user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    %rsp,%rax
  cmp    %rax,%rsp
  je     L475
L9:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L9
L475:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    0x8(%rbx),%rsi
  mov    %rsp,%rdi
  mov    %rsp,-0x98(%rbp)
  call   <strcpy@plt>
L98:
  cmp    -0x98(%rbp),%rsp
  je     L75
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L98
L75:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    0x10(%rbx),%rsi
  mov    %rsp,%rdi
  mov    %rsp,%r14
  call   <strcpy@plt>
L479:
  cmp    %r14,%rsp
  je     L405
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L479
L405:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    0x18(%rbx),%rsi
  mov    %rsp,%rdi
  mov    %rsp,-0x48(%rbp)
  call   <strcpy@plt>
L194:
  cmp    -0x48(%rbp),%rsp
  je     L274
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L194
L274:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    -0x48(%rbp),%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  lea    D5(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D139(%rip),%rsi
  mov    %rsp,%rdi
  call   <fopen@plt>
  mov    %rax,-0xa0(%rbp)
  mov    %rsp,%rax
L420:
  cmp    %rax,%rsp
  je     L134
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L420
L134:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    -0x48(%rbp),%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  lea    D157(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D174(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    -0x98(%rbp),%rbx
  mov    %rsp,%rdi
  mov    %rbx,%rsi
  call   <strcat@plt>
  lea    D63(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D174(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %rbx,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D137(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D134(%rip),%rsi
  mov    %rsp,%rdi
  call   <fopen@plt>
  mov    $0x2a,%edx
  mov    $0x1,%esi
  lea    D191(%rip),%rdi
  mov    %rax,%rcx
  mov    %rax,-0x88(%rbp)
  call   <fwrite@plt>
  mov    %rsp,%rax
L597:
  cmp    %rax,%rsp
  je     L400
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L597
L400:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  mov    -0x48(%rbp),%rsi
  mov    %rsp,%rdi
  mov    %rsp,%r13
  call   <strcpy@plt>
  lea    D157(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D174(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    -0x98(%rbp),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D63(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D174(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  lea    D49(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
L466:
  cmp    %r13,%rsp
  je     L335
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L466
L335:
  sub    $0x3f0,%rsp
  orq    $0x0,0x3e8(%rsp)
  lea    D208(%rip),%rsi
  xor    %ebx,%ebx
  mov    %r13,%rdi
  mov    %rsp,%r12
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  jne    L157
  jmp    L258
  nopl   0x0(%rax,%rax,1)
L13:
  add    $0x1,%ebx
L157:
  mov    %r15,%rdx
  mov    $0x3e8,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L13
  mov    %r15,%rdi
  call   <fclose@plt>
L559:
  movslq %ebx,%rax
  mov    %rsp,%rcx
  imul   $0x3e8,%rax,%rax
  add    $0xf,%rax
  mov    %rax,%rsi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L627
L595:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L595
L627:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L461
  orq    $0x0,-0x8(%rsp,%rdx,1)
L461:
  mov    %rsp,-0x90(%rbp)
  mov    %rax,%rdx
  mov    %rsp,%rcx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L629:
  cmp    %rcx,%rsp
  je     L132
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L629
L258:
  mov    %r13,%rdi
  call   <perror@plt>
  jmp    L559
L132:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L387
  orq    $0x0,-0x8(%rsp,%rax,1)
L387:
  lea    D208(%rip),%rsi
  mov    %r13,%rdi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L108
  mov    %rsp,-0x70(%rbp)
  mov    -0x90(%rbp),%r13
  mov    %rsp,%rbx
  movl   $0x0,-0x4c(%rbp)
  jmp    L585
  nopl   0x0(%rax)
L293:
  mov    %r12,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,(%r12,%rax,1)
  jne    L568
  movb   $0x0,(%r12,%rax,1)
L568:
  mov    %r13,%rdi
  mov    %r12,%rsi
  add    $0x3e8,%r13
  call   <strcpy@plt>
  mov    -0x48(%rbp),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rdi
  lea    D157(%rip),%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  mov    %r14,%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  lea    D174(%rip),%rsi
  call   <strcat@plt>
  mov    -0x98(%rbp),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %rbx,%rdi
  lea    D63(%rip),%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  mov    %r14,%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  lea    D168(%rip),%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  mov    %r12,%rsi
  call   <strcat@plt>
  mov    %rbx,%rdi
  lea    D82(%rip),%rsi
  add    $0x3e8,%rbx
  call   <strcat@plt>
  addl   $0x1,-0x4c(%rbp)
L585:
  mov    %r15,%rdx
  mov    $0x3e8,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L293
  mov    %r15,%rdi
  call   <fclose@plt>
  lea    -0xf4000(%rsp),%rax
L578:
  cmp    %rax,%rsp
  je     L534
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L578
L534:
  sub    $0x240,%rsp
  orq    $0x0,0x238(%rsp)
  mov    %rsp,-0x78(%rbp)
  lea    -0xf4000(%rsp),%rax
L153:
  cmp    %rax,%rsp
  je     L10
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L153
L108:
  mov    %r13,%rdi
  call   <perror@plt>
L486:
  mov    -0x98(%rbp),%rbx
  lea    D248(%rip),%r12
  mov    %r12,%rdi
  mov    %rbx,%rsi
  call   <printf@plt>
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    -0xa0(%rbp),%rdi
  call   <fprintf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L262
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L10:
  sub    $0x240,%rsp
  orq    $0x0,0x238(%rsp)
  cmpl   $0x0,-0x4c(%rbp)
  mov    %rsp,-0x80(%rbp)
  movq   $0x0,-0x58(%rbp)
  movl   $0x0,-0x48(%rbp)
  je     L486
  nopw   0x0(%rax,%rax,1)
L284:
  mov    -0x70(%rbp),%r12
  add    -0x58(%rbp),%r12
  lea    D208(%rip),%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L553
  lea    -0xf4000(%rsp),%rax
  mov    %rsp,%r12
  cmp    %rax,%rsp
  je     L530
L424:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L424
L530:
  sub    $0x240,%rsp
  orq    $0x0,0x238(%rsp)
  mov    %rsp,%r13
  jmp    L104
  nopl   (%rax)
L255:
  cmpb   $0x3e,0x0(%r13)
  jne    L242
L104:
  mov    %rbx,%rdx
  mov    $0xf4240,%esi
  mov    %r13,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L255
  mov    %r12,%rsp
L579:
  mov    -0x90(%rbp),%r14
  mov    -0x58(%rbp),%rax
  xor    %ebx,%ebx
  mov    -0x70(%rbp),%r13
  add    %r14,%rax
  mov    %rax,-0x68(%rbp)
  jmp    L203
  nopl   (%rax)
L523:
  add    $0x1,%ebx
  add    $0x3e8,%r14
  add    $0x3e8,%r13
  cmp    %ebx,-0x4c(%rbp)
  je     L611
L203:
  cmp    %ebx,-0x48(%rbp)
  jle    L523
  lea    D208(%rip),%rsi
  mov    %r13,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L637
  lea    -0xf4000(%rsp),%rax
  mov    %rsp,-0x60(%rbp)
  cmp    %rax,%rsp
  je     L414
L350:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L350
L414:
  sub    $0x240,%rsp
  orq    $0x0,0x238(%rsp)
  mov    %rsp,%r15
  jmp    L40
  nopl   (%rax)
L397:
  cmpb   $0x3e,(%r15)
  jne    L243
L40:
  mov    %r12,%rdx
  mov    $0xf4240,%esi
  mov    %r15,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L397
  mov    -0x60(%rbp),%rsp
L193:
  mov    -0x78(%rbp),%r15
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %eax,%r9d
  test   %eax,%eax
  jle    L379
  movslq %eax,%rdi
  mov    -0x80(%rbp),%r10
  xor    %eax,%eax
  xor    %esi,%esi
  xor    %r12d,%r12d
  mov    %r15,%r8
  jmp    L190
  nopl   (%rax)
L228:
  movzbl (%r10,%rax,1),%ecx
  cmp    $0x4e,%cl
  je     L548
  cmp    %cl,%dl
  setne  %dl
  add    $0x1,%rax
  movzbl %dl,%edx
  add    %edx,%r12d
  cmp    %rax,%rdi
  je     L481
L190:
  movzbl (%r8,%rax,1),%edx
  cmp    $0x4e,%dl
  jne    L228
L548:
  add    $0x1,%rax
  add    $0x1,%esi
  cmp    %rax,%rdi
  jne    L190
L481:
  pxor   %xmm0,%xmm0
  sub    %esi,%r9d
  cvtsi2ss %r12d,%xmm0
L480:
  pxor   %xmm1,%xmm1
  mov    %r9d,-0x60(%rbp)
  cvtsi2ss %r9d,%xmm1
  divss  %xmm1,%xmm0
  movss  D88(%rip),%xmm1
  mulss  D7(%rip),%xmm0
  subss  %xmm0,%xmm1
  cvttss2si %xmm1,%edi
  call   <log@plt>
  mov    -0x60(%rbp),%r9d
  mov    -0x68(%rbp),%rdx
  mov    %r12d,%r8d
  mulss  D118(%rip),%xmm0
  mov    %r14,%rcx
  mov    -0x88(%rbp),%rdi
  lea    D108(%rip),%rsi
  mov    $0x1,%eax
  cvtss2sd %xmm0,%xmm0
  call   <fprintf@plt>
  jmp    L523
  nopl   (%rax)
L611:
  addl   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  addq   $0x3e8,-0x58(%rbp)
  cmp    %eax,-0x4c(%rbp)
  jne    L284
  jmp    L486
  nopl   (%rax)
L243:
  mov    %r15,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,(%r15,%rax,1)
  jne    L394
  movb   $0x0,(%r15,%rax,1)
L394:
  mov    -0x80(%rbp),%rdi
  mov    %r15,%rsi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  jmp    L40
  nopw   0x0(%rax,%rax,1)
L242:
  mov    %r13,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x0(%r13,%rax,1)
  jne    L636
  movb   $0x0,0x0(%r13,%rax,1)
L636:
  mov    -0x78(%rbp),%rdi
  mov    %r13,%rsi
  call   <strcpy@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  jmp    L104
  nopl   0x0(%rax)
L637:
  mov    %r13,%rdi
  call   <perror@plt>
  jmp    L193
  nopl   (%rax)
L553:
  mov    %r12,%rdi
  call   <perror@plt>
  jmp    L579
L379:
  pxor   %xmm0,%xmm0
  xor    %r12d,%r12d
  jmp    L480
L262:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D5
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D139
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D157
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D174
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D63
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D137
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D134
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D191
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D49
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D208
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D168
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D82
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D248
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D88
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_label: D7
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_label: D118
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_label: D108
type_guessed: string

tool: D5: /Analysis/log.txt

tool: D139: a

tool: D157: /Analysis/

tool: D174: /

tool: D63: _

tool: D137: _di_simulated.csv

tool: D134: w

tool: D191: Isolate_1,Isolate_2,SNPs,Sites,Divergence


tool: D49: Isolates.txt

tool: D208: r

tool: D168: /Intergenic_files/

tool: D82: .fasta

tool: D248: %s di calculated.


tool: {"D88": [0x00,0x00,0x80,0x3f]}

tool: {"D7": [0xab,0xaa,0xaa,0x3f]}

tool: {"D118": [0x00,0x00,0x40,0xbf]}

tool: D108: %s,%s,%i,%i,%0.6f


assistant: ```c
int main(int argc, char *argv[]) {
  int arg_len = 1000;
  char species[arg_len];
  strcpy(species, argv[1]);
  char analysis[arg_len];
  strcpy(analysis, argv[2]);
  char base_dir[arg_len];
  strcpy(base_dir, argv[3]);
  char log_file_name[arg_len];
  strcpy(log_file_name, base_dir);
  strcat(log_file_name, "/Analysis/log.txt");
  FILE *log_file = fopen(log_file_name, "a");
  char output_file_name[arg_len];
  strcpy(output_file_name, base_dir);
  strcat(output_file_name, "/Analysis/");
  strcat(output_file_name, analysis);
  strcat(output_file_name, "/");
  strcat(output_file_name, species);
  strcat(output_file_name, "_");
  strcat(output_file_name, analysis);
  strcat(output_file_name, "/");
  strcat(output_file_name, species);
  strcat(output_file_name, "_di_simulated.csv");
  FILE *output = fopen(output_file_name, "w");
  fprintf(output, "Isolate_1,Isolate_2,SNPs,Sites,Divergence\n");
  char isolates_file_name[arg_len];
  strcpy(isolates_file_name, base_dir);
  strcat(isolates_file_name, "/Analysis/");
  strcat(isolates_file_name, analysis);
  strcat(isolates_file_name, "/");
  strcat(isolates_file_name, species);
  strcat(isolates_file_name, "_");
  strcat(isolates_file_name, analysis);
  strcat(isolates_file_name, "/");
  strcat(isolates_file_name, "Isolates.txt");
  char isolate_name[arg_len];
  int isolate_count;
  isolate_count = 0;
  FILE *isolates_file = fopen(isolates_file_name, "r");
  if (isolates_file != NULL) {
    while (fgets(isolate_name, sizeof isolate_name, isolates_file) != NULL) {
      isolate_count++;
    }
    fclose(isolates_file);
  } else {
    perror(isolates_file_name);
  }
  char isolate_name_array[isolate_count][arg_len];
  char isolate_file_name_array[isolate_count][arg_len];
  isolate_count = 0;
  FILE *isolates_file_2 = fopen(isolates_file_name, "r");
  if (isolates_file_2 != NULL) {
    while (fgets(isolate_name, sizeof isolate_name, isolates_file_2) != NULL) {
      int isolate_name_len;
      isolate_name_len = strlen(isolate_name);
      if (isolate_name[(isolate_name_len - 1)] == '\n') {
        isolate_name[(isolate_name_len - 1)] = '\0';
      }
      strcpy(isolate_name_array[isolate_count], isolate_name);
      strcpy(isolate_file_name_array[isolate_count], base_dir);
      strcat(isolate_file_name_array[isolate_count], "/Analysis/");
      strcat(isolate_file_name_array[isolate_count], analysis);
      strcat(isolate_file_name_array[isolate_count], "/");
      strcat(isolate_file_name_array[isolate_count], species);
      strcat(isolate_file_name_array[isolate_count], "_");
      strcat(isolate_file_name_array[isolate_count], analysis);
      strcat(isolate_file_name_array[isolate_count], "/Intergenic_files/");
      strcat(isolate_file_name_array[isolate_count], isolate_name);
      strcat(isolate_file_name_array[isolate_count], ".fasta");
      isolate_count++;
    }
    fclose(isolates_file_2);
  } else {
    perror(isolates_file_name);
  }
  int a;
  int b;
  int i;
  int genome_max = 1000000;
  char genome1[genome_max];
  char genome2[genome_max];
  int count;
  count = 0;
  for (a = 0; a < isolate_count; a++) {
    FILE *file1 = fopen(isolate_file_name_array[a], "r");
    if (file1 != NULL) {
      char line1[genome_max];
      while (fgets(line1, sizeof line1, file1) != NULL) {
        if (line1[0] != '>') {
          int line1_len = strlen(line1);
          line1_len = (line1_len - 1);
          if (line1[line1_len] == '\n') {
            line1[line1_len] = '\0';
          }
          strcpy(genome1, line1);
          fclose(file1);
        }
      }
    } else {
      perror(isolate_file_name_array[a]);
    }
    for (b = 0; b < isolate_count; b++) {
      if (a > b) {
        FILE *file2 = fopen(isolate_file_name_array[b], "r");
        if (file2 != NULL) {
          char line2[genome_max];
          while (fgets(line2, sizeof line2, file2) != NULL) {
            if (line2[0] != '>') {
              int line2_len = strlen(line2);
              line2_len = (line2_len - 1);
              if (line2[line2_len] == '\n') {
                line2[line2_len] = '\0';
              }
              strcpy(genome2, line2);
              fclose(file2);
            }
          }
        } else {
          perror(isolate_file_name_array[b]);
        }
        int genome_len;
        genome_len = strlen(genome1);
        int snp;
        snp = 0;
        int n;
        n = 0;
        for (i = 0; i < genome_len; i++) {
          if (genome1[i] == 'N' || genome2[i] == 'N') {
            n++;
          } else {
            if (genome1[i] != genome2[i]) {
              snp++;
            }
          }
        }
        int sites;
        sites = (genome_len - n);
        float div;
        div = ((float)snp / sites);
        float JC_div;
        JC_div = (((float)-3 / 4) * (log(1 - (((float)4 / 3) * div))));
        fprintf(output, "%s,%s,%i,%i,%0.6f\n", isolate_name_array[a], isolate_name_array[b], snp, sites, JC_div);
        count++;
      }
    }
  }
  printf("%s di calculated.\n", species);
  fprintf(log_file, "%s di calculated.\n", species);
  return 0;
}
```