(command.CommandList
  children: [
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:tempfile)
              op: Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Left_DollarParen '$('>
                    command_list: (command.CommandList children:[(C {(mktemp)} {(tmp.XXXXXX)})])
                  )
                }
            )
          ]
        )
        (command.ControlFlow token:<ControlFlow_Exit exit>)
      ]
    )
    (C {(trap)} {(DQ ('rm -f ') ($ VSub_DollarName '$tempfile'))} {(EXIT)} {(INT)} {(TERM)})
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:include_metadata) op:Equal rhs:{(true)})]
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [(command.Sentence child:(C {(getopts)} {(r)} {(opt)}) terminator:<Op_Semi ';'>)]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ VSub_DollarName '$opt'))}
              arms: [
                (case_arm
                  pat_list: [{(r)}]
                  action: [
                    (command.ShAssignment
                      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:include_metadata) op:Equal rhs:(word.Empty))]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (C {(shift)} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Arith_Minus
              left: (arith_expr.VarRef token:<Lit_ArithVarLike OPTIND>)
              right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
            )
        )
      }
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:LC_ALL) op:Equal rhs:{(C)})]
            )
          terminator: <Op_Semi ';'>
        )
        (C {(export)} {(LC_ALL)})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:u)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name USER>
                suffix_op: (suffix_op.Unary op_id:VTest_Hyphen arg_word:{(root)})
              )
            }
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:h)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name HOSTNAME>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_Hyphen
                    arg_word: 
                      {
                        (command_sub
                          left_token: <Left_Backtick '`'>
                          command_list: (command.CommandList children:[(C {(hostname)})])
                        )
                      }
                  )
              )
            }
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:t)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_Backtick '`'>
                command_list: (command.CommandList children:[(C {(date)})])
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:r)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_Backtick '`'>
                command_list: 
                  (command.CommandList
                    children: [
                      (C {(awk)} {(-F) (Lit_Other ':')} {(SQ <' /^[0-9]\\.[0-9]+:/ { print $1; exit }'>)} 
                        {($ VSub_Number '$1')}
                      )
                    ]
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bootprog_info)
          op: Equal
          rhs: 
            {
              (DQ (FreeBSD/) (${ VSub_Number 3) (' ') (${ VSub_Number 2) (', Revision ') (${ VSub_Name r) 
                (word_part.EscapedLiteral token:<Lit_EscapedChar '\\\\'>) (n)
              )
            }
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(-n)} {(DQ (${ VSub_Name include_metadata))} 
                  {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:bootprog_info)
                  op: Equal
                  rhs: 
                    {
                      (DQ ($ VSub_DollarName '$bootprog_info') ('(') (${ VSub_Name t) (' ') 
                        (${ VSub_Name u) ('@') (${ VSub_Name h) (')') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\\\'>) (n)
                      )
                    }
                )
              ]
            )
          ]
        )
      ]
    )
    (command.Simple
      words: [
        {(echo)}
        {
          (DQ ('char bootprog_info[] = ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) 
            ($ VSub_DollarName '$bootprog_info') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (';')
          )
        }
      ]
      redirects: [
        (redir.Redir
          op: <Redir_Great '>'>
          fd: 16777215
          arg_word: {($ VSub_DollarName '$tempfile')}
        )
      ]
    )
    (command.Simple
      words: [
        {(echo)}
        {
          (DQ ('unsigned bootprog_rev = ') 
            (braced_var_sub
              token: <VSub_Name r>
              suffix_op: (suffix_op.Unary op_id:VOp1_DPercent arg_word:{('.*')})
            ) (braced_var_sub token:<VSub_Name r> suffix_op:(suffix_op.Unary op_id:VOp1_DPound arg_word:{('*.')})) 
            (';')
          )
        }
      ]
      redirects: [
        (redir.Redir
          op: <Redir_DGreat '>>'>
          fd: 16777215
          arg_word: {($ VSub_DollarName '$tempfile')}
        )
      ]
    )
    (C {(mv)} {($ VSub_DollarName '$tempfile')} {(vers.c)})
  ]
)