user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x850,%rsp
  mov    %edi,-0x844(%rbp)
  mov    %rsi,-0x850(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x83c(%rbp)
  lea    -0x810(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    D303(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x838(%rbp)
  lea    D328(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x830(%rbp)
  cmpq   $0x0,-0x838(%rbp)
  jne    L128
  lea    D507(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L128:
  cmpq   $0x0,-0x830(%rbp)
  jne    L295
  lea    D120(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L295:
  mov    -0x838(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x39c,%eax
  jbe    L108
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L108:
  mov    -0x838(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D614(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L163
  lea    -0x810(%rbp),%rax
  lea    D387(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L163:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D719(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L219
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L219:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D117(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L196
  lea    -0x810(%rbp),%rax
  lea    D387(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L196:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D674(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L89
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L89:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D389(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L92
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L92:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D404(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L52
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L52:
  mov    -0x830(%rbp),%rax
  mov    $0x4,%edx
  lea    D264(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L9
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L9:
  mov    -0x830(%rbp),%rax
  mov    $0x3,%edx
  lea    D727(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L313
  lea    -0x810(%rbp),%rax
  lea    D366(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L313:
  mov    -0x830(%rbp),%rax
  mov    $0x3,%edx
  lea    D301(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L123
  lea    -0x810(%rbp),%rax
  lea    D387(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L127
L123:
  lea    -0x810(%rbp),%rax
  lea    D387(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L127:
  mov    -0x838(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x410(%rbp),%rax
  lea    D79(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x810(%rbp),%rax
  lea    D457(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x828(%rbp)
  cmpq   $0x0,-0x828(%rbp)
  jne    L77
  lea    -0x810(%rbp),%rax
  mov    %rax,%rsi
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L77:
  lea    -0x410(%rbp),%rax
  lea    D272(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x820(%rbp)
  cmpq   $0x0,-0x820(%rbp)
  jne    L47
  lea    -0x410(%rbp),%rax
  mov    %rax,%rsi
  lea    D322(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L47:
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D570(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x34,%edx
  mov    $0x1,%esi
  lea    D665(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x18,%edx
  mov    $0x1,%esi
  lea    D444(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x42,%edx
  mov    $0x1,%esi
  lea    D556(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D118(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x8,%edx
  mov    $0x1,%esi
  lea    D318(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x47,%edx
  mov    $0x1,%esi
  lea    D308(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x44,%edx
  mov    $0x1,%esi
  lea    D429(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x23,%edx
  mov    $0x1,%esi
  lea    D585(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4c,%edx
  mov    $0x1,%esi
  lea    D501(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4a,%edx
  mov    $0x1,%esi
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x37,%edx
  mov    $0x1,%esi
  lea    D126(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4c,%edx
  mov    $0x1,%esi
  lea    D649(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D677(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4d,%edx
  mov    $0x1,%esi
  lea    D355(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x48,%edx
  mov    $0x1,%esi
  lea    D109(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x46,%edx
  mov    $0x1,%esi
  lea    D382(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x44,%edx
  mov    $0x1,%esi
  lea    D217(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x40,%edx
  mov    $0x1,%esi
  lea    D682(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x47,%edx
  mov    $0x1,%esi
  lea    D508(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x3c,%edx
  mov    $0x1,%esi
  lea    D254(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D504(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x47,%edx
  mov    $0x1,%esi
  lea    D648(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x1d,%edx
  mov    $0x1,%esi
  lea    D573(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x46,%edx
  mov    $0x1,%esi
  lea    D378(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D597(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x44,%edx
  mov    $0x1,%esi
  lea    D491(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D685(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x46,%edx
  mov    $0x1,%esi
  lea    D562(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x47,%edx
  mov    $0x1,%esi
  lea    D386(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x48,%edx
  mov    $0x1,%esi
  lea    D357(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x48,%edx
  mov    $0x1,%esi
  lea    D270(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x49,%edx
  mov    $0x1,%esi
  lea    D345(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x43,%edx
  mov    $0x1,%esi
  lea    D728(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xa,%edx
  mov    $0x1,%esi
  lea    D646(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D281(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x28,%edx
  mov    $0x1,%esi
  lea    D160(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x28,%edx
  mov    $0x1,%esi
  lea    D160(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D703(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
L106:
  mov    -0x828(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %al,-0x83d(%rbp)
  mov    -0x828(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L253
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D564(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x828(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  jmp    L78
L253:
  lea    -0x813(%rbp),%rax
  mov    $0x2,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  cmpl   $0xf,-0x83c(%rbp)
  jle    L58
  mov    -0x820(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  movl   $0x0,-0x83c(%rbp)
L58:
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D314(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  movzbl -0x83d(%rbp),%edx
  lea    -0x813(%rbp),%rax
  lea    D694(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x820(%rbp),%rdx
  lea    -0x813(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fputs@plt>
  mov    -0x820(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D625(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  addl   $0x1,-0x83c(%rbp)
  jmp    L106
L78:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D303
type_guessed: string
name: extract_symbolic_data
arguments: label: D328
type_guessed: string
name: extract_symbolic_data
arguments: label: D507
type_guessed: string
name: extract_symbolic_data
arguments: label: D120
type_guessed: string
name: extract_symbolic_data
arguments: label: D6
type_guessed: string
name: extract_symbolic_data
arguments: label: D614
type_guessed: string
name: extract_symbolic_data
arguments: label: D387
type_guessed: string
name: extract_symbolic_data
arguments: label: D719
type_guessed: string
name: extract_symbolic_data
arguments: label: D366
type_guessed: string
name: extract_symbolic_data
arguments: label: D117
type_guessed: string
name: extract_symbolic_data
arguments: label: D674
type_guessed: string
name: extract_symbolic_data
arguments: label: D389
type_guessed: string
name: extract_symbolic_data
arguments: label: D404
type_guessed: string
name: extract_symbolic_data
arguments: label: D264
type_guessed: string
name: extract_symbolic_data
arguments: label: D727
type_guessed: string
name: extract_symbolic_data
arguments: label: D301
type_guessed: string
name: extract_symbolic_data
arguments: label: D79
type_guessed: string
name: extract_symbolic_data
arguments: label: D457
type_guessed: string
name: extract_symbolic_data
arguments: label: D93
type_guessed: string
name: extract_symbolic_data
arguments: label: D272
type_guessed: string
name: extract_symbolic_data
arguments: label: D322
type_guessed: string
name: extract_symbolic_data
arguments: label: D570
type_guessed: string
name: extract_symbolic_data
arguments: label: D665
type_guessed: string
name: extract_symbolic_data
arguments: label: D444
type_guessed: string
name: extract_symbolic_data
arguments: label: D556
type_guessed: string
name: extract_symbolic_data
arguments: label: D118
type_guessed: string
name: extract_symbolic_data
arguments: label: D318
type_guessed: string
name: extract_symbolic_data
arguments: label: D308
type_guessed: string
name: extract_symbolic_data
arguments: label: D429
type_guessed: string
name: extract_symbolic_data
arguments: label: D585
type_guessed: string
name: extract_symbolic_data
arguments: label: D501
type_guessed: string
name: extract_symbolic_data
arguments: label: D58
type_guessed: string
name: extract_symbolic_data
arguments: label: D126
type_guessed: string
name: extract_symbolic_data
arguments: label: D649
type_guessed: string
name: extract_symbolic_data
arguments: label: D677
type_guessed: string
name: extract_symbolic_data
arguments: label: D355
type_guessed: string
name: extract_symbolic_data
arguments: label: D109
type_guessed: string
name: extract_symbolic_data
arguments: label: D382
type_guessed: string
name: extract_symbolic_data
arguments: label: D217
type_guessed: string
name: extract_symbolic_data
arguments: label: D682
type_guessed: string
name: extract_symbolic_data
arguments: label: D508
type_guessed: string
name: extract_symbolic_data
arguments: label: D254
type_guessed: string
name: extract_symbolic_data
arguments: label: D504
type_guessed: string
name: extract_symbolic_data
arguments: label: D648
type_guessed: string
name: extract_symbolic_data
arguments: label: D573
type_guessed: string
name: extract_symbolic_data
arguments: label: D378
type_guessed: string
name: extract_symbolic_data
arguments: label: D597
type_guessed: string
name: extract_symbolic_data
arguments: label: D491
type_guessed: string
name: extract_symbolic_data
arguments: label: D685
type_guessed: string
name: extract_symbolic_data
arguments: label: D562
type_guessed: string
name: extract_symbolic_data
arguments: label: D386
type_guessed: string
name: extract_symbolic_data
arguments: label: D357
type_guessed: string
name: extract_symbolic_data
arguments: label: D106
type_guessed: string
name: extract_symbolic_data
arguments: label: D270
type_guessed: string
name: extract_symbolic_data
arguments: label: D345
type_guessed: string
name: extract_symbolic_data
arguments: label: D728
type_guessed: string
name: extract_symbolic_data
arguments: label: D646
type_guessed: string
name: extract_symbolic_data
arguments: label: D281
type_guessed: string
name: extract_symbolic_data
arguments: label: D160
type_guessed: string
name: extract_symbolic_data
arguments: label: D703
type_guessed: string
name: extract_symbolic_data
arguments: label: D564
type_guessed: string
name: extract_symbolic_data
arguments: label: D314
type_guessed: string
name: extract_symbolic_data
arguments: label: D694
type_guessed: string
name: extract_symbolic_data
arguments: label: D625
type_guessed: string

tool: D303: RT28xx_DIR

tool: D328: CHIPSET

tool: D507: Environment value "RT28xx_DIR" not export 

tool: D120: Environment value "CHIPSET" not export 

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

tool: D614: 2860

tool: D387: /common/rt2860.bin

tool: D719: 2870

tool: D366: /common/rt2870.bin

tool: D117: 3090

tool: D674: 2070

tool: D389: 3070

tool: D404: 3572

tool: D264: 3370

tool: D727: USB

tool: D301: PCI

tool: D79: /include/firmware.h

tool: D457: r

tool: D93: Can't read file %s 


tool: D272: w

tool: D322: Can't open write file %s 


tool: D570: /*


tool: D665:  Copyright (c) 2007, Ralink Technology Corporation 


tool: D444:  All rights reserved. 



tool: D556:  Redistribution.  Redistribution and use in binary form, without 


tool: D118:  modification, are permitted provided that the following conditions are 


tool: D318:  met: 



tool: D308:  	* Redistributions must reproduce the above copyright notice and the 


tool: D429:  	following disclaimer in the documentation and/or other materials 


tool: D585:  	provided with the distribution. 


tool: D501:  	* Neither the name of Ralink Technology Corporation nor the names of its 


tool: D58:  	suppliers may be used to endorse or promote products derived from this 


tool: D126:  	software without specific prior written permission. 


tool: D649:  	* No reverse engineering, decompilation, or disassembly of this software 


tool: D677:  	is permitted. 



tool: D355:  Limited patent license. Ralink Technology Corporation grants a world-wide, 


tool: D109:  royalty-free, non-exclusive license under patents it now or hereafter 


tool: D382:  owns or controls to make, have made, use, import, offer to sell and 


tool: D217:  sell ("Utilize") this software, but solely to the extent that any 


tool: D682:  such patent is necessary to Utilize the software alone, or in 


tool: D508:  combination with an operating system licensed under an approved Open 


tool: D254:  Source license as listed by the Open Source Initiative at 


tool: D504:  http://opensource.org/licenses.  The patent license shall not apply to 


tool: D648:  any other combinations which include this software.  No hardware per 


tool: D573:  se is licensed hereunder. 



tool: D378:  DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 


tool: D597:  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 


tool: D491:  BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 


tool: D685:  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 


tool: D562:  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 


tool: D386:  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 


tool: D357:  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 


tool: D106:  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 


tool: D270:  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 


tool: D345:  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 


tool: D728:  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 


tool: D646:  DAMAGE. 


tool: D281: */ 


tool: D160: /* AUTO GEN PLEASE DO NOT MODIFY IT */ 


tool: D703: UCHAR FirmwareImage [] = { 


tool: D564: } ;


tool: D314: 0x

tool: D694: %02x

tool: D625: , 

assistant: ```c
int main(int argc, char *argv[]) {
  FILE *infile, *outfile;
  char infname[1024];
  char outfname[1024];
  char *rt28xxdir;
  char *chipset;
  int i = 0;
  unsigned char c;
  memset(infname, 0, 1024);
  memset(outfname, 0, 1024);
  rt28xxdir = (char *)getenv("RT28xx_DIR");
  chipset = (char *)getenv("CHIPSET");
  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;
  }
  strcat(infname, rt28xxdir);
  if (strncmp(chipset, "2860", 4) == 0)
    strcat(infname, "/common/rt2860.bin");
  else if (strncmp(chipset, "2870", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3090", 4) == 0)
    strcat(infname, "/common/rt2860.bin");
  else if (strncmp(chipset, "2070", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3070", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3572", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3370", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "USB", 3) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "PCI", 3) == 0)
    strcat(infname, "/common/rt2860.bin");
  else
    strcat(infname, "/common/rt2860.bin");
  strcat(outfname, rt28xxdir);
  strcat(outfname, "/include/firmware.h");
  infile = fopen(infname, "r");
  if (infile == (FILE *)NULL) {
    printf("Can't read file %s \n", infname);
    return -1;
  }
  outfile = fopen(outfname, "w");
  if (outfile == (FILE *)NULL) {
    printf("Can't open write file %s \n", outfname);
    return -1;
  }
  fputs("/*\n", outfile);
  fputs(" Copyright (c) 2007, Ralink Technology Corporation \n", outfile);
  fputs(" All rights reserved. \n\n", outfile);
  fputs(" Redistribution.  Redistribution and use in binary form, without \n", outfile);
  fputs(" modification, are permitted provided that the following conditions are \n", outfile);
  fputs(" met: \n\n", outfile);
  fputs(" \t* Redistributions must reproduce the above copyright notice and the \n", outfile);
  fputs(" \tfollowing disclaimer in the documentation and/or other materials \n", outfile);
  fputs(" \tprovided with the distribution. \n", outfile);
  fputs(" \t* Neither the name of Ralink Technology Corporation nor the names of its \n", outfile);
  fputs(" \tsuppliers may be used to endorse or promote products derived from this \n", outfile);
  fputs(" \tsoftware without specific prior written permission. \n", outfile);
  fputs(" \t* No reverse engineering, decompilation, or disassembly of this software \n", outfile);
  fputs(" \tis permitted. \n\n", outfile);
  fputs(" Limited patent license. Ralink Technology Corporation grants a world-wide, \n", outfile);
  fputs(" royalty-free, non-exclusive license under patents it now or hereafter \n", outfile);
  fputs(" owns or controls to make, have made, use, import, offer to sell and \n", outfile);
  fputs(" sell (\"Utilize\") this software, but solely to the extent that any \n", outfile);
  fputs(" such patent is necessary to Utilize the software alone, or in \n", outfile);
  fputs(" combination with an operating system licensed under an approved Open \n", outfile);
  fputs(" Source license as listed by the Open Source Initiative at \n", outfile);
  fputs(" http://opensource.org/licenses.  The patent license shall not apply to \n", outfile);
  fputs(" any other combinations which include this software.  No hardware per \n", outfile);
  fputs(" se is licensed hereunder. \n\n", outfile);
  fputs(" DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \n", outfile);
  fputs(" CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, \n", outfile);
  fputs(" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \n", outfile);
  fputs(" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \n", outfile);
  fputs(" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \n", outfile);
  fputs(" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \n", outfile);
  fputs(" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS \n", outfile);
  fputs(" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND \n", outfile);
  fputs(" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \n", outfile);
  fputs(" TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE \n", outfile);
  fputs(" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH \n", outfile);
  fputs(" DAMAGE. \n", outfile);
  fputs("*/ \n", outfile);
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */ \n", outfile);
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */ \n", outfile);
  fputs("\n", outfile);
  fputs("\n", outfile);
  fputs("UCHAR FirmwareImage [] = { \n", outfile);
  while (1) {
    char cc[3];
    c = getc(infile);
    if (feof(infile))
      break;
    memset(cc, 0, 2);
    if (i >= 16) {
      fputs("\n", outfile);
      i = 0;
    }
    fputs("0x", outfile);
    sprintf(cc, "%02x", c);
    fputs(cc, outfile);
    fputs(", ", outfile);
    i++;
  }
  fputs("} ;\n", outfile);
  fclose(infile);
  fclose(outfile);
  exit(0);
}
```