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

```asm
<check_index_source>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  lea    D16(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x19d,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%r9
  lea    D325(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1a0,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%r9
  lea    D179(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1a1,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,%r9d
  lea    D127(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1a2,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x34(%rbp),%edx
  sub    $0x1,%edx
  mov    %edx,%edx
  cmp    %rdx,%rax
  jne    L74
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D130(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <error_@plt>
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <error_@plt>
  mov    $0xffffffff,%eax
  jmp    L78
L74:
  movl   $0x0,-0x18(%rbp)
  jmp    L114
L140:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L0
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L0
  lea    D264(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1b0,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  jmp    L68
L0:
  addl   $0x1,-0x18(%rbp)
L114:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L140
L68:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jne    L11
  lea    D29(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1b6,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    $0x1,%eax
  jmp    L78
L11:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    $0x8,%rsp
  push   %rax
  mov    %edx,%r9d
  lea    D259(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1bb,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  add    $0x10,%rsp
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L127
  lea    D68(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1bf,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    $0x1,%eax
  jmp    L78
L127:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L103
  mov    $0x1,%eax
  jmp    L78
L103:
  movl   $0x0,-0x18(%rbp)
  jmp    L28
L15:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L95
  lea    D335(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1cb,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L16
L27:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%r9d
  lea    D315(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1d0,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L159
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L95
L159:
  lea    D17(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1d2,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0x14(%rbp)
L16:
  cmpl   $0x0,-0x14(%rbp)
  jg     L27
L95:
  addl   $0x1,-0x18(%rbp)
L28:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L15
  lea    D108(%rip),%r8
  lea    D142(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1dc,%edx
  lea    D238(%rip),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <debug_@plt>
  mov    $0x0,%eax
L78:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D16
datatype: string
name: unpack_data
arguments: tag: D142
datatype: string
name: unpack_data
arguments: tag: D238
datatype: string
name: unpack_data
arguments: tag: D325
datatype: string
name: unpack_data
arguments: tag: D179
datatype: string
name: unpack_data
arguments: tag: D127
datatype: string
name: unpack_data
arguments: tag: D130
datatype: string
name: unpack_data
arguments: tag: D41
datatype: string
name: unpack_data
arguments: tag: D264
datatype: string
name: unpack_data
arguments: tag: D29
datatype: string
name: unpack_data
arguments: tag: D259
datatype: string
name: unpack_data
arguments: tag: D68
datatype: string
name: unpack_data
arguments: tag: D335
datatype: string
name: unpack_data
arguments: tag: D315
datatype: string
name: unpack_data
arguments: tag: D17
datatype: string
name: unpack_data
arguments: tag: D108
datatype: string

tool: D16: <-----------------------[enter]


tool: D142: check_index_source

tool: D238: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c

tool: D325: (filename ): "%s"


tool: D179: (temp     ): "%s"


tool: D127: (temp_size): "%d"



tool: D130: size of the file too long. (max : %d)


tool: D41: QUITTING!


tool: D264: space or tab detected, ignore it


tool: D29: empty line, ignore it


tool: D259: the first ascii char of the line is: 0x%02x (%c)


tool: D68: comment detected, ignore the line


tool: D335: comment detected, replaced by NULL


tool: D315: temp[j]: 0x%02x


tool: D17: remove extra space


tool: D108: <-----------------------[quit]


assistant: ```c
int check_index_source(unsigned char *filename, unsigned char *temp, unsigned int temp_size) {
  int i;
  int j;
  debug_(1, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 413, __func__, "<-----------------------[enter]\n");
  debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 416, __func__, "(filename ): \"%s\"\n", filename);
  debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 417, __func__, "(temp     ): \"%s\"\n", temp);
  debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 418, __func__, "(temp_size): \"%d\"\n\n", temp_size);
  if (strlen(temp) == temp_size - 1) {
    error_("size of the file too long. (max : %d)\n", temp_size);
    error_("QUITTING!\n");
    return -1;
  }
  for (i = 0; i < strlen(temp); i++)
    if ((temp[i] != 0x20) && (temp[i] != 0x09)) {
      debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 432, __func__, "space or tab detected, ignore it\n");
      break;
    }
  if (i == strlen(temp)) {
    debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 438, __func__, "empty line, ignore it\n");
    return 1;
  }
  debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 443, __func__, "the first ascii char of the line is: 0x%02x (%c)\n", temp[i], temp[i]);
  if (temp[i] == '#') {
    debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 447, __func__, "comment detected, ignore the line\n");
    return 1;
  }
  if (temp[i] != '/') {
    return 1;
  }
  for (i = 0; i < strlen(temp); i++) {
    if (temp[i] == '#') {
      debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 459, __func__, "comment detected, replaced by NULL\n");
      temp[i] = '\0';
      for (j = i - 1; j > 0; j--) {
        debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 464, __func__, "temp[j]: 0x%02x\n", temp[j]);
        if ((temp[j] == 0x20) || (temp[j] == 0x09)) {
          debug_(3, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 466, __func__, "remove extra space\n");
          temp[j] = '\0';
        } else
          break;
      }
    }
  }
  debug_(1, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tcell2020/autodafe-0.1-osx/refs/heads/master/src/autodafe/file.c", 476, __func__, "<-----------------------[quit]\n");
  return 0;
}
```