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

```asm
<write_ft_info>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  lea    -0x41(%rsi),%eax
  cmp    $0x16,%al
  ja     L3
  movzbl %al,%eax
  lea    D54(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0x6,0xc(%rsp)
  mov    $0x20,%r15d
  mov    $0x80,%r14d
  mov    $0x80,%r13d
  jmp    L38
  movl   $0x6,0xc(%rsp)
  mov    $0x80,%r15d
  mov    $0x100,%r14d
  mov    $0x100,%r13d
L38:
  cmp    %r14d,%r13d
  mov    %r14d,%r12d
  cmovge %r13d,%r12d
  cmp    %r15d,%r12d
  cmovl  %r15d,%r12d
  lea    D52(%rip),%rbp
  mov    %rbp,%rdx
  lea    D29(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  sub    $0x8,%rsp
  push   %r12
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %rbp,%rdx
  lea    D3(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    0x1c(%rsp),%ecx
  mov    %rbp,%rdx
  lea    D61(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbp,%rdx
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  movl   $0x14,0xc(%rsp)
  mov    $0x100,%r15d
  mov    $0x100,%r14d
  mov    $0x200,%r13d
  jmp    L38
  movl   $0x14,0xc(%rsp)
  mov    $0x200,%r15d
  mov    $0x200,%r14d
  mov    $0x200,%r13d
  jmp    L38
L3:
  movsbl %sil,%esi
  lea    D18(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L38
  movl   $0x6,0xc(%rsp)
  mov    $0x40,%r15d
  mov    $0x40,%r14d
  mov    $0x40,%r13d
  jmp    L38
```

tool_calls: name: retrieve_data
arguments: label: D52
data_type: string
name: retrieve_data
arguments: label: D29
data_type: string
name: retrieve_data
arguments: label: D3
data_type: string
name: retrieve_data
arguments: label: D61
data_type: string
name: retrieve_data
arguments: label: D31
data_type: string
name: retrieve_data
arguments: label: D18
data_type: string

tool: D52:         

tool: D29: %sinteger nx, ny, nz, maxdim, niter_default, ntotal


tool: D3: %sparameter (nx=%d, ny=%d, nz=%d, maxdim=%d)


tool: D61: %sparameter (niter_default=%d)


tool: D31: %sparameter (ntotal=nx*ny*nz)


tool: D18: setparams: Internal error: invalid class type %c


assistant: ```c
void write_ft_info(FILE *fp, char class) {
  int nx, ny, nz, maxdim, niter;
  if (class == 'S') {
    nx = 64;
    ny = 64;
    nz = 64;
    niter = 6;
  } else if (class == 'W') {
    nx = 128;
    ny = 128;
    nz = 32;
    niter = 6;
  } else if (class == 'A') {
    nx = 256;
    ny = 256;
    nz = 128;
    niter = 6;
  } else if (class == 'B') {
    nx = 512;
    ny = 256;
    nz = 256;
    niter = 20;
  } else if (class == 'C') {
    nx = 512;
    ny = 512;
    nz = 512;
    niter = 20;
  } else {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  maxdim = nx;
  if (ny > maxdim)
    maxdim = ny;
  if (nz > maxdim)
    maxdim = nz;
  fprintf(fp, "%sinteger nx, ny, nz, maxdim, niter_default, ntotal\n", "        ");
  fprintf(fp, "%sparameter (nx=%d, ny=%d, nz=%d, maxdim=%d)\n", "        ", nx, ny, nz, maxdim);
  fprintf(fp, "%sparameter (niter_default=%d)\n", "        ", niter);
  fprintf(fp, "%sparameter (ntotal=nx*ny*nz)\n", "        ");
}
```