user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1d8,%rsp
  lea    D671(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x11c8(%rsp)
  xor    %eax,%eax
  lea    0xdc0(%rsp),%r12
  call   <getenv@plt>
  lea    D319(%rip),%rdi
  mov    %rax,%rbx
  call   <getenv@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %eax,%edx
  call   <memcpy@plt>
  lea    D278(%rip),%rdi
  call   <getenv@plt>
  lea    D261(%rip),%rdi
  mov    %rax,0x30(%rsp)
  call   <getenv@plt>
  mov    %rax,0x38(%rsp)
  test   %rbx,%rbx
  je     L339
  test   %rbp,%rbp
  je     L408
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x19c,%eax
  ja     L452
  lea    D301(%rip),%rsi
  mov    %r12,%rdi
  call   <strtok@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L272
  lea    0x3c0(%rsp),%rax
  lea    0x1c0(%rsp),%r12
  mov    %rax,0x8(%rsp)
  lea    0xc0(%rsp),%rax
  lea    0x40(%rsp),%r13
  mov    %rax,0x20(%rsp)
  lea    0x5c0(%rsp),%rax
  lea    0x7c0(%rsp),%rbp
  mov    %rax,0x18(%rsp)
  lea    0xbc0(%rsp),%rax
  lea    0x9c0(%rsp),%r15
  mov    %rax,0x10(%rsp)
  lea    0x140(%rsp),%rax
  mov    %rax,0x28(%rsp)
  nop
L381:
  mov    %r14,%rsi
  lea    D282(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  mov    $0x200,%edx
  mov    %r12,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x200,%edx
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x200,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x200,%edx
  mov    %r15,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x80,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  mov    0x20(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x80,%edx
  call   <memset@plt>
  mov    0x18(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x200,%edx
  call   <memset@plt>
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x200,%edx
  call   <memset@plt>
  mov    0x28(%rsp),%rdi
  mov    $0x80,%edx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    0x8(%rsp),%rdi
  mov    %rbx,%rsi
  call   <strcat@plt>
  mov    0x18(%rsp),%rdi
  mov    %rbx,%rsi
  call   <strcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  mov    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <strcat@plt>
  mov    $0x4,%edx
  lea    D748(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L489
  mov    $0x4,%edx
  lea    D397(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D836(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L489
  mov    $0x4,%edx
  lea    D337(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L434
  nopw   0x0(%rax,%rax,1)
L490:
  mov    0x30(%rsp),%rdi
  mov    $0x1,%edx
  lea    D766(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L7
  mov    0x38(%rsp),%rdi
  mov    $0x3,%edx
  lea    D519(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L107
L7:
  lea    D602(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D289(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D512(%rip),%rsi
  mov    %r13,%rdi
L181:
  call   <strcat@plt>
L487:
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <bin2h@plt>
L32:
  lea    D301(%rip),%rsi
  xor    %edi,%edi
  call   <strtok@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L381
L272:
  xor    %edi,%edi
  call   <exit@plt>
  xor    %eax,%eax
L279:
  mov    0x11c8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L228
  add    $0x11d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L489:
  lea    D613(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D650(%rip),%rsi
  mov    %r13,%rdi
  jmp    L181
L434:
  mov    $0x4,%edx
  lea    D69(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D645(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D423(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D605(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D556(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L490
  mov    $0x4,%edx
  lea    D630(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L7
  mov    $0x4,%edx
  lea    D698(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L489
  mov    $0x7,%edx
  lea    D283(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L50
  mov    $0x7,%edx
  lea    D536(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L377
L50:
  lea    D745(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D568(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D24(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  mov    0x8(%rsp),%rdi
  lea    D647(%rip),%rsi
  call   <strcat@plt>
  lea    D732(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  mov    0x20(%rsp),%rdi
  lea    D758(%rip),%rsi
  call   <strcat@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <bin2h@plt>
L312:
  mov    0x20(%rsp),%rdx
  mov    0x8(%rsp),%rdi
  mov    %r15,%rsi
  call   <bin2h@plt>
  jmp    L32
L107:
  lea    D306(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D532(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D92(%rip),%rsi
  mov    %r13,%rdi
  jmp    L181
L452:
  lea    D276(%rip),%rdi
  call   <puts@plt>
L415:
  or     $0xffffffff,%eax
  jmp    L279
L408:
  lea    D390(%rip),%rdi
  call   <puts@plt>
  jmp    L415
L339:
  lea    D434(%rip),%rdi
  call   <puts@plt>
  jmp    L415
L377:
  mov    $0x7,%edx
  lea    D599(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L342
  mov    $0x7,%edx
  lea    D783(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L486
L342:
  lea    D465(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D391(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D761(%rip),%rsi
  mov    %r13,%rdi
  jmp    L181
L228:
  call   <__stack_chk_fail@plt>
L486:
  mov    $0x7,%edx
  lea    D91(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L342
  mov    $0x7,%edx
  lea    D146(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L342
  mov    $0x7,%edx
  lea    D572(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L140
  mov    $0x7,%edx
  lea    D515(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L180
L140:
  lea    D465(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D235(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    D665(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  mov    $0x7,%edx
  lea    D572(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L179
  mov    0x8(%rsp),%rdi
  lea    D724(%rip),%rsi
  call   <strcat@plt>
  lea    D805(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D729(%rip),%rsi
L367:
  mov    0x20(%rsp),%rdi
  jmp    L181
L180:
  mov    $0x7,%edx
  lea    D581(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x7,%edx
  lea    D139(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L491
L6:
  mov    %r12,%rdi
  lea    D521(%rip),%rsi
  call   <strcat@plt>
  mov    %rbp,%rdi
  lea    D469(%rip),%rsi
  call   <strcat@plt>
  mov    %r13,%rdi
  lea    D15(%rip),%rsi
  call   <strcat@plt>
  mov    0x18(%rsp),%rdi
  lea    D735(%rip),%rsi
  call   <strcat@plt>
  mov    0x10(%rsp),%rdi
  lea    D394(%rip),%rsi
  call   <strcat@plt>
  mov    0x28(%rsp),%r14
  lea    D329(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    0x8(%rsp),%rdi
  lea    D287(%rip),%rsi
  call   <strcat@plt>
  mov    %r15,%rdi
  lea    D343(%rip),%rsi
  call   <strcat@plt>
  mov    0x20(%rsp),%rdi
  lea    D658(%rip),%rsi
  call   <strcat@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <bin2h@plt>
  mov    0x10(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  mov    %r14,%rdx
  call   <bin2h@plt>
  jmp    L312
L179:
  mov    $0x7,%edx
  lea    D515(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L487
  mov    0x8(%rsp),%rdi
  lea    D724(%rip),%rsi
  call   <strcat@plt>
  lea    D803(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D78(%rip),%rsi
  jmp    L367
L491:
  mov    $0x7,%edx
  lea    D362(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x7,%edx
  lea    D176(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x7,%edx
  lea    D733(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x7,%edx
  lea    D678(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L6
  mov    $0x8,%edx
  lea    D12(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L77
L142:
  mov    %r12,%rdi
  lea    D71(%rip),%rsi
  call   <strcat@plt>
  mov    %rbp,%rdi
  lea    D332(%rip),%rsi
  call   <strcat@plt>
  mov    %r13,%rdi
  lea    D158(%rip),%rsi
  call   <strcat@plt>
  mov    0x18(%rsp),%rdi
  lea    D646(%rip),%rsi
  call   <strcat@plt>
  mov    0x10(%rsp),%rdi
  lea    D114(%rip),%rsi
  call   <strcat@plt>
  mov    0x28(%rsp),%r14
  lea    D741(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <bin2h@plt>
  mov    0x10(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  mov    %r14,%rdx
  call   <bin2h@plt>
  jmp    L32
L77:
  mov    $0x8,%edx
  lea    D364(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L142
  mov    $0x8,%edx
  lea    D792(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L142
  mov    %r14,%rsi
  lea    D162(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L32
```

tool_calls: name: parse_data
arguments: label: D671
type_infered: string
name: parse_data
arguments: label: D319
type_infered: string
name: parse_data
arguments: label: D278
type_infered: string
name: parse_data
arguments: label: D261
type_infered: string
name: parse_data
arguments: label: D301
type_infered: string
name: parse_data
arguments: label: D282
type_infered: string
name: parse_data
arguments: label: D748
type_infered: string
name: parse_data
arguments: label: D397
type_infered: string
name: parse_data
arguments: label: D836
type_infered: string
name: parse_data
arguments: label: D337
type_infered: string
name: parse_data
arguments: label: D766
type_infered: string
name: parse_data
arguments: label: D519
type_infered: string
name: parse_data
arguments: label: D602
type_infered: string
name: parse_data
arguments: label: D289
type_infered: string
name: parse_data
arguments: label: D512
type_infered: string
name: parse_data
arguments: label: D613
type_infered: string
name: parse_data
arguments: label: D1
type_infered: string
name: parse_data
arguments: label: D650
type_infered: string
name: parse_data
arguments: label: D69
type_infered: string
name: parse_data
arguments: label: D645
type_infered: string
name: parse_data
arguments: label: D423
type_infered: string
name: parse_data
arguments: label: D605
type_infered: string
name: parse_data
arguments: label: D556
type_infered: string
name: parse_data
arguments: label: D630
type_infered: string
name: parse_data
arguments: label: D698
type_infered: string
name: parse_data
arguments: label: D283
type_infered: string
name: parse_data
arguments: label: D536
type_infered: string
name: parse_data
arguments: label: D745
type_infered: string
name: parse_data
arguments: label: D568
type_infered: string
name: parse_data
arguments: label: D24
type_infered: string
name: parse_data
arguments: label: D647
type_infered: string
name: parse_data
arguments: label: D732
type_infered: string
name: parse_data
arguments: label: D758
type_infered: string
name: parse_data
arguments: label: D306
type_infered: string
name: parse_data
arguments: label: D532
type_infered: string
name: parse_data
arguments: label: D92
type_infered: string
name: parse_data
arguments: label: D276
type_infered: string
name: parse_data
arguments: label: D390
type_infered: string
name: parse_data
arguments: label: D434
type_infered: string
name: parse_data
arguments: label: D599
type_infered: string
name: parse_data
arguments: label: D783
type_infered: string
name: parse_data
arguments: label: D465
type_infered: string
name: parse_data
arguments: label: D391
type_infered: string
name: parse_data
arguments: label: D761
type_infered: string
name: parse_data
arguments: label: D91
type_infered: string
name: parse_data
arguments: label: D146
type_infered: string
name: parse_data
arguments: label: D572
type_infered: string
name: parse_data
arguments: label: D515
type_infered: string
name: parse_data
arguments: label: D235
type_infered: string
name: parse_data
arguments: label: D665
type_infered: string
name: parse_data
arguments: label: D724
type_infered: string
name: parse_data
arguments: label: D805
type_infered: string
name: parse_data
arguments: label: D729
type_infered: string
name: parse_data
arguments: label: D581
type_infered: string
name: parse_data
arguments: label: D139
type_infered: string
name: parse_data
arguments: label: D521
type_infered: string
name: parse_data
arguments: label: D469
type_infered: string
name: parse_data
arguments: label: D15
type_infered: string
name: parse_data
arguments: label: D735
type_infered: string
name: parse_data
arguments: label: D394
type_infered: string
name: parse_data
arguments: label: D329
type_infered: string
name: parse_data
arguments: label: D287
type_infered: string
name: parse_data
arguments: label: D343
type_infered: string
name: parse_data
arguments: label: D658
type_infered: string
name: parse_data
arguments: label: D803
type_infered: string
name: parse_data
arguments: label: D78
type_infered: string
name: parse_data
arguments: label: D362
type_infered: string
name: parse_data
arguments: label: D176
type_infered: string
name: parse_data
arguments: label: D733
type_infered: string
name: parse_data
arguments: label: D678
type_infered: string
name: parse_data
arguments: label: D12
type_infered: string
name: parse_data
arguments: label: D71
type_infered: string
name: parse_data
arguments: label: D332
type_infered: string
name: parse_data
arguments: label: D158
type_infered: string
name: parse_data
arguments: label: D646
type_infered: string
name: parse_data
arguments: label: D114
type_infered: string
name: parse_data
arguments: label: D741
type_infered: string
name: parse_data
arguments: label: D364
type_infered: string
name: parse_data
arguments: label: D792
type_infered: string
name: parse_data
arguments: label: D162
type_infered: string

tool: D671: RT28xx_DIR

tool: D319: CHIPSET

tool: D278: HAS_WOW_SUPPORT

tool: D261: RT28xx_MODE

tool: D301:  

tool: D282: chipset = %s


tool: D748: 2860

tool: D397: 2870

tool: D836: 3090

tool: D337: 2070

tool: D766: y

tool: D519: STA

tool: D602: /mcu/bin/rt2870.bin

tool: D289: /include/mcu/rt2870_firmware.h

tool: D512: RT2870_FirmwareImage

tool: D613: /mcu/bin/rt2860.bin

tool: D1: /include/mcu/rt2860_firmware.h

tool: D650: RT2860_FirmwareImage

tool: D69: 3070

tool: D645: 3572

tool: D423: 3573

tool: D605: 3370

tool: D556: 5370

tool: D630: 5572

tool: D698: 5592

tool: D283: mt7601e

tool: D536: mt7601u

tool: D745: /mcu/bin/MT7601_formal_1.6.bin

tool: D568: /include/mcu/mt7601_firmware.h

tool: D24: MT7601_FirmwareImage

tool: D647: /eeprom/MT7601_USB_V0_D-20130416.bin

tool: D732: /include/eeprom/mt7601_e2p.h

tool: D758: MT7601_E2PImage

tool: D306: /mcu/bin/rt2870_wow.bin

tool: D532: /include/mcu/rt2870_wow_firmware.h

tool: D92: RT2870_WOW_FirmwareImage

tool: D276: Environment value "RT28xx_DIR" is too long!

tool: D390: Environment value "CHIPSET" not export 

tool: D434: Environment value "RT28xx_DIR" not export 

tool: D599: mt7650e

tool: D783: mt7650u

tool: D465: /mcu/bin/MT7650.bin

tool: D391: /include/mcu/mt7650_firmware.h

tool: D761: MT7650_FirmwareImage

tool: D91: mt7630e

tool: D146: mt7630u

tool: D572: mt7610e

tool: D515: mt7610u

tool: D235: /include/mcu/mt7610_firmware.h

tool: D665: MT7610_FirmwareImage

tool: D724: /eeprom/MT7610U_FEM_V1_1.bin

tool: D805: /include/eeprom/mt7610e_e2p.h

tool: D729: MT7610E_E2PImage

tool: D581: mt7662e

tool: D139: mt7662u

tool: D521: /mcu/bin/MT7662_E3_v1.9.bin

tool: D469: /include/mcu/mt7662_firmware.h

tool: D15: MT7662_FirmwareImage

tool: D735: /mcu/bin/mt7662_patch_e3_hdr_v0.0.2_P69.bin

tool: D394: /include/mcu/mt7662_rom_patch.h

tool: D329: mt7662_rom_patch

tool: D287: /eeprom/MT7612E_EEPROM_layout_20131121_2G5G_ePAeLNA_TXTC_off.bin

tool: D343: /include/eeprom/mt76x2_e2p.h

tool: D658: MT76x2_E2PImage

tool: D803: /include/eeprom/mt7610u_e2p.h

tool: D78: MT7610U_E2PImage

tool: D362: mt7632e

tool: D176: mt7632u

tool: D733: mt7612e

tool: D678: mt7612u

tool: D12: mt7662tu

tool: D71: /mcu/bin/mt7662t_firmware_e1.bin

tool: D332: /include/mcu/mt7662t_firmware.h

tool: D158: MT7662T_FirmwareImage

tool: D646: /mcu/bin/mt7662t_patch_e1_hdr.bin

tool: D114: /include/mcu/mt7662t_rom_patch.h

tool: D741: mt7662t_rom_patch

tool: D364: mt7632tu

tool: D792: mt7612tu

tool: D162: unknown chipset = %s


assistant: ```c
int main(int argc, char *argv[]) {
  char infname[512], ine2pname[512], in_rom_patch[512];
  char outfname[512], oute2pname[512], out_rom_patch[512];
  char chipsets[1024];
  char fw_name[128], e2p_name[128], rom_patch_name[128];
  char *rt28xxdir;
  char *chipset, *token;
  char *wow, *rt28xx_mode;
  int is_bin2h_fw = 0, is_bin2h_rom_patch = 0, is_bin2h_e2p = 0;
  rt28xxdir = (char *)getenv("RT28xx_DIR");
  chipset = (char *)getenv("CHIPSET");
  memcpy(chipsets, chipset, strlen(chipset));
  wow = (char *)getenv("HAS_WOW_SUPPORT");
  rt28xx_mode = (char *)getenv("RT28xx_MODE");
  if (!rt28xxdir) {
    printf("Environment value \"RT28xx_DIR\" not export \n");
    return -1;
  }
  if (!chipset) {
    printf("Environment value \"CHIPSET\" not export \n");
    return -1;
  }
  if (strlen(rt28xxdir) > (sizeof(infname) - 100)) {
    printf("Environment value \"RT28xx_DIR\" is too long!\n");
    return -1;
  }
  chipset = strtok(chipsets, " ");
  while (chipset != NULL) {
    printf("chipset = %s\n", chipset);
    memset(infname, 0, 512);
    memset(ine2pname, 0, 512);
    memset(outfname, 0, 512);
    memset(oute2pname, 0, 512);
    memset(fw_name, 0, 128);
    memset(e2p_name, 0, 128);
    memset(in_rom_patch, 0, 512);
    memset(out_rom_patch, 0, 512);
    memset(rom_patch_name, 0, 128);
    strcat(infname, rt28xxdir);
    strcat(ine2pname, rt28xxdir);
    strcat(in_rom_patch, rt28xxdir);
    strcat(outfname, rt28xxdir);
    strcat(oute2pname, rt28xxdir);
    strcat(out_rom_patch, rt28xxdir);
    is_bin2h_fw = 0;
    is_bin2h_rom_patch = 0;
    is_bin2h_e2p = 0;
    if (strncmp(chipset, "2860", 4) == 0) {
      strcat(infname, "/mcu/bin/rt2860.bin");
      strcat(outfname, "/include/mcu/rt2860_firmware.h");
      strcat(fw_name, "RT2860_FirmwareImage");
      is_bin2h_fw = 1;
    } else if (strncmp(chipset, "2870", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "3090", 4) == 0) {
      strcat(infname, "/mcu/bin/rt2860.bin");
      strcat(outfname, "/include/mcu/rt2860_firmware.h");
      strcat(fw_name, "RT2860_FirmwareImage");
      is_bin2h_fw = 1;
    } else if (strncmp(chipset, "2070", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "3070", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "3572", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "3573", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "3370", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "5370", 4) == 0) {
      if ((strncmp(wow, "y", 1) == 0) && (strncmp(rt28xx_mode, "STA", 3) == 0)) {
        strcat(infname, "/mcu/bin/rt2870_wow.bin");
        strcat(outfname, "/include/mcu/rt2870_wow_firmware.h");
        strcat(fw_name, "RT2870_WOW_FirmwareImage");
        is_bin2h_fw = 1;
      } else {
        strcat(infname, "/mcu/bin/rt2870.bin");
        strcat(outfname, "/include/mcu/rt2870_firmware.h");
        strcat(fw_name, "RT2870_FirmwareImage");
        is_bin2h_fw = 1;
      }
    } else if (strncmp(chipset, "5572", 4) == 0) {
      strcat(infname, "/mcu/bin/rt2870.bin");
      strcat(outfname, "/include/mcu/rt2870_firmware.h");
      strcat(fw_name, "RT2870_FirmwareImage");
      is_bin2h_fw = 1;
    } else if (strncmp(chipset, "5592", 4) == 0) {
      strcat(infname, "/mcu/bin/rt2860.bin");
      strcat(outfname, "/include/mcu/rt2860_firmware.h");
      strcat(fw_name, "RT2860_FirmwareImage");
      is_bin2h_fw = 1;
    } else if ((strncmp(chipset, "mt7601e", 7) == 0) || (strncmp(chipset, "mt7601u", 7) == 0)) {
      strcat(infname, "/mcu/bin/MT7601_formal_1.6.bin");
      strcat(outfname, "/include/mcu/mt7601_firmware.h");
      strcat(fw_name, "MT7601_FirmwareImage");
      is_bin2h_fw = 1;
      strcat(ine2pname, "/eeprom/MT7601_USB_V0_D-20130416.bin");
      strcat(oute2pname, "/include/eeprom/mt7601_e2p.h");
      strcat(e2p_name, "MT7601_E2PImage");
      is_bin2h_e2p = 1;
    } else if ((strncmp(chipset, "mt7650e", 7) == 0) || (strncmp(chipset, "mt7650u", 7) == 0) || (strncmp(chipset, "mt7630e", 7) == 0) || (strncmp(chipset, "mt7630u", 7) == 0)) {
      strcat(infname, "/mcu/bin/MT7650.bin");
      strcat(outfname, "/include/mcu/mt7650_firmware.h");
      strcat(fw_name, "MT7650_FirmwareImage");
      is_bin2h_fw = 1;
    } else if ((strncmp(chipset, "mt7610e", 7) == 0) || (strncmp(chipset, "mt7610u", 7) == 0)) {
      strcat(infname, "/mcu/bin/MT7650.bin");
      strcat(outfname, "/include/mcu/mt7610_firmware.h");
      strcat(fw_name, "MT7610_FirmwareImage");
      is_bin2h_fw = 1;
      if ((strncmp(chipset, "mt7610e", 7) == 0)) {
        strcat(ine2pname, "/eeprom/MT7610U_FEM_V1_1.bin");
        strcat(oute2pname, "/include/eeprom/mt7610e_e2p.h");
        strcat(e2p_name, "MT7610E_E2PImage");
      } else if ((strncmp(chipset, "mt7610u", 7) == 0)) {
        strcat(ine2pname, "/eeprom/MT7610U_FEM_V1_1.bin");
        strcat(oute2pname, "/include/eeprom/mt7610u_e2p.h");
        strcat(e2p_name, "MT7610U_E2PImage");
      }
    } else if ((strncmp(chipset, "mt7662e", 7) == 0) || (strncmp(chipset, "mt7662u", 7) == 0) || (strncmp(chipset, "mt7632e", 7) == 0) || (strncmp(chipset, "mt7632u", 7) == 0) || (strncmp(chipset, "mt7612e", 7) == 0) || (strncmp(chipset, "mt7612u", 7) == 0)) {
      strcat(infname, "/mcu/bin/MT7662_E3_v1.9.bin");
      strcat(outfname, "/include/mcu/mt7662_firmware.h");
      strcat(fw_name, "MT7662_FirmwareImage");
      strcat(in_rom_patch, "/mcu/bin/mt7662_patch_e3_hdr_v0.0.2_P69.bin");
      strcat(out_rom_patch, "/include/mcu/mt7662_rom_patch.h");
      strcat(rom_patch_name, "mt7662_rom_patch");
      strcat(ine2pname, "/eeprom/MT7612E_EEPROM_layout_20131121_2G5G_ePAeLNA_TXTC_off.bin");
      strcat(oute2pname, "/include/eeprom/mt76x2_e2p.h");
      strcat(e2p_name, "MT76x2_E2PImage");
      is_bin2h_fw = 1;
      is_bin2h_rom_patch = 1;
      is_bin2h_e2p = 1;
    } else if ((strncmp(chipset, "mt7662tu", 8) == 0) || (strncmp(chipset, "mt7632tu", 8) == 0) || (strncmp(chipset, "mt7612tu", 8) == 0)) {
      strcat(infname, "/mcu/bin/mt7662t_firmware_e1.bin");
      strcat(outfname, "/include/mcu/mt7662t_firmware.h");
      strcat(fw_name, "MT7662T_FirmwareImage");
      strcat(in_rom_patch, "/mcu/bin/mt7662t_patch_e1_hdr.bin");
      strcat(out_rom_patch, "/include/mcu/mt7662t_rom_patch.h");
      strcat(rom_patch_name, "mt7662t_rom_patch");
      is_bin2h_fw = 1;
      is_bin2h_rom_patch = 1;
    } else {
      printf("unknown chipset = %s\n", chipset);
    }
    if (is_bin2h_fw)
      bin2h(infname, outfname, fw_name);
    if (is_bin2h_rom_patch)
      bin2h(in_rom_patch, out_rom_patch, rom_patch_name);
    if (is_bin2h_e2p)
      bin2h(ine2pname, oute2pname, e2p_name);
    chipset = strtok(NULL, " ");
  }
  exit(0);
}
```