(command.CommandList
  children: [
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:tempfile)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<mktemp>} {<tmp.XXXXXX>})
                  )
                }
              spids: [100]
            )
          ]
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (C {<trap>} {(DQ <'rm -f '> ($ Id.VSub_DollarName '$tempfile'))} {<EXIT>} {<INT>} {<TERM>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:include_metadata)
          op: assign_op.Equal
          rhs: {<true>}
          spids: [125]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [(command.Sentence child:(C {<getopts>} {<r>} {<opt>}) terminator:<Id.Op_Semi _>)]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$opt'))}
              arms: [
                (case_arm
                  pat_list: [{<r>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:include_metadata)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [153]
                        )
                      ]
                    )
                  ]
                  spids: [149 150 156 -1]
                )
              ]
            )
          ]
        )
    )
    (C {<shift>} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: <Id.Lit_ArithVarLike OPTIND>
              right: {<Id.Lit_Digits 1>}
            )
        )
      }
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:LC_ALL)
                  op: assign_op.Equal
                  rhs: {<C>}
                  spids: [175]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<export>} {<LC_ALL>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:u)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name USER>
                suffix_op: (suffix_op.Unary tok:<Id.VTest_Hyphen -> arg_word:{<root>})
              )
            }
          spids: [183]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:h)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name HOSTNAME>
                suffix_op: 
                  (suffix_op.Unary
                    tok: <Id.VTest_Hyphen ->
                    arg_word: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<hostname>}))}
                  )
              )
            }
          spids: [190]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:t)
          op: assign_op.Equal
          rhs: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<date>}))}
          spids: [201]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:r)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: 
                  (C {<awk>} {<-F> <Id.Lit_Colon ':'>} {(SQ <' /^[0-9]\\.[0-9]+:/ { print $1; exit }'>)} 
                    {($ Id.VSub_Number '$1')}
                  )
              )
            }
          spids: [211]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bootprog_info)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'FreeBSD/'> (${ Id.VSub_Number 3) <' '> (${ Id.VSub_Number 2) <', Revision '> 
                (${ Id.VSub_Name r) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'>) <n>
              )
            }
          spids: [230]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name include_metadata))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:bootprog_info)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$bootprog_info') <'('> (${ Id.VSub_Name t) <' '> 
                        (${ Id.VSub_Name u) <'@'> (${ Id.VSub_Name h) <')'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'>) <n>
                      )
                    }
                  spids: [266]
                )
              ]
            )
          ]
          spids: [248 263]
        )
      ]
    )
    (command.Simple
      words: [
        {<echo>}
        {
          (DQ <'char bootprog_info[] = '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
            ($ Id.VSub_DollarName '$bootprog_info') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <';'>
          )
        }
      ]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {($ Id.VSub_DollarName '$tempfile')}
        )
      ]
      do_fork: T
    )
    (command.Simple
      words: [
        {<echo>}
        {
          (DQ <'unsigned bootprog_rev = '> 
            (braced_var_sub
              token: <Id.VSub_Name r>
              suffix_op: 
                (suffix_op.Unary
                  tok: <Id.VOp1_DPercent '%%'>
                  arg_word: {<.> <Id.Lit_Other '*'>}
                )
            ) 
            (braced_var_sub
              token: <Id.VSub_Name r>
              suffix_op: (suffix_op.Unary tok:<Id.VOp1_DPound '##'> arg_word:{<Id.Lit_Other '*'> <.>})
            ) <';'>
          )
        }
      ]
      redirects: [
        (redir
          op: <Id.Redir_DGreat '>>'>
          loc: (redir_loc.Fd fd:1)
          arg: {($ Id.VSub_DollarName '$tempfile')}
        )
      ]
      do_fork: T
    )
    (C {<mv>} {($ Id.VSub_DollarName '$tempfile')} {<vers.c>})
  ]
)