(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:append)
          op: assign_op.Equal
          rhs: {(DQ <NO>)}
          spids: [82]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:delete)
          op: assign_op.Equal
          rhs: {(DQ <NO>)}
          spids: [87]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:kenv)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [92]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:force)
          op: assign_op.Equal
          rhs: {(DQ <NO>)}
          spids: [94]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:nextboot_file)
          op: assign_op.Equal
          rhs: {(DQ <'/boot/nextboot.conf'>)}
          spids: [99]
        )
      ]
    )
    (command.ShFunction
      name: add_kenv
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.KW_Var var>} {<value>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:var)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [120]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:value)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 2>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VOp1_Percent '%'>
                            arg_word: 
                              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                                <Id.Lit_Other '*'>
                              }
                          )
                      )
                    }
                  spids: [128]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:value)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name value>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VOp1_Pound '#'>
                            arg_word: 
                              {<Id.Lit_Other '*'> 
                                (word_part.EscapedLiteral
                                  token: <Id.Lit_EscapedChar '\\"'>
                                )
                              }
                          )
                      )
                    }
                  spids: [137]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name kenv))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:kenv)
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name kenv) <'\n'>)}
                          spids: [165]
                        )
                      ]
                    )
                  ]
                  spids: [147 162]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:kenv)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ (${ Id.VSub_Name kenv) (${ Id.VSub_Name var) <'='> 
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\"'>
                        ) (${ Id.VSub_Name value) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                      )
                    }
                  spids: [177]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: display_usage
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLessDash '<<-'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_span_id: 211
                      stdin_parts: [
                        <'Usage: nextboot [-af] [-e variable=value] [-k kernel] [-o options]\n'>
                        <'       nextboot -D\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: (C {<getopts>} {(DQ <'aDe:fk:o:'>)} {<argument>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ (${ Id.VSub_Name argument))}
              arms: [
                (case_arm
                  pat_list: [{<a>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:append)
                          op: assign_op.Equal
                          rhs: {(DQ <YES>)}
                          spids: [245]
                        )
                      ]
                    )
                  ]
                  spids: [241 242 251 -1]
                )
                (case_arm
                  pat_list: [{<D>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:delete)
                          op: assign_op.Equal
                          rhs: {(DQ <YES>)}
                          spids: [258]
                        )
                      ]
                    )
                  ]
                  spids: [254 255 264 -1]
                )
                (case_arm
                  pat_list: [{<e>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:var)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name OPTARG>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_DPercent '%%'>
                                    arg_word: {<'='> <Id.Lit_Other '*'>}
                                  )
                              )
                            }
                          spids: [271]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:value)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name OPTARG>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_Pound '#'>
                                    arg_word: {<Id.Lit_Other '*'> <'='>}
                                  )
                              )
                            }
                          spids: [280]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-z>} 
                                      {(DQ ($ Id.VSub_DollarName '$var'))} {<-o>} {<-z>} {(DQ ($ Id.VSub_DollarName '$value'))} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<display_usage>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [289 310]
                        )
                      ]
                    )
                    (C {<add_kenv>} {(DQ ($ Id.VSub_DollarName '$var'))} 
                      {(DQ ($ Id.VSub_DollarName '$value'))}
                    )
                  ]
                  spids: [267 268 335 -1]
                )
                (case_arm
                  pat_list: [{<f>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:force)
                          op: assign_op.Equal
                          rhs: {(DQ <YES>)}
                          spids: [342]
                        )
                      ]
                    )
                  ]
                  spids: [338 339 348 -1]
                )
                (case_arm
                  pat_list: [{<k>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:kernel)
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name OPTARG))}
                          spids: [355]
                        )
                      ]
                    )
                    (C {<add_kenv>} {<kernel>} {(DQ ($ Id.VSub_DollarName '$kernel'))})
                  ]
                  spids: [351 352 372 -1]
                )
                (case_arm
                  pat_list: [{<o>}]
                  action: [(C {<add_kenv>} {<kernel_options>} {(DQ (${ Id.VSub_Name OPTARG))})]
                  spids: [375 376 390 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (C {<display_usage>})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [393 394 405 -1]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name delete)} {<Id.Lit_Equals '='>} 
                      {(DQ <YES>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<rm>} {<-f>} {(${ Id.VSub_Name nextboot_file)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
          spids: [413 430]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name kenv))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<display_usage>})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [449 464]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name kernel))} {<-a>} 
                      {(${ Id.VSub_Name force)} {<Id.Lit_Equals '='>} {(DQ <NO>)} {<-a>} {<Id.KW_Bang '!'>} {<-d>} {<'/boot/'> (${ Id.VSub_Name kernel)} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} 
              {
                (DQ <'Error: /boot/'> (${ Id.VSub_Name kernel) <' doesn\'t exist. Use -f to override.'>)
              }
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [477 515]
        )
      ]
    )
    (command.Pipeline
      children: [
        (command.Simple
          words: [{<df>} {<-Tn>} {(DQ <'/boot/'>)}]
          redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
          do_fork: T
        )
        (command.WhileUntil
          keyword: <Id.KW_While while>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (C {<read>} {<_fs>} {<_type>} {<_other>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          body: 
            (command.DoGroup
              children: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {<Id.Lit_LBracket '['>} {(DQ <zfs>)} {<Id.Lit_Equals '='>} 
                      {(DQ (${ Id.VSub_Name _type))} {<Id.Lit_RBracket ']'>}
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                )
                (command.Simple
                  words: [{<cat>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_GreatAnd '1>&'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<2>}
                    )
                    (redir
                      op: <Id.Redir_DLessDash '<<-'>
                      loc: (redir_loc.Fd fd:0)
                      arg: 
                        (redir_param.HereDoc
                          here_begin: {<EOF>}
                          here_end_span_id: 596
                          stdin_parts: [
                            <'WARNING: loader(8) has only R/O support for ZFS\n'>
                            <'nextboot.conf will NOT be reset in case of kernel boot failure\n'>
                          ]
                        )
                    )
                  ]
                  do_fork: T
                )
              ]
            )
        )
      ]
      negated: F
    )
    (C {<set>} {<-e>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:nextboot_tmp)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (C {<mktemp>} 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<dirname>} {(${ Id.VSub_Name nextboot_file)})
                      ) <'/nextboot.XXXXXX'>
                    }
                  )
              )
            }
          spids: [605]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name append)} {<Id.Lit_Equals '='>} 
                      {(DQ <YES>)} {<-a>} {<-f>} {(${ Id.VSub_Name nextboot_file)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<cp>} {<-f>} {(${ Id.VSub_Name nextboot_file)} {(${ Id.VSub_Name nextboot_tmp)})]
          spids: [620 645]
        )
      ]
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir
          op: <Id.Redir_DGreat '>>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(${ Id.VSub_Name nextboot_tmp)}
        )
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_span_id: 683
              stdin_parts: [
                <'nextboot_enable='>
                <Id.Right_DoubleQuote '"'>
                <YES>
                <Id.Right_DoubleQuote '"'>
                <'\n'>
                ($ Id.VSub_DollarName '$kenv')
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<fsync>} {(${ Id.VSub_Name nextboot_tmp)})
    (C {<mv>} {(${ Id.VSub_Name nextboot_tmp)} {(${ Id.VSub_Name nextboot_file)})
  ]
)