(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:75)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ("Usage: DEFINES='list' HEADERS='list' ") 
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:84)
                    )
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:87)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ("  [TARGET_CPU_DEFAULT='default'] mkconfig.sh FILE"))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:97)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:101)
              arg_word: {(1)}
            )
          ]
          spids: [64 77]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:output)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [108]
        )
      ]
    )
    (C {(rm)} {(-f)} {(${ Id.VSub_Name output) (T)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:hg_sed_expr)
          op: assign_op.Equal
          rhs: 
            {
              (SQ 
                (Token
                  id: Id.Lit_Chars
                  val: 'y,abcdefghijklmnopqrstuvwxyz./,ABCDEFGHIJKLMNOPQRSTUVWXYZ__,'
                  span_id: 126
                )
              )
            }
          spids: [124]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:header_guard)
          op: assign_op.Equal
          rhs: 
            {(GCC_) 
              (command_sub
                left_token: (Token id:Id.Left_Backtick val:'`' span_id:131)
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(${ Id.VSub_Name output)})
                          (C {(sed)} {(-e)} {(${ Id.VSub_Name hg_sed_expr)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [129]
        )
      ]
    )
    (command.Simple
      words: [{(echo)} {(DQ ('#ifndef ') (${ Id.VSub_Name header_guard))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_DGreat val:'>>' span_id:164)
          fd: -1
          arg_word: {(${ Id.VSub_Name output) (T)}
        )
      ]
    )
    (command.Simple
      words: [{(echo)} {(DQ ('#define ') (${ Id.VSub_Name header_guard))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_DGreat val:'>>' span_id:180)
          fd: -1
          arg_word: {(${ Id.VSub_Name output) (T)}
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(test)} {(x) (DQ ($ Id.VSub_DollarName '$output'))} {(Id.Lit_Equals '=')} 
                  {(x) (DQ (config.h))}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:209)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('#ifdef GENERATOR_FILE'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:220)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ('#error config.h is for the host, not build, machine.'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:234)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ('#endif'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:248)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
              ]
            )
          ]
          spids: [194 211]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$TARGET_CPU_DEFAULT'))} 
                  {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ )} {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:279)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('#define TARGET_CPU_DEFAULT (') ($ Id.VSub_DollarName '$TARGET_CPU_DEFAULT') 
                    (')')
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:292)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
              ]
            )
          ]
          spids: [264 281]
        )
      ]
    )
    (command.ForEach
      iter_name: def
      iter_words: [{($ Id.VSub_DollarName '$DEFINES')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Pipeline
              children: [
                (C {(echo)} {(DQ ('#ifndef ') ($ Id.VSub_DollarName '$def'))})
                (command.Simple
                  words: [{(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/=.*//' span_id:329))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_DGreat val:'>>' span_id:332)
                      fd: -1
                      arg_word: {(${ Id.VSub_Name output) (T)}
                    )
                  ]
                )
              ]
              negated: F
            )
            (command.Pipeline
              children: [
                (C {(echo)} {(DQ ('# define ') ($ Id.VSub_DollarName '$def'))})
                (command.Simple
                  words: [{(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/=/ /' span_id:352))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_DGreat val:'>>' span_id:355)
                      fd: -1
                      arg_word: {(${ Id.VSub_Name output) (T)}
                    )
                  ]
                )
              ]
              negated: F
            )
            (command.Simple
              words: [{(echo)} {(DQ ('#endif'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:369)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$HEADERS'))} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:396)
            )
          ]
          action: [
            (C {(Id.KW_Set set)} {($ Id.VSub_DollarName '$HEADERS')})
            (command.Case
              to_match: {(DQ ($ Id.VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(auto-) (Id.Lit_Star '*')}]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {
                          (DQ ('#include ') 
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:424)
                            ) ($ Id.VSub_Number '$1') 
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:426)
                            )
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_DGreat val:'>>' span_id:429)
                          fd: -1
                          arg_word: {(${ Id.VSub_Name output) (T)}
                        )
                      ]
                    )
                    (C {(shift)})
                  ]
                  spids: [414 417 440 -1]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ge)} {(1)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:457)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(echo)} {(SQ (Token id:Id.Lit_Chars val:'#ifdef IN_GCC' span_id:465))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_DGreat val:'>>' span_id:468)
                          fd: -1
                          arg_word: {(${ Id.VSub_Name output) (T)}
                        )
                      ]
                    )
                    (command.ForEach
                      iter_name: file
                      iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.Simple
                              words: [
                                {(echo)}
                                {
                                  (DQ ('# include ') 
                                    (word_part.EscapedLiteral
                                      token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:494)
                                    ) ($ Id.VSub_DollarName '$file') 
                                    (word_part.EscapedLiteral
                                      token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:496)
                                    )
                                  )
                                }
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:499)
                                  fd: -1
                                  arg_word: {(${ Id.VSub_Name output) (T)}
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.Simple
                      words: [{(echo)} {(SQ (Token id:Id.Lit_Chars val:'#endif' span_id:513))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_DGreat val:'>>' span_id:516)
                          fd: -1
                          arg_word: {(${ Id.VSub_Name output) (T)}
                        )
                      ]
                    )
                  ]
                  spids: [446 459]
                )
              ]
            )
          ]
          spids: [385 398]
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_DollarName '$output')}
      arms: [
        (case_arm
          pat_list: [{(tm.h)}]
          action: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:553)
                  fd: -1
                  arg_word: {(${ Id.VSub_Name output) (T)}
                )
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:560)
                  fd: -1
                  here_begin: {(EOF)}
                  here_end_span_id: 576
                  stdin_parts: [
                    ('#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET\n')
                    ('# include ')
                    (Id.Right_DoubleQuote '"')
                    (insn-constants.h)
                    (Id.Right_DoubleQuote '"')
                    ('\n')
                    ('# include ')
                    (Id.Right_DoubleQuote '"')
                    (insn-flags.h)
                    (Id.Right_DoubleQuote '"')
                    ('\n')
                    ('#endif\n')
                  ]
                )
              ]
            )
          ]
          spids: [546 548 578 -1]
        )
      ]
    )
    (command.Simple
      words: [{(echo)} {(DQ ('#endif /* ') (${ Id.VSub_Name header_guard) (' */'))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_DGreat val:'>>' span_id:596)
          fd: -1
          arg_word: {(${ Id.VSub_Name output) (T)}
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {(Id.Lit_LBracket '[')} {(-f)} {($ Id.VSub_DollarName '$output')} 
                      {(Id.Lit_RBracket ']')}
                    )
                    (command.Simple
                      words: [{(cmp)} {(${ Id.VSub_Name output) (T)} {($ Id.VSub_DollarName '$output')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:628)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:631)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:633)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {($ Id.VSub_DollarName '$output')} {(is)} {(unchanged)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:646)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (C {(rm)} {(-f)} {(${ Id.VSub_Name output) (T)})
          ]
          spids: [607 635]
        )
      ]
      else_action: [(C {(mv)} {(-f)} {(${ Id.VSub_Name output) (T)} {($ Id.VSub_DollarName '$output')})]
    )
    (C {(rm)} {(-f)} {(cs-) ($ Id.VSub_DollarName '$output')})
    (command.Simple
      words: [{(echo)} {(timestamp)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:690)
          fd: -1
          arg_word: {(cs-) ($ Id.VSub_DollarName '$output')}
        )
      ]
    )
  ]
)