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

```asm
<write_page>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x430,%rsp
  mov    %edi,-0x424(%rbp)
  mov    %esi,-0x428(%rbp)
  mov    %rdx,-0x430(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D133(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D133(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L33
  mov    $0xffffffff,%eax
  jmp    L141
L33:
  lea    D159(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D159(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L185
  mov    $0xffffffff,%eax
  jmp    L141
L185:
  mov    -0x430(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x414(%rbp)
  mov    -0x414(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x430(%rbp),%rax
  add    %rdx,%rax
  lea    D126(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L84
  mov    -0x414(%rbp),%eax
  cltq
  lea    -0x4(%rax),%rdx
  mov    -0x430(%rbp),%rax
  add    %rdx,%rax
  lea    D165(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L98
L84:
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L118
  mov    $0xffffffff,%eax
  jmp    L141
L118:
  mov    -0x414(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x430(%rbp),%rax
  add    %rdx,%rax
  lea    D35(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L98
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D98(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L116
  mov    $0xffffffff,%eax
  jmp    L141
L116:
  mov    -0x414(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x430(%rbp),%rax
  add    %rdx,%rax
  lea    D104(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L98
  lea    D139(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D139(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L157
  mov    $0xffffffff,%eax
  jmp    L141
L157:
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x424(%rbp),%eax
  lea    D37(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L98
  mov    $0xffffffff,%eax
  jmp    L141
L98:
  mov    -0x424(%rbp),%eax
  mov    $0x4,%edx
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L194
  mov    $0xffffffff,%eax
  jmp    L141
L203:
  mov    -0x414(%rbp),%edx
  lea    -0x410(%rbp),%rcx
  mov    -0x424(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <my_write@plt>
  cmp    $0xffffffff,%eax
  jne    L194
  mov    $0xffffffff,%eax
  jmp    L141
L194:
  lea    -0x410(%rbp),%rcx
  mov    -0x428(%rbp),%eax
  mov    $0x400,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x414(%rbp)
  cmpl   $0x0,-0x414(%rbp)
  jg     L203
  mov    $0x0,%eax
L141:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L130
  call   <__stack_chk_fail@plt>
L130:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D133
data_type: string
name: read_data
arguments: data_tag: D159
data_type: string
name: read_data
arguments: data_tag: D126
data_type: string
name: read_data
arguments: data_tag: D165
data_type: string
name: read_data
arguments: data_tag: D10
data_type: string
name: read_data
arguments: data_tag: D35
data_type: string
name: read_data
arguments: data_tag: D98
data_type: string
name: read_data
arguments: data_tag: D104
data_type: string
name: read_data
arguments: data_tag: D139
data_type: string
name: read_data
arguments: data_tag: D37
data_type: string
name: read_data
arguments: data_tag: D2
data_type: string

tool: D133: HTTP/1.1 200 OK


tool: D159: Content-Type: 

tool: D126: jpg

tool: D165: jpeg

tool: D10: image/jpeg

tool: D35: gif

tool: D98: image/gif

tool: D104: png

tool: D139: image/png

tool: D37: text/html

tool: D2: 



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;
}
```