// File: solaldunckel[P]webserv/srcs/HTTP/Response.cpp
// Function: Response::DELETE()
int Response::DELETE() {
  if (!file_.exists())
    return 404;

  file_.unlink();

  body_ += "<!DOCTYPE html>\n\
            <html>\n\
            <body>\n\
              <h1>File deleted</h1>\n\
            </body>\n\
            </html>";
  headers_["Content-Type"] = g_mimes.getType(".html");
  headers_["Content-Length"] = ft::to_string(body_.length());
  return 200;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
addq $0x8, %rdi
callq 0x36950
testb $0x1, %al
jne 0x25343
movl $0x194, -0x4(%rbp)      # imm = 0x194
jmp 0x255c7
movq -0xe0(%rbp), %rdi
addq $0x8, %rdi
callq 0x366f0
movq -0xe0(%rbp), %rdi
addq $0xe0, %rdi
leaq 0x1e565(%rip), %rsi     # 0x438cd
callq 0x5520
leaq -0x51(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x5960
movq -0xe8(%rbp), %rdx
leaq 0x1e478(%rip), %rsi     # 0x43803
leaq -0x50(%rbp), %rdi
callq 0x6be0
jmp 0x25396
leaq 0x372db(%rip), %rsi     # 0x5c678
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x403d0
jmp 0x253ac
movq -0xe0(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0xf8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x5960
movq -0xf0(%rbp), %rdx
leaq 0x1e20e(%rip), %rsi     # 0x435ef
leaq -0x88(%rbp), %rdi
callq 0x6be0
jmp 0x253ef
movq -0xf8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x20e30
movq %rax, -0x100(%rbp)
jmp 0x2540b
movq -0x100(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq %rsi, -0x118(%rbp)
callq 0x56d0
leaq -0x88(%rbp), %rdi
callq 0x5aa8
leaq -0x89(%rbp), %rdi
callq 0x55e0
movq -0x118(%rbp), %rdi
callq 0x5aa8
leaq -0x50(%rbp), %rdi
callq 0x5aa8
leaq -0x51(%rbp), %rdi
callq 0x55e0
movq -0xe0(%rbp), %rdi
addq $0xe0, %rdi
callq 0x5830
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x20f10
movq -0xe0(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x110(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x5960
movq -0x108(%rbp), %rdx
leaq 0x1e131(%rip), %rsi     # 0x435e0
leaq -0xd0(%rbp), %rdi
callq 0x6be0
jmp 0x254bd
movq -0x110(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x20e30
movq %rax, -0x120(%rbp)
jmp 0x254d9
movq -0x120(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x56d0
leaq -0xd0(%rbp), %rdi
callq 0x5aa8
leaq -0xd1(%rbp), %rdi
callq 0x55e0
leaq -0xb0(%rbp), %rdi
callq 0x5aa8
movl $0xc8, -0x4(%rbp)
jmp 0x255c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2557c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x25573
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2555e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5aa8
leaq -0x89(%rbp), %rdi
callq 0x55e0
leaq -0x30(%rbp), %rdi
callq 0x5aa8
leaq -0x50(%rbp), %rdi
callq 0x5aa8
leaq -0x51(%rbp), %rdi
callq 0x55e0
jmp 0x255d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x255ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x5aa8
leaq -0xd1(%rbp), %rdi
callq 0x55e0
leaq -0xb0(%rbp), %rdi
callq 0x5aa8
jmp 0x255d3
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x5950
nopl (%rax)