// File: /workspace/github_cpp_makefile_star2_O1/solaldunckel[P]webserv/srcs/HTTP/Server.cpp
// Function: Server::send(int)
bool Server::send(int fd) {
  FD_CLR(fd, &write_fds_);

  Response *response = clients_[fd]->getResponse();

  if (response) {
    int ret = response->send(fd);

    if (ret < 0)
      return false;
    else if (ret == 0) {
      bool disconnect = response->shouldDisconnect() || clients_[fd]->disconnect();
      Log.print(INFO, head_ + ">> " + response->response_log(Log.getLogLevel()));
      clients_[fd]->clear();
      if (disconnect)
        return false;
    }
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ecx
movq %rdi, %r12
movq $-0x2, %rax
rolq %cl, %rax
leaq 0x4(%rsp), %rsi
movl %ecx, (%rsi)
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rcx
andq %rax, 0x178(%rdi,%rcx,8)
leaq 0x48(%rdi), %r14
movq %r14, %rdi
callq 0x1ac40
movq (%rax), %rdi
callq 0x10d9c
movb $0x1, %bl
testq %rax, %rax
je 0x1a0dc
movq %rax, %r15
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x16fbe
testl %eax, %eax
js 0x1a0da
jne 0x1a0dc
movq %r15, %rdi
callq 0x16e66
movb $0x1, %bpl
testb %al, %al
jne 0x19f23
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1ac40
movq (%rax), %rdi
callq 0x10d84
movl %eax, %ebp
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x218(%r12), %rsi
movq 0x220(%r12), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x6bac
leaq 0xbaeb(%rip), %rsi      # 0x25a3e
movq %r12, %rdi
callq 0x4830
leaq 0x18576(%rip), %rdi     # 0x324d8
callq 0x20faa
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x170ac
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x19f98
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x19fb7
leaq 0x58(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x19fb2
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x19fc8
movq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x4100
jmp 0x19fd6
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44c0
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x19ffa
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1a000
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xafed(%rip), %rsi      # 0x2501a
leaq 0xafeb(%rip), %rdx      # 0x2501f
leaq 0x68(%rsp), %rdi
callq 0x578e
leaq 0x18493(%rip), %rdi     # 0x324d8
leaq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movl $0x1, %esi
xorl %r8d, %r8d
callq 0x20fae
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a073
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a08e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a0a9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a0c0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1ac40
movq (%rax), %rdi
callq 0x1089a
testb %bpl, %bpl
je 0x1a0dc
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a10f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x1a10f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a12f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x1a12f
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a151
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x1a151
jmp 0x1a14e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a168
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rbx, %rdi
callq 0x4780