// File: /workspace/github_cpp_makefile_star2_O3/solaldunckel[P]webserv/srcs/HTTP/Server.cpp
// Function: Server::recv(int)
bool Server::recv(int fd) {
  Request *req = clients_[fd]->getRequest();

  if (!req)
    req = clients_[fd]->getRequest(true);

  char buf[BUF_SIZE];

  FD_CLR(fd, &read_fds_);

  int nbytes = ::recv(fd, buf, BUF_SIZE, 0);

  if (nbytes <= 0)
    return false;

  std::string buffer(buf, nbytes);

  int ret = req->parse(buffer);

  if (ret >= 1) {
    clients_[fd]->setupConfig(servers_, options_);
    Log.print(INFO, head_ + "<< " + clients_[fd]->getConfig()->log(Log.getLogLevel()));
    clients_[fd]->setupResponse(servers_, options_, ret);
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100b8, %rsp          # imm = 0x100B8
movq %rdi, %rbx
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
leaq 0x48(%rdi), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x1ad06
movq (%rax), %rdi
xorl %esi, %esi
callq 0x10dbe
movq %rax, %r12
testq %rax, %rax
jne 0x19b8b
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
movl $0x1, %esi
callq 0x10dbe
movq %rax, %r12
movl 0xc(%rsp), %ecx
movq $-0x2, %rax
rolq %cl, %rax
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
andq %rax, 0xf8(%rbx,%rdx,8)
leaq 0xb0(%rsp), %rsi
movl $0xffff, %edx           # imm = 0xFFFF
movl %ecx, %edi
xorl %ecx, %ecx
callq 0x4120
movq %rax, %r15
testl %r15d, %r15d
jle 0x19e39
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
leaq (%rsp,%rax), %rdx
addq $0xb0, %rdx
leaq 0x70(%rsp), %r13
leaq 0xb0(%rsp), %rsi
movq %r13, %rdi
callq 0x579e
movq %r12, %rdi
movq %r13, %rsi
callq 0x11192
movl %eax, %ebp
testl %eax, %eax
jle 0x19e17
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
callq 0x109ae
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x6c2a
leaq 0xbdd8(%rip), %rsi      # 0x25a3a
leaq 0x10(%rsp), %rdi
callq 0x4840
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
callq 0x10e88
movq %rax, %r12
leaq 0x1885d(%rip), %rdi     # 0x324e8
callq 0x20f2e
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x9f84
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x19cc1
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x19ce4
leaq 0x60(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x19cdf
movq 0x60(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x19cf0
leaq 0x10(%rsp), %rdi
callq 0x4100
jmp 0x19cfe
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44d0
leaq 0x40(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x19d22
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x19d28
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb2c1(%rip), %rsi      # 0x2501a
leaq 0xb2bf(%rip), %rdx      # 0x2501f
leaq 0x90(%rsp), %rdi
callq 0x579e
leaq 0x18774(%rip), %rdi     # 0x324e8
leaq 0x30(%rsp), %rdx
leaq 0x90(%rsp), %rcx
movl $0x1, %esi
xorl %r8d, %r8d
callq 0x20f32
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x19dab
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19dc6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19de1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x19df8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movl %ebp, %ecx
callq 0x10a14
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x19e39
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
testl %r15d, %r15d
setg %al
addq $0x100b8, %rsp          # imm = 0x100B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x19e76
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19e76
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19e96
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19e96
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19eba
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19eba
jmp 0x19eb7
jmp 0x19ed3
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x19ed6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19ed6
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x19ef8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4790