// File: /workspace/github_c_makefile_star2_O0/wtarreau[P]httpterm/httpterm.c
// Function: event_accept
int event_accept(int fd) {
    struct proxy *p = (struct proxy *)fdtab[fd].owner;
    struct session *s;
    struct task *t;
    int cfd = -1;
    int max_accept;

#ifdef ENABLE_ACCEPT4
    static int use_accept = 0;
#else
    static int use_accept = 1;
#endif

    if (global.nbproc > 1)
	    max_accept = 8; /* let other processes catch some connections too */
    else
	    max_accept = -1;

    while (p->nbconn < p->maxconn && max_accept--) {
	struct sockaddr_storage addr;
	socklen_t laddr = sizeof(addr);

#ifdef ENABLE_ACCEPT4
	if (!use_accept) {
	    cfd = accept4(fd, (struct sockaddr *)&addr, &laddr, SOCK_NONBLOCK);
	    if (cfd == -1 && errno == ENOSYS)
		use_accept = 1;
	}
#endif
	if (use_accept) {
	    cfd = accept(fd, (struct sockaddr *)&addr, &laddr);
	    if (cfd != -1)
		fcntl(cfd, F_SETFL, O_NONBLOCK);
	}

	if (cfd == -1) {
	    switch (errno) {
	    case EAGAIN:
	    case EINTR:
	    case ECONNABORTED:
		return 0;	    /* nothing more to accept */
	    case ENFILE:
		return 0;
	    case EMFILE:
		return 0;
	    case ENOBUFS:
	    case ENOMEM:
		return 0;
	    default:
		return 0;
	    }
	}

	if ((s = pool_alloc(session)) == NULL) { /* disable this proxy for a while */
	    Alert("out of memory in event_accept().\n");
	    my_fd_clr(fd, StaticReadEvent);
	    p->state = PR_STIDLE;
	    close(cfd);
	    return 0;
	}

	if ((t = pool_alloc(task)) == NULL) { /* disable this proxy for a while */
	    Alert("out of memory in event_accept().\n");
	    my_fd_clr(fd, StaticReadEvent);
	    p->state = PR_STIDLE;
	    close(cfd);
	    pool_free(session, s);
	    return 0;
	}

	s->cli_addr = addr;
	if (cfd >= global.maxsock) {
	    Alert("accept(): not enough free sockets. Raise -n argument. Giving up.\n");
	    close(cfd);
	    pool_free(task, t);
	    pool_free(session, s);
	    return 0;
	}

	if (p->options & PR_O_TCP_CLI_KA)
	    setsockopt(cfd, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(one));

	if (cfg_sndbuf > 0)
	    setsockopt(cfd, SOL_SOCKET, SO_SNDBUF, &cfg_sndbuf, sizeof(cfg_sndbuf));

	t->next = t->prev = t->rqnext = NULL; /* task not in run queue yet */
	t->wq = LIST_HEAD(wait_queue[0]); /* but already has a wait queue assigned */
	t->state = TASK_IDLE;
	t->process = process_session;
	t->context = s;

	s->task = t;
	s->proxy = p;
	s->cli_state = CL_STHEADERS;
	s->sock_st = 0;
	s->ka = 0;
	s->req = s->rep = NULL; /* will be allocated later */
        s->to_write = 0;

	s->res_cr = s->res_cw  = RES_SILENT;
	s->cli_fd = cfd;
	s->srv = NULL;
	s->uri = NULL;
	s->etag = 0;
	s->req_code = s->req_size = s->req_cache = s->req_time = -1;
	s->ka_time = s->pause_time = -1;
	s->req_body = 0;
	s->req_chunked = 0;
	s->req_nosplice = 0;
	s->req_random = 0;
	s->req_pieces = 0;
	s->req_bodylen = -1; // default: advertise the correct size
	s->req_maxbody = -1;
	s->req_verbose = 0;

	s->logs.tv_accept = now;
	s->logs.t_request = -1;
	s->logs.t_queue = -1;

	s->uniq_id = totalconn;
	p->cum_conn++;

	if ((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
	    struct sockaddr_in sockname;
	    socklen_t namelen = sizeof(sockname);
	    int len;
	    if (addr.ss_family != AF_INET)
		getsockname(cfd, (struct sockaddr *)&sockname, &namelen);

	    if (s->cli_addr.ss_family == AF_INET) {
		char pn[INET_ADDRSTRLEN];
		inet_ntop(AF_INET,
			  (const void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr,
			  pn, sizeof(pn));

		len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n",
			      s->uniq_id, p->id, (unsigned short)fd, (unsigned short)cfd,
			      pn, ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port));
	    }
	    else {
		char pn[INET6_ADDRSTRLEN];
		inet_ntop(AF_INET6,
			  (const void *)&((struct sockaddr_in6 *)(&s->cli_addr))->sin6_addr,
			  pn, sizeof(pn));

		len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n",
			      s->uniq_id, p->id, (unsigned short)fd, (unsigned short)cfd,
			      pn, ntohs(((struct sockaddr_in6 *)(&s->cli_addr))->sin6_port));
	    }

	    (void)!write(1, trash, len);
	}

	if ((s->req = pool_alloc(buffer)) == NULL) { /* no memory */
	    close(cfd); /* nothing can be done for this fd without memory */
	    pool_free(task, t);
	    pool_free(session, s);
	    return 0;
	}

	s->req->data = s->req->data_buf;
	s->req->l = 0;
	s->req->total = 0;
	s->req->h = s->req->r = s->req->lr = s->req->w = s->req->data;	/* r and w will be reset further */

	if ((s->rep = pool_alloc(buffer)) == NULL) { /* no memory */
	    pool_free(buffer, s->req);
	    close(cfd); /* nothing can be done for this fd without memory */
	    pool_free(task, t);
	    pool_free(session, s);
	    return 0;
	}
	s->rep->l = 0;
	s->rep->total = 0;
	s->rep->data = s->rep->data_buf;
	s->rep->h = s->rep->r = s->rep->lr = s->rep->w = s->rep->data;

	fdtab[cfd].read  = &event_cli_read;
	fdtab[cfd].write = &event_cli_write;
	fdtab[cfd].owner = t;
	fdtab[cfd].state = FD_STREADY;

	if (event_cli_read(cfd) < 0)
	    my_fd_set(cfd, StaticReadEvent);

	setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof(one));

	fd_insert(cfd);

	tv_eternity(&s->cnexpire);
	tv_eternity(&s->crexpire);
	tv_eternity(&s->cwexpire);

	if (s->proxy->clitimeout) {
	    if (my_fd_isset(cfd, StaticReadEvent))
		tv_delayfrom(&s->crexpire, &now, s->proxy->clitimeout);
	    if (my_fd_isset(cfd, StaticWriteEvent))
		tv_delayfrom(&s->cwexpire, &now, s->proxy->clitimeout);
	}

	tv_min(&t->expire, &s->crexpire, &s->cwexpire);

	task_queue(t);
	task_wakeup(&rq, t);

	p->nbconn++;
	actconn++;
	totalconn++;

	// fprintf(stderr, "accepting from %p => %d conn, %d total, task=%p\n", p, actconn, totalconn, t);
    } /* end of while (p->nbconn < p->maxconn) */
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movl %edi, -0x8(%rbp)
movq 0xca8b(%rip), %rax      # 0x113b0
movslq -0x8(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
cmpl $0x1, 0xca82(%rip)      # 0x113c8
jle 0x4951
movl $0x8, -0x28(%rbp)
jmp 0x4958
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x495a
movq -0x10(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x48(%rdx), %ecx
movb %al, -0x189(%rbp)
jge 0x4989
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x28(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x189(%rbp)
movb -0x189(%rbp), %al
testb $0x1, %al
jne 0x4998
jmp 0x54e9
movl $0x80, -0xac(%rbp)
cmpl $0x0, 0xc99b(%rip)      # 0x11344
je 0x49e0
movl -0x8(%rbp), %edi
leaq -0xa8(%rbp), %rsi
leaq -0xac(%rbp), %rdx
callq 0x2390
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
je 0x49de
movl -0x24(%rbp), %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
movb $0x0, %al
callq 0x20d0
jmp 0x49e0
cmpl $-0x1, -0x24(%rbp)
jne 0x4a88
callq 0x2070
movl (%rax), %eax
movl %eax, -0x190(%rbp)
subl $0x4, %eax
je 0x4a4c
jmp 0x49fe
movl -0x190(%rbp), %eax
subl $0xb, %eax
je 0x4a4c
jmp 0x4a0b
movl -0x190(%rbp), %eax
subl $0xc, %eax
je 0x4a70
jmp 0x4a18
movl -0x190(%rbp), %eax
subl $0x17, %eax
je 0x4a58
jmp 0x4a25
movl -0x190(%rbp), %eax
subl $0x18, %eax
je 0x4a64
jmp 0x4a32
movl -0x190(%rbp), %eax
subl $0x67, %eax
je 0x4a4c
jmp 0x4a3f
movl -0x190(%rbp), %eax
subl $0x69, %eax
je 0x4a70
jmp 0x4a7c
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq 0xc8f9(%rip), %rax      # 0x11388
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
jne 0x4aaf
movl $0x178, %edi            # imm = 0x178
callq 0x22b0
movq %rax, -0xb8(%rbp)
jmp 0x4ac0
movq 0xc8d2(%rip), %rax      # 0x11388
movq (%rax), %rax
movq %rax, 0xc8c8(%rip)      # 0x11388
movq -0xb8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x4b1b
leaq 0x985d(%rip), %rdi      # 0xe343
movb $0x0, %al
callq 0x2d40
movl -0x8(%rbp), %edi
movq 0xc911(%rip), %rsi      # 0x11408
callq 0x3fd0
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movl -0x24(%rbp), %edi
callq 0x21d0
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq 0xc87e(%rip), %rax      # 0x113a0
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
jne 0x4b42
movl $0x48, %edi
callq 0x22b0
movq %rax, -0xc8(%rbp)
jmp 0x4b53
movq 0xc857(%rip), %rax      # 0x113a0
movq (%rax), %rax
movq %rax, 0xc84d(%rip)      # 0x113a0
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x4bce
leaq 0x97ca(%rip), %rdi      # 0xe343
movb $0x0, %al
callq 0x2d40
movl -0x8(%rbp), %edi
movq 0xc87e(%rip), %rsi      # 0x11408
callq 0x3fd0
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movl -0x24(%rbp), %edi
callq 0x21d0
movq 0xc7df(%rip), %rcx      # 0x11388
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, 0xc7cd(%rip)      # 0x11388
movq %rax, -0xd8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq -0x18(%rbp), %rdi
addq $0x70, %rdi
leaq -0xa8(%rbp), %rsi
movl $0x80, %edx
callq 0x2270
movl -0x24(%rbp), %eax
cmpl 0xc7e0(%rip), %eax      # 0x113d0
jl 0x4c54
leaq 0x976c(%rip), %rdi      # 0xe365
movb $0x0, %al
callq 0x2d40
movl -0x24(%rbp), %edi
callq 0x21d0
movq 0xc791(%rip), %rcx      # 0x113a0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, 0xc77f(%rip)      # 0x113a0
movq %rax, -0xe0(%rbp)
movq 0xc759(%rip), %rcx      # 0x11388
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, 0xc747(%rip)      # 0x11388
movq %rax, -0xe8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x4c84
movl -0x24(%rbp), %edi
movl $0x1, %esi
movl $0x9, %edx
leaq 0x8523(%rip), %rcx      # 0xd19c
movl $0x4, %r8d
callq 0x20c0
cmpl $0x0, 0xc6d9(%rip)      # 0x11364
jle 0x4cac
movl -0x24(%rbp), %edi
movl $0x1, %esi
movl $0x7, %edx
leaq 0xc6c3(%rip), %rcx      # 0x11364
movl $0x4, %r8d
callq 0x20c0
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
leaq 0xc586(%rip), %rcx      # 0x11260
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
leaq 0x80c(%rip), %rcx       # 0x5500
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x39(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x38(%rax)
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0xf0(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x120(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x11c(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x150(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x14c(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq $-0x1, 0x128(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x148(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x158(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x154(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq $0x0, 0x130(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x15c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x160(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x164(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x168(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x140(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x138(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x170(%rax)
movq -0x18(%rbp), %rax
movq 0xc597(%rip), %rcx      # 0x11410
movq %rcx, 0xf8(%rax)
movq 0xc591(%rip), %rcx      # 0x11418
movq %rcx, 0x100(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x108(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x110(%rax)
movl 0x2c586(%rip), %ecx     # 0x31438
movq -0x18(%rbp), %rax
movl %ecx, 0x118(%rax)
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x44(%rax)
movl 0xc50d(%rip), %eax      # 0x113dc
andl $0x1, %eax
cmpl $0x0, %eax
je 0x50cd
movl 0xc4fb(%rip), %eax      # 0x113dc
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4efb
movl 0xc4ed(%rip), %eax      # 0x113dc
andl $0x40, %eax
cmpl $0x0, %eax
je 0x50cd
movl $0x10, -0xfc(%rbp)
movzwl -0xa8(%rbp), %eax
cmpl $0x2, %eax
je 0x4f27
movl -0x24(%rbp), %edi
leaq -0xf8(%rbp), %rsi
leaq -0xfc(%rbp), %rdx
callq 0x23a0
movq -0x18(%rbp), %rax
movzwl 0x70(%rax), %eax
cmpl $0x2, %eax
jne 0x4ff9
movq -0x18(%rbp), %rsi
addq $0x70, %rsi
addq $0x4, %rsi
leaq -0x110(%rbp), %rdx
movl $0x2, %edi
movl $0x10, %ecx
callq 0x2030
movq -0x18(%rbp), %rax
movl 0x118(%rax), %eax
movl %eax, -0x1ac(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x1a8(%rbp)
movl -0x8(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x1a0(%rbp)
movl -0x24(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x19c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x72(%rax), %edi
callq 0x2310
movl -0x1ac(%rbp), %edx
movq -0x1a8(%rbp), %rcx
movl -0x1a0(%rbp), %r8d
movl -0x19c(%rbp), %r9d
movq -0x198(%rbp), %r10
movzwl %ax, %eax
leaq 0x2c468(%rip), %rdi     # 0x31440
leaq 0x93c8(%rip), %rsi      # 0xe3a7
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x23d0
movl %eax, -0x100(%rbp)
jmp 0x50b5
movq -0x18(%rbp), %rsi
addq $0x70, %rsi
addq $0x8, %rsi
leaq -0x140(%rbp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x2030
movq -0x18(%rbp), %rax
movl 0x118(%rax), %eax
movl %eax, -0x1cc(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x1c8(%rbp)
movl -0x8(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x1c0(%rbp)
movl -0x24(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x1bc(%rbp)
leaq -0x140(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x72(%rax), %edi
callq 0x2310
movl -0x1cc(%rbp), %edx
movq -0x1c8(%rbp), %rcx
movl -0x1c0(%rbp), %r8d
movl -0x1bc(%rbp), %r9d
movq -0x1b8(%rbp), %r10
movzwl %ax, %eax
leaq 0x2c3a7(%rip), %rdi     # 0x31440
leaq 0x9307(%rip), %rsi      # 0xe3a7
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x23d0
movl %eax, -0x100(%rbp)
movslq -0x100(%rbp), %rdx
movl $0x1, %edi
leaq 0x2c378(%rip), %rsi     # 0x31440
callq 0x20e0
movq 0xc2bc(%rip), %rax      # 0x11390
movq %rax, -0x148(%rbp)
cmpq $0x0, %rax
jne 0x50f4
movl $0x1038, %edi           # imm = 0x1038
callq 0x22b0
movq %rax, -0x148(%rbp)
jmp 0x5105
movq 0xc295(%rip), %rax      # 0x11390
movq (%rax), %rax
movq %rax, 0xc28b(%rip)      # 0x11390
movq -0x148(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rax, 0x58(%rcx)
cmpq $0x0, %rax
jne 0x517c
movl -0x24(%rbp), %edi
callq 0x21d0
movq 0xc269(%rip), %rcx      # 0x113a0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, 0xc257(%rip)      # 0x113a0
movq %rax, -0x158(%rbp)
movq 0xc231(%rip), %rcx      # 0x11388
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, 0xc21f(%rip)      # 0x11388
movq %rax, -0x160(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0x38, %rcx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x18(%rax)
movq 0xc19b(%rip), %rax      # 0x11390
movq %rax, -0x168(%rbp)
cmpq $0x0, %rax
jne 0x5215
movl $0x1038, %edi           # imm = 0x1038
callq 0x22b0
movq %rax, -0x168(%rbp)
jmp 0x5226
movq 0xc174(%rip), %rax      # 0x11390
movq (%rax), %rax
movq %rax, 0xc16a(%rip)      # 0x11390
movq -0x168(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rax, 0x60(%rcx)
cmpq $0x0, %rax
jne 0x52c5
movq 0xc140(%rip), %rcx      # 0x11390
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, 0xc126(%rip)      # 0x11390
movq %rax, -0x178(%rbp)
movl -0x24(%rbp), %edi
callq 0x21d0
movq 0xc120(%rip), %rcx      # 0x113a0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, 0xc10e(%rip)      # 0x113a0
movq %rax, -0x180(%rbp)
movq 0xc0e8(%rip), %rcx      # 0x11388
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, 0xc0d6(%rip)      # 0x11388
movq %rax, -0x188(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x54f0
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x38, %rcx
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x18(%rax)
movq 0xc072(%rip), %rax      # 0x113b0
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x16d0(%rip), %rcx     # 0x3c80
movq %rcx, (%rax)
movq 0xc056(%rip), %rax      # 0x113b0
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x120c(%rip), %rcx     # 0x4160
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq 0xc035(%rip), %rax      # 0x113b0
movslq -0x24(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq 0xc01f(%rip), %rax      # 0x113b0
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x3, 0x18(%rax)
movl -0x24(%rbp), %edi
callq 0x3c80
cmpl $0x0, %eax
jge 0x53bf
movl -0x24(%rbp), %edi
movq 0xc04e(%rip), %rsi      # 0x11408
callq 0x4810
movl -0x24(%rbp), %edi
movl $0x6, %esi
movl $0x1, %edx
leaq 0x7dc9(%rip), %rcx      # 0xd19c
movl $0x4, %r8d
callq 0x20c0
movl -0x24(%rbp), %edi
callq 0x5680
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x40e0
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x40e0
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x40e0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
cmpl $0x0, 0x30(%rax)
je 0x5483
movl -0x24(%rbp), %edi
movq 0xbfe3(%rip), %rsi      # 0x11408
callq 0x4000
cmpl $0x0, %eax
je 0x544e
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x30(%rax), %edx
leaq 0xbfc7(%rip), %rsi      # 0x11410
callq 0x4030
movl -0x24(%rbp), %edi
movq 0x2bfd8(%rip), %rsi     # 0x31430
callq 0x4000
cmpl $0x0, %eax
je 0x5481
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x30(%rax), %edx
leaq 0xbf94(%rip), %rsi      # 0x11410
callq 0x4030
jmp 0x5483
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
addq $0x18, %rdx
callq 0x56b0
movq -0x20(%rbp), %rdi
callq 0x3870
movq -0x20(%rbp), %rsi
leaq 0xbf04(%rip), %rdi      # 0x113b8
callq 0x4110
movq -0x10(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
movl 0x2cf74(%rip), %eax     # 0x32440
addl $0x1, %eax
movl %eax, 0x2cf6b(%rip)     # 0x32440
movl 0x2bf5d(%rip), %eax     # 0x31438
addl $0x1, %eax
movl %eax, 0x2bf54(%rip)     # 0x31438
jmp 0x495a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopl (%rax)