(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PATH)
          op: assign_op.Equal
          rhs: 
            {(/sbin) (Id.Lit_Other ':') (/usr/sbin) (Id.Lit_Other ':') (/bin) (Id.Lit_Other ':') 
              (/usr/bin)
            }
          spids: [31]
        )
      ]
    )
    (C {(.)} {(/lib/lsb/init-functions)})
    (command.ShFunction
      name: report_unkillable
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(Id.Lit_LBracket '[')} {(-x)} {(/usr/share/apport/unkillable_shutdown)} 
                  {(Id.Lit_RBracket ']')}
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:66)
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-e)} {(/etc/default/apport)} 
                              {(Id.Lit_RBracket ']')}
                            )
                            (command.Pipeline
                              children: [
                                (C {(grep)} {(-q)} 
                                  {
                                    (SQ 
                                      (Token
                                        id: Id.Lit_Chars
                                        val: '^enabled[[:space:]]*=[[:space:]]*1'
                                        span_id: 90
                                      )
                                    )
                                  } {(/etc/default/apport)}
                                )
                              ]
                              negated: T
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:94)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:99)
                    )
                  ]
                  spids: [69 96]
                )
              ]
            )
            (C {(/usr/share/apport/unkillable_shutdown)} {($ Id.VSub_DollarName '$OMITPIDS')})
          ]
        )
    )
    (command.ShFunction
      name: upstart_killed_jobs
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(initctl)} {(list)})
                (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:stop/killed span_id:129))})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: upstart_jobs
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(initctl)} {(list)})
                (C {(grep)} {(-E)} {(SQ (Token id:Id.Lit_Chars val:'(start/|stop/killed)' span_id:154))})
                (C {(sed)} {(-n)} {(-e)} {(DQ ('/process [0-9]/s/.*process //p'))})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: do_stop
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OMITPIDS)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [180]
                )
              ]
            )
            (command.ForEach
              iter_name: omitfile
              iter_words: [{(/run/sendsigs.omit)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-e)} {($ Id.VSub_DollarName '$omitfile')} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:205)
                            )
                          ]
                          action: [
                            (command.ForEach
                              iter_name: pid
                              iter_words: [
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:216)
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {(cat)} {($ Id.VSub_DollarName '$omitfile')})]
                                      )
                                  )
                                }
                              ]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:OMITPIDS)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  token: 
                                                    (Token
                                                      id: Id.VSub_Name
                                                      val: OMITPIDS
                                                      span_id: 229
                                                    )
                                                  suffix_op: 
                                                    (suffix_op.Unary
                                                      op_id: Id.VTest_ColonPlus
                                                      arg_word: 
                                                        {($ Id.VSub_DollarName '$OMITPIDS') (' ')}
                                                    )
                                                ) ('-o ') ($ Id.VSub_DollarName '$pid')
                                              )
                                            }
                                          spids: [226]
                                        )
                                      ]
                                    )
                                  ]
                                )
                            )
                          ]
                          spids: [196 207]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ForEach
              iter_name: omitdir
              iter_words: [{(/run/sendsigs.omit.d)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-d)} {(DQ (${ Id.VSub_Name omitdir))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:286)
                            )
                          ]
                          action: [
                            (command.ForEach
                              iter_name: pidfile
                              iter_words: [{(DQ (${ Id.VSub_Name omitdir) (/)) (Id.Lit_Star '*')}]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.AndOr
                                      ops: [Id.Op_DPipe]
                                      children: [
                                        (C {(Id.Lit_LBracket '[')} {(-f)} 
                                          {(DQ ($ Id.VSub_DollarName '$pidfile'))} {(Id.Lit_RBracket ']')}
                                        )
                                        (command.ControlFlow
                                          token: 
                                            (Token
                                              id: Id.ControlFlow_Continue
                                              val: continue
                                              span_id: 321
                                            )
                                        )
                                      ]
                                    )
                                    (command.ForEach
                                      iter_name: pid
                                      iter_words: [
                                        {
                                          (command_sub
                                            left_token: 
                                              (Token
                                                id: Id.Left_DollarParen
                                                val: '$('
                                                span_id: 330
                                              )
                                            command_list: 
                                              (command.CommandList
                                                children: [
                                                  (C {(cat)} {($ Id.VSub_DollarName '$pidfile')})
                                                ]
                                              )
                                          )
                                        }
                                      ]
                                      do_arg_iter: F
                                      body: 
                                        (command.DoGroup
                                          children: [
                                            (command.ShAssignment
                                              pairs: [
                                                (assign_pair
                                                  lhs: (sh_lhs_expr.Name name:OMITPIDS)
                                                  op: assign_op.Equal
                                                  rhs: 
                                                    {
                                                      (DQ 
                                                        (braced_var_sub
                                                          token: 
                                                            (Token
                                                              id: Id.VSub_Name
                                                              val: OMITPIDS
                                                              span_id: 343
                                                            )
                                                          suffix_op: 
                                                            (suffix_op.Unary
                                                              op_id: Id.VTest_ColonPlus
                                                              arg_word: 
                                                                {($ Id.VSub_DollarName '$OMITPIDS') 
                                                                  (' ')
                                                                }
                                                            )
                                                        ) ('-o ') ($ Id.VSub_DollarName '$pid')
                                                      )
                                                    }
                                                  spids: [340]
                                                )
                                              ]
                                            )
                                          ]
                                        )
                                    )
                                  ]
                                )
                            )
                          ]
                          spids: [273 288]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-x)} {(/sbin/initctl)} {(Id.Lit_RBracket ']')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:387)
                    )
                  ]
                  action: [
                    (command.ForEach
                      iter_name: pid
                      iter_words: [
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:398)
                            command_list: (command.CommandList children:[(C {(upstart_jobs)})])
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:OMITPIDS)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (braced_var_sub
                                          token: (Token id:Id.VSub_Name val:OMITPIDS span_id:409)
                                          suffix_op: 
                                            (suffix_op.Unary
                                              op_id: Id.VTest_ColonPlus
                                              arg_word: {($ Id.VSub_DollarName '$OMITPIDS') (' ')}
                                            )
                                        ) ('-o ') ($ Id.VSub_DollarName '$pid')
                                      )
                                    }
                                  spids: [406]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  spids: [378 389]
                )
              ]
            )
            (C {(sync)})
            (C {(log_action_begin_msg)} {(DQ ('Asking all remaining processes to terminate'))})
            (C {(killall5)} {(-15)} {($ Id.VSub_DollarName '$OMITPIDS')})
            (C {(log_action_end_msg)} {(0)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:alldead)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [476]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OMITPIDS0)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$OMITPIDS'))}
                  spids: [481]
                )
              ]
            )
            (command.ForEach
              iter_name: seq
              iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)} {(10)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:OMITPIDS)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$OMITPIDS0'))}
                          spids: [517]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-x)} {(/sbin/initctl)} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:569)
                            )
                          ]
                          action: [
                            (command.ForEach
                              iter_name: pid
                              iter_words: [
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:580)
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {(upstart_jobs)})]
                                      )
                                  )
                                }
                              ]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:OMITPIDS)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  token: 
                                                    (Token
                                                      id: Id.VSub_Name
                                                      val: OMITPIDS
                                                      span_id: 591
                                                    )
                                                  suffix_op: 
                                                    (suffix_op.Unary
                                                      op_id: Id.VTest_ColonPlus
                                                      arg_word: 
                                                        {($ Id.VSub_DollarName '$OMITPIDS') (' ')}
                                                    )
                                                ) ('-o ') ($ Id.VSub_DollarName '$pid')
                                              )
                                            }
                                          spids: [588]
                                        )
                                      ]
                                    )
                                  ]
                                )
                            )
                          ]
                          spids: [560 571]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(killall5)} {(-18)} {($ Id.VSub_DollarName '$OMITPIDS')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:615)
                            )
                          ]
                          action: [(C {(Id.Lit_Other ':')})]
                          spids: [607 617]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:alldead)
                              op: assign_op.Equal
                              rhs: {(1)}
                              spids: [626]
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Break val:break span_id:630)
                        )
                      ]
                    )
                    (C {(sleep)} {(1)})
                  ]
                )
            )
            (command.WhileUntil
              keyword: (Token id:Id.KW_While val:while span_id:678)
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(-n)} 
                      {
                        (DQ 
                          (command_sub
                            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:685)
                            command_list: 
                              (command.CommandList
                                children: [(C {(upstart_killed_jobs)})]
                              )
                          )
                        )
                      } {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:692)
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:seq)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$seq')})
                                    right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                  )
                              )
                            }
                          spids: [697]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$seq')} {(-ge)} 
                                  {(300)} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:718)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Break val:break span_id:723)
                            )
                          ]
                          spids: [706 720]
                        )
                      ]
                    )
                    (C {(sleep)} {(1)})
                  ]
                )
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$alldead'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:752)
                    )
                  ]
                  action: [
                    (C {(log_action_begin_msg)} {(DQ ('Killing all remaining processes'))})
                    (C {(killall5)} {(-9)} {($ Id.VSub_DollarName '$OMITPIDS')})
                    (C {(log_action_end_msg)} {(1)})
                  ]
                  spids: [740 754]
                )
              ]
              else_action: [
                (C {(log_action_begin_msg)} 
                  {(DQ ('All processes ended within ') ($ Id.VSub_DollarName '$seq') (' seconds'))}
                )
                (C {(log_action_end_msg)} {(0)})
              ]
            )
          ]
        )
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_Number '$1'))}
      arms: [
        (case_arm pat_list:[{(start)} {(status)}] spids:[814 817 824 -1])
        (case_arm
          pat_list: [{(restart)} {(reload)} {(force-reload)}]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ("Error: argument '") ($ Id.VSub_Number '$1') ("' not supported"))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:843)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:847)
              arg_word: {(3)}
            )
          ]
          spids: [827 832 852 -1]
        )
        (case_arm pat_list:[{(stop)}] action:[(C {(do_stop)})] spids:[855 856 862 -1])
        (case_arm
          pat_list: [{(Id.Lit_Star '*')}]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('Usage: ') ($ Id.VSub_Number '$0') (' start|stop'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:877)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:881)
              arg_word: {(3)}
            )
          ]
          spids: [865 866 886 -1]
        )
      ]
    )
    (C {(Id.Lit_Other ':')})
  ]
)