user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    D35(%rip),%r13
  push   %r12
  mov    $0x1,%r12d
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x98,%rsp
  mov    %edi,0x14(%rsp)
  lea    D3(%rip),%rdi
  lea    0x20(%rsp),%r14
  mov    %rsi,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    D32(%rip),%rdi
  call   <puts@plt>
  cmp    $0x1,%ebx
  jle    L161
L42:
  mov    0x18(%rsp),%rdx
  movslq %r12d,%r15
  movb   $0x0,0x20(%rsp)
  lea    0x1(%r12),%ecx
  lea    0x0(,%r15,8),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    (%rbx),%rsi
  cmpb   $0x2d,(%rsi)
  jne    L222
  cmp    %ecx,0x14(%rsp)
  jle    L131
  mov    0x18(%rsp),%rdx
  lea    0x10(%rdx,%rax,1),%rbp
  mov    0x14(%rsp),%eax
  sub    $0x2,%eax
  sub    %r12,%rax
  mov    $0x2,%r12d
  and    $0xfffffffe,%eax
  lea    0x2(%r15,%rax,1),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L143:
  cmpb   $0x6f,0x1(%rsi)
  jne    L246
  mov    %r14,(%rsp)
  mov    -0x8(%rbp),%rsi
  mov    %rbp,%rbx
  xor    %edi,%edi
  jmp    L247
  nopl   0x0(%rax)
L128:
  cmp    $0x2e,%al
  je     L141
  mov    %al,(%r14,%rdi,1)
  add    $0x1,%rdi
  cmp    $0x5f,%rdi
  je     L141
L247:
  movzbl (%rsi,%rdi,1),%eax
  test   %al,%al
  jne    L128
L141:
  add    %r14,%rdi
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    0x0(%rbp),%rsi
  lea    (%r12,%r15,1),%r9d
  add    $0x2,%r15
  cmpb   $0x2d,(%rsi)
  jne    L113
  add    $0x10,%rbp
  cmp    0x8(%rsp),%r15
  jne    L143
L80:
  add    $0x2,%r9d
  cmp    0x14(%rsp),%r9d
  jl     L75
  mov    0x18(%rsp),%rax
  lea    D38(%rip),%rdi
  mov    0x8(%rax,%r15,8),%rdx
  xor    %eax,%eax
  call   <printf@plt>
L161:
  xor    %eax,%eax
  call   <help@plt>
  mov    $0x1,%eax
L48:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L191
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L246:
  lea    D13(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L161
L113:
  cmpb   $0x0,0x20(%rsp)
  je     L67
L199:
  mov    (%rsp),%rsi
  mov    (%rbx),%rdi
  mov    %r9d,0x8(%rsp)
  call   <convert@plt>
  mov    0x8(%rsp),%r9d
  lea    0x1(%r9),%r12d
  cmp    %r12d,0x14(%rsp)
  jg     L42
  xor    %eax,%eax
  jmp    L48
L75:
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L161
L67:
  mov    %r9d,%r12d
L46:
  xor    %eax,%eax
  jmp    L182
  nop
L147:
  test   %cl,%cl
  je     L241
  mov    (%rsp),%rdx
  mov    %cl,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    $0x5f,%rax
  je     L169
L182:
  movzbl (%rsi,%rax,1),%ecx
  movslq %eax,%rdi
  cmp    $0x2e,%cl
  jne    L147
L241:
  add    (%rsp),%rdi
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %r12d,%r9d
  jmp    L199
L222:
  mov    %r14,(%rsp)
  jmp    L46
L131:
  mov    %r12d,%r9d
  jmp    L80
L169:
  mov    $0x5f,%edi
  jmp    L241
L191:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D35
data_type: string
name: retrieve_data
arguments: data_tag: D3
data_type: string
name: retrieve_data
arguments: data_tag: D32
data_type: string
name: retrieve_data
arguments: data_tag: D38
data_type: string
name: retrieve_data
arguments: data_tag: D13
data_type: string
name: retrieve_data
arguments: data_tag: D18
data_type: string

tool: D35: .cad

tool: D3: skinless - base frame generator

tool: D32: Copyright (C) 2001  Seth Galbraith

tool: D38: ERROR: option '%s %s' not followed by a filename.


tool: D13: ERROR: unrecognized option '%s'.


tool: D18: ERROR: option '%s' not followed by a value.


assistant: ```c
int main(int argc, char **argv) {
  int i, c;
  char outfile[100];
  printf("skinless - base frame generator\n");
  printf("Copyright (C) 2001  Seth Galbraith\n");
  if (argc < 2) {
    help();
    return 1;
  }
  for (i = 1; i < argc; i++) {
    outfile[0] = '\0';
    while (argv[i][0] == '-') {
      if (i + 2 > argc) {
        if (i + 3 > argc)
          printf("ERROR: option '%s %s' not followed by a filename.\n", argv[i], argv[i + 1]);
        else
          printf("ERROR: option '%s' not followed by a value.\n", argv[i]);
        help();
        return 1;
      }
      switch (argv[i][1]) {
      case 'o':
        for (c = 0; c < 95 && argv[i + 1][c] && argv[i + 1][c] != '.'; c++)
          outfile[c] = argv[i + 1][c];
        sprintf(outfile + c, ".cad");
        break;
      default:
        printf("ERROR: unrecognized option '%s'.\n", argv[i]);
        help();
        return 1;
      }
      i += 2;
    }
    if (outfile[0] == '\0') {
      for (c = 0; c < 95 && argv[i][c] && argv[i][c] != '.'; c++)
        outfile[c] = argv[i][c];
      sprintf(outfile + c, ".cad");
    }
    convert(argv[i], outfile);
  }
  return 0;
}
```