user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<write_cg_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,%eax
  mov    %al,-0x80(%rbp)
  lea    D148(%rip),%rax
  mov    %rax,-0x50(%rbp)
  lea    D103(%rip),%rax
  mov    %rax,-0x48(%rbp)
  lea    D77(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D37(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    D109(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D150(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D156(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D18(%rip),%rax
  mov    %rax,-0x18(%rbp)
  cmpb   $0x53,-0x80(%rbp)
  jne    L57
  movl   $0x578,-0x6c(%rbp)
  movl   $0x7,-0x68(%rbp)
  movl   $0xf,-0x64(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L57:
  cmpb   $0x57,-0x80(%rbp)
  jne    L66
  movl   $0x1b58,-0x6c(%rbp)
  movl   $0x8,-0x68(%rbp)
  movl   $0xf,-0x64(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L66:
  cmpb   $0x41,-0x80(%rbp)
  jne    L59
  movl   $0x36b0,-0x6c(%rbp)
  movl   $0xb,-0x68(%rbp)
  movl   $0xf,-0x64(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L59:
  cmpb   $0x42,-0x80(%rbp)
  jne    L6
  movl   $0x124f8,-0x6c(%rbp)
  movl   $0xd,-0x68(%rbp)
  movl   $0x4b,-0x64(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L6:
  cmpb   $0x43,-0x80(%rbp)
  jne    L16
  movl   $0x249f0,-0x6c(%rbp)
  movl   $0xf,-0x68(%rbp)
  movl   $0x4b,-0x64(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L16:
  cmpb   $0x44,-0x80(%rbp)
  jne    L8
  movl   $0x16e360,-0x6c(%rbp)
  movl   $0x15,-0x68(%rbp)
  movl   $0x64,-0x64(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L8:
  cmpb   $0x45,-0x80(%rbp)
  jne    L62
  movl   $0x895440,-0x6c(%rbp)
  movl   $0x1a,-0x68(%rbp)
  movl   $0x64,-0x64(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L143
L62:
  movsbl -0x80(%rbp),%eax
  mov    %eax,%esi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L143:
  mov    -0x6c(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D11(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x68(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D117(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x64(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D165(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    D29(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x50(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    D124(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x7c(%rbp),%eax
  mov    %eax,%edi
  call   <ilog2@plt>
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%eax
  lea    (%rdx,%rax,1),%ebx
  mov    -0x7c(%rbp),%eax
  mov    %eax,%edi
  call   <ilog2@plt>
  cmp    %eax,%ebx
  je     L121
  addl   $0x1,-0x60(%rbp)
L121:
  mov    -0x60(%rbp),%eax
  mov    %eax,%edi
  call   <ipow2@plt>
  mov    %eax,-0x60(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,%edi
  call   <ipow2@plt>
  mov    %eax,-0x5c(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x37,%edx
  mov    $0x1,%esi
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x7c(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D175(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x60(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D62(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x5c(%rbp),%edx
  mov    -0x78(%rbp),%rax
  lea    D15(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D148
type: string
name: disassemble_data
arguments: tag: D103
type: string
name: disassemble_data
arguments: tag: D77
type: string
name: disassemble_data
arguments: tag: D37
type: string
name: disassemble_data
arguments: tag: D109
type: string
name: disassemble_data
arguments: tag: D150
type: string
name: disassemble_data
arguments: tag: D156
type: string
name: disassemble_data
arguments: tag: D18
type: string
name: disassemble_data
arguments: tag: D31
type: string
name: disassemble_data
arguments: tag: D11
type: string
name: disassemble_data
arguments: tag: D117
type: string
name: disassemble_data
arguments: tag: D165
type: string
name: disassemble_data
arguments: tag: D29
type: string
name: disassemble_data
arguments: tag: D124
type: string
name: disassemble_data
arguments: tag: D93
type: string
name: disassemble_data
arguments: tag: D175
type: string
name: disassemble_data
arguments: tag: D62
type: string
name: disassemble_data
arguments: tag: D15
type: string

tool: D148: 1.0e-1

tool: D103: 10.

tool: D77: 12.

tool: D37: 20.

tool: D109: 60.

tool: D150: 110.

tool: D156: 500.

tool: D18: 1.5e3

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


tool: D11: const int na = %d;


tool: D117: const int nonzer = %d;


tool: D165: const int niter = %d;


tool: D29: const double shift = %s;


tool: D124: const double rcond = %s;


tool: D93: 
// number of nodes for which this version is compiled


tool: D175: const int nnodes_compiled = %d;


tool: D62: const int num_proc_cols = %d;


tool: D15: const int num_proc_rows = %d;


assistant: ```c
void write_cg_info(FILE *fp, int nprocs, char class) {
  int na, nonzer, niter;
  char *shift, *rcond = "1.0e-1";
  char *shiftS = "10.", *shiftW = "12.", *shiftA = "20.", *shiftB = "60.", *shiftC = "110.", *shiftD = "500.", *shiftE = "1.5e3";
  int num_proc_cols, num_proc_rows;
  if (class == 'S') {
    na = 1400;
    nonzer = 7;
    niter = 15;
    shift = shiftS;
  } else if (class == 'W') {
    na = 7000;
    nonzer = 8;
    niter = 15;
    shift = shiftW;
  } else if (class == 'A') {
    na = 14000;
    nonzer = 11;
    niter = 15;
    shift = shiftA;
  } else if (class == 'B') {
    na = 75000;
    nonzer = 13;
    niter = 75;
    shift = shiftB;
  } else if (class == 'C') {
    na = 150000;
    nonzer = 15;
    niter = 75;
    shift = shiftC;
  } else if (class == 'D') {
    na = 1500000;
    nonzer = 21;
    niter = 100;
    shift = shiftD;
  } else if (class == 'E') {
    na = 9000000;
    nonzer = 26;
    niter = 100;
    shift = shiftE;
  } else {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  fprintf(fp, "const int na = %d;\n", na);
  fprintf(fp, "const int nonzer = %d;\n", nonzer);
  fprintf(fp, "const int niter = %d;\n", niter);
  fprintf(fp, "const double shift = %s;\n", shift);
  fprintf(fp, "const double rcond = %s;\n", rcond);
  num_proc_cols = num_proc_rows = ilog2(nprocs) / 2;
  if (num_proc_cols + num_proc_rows != ilog2(nprocs))
    num_proc_cols += 1;
  num_proc_cols = ipow2(num_proc_cols);
  num_proc_rows = ipow2(num_proc_rows);
  fprintf(fp, "\n// number of nodes for which this version is compiled\n");
  fprintf(fp, "const int nnodes_compiled = %d;\n", nprocs);
  fprintf(fp, "const int num_proc_cols = %d;\n", num_proc_cols);
  fprintf(fp, "const int num_proc_rows = %d;\n", num_proc_rows);
}
```