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

```asm
<write_page>:
  endbr64
  push   %r14
  push   %r13
  lea    D57(%rip),%r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  mov    %r13,%rdi
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  lea    D28(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    D73(%rip),%rsi
  movslq %eax,%r13
  lea    -0x3(%rbx,%r13,1),%r14
  mov    %r14,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L163
L82:
  lea    D105(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  lea    D100(%rip),%rsi
  mov    %r14,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L70
L85:
  mov    $0x4,%edx
  lea    D5(%rip),%rsi
  mov    %ebp,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  mov    %rsp,%rbx
  jmp    L16
  nopw   0x0(%rax,%rax,1)
L62:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
L16:
  mov    $0x400,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <read@plt>
  mov    %eax,%edx
  test   %eax,%eax
  jg     L62
  xor    %eax,%eax
  jmp    L20
L70:
  lea    D69(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L85
  lea    D6(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  je     L56
  lea    D102(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L85
  nopl   0x0(%rax)
L56:
  mov    $0xffffffff,%eax
L20:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L154
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L163:
  lea    -0x4(%rbx,%r13,1),%rdi
  lea    D18(%rip),%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L82
  jmp    L85
L154:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D57
type_guessed: string
name: parse_data
arguments: label: D28
type_guessed: string
name: parse_data
arguments: label: D73
type_guessed: string
name: parse_data
arguments: label: D105
type_guessed: string
name: parse_data
arguments: label: D100
type_guessed: string
name: parse_data
arguments: label: D5
type_guessed: string
name: parse_data
arguments: label: D69
type_guessed: string
name: parse_data
arguments: label: D29
type_guessed: string
name: parse_data
arguments: label: D6
type_guessed: string
name: parse_data
arguments: label: D102
type_guessed: string
name: parse_data
arguments: label: D18
type_guessed: string

tool: D57: HTTP/1.1 200 OK


tool: D28: Content-Type: 

tool: D73: jpg

tool: D105: image/jpeg

tool: D100: gif

tool: D5: 



tool: D69: image/gif

tool: D29: png

tool: D6: image/png

tool: D102: text/html

tool: D18: jpeg

assistant: ```c
int write_page(int cfd, int fd, 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(fd, buf, 1024)) > 0)
    if (my_write(cfd, buf, n) == -1)
      return -1;
  return 0;
}
```