user: What would the C source look like for the assembly code provided here?

```asm
<save_ppm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,-0x118(%rbp)
  mov    %rsi,-0x120(%rbp)
  mov    %rdx,-0x128(%rbp)
  mov    %rcx,-0x130(%rbp)
  mov    %r8,-0xb0(%rbp)
  mov    %r9,-0xa8(%rbp)
  test   %al,%al
  je     L36
  movaps %xmm0,-0xa0(%rbp)
  movaps %xmm1,-0x90(%rbp)
  movaps %xmm2,-0x80(%rbp)
  movaps %xmm3,-0x70(%rbp)
  movaps %xmm4,-0x60(%rbp)
  movaps %xmm5,-0x50(%rbp)
  movaps %xmm6,-0x40(%rbp)
  movaps %xmm7,-0x30(%rbp)
L36:
  mov    %fs:0x28,%rax
  mov    %rax,-0xd8(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movq   $0x400,-0xf8(%rbp)
  mov    -0xf8(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0xf0(%rbp)
  mov    -0xf8(%rbp),%rax
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    -0xf8(%rbp),%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    $0x10,%eax
  lea    -0x1(%rax),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L83:
  cmp    %rdx,%rsp
  je     L0
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L83
L0:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L74
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L74:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0xe8(%rbp)
  mov    -0x130(%rbp),%rdx
  mov    -0x10c(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0x10c(%rbp),%ecx
  mov    -0x130(%rbp),%rdx
  mov    -0xf8(%rbp),%rsi
  mov    -0xe8(%rbp),%rax
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    -0x10c(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    -0xe8(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xe0(%rbp)
  mov    -0x128(%rbp),%rcx
  mov    -0x120(%rbp),%rdx
  mov    -0xe0(%rbp),%rax
  mov    $0xff,%r8d
  lea    D22(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movq   $0x0,-0x108(%rbp)
  jmp    L22
L70:
  movq   $0x0,-0x100(%rbp)
  jmp    L16
L61:
  mov    -0x120(%rbp),%rax
  imul   -0x108(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  lea    0x2(%rax),%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%esi
  mov    -0x120(%rbp),%rax
  imul   -0x108(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  lea    0x1(%rax),%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x120(%rbp),%rax
  imul   -0x108(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0xe0(%rbp),%rax
  mov    %esi,%r8d
  lea    D7(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addq   $0x1,-0x100(%rbp)
L16:
  mov    -0x100(%rbp),%rax
  cmp    -0x120(%rbp),%rax
  jb     L61
  mov    -0xe0(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  addq   $0x1,-0x108(%rbp)
L22:
  mov    -0x108(%rbp),%rax
  cmp    -0x128(%rbp),%rax
  jb     L70
  mov    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %rbx,%rsp
  nop
  mov    -0xd8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D21
type_infered: string
name: read_data
arguments: tag: D22
type_infered: string
name: read_data
arguments: tag: D7
type_infered: string

tool: D21: w

tool: D22: P3
%zu %zu
%u


tool: D7: %4u%4u%4u

assistant: ```c
void save_ppm(const unsigned char *src, size_t w, size_t h, const char *fmt, ...) {
  const size_t kPathMax = 1024;
  char path[kPathMax];
  va_list ap;
  size_t y, x;
  FILE *f;
  va_start(ap, fmt);
  vsnprintf(path, kPathMax, fmt, ap);
  va_end(ap);
  f = fopen(path, "w");
  fprintf(f, "P3\n%zu %zu\n%u\n", w, h, 255);
  for (y = 0; y < h; ++y) {
    for (x = 0; x < w; ++x) {
      fprintf(f, "%4u%4u%4u", src[4 * w * y + 4 * x + 0], src[4 * w * y + 4 * x + 1], src[4 * w * y + 4 * x + 2]);
    }
    fprintf(f, "\n");
  }
  fclose(f);
}
```