user: Converte this assembly snippet into its equivalent C code:

```asm
<args>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %r9,0x18(%rsp)
  cmp    $0x1,%edi
  jle    L255
  mov    %edi,%eax
  lea    0x8(%rsi),%rbx
  lea    D26(%rip),%rbp
  sub    $0x2,%eax
  lea    D144(%rip),%r12
  lea    D190(%rip),%r13
  lea    0x10(%rsi,%rax,8),%r14
  lea    D60(%rip),%r15
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L28:
  mov    (%rbx),%rdi
  lea    D204(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L197
  mov    0x8(%rsp),%rax
  movl   $0x1,(%rax)
L195:
  add    $0x8,%rbx
  cmp    %r14,%rbx
  je     L255
L36:
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L185
  mov    (%rbx),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L266
  mov    (%rbx),%rdi
  mov    $0x8,%edx
  mov    %r13,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L28
  mov    (%rbx),%rdi
  mov    $0x6,%edx
  mov    %r15,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L85
  mov    (%rbx),%rdi
  lea    D173(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L118
  mov    0x10(%rsp),%rax
  add    $0x8,%rbx
  movb   $0xff,(%rax)
  cmp    %r14,%rbx
  jne    L36
L255:
  add    $0x38,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L85:
  mov    (%rbx),%rdi
  mov    $0x7,%edx
  lea    D193(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L178
  mov    (%rbx),%rdi
  mov    $0x8,%edx
  lea    D62(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L35
  mov    0x18(%rsp),%rax
  movl   $0x1,(%rax)
  jmp    L195
  cs nopw 0x0(%rax,%rax,1)
L197:
  mov    (%rbx),%rdi
  lea    D170(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L66
  mov    0x8(%rsp),%rax
  movl   $0x2,(%rax)
  jmp    L195
  nopl   0x0(%rax,%rax,1)
L178:
  mov    (%rbx),%rdi
  mov    $0xb,%edx
  lea    D103(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L15
  mov    (%rbx),%rdi
  mov    $0xb,%edx
  lea    D49(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L142
L15:
  mov    (%rbx),%rdi
  call   <strlen@plt>
  lea    -0xa(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    (%rbx),%rax
  mov    %rdi,0x28(%rsp)
  lea    0xb(%rax),%rsi
  call   <strcpy@plt>
  mov    0x28(%rsp),%rdi
  call   <atoi@plt>
  mov    0x70(%rsp),%rcx
  mov    %eax,(%rcx)
  jmp    L195
  nopl   0x0(%rax)
L118:
  mov    (%rbx),%rdi
  lea    D68(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L116
  mov    0x10(%rsp),%rax
  movb   $0x0,(%rax)
  jmp    L195
  nopl   0x0(%rax)
L142:
  mov    (%rbx),%rsi
  mov    0x20(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L195
  nopw   0x0(%rax,%rax,1)
L116:
  mov    (%rbx),%rdi
  lea    D196(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L181
  mov    0x10(%rsp),%rax
  movb   $0x1,(%rax)
  jmp    L195
  nopl   (%rax)
L66:
  mov    (%rbx),%rdi
  lea    D42(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L110
  mov    0x8(%rsp),%rax
  movl   $0x3,(%rax)
  jmp    L195
L35:
  mov    (%rbx),%rdi
  mov    $0x8,%edx
  lea    D112(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L195
  mov    0x18(%rsp),%rax
  movl   $0x0,(%rax)
  jmp    L195
  nopl   (%rax)
L185:
  lea    D29(%rip),%rdi
  call   <printf@plt>
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L266:
  lea    D205(%rip),%rdi
  call   <printf@plt>
  lea    D55(%rip),%rdi
  call   <printf@plt>
  lea    D46(%rip),%rdi
  call   <printf@plt>
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L181:
  lea    D92(%rip),%rdi
  call   <printf@plt>
  jmp    L195
  cs nopw 0x0(%rax,%rax,1)
L110:
  lea    D166(%rip),%rdi
  call   <printf@plt>
  jmp    L195
```

tool_calls: name: unpack_data
arguments: tag: D26
type: string
name: unpack_data
arguments: tag: D144
type: string
name: unpack_data
arguments: tag: D190
type: string
name: unpack_data
arguments: tag: D60
type: string
name: unpack_data
arguments: tag: D204
type: string
name: unpack_data
arguments: tag: D173
type: string
name: unpack_data
arguments: tag: D193
type: string
name: unpack_data
arguments: tag: D62
type: string
name: unpack_data
arguments: tag: D170
type: string
name: unpack_data
arguments: tag: D103
type: string
name: unpack_data
arguments: tag: D49
type: string
name: unpack_data
arguments: tag: D68
type: string
name: unpack_data
arguments: tag: D196
type: string
name: unpack_data
arguments: tag: D42
type: string
name: unpack_data
arguments: tag: D112
type: string
name: unpack_data
arguments: tag: D29
type: string
name: unpack_data
arguments: tag: D205
type: string
name: unpack_data
arguments: tag: D55
type: string
name: unpack_data
arguments: tag: D46
type: string
name: unpack_data
arguments: tag: D92
type: string
name: unpack_data
arguments: tag: D166
type: string

tool: D26: --version

tool: D144: --help

tool: D190: --width=

tool: D60: --eof=

tool: D204: --width=32

tool: D173: --eof=-1

tool: D193: --wrap=

tool: D62: --wrap=y

tool: D170: --width=16

tool: D103: --fwdbound=

tool: D49: --revbound=

tool: D68: --eof=0

tool: D196: --eof=nochg

tool: D42: --width=8

tool: D112: --wrap=n

tool: D29: BestFriend brainfuck interpreter


tool: D205: Usage: bestfriend [FILE]


tool: D55: Runs FILE as a brainfuck program.


tool: D46: If multiple FILEs are given, the last will be run.


tool: D92: Invalid EOF behaviour, defaulting to -1.


tool: D166: Invalid cell width, defaulting to 32-bit.


assistant: ```c
bool args(int argc, char **argv, char *bfpath, int *cwidth, char *eofval, bool *wrap, int *max_fwdsize, int *max_revsize) {
  char *temp;
  for (int i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--version") == 0) {
      printf("BestFriend brainfuck interpreter\n");
      return false;
    } else if (strcmp(argv[i], "--help") == 0) {
      printf("Usage: bestfriend [FILE]\n");
      printf("Runs FILE as a brainfuck program.\n");
      printf("If multiple FILEs are given, the last will be run.\n");
      return false;
    } else if (strncmp(argv[i], "--width=", 8) == 0) {
      if (strcmp(argv[i], "--width=32") == 0) {
        *cwidth = 1;
      } else if (strcmp(argv[i], "--width=16") == 0) {
        *cwidth = 2;
      } else if (strcmp(argv[i], "--width=8") == 0) {
        *cwidth = 3;
      } else {
        printf("Invalid cell width, defaulting to 32-bit.\n");
      }
    } else if (strncmp(argv[i], "--eof=", 6) == 0) {
      if (strcmp(argv[i], "--eof=-1") == 0) {
        *eofval = -1;
      } else if (strcmp(argv[i], "--eof=0") == 0) {
        *eofval = 0;
      } else if (strcmp(argv[i], "--eof=nochg") == 0) {
        *eofval = 1;
      } else {
        printf("Invalid EOF behaviour, defaulting to -1.\n");
      }
    } else if (strncmp(argv[i], "--wrap=", 7) == 0) {
      if (strncmp(argv[i], "--wrap=y", 8) == 0) {
        *wrap = true;
      } else if (strncmp(argv[i], "--wrap=n", 8) == 0) {
        *wrap = false;
      }
    } else if (strncmp(argv[i], "--fwdbound=", 11) == 0) {
      temp = malloc((strlen(argv[i]) - 10) * sizeof(char));
      strcpy(temp, argv[i] + 11);
      *max_fwdsize = atoi(temp);
    } else if (strncmp(argv[i], "--revbound=", 11) == 0) {
      temp = malloc((strlen(argv[i]) - 10) * sizeof(char));
      strcpy(temp, argv[i] + 11);
      *max_fwdsize = atoi(temp);
    } else {
      strcpy(bfpath, argv[i]);
    }
  }
  return true;
}
```