user: What is the c source code of the assembly code below?

```asm
<write_page>:
  endbr64
  push   %r13
  push   %r12
  lea    D90(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %r12,%rdi
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  lea    D48(%rip),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D95(%rip),%rsi
  movslq %eax,%r12
  lea    -0x3(%rbp,%r12,1),%r13
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L24
L55:
  lea    D6(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  lea    D3(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L76
L10:
  mov    $0x4,%edx
  lea    D100(%rip),%rsi
  mov    %ebx,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  mov    %rsp,%rbp
  jmp    L126
  nopw   0x0(%rax,%rax,1)
L144:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
L126:
  mov    $0x400,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <read@plt>
  mov    %eax,%edx
  test   %eax,%eax
  jg     L144
  xor    %eax,%eax
  jmp    L97
  nopw   0x0(%rax,%rax,1)
L76:
  lea    D62(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  lea    D103(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L10
  lea    D13(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L45
  lea    D108(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L10
  nopl   0x0(%rax)
L45:
  mov    $0xffffffff,%eax
L97:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L104
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L24:
  lea    -0x4(%rbp,%r12,1),%rdi
  lea    D52(%rip),%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L55
  jmp    L10
L104:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D90
type_guessed: string
name: disassemble_data
arguments: label: D48
type_guessed: string
name: disassemble_data
arguments: label: D95
type_guessed: string
name: disassemble_data
arguments: label: D6
type_guessed: string
name: disassemble_data
arguments: label: D3
type_guessed: string
name: disassemble_data
arguments: label: D100
type_guessed: string
name: disassemble_data
arguments: label: D62
type_guessed: string
name: disassemble_data
arguments: label: D103
type_guessed: string
name: disassemble_data
arguments: label: D13
type_guessed: string
name: disassemble_data
arguments: label: D108
type_guessed: string
name: disassemble_data
arguments: label: D52
type_guessed: string

tool: D90: HTTP/1.1 200 OK


tool: D48: Content-Type: 

tool: D95: jpg

tool: D6: image/jpeg

tool: D3: gif

tool: D100: 



tool: D62: image/gif

tool: D103: png

tool: D13: image/png

tool: D108: text/html

tool: D52: jpeg

assistant: ```c
int write_page(int cfd, char *path) {
  int n;
  char buf[1024];
  if (my_write(cfd, "HTTP/1.1 200 OK\r\n", strlen("HTTP/1.1 200 OK\r\n")) == -1)
    return -1;
  if (my_write(cfd, "Content-Type: ", strlen("Content-Type: ")) == -1)
    return -1;
  n = strlen(path);
  if (strcasecmp(&path[n - 3], "jpg") == 0 || (strcasecmp(&path[n - 4], "jpeg") == 0))
    if (my_write(cfd, "image/jpeg", strlen("image/jpeg")) == -1)
      return -1;
    else if (strcasecmp(&path[n - 3], "gif") == 0)
      if (my_write(cfd, "image/gif", strlen("image/gif")) == -1)
        return -1;
      else if (strcasecmp(&path[n - 3], "png") == 0)
        if (my_write(cfd, "image/png", strlen("image/png")) == -1)
          return -1;
        else if (my_write(cfd, "text/html", strlen("text/html")) == -1)
          return -1;
  if (my_write(cfd, "\r\n\r\n", 4) == -1)
    return -1;
  while ((n = read(cfd, buf, 1024)) > 0)
    if (my_write(cfd, buf, n) == -1)
      return -1;
  return 0;
}
```