// File: /workspace/github_cpp_makefile_star2_O1/solaldunckel[P]webserv/srcs/HTTP/Response.cpp
// Function: Response::createResponse()
void Response::createResponse() {
  headers_["Server"] = "webserv/1.0";

  if (config_.getMethod() == "HEAD")
    body_.clear();

  if (status_code_ < 400 && redirect_code_)
    status_code_ = redirect_code_;

  std::string status_code;

  if (headers_.count("Status")) {
    status_code = headers_["Status"];
    headers_.erase("Status");
  }
  else
    status_code = ft::to_string(status_code_) + " " + g_status[status_code_];

  response_ = response_ + config_.getProtocol() + " " + status_code + "\r\n";

  headers_["Date"] = ft::get_http_date();

  for (std::map<std::string, std::string>::iterator it = headers_.begin(); it != headers_.end(); it++)
    response_ += it->first + ": " + it->second + "\r\n";

  response_ += "\r\n";

  header_size_ = response_.size();

  if (!body_.empty()) {
    body_size_ = body_.size();
    response_ += body_;
    body_.clear();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r12
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfd9a(%rip), %rsi      # 0x25816
leaq 0xfd99(%rip), %rdx      # 0x2581c
leaq 0x68(%rsp), %rdi
callq 0x578e
leaq 0x190(%r12), %r14
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x104da
movq 0x8(%rax), %rdx
leaq 0xfe21(%rip), %rcx      # 0x258ce
movl $0xb, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x4680
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x15ad4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4460
movq (%r12), %rdi
callq 0x9f04
leaq 0xfcbb(%rip), %rsi      # 0x2579f
movq %rax, %rdi
callq 0x40f0
testl %eax, %eax
jne 0x15b07
movq $0x0, 0xe8(%r12)
movq 0xe0(%r12), %rax
movb $0x0, (%rax)
cmpl $0x18f, 0xb8(%r12) # imm = 0x18F
jg 0x15b29
movl 0x128(%r12), %eax
testl %eax, %eax
je 0x15b29
movl %eax, 0xb8(%r12)
movq %r15, 0x68(%rsp)
movq $0x0, 0x70(%rsp)
movb $0x0, 0x78(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xfd8e(%rip), %rsi      # 0x258da
leaq 0xfd8d(%rip), %rdx      # 0x258e0
movq %rsp, %rdi
callq 0x578e
movq %rsp, %rsi
movq %r14, %rdi
callq 0x10658
movq %rax, %rbx
leaq 0x198(%r12), %rax
movq %rax, 0x88(%rsp)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x15b94
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
cmpq 0x88(%rsp), %rbx
je 0x15c43
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0xfd26(%rip), %rsi      # 0x258da
leaq 0xfd25(%rip), %rdx      # 0x258e0
callq 0x578e
movq %rsp, %rsi
movq %r14, %rdi
callq 0x104da
leaq 0x68(%rsp), %rdi
movq %rax, %rsi
callq 0x4230
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x15bf3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0xfcd5(%rip), %rsi      # 0x258da
leaq 0xfcd4(%rip), %rdx      # 0x258e0
callq 0x578e
movq %rsp, %rsi
movq %r14, %rdi
callq 0x1811e
movq %r14, %rdi
movq %rax, %rsi
callq 0x181c6
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x15d6d
movq 0x10(%rsp), %rsi
jmp 0x15d65
movl 0xb8(%r12), %esi
leaq 0x40(%rsp), %rdi
callq 0x6a15
leaq 0xfc2b(%rip), %rsi      # 0x25887
leaq 0x40(%rsp), %rdi
callq 0x4830
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15c8d
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x15c94
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0xb8(%r12), %esi
leaq 0x1c86d(%rip), %rdi     # 0x32528
callq 0x24042
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
callq 0x4100
leaq 0x10(%rsp), %r13
movq %r13, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15cf7
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x15cff
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rsp, %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4560
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x15d3b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x15d52
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15d6d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4460
movq (%r12), %rdi
callq 0x9f26
leaq 0xc0(%r12), %rsi
leaq 0x98(%rsp), %rdi
movq %rsi, 0x60(%rsp)
movq %rax, %rdx
callq 0x17be6
leaq 0xfaed(%rip), %rsi      # 0x25887
leaq 0x98(%rsp), %rdi
callq 0x4830
leaq 0x50(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15dce
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x15dd5
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x4100
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15e27
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x15e2e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xf98e(%rip), %rsi      # 0x257df
callq 0x4830
leaq 0x10(%rsp), %r13
movq %r13, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15e7c
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x15e84
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rsp, %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x4560
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x15ec0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x15ed7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15eee
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15f0f
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rsp, %rdi
callq 0x24aeb
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0xf9bb(%rip), %rsi      # 0x258e1
leaq 0xf9b8(%rip), %rdx      # 0x258e5
callq 0x578e
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x104da
movq %rsp, %rsi
movq %rax, %rdi
callq 0x4560
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x15f61
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rbp, %r13
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x15f7f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq %r12, 0x90(%rsp)
movq 0x1a8(%r12), %r14
cmpq 0x88(%rsp), %r14
je 0x160eb
leaq 0x40(%rsp), %r12
leaq 0xf836(%rip), %rbp      # 0x257df
leaq 0x20(%rsp), %rbx
movq %r13, 0x40(%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6bac
movq %r12, %rdi
leaq 0xfa7e(%rip), %rsi      # 0x25a4e
callq 0x4830
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
movq %r12, %rdi
callq 0x4100
movq %r15, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x16008
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1600f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4830
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x16058
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1605e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x60(%rsp), %rdi
callq 0x4100
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x160a4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x160bb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x160d2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4460
movq %r14, %rdi
callq 0x42d0
movq %rax, %r14
cmpq 0x88(%rsp), %rax
jne 0x15fae
leaq 0xf6ed(%rip), %rsi      # 0x257df
movq 0x60(%rsp), %rdi
leaq 0x78(%rsp), %rbx
callq 0x4830
movq 0x90(%rsp), %r14
movq 0xc8(%r14), %rax
movq 0xe8(%r14), %rdx
movq %rax, 0x130(%r14)
testq %rdx, %rdx
je 0x16150
movq %rdx, 0x138(%r14)
movq 0xe0(%r14), %rsi
movq 0x60(%rsp), %rdi
callq 0x4100
movq $0x0, 0xe8(%r14)
movq 0xe0(%r14), %rax
movb $0x0, (%rax)
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x16167
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4460
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x161a7
jmp 0x1627b
jmp 0x1627b
jmp 0x1627b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x161a7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x162cb
jmp 0x162d8
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x16253
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x16253
jmp 0x16250
jmp 0x1627b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x16204
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x16204
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16220
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x16220
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x162d8
movq 0xa8(%rsp), %rsi
jmp 0x162d0
jmp 0x16250
jmp 0x1627b
movq %rax, %rbx
jmp 0x162f4
jmp 0x16250
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x162d8
movq 0x10(%rsp), %rsi
jmp 0x162d0
jmp 0x1627b
jmp 0x1627b
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
jne 0x162e7
jmp 0x162f4
movq %rax, %rbx
jmp 0x162d8
jmp 0x16282
movq %rax, %rbx
jmp 0x162c1
movq %rax, %rbx
jmp 0x162aa
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x162aa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x162c1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x162d8
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x162f4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rbx, %rdi
callq 0x4780