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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x96000(%rsp),%r11
L37:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L37
  sub    $0x48,%rsp
  pxor   %xmm0,%xmm0
  mov    $0x18ff0,%edx
  xor    %r14d,%r14d
  mov    %rsi,%r12
  lea    0x7d040(%rsp),%rdi
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x96038(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rbp
  movaps %xmm0,0x7d030(%rsp)
  lea    0x32020(%rsp),%rbx
  call   <memset@plt>
  mov    $0x32000,%edx
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  mov    %dx,0x7d02d(%rsp)
  mov    $0x4b000,%edx
  lea    0x7d030(%rsp),%r13
  movb   $0x0,0x7d02f(%rsp)
  call   <memset@plt>
  mov    0x8(%r12),%rdi
  lea    D38(%rip),%rsi
  call   <fopen@plt>
  movl   $0x0,0x1c(%rsp)
  mov    %rax,%r12
  nopl   (%rax)
L184:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L164
L180:
  cmp    $0x3,%r14d
  je     L216
  mov    %r12,%rdx
  mov    $0x19000,%esi
  mov    %r13,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L184
  mov    %r13,%rdi
  call   <strlen@plt>
  sub    $0x2,%eax
  cltq
  movb   $0x0,0x7d030(%rsp,%rax,1)
  movzbl 0x7d030(%rsp),%eax
  cmp    $0x6e,%al
  je     L173
  cmp    $0x77,%al
  je     L49
  movslq %r14d,%rdx
  lea    0x7d032(%rsp),%rsi
  add    $0x1,%r14d
  mov    %al,0x7d02d(%rsp,%rdx,1)
  lea    (%rdx,%rdx,4),%rax
  lea    (%rax,%rax,4),%rdi
  shl    $0xc,%rdi
  add    %rbx,%rdi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L180
L164:
  mov    0x1c(%rsp),%esi
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  mov    %rbp,%rsi
  call   <printf@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  test   %r14d,%r14d
  je     L130
L83:
  lea    0x7d02d(%rsp),%rax
  mov    %rbx,%r13
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    D59(%rip),%r12
L136:
  mov    0x8(%rsp),%rax
  mov    %r13,%rdx
  mov    %r12,%rdi
  add    $0x19000,%r13
  movsbl (%rax,%r15,1),%esi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %r15d,%r14d
  jg     L136
L130:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L237
  lea    0x19020(%rsp),%rax
  movl   $0x0,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L124:
  mov    0x8(%rsp),%esi
  xor    %eax,%eax
  mov    %rbp,%rdx
  lea    D92(%rip),%rdi
  mov    %rbp,%r13
  call   <printf@plt>
  cmpb   $0x0,0x0(%rbp)
  mov    0x10(%rsp),%r15
  je     L22
  nopl   0x0(%rax,%rax,1)
L28:
  xor    %eax,%eax
  test   %r14d,%r14d
  jne    L62
  jmp    L101
  nopl   0x0(%rax)
L106:
  add    $0x1,%eax
  cmp    %eax,%r14d
  jle    L53
L62:
  movslq %eax,%rdx
  movzbl 0x7d02d(%rsp,%rdx,1),%ecx
  cmp    %cl,0x0(%r13)
  jne    L106
  lea    (%rdx,%rdx,4),%rax
  mov    %r15,%rdi
  lea    (%rax,%rax,4),%r8
  shl    $0xc,%r8
  lea    (%rbx,%r8,1),%r12
  mov    %r12,%rsi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%r15
  lea    0x1(%r14),%eax
  add    $0x1,%eax
  movb   $0x0,(%r15)
  cmp    %eax,%r14d
  jg     L62
L53:
  je     L101
L168:
  add    $0x1,%r13
  cmpb   $0x0,0x0(%r13)
  jne    L28
L22:
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0x1c(%rsp)
  je     L176
  mov    %rbp,%rax
  mov    0x10(%rsp),%rbp
  mov    %rax,0x10(%rsp)
  jmp    L124
  nopw   0x0(%rax,%rax,1)
L101:
  movzbl 0x0(%r13),%eax
  add    $0x1,%r15
  movb   $0x0,(%r15)
  mov    %al,-0x1(%r15)
  jmp    L168
L49:
  lea    0x7d032(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  jmp    L184
L173:
  lea    0x7d032(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,0x1c(%rsp)
  jmp    L184
L237:
  mov    %rbp,0x10(%rsp)
L176:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    0x96038(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L135
  add    $0x96048,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L216:
  mov    0x1c(%rsp),%esi
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  jmp    L83
L135:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D38
type_guessed: string
name: disassemble_data
arguments: data_label: D17
type_guessed: string
name: disassemble_data
arguments: data_label: D6
type_guessed: string
name: disassemble_data
arguments: data_label: D75
type_guessed: string
name: disassemble_data
arguments: data_label: D59
type_guessed: string
name: disassemble_data
arguments: data_label: D92
type_guessed: string
name: disassemble_data
arguments: data_label: D7
type_guessed: string

tool: D38: r

tool: D17: Number of passes: n=%d


tool: D6: Initial String: w = %s


tool: D75: Substitution Strings:

tool: D59:                        %c = %s


tool: D92: Pass %d = %s


tool: D7: Results = %s


assistant: ```c
int main(int argc, char *argv[]) {
  FILE *fp;
  char Input[102400] = {0};
  int substrs = 0;
  int n = 0;
  int passes = 0;
  int NumStrs = 0;
  char *src = NULL;
  char *dest = NULL;
  char *tmp = NULL;
  char Ans_Arrays[2][102400] = {0};
  char Characters[3] = {0};
  char Strings[3][102400] = {0};
  char *destwlkr;
  char *srcwlkr;
  srcwlkr = src = Ans_Arrays[0];
  destwlkr = dest = Ans_Arrays[1];
  fp = fopen(argv[1], "r");
  while (!feof(fp) && (NumStrs < 3)) {
    if (fgets(Input, 102400, fp) == NULL)
      continue;
    Input[strlen(Input) - 2] = '\0';
    switch (Input[0]) {
    case 'n':
      n = atoi(&Input[2]);
      break;
    case 'w':
      strcpy(src, &Input[2]);
      break;
    default:
      Characters[NumStrs] = Input[0];
      strcpy(Strings[NumStrs], &Input[2]);
      NumStrs++;
      break;
    }
  }
  printf("Number of passes: n=%d\n", n);
  printf("Initial String: w = %s\n", src);
  printf("Substitution Strings:\n");
  for (substrs = 0; substrs < NumStrs; substrs++)
    printf("                       %c = %s\n", Characters[substrs], Strings[substrs]);
  printf("\n");
  for (passes = 0; passes < n; passes++) {
    printf("Pass %d = %s\n", passes, srcwlkr);
    while (*srcwlkr != '\0') {
      for (substrs = 0; substrs < NumStrs; substrs++) {
        if (*srcwlkr == Characters[substrs]) {
          strcpy(destwlkr, Strings[substrs]);
          destwlkr += strlen(Strings[substrs]);
          *destwlkr = '\0';
          substrs = NumStrs + 1;
        }
      }
      if (substrs == NumStrs) {
        *destwlkr = *srcwlkr;
        *(destwlkr + 1) = '\0';
        destwlkr++;
      }
      srcwlkr++;
    }
    tmp = src;
    srcwlkr = src = dest;
    destwlkr = dest = tmp;
  }
  printf("\n");
  printf("Results = %s\n", src);
}
```