(command.CommandList
  children: [
    (C {<set>} {<-e>})
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<echo>} {(DQ <'Usage: -o file'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<Id.Lit_Equals '='>} {<0>} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<usage>})
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>})
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'flag='> name:flag)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [60]
                )
              ]
              redirects: []
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName flag))}
              arms: [
                (case_arm
                  pat_list: [{<-o>}]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-eq>} {<1>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (C {<usage>})
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'out='> name:out)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_Number 2))}
                          spids: [94]
                        )
                      ]
                      redirects: []
                    )
                    (C {<mkdir>} {<-p>} 
                      {
                        (DQ 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<dirname>} {($ Id.VSub_Number 2)})
                            right: <Id.Eof_RParen _>
                          )
                        )
                      }
                    )
                    (C {<shift>})
                  ]
                  spids: [75 76 116 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (C {<echo>} {(DQ <'Unknown option '> ($ Id.VSub_Number 1))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [119 120 -1 136]
                )
              ]
              redirects: []
            )
            (C {<shift>})
          ]
        )
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName out))} {<Id.Lit_RBracket ']'>})
        (C {<usage>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'package='> name:package)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<basename>} {(DQ ($ Id.VSub_DollarName out))})
                right: <Id.Eof_RParen _>
              )
            }
          spids: [159]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dir='> name:dir)
          op: assign_op.Equal
          rhs: {(DQ <'/src'>)}
          spids: [169]
        )
      ]
      redirects: []
    )
    (C {<tar>} {<xf>} {<->} {<-C>} {($ Id.VSub_DollarName dir)})
    (command.Subshell
      child: 
        (command.CommandList
          children: [
            (C {<cd>} {($ Id.VSub_DollarName dir)})
            (C {<opam>} {<config>} {<exec>} {<-->} {<mirage>} {<configure>} {<-o>} 
              {($ Id.VSub_DollarName out)} {<-t>} {<unix>}
            )
            (C {<opam>} {<config>} {<exec>} {<-->} {<make>} {<depend>})
            (C {<opam>} {<config>} {<exec>} {<-->} {<make>})
            (C {<mv>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<readlink>} {($ Id.VSub_DollarName out)})
                  right: <Id.Eof_RParen _>
                )
              } {($ Id.VSub_DollarName out)}
            )
          ]
        )
      redirects: [
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/src/logs'>})
        (redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<cd>} {($ Id.VSub_DollarName dir)})
        (C {<tar>} {<-cf>} {<->} {($ Id.VSub_DollarName out)})
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)