// File: /workspace/github_cpp_makefile_star2_O3/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 0x1ad06
movq (%rax), %rdi
callq 0x10e8e
movb $0x1, %bl
testq %rax, %rax
je 0x1a157
movq %rax, %r15
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x17042
testl %eax, %eax
js 0x1a155
jne 0x1a157
movq %r15, %rdi
callq 0x16efc
movb $0x1, %bpl
testb %al, %al
jne 0x19f9f
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
callq 0x10e76
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 0x6c2a
leaq 0xba6f(%rip), %rsi      # 0x25a3e
movq %r12, %rdi
callq 0x4840
leaq 0x1850a(%rip), %rdi     # 0x324e8
callq 0x20f2e
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x17130
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x50(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x1a014
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x1a037
leaq 0x58(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x1a032
movq 0x58(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1a043
leaq 0x28(%rsp), %rdi
callq 0x4100
jmp 0x1a051
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44d0
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1a075
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1a07b
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 0xaf72(%rip), %rsi      # 0x2501a
leaq 0xaf70(%rip), %rdx      # 0x2501f
leaq 0x68(%rsp), %rdi
callq 0x579e
leaq 0x18428(%rip), %rdi     # 0x324e8
leaq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movl $0x1, %esi
xorl %r8d, %r8d
callq 0x20f32
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a0ee
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a109
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a124
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a13b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1ad06
movq (%rax), %rdi
callq 0x1098a
testb %bpl, %bpl
je 0x1a157
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 0x1a18a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x1a18a
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a1aa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x1a1aa
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a1cc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x1a1cc
jmp 0x1a1c9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a1e3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4790
nop