(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(DQ ($ VSub_Pound '$#'))} {(KW_Bang '!') (Lit_Equals '=')} 
                  {(DQ (1))} {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Usage: ') 
                    (command_sub
                      left_token: <Left_Backtick '`'>
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                    ) (" 'character'")
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Pipeline
                  children: [
                    (C {(echo)} {($ VSub_DollarName '$LANG')})
                    (C {(grep)} {(-qi)} {(SQ <'UTF.*8'>)})
                  ]
                  negated: F
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:lang)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} {($ VSub_DollarName '$LANG')})
                                  (C {(sed)} {(SQ <'s/\\(.._..\\).*/\\1/'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (command.ShAssignment
              pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:codeset) op:Equal rhs:{(UTF-8)})]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:character)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
          ]
        )
      ]
      else_action: [
        (command.Simple
          words: [{(echo)} {(DQ ('Sorry, only UTF-8 is supported at present'))}]
          redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
        )
        (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:dir) op:Equal rhs:{(/usr/share/X11/locale)})]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-d)} {(DQ ($ VSub_DollarName '$dir'))} 
                  {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dir)
                  op: Equal
                  rhs: {(/usr/X11R6/lib/X11/locale)}
                )
              ]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-f)} 
                  {(DQ ($ VSub_DollarName '$dir') (/locale.dir))} {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ("Sorry, couldn't find your X windows locale data"))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:dir)
          op: Equal
          rhs: 
            {
              (DQ ($ VSub_DollarName '$dir') (/) 
                (command_sub
                  left_token: <Left_Backtick '`'>
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.Simple
                          words: [
                            {(sed)}
                            {(-n)}
                            {
                              (DQ ('s#') (Lit_Other '\\') ('([^/]*') (Lit_Other '\\') (')/.*:.*') 
                                ($ VSub_DollarName '$lang') (.) ($ VSub_DollarName '$codeset') ('#') (Lit_Other '\\') ('1#p')
                              )
                            }
                          ]
                          redirects: [
                            (redir.Redir
                              op: <Redir_Less '<'>
                              fd: 16777215
                              arg_word: {($ VSub_DollarName '$dir') (/locale.dir)}
                            )
                          ]
                        )
                      ]
                    )
                )
              )
            }
        )
      ]
    )
    (command.Simple
      words: [
        {(grep)}
        {(-F)}
        {
          (DQ (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) 
            ($ VSub_DollarName '$character') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>)
          )
        }
        {($ VSub_DollarName '$dir') (/Compose)}
      ]
      more_env: [(env_pair name:LANG val:{(C)})]
    )
  ]
)