(command.CommandList
  children: [
    (command.ShFunction
      name: ldflags
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{<pkg-config>} {<--libs>} {<ncursesw>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{<pkg-config>} {<--libs>} {<ncurses>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
            (command.ForEach
              iter_name: ext
              iter_words: [{<so>} {<a>} {<dll.a>} {<dylib>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: lib
                      iter_words: [{<ncursesw>} {<ncurses>} {<curses>}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.Pipeline
                              children: [
                                (C {($ Id.VSub_DollarName '$cc')} 
                                  {<-print-file-name> <Id.Lit_Equals '='> <lib> (${ Id.VSub_Name lib) 
                                    <.> (${ Id.VSub_Name ext)
                                  }
                                )
                                (C {<grep>} {<-q>} {<'/'>})
                              ]
                              negated: F
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} 
                                              {<0>} {<Id.Lit_RBracket ']'>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<echo>} {(DQ <-l> (${ Id.VSub_Name lib))})
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Exit exit>
                                    )
                                  ]
                                  spids: [103 116]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.ShFunction
      name: ccflags
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<pkg-config>} {<--cflags>} {<ncursesw>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(SQ <'-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'>)})]
                  spids: [158 170]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<pkg-config>} {<--cflags>} {<ncurses>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(SQ <'-DCURSES_LOC="<ncurses.h>"'>)})]
                  spids: [180 192]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-f>} {<'/usr/include/ncursesw/curses.h'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} {(SQ <'-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'>)})
                    (C {<echo>} {(SQ <' -DNCURSES_WIDECHAR=1'>)})
                  ]
                  spids: [202 213]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-f>} {<'/usr/include/ncurses/ncurses.h'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(SQ <'-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'>)})]
                  spids: [230 241]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-f>} {<'/usr/include/ncurses/curses.h'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(SQ <'-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'>)})]
                  spids: [251 262]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-f>} {<'/usr/include/ncurses.h'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(SQ <'-DCURSES_LOC="<ncurses.h>"'>)})]
                  spids: [272 283]
                )
              ]
              else_action: [(C {<echo>} {(SQ <'-DCURSES_LOC="<curses.h>"'>)})]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tmp)
          op: assign_op.Equal
          rhs: {<.lxdialog.tmp>}
          spids: [311]
        )
      ]
    )
    (C {<trap>} {(DQ <'rm -f '> ($ Id.VSub_DollarName '$tmp'))} {<0>} {<1>} {<2>} {<3>} {<15>})
    (command.ShFunction
      name: check
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [
                {($ Id.VSub_DollarName '$cc')}
                {<-x>}
                {<c>}
                {<->}
                {<-o>}
                {($ Id.VSub_DollarName '$tmp')}
              ]
              redirects: [
                (redir
                  op: <Id.Redir_Great '2>'>
                  loc: (redir_loc.Fd fd:2)
                  arg: {<'/dev/null'>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {(SQ <EOF>)}
                      here_end_span_id: 364
                      stdin_parts: [<'#include CURSES_LOC\n'> <'main() {}\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<echo>} {(DQ <' *** Unable to find the ncurses libraries or the'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '1>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<2>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <' *** required header files.'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '1>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<2>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {(DQ <' *** \'make menuconfig\' requires the ncurses libraries.'>)}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '1>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<2>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <' *** '>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '1>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<2>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <' *** Install ncurses (ncurses-devel) and try again.'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '1>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<2>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <' *** '>)}]
                      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>}
                    )
                  ]
                  spids: [366 380]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {<printf>} 
              {
                (DQ <'Usage: '> ($ Id.VSub_Number '$0') 
                  <' [-check compiler options|-ccflags|-ldflags compiler options]'> <Id.Lit_BadBackslash '\\'> <n>
                )
              }
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})]
          spids: [473 486]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:cc) op:assign_op.Equal rhs:{(DQ )} spids:[499])]
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_Number '$1'))}
      arms: [
        (case_arm
          pat_list: [{(DQ <-check>)}]
          action: [
            (C {<shift>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cc)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_At '$@'))}
                  spids: [521]
                )
              ]
            )
            (C {<check>})
          ]
          spids: [512 515 530 -1]
        )
        (case_arm
          pat_list: [{(DQ <-ccflags>)}]
          action: [(C {<ccflags>})]
          spids: [533 536 542 -1]
        )
        (case_arm
          pat_list: [{(DQ <-ldflags>)}]
          action: [
            (C {<shift>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cc)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_At '$@'))}
                  spids: [554]
                )
              ]
            )
            (C {<ldflags>})
          ]
          spids: [545 548 563 -1]
        )
        (case_arm
          pat_list: [{(DQ <'*'>)}]
          action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})]
          spids: [566 569 580 -1]
        )
      ]
    )
  ]
)