// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/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_CONNTrigmode, 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;
    utils.m_timer_lst.add_timer(timer);  */

    tw_timer *timer = new tw_timer(0,0);
    timer->user_data = &users_timer[connfd];
    timer->cb_func = cb_func;
    users_timer[connfd].timer = timer;

    utils.m_time_wheel.add_timer(timer,3 * TIMESLOT);

}

// 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, 0x50(%rsp)
movl 0x1d57c(%rdi), %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rdi), %r13d
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x3cdc
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x3cdc
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 0x3cdc
subq $0x8, %rsp
leaq 0x80(%rsp), %rdx
movq %r14, %rdi
movl %ebp, %esi
movq 0x58(%rsp), %rcx
movl 0x14(%rsp), %r8d
movl %r13d, %r9d
pushq %r15
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x4534
addq $0x20, %rsp
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x7a5b
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7a77
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x7a93
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x1d580(%rbx), %rax
shlq $0x5, %r12
movups 0x78(%rsp), %xmm0
movups %xmm0, (%rax,%r12)
movq 0x1d580(%rbx), %r14
leaq (%r14,%r12), %r15
movl %ebp, 0x10(%r14,%r12)
movl $0x28, %edi
callq 0x3390
movq $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movq %r15, 0x10(%rax)
leaq -0x38b7(%rip), %rcx     # 0x4224
movq %rcx, 0x8(%rax)
movq %rax, 0x18(%r14,%r12)
addq $0x1d588, %rbx          # imm = 0x1D588
movq %rbx, %rdi
movq %rax, %rsi
movl $0xc, %edx
callq 0x3e58
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 0x7b31
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x7b31
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7b52
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x7b52
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x7b6e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x33a0
movq %rbx, %rdi
callq 0x35e0