user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x74(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x1,-0x74(%rbp)
  jg     L94
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L94:
  mov    -0x80(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x5,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D66(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x30(%rbp),%r8
  lea    -0x38(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x48(%rbp),%rdx
  lea    -0x60(%rbp),%rsi
  lea    -0x64(%rbp),%rax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <epistasis_dataset_load@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x64(%rbp),%edx
  mov    -0x60(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D85(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x5c(%rbp)
  jmp    L39
L85:
  mov    -0x5c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D5(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x5c(%rbp)
L39:
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  cmp    %rax,%rdx
  jb     L85
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  movl   $0x0,-0x58(%rbp)
  jmp    L45
L36:
  movl   $0x0,-0x5c(%rbp)
  jmp    L22
L72:
  mov    -0x5c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x54(%rbp)
  cmpl   $0xff,-0x54(%rbp)
  jne    L37
  movl   $0x3,-0x54(%rbp)
L37:
  mov    -0x54(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D35(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x5c(%rbp)
L22:
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  cmp    %rax,%rdx
  jb     L72
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  addl   $0x1,-0x58(%rbp)
L45:
  mov    -0x64(%rbp),%eax
  cmp    %eax,-0x58(%rbp)
  jl     L36
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  jmp    L95
L125:
  movl   $0x0,-0x5c(%rbp)
  jmp    L118
L131:
  mov    -0x5c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x50(%rbp)
  cmpl   $0xff,-0x50(%rbp)
  jne    L89
  movl   $0x3,-0x50(%rbp)
L89:
  mov    -0x50(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D35(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x5c(%rbp)
L118:
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  cmp    %rax,%rdx
  jb     L131
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  addl   $0x1,-0x58(%rbp)
L95:
  mov    -0x58(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L125
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <epistasis_dataset_close@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L76
  call   <__stack_chk_fail@plt>
L76:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D30
data_type: string
name: read_data
arguments: label: D66
data_type: string
name: read_data
arguments: label: D104
data_type: string
name: read_data
arguments: label: D85
data_type: string
name: read_data
arguments: label: D3
data_type: string
name: read_data
arguments: label: D5
data_type: string
name: read_data
arguments: label: D45
data_type: string
name: read_data
arguments: label: D35
data_type: string
name: read_data
arguments: label: D17
data_type: string
name: read_data
arguments: label: D39
data_type: string

tool: D30: Usage: hpgvariant2mdrjava <filename>

tool: D66: %s.txt

tool: D104: output file is %s


tool: D85: w

tool: D3: genotypes offset is %zu


tool: D5: S%d	

tool: D45: Class


tool: D35: %d	

tool: D17: 0


tool: D39: 1


assistant: ```c
int main(int argc, char *argv[]) {
  int num_affected, num_unaffected, num_samples;
  size_t num_variants, file_len, genotypes_offset;
  char *filename, *output_filename;
  if (argc < 2) {
    printf("Usage: hpgvariant2mdrjava <filename>\n");
    exit(1);
  }
  filename = argv[1];
  output_filename = malloc((strlen(filename) + 5) * sizeof(char));
  sprintf(output_filename, "%s.txt", filename);
  printf("output file is %s\n", output_filename);
  uint8_t *input_file = epistasis_dataset_load(&num_affected, &num_unaffected, &num_variants, &file_len, &genotypes_offset, filename);
  uint8_t *genotypes = input_file + genotypes_offset;
  num_samples = num_affected + num_unaffected;
  FILE *outfile = fopen(output_filename, "w");
  printf("genotypes offset is %zu\n", genotypes_offset);
  int i, j;
  for (i = 0; i < num_variants; i++) {
    fprintf(outfile, "S%d\t", i);
  }
  fprintf(outfile, "Class\n");
  for (j = 0; j < num_affected; j++) {
    for (i = 0; i < num_variants; i++) {
      uint8_t gt = genotypes[i * num_samples + j];
      if (gt == 255)
        gt = 3;
      fprintf(outfile, "%d\t", gt);
    }
    fprintf(outfile, "0\n");
  }
  for (j = num_affected; j < num_samples; j++) {
    for (i = 0; i < num_variants; i++) {
      uint8_t gt = genotypes[i * num_samples + j];
      if (gt == 255)
        gt = 3;
      fprintf(outfile, "%d\t", gt);
    }
    fprintf(outfile, "1\n");
  }
  fclose(outfile);
  epistasis_dataset_close(input_file, file_len);
  return 0;
}
```