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
L80:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L80
  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    D56(%rip),%rsi
  call   <fopen@plt>
  movl   $0x0,0x1c(%rsp)
  mov    %rax,%r12
  nopl   (%rax)
L123:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L229
  mov    %r12,%rdx
  mov    $0x19000,%esi
  mov    %r13,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L123
  mov    %r13,%rdi
  call   <strlen@plt>
  sub    $0x2,%eax
  cltq
  movb   $0x0,0x7d030(%rsp,%rax,1)
  movzbl 0x7d030(%rsp),%eax
  cmp    $0x6e,%al
  je     L215
  cmp    $0x77,%al
  je     L223
  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>
L102:
  cmp    $0x3,%r14d
  jne    L123
  mov    %r12,%rdi
  call   <feof@plt>
  mov    0x1c(%rsp),%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D42(%rip),%rdi
  mov    %rbp,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D65(%rip),%rdi
  call   <puts@plt>
L1:
  lea    0x7d02d(%rsp),%rax
  mov    %rbx,%r13
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    D82(%rip),%r12
L101:
  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     L101
L11:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L25
  lea    0x19020(%rsp),%rax
  movl   $0x0,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L33:
  mov    0x8(%rsp),%esi
  xor    %eax,%eax
  mov    %rbp,%rdx
  lea    D48(%rip),%rdi
  mov    %rbp,%r13
  call   <printf@plt>
  cmpb   $0x0,0x0(%rbp)
  mov    0x10(%rsp),%r15
  je     L36
  nopl   0x0(%rax,%rax,1)
L183:
  test   %r14d,%r14d
  je     L114
  movzbl 0x0(%r13),%esi
  xor    %eax,%eax
L39:
  movslq %eax,%rdx
  cmp    0x7d02d(%rsp,%rdx,1),%sil
  je     L32
  add    $0x1,%eax
  cmp    %eax,%r14d
  jg     L39
  cmp    %eax,%r14d
  je     L114
  nopw   0x0(%rax,%rax,1)
L94:
  add    $0x1,%r13
  cmpb   $0x0,0x0(%r13)
  jne    L183
L36:
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0x1c(%rsp)
  je     L240
L194:
  mov    %rbp,%rax
  mov    0x10(%rsp),%rbp
  mov    %rax,0x10(%rsp)
  jmp    L33
  nopl   0x0(%rax)
L32:
  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    0x2(%r14),%eax
  movb   $0x0,(%r15)
  cmp    %eax,%r14d
  jne    L94
L114:
  movzbl 0x0(%r13),%eax
  add    $0x1,%r13
  movb   $0x0,0x1(%r15)
  add    $0x1,%r15
  mov    %al,-0x1(%r15)
  cmpb   $0x0,0x0(%r13)
  jne    L183
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0x1c(%rsp)
  jne    L194
L240:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    D97(%rip),%rdi
  call   <printf@plt>
  mov    0x96038(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x96048,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L223:
  lea    0x7d032(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  jmp    L102
L215:
  lea    0x7d032(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,0x1c(%rsp)
  jmp    L102
L229:
  mov    0x1c(%rsp),%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  mov    %rbp,%rsi
  call   <printf@plt>
  lea    D65(%rip),%rdi
  call   <puts@plt>
  test   %r14d,%r14d
  je     L11
  jmp    L1
L25:
  mov    %rbp,0x10(%rsp)
  jmp    L240
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D56
type_guessed: string
name: read_data
arguments: data_tag: D45
type_guessed: string
name: read_data
arguments: data_tag: D42
type_guessed: string
name: read_data
arguments: data_tag: D65
type_guessed: string
name: read_data
arguments: data_tag: D82
type_guessed: string
name: read_data
arguments: data_tag: D48
type_guessed: string
name: read_data
arguments: data_tag: D97
type_guessed: string

tool: D56: r

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


tool: D42: Initial String: w = %s


tool: D65: Substitution Strings:

tool: D82:                        %c = %s


tool: D48: Pass %d = %s


tool: D97: 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);
}
```