(command.CommandList
  children: [
    (command.ShFunction
      name: clean_up
      body: 
        (BraceGroup
          children: [
            (C {<rm>} {<-f>} {($ Id.VSub_DollarName '$TMP_FILE')})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
        )
    )
    (C {<trap>} {<clean_up>} {<HUP>} {<INT>} {<TERM>})
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {(DQ <'Usage: '> ($ Id.VSub_Number '$0') <' [OPTIONS] [CONFIG [...]]'>)})
            (C {<echo>} {(DQ <'  -h    display this help text'>)})
            (C {<echo>} {(DQ <'  -m    only merge the fragments, do not execute the make command'>)})
            (C {<echo>} {(DQ <'  -n    use allnoconfig instead of alldefconfig'>)})
            (C {<echo>} {(DQ <'  -r    list redundant entries when merging fragments'>)})
            (C {<echo>} 
              {
                (DQ <'  -O    dir to put generated output files.  Consider setting '> 
                  (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'KCONFIG_CONFIG instead.'>
                )
              }
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:RUNMAKE)
          op: assign_op.Equal
          rhs: {<true>}
          spids: [148]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ALLTARGET)
          op: assign_op.Equal
          rhs: {<alldefconfig>}
          spids: [151]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WARNREDUN)
          op: assign_op.Equal
          rhs: {<false>}
          spids: [154]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OUTPUT)
          op: assign_op.Equal
          rhs: {<.>}
          spids: [157]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [(command.Sentence child:(C {<true>}) terminator:<Id.Op_Semi _>)]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_Number '$1')}
              arms: [
                (case_arm
                  pat_list: [{(DQ <-n>)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ALLTARGET)
                          op: assign_op.Equal
                          rhs: {<allnoconfig>}
                          spids: [182]
                        )
                      ]
                    )
                    (C {<shift>})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [176 179 192 -1]
                )
                (case_arm
                  pat_list: [{(DQ <-m>)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:RUNMAKE)
                          op: assign_op.Equal
                          rhs: {<false>}
                          spids: [201]
                        )
                      ]
                    )
                    (C {<shift>})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [195 198 211 -1]
                )
                (case_arm
                  pat_list: [{(DQ <-h>)}]
                  action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit>)]
                  spids: [214 217 226 -1]
                )
                (case_arm
                  pat_list: [{(DQ <-r>)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:WARNREDUN)
                          op: assign_op.Equal
                          rhs: {<true>}
                          spids: [235]
                        )
                      ]
                    )
                    (C {<shift>})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [229 232 245 -1]
                )
                (case_arm
                  pat_list: [{(DQ <-O>)}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-d>} {($ Id.VSub_Number '$2')} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:OUTPUT)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        child: 
                                          (command.Pipeline
                                            children: [
                                              (C {<echo>} {($ Id.VSub_Number '$2')})
                                              (C {<sed>} {(SQ <'s/\\/*$//'>)})
                                            ]
                                            negated: F
                                          )
                                      )
                                    }
                                  spids: [267]
                                )
                              ]
                            )
                          ]
                          spids: [254 264]
                        )
                      ]
                      else_action: [
                        (command.Simple
                          words: [
                            {<echo>}
                            {(DQ <'output directory '> ($ Id.VSub_Number '$2') <' does not exist'>)}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '1>&'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<2>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Exit exit>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (C {<shift>} {<2>})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [248 251 314 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Break break>)]
                  spids: [317 318 324 -1]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Pound '$#'))} {<-lt>} {<1>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit>)]
          spids: [332 348]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$KCONFIG_CONFIG'))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$OUTPUT'))} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<.>} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:KCONFIG_CONFIG)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<readlink>} {<-m>} {<-->} 
                                    {(DQ ($ Id.VSub_DollarName '$OUTPUT') <'/.config'>)}
                                  )
                              )
                            }
                          spids: [394]
                        )
                      ]
                    )
                  ]
                  spids: [375 391]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:KCONFIG_CONFIG)
                      op: assign_op.Equal
                      rhs: {<.config>}
                      spids: [412]
                    )
                  ]
                )
              ]
            )
          ]
          spids: [359 372]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:INITFILE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [421]
        )
      ]
    )
    (command.Sentence child:(C {<shift>}) terminator:<Id.Op_Semi _>)
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-r>} 
                      {(DQ ($ Id.VSub_DollarName '$INITFILE'))} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'The base file \''> ($ Id.VSub_DollarName '$INITFILE') 
                    <'\' does not exist.  Exit.'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [428 443]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:MERGE_LIST)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Star '$*')}
          spids: [465]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SED_CONFIG_EXP)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'s/^'> <Id.Lit_BadBackslash '\\'> <'(# '> <Id.Lit_BadBackslash '\\'> <')'> 
                <Id.Lit_BadBackslash '\\'> <'{0,1'> <Id.Lit_BadBackslash '\\'> <'}'> <Id.Lit_BadBackslash '\\'> <'(CONFIG_[a-zA-Z0-9_]*'> 
                <Id.Lit_BadBackslash '\\'> <')[= ].*/'> <Id.Lit_BadBackslash '\\'> <'2/p'>
              )
            }
          spids: [468]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TMP_FILE)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<mktemp>} {<'./.tmp.config.XXXXXXXXXX'>})
              )
            }
          spids: [487]
        )
      ]
    )
    (C {<echo>} {(DQ <'Using '> ($ Id.VSub_DollarName '$INITFILE') <' as base'>)})
    (command.Simple
      words: [{<cat>} {($ Id.VSub_DollarName '$INITFILE')}]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {($ Id.VSub_DollarName '$TMP_FILE')}
        )
      ]
      do_fork: T
    )
    (command.ForEach
      iter_name: MERGE_FILE
      iter_words: [{($ Id.VSub_DollarName '$MERGE_LIST')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<echo>} {(DQ <'Merging '> ($ Id.VSub_DollarName '$MERGE_FILE'))})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-r>} 
                              {(DQ ($ Id.VSub_DollarName '$MERGE_FILE'))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'The merge file \''> ($ Id.VSub_DollarName '$MERGE_FILE') 
                            <'\' does not exist.  Exit.'>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [536 551]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CFG_LIST)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$SED_CONFIG_EXP'))} 
                            {($ Id.VSub_DollarName '$MERGE_FILE')}
                          )
                      )
                    }
                  spids: [574]
                )
              ]
            )
            (command.ForEach
              iter_name: CFG
              iter_words: [{($ Id.VSub_DollarName '$CFG_LIST')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<grep>} {<-q>} {<-w>} {($ Id.VSub_DollarName '$CFG')} 
                          {($ Id.VSub_DollarName '$TMP_FILE')}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Continue continue>
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:PREV_VAL)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<grep>} {<-w>} {($ Id.VSub_DollarName '$CFG')} 
                                    {($ Id.VSub_DollarName '$TMP_FILE')}
                                  )
                              )
                            }
                          spids: [617]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:NEW_VAL)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<grep>} {<-w>} {($ Id.VSub_DollarName '$CFG')} 
                                    {($ Id.VSub_DollarName '$MERGE_FILE')}
                                  )
                              )
                            }
                          spids: [629]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} 
                                      {(DQ <x> ($ Id.VSub_DollarName '$PREV_VAL'))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <x> ($ Id.VSub_DollarName '$NEW_VAL'))} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} {<Value>} {<of>} {($ Id.VSub_DollarName '$CFG')} {<is>} 
                              {<redefined>} {<by>} {<fragment>} {($ Id.VSub_DollarName '$MERGE_FILE') <Id.Lit_Colon ':'>}
                            )
                            (C {<echo>} {<Previous>} {<value> <Id.Lit_Colon ':'>} 
                              {($ Id.VSub_DollarName '$PREV_VAL')}
                            )
                            (C {<echo>} {<New>} {<value> <Id.Lit_Colon ':'>} 
                              {($ Id.VSub_DollarName '$NEW_VAL')}
                            )
                            (C {<echo>})
                          ]
                          spids: [641 662]
                        )
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} 
                                      {(DQ ($ Id.VSub_DollarName '$WARNREDUN'))} {<Id.Lit_Equals '='>} {(DQ <true>)} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} {<Value>} {<of>} {($ Id.VSub_DollarName '$CFG')} {<is>} 
                              {<redundant>} {<by>} {<fragment>} {($ Id.VSub_DollarName '$MERGE_FILE') <Id.Lit_Colon ':'>}
                            )
                          ]
                          spids: [708 725]
                        )
                      ]
                    )
                    (C {<sed>} {<-i>} {(DQ <'/'> ($ Id.VSub_DollarName '$CFG') <'[ =]/d'>)} 
                      {($ Id.VSub_DollarName '$TMP_FILE')}
                    )
                  ]
                )
            )
            (command.Simple
              words: [{<cat>} {($ Id.VSub_DollarName '$MERGE_FILE')}]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$TMP_FILE')}
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$RUNMAKE'))} 
                      {<Id.Lit_Equals '='>} {(DQ <false>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<cp>} {<-T>} {<-->} {(DQ ($ Id.VSub_DollarName '$TMP_FILE'))} 
              {(DQ ($ Id.VSub_DollarName '$KCONFIG_CONFIG'))}
            )
            (C {<echo>} {(DQ <'#'>)})
            (C {<echo>} 
              {
                (DQ <'# merged configuration written to '> ($ Id.VSub_DollarName '$KCONFIG_CONFIG') 
                  <' (needs make)'>
                )
              }
            )
            (C {<echo>} {(DQ <'#'>)})
            (C {<clean_up>})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
          spids: [778 795]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OUTPUT_ARG)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [850]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$OUTPUT'))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <.>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT_ARG)
                  op: assign_op.Equal
                  rhs: {(DQ <'O='> ($ Id.VSub_DollarName '$OUTPUT'))}
                  spids: [876]
                )
              ]
            )
          ]
          spids: [854 873]
        )
      ]
    )
    (C {<make>} {<Id.Lit_VarLike 'KCONFIG_ALLCONFIG='> ($ Id.VSub_DollarName '$TMP_FILE')} 
      {($ Id.VSub_DollarName '$OUTPUT_ARG')} {($ Id.VSub_DollarName '$ALLTARGET')}
    )
    (command.ForEach
      iter_name: CFG
      iter_words: [
        {
          (command_sub
            left_token: <Id.Left_DollarParen '$('>
            child: 
              (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$SED_CONFIG_EXP'))} 
                {($ Id.VSub_DollarName '$TMP_FILE')}
              )
          )
        }
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:REQUESTED_VAL)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<grep>} {<-w>} {<-e>} {(DQ ($ Id.VSub_DollarName '$CFG'))} 
                            {($ Id.VSub_DollarName '$TMP_FILE')}
                          )
                      )
                    }
                  spids: [932]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ACTUAL_VAL)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<grep>} {<-w>} {<-e>} {(DQ ($ Id.VSub_DollarName '$CFG'))} 
                            {(DQ ($ Id.VSub_DollarName '$KCONFIG_CONFIG'))}
                          )
                      )
                    }
                  spids: [948]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} 
                              {(DQ <x> ($ Id.VSub_DollarName '$REQUESTED_VAL'))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <x> ($ Id.VSub_DollarName '$ACTUAL_VAL'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Value requested for '> ($ Id.VSub_DollarName '$CFG') 
                          <' not in final .config'>
                        )
                      }
                    )
                    (C {<echo>} {(DQ <'Requested value:  '> ($ Id.VSub_DollarName '$REQUESTED_VAL'))})
                    (C {<echo>} {(DQ <'Actual value:     '> ($ Id.VSub_DollarName '$ACTUAL_VAL'))})
                    (C {<echo>} {(DQ )})
                  ]
                  spids: [966 987]
                )
              ]
            )
          ]
        )
    )
    (C {<clean_up>})
  ]
)