// File: /workspace/github_cpp_makefile_star2_O3/yckwong[P]tinywebserver/webserver.cpp
// Function: WebServer::timer(int, sockaddr_in)
void WebServer::timer(int connfd, struct sockaddr_in client_address)
{
    users[connfd].init(connfd, client_address, m_root, m_SQLVerify, m_TRIGMode, m_close_log, m_user, m_passWord, m_databaseName);

    //初始化client_data数据
    //创建定时器，设置回调函数和超时时间，绑定用户数据，将定时器添加到链表中
    users_timer[connfd].address = client_address;
    users_timer[connfd].sockfd = connfd;
    util_timer *timer = new util_timer;
    timer->user_data = &users_timer[connfd];
    timer->cb_func = cb_func;
    time_t cur = time(NULL);
    timer->expire = cur + 3 * TIMESLOT;
    users_timer[connfd].timer = timer;
    timer_lst.add_timer(timer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, 0x78(%rsp)
movq %rcx, 0x80(%rsp)
movslq %esi, %r12
imulq $0xf68, %r12, %r14      # imm = 0xF68
addq 0x28(%rdi), %r14
movq 0x8(%rdi), %rax
movq %rax, 0x48(%rsp)
movl 0x9c(%rdi), %eax
movl %eax, 0x4(%rsp)
movl 0x1d574(%rdi), %r13d
movl 0x14(%rdi), %eax
movq %rax, 0x50(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3df0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x3df0
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x3df0
leaq 0x78(%rsp), %rdx
movq %r14, %rdi
movl %ebp, %esi
movq 0x48(%rsp), %rcx
movl 0x4(%rsp), %r8d
movl %r13d, %r9d
pushq %r15
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
pushq 0x68(%rsp)
callq 0x489c
addq $0x20, %rsp
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x84a1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x84bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x84d9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x1d588(%rbx), %rax
shlq $0x5, %r12
movups 0x78(%rsp), %xmm0
movups %xmm0, (%rax,%r12)
movq 0x1d588(%rbx), %r15
movl %ebp, 0x10(%r15,%r12)
addq %r12, %r15
movl $0x28, %edi
callq 0x3420
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movq %r15, 0x10(%rax)
leaq -0x421a(%rip), %rax     # 0x4302
movq %rax, 0x8(%r14)
xorl %edi, %edi
callq 0x33d0
addq $0xf, %rax
movq %rax, (%r14)
movq 0x1d588(%rbx), %rax
movq %r14, 0x18(%rax,%r12)
addq $0x1d578, %rbx          # imm = 0x1D578
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3f48
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x8582
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x8582
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x85a3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x85a3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x85bf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3430
movq %rbx, %rdi
callq 0x36e0
nop