(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(DQ ($ VSub_Pound '$#'))} {(KW_Bang '!') (Lit_Equals '=')} {(3)} 
                  {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('Usage: add-memzip.sh input.hex output.hex file-directory'))})
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:input_hex) op:Equal rhs:{($ VSub_Number '$1')})]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:output_hex) op:Equal rhs:{($ VSub_Number '$2')})]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:memzip_src_dir)
          op: Equal
          rhs: {($ VSub_Number '$3')}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:input_bin)
          op: Equal
          rhs: {(${ VSub_Name input_hex) (.bin)}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:output_bin)
          op: Equal
          rhs: {(${ VSub_Name output_hex) (.bin)}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:zip_file)
          op: Equal
          rhs: {(${ VSub_Name output_hex) (.zip)}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:zip_base)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [(C {(basename)} {(${ VSub_Name zip_file)})]
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:zip_dir)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [(C {(dirname)} {(${ VSub_Name zip_file)})]
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:abs_zip_dir)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [(C {(realpath)} {(${ VSub_Name zip_dir)})]
                  )
              )
            }
        )
      ]
    )
    (C {(rm)} {(-f)} {(${ VSub_Name zip_file)})
    (command.Subshell
      command_list: 
        (command.CommandList
          children: [
            (command.Sentence
              child: (C {(cd)} {(${ VSub_Name memzip_src_dir)})
              terminator: <Op_Semi ';'>
            )
            (C {(zip)} {(-0)} {(-r)} {(-D)} {(${ VSub_Name abs_zip_dir) (/) (${ VSub_Name zip_base)} {(.)})
          ]
        )
    )
    (C {(objcopy)} {(-I)} {(ihex)} {(-O)} {(binary)} {(${ VSub_Name input_hex)} {(${ VSub_Name input_bin)})
    (command.Simple
      words: [{(cat)} {(${ VSub_Name input_bin)} {(${ VSub_Name zip_file)}]
      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(${ VSub_Name output_bin)})]
    )
    (C {(objcopy)} {(-I)} {(binary)} {(-O)} {(ihex)} {(${ VSub_Name output_bin)} {(${ VSub_Name output_hex)})
    (C {(echo)} 
      {
        (DQ ('Added ') (${ VSub_Name memzip_src_dir) (' to ') (${ VSub_Name input_hex) (' creating ') 
          (${ VSub_Name output_hex)
        )
      }
    )
  ]
)