(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:PATH)
          op: Equal
          rhs: {(/sbin) (Lit_Other ':') (/usr/sbin) (Lit_Other ':') (/bin) (Lit_Other ':') (/usr/bin)}
          spids: [31]
        )
      ]
      spids: [31]
    )
    (C {(.)} {(/lib/lsb/init-functions)})
    (FuncDef
      name: report_unkillable
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DPipe]
              children: [
                (C {(Lit_Other '[')} {(-x)} {(/usr/share/apport/unkillable_shutdown)} {(Lit_Other ']')})
                (ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (AndOr
                          ops: [Op_DPipe]
                          children: [
                            (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(/etc/default/apport)} 
                              {(Lit_Other ']')}
                            )
                            (Pipeline
                              children: [
                                (C {(grep)} {(-q)} {(SQ <'^enabled[[:space:]]*=[[:space:]]*1'>)} 
                                  {(/etc/default/apport)}
                                )
                              ]
                              negated: T
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Return return>)]
                  spids: [16777215 96]
                )
              ]
              spids: [16777215 102]
            )
            (C {(/usr/share/apport/unkillable_shutdown)} {($ VSub_Name '$OMITPIDS')})
          ]
          spids: [53]
        )
      spids: [49 52]
    )
    (FuncDef
      name: upstart_killed_jobs
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [(C {(initctl)} {(list)}) (C {(grep)} {(SQ <stop/killed>)})]
              negated: F
            )
          ]
          spids: [117]
        )
      spids: [112 116]
    )
    (FuncDef
      name: upstart_jobs
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(initctl)} {(list)})
                (C {(grep)} {(-E)} {(SQ <'(start/|stop/killed)'>)})
                (C {(sed)} {(-n)} {(-e)} {(DQ ('/process [0-9]/s/.*process //p'))})
              ]
              negated: F
            )
          ]
          spids: [140]
        )
      spids: [135 139]
    )
    (FuncDef
      name: do_stop
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:OMITPIDS)
                  op: Equal
                  rhs: {(EmptyPart)}
                  spids: [180]
                )
              ]
              spids: [180]
            )
            (ForEach
              iter_name: omitfile
              iter_words: [{(/run/sendsigs.omit)}]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(-e)} {($ VSub_Name '$omitfile')} {(Lit_Other ']')})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (ForEach
                              iter_name: pid
                              iter_words: [
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [(C {(cat)} {($ VSub_Name '$omitfile')})]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [216 220]
                                  )
                                }
                              ]
                              do_arg_iter: F
                              body: 
                                (DoGroup
                                  children: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:OMITPIDS)
                                          op: Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name OMITPIDS>
                                                  suffix_op: 
                                                    (StringUnary
                                                      op_id: VTest_ColonPlus
                                                      arg_word: {($ VSub_Name '$OMITPIDS') (' ')}
                                                    )
                                                  spids: [228 233]
                                                ) ('-o ') ($ VSub_Name '$pid')
                                              )
                                            }
                                          spids: [226]
                                        )
                                      ]
                                      spids: [226]
                                    )
                                  ]
                                  spids: [223 239]
                                )
                              spids: [215 221]
                            )
                          ]
                          spids: [16777215 207]
                        )
                      ]
                      spids: [16777215 242]
                    )
                  ]
                  spids: [193 245]
                )
              spids: [189 191]
            )
            (ForEach
              iter_name: omitdir
              iter_words: [{(/run/sendsigs.omit.d)}]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(-d)} {(DQ (${ VSub_Name omitdir))} 
                                  {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (ForEach
                              iter_name: pidfile
                              iter_words: [{(DQ (${ VSub_Name omitdir) (/)) (Lit_Other '*')}]
                              do_arg_iter: F
                              body: 
                                (DoGroup
                                  children: [
                                    (AndOr
                                      ops: [Op_DPipe]
                                      children: [
                                        (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_Name '$pidfile'))} 
                                          {(Lit_Other ']')}
                                        )
                                        (ControlFlow
                                          token: <ControlFlow_Continue continue>
                                        )
                                      ]
                                    )
                                    (ForEach
                                      iter_name: pid
                                      iter_words: [
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [(C {(cat)} {($ VSub_Name '$pidfile')})]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [330 334]
                                          )
                                        }
                                      ]
                                      do_arg_iter: F
                                      body: 
                                        (DoGroup
                                          children: [
                                            (Assignment
                                              keyword: Assign_None
                                              pairs: [
                                                (assign_pair
                                                  lhs: (LhsName name:OMITPIDS)
                                                  op: Equal
                                                  rhs: 
                                                    {
                                                      (DQ 
                                                        (BracedVarSub
                                                          token: <VSub_Name OMITPIDS>
                                                          suffix_op: 
                                                            (StringUnary
                                                              op_id: VTest_ColonPlus
                                                              arg_word: 
                                                                {($ VSub_Name '$OMITPIDS') (' ')}
                                                            )
                                                          spids: [342 347]
                                                        ) ('-o ') ($ VSub_Name '$pid')
                                                      )
                                                    }
                                                  spids: [340]
                                                )
                                              ]
                                              spids: [340]
                                            )
                                          ]
                                          spids: [337 353]
                                        )
                                      spids: [329 335]
                                    )
                                  ]
                                  spids: [306 356]
                                )
                              spids: [296 304]
                            )
                          ]
                          spids: [16777215 288]
                        )
                      ]
                      spids: [16777215 359]
                    )
                  ]
                  spids: [270 362]
                )
              spids: [266 268]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-x)} {(/sbin/initctl)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (ForEach
                      iter_name: pid
                      iter_words: [
                        {
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(upstart_jobs)})])
                            left_token: <Left_CommandSub '$('>
                            spids: [398 400]
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (DoGroup
                          children: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:OMITPIDS)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name OMITPIDS>
                                          suffix_op: 
                                            (StringUnary
                                              op_id: VTest_ColonPlus
                                              arg_word: {($ VSub_Name '$OMITPIDS') (' ')}
                                            )
                                          spids: [408 413]
                                        ) ('-o ') ($ VSub_Name '$pid')
                                      )
                                    }
                                  spids: [406]
                                )
                              ]
                              spids: [406]
                            )
                          ]
                          spids: [403 419]
                        )
                      spids: [397 401]
                    )
                  ]
                  spids: [16777215 389]
                )
              ]
              spids: [16777215 422]
            )
            (C {(sync)})
            (C {(log_action_begin_msg)} {(DQ ('Asking all remaining processes to terminate'))})
            (C {(killall5)} {(-15)} {($ VSub_Name '$OMITPIDS')})
            (C {(log_action_end_msg)} {(0)})
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:alldead) op:Equal rhs:{(DQ )} spids:[476])]
              spids: [476]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:OMITPIDS0)
                  op: Equal
                  rhs: {(DQ ($ VSub_Name '$OMITPIDS'))}
                  spids: [481]
                )
              ]
              spids: [481]
            )
            (ForEach
              iter_name: seq
              iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)} {(10)}]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:OMITPIDS)
                          op: Equal
                          rhs: {(DQ ($ VSub_Name '$OMITPIDS0'))}
                          spids: [517]
                        )
                      ]
                      spids: [517]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(Lit_Other '[')} {(-x)} {(/sbin/initctl)} {(Lit_Other ']')})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (ForEach
                              iter_name: pid
                              iter_words: [
                                {
                                  (CommandSubPart
                                    command_list: (CommandList children:[(C {(upstart_jobs)})])
                                    left_token: <Left_CommandSub '$('>
                                    spids: [580 582]
                                  )
                                }
                              ]
                              do_arg_iter: F
                              body: 
                                (DoGroup
                                  children: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:OMITPIDS)
                                          op: Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name OMITPIDS>
                                                  suffix_op: 
                                                    (StringUnary
                                                      op_id: VTest_ColonPlus
                                                      arg_word: {($ VSub_Name '$OMITPIDS') (' ')}
                                                    )
                                                  spids: [590 595]
                                                ) ('-o ') ($ VSub_Name '$pid')
                                              )
                                            }
                                          spids: [588]
                                        )
                                      ]
                                      spids: [588]
                                    )
                                  ]
                                  spids: [585 601]
                                )
                              spids: [579 583]
                            )
                          ]
                          spids: [16777215 571]
                        )
                      ]
                      spids: [16777215 604]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(killall5)} {(-18)} {($ VSub_Name '$OMITPIDS')})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(C {(Lit_Other ':')})]
                          spids: [16777215 617]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:alldead)
                              op: Equal
                              rhs: {(1)}
                              spids: [626]
                            )
                          ]
                          spids: [626]
                        )
                        (ControlFlow token:<ControlFlow_Break break>)
                      ]
                      spids: [623 633]
                    )
                    (C {(sleep)} {(1)})
                  ]
                  spids: [514 642]
                )
              spids: [492 512]
            )
            (While
              cond: [
                (Sentence
                  child: 
                    (C {(Lit_Other '[')} {(-n)} 
                      {
                        (DQ 
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(upstart_killed_jobs)})])
                            left_token: <Left_CommandSub '$('>
                            spids: [685 687]
                          )
                        )
                      } {(Lit_Other ']')}
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:seq)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Plus
                                    left: (ArithWord w:{($ VSub_Name '$seq')})
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [698 703]
                              )
                            }
                          spids: [697]
                        )
                      ]
                      spids: [697]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {($ VSub_Name '$seq')} {(-ge)} {(300)} 
                                  {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(ControlFlow token:<ControlFlow_Break break>)]
                          spids: [16777215 720]
                        )
                      ]
                      spids: [16777215 726]
                    )
                    (C {(sleep)} {(1)})
                  ]
                  spids: [694 736]
                )
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$alldead'))} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(log_action_begin_msg)} {(DQ ('Killing all remaining processes'))})
                    (C {(killall5)} {(-9)} {($ VSub_Name '$OMITPIDS')})
                    (C {(log_action_end_msg)} {(1)})
                  ]
                  spids: [16777215 754]
                )
              ]
              else_action: [
                (C {(log_action_begin_msg)} 
                  {(DQ ('All processes ended within ') ($ VSub_Name '$seq') (' seconds'))}
                )
                (C {(log_action_end_msg)} {(0)})
              ]
              spids: [783 800]
            )
          ]
          spids: [177]
        )
      spids: [172 176]
    )
    (Case
      to_match: {(DQ ($ VSub_Number '$1'))}
      arms: [
        (case_arm pat_list:[{(start)} {(status)}] spids:[814 817 824 16777215])
        (case_arm
          pat_list: [{(restart)} {(reload)} {(force-reload)}]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ("Error: argument '") ($ VSub_Number '$1') ("' not supported"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[843])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)})
          ]
          spids: [827 832 852 16777215]
        )
        (case_arm pat_list:[{(stop)}] action:[(C {(do_stop)})] spids:[855 856 862 16777215])
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ('Usage: ') ($ VSub_Number '$0') (' start|stop'))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[877])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)})
          ]
          spids: [865 866 886 16777215]
        )
      ]
      spids: [805 811 888]
    )
    (C {(Lit_Other ':')})
  ]
)