// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: process_session
int process_session(struct task *t) {
    struct session *s = t->context;

    process_cli(s);

    if (s->cli_state != CL_STCLOSE) {
	struct timeval min1;
	s->res_cw = s->res_cr = RES_SILENT;

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

	/* restore t to its place in the task list */
	task_queue(t);

	return tv_remain2(&now, &t->expire); /* nothing more to do */
    }

    if (s->srv)
	s->srv->cur_sess--;

    s->proxy->nbconn--;
    actconn--;
    
    if ((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
	int len;
	len = sprintf(trash, "%08x:%s.closed[%04x:%04x]\n", s->uniq_id, s->proxy->id, (unsigned short)s->cli_fd, (unsigned short)-1);
	(void)!write(1, trash, len);
    }

    /* the task MUST not be in the run queue anymore */
    task_delete(t);
    session_free(s);
    task_free(t);
    return TIME_ETERNITY; /* rest in peace for eternity */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %r14
movq %r14, %rdi
callq 0x4362
cmpl $0x5, 0x4c(%r14)
jne 0x403d
movq 0xf0(%r14), %rax
testq %rax, %rax
je 0x3f67
decl 0x18(%rax)
movq 0x40(%r14), %rax
decl 0x40(%rax)
decl 0x2b4bc(%rip)           # 0x2f430
movl 0xa44e(%rip), %ecx      # 0xe3c8
testb $0x1, %cl
sete %dl
andl $0x50, %ecx
cmpl $0x10, %ecx
sete %cl
orb %dl, %cl
jne 0x3fc9
movl 0x118(%r14), %edx
movq 0x38(%rax), %rcx
movzwl 0x48(%r14), %r8d
leaq 0x2a48c(%rip), %r15     # 0x2e430
leaq 0x636a(%rip), %rsi      # 0xa315
movq %r15, %rdi
movl $0xffff, %r9d           # imm = 0xFFFF
xorl %eax, %eax
callq 0x23a0
movslq %eax, %rdx
pushq $0x1
popq %rdi
movq %r15, %rsi
callq 0x20f0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq 0x58(%r14), %rax
testq %rax, %rax
je 0x3ff5
movq 0xa379(%rip), %rcx      # 0xe360
movq %rcx, (%rax)
movq 0x58(%r14), %rax
movq %rax, 0xa36b(%rip)      # 0xe360
movq 0x60(%r14), %rax
testq %rax, %rax
je 0x4013
movq 0xa35b(%rip), %rcx      # 0xe360
movq %rcx, (%rax)
movq 0x60(%r14), %rax
movq %rax, 0xa34d(%rip)      # 0xe360
movq 0xa33e(%rip), %rax      # 0xe358
movq %rax, (%r14)
movq %r14, 0xa334(%rip)      # 0xe358
movq 0xa345(%rip), %rax      # 0xe370
movq %rax, (%rbx)
movq %rbx, 0xa33b(%rip)      # 0xe370
pushq $-0x1
popq %rax
jmp 0x40e4
andw $0x0, 0x38(%r14)
leaq 0x8(%r14), %rsi
leaq 0x18(%r14), %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x40f0
leaq 0x28(%rbx), %r15
addq $0x28, %r14
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x40f0
movq %rbx, %rdi
callq 0x3120
movq 0x28(%rbx), %r14
testq %r14, %r14
jne 0x4086
cmpq $0x0, 0x30(%rbx)
je 0x40e1
leaq 0xa373(%rip), %rdi      # 0xe400
movq %r15, %rsi
callq 0x5c7c
testl %eax, %eax
js 0x409d
xorl %eax, %eax
jmp 0x40e4
subq 0xa35c(%rip), %r14      # 0xe400
imulq $0x3e8, %r14, %rsi      # imm = 0x3E8
movq 0x30(%rbx), %rdx
movq 0xa352(%rip), %rax      # 0xe408
movq %rdx, %rcx
subq %rax, %rcx
jle 0x40cd
movl $0x3e8, %edi            # imm = 0x3E8
movq %rcx, %rax
cqto
idivq %rdi
jmp 0x40dc
subq %rdx, %rax
movq $-0x3e8, %rcx           # imm = 0xFC18
cqto
idivq %rcx
addq %rsi, %rax
jmp 0x40e4
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq