(command.CommandList
  children: [
    (command.ShFunction
      name: Usage
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' mon|tue|... [next]|week|last'>
                  )
                }
              ]
              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.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 name:day)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [64]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:which)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$2')}
          spids: [67]
        )
      ]
    )
    (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 name:which)
              op: assign_op.Equal
              rhs: {<next>}
              spids: [82]
            )
          ]
        )
      ]
    )
    (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>})
                                )
                              } {<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>}
                                    )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:weeks)
                          op: assign_op.Equal
                          rhs: {<Id.Lit_Other '+'> <2>}
                          spids: [135]
                        )
                      ]
                    )
                  ]
                  spids: [96 132]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:weeks)
                      op: assign_op.Equal
                      rhs: {<Id.Lit_Other '+'> <1>}
                      spids: [146]
                    )
                  ]
                )
              ]
            )
          ]
          spids: [92 93 153 -1]
        )
        (case_arm
          pat_list: [{<last>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:weeks)
                  op: assign_op.Equal
                  rhs: {<-1>}
                  spids: [159]
                )
              ]
            )
          ]
          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>})
                                )
                              } {<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>}
                                    )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:weeks)
                          op: assign_op.Equal
                          rhs: {<Id.Lit_Other '+'> <1>}
                          spids: [206]
                        )
                      ]
                    )
                  ]
                  spids: [167 203]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:weeks)
                      op: assign_op.Equal
                      rhs: {<Id.Lit_Other '+'> <0>}
                      spids: [217]
                    )
                  ]
                )
              ]
            )
          ]
          spids: [163 164 224 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [(C {<Usage>})]
          spids: [226 227 231 -1]
        )
      ]
    )
    (C {<date>} 
      {<--date> <Id.Lit_Equals '='> 
        (DQ ($ Id.VSub_DollarName '$day') <' '> ($ Id.VSub_DollarName '$weeks') <' weeks'>)
      } {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <x>}
    )
  ]
)