(command.CommandList
  children: [
    (command.ShFunction
      name: Usage
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number 0)})
                      right: <Id.Backtick_Right '`'>
                    ) <' mon|tue|... [next]|week|last'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Pound '#'))} {<-eq>} {(DQ <0>)} {<Id.Lit_RBracket ']'>})
        (C {<Usage>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'day='> name:day)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number 1)}
          spids: [64]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'which='> name:which)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number 2)}
          spids: [67]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName which))} {<Id.Lit_RBracket ']'>})
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'which='> name:which)
              op: assign_op.Equal
              rhs: {<next>}
              spids: [82]
            )
          ]
          redirects: []
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_DollarName which)}
      arms: [
        (case_arm
          pat_list: [{<week>}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <D>})
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {<Id.Lit_Equals '='>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: 
                                    (C {<date>} 
                                      {<--date> <Id.Lit_Equals '='> 
                                        (DQ <'next '> ($ Id.VSub_DollarName day))
                                      } {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <D>}
                                    )
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'weeks='> name:weeks)
                          op: assign_op.Equal
                          rhs: {<Id.Lit_Other '+'> <2>}
                          spids: [135]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [96 132]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'weeks='> name:weeks)
                      op: assign_op.Equal
                      rhs: {<Id.Lit_Other '+'> <1>}
                      spids: [146]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
          ]
          spids: [92 93 153 -1]
        )
        (case_arm
          pat_list: [{<last>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'weeks='> name:weeks)
                  op: assign_op.Equal
                  rhs: {<-1>}
                  spids: [159]
                )
              ]
              redirects: []
            )
          ]
          spids: [155 156 161 -1]
        )
        (case_arm
          pat_list: [{<next>}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <D>})
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {<Id.Lit_Equals '='>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: 
                                    (C {<date>} 
                                      {<--date> <Id.Lit_Equals '='> 
                                        (DQ <'next '> ($ Id.VSub_DollarName day))
                                      } {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <D>}
                                    )
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'weeks='> name:weeks)
                          op: assign_op.Equal
                          rhs: {<Id.Lit_Other '+'> <1>}
                          spids: [206]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [167 203]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'weeks='> name:weeks)
                      op: assign_op.Equal
                      rhs: {<Id.Lit_Other '+'> <0>}
                      spids: [217]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
          ]
          spids: [163 164 224 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [(C {<Usage>})]
          spids: [226 227 231 -1]
        )
      ]
      redirects: []
    )
    (C {<date>} 
      {<--date> <Id.Lit_Equals '='> 
        (DQ ($ Id.VSub_DollarName day) <' '> ($ Id.VSub_DollarName weeks) <' weeks'>)
      } {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <x>}
    )
  ]
)