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

```asm
<main>:
  endbr64
  push   %r13
  lea    D42(%rip),%rsi
  lea    D27(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L254
  lea    D40(%rip),%rsi
  lea    D47(%rip),%rdi
  mov    %rax,%r12
  mov    %rsp,%rbx
  call   <fopen@plt>
  mov    %rax,%rbp
  jmp    L187
  nopl   0x0(%rax,%rax,1)
L171:
  movzbl (%rsp),%eax
  xor    %r13d,%r13d
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L78
  movzbl 0x1(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L38
  movzbl 0x2(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L60
  movzbl 0x3(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L67
  movzbl 0x4(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L311
  movzbl 0x5(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L172
  movzbl 0x6(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L85
  movzbl 0x7(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L137
  movzbl 0x8(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L28
  movzbl 0x9(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L266
  movzbl 0xa(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L276
  movzbl 0xb(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L211
  movzbl 0xc(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L82
  movzbl 0xd(%rsp),%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L138
  movzbl 0xe(%rsp),%eax
  xor    %r13d,%r13d
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x1a,%al
  setb   %r13b
  add    $0xe,%r13d
  nopl   0x0(%rax)
L78:
  movslq %r13d,%rax
  movb   $0x0,(%rsp,%rax,1)
  movsbl (%rsp),%edi
  call   <tolower@plt>
  mov    $0x1,%esi
  mov    %rbx,%rdi
  mov    %rbp,%rcx
  mov    %r13d,%edx
  mov    %al,(%rsp)
  call   <fwrite@plt>
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <putc@plt>
L187:
  mov    %r12,%rdx
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L171
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
L173:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L38:
  mov    $0x1,%r13d
  jmp    L78
L60:
  mov    $0x2,%r13d
  jmp    L78
L67:
  mov    $0x3,%r13d
  jmp    L78
L311:
  mov    $0x4,%r13d
  jmp    L78
L172:
  mov    $0x5,%r13d
  jmp    L78
L85:
  mov    $0x6,%r13d
  jmp    L78
L137:
  mov    $0x7,%r13d
  jmp    L78
L28:
  mov    $0x8,%r13d
  jmp    L78
L266:
  mov    $0x9,%r13d
  jmp    L78
L276:
  mov    $0xa,%r13d
  jmp    L78
L211:
  mov    $0xb,%r13d
  jmp    L78
L254:
  lea    D12(%rip),%rdi
  call   <printf@plt>
  jmp    L173
L82:
  mov    $0xc,%r13d
  jmp    L78
L138:
  mov    $0xd,%r13d
  jmp    L78
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D42
data_type: string
name: extract_symbolic_data
arguments: data_label: D27
data_type: string
name: extract_symbolic_data
arguments: data_label: D40
data_type: string
name: extract_symbolic_data
arguments: data_label: D47
data_type: string
name: extract_symbolic_data
arguments: data_label: D12
data_type: string

tool: D42: r

tool: D27: ./all-names.txt

tool: D40: a

tool: D47: ./all-names2.txt

tool: D12: cannot open ./all-names.txt


assistant: ```c
int main(int argc, char const *argv[]) {
  FILE *fp1, *fp2;
  char line[16];
  fp1 = fopen("./all-names.txt", "r");
  if (fp1 == NULL) {
    printf("cannot open ./all-names.txt\n");
    return 0;
  }
  fp2 = fopen("./all-names2.txt", "a");
  int i = 0;
  while (fgets(line, sizeof(line), fp1) != NULL) {
    while (((line[i] >= 'a' && line[i] <= 'z') || (line[i] >= 'A' && line[i] <= 'Z'))) {
      i++;
    }
    line[i] = '\0';
    line[0] = tolower(line[0]);
    fwrite(line, sizeof(char), i, fp2);
    putc('\n', fp2);
    i = 0;
  }
  fclose(fp1);
  fclose(fp2);
  return 0;
}
```