user: 这段汇编代码用C语言表示是什么样的?

```asm
<save_image>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %edi,-0xc4(%rbp)
  mov    %rsi,-0xd0(%rbp)
  mov    %rdx,-0xd8(%rbp)
  mov    %ecx,-0xc8(%rbp)
  movsd  %xmm0,-0xe0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xc4(%rbp),%edx
  lea    -0x90(%rbp),%rax
  lea    D4(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x90(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xa0(%rbp)
  cmpq   $0x0,-0xa0(%rbp)
  je     L8
  mov    -0xa0(%rbp),%rax
  mov    $0xff,%r8d
  mov    $0x8,%ecx
  mov    $0x50,%edx
  lea    D10(%rip),%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  movl   $0x0,-0xb0(%rbp)
  jmp    L48
L65:
  movl   $0x0,-0xac(%rbp)
  jmp    L2
L6:
  mov    -0xb0(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x7,%rax
  mov    %rax,%rdx
  mov    -0xd0(%rbp),%rax
  add    %rax,%rdx
  mov    -0xac(%rbp),%eax
  cltq
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,-0x98(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc8(%rbp),%xmm0
  mulsd  -0x98(%rbp),%xmm0
  divsd  -0xe0(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0xa8(%rbp)
  mov    -0xa8(%rbp),%eax
  cmp    -0xc8(%rbp),%eax
  jle    L50
  mov    -0xc8(%rbp),%eax
  mov    %eax,-0xa8(%rbp)
L50:
  mov    -0xa8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xa4(%rbp)
  mov    -0xa4(%rbp),%eax
  sar    $0x10,%eax
  movzbl %al,%eax
  mov    %eax,-0xb4(%rbp)
  mov    -0xa0(%rbp),%rdx
  lea    -0xb4(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0xa4(%rbp),%eax
  sar    $0x8,%eax
  movzbl %al,%eax
  mov    %eax,-0xb4(%rbp)
  mov    -0xa0(%rbp),%rdx
  lea    -0xb4(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0xa4(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0xb4(%rbp)
  mov    -0xa0(%rbp),%rdx
  lea    -0xb4(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  addl   $0x1,-0xac(%rbp)
L2:
  cmpl   $0x4f,-0xac(%rbp)
  jle    L6
  addl   $0x1,-0xb0(%rbp)
L48:
  cmpl   $0x7,-0xb0(%rbp)
  jle    L65
  mov    -0xa0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L8:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L58
  call   <__stack_chk_fail@plt>
L58:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D4
type: string
name: disassemble_data
arguments: label: D9
type: string
name: disassemble_data
arguments: label: D10
type: string

tool: D4: metaballs%03d.ppm

tool: D9: wb

tool: D10: P6
%d %d
%d


assistant: ```c
void save_image(int index, double field[][80], uint32_t palet[], int max_col, double scale) {
  FILE *file;
  char filename[128];
  int row, col;
  uint32_t rgb;
  uint8_t b;
  sprintf(filename, "metaballs%03d.ppm", index);
  file = fopen(filename, "wb");
  if (file != NULL) {
    fprintf(file, "P6\n%d %d\n%d\n", 80, 8, 255);
    for (row = 0; row < 8; row++) {
      for (col = 0; col < 80; col++) {
        double v = field[row][col];
        int j = max_col * v / scale;
        if (j > max_col) {
          j = max_col;
        }
        rgb = palet[j];
        b = (rgb >> 16) & 0xFF;
        fwrite(&b, 1, 1, file);
        b = (rgb >> 8) & 0xFF;
        fwrite(&b, 1, 1, file);
        b = (rgb >> 0) & 0xFF;
        fwrite(&b, 1, 1, file);
      }
    }
    fclose(file);
  }
}
```