user: 下面的汇编指令对应的C源代码是什么:

```asm
<write_ppm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L54
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L38
L54:
  mov    -0x24(%rbp),%esi
  mov    -0x1c(%rbp),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %esi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D30(%rip),%rdx
  lea    D27(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L20
L14:
  movl   $0x0,-0x10(%rbp)
  jmp    L51
L23:
  mov    -0xc(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%esi
  mov    -0xc(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0xc(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x8(%rbp),%rax
  mov    %esi,%r8d
  lea    D22(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  addl   $0x1,-0x10(%rbp)
L51:
  mov    -0x10(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L23
  addl   $0x1,-0xc(%rbp)
L20:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L14
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L38:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
type_guessed: string
name: extract_symbolic_data
arguments: tag: D14
type_guessed: string
name: extract_symbolic_data
arguments: tag: D30
type_guessed: string
name: extract_symbolic_data
arguments: tag: D27
type_guessed: string
name: extract_symbolic_data
arguments: tag: D22
type_guessed: string

tool: D1: w

tool: D14: Unable to open %s.


tool: D30: P3

tool: D27: %s
%d %d
%d


tool: D22: %d %d %d  

assistant: ```c
int write_ppm(char *path, int height, int width, int grey_levels, unsigned char data[]) {
  FILE *file = fopen(path, "w");
  if (!file) {
    printf("Unable to open %s.\n", path);
    return -1;
  }
  fprintf(file, "%s\n%d %d\n%d\n", "P3", width, height, grey_levels);
  int i, j;
  for (j = 0; j < height; j++) {
    for (i = 0; i < width; i++) {
      fprintf(file, "%d %d %d  ", data[j * 3 * width + 3 * i + 0], data[j * 3 * width + 3 * i + 1], data[j * 3 * width + 3 * i + 2]);
      fprintf(file, "\n");
    }
  }
  fclose(file);
  return 0;
}
```