// File: /workspace/github_cpp_makefile_star2_O3/solaldunckel[P]webserv/srcs/HTTP/Server.cpp
// Function: Server::newConnection(int)
void Server::newConnection(int fd) {
  struct sockaddr_storage their_addr;
  socklen_t addr_size = sizeof(their_addr);

  FD_CLR(fd, &read_fds_);

  int clientFd = accept(fd, (struct sockaddr *)&their_addr, &addr_size);

  if (clientFd == -1)
    return ;

  Log.print(INFO, head_ + "new connection on " + ft::to_string(running_server_[fd].ip_) + ":" + ft::to_string(running_server_[fd].port_), GREEN);

  fcntl(clientFd, F_SETFL, O_NONBLOCK);

  std::string client_addr = ft::inet_ntop(ft::get_in_addr((struct sockaddr *)&their_addr));
  clients_[clientFd] = new Client(clientFd, client_addr, running_server_[fd], worker_id_, clients_.size() >= MAX_CLIENT);

  add_to_fd_set(clientFd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %esi, %ecx
movq %rdi, %rbx
movl %esi, 0x8(%rsp)
leaq 0xd4(%rsp), %rdx
movl $0x80, (%rdx)
movq $-0x2, %rax
rolq %cl, %rax
leal 0x3f(%rcx), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x6, %esi
movslq %esi, %rsi
andq %rax, 0xf8(%rdi,%rsi,8)
leaq 0x118(%rsp), %rsi
movl %ecx, %edi
callq 0x4110
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x197a9
movl %eax, %ebp
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x6c2a
leaq 0xc679(%rip), %rsi      # 0x25a15
movq %r14, %rdi
callq 0x4840
leaq 0x18(%rbx), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1abc6
leaq 0x108(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0x6c2a
leaq 0xb0(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1ac2b
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0xb8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r15, %rcx
je 0x19413
movq 0x40(%rsp), %rdi
movq 0xb0(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x1943f
leaq 0xc0(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x1943a
movq 0xc0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1944b
leaq 0x30(%rsp), %rdi
callq 0x4100
jmp 0x1945c
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44d0
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x19480
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x19486
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xbf78(%rip), %rsi      # 0x25422
leaq 0x50(%rsp), %rdi
callq 0x4840
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x194db
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x194e3
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1abc6
movl 0x20(%rax), %esi
leaq 0x90(%rsp), %rdi
callq 0x106c9
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x98(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x1953d
movq 0x20(%rsp), %rdi
movq 0x90(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x19569
leaq 0xa0(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x19564
movq 0xa0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x19575
leaq 0x10(%rsp), %rdi
callq 0x4100
jmp 0x19586
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44d0
leaq 0x80(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x195b0
movq %rsi, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x195b6
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %r12, %r15
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xe8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc425(%rip), %rsi      # 0x25a0f
leaq 0xc423(%rip), %rdx      # 0x25a14
leaq 0xd8(%rsp), %rdi
callq 0x579e
leaq 0x18ee3(%rip), %rdi     # 0x324e8
leaq 0x70(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
movl $0x1, %esi
xorl %r8d, %r8d
callq 0x20f32
movq 0xd8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1963c
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1965d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1967e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x19695
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x196b0
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x196d1
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x196ee
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1970a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
movl %ebp, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x4260
leaq 0x118(%rsp), %rdi
callq 0x24a2b
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x247db
movl $0x50, %edi
callq 0x4440
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1abc6
movl (%rbx), %r8d
xorl %r9d, %r9d
cmpq $0x3e8, 0x70(%rbx)      # imm = 0x3E8
setae %r9b
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rcx
callq 0x108e8
leaq 0x48(%rbx), %rdi
leaq 0xc(%rsp), %rsi
callq 0x1ad06
movq %r15, (%rax)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x19296
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x197a9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r12, %rdi
je 0x197e0
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x197e0
movq %rax, %rbx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19809
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19809
movq %r12, %r15
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19878
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x19878
movq %r12, %r15
movq %rax, %rbx
jmp 0x1988f
movq %r12, %r15
movq %rax, %rbx
jmp 0x198aa
movq %r12, %r15
movq %rax, %rbx
jmp 0x198cb
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
jne 0x198fc
jmp 0x1991d
movq %rax, %rbx
movl $0x50, %esi
movq %r15, %rdi
callq 0x4470
jmp 0x19906
movq %r12, %r15
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x1988f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x198aa
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x198cb
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x198ed
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x198ed
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1991d
movq 0x40(%rsp), %rsi
jmp 0x19915
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x1991d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4790
nop