(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Pound '$#'))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <1>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' \'character\''>
                  )
                }
              ]
              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: [48 66]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<echo>} {($ Id.VSub_DollarName '$LANG')})
                        (C {<grep>} {<-qi>} {(SQ <'UTF.*8'>)})
                      ]
                      negated: F
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:lang)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} {($ Id.VSub_DollarName '$LANG')})
                              (C {<sed>} {(SQ <'s/\\(.._..\\).*/\\1/'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [114]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:codeset)
                  op: assign_op.Equal
                  rhs: {<UTF-8>}
                  spids: [138]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:character)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [142]
                )
              ]
            )
          ]
          spids: [94 111]
        )
      ]
      else_action: [
        (command.Simple
          words: [{<echo>} {(DQ <'Sorry, only UTF-8 is supported at present'>)}]
          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>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:dir)
          op: assign_op.Equal
          rhs: {<'/usr/share/X11/locale'>}
          spids: [175]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} 
                      {(DQ ($ Id.VSub_DollarName '$dir'))} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dir)
                  op: assign_op.Equal
                  rhs: {<'/usr/X11R6/lib/X11/locale'>}
                  spids: [199]
                )
              ]
            )
          ]
          spids: [181 196]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                      {(DQ ($ Id.VSub_DollarName '$dir') <'/locale.dir'>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Sorry, couldn\'t find your X windows locale data'>)}]
              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: [207 223]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:dir)
          op: assign_op.Equal
          rhs: 
            {
              (DQ ($ Id.VSub_DollarName '$dir') <'/'> 
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: 
                    (command.Simple
                      words: [
                        {<sed>}
                        {<-n>}
                        {
                          (DQ <'s#'> <Id.Lit_BadBackslash '\\'> <'([^/]*'> <Id.Lit_BadBackslash '\\'> 
                            <')/.*:.*'> ($ Id.VSub_DollarName '$lang') <.> ($ Id.VSub_DollarName '$codeset') <'#'> <Id.Lit_BadBackslash '\\'> 
                            <'1#p'>
                          )
                        }
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Less '<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: {($ Id.VSub_DollarName '$dir') <'/locale.dir'>}
                        )
                      ]
                      do_fork: T
                    )
                )
              )
            }
          spids: [243]
        )
      ]
    )
    (command.Simple
      words: [
        {<grep>}
        {<-F>}
        {
          (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
            ($ Id.VSub_DollarName '$character') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
          )
        }
        {($ Id.VSub_DollarName '$dir') <'/Compose'>}
      ]
      more_env: [(env_pair name:LANG val:{<C>} spids:[285])]
      do_fork: T
    )
  ]
)