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    $0x8,%rsp
  mov    %rdi,%rbx
  lea    -0x41(%rsi),%eax
  cmp    $0x16,%al
  ja     L1
  movzbl %al,%eax
  lea    D10(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x6,%r14d
  mov    $0x20,%r12d
  mov    $0x80,%r13d
  mov    $0x80,%ebp
  jmp    L10
  mov    $0x6,%r14d
  mov    $0x80,%r12d
  mov    $0x100,%r13d
  mov    $0x100,%ebp
L10:
  cmp    %r13d,%ebp
  mov    %r13d,%eax
  cmovge %ebp,%eax
  cmp    %r12d,%eax
  cmovl  %r12d,%eax
  mov    %eax,%r15d
  mov    %ebp,%edx
  lea    D62(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %r13d,%edx
  lea    D12(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %r12d,%edx
  lea    D20(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %r15d,%edx
  lea    D74(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %r14d,%edx
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %ebp,%edx
  imul   %r13d,%edx
  imul   %r12d,%edx
  lea    D2(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  mov    $0x14,%r14d
  mov    $0x100,%r12d
  mov    $0x100,%r13d
  mov    $0x200,%ebp
  jmp    L10
  mov    $0x14,%r14d
  mov    $0x200,%r12d
  mov    $0x200,%r13d
  mov    $0x200,%ebp
  jmp    L10
L1:
  movsbl %sil,%esi
  lea    D21(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L10
  mov    $0x6,%r14d
  mov    $0x40,%r12d
  mov    $0x40,%r13d
  mov    $0x40,%ebp
  jmp    L10
```

tool_calls: name: unpack_data
arguments: tag: D62
datatype: string
name: unpack_data
arguments: tag: D12
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string
name: unpack_data
arguments: tag: D74
datatype: string
name: unpack_data
arguments: tag: D4
datatype: string
name: unpack_data
arguments: tag: D2
datatype: string
name: unpack_data
arguments: tag: D21
datatype: string

tool: D62: #define	NX	%d


tool: D12: #define	NY	%d


tool: D20: #define	NZ	%d


tool: D74: #define	MAXDIM	%d


tool: D4: #define	NITER_DEFAULT	%d


tool: D2: #define	NTOTAL	%d


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


assistant: ```c
void write_ft_info(FILE *fp, char class) {
  int nx, ny, nz, maxdim, niter, np_min;
  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, "#define\tNX\t%d\n", nx);
  fprintf(fp, "#define\tNY\t%d\n", ny);
  fprintf(fp, "#define\tNZ\t%d\n", nz);
  fprintf(fp, "#define\tMAXDIM\t%d\n", maxdim);
  fprintf(fp, "#define\tNITER_DEFAULT\t%d\n", niter);
  fprintf(fp, "#define\tNTOTAL\t%d\n", nx * ny * nz);
}
```