user: 请从给定的汇编指令推导出C源代码：

```asm
<write_mg_info>:
  endbr64
  push   %r14
  lea    -0x41(%rsi),%eax
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  cmp    $0x16,%al
  ja     L8
  lea    D129(%rip),%rdx
  movzbl %al,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   (%rax)
L8:
  lea    D35(%rip),%rdi
  movsbl %sil,%esi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L19:
  mov    %r13d,%edi
  call   <ilog2@plt>
  mov    %r13d,%edx
  mov    %rbp,%rdi
  lea    D4(%rip),%rsi
  mov    %eax,%r12d
  call   <fprintf@plt>
  mov    %r13d,%edx
  mov    %rbp,%rdi
  lea    D43(%rip),%rsi
  call   <fprintf@plt>
  mov    %r13d,%edx
  mov    %rbp,%rdi
  lea    D124(%rip),%rsi
  call   <fprintf@plt>
  mov    %r14d,%edx
  mov    %rbp,%rdi
  lea    D11(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  lea    D54(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  lea    D21(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  xor    %edx,%edx
  lea    D26(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  lea    D18(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  lea    D98(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %rbp,%rdi
  lea    D93(%rip),%rsi
  call   <fprintf@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  mov    $0x1,%edx
  pop    %rbp
  lea    D47(%rip),%rsi
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10a0 <fprintf@plt>
  nopw   0x0(%rax,%rax,1)
  mov    $0x4,%r14d
  mov    $0x100,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x14,%r14d
  mov    $0x100,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x14,%r14d
  mov    $0x200,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x32,%r14d
  mov    $0x400,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x32,%r14d
  mov    $0x800,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x4,%r14d
  mov    $0x20,%r13d
  jmp    L19
  nopl   0x0(%rax)
  mov    $0x4,%r14d
  mov    $0x80,%r13d
  jmp    L19
```

tool_calls: name: retrieve_data
arguments: data_label: D35
type_infered: string
name: retrieve_data
arguments: data_label: D4
type_infered: string
name: retrieve_data
arguments: data_label: D43
type_infered: string
name: retrieve_data
arguments: data_label: D124
type_infered: string
name: retrieve_data
arguments: data_label: D11
type_infered: string
name: retrieve_data
arguments: data_label: D54
type_infered: string
name: retrieve_data
arguments: data_label: D21
type_infered: string
name: retrieve_data
arguments: data_label: D26
type_infered: string
name: retrieve_data
arguments: data_label: D18
type_infered: string
name: retrieve_data
arguments: data_label: D98
type_infered: string
name: retrieve_data
arguments: data_label: D93
type_infered: string
name: retrieve_data
arguments: data_label: D47
type_infered: string

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


tool: D4: #define NX_DEFAULT     %d


tool: D43: #define NY_DEFAULT     %d


tool: D124: #define NZ_DEFAULT     %d


tool: D11: #define NIT_DEFAULT    %d


tool: D54: #define LM             %d


tool: D21: #define LT_DEFAULT     %d


tool: D26: #define DEBUG_DEFAULT  %d


tool: D18: #define NDIM1          %d


tool: D98: #define NDIM2          %d


tool: D93: #define NDIM3          %d


tool: D47: #define ONE            %d


assistant: ```c
void write_mg_info(FILE *fp, char class) {
  int problem_size, nit, log2_size, lt_default, lm;
  int ndim1, ndim2, ndim3;
  if (class == 'S') {
    problem_size = 32;
    nit = 4;
  } else if (class == 'W') {
    problem_size = 128;
    nit = 4;
  } else if (class == 'A') {
    problem_size = 256;
    nit = 4;
  } else if (class == 'B') {
    problem_size = 256;
    nit = 20;
  } else if (class == 'C') {
    problem_size = 512;
    nit = 20;
  } else if (class == 'D') {
    problem_size = 1024;
    nit = 50;
  } else if (class == 'E') {
    problem_size = 2048;
    nit = 50;
  } else {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  log2_size = ilog2(problem_size);
  lt_default = log2_size;
  lm = log2_size;
  ndim1 = lm;
  ndim3 = log2_size;
  ndim2 = log2_size;
  fprintf(fp, "#define NX_DEFAULT     %d\n", problem_size);
  fprintf(fp, "#define NY_DEFAULT     %d\n", problem_size);
  fprintf(fp, "#define NZ_DEFAULT     %d\n", problem_size);
  fprintf(fp, "#define NIT_DEFAULT    %d\n", nit);
  fprintf(fp, "#define LM             %d\n", lm);
  fprintf(fp, "#define LT_DEFAULT     %d\n", lt_default);
  fprintf(fp, "#define DEBUG_DEFAULT  %d\n", 0);
  fprintf(fp, "#define NDIM1          %d\n", ndim1);
  fprintf(fp, "#define NDIM2          %d\n", ndim2);
  fprintf(fp, "#define NDIM3          %d\n", ndim3);
  fprintf(fp, "#define ONE            %d\n", 1);
}
```