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

```asm
<SaveBMP>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x130364d42,%rax
  mov    %rax,-0x3e(%rbp)
  movl   $0x4360000,-0x36(%rbp)
  movw   $0x0,-0x32(%rbp)
  movabs $0x14000000028,%rax
  movabs $0x80001000000f0,%rdx
  mov    %rax,-0x30(%rbp)
  mov    %rdx,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x3e(%rbp),%rax
  mov    $0xe,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <gm_memcpy@plt>
  mov    -0x50(%rbp),%eax
  add    $0xe,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x28,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <gm_memcpy@plt>
  mov    -0x50(%rbp),%eax
  add    $0x28,%eax
  mov    %eax,-0x50(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L45
L53:
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x53(%rbp)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x52(%rbp)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x51(%rbp)
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x51(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x52(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x53(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L45:
  cmpl   $0xff,-0x4c(%rbp)
  jle    L53
  movl   $0xef,-0x44(%rbp)
  jmp    L19
L61:
  movl   $0x0,-0x48(%rbp)
  jmp    L59
L29:
  mov    $0xf0,%eax
  sub    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  imul   $0xf0,%eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x48(%rbp)
L59:
  cmpl   $0x13f,-0x48(%rbp)
  jle    L29
  subl   $0x1,-0x44(%rbp)
L19:
  cmpl   $0x0,-0x44(%rbp)
  jns    L61
  mov    -0x50(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  leave
  ret
```

assistant: ```c
int SaveBMP(unsigned char *src, unsigned char *dst, unsigned char *pal) {
  unsigned char HEADER[] = {'B', 'M', 0x036, 0x30, 0x1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x04, 0x00, 0x00};
  unsigned char INFOHD[] = {40, 0, 0, 0, 0x40, 1, 0, 0, 0xf0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int total = 0, i, x, y;
  gm_memcpy(&dst[total], HEADER, sizeof(HEADER));
  total += sizeof(HEADER);
  ;
  gm_memcpy(&dst[total], INFOHD, sizeof(INFOHD));
  total += sizeof(INFOHD);
  ;
  for (i = 0; i < 256; i++) {
    unsigned char r, g, b;
    r = *pal++;
    g = *pal++;
    b = *pal++;
    dst[total++] = b;
    dst[total++] = g;
    dst[total++] = r;
    dst[total++] = 0;
  }
  for (y = 240 - 1; y >= 0; y--)
    for (x = 0; x < 320; x++)
      dst[total++] = src[(240 - y) + x * 240];
  return total;
}
```