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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpl   $0x2,-0x34(%rbp)
  jg     L136
  mov    $0x0,%eax
  jmp    L156
L136:
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L14
  mov    $0x0,%eax
  jmp    L156
L14:
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L146
L78:
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x64,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L13
  addl   $0x1,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L110
L32:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  je     L111
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L17
L111:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L99
  jmp    L146
L99:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L133
  mov    -0x28(%rbp),%eax
  jmp    L156
L133:
  movl   $0x0,-0x20(%rbp)
  addl   $0x1,-0x24(%rbp)
L17:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
  addl   $0x1,-0x20(%rbp)
L110:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L32
L146:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L78
  jmp    L74
L13:
  nop
L74:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L156:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D6
data_type: string

tool: D6: r

assistant: ```c
int main(int argc, char **argv) {
  if (argc < 3) {
    return 0;
  }
  FILE *qfile = fopen(argv[2], "r");
  if (qfile == NULL) {
    return 0;
  }
  char *ques = (char *)malloc(100);
  int line = 0;
  int siz, i, k;
  char *voc = (char *)malloc(2 * 5);
  while (feof(qfile) == 0) {
    ques = fgets(ques, 100, qfile);
    if (ques == NULL)
      break;
    line++;
    siz = strlen(ques) - 1;
    ques[siz] = '\0';
    for (i = 0, k = 0; i <= siz; i++, k++) {
      if (ques[i] == ',' || i == siz) {
        voc[k] = '\0';
        if (strstr(argv[1], voc) == NULL)
          break;
        else if (i == siz)
          return line;
        k = 0;
        i++;
      }
      voc[k] = ques[i];
    }
  }
  free(ques);
  free(voc);
  return 0;
}
```