// File: solaldunckel[P]webserv/srcs/HTTP/Response.cpp
// Function: Response::GET()
int Response::GET() {
  if (config_.getAutoindex() && file_.is_directory()) {
    headers_["Content-Type"] = g_mimes.getType(".html");
    body_ = file_.autoIndex(config_.getRequestTarget());
    headers_["Content-Length"] = ft::to_string(body_.length());
  }
  else {
    headers_["Content-Type"] = g_mimes.getType(file_.getMimeExtension());
    if (!charset_.empty())
      headers_["Content-Type"] += "; charset=" + charset_;
    body_ = file_.getContent();
    headers_["Content-Length"] = ft::to_string(body_.length());
  }
  return 200;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x210(%rbp)
movq (%rax), %rdi
callq 0x12f70
testb $0x1, %al
jne 0x249bb
jmp 0x24c81
movq -0x210(%rbp), %rdi
addq $0x8, %rdi
callq 0x37620
testb $0x1, %al
jne 0x249d4
jmp 0x24c81
leaq -0x49(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x5960
movq -0x218(%rbp), %rdx
leaq 0x1ee11(%rip), %rsi     # 0x43803
leaq -0x48(%rbp), %rdi
callq 0x6be0
jmp 0x249fd
leaq 0x37c74(%rip), %rsi     # 0x5c678
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x403d0
jmp 0x24a13
movq -0x210(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x228(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x5960
movq -0x220(%rbp), %rdx
leaq 0x1eba7(%rip), %rsi     # 0x435ef
leaq -0x80(%rbp), %rdi
callq 0x6be0
jmp 0x24a53
movq -0x228(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x20e30
movq %rax, -0x230(%rbp)
jmp 0x24a6c
movq -0x230(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movq %rsi, -0x260(%rbp)
callq 0x56d0
leaq -0x80(%rbp), %rdi
callq 0x5aa8
leaq -0x81(%rbp), %rdi
callq 0x55e0
movq -0x260(%rbp), %rdi
callq 0x5aa8
leaq -0x48(%rbp), %rdi
callq 0x5aa8
leaq -0x49(%rbp), %rdi
callq 0x55e0
movq -0x210(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x258(%rbp)
movq (%rax), %rdi
callq 0x12de0
movq -0x258(%rbp), %rsi
movq %rax, %rdx
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x36b10
movq -0x250(%rbp), %rsi
movq -0x210(%rbp), %rdi
addq $0xe0, %rdi
movq %rdi, -0x248(%rbp)
callq 0x56d0
movq -0x250(%rbp), %rdi
callq 0x5aa8
movq -0x248(%rbp), %rdi
callq 0x5830
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x20f10
movq -0x210(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x240(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x5960
movq -0x238(%rbp), %rdx
leaq 0x1ea73(%rip), %rsi     # 0x435e0
leaq -0xe8(%rbp), %rdi
callq 0x6be0
jmp 0x24b7b
movq -0x240(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x20e30
movq %rax, -0x268(%rbp)
jmp 0x24b97
movq -0x268(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x56d0
leaq -0xe8(%rbp), %rdi
callq 0x5aa8
leaq -0xe9(%rbp), %rdi
callq 0x55e0
leaq -0xc8(%rbp), %rdi
callq 0x5aa8
jmp 0x2501c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24c30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24c27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24c12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5aa8
leaq -0x81(%rbp), %rdi
callq 0x55e0
leaq -0x28(%rbp), %rdi
callq 0x5aa8
leaq -0x48(%rbp), %rdi
callq 0x5aa8
leaq -0x49(%rbp), %rdi
callq 0x55e0
jmp 0x2502a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24c64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5aa8
leaq -0xe9(%rbp), %rdi
callq 0x55e0
leaq -0xc8(%rbp), %rdi
callq 0x5aa8
jmp 0x2502a
movq -0x210(%rbp), %rdi
addq $0x8, %rdi
callq 0x37f70
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x5200
movq -0x270(%rbp), %rdx
leaq 0x379c3(%rip), %rsi     # 0x5c678
leaq -0x110(%rbp), %rdi
callq 0x403d0
jmp 0x24cc3
movq -0x210(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x280(%rbp)
leaq -0x151(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x5960
movq -0x278(%rbp), %rdx
leaq 0x1e8f7(%rip), %rsi     # 0x435ef
leaq -0x150(%rbp), %rdi
callq 0x6be0
jmp 0x24d06
movq -0x280(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x20e30
movq %rax, -0x288(%rbp)
jmp 0x24d22
movq -0x288(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x56d0
leaq -0x150(%rbp), %rdi
callq 0x5aa8
leaq -0x151(%rbp), %rdi
callq 0x55e0
leaq -0x110(%rbp), %rdi
callq 0x5aa8
leaq -0x130(%rbp), %rdi
callq 0x5aa8
movq -0x210(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x5900
testb $0x1, %al
jne 0x24ede
movq -0x210(%rbp), %rdx
addq $0x140, %rdx            # imm = 0x140
leaq 0x1eb2d(%rip), %rsi     # 0x438c2
leaq -0x178(%rbp), %rdi
callq 0x6ad0
movq -0x210(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x298(%rbp)
leaq -0x199(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x5960
movq -0x290(%rbp), %rdx
leaq 0x1e819(%rip), %rsi     # 0x435ef
leaq -0x198(%rbp), %rdi
callq 0x6be0
jmp 0x24de4
movq -0x298(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x20e30
movq %rax, -0x2a0(%rbp)
jmp 0x24e00
movq -0x2a0(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x5710
jmp 0x24e15
leaq -0x198(%rbp), %rdi
callq 0x5aa8
leaq -0x199(%rbp), %rdi
callq 0x55e0
leaq -0x178(%rbp), %rdi
callq 0x5aa8
jmp 0x24ede
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24e8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24e72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x5aa8
leaq -0x151(%rbp), %rdi
callq 0x55e0
leaq -0x110(%rbp), %rdi
callq 0x5aa8
leaq -0x130(%rbp), %rdi
callq 0x5aa8
jmp 0x2502a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x24ec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x5aa8
leaq -0x199(%rbp), %rdi
callq 0x55e0
leaq -0x178(%rbp), %rdi
callq 0x5aa8
jmp 0x2502a
movq -0x210(%rbp), %rsi
addq $0x8, %rsi
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x37c50
movq -0x2c0(%rbp), %rsi
movq -0x210(%rbp), %rdi
addq $0xe0, %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x56d0
movq -0x2c0(%rbp), %rdi
callq 0x5aa8
movq -0x2b8(%rbp), %rdi
callq 0x5830
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x20f10
movq -0x210(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x2b0(%rbp)
leaq -0x201(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x5960
movq -0x2a8(%rbp), %rdx
leaq 0x1e667(%rip), %rsi     # 0x435e0
leaq -0x200(%rbp), %rdi
callq 0x6be0
jmp 0x24f87
movq -0x2b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x20e30
movq %rax, -0x2c8(%rbp)
jmp 0x24fa3
movq -0x2c8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x56d0
leaq -0x200(%rbp), %rdi
callq 0x5aa8
leaq -0x201(%rbp), %rdi
callq 0x55e0
leaq -0x1e0(%rbp), %rdi
callq 0x5aa8
jmp 0x2501c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x25002
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x5aa8
leaq -0x201(%rbp), %rdi
callq 0x55e0
leaq -0x1e0(%rbp), %rdi
callq 0x5aa8
jmp 0x2502a
movl $0xc8, %eax
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x5950
nopw %cs:(%rax,%rax)