LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/netfilter.cpp
// Function: NetFilter::NetFilter(Slice&)
NetFilter::NetFilter(Slice &mask) {
    std::string ip;
    int bits = 32;
    for(int i=0;i<mask.size();i++) {
        if(mask.ptr()[i] == '/') {
            ip.append(mask.ptr(), i);
            mask.remove(i + 1);
            bits = mask.atoi();
            break;
        }
    };
    if(ip.empty()) ip = mask.as_string();
    _ip = inet_addr(ip.c_str());

    _mask = 0xffffffff;
    bits = 32 - bits;
    for(int i=0;i<bits;i++) _mask = _mask << 1;
    // swap bytes
    char *b4 = (char*)&_mask;
    char t = b4[0]; b4[0] = b4[3]; b4[3] = t;
    t = b4[1]; b4[1] = b4[2]; b4[2] = t;

    _ip = _ip & _mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%rsi), %eax
movq (%rsi), %rsi
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
xorl %r15d, %r15d
cmpq %r15, %rax
je 0xfbd0
cmpb $0x2f, (%rsi,%r15)
je 0xfb94
incq %r15
jmp 0xfb83
leaq -0x40(%rbp), %rdi
movq %r15, %rdx
callq 0xa060
incl %r15d
movl 0x8(%r14), %eax
cmpl %r15d, %eax
cmovll %eax, %r15d
movslq %r15d, %rcx
addq %rcx, (%r14)
subl %ecx, %eax
movl %eax, 0x8(%r14)
movq %r14, %rdi
callq 0xd466
pushq $0x20
popq %r12
subl %eax, %r12d
cmpq $0x0, -0x38(%rbp)
jne 0xfbf7
leaq -0x60(%rbp), %rdi
pushq $-0x1
popq %rdx
movq %r14, %rsi
callq 0xd636
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %r14
movq %r14, %rsi
callq 0xa360
movq %r14, %rdi
callq 0xa130
movq -0x40(%rbp), %rdi
callq 0xa2f0
movl %eax, (%rbx)
orl $-0x1, 0x4(%rbx)
xorl %ecx, %ecx
testl %r12d, %r12d
cmovgl %r12d, %ecx
pushq $-0x1
popq %rdx
movb $-0x1, %r9b
movb $-0x1, %dil
movb $-0x1, %r8b
movb $-0x1, %sil
subl $0x1, %ecx
jb 0xfc3f
leal (%rdx,%rdx), %esi
movl %esi, 0x4(%rbx)
movl %edx, %r8d
shrl $0x17, %r8d
movl %edx, %edi
shrl $0x7, %edi
shrl $0xf, %edx
movl %edx, %r9d
movl %esi, %edx
jmp 0xfc1e
movb %r8b, 0x4(%rbx)
movb %sil, 0x7(%rbx)
movb %r9b, 0x5(%rbx)
movb %dil, 0x6(%rbx)
movl 0x4(%rbx), %ecx
andl %eax, %ecx
movl %ecx, (%rbx)
leaq -0x40(%rbp), %rdi
callq 0xa130
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfc6e
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xa130
movq %rbx, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Server::_valid_ip(unsigned int)
bool Server::_valid_ip(u32 ip) {
    if(!net_filter.size()) return true;

    for(int i=0;i<net_filter.size();i++) {
        if(net_filter[i].match(ip)) {
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x40(%rdi), %rax
cmpq 0x38(%rdi), %rax
je 0xffe3
movl %esi, %ebx
movq %rdi, %r14
pushq $-0x1
popq %r12
xorl %r13d, %r13d
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rax
subq %rdi, %rax
sarq $0x3, %rax
incq %r12
cmpq %r12, %rax
seta %r15b
jbe 0xffe6
addq %r13, %rdi
addq $0x8, %r13
movl %ebx, %esi
callq 0xfc82
testb %al, %al
je 0xffb4
jmp 0xffe6
movb $0x1, %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::accept(Connect*)
void Loop::accept(Connect *conn) {
    conn->nloop = conn->need_loop = _nloop;
    conn->loop = this;

    int st = conn->get_socket_status();
    if(st == -1) THROW("accept: connection is closed");

    eitem event = {0};
#ifdef _KQUEUE
    EV_SET(&event, conn->fd, EVFILT_READ, (st & 1) ? EV_ADD | EV_ENABLE : EV_DISABLE, 0, 0, NULL);
    if(kevent(epollfd, &event, 1, NULL, 0, NULL) == -1) THROW("kqueue change read error");

    if(st & 2) {
        EV_SET(&event, conn->fd, EVFILT_WRITE, EV_ADD | EV_ENABLE, 0, 0, NULL);
        if(kevent(epollfd, &event, 1, NULL, 0, NULL) == -1) THROW("kqueue change write error");
    }
#else
    event.data.fd = conn->fd;
    if(st & 1) event.events |= EPOLLIN;
    if(st & 2) event.events |= EPOLLOUT;
    if(epoll_ctl(epollfd, EPOLL_CTL_ADD, conn->fd, &event) < 0) THROW("epoll_ctl EPOLL_CTL_ADD");
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl 0x4(%rdi), %eax
movl %eax, 0x3c(%rsi)
movl %eax, 0x38(%rsi)
movq %rdi, 0x30(%rsi)
movl (%rsi), %eax
cmpl $-0x1, %eax
je 0x102a0
andl $0x0, -0x18(%rbp)
andq $0x0, -0x20(%rbp)
movl 0xc(%rsi), %edx
movl %edx, -0x1c(%rbp)
testb $0x3, %al
je 0x10285
movl %eax, %ecx
andl $0x1, %ecx
orl $0x4, %ecx
testb $0x2, %al
pushq $0x1
popq %rax
cmovnel %ecx, %eax
movl %eax, -0x20(%rbp)
movl (%rdi), %edi
pushq $0x1
popq %rsi
leaq -0x20(%rbp), %rcx
callq 0xa3a0
testl %eax, %eax
js 0x102cf
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x9092(%rip), %rsi      # 0x19344
leaq 0x8f3d(%rip), %rdx      # 0x191f6
leaq 0x90a1(%rip), %r8       # 0x19361
movq %rax, %rdi
movl $0xd1, %ecx
callq 0xe15c
jmp 0x102fc
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x909d(%rip), %rsi      # 0x1937e
leaq 0x8f0e(%rip), %rdx      # 0x191f6
leaq 0x9072(%rip), %r8       # 0x19361
movq %rax, %rdi
movl $0xe0, %ecx
callq 0xe15c
leaq 0xfa15(%rip), %rsi      # 0x1fd18
leaq -0x1df4(%rip), %rdx     # 0xe516
movq %rbx, %rdi
callq 0xa450
jmp 0x10314
movq %rax, %r14
movq %rbx, %rdi
callq 0xa200
movq %r14, %rdi
callq 0xa470
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Server::start()
void Server::start() {
    if(_listen() != 0) return;
    stat_starttime = get_time_sec();

    if(threads < 1) threads = 1;
    if(threads > 62) {
        threads = 62;
        if(log & 4) std::cout << "max threads is 62\n";
    }
    loops = (Loop**)_malloc(sizeof(Loop*) * threads);

    for(int i=0; i<threads; i++) {
        Loop *loop = new Loop(this, i);
        loop->start();
        loops[i] = loop;
    }

    Service service(this);
    service.start();

    _accept();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xfd4a
testl %eax, %eax
je 0x1034c
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x16a69
movl %eax, %eax
movq %rax, 0x20180(%rbx)
movl 0x28(%rbx), %edi
testl %edi, %edi
jg 0x1036d
movl $0x1, 0x28(%rbx)
pushq $0x1
popq %rdi
jmp 0x10399
cmpl $0x3f, %edi
jb 0x10399
movl $0x3e, 0x28(%rbx)
testb $0x4, 0x20(%rbx)
jne 0x10383
pushq $0x3e
jmp 0x1036a
movq 0xfc46(%rip), %rdi      # 0x1ffd0
leaq 0x8f95(%rip), %rsi      # 0x19326
callq 0xa2e0
movl 0x28(%rbx), %edi
shll $0x3, %edi
callq 0xfb14
movq %rax, 0x20050(%rbx)
xorl %r15d, %r15d
movslq 0x28(%rbx), %rax
cmpq %rax, %r15
jge 0x103fa
movl $0xa8, %edi
callq 0xfb38
movq %rax, %r14
andq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rax), %rdi
movl $0x88, %edx
xorl %esi, %esi
callq 0xa1a0
movq %rbx, 0x18(%r14)
movl %r15d, 0x4(%r14)
movq %r14, %rdi
callq 0x10428
movq 0x20050(%rbx), %rax
movq %r14, (%rax,%r15,8)
incq %r15
jmp 0x103ab
leaq -0x28(%rbp), %rdi
andq $0x0, (%rdi)
movq %rbx, 0x8(%rdi)
callq 0x16358
movq %rbx, %rdi
callq 0xfff8
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x1349c
movq %rbx, %rdi
callq 0xa470
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Server::autolock(int)
Lock Server::autolock(int except) {
    Lock lock(this);
    for(int i=0;i<threads;i++) {
        if(i != except) lock.lock(i);
    }
    return lock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, (%rdi)
andq $0x0, 0x8(%rdi)
xorl %r12d, %r12d
cmpl 0x28(%r15), %r12d
jge 0x104b6
cmpl %r12d, %r14d
je 0x104b1
movq %rbx, %rdi
movl %r12d, %esi
callq 0x16c48
incl %r12d
jmp 0x1049b
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x131ea
movq %r14, %rdi
callq 0xa470
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Server::get_queue(ISlice, bool)
QueueLine *Server::get_queue(ISlice key, bool create) {
    u16 n = _mapper.find(key);
    if(n) return _queue_list[n-1];
    if(!create) return NULL;

    LOCK _l(global_lock);
    n = _mapper.find(key);
    if(n) return _queue_list[n-1];

    QueueLine *ql = new QueueLine(threads);
    ql->name.set(key);

    n = 0;
    for(u16 i=0;i<_queue_list.size();i++) {
        if(_queue_list[i] == NULL) {
            _queue_list[i] = ql;
            n = i + 1;
            break;
        }
    }
    if(!n) {
        _queue_list.push_back(ql);
        n = _queue_list.size();
    }
    _mapper.add(key, n);
    return ql;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r14
movq %rsi, -0x40(%rbp)
movl %edx, -0x38(%rbp)
leaq 0x200c8(%rdi), %r15
movq %r15, %rdi
callq 0xf8ac
testw %ax, %ax
je 0x10527
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movzwl %ax, %eax
addl %ecx, %eax
movq 0x20110(%r14), %rcx
movq (%rcx,%rax,8), %r14
jmp 0x1060f
testb %bl, %bl
je 0x10567
leaq 0x20058(%r14), %rbx
movq %rbx, %rdi
callq 0xd764
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0xf8ac
testw %ax, %ax
je 0x1056f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movzwl %ax, %eax
addl %ecx, %eax
movq 0x20110(%r14), %rcx
movq (%rcx,%rax,8), %r14
jmp 0x10607
xorl %r14d, %r14d
jmp 0x1060f
movl $0x88, %edi
callq 0xfb38
movq %rax, %r12
movl 0x28(%r14), %esi
movq %rax, %rdi
callq 0x131fe
movq %r12, -0x30(%rbp)
leaq -0x40(%rbp), %rsi
movq %r12, %rdi
callq 0xd3d0
leaq 0x20110(%r14), %rdi
movq 0x20110(%r14), %rcx
movq 0x20118(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movw $0x1, %ax
leal -0x1(%rax), %esi
movzwl %si, %esi
cmpq %rsi, %rdx
jbe 0x105d7
cmpq $0x0, (%rcx,%rsi,8)
je 0x105ce
incl %eax
jmp 0x105b8
movq %r12, (%rcx,%rsi,8)
testw %ax, %ax
jne 0x105f1
leaq -0x30(%rbp), %rsi
callq 0xd72a
movl 0x20118(%r14), %eax
subl 0x20110(%r14), %eax
shrl $0x3, %eax
movq -0x40(%rbp), %rsi
movl -0x38(%rbp), %edx
movzwl %ax, %ecx
movq %r15, %rdi
callq 0xf6f8
movq -0x30(%rbp), %r14
movq %rbx, %rdi
callq 0xa220
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x88, %esi
movq %r12, %rdi
callq 0xa300
jmp 0x10638
jmp 0x10635
movq %rax, %r14
movq %rbx, %rdi
callq 0xa220
movq %r14, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_loop_safe()
void Loop::_loop_safe() {
    try {
        _loop();
    } catch (const Exception &e) {
        if(server->log & 1) e.print("Exception in loop");
    } catch (const std::exception &e) {
        if(server->log & 1) std::cout << ltime() << "Fatal exception: " << e.what() << std::endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x10a7e
movq %rax, %rbx
cmpl $0x2, %edx
jne 0x108be
movq %rbx, %rdi
callq 0xa110
movq 0x18(%r14), %rcx
testb $0x1, 0x20(%rcx)
je 0x1091a
leaq 0x8af4(%rip), %rsi      # 0x193a8
movq %rax, %rdi
callq 0xe38e
jmp 0x1091a
cmpl $0x1, %edx
jne 0x10935
movq %rbx, %rdi
callq 0xa110
movq %rax, %rbx
movq 0x18(%r14), %rax
testb $0x1, 0x20(%rax)
je 0x1091a
callq 0x16a89
movq 0xf6ec(%rip), %rdi      # 0x1ffd0
movq %rax, %rsi
callq 0xa2e0
leaq 0x887d(%rip), %rsi      # 0x19170
movq %rax, %rdi
callq 0xa2e0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0xa2e0
movq %rax, %rdi
callq 0xa160
popq %rbx
popq %r14
popq %rbp
jmp 0xa430
movq %rax, %rbx
callq 0xa430
jmp 0x10935
movq %rax, %rbx
callq 0xa430
movq %rbx, %rdi
callq 0xa470
movq %rax, %rdi
callq 0xd334
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::wake()
void Loop::wake() {
#ifndef _KQUEUE  // TODO: fix for kqueue
    if(!server->fake_fd) {
        LOCK _l(server->global_lock);
        if(!server->fake_fd) server->fake_fd = socket(AF_INET, SOCK_STREAM, 0);
        if(server->fake_fd < 0) THROW("Error opening socket");
    }

    eitem event = {0};
    event.data.fd = server->fake_fd;
    if(epoll_ctl(epollfd, EPOLL_CTL_ADD, server->fake_fd, &event) < 0) THROW("epoll_ctl EPOLL_CTL_ADD");
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rbx
movl 0x30(%rbx), %edx
testl %edx, %edx
jne 0x109a2
addq $0x20058, %rbx          # imm = 0x20058
movq %rbx, %rdi
callq 0xd764
movq 0x18(%r14), %rax
movl 0x30(%rax), %eax
testl %eax, %eax
jne 0x1098f
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0xa0a0
movq 0x18(%r14), %rcx
movl %eax, 0x30(%rcx)
testl %eax, %eax
js 0x10a0e
movq %rbx, %rdi
callq 0xa220
movq 0x18(%r14), %rax
movl 0x30(%rax), %edx
leaq -0x28(%rbp), %rcx
andq $0x0, (%rcx)
andl $0x0, 0x8(%rcx)
movl %edx, 0x4(%rcx)
movl (%r14), %edi
pushq $0x1
popq %rsi
callq 0xa3a0
testl %eax, %eax
js 0x109cb
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x89a1(%rip), %rsi      # 0x1937e
leaq 0x8812(%rip), %rdx      # 0x191f6
leaq 0x89ab(%rip), %r8       # 0x19396
movq %rax, %rdi
movl $0xef, %ecx
callq 0xe15c
leaq 0xf319(%rip), %rsi      # 0x1fd18
leaq -0x24f0(%rip), %rdx     # 0xe516
movq %rbx, %rdi
callq 0xa450
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %r15
leaq 0x8817(%rip), %rsi      # 0x19237
leaq 0x87cf(%rip), %rdx      # 0x191f6
leaq 0x8968(%rip), %r8       # 0x19396
movq %rax, %rdi
movl $0xea, %ecx
callq 0xe15c
leaq 0xf2d6(%rip), %rsi      # 0x1fd18
leaq -0x2533(%rip), %rdx     # 0xe516
movq %r15, %rdi
callq 0xa450
movq %rax, %r14
jmp 0x10a61
movq %rax, %r14
movq %r15, %rdi
callq 0xa200
movq %rbx, %rdi
callq 0xa220
jmp 0x10a76
movq %rax, %r14
movq %rbx, %rdi
callq 0xa200
movq %r14, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::set_poll_mode(int, int)
void Loop::set_poll_mode(int fd, int status) {
    if(status == -1) {
        if(epoll_ctl(epollfd, EPOLL_CTL_DEL, fd, NULL) < 0) THROW("epoll_ctl EPOLL_CTL_DEL");
        return;
    }

    eitem event = {0};
    event.data.fd = fd;
    if(status & 1) event.events |= EPOLLIN;
    if(status & 2) event.events |= EPOLLOUT;

    if(epoll_ctl(epollfd, EPOLL_CTL_MOD, fd, &event) < 0) THROW("epoll_ctl EPOLL_CTL_MOD");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %eax
movl %esi, %edx
cmpl $-0x1, %eax
je 0x10e6a
andq $0x0, -0x20(%rbp)
andl $0x0, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
testb $0x3, %al
je 0x10e29
movl %eax, %ecx
andl $0x1, %ecx
orl $0x4, %ecx
testb $0x2, %al
pushq $0x1
popq %rax
cmovnel %ecx, %eax
movl %eax, -0x20(%rbp)
movl (%rdi), %edi
pushq $0x3
popq %rsi
leaq -0x20(%rbp), %rcx
callq 0xa3a0
testl %eax, %eax
jns 0x10e7a
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x86a8(%rip), %rsi      # 0x194f5
leaq 0x83a2(%rip), %rdx      # 0x191f6
leaq 0x8677(%rip), %r8       # 0x194d2
movq %rax, %rdi
movl $0x221, %ecx            # imm = 0x221
callq 0xe15c
jmp 0x10eb0
movl (%rdi), %edi
pushq $0x2
popq %rsi
xorl %ecx, %ecx
callq 0xa3a0
testl %eax, %eax
js 0x10e83
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x8625(%rip), %rsi      # 0x194ba
leaq 0x835a(%rip), %rdx      # 0x191f6
leaq 0x862f(%rip), %r8       # 0x194d2
movq %rax, %rdi
movl $0x218, %ecx            # imm = 0x218
callq 0xe15c
leaq 0xee61(%rip), %rsi      # 0x1fd18
leaq -0x29a8(%rip), %rdx     # 0xe516
movq %rbx, %rdi
callq 0xa450
jmp 0x10ec8
movq %rax, %r14
movq %rbx, %rdi
callq 0xa200
movq %r14, %rdi
callq 0xa470
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_close(int)
void Loop::_close(int fd) {
    Connect* conn = server->connections[fd];
    if(server->log & 16) std::cout << ltime() << "disconnect socket " << fd << " " << (void*)conn << std::endl;
    if(conn == NULL) THROW("_close: connection is null");
    conn->close();
    conn->_switch_mode();
    this->on_disconnect(conn);
    conn->unlink();
    server->connections[fd] = NULL;
    close(fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x18(%rdi), %rax
movslq %esi, %r12
movq 0x50(%rax,%r12,8), %r15
testb $0x10, 0x20(%rax)
je 0x10f4d
callq 0x16a89
movq 0xf0c6(%rip), %rdi      # 0x1ffd0
movq %rax, %rsi
callq 0xa2e0
leaq 0x85f4(%rip), %rsi      # 0x1950d
movq %rax, %rdi
callq 0xa2e0
movq %rax, %rdi
movl %ebx, %esi
callq 0xa460
leaq 0x777a(%rip), %rsi      # 0x186ac
movq %rax, %rdi
callq 0xa2e0
movq %rax, %rdi
movq %r15, %rsi
callq 0xa230
movq %rax, %rdi
callq 0xa160
testq %r15, %r15
je 0x10f8a
orl $-0x1, (%r15)
movq %r15, %rdi
callq 0x134ac
movq %r14, %rdi
movq %r15, %rsi
callq 0x11ee8
movq %r15, %rdi
callq 0xa84c
movq 0x18(%r14), %rax
andq $0x0, 0x50(%rax,%r12,8)
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa4c0
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x8584(%rip), %rsi      # 0x19520
leaq 0x8253(%rip), %rdx      # 0x191f6
leaq 0x8591(%rip), %r8       # 0x1953b
movq %rax, %rdi
movl $0x229, %ecx            # imm = 0x229
callq 0xe15c
leaq 0xed5a(%rip), %rsi      # 0x1fd18
leaq -0x2aaf(%rip), %rdx     # 0xe516
movq %rbx, %rdi
callq 0xa450
movq %rax, %r14
movq %rbx, %rdi
callq 0xa200
movq %r14, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_perform_to_send()
void Loop::_perform_to_send() {
    if(!_queue_to_send.size()) return;
    for(auto const& conn : _queue_to_send) {
        conn->_switch_mode();
    }
    _queue_to_send.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x60(%rdi), %r14
movq 0x68(%rdi), %r15
cmpq %r14, %r15
je 0x11237
movq %rdi, %rbx
cmpq %r15, %r14
je 0x11229
movq (%r14), %rdi
callq 0x134ac
addq $0x8, %r14
jmp 0x11216
movq 0x60(%rbx), %rax
cmpq %rax, 0x68(%rbx)
je 0x11237
movq %rax, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_migrate_send()
void Loop::_migrate_send() {
    Lock lock = server->autolock(_nloop);

    for (int i = 0; i <= server->max_fd; i++) {
        Connect* conn = server->connections[i];
        if(!conn) continue;
        if(conn->nloop != _nloop) continue;
        if(!conn->go_loop || conn->need_loop == _nloop) continue;
        conn->go_loop = false;
        if(conn->is_closed()) continue;
        set_poll_mode(conn->fd, -1);
        if(server->log & 64) std::cout << "migrate fd " << conn->fd << ", " << _nloop << " -> " << conn->need_loop << std::endl;
        auto loop = server->loops[conn->need_loop];
        loop->accept(conn);

        if(conn->status == Status::migration) {
            loop->accept_request = true;
            loop->wake();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
movl 0x4(%rdi), %edx
leaq -0x38(%rbp), %rdi
callq 0x1047c
xorl %r15d, %r15d
pushq $-0x1
popq %r14
movq 0x18(%rbx), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %r15
jg 0x11379
movq 0x50(%rax,%r15,8), %r12
testq %r12, %r12
je 0x11371
movl 0x38(%r12), %eax
cmpl 0x4(%rbx), %eax
jne 0x11371
cmpb $0x1, 0x40(%r12)
jne 0x11371
cmpl %eax, 0x3c(%r12)
je 0x11371
movb $0x0, 0x40(%r12)
cmpl $-0x1, (%r12)
je 0x11371
movl 0xc(%r12), %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x10df2
movq 0x18(%rbx), %rax
testb $0x40, 0x20(%rax)
je 0x1133e
movq 0xeced(%rip), %rdi      # 0x1ffd0
leaq 0x81bc(%rip), %rsi      # 0x194a6
callq 0xa2e0
movl 0xc(%r12), %esi
movq %rax, %rdi
callq 0xa460
movq %rax, %rdi
leaq 0x81ac(%rip), %rsi      # 0x194b2
callq 0xa2e0
movl 0x4(%rbx), %esi
movq %rax, %rdi
callq 0xa460
movq %rax, %rdi
leaq 0x8195(%rip), %rsi      # 0x194b5
callq 0xa2e0
movl 0x3c(%r12), %esi
movq %rax, %rdi
callq 0xa460
movq %rax, %rdi
callq 0xa160
movq 0x18(%rbx), %rax
movq 0x20050(%rax), %rax
movslq 0x3c(%r12), %rcx
movq (%rax,%rcx,8), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x10240
cmpl $0x3, 0xcc(%r12)
jne 0x11371
movb $0x1, 0x10(%r13)
movq %r13, %rdi
callq 0x10946
incq %r15
jmp 0x1126d
leaq -0x38(%rbp), %rdi
callq 0x131ea
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11393
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x131ea
movq %rbx, %rdi
callq 0xa470
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_delete_connections()
void Loop::_delete_connections() {
    if(!dead_connections.size()) return;
    if(!del_lock.try_lock()) return;

    for(Connect *conn : dead_connections) {
        if(conn->get_link() == 0) {
            if(server->log & 16) std::cout << ltime() << "delete connection " << (void*)conn << std::endl;
            delete conn;
        }
    }
    dead_connections.clear();
    del_lock.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rax
cmpq 0x20(%rdi), %rax
je 0x11449
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
movq %r14, %rdi
callq 0x134d4
testb %al, %al
je 0x11449
movq 0x20(%rbx), %r15
movq 0x28(%rbx), %r12
cmpq %r12, %r15
je 0x11458
movq (%r15), %r13
cmpl $0x0, 0x8(%r13)
jne 0x11443
movq 0x18(%rbx), %rax
testb $0x10, 0x20(%rax)
je 0x1142e
callq 0x16a89
movq 0xebcc(%rip), %rdi      # 0x1ffd0
movq %rax, %rsi
callq 0xa2e0
movq %rax, %rdi
leaq 0x807d(%rip), %rsi      # 0x19493
callq 0xa2e0
movq %rax, %rdi
movq %r13, %rsi
callq 0xa230
movq %rax, %rdi
callq 0xa160
movq %r13, %rdi
callq 0x134e4
movl $0x1e8, %esi            # imm = 0x1E8
movq %r13, %rdi
callq 0xa300
addq $0x8, %r15
jmp 0x113df
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rax
cmpq %rax, 0x28(%rbx)
je 0x11466
movq %rax, 0x28(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa220
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::_migrate_recv()
void Loop::_migrate_recv() {
    if(!accept_request) return;
    Lock lock = server->autolock(_nloop);
    accept_request = false;
    for (int i = 0; i <= server->max_fd; i++) {
        Connect* conn = server->connections[i];
        if(!conn || conn->nloop != _nloop) continue;
        if(conn->status != Status::migration) continue;
        if(conn->is_closed()) continue;

        client_request(conn->name, conn);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpb $0x1, 0x10(%rdi)
jne 0x114f7
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
movl 0x4(%rdi), %edx
leaq -0x20(%rbp), %rdi
callq 0x1047c
movb $0x0, 0x10(%rbx)
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %r14
jg 0x114ee
movq 0x50(%rax,%r14,8), %rcx
testq %rcx, %rcx
je 0x114e9
movl 0x38(%rcx), %eax
cmpl 0x4(%rbx), %eax
jne 0x114e9
cmpl $0x3, 0xcc(%rcx)
jne 0x114e9
cmpl $-0x1, (%rcx)
je 0x114e9
movq 0xb8(%rcx), %rsi
movl 0xc0(%rcx), %edx
movq %rbx, %rdi
callq 0x11514
incq %r14
jmp 0x114a7
leaq -0x20(%rbp), %rdi
callq 0x131ea
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x131ea
movq %rbx, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::add_worker(ISlice, Connect*)
void Loop::add_worker(ISlice name, Connect *worker) {
    char *ptr = name.ptr();
    int start = 0;
    int i = 0;
    Slice n;
    for(;i<name.size();i++) {
        if(ptr[i] == ',' || ptr[i] == ' ') {
            n.set(&ptr[start], i - start);
            start = i + 1;
            if(_add_worker(n, worker) == 1) {
                // worker is taken
                return;
            }
        }
    }
    if(start < name.size()) {
        n.set(&ptr[start], i - start);
        _add_worker(n, worker);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x38(%rbp)
movl %edx, %r13d
movq %rsi, %r14
xorl %ebx, %ebx
testl %edx, %edx
movl $0x0, %r12d
cmovgl %edx, %r12d
movq %rdi, -0x30(%rbp)
movq %r12, %r15
negq %r15
xorl %ecx, %ecx
movl %ebx, %edx
subl %ecx, %edx
incq %rbx
leaq (%r15,%rbx), %rax
movslq %ecx, %rsi
cmpq $0x1, %rax
je 0x1220f
movzbl -0x1(%r14,%rbx), %eax
cmpl $0x20, %eax
je 0x121f7
cmpl $0x2c, %eax
je 0x121f7
incl %edx
jmp 0x121d3
addq %r14, %rsi
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rcx
callq 0x1224a
movl %ebx, %ecx
testl %eax, %eax
je 0x121cf
jmp 0x1223b
cmpl %r13d, %ecx
jge 0x1223b
addq %rsi, %r14
subl %ecx, %r12d
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl %r12d, %edx
movq -0x38(%rbp), %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1224a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::worker_result(ISlice, Connect*)
int Loop::worker_result(ISlice id, Connect *worker) {
    auto it = server->wait_response.find(id.as_string());
    if(it == server->wait_response.end()) return -1;
    Connect *client = it->second;
    server->wait_lock.lock();
    server->wait_response.erase(it);
    server->wait_lock.unlock();

    client->unlink();
    if(client->is_closed()) return -2;
    if(worker) client->send.status("200 OK")->header("Id", id)->done(worker->body);
    else client->send.status("503 Service Unavailable")->header("Id", id)->done(-1);
    client->status = Status::net;

    if(worker && worker->nloop != worker->need_loop) migrate(worker, client);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdi, %r14
leaq -0x38(%rbp), %rax
movq %rsi, (%rax)
movl %edx, 0x8(%rax)
movl $0x20128, %r15d         # imm = 0x20128
addq 0x18(%rdi), %r15
leaq -0x58(%rbp), %r13
pushq $-0x1
popq %r12
movq %r13, %rdi
movq %rax, %rsi
movl %r12d, %edx
callq 0xd636
movq %r15, %rdi
movq %r13, %rsi
callq 0x14a7e
movq %rax, %r13
leaq -0x58(%rbp), %rdi
callq 0xa130
movq 0x18(%r14), %rdi
leaq 0x20130(%rdi), %rax
cmpq %rax, %r13
je 0x12dd4
movq 0x40(%r13), %r15
movl $0x20158, %r12d         # imm = 0x20158
addq %r12, %rdi
callq 0xd764
movl $0x20128, %edi          # imm = 0x20128
addq 0x18(%r14), %rdi
movq %r13, %rsi
callq 0x162f4
addq 0x18(%r14), %r12
movq %r12, %rdi
callq 0xa220
movq %r15, %rdi
callq 0xa84c
cmpl $-0x1, (%r15)
je 0x12d99
leaq 0x18(%r15), %rdi
testq %rbx, %rbx
je 0x12d9f
leaq 0x54ea(%rip), %rsi      # 0x18239
callq 0xb93e
leaq 0x684a(%rip), %rsi      # 0x195a5
leaq -0x38(%rbp), %rdx
movq %rax, %rdi
callq 0xcdbe
leaq 0xd0(%rbx), %rsi
movq %rax, %rdi
callq 0xbe84
andl $0x0, 0xcc(%r15)
movl 0x38(%rbx), %eax
xorl %r12d, %r12d
cmpl 0x3c(%rbx), %eax
je 0x12dd4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x12dfa
jmp 0x12dd4
pushq $-0x2
popq %r12
jmp 0x12dd4
leaq 0x685d(%rip), %rsi      # 0x19603
callq 0xb93e
leaq 0x67f3(%rip), %rsi      # 0x195a5
leaq -0x38(%rbp), %rdx
movq %rax, %rdi
callq 0xcdbe
pushq $-0x1
popq %rsi
movq %rax, %rdi
callq 0xb9b2
andl $0x0, 0xcc(%r15)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0xa130
movq %rbx, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::migrate(Connect*, Connect*)
void Loop::migrate(Connect *w, Connect *c) {
    if(_nloop == w->need_loop && server->log & 1) std::cout << "migrate warning: connection is on target loop\n";

    w->go_loop = true;
    c->go_loop = true;
    c->need_loop = w->need_loop;
    if(server->log & 64) std::cout << "migrate: loop " << _nloop << " -> " << w->need_loop << ", fd " << w->fd << ", " << c->fd << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x4(%rdi), %ecx
movl 0x3c(%rsi), %eax
cmpl %eax, %ecx
jne 0x12e3a
movq 0x18(%r15), %rax
testb $0x1, 0x20(%rax)
movl %ecx, %eax
je 0x12e3a
movq 0xd1a6(%rip), %rdi      # 0x1ffd0
leaq 0x6880(%rip), %rsi      # 0x196b1
callq 0xa2e0
movl 0x3c(%r14), %eax
movb $0x1, %cl
movb %cl, 0x40(%r14)
movb %cl, 0x40(%rbx)
movl %eax, 0x3c(%rbx)
movq 0x18(%r15), %rax
testb $0x40, 0x20(%rax)
jne 0x12e5b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xd16e(%rip), %rdi      # 0x1ffd0
leaq 0x6877(%rip), %rsi      # 0x196e0
callq 0xa2e0
movl 0x4(%r15), %esi
movq %rax, %rdi
callq 0xa460
leaq 0x6634(%rip), %rsi      # 0x194b5
movq %rax, %rdi
callq 0xa2e0
movl 0x3c(%r14), %esi
movq %rax, %rdi
callq 0xa460
leaq 0x6853(%rip), %rsi      # 0x196ef
movq %rax, %rdi
callq 0xa2e0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0xa460
leaq 0x65fb(%rip), %rsi      # 0x194b2
movq %rax, %rdi
callq 0xa2e0
movl 0xc(%rbx), %esi
movq %rax, %rdi
callq 0xa460
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa160
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/server.cpp
// Function: Loop::worker_result_noid(Connect*)
int Loop::worker_result_noid(Connect *worker) {
    stat_result++;
    auto client = worker->client;
    if(!client) THROW("No connected client for noid");

    if(!worker->worker_mode) {
        worker->noid = false;
        worker->fail_on_disconnect = false;
    }
    worker->client = NULL;
    client->unlink();

    if(client->is_closed()) return -2;
    client->status = Status::net;
    client->send.status("200 OK")->done(worker->body);

    if(worker->nloop != worker->need_loop) migrate(worker, client);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
incq 0x88(%rdi)
movq 0x120(%rsi), %r14
testq %r14, %r14
je 0x12f80
movq %rdi, %rbx
movq %rsi, %r15
cmpb $0x0, 0xf3(%rsi)
jne 0x12f16
andw $0x0, 0xf0(%r15)
andq $0x0, 0x120(%r15)
movq %r14, %rdi
callq 0xa84c
cmpl $-0x1, (%r14)
je 0x12f70
andl $0x0, 0xcc(%r14)
leaq 0x18(%r14), %rdi
leaq 0x52fa(%rip), %rsi      # 0x18239
callq 0xb93e
leaq 0xd0(%r15), %rsi
movq %rax, %rdi
callq 0xbe84
movl 0x38(%r15), %eax
xorl %r12d, %r12d
cmpl 0x3c(%r15), %eax
je 0x12f74
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12dfa
jmp 0x12f74
pushq $-0x2
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0xa170
movq %rax, %rbx
leaq 0x6689(%rip), %rsi      # 0x1961b
leaq 0x625d(%rip), %rdx      # 0x191f6
leaq 0x6698(%rip), %r8       # 0x19638
movq %rax, %rdi
movl $0x3ac, %ecx            # imm = 0x3AC
callq 0xe15c
leaq 0xcd64(%rip), %rsi      # 0x1fd18
leaq -0x4aa5(%rip), %rdx     # 0xe516
movq %rbx, %rdi
callq 0xa450
movq %rax, %r14
movq %rbx, %rdi
callq 0xa200
movq %r14, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/connect.h
// Function: Connect::Connect(Server*, int)
Connect(Server *server, int fd) {
        this->server = server;
        this->fd = fd;
        loop = server->loops[0];
        send.set_connect(this);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
movl %edx, %r12d
andl $0x0, 0x160(%rdi)
movq %rsi, %r13
andq $0x0, 0x138(%rdi)
leaq 0x88(%rdi), %r14
andl $0x0, 0x140(%rdi)
xorps %xmm0, %xmm0
andl $0x0, 0x158(%rdi)
movups %xmm0, 0x148(%rdi)
andq $0x0, 0x168(%rdi)
leaq 0xb8(%rdi), %r15
andl $0x0, 0x170(%rdi)
addq $0x190, %rdi            # imm = 0x190
andq $0x0, 0x28(%rbx)
movups %xmm0, 0x18(%rbx)
andq $0x0, 0x38(%rbx)
movb $0x0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x6c(%rbx)
movups %xmm0, 0xa4(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xc8(%rbx)
andq $0x0, 0xe8(%rbx)
movups %xmm0, 0xb8(%rbx)
movups %xmm0, 0x122(%rbx)
movups %xmm0, 0x112(%rbx)
movups %xmm0, 0x102(%rbx)
movups %xmm0, 0xf2(%rbx)
andw $0x0, 0x132(%rbx)
movups %xmm0, 0x178(%rbx)
andq $0x0, 0x188(%rbx)
callq 0x13898
andq $0x0, 0x1e0(%rbx)
movq %r13, 0x48(%rbx)
movl %r12d, 0xc(%rbx)
movq 0x20050(%r13), %rax
movq (%rax), %rax
movq %rax, 0x30(%rbx)
movq %rbx, 0x18(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x48(%rbp)
leaq 0x180(%rbx), %rdi
leaq 0x110(%rbx), %r13
leaq 0x100(%rbx), %r12
leaq 0xe0(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0xd0(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq 0x98(%rbx), %rax
movq %rax, -0x40(%rbp)
addq $0x20, %rbx
callq 0xd6dc
movq %r13, %rdi
callq 0xd6dc
movq %r12, %rdi
callq 0xd6dc
movq -0x30(%rbp), %rdi
callq 0xd6dc
movq -0x38(%rbp), %rdi
callq 0xd6dc
movq %r15, %rdi
callq 0xd6dc
movq -0x40(%rbp), %rdi
callq 0xd6dc
movq %r14, %rdi
callq 0xd6dc
movq %rbx, %rdi
callq 0xd6dc
movq -0x48(%rbp), %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/buffer.h
// Function: Buffer::move(Buffer*)
void move(Buffer *buf) {
        std::swap(_cap, buf->_cap);
        std::swap(_ptr, buf->_ptr);
        _size = buf->_size;
        buf->_size = 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xc(%rdi), %eax
movl 0xc(%rsi), %ecx
movl %ecx, 0xc(%rdi)
movl %eax, 0xc(%rsi)
movq (%rdi), %rax
movq (%rsi), %rcx
movq %rcx, (%rdi)
movq %rax, (%rsi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
andl $0x0, 0x8(%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/service.cpp
// Function: Service::_free_memory()
void Service::_free_memory() {
    if(!server->_free_list.size()) return;

    server->_free_lock.lock();
    std::vector<char*> v(server->_free_list);
    server->_free_list.clear();
    server->_free_lock.unlock();
    usleep(10'000);
    for(auto const &ptr : v) _free(ptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x200b8(%rdi), %rax
cmpq 0x200b0(%rdi), %rax
je 0x1665f
addq $0x20088, %rdi          # imm = 0x20088
callq 0xd764
movl $0x200b0, %esi          # imm = 0x200B0
addq 0x8(%rbx), %rsi
leaq -0x28(%rbp), %rdi
callq 0x16962
movq 0x8(%rbx), %rdi
movq 0x200b0(%rdi), %rax
cmpq %rax, 0x200b8(%rdi)
je 0x16625
movq %rax, 0x200b8(%rdi)
addq $0x20088, %rdi          # imm = 0x20088
callq 0xa220
movl $0x2710, %edi           # imm = 0x2710
callq 0xa3b0
movq -0x28(%rbp), %rbx
movq -0x20(%rbp), %r14
cmpq %r14, %rbx
je 0x16656
movq (%rbx), %rdi
callq 0xfb27
addq $0x8, %rbx
jmp 0x16643
leaq -0x28(%rbp), %rdi
callq 0xf352
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1666a
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0xf352
movq %rbx, %rdi
callq 0xa470
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/utils.cpp
// Function: ltime()
const char *ltime() {
    // thread unsafe
    std::time_t t = std::time(0);
    std::tm* now = std::localtime(&t);

    lbuf.clear();
    lbuf.add_number(now->tm_year + 1900);
    lbuf.add("-", 1);
    int mon = now->tm_mon + 1;
    if(mon < 10) lbuf.add("0", 1);
    lbuf.add_number(mon);
    lbuf.add("-", 1);
    if(now->tm_mday < 10) lbuf.add("0", 1);
    lbuf.add_number(now->tm_mday);
    lbuf.add(" ", 1);
    if(now->tm_hour < 10) lbuf.add("0", 1);
    lbuf.add_number(now->tm_hour);
    lbuf.add(":", 1);
    if(now->tm_min < 10) lbuf.add("0", 1);
    lbuf.add_number(now->tm_min);
    lbuf.add(":", 1);
    if(now->tm_sec < 10) lbuf.add("0", 1);
    lbuf.add_number(now->tm_sec);
    lbuf.add(" ", 1);

    return lbuf.ptr();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0xa2b0
leaq -0x20(%rbp), %rdi
movq %rax, (%rdi)
callq 0xa210
andl $0x0, 0x983b(%rip)      # 0x202e8
movq %rax, %rbx
leaq 0x9829(%rip), %r14      # 0x202e0
movslq 0x14(%rax), %rsi
addq $0x76c, %rsi            # imm = 0x76C
movq %r14, %rdi
callq 0xd54a
leaq 0x2cc7(%rip), %rsi      # 0x19798
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xd24c
movslq 0x10(%rbx), %rax
leaq 0x1(%rax), %r14
cmpq $0x8, %rax
jg 0x16b00
leaq 0x97ef(%rip), %rdi      # 0x202e0
leaq 0x1598(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
callq 0xd24c
leaq 0x97d9(%rip), %r15      # 0x202e0
movq %r15, %rdi
movq %r14, %rsi
callq 0xd54a
leaq 0x2c7f(%rip), %rsi      # 0x19798
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0xd24c
movl 0xc(%rbx), %eax
cmpl $0x9, %eax
jg 0x16b45
leaq 0x97ad(%rip), %rdi      # 0x202e0
leaq 0x1556(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
callq 0xd24c
movl 0xc(%rbx), %eax
movslq %eax, %rsi
leaq 0x9791(%rip), %r14      # 0x202e0
movq %r14, %rdi
callq 0xd54a
leaq 0x1b4e(%rip), %rsi      # 0x186ac
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xd24c
movl 0x8(%rbx), %eax
cmpl $0x9, %eax
jg 0x16b8a
leaq 0x9768(%rip), %rdi      # 0x202e0
leaq 0x1511(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
callq 0xd24c
movl 0x8(%rbx), %eax
movslq %eax, %rsi
leaq 0x974c(%rip), %r14      # 0x202e0
movq %r14, %rdi
callq 0xd54a
leaq 0x1850(%rip), %rsi      # 0x183f3
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xd24c
movl 0x4(%rbx), %eax
cmpl $0x9, %eax
jg 0x16bcf
leaq 0x9723(%rip), %rdi      # 0x202e0
leaq 0x14cc(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
callq 0xd24c
movl 0x4(%rbx), %eax
movslq %eax, %rsi
leaq 0x9707(%rip), %r14      # 0x202e0
movq %r14, %rdi
callq 0xd54a
leaq 0x180b(%rip), %rsi      # 0x183f3
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xd24c
movl (%rbx), %eax
cmpl $0x9, %eax
jg 0x16c12
leaq 0x96df(%rip), %rdi      # 0x202e0
leaq 0x1488(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
callq 0xd24c
movl (%rbx), %eax
movslq %eax, %rsi
leaq 0x96c4(%rip), %rbx      # 0x202e0
movq %rbx, %rdi
callq 0xd54a
leaq 0x1a81(%rip), %rsi      # 0x186ac
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xd24c
movq 0x96a3(%rip), %rax      # 0x202e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/utils.cpp
// Function: Lock::lock(int)
void Lock::lock(int n) {
    u64 v = 1 << n;
    if(mask & v) return;
    mask |= v;
    server->loops[n]->del_lock.lock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq 0x8(%rdi), %rdx
testq %rax, %rdx
je 0x16c62
popq %rbp
retq
orq %rax, %rdx
movq %rdx, 0x8(%rdi)
movq (%rdi), %rax
movq 0x20050(%rax), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
addq $0x38, %rdi
popq %rbp
jmp 0xd764
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/utils.cpp
// Function: Lock::unlock()
void Lock::unlock() {
    u64 v = 1;
    for(int i=0;i<server->threads;i++) {
        if(v & mask) server->loops[i]->del_lock.unlock();
        v <<= 1;
    }
    mask = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r14
xorl %r15d, %r15d
movq (%rbx), %rax
movslq 0x28(%rax), %rcx
cmpq %rcx, %r15
jge 0x16cc6
testq %r14, 0x8(%rbx)
je 0x16cbe
movq 0x20050(%rax), %rax
movq (%rax,%r15,8), %rdi
addq $0x38, %rdi
callq 0xa220
addq %r14, %r14
incq %r15
jmp 0x16c98
andq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/utils.cpp
// Function: GC::release()
void GC::release() {
    for(auto const & i : _list) {
        switch(i.type) {
        case 1:
            {
                auto *it = (::Message*)i.ptr;
                delete it;
                break;
            }
        case 2:
            {
                auto *it = (::DirectMessage*)i.ptr;
                if(it->unlink() == 0) {
                    delete it;
                }
                break;
            }
        }
    }
    _list.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r13
movq 0x8(%rdi), %r14
pushq $0x38
popq %r15
cmpq %r14, %r13
je 0x16db3
movl 0x8(%r13), %eax
cmpl $0x2, %eax
je 0x16d8c
cmpl $0x1, %eax
jne 0x16dad
movq (%r13), %r12
testq %r12, %r12
je 0x16d84
movq %r12, %rdi
callq 0x12fd6
movq %r12, %rdi
movq %r15, %rsi
jmp 0x16da8
movq (%r13), %r12
lock
decl 0x3c(%r12)
jne 0x16dad
leaq 0x28(%r12), %rdi
callq 0xd6dc
movq %r12, %rdi
pushq $0x40
popq %rsi
callq 0xa300
addq $0x10, %r13
jmp 0x16d60
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x16dc0
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/buffer.h
// Function: Buffer::add_hex(unsigned long)
void add_hex(u64 n) {
        if(!n) {
            add("0", 1);
            return;
        }
        const char hex[] = "0123456789abcdef";
        char r[16];
        int i = 15;
        while(n) {
            r[i--] = hex[n & 0xf];
            n >>= 4;
        }
        add(&r[i + 1], 15-i);
    }

// Assembly:
testq %rsi, %rsi
je 0x16e11
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edx, %edx
leaq 0x29ba(%rip), %rax      # 0x197a0
testq %rsi, %rsi
je 0x16e00
movl %esi, %ecx
andl $0xf, %ecx
movb (%rcx,%rax), %cl
movb %cl, -0x1(%rbp,%rdx)
shrq $0x4, %rsi
decq %rdx
jmp 0x16de6
leaq (%rdx,%rbp), %rsi
negl %edx
callq 0xd24c
addq $0x10, %rsp
popq %rbp
retq
leaq 0x1278(%rip), %rsi      # 0x18090
pushq $0x1
popq %rdx
jmp 0xd24c
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/workerlist.cpp
// Function: WorkerItem::pop()
void WorkerItem::pop() {
    list->lock.lock();
    if(this == list->head) {
        list->head = this->next;
        if(list->head) list->head->prev = NULL;
    } else {
        if(this->prev) this->prev->next = this->next;
        if(this->next) this->next->prev = this->prev;
    }
    list->lock.unlock();
    delete this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xd764
movq (%rbx), %rdi
cmpq %rbx, 0x28(%rdi)
je 0x1703c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rax
testq %rcx, %rcx
je 0x17035
movq %rax, 0x10(%rcx)
testq %rax, %rax
jne 0x1704b
jmp 0x1704f
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0x1704f
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
callq 0xa220
movq %rbx, %rdi
callq 0x16fdc
pushq $0x20
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa300
nop
// File: /workspace/github_cpp_makefile_star2_O2/lega911[P]ijson/src/workerlist.cpp
// Function: WorkerList::push(Connect*)
WorkerItem *WorkerList::push(Connect *conn) {
    WorkerItem *n = new WorkerItem(this, conn);
    lock.lock();
    if(head) {
        n->next = head;
        head->prev = n;
        head = n;
    } else head = n;
    lock.unlock();
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0xfb38
movq %rax, %r14
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %r15, 0x18(%rax)
incl 0x8(%r15)
movq %rbx, %rdi
callq 0xd764
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x170b4
movq %rax, 0x10(%r14)
movq %r14, 0x8(%rax)
movq %r14, 0x28(%rbx)
movq %rbx, %rdi
callq 0xa220
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lorenatoscano[P]musify/src/linkedList.cpp
// Function: LinkedList::~LinkedList()
LinkedList::~LinkedList() {
  if (size != 0) {
    node* temp = nullptr;
    node* cur = nullptr;

    cur = head;

    while (cur != nullptr) {
      temp = cur->next;
      delete cur;
      cur = temp;
    }
  }
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x1401
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x13fd
movq 0x40(%rbx), %r14
movq %rbx, %rdi
callq 0x5830
movq %rbx, %rdi
callq 0x1100
movq %r14, %rbx
jmp 0x13df
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lorenatoscano[P]musify/src/linkedList.cpp
// Function: LinkedList::LinkedList(LinkedList const&)
LinkedList::LinkedList(const LinkedList& oldList) {
  head = nullptr;
  tail = nullptr;
  size = 0;

  node* temp = oldList.head;

  while (temp != nullptr) {
    insertEnd(temp->data);

    temp = temp->next;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq -0x58(%rbp), %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1450
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20ac
movq %r14, %rdi
movq %r15, %rsi
callq 0x1470
movq %r15, %rdi
callq 0x5830
addq $0x40, %rbx
jmp 0x1424
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x5830
movq %rbx, %rdi
callq 0x1180
nop
// File: /workspace/github_cpp_makefile_star2_O2/lorenatoscano[P]musify/src/linkedList.cpp
// Function: LinkedList::insertEnd(Song)
void LinkedList::insertEnd(Song value) {
  // Evita a adição de músicas repetidas
  if (search(value) != nullptr) {
    cout << "A música já existe no sistema." << endl;
  } else {
    node* temp = new node;

    temp->data = value;
    temp->next = nullptr;

    if (head == nullptr) {
      head =  temp;
      tail = temp;
      temp = nullptr;
    } else {
      tail->next = temp;
      tail = temp;
    }

    ++size;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x58(%rbp), %r15
movq %r15, %rdi
callq 0x20ac
movq %rbx, %rdi
movq %r15, %rsi
callq 0x17fc
movq %rax, %r15
leaq -0x58(%rbp), %rdi
callq 0x5830
testq %r15, %r15
je 0x14c8
movq 0x8b1e(%rip), %rdi      # 0x9fd0
leaq 0x4b4b(%rip), %rsi      # 0x6004
callq 0x1110
movq %rax, %rdi
callq 0x1070
jmp 0x1506
pushq $0x48
popq %rdi
callq 0x1120
movq %rax, %r15
movq %rax, %rdi
callq 0x5808
movq %r15, %rdi
movq %r14, %rsi
callq 0x20e6
andq $0x0, 0x40(%r15)
cmpq $0x0, (%rbx)
je 0x14fb
movq 0x8(%rbx), %rax
movq %r15, 0x40(%rax)
jmp 0x14fe
movq %r15, (%rbx)
movq %r15, 0x8(%rbx)
incq 0x10(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x1100
jmp 0x152a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x5830
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O2/lorenatoscano[P]musify/src/linkedList.cpp
// Function: LinkedList::operator+(LinkedList const&)
LinkedList LinkedList::operator+ (const LinkedList& secondList) {
  LinkedList finalList;

  // Percorre a lista atual copiando os valores para a lista final
  node* temp = head;
  while (temp != nullptr) {
    finalList.insertEnd(temp->data);

    temp = temp->next;
  }
  
  // Percorre a segunda lista copiando os valores para a lista final
  temp = secondList.head;
  while (temp != nullptr) {
    node* newNode = new node;

    newNode->data = temp->data;
    newNode->next = nullptr;
    
    if (finalList.head == nullptr) {
      finalList.head = newNode;
      finalList.tail = newNode;
      newNode = nullptr;
    } else {
      finalList.tail->next = newNode;
      finalList.tail = newNode;
    }

    finalList.size++;
    temp = temp->next;
  }
  
  return finalList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq -0x70(%rbp), %r12
movq (%r15), %r15
testq %r15, %r15
je 0x1587
movq %r12, %rdi
movq %r15, %rsi
callq 0x20ac
movq %r13, %rdi
movq %r12, %rsi
callq 0x1470
movq %r12, %rdi
callq 0x5830
addq $0x40, %r15
jmp 0x155b
movq (%r13), %r15
movq 0x8(%r13), %rbx
movq %r13, -0x30(%rbp)
movq 0x10(%r13), %r13
movq (%r14), %r14
testq %r14, %r14
je 0x15e1
pushq $0x48
popq %rdi
callq 0x1120
movq %rax, %r12
movq %rax, %rdi
callq 0x5808
movq %r12, %rdi
movq %r14, %rsi
callq 0x20e6
andq $0x0, 0x40(%r12)
movq %r12, %rax
testq %r15, %r15
je 0x15d2
movq %r12, 0x40(%rbx)
movq %r15, %rax
incq %r13
addq $0x40, %r14
movq %r12, %rbx
movq %rax, %r15
jmp 0x1597
movq -0x30(%rbp), %rax
movq %rbx, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %r15, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x30(%rbp), %rax
movq %rbx, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rax, %r13
movq %r15, (%rax)
movq %r12, %rdi
callq 0x1100
jmp 0x1646
movq %rax, %r14
jmp 0x1646
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x5830
jmp 0x1646
movq %rax, %r14
movq -0x30(%rbp), %rax
movq %rbx, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rax, %r13
movq %r15, (%rax)
movq %r13, %rdi
callq 0x13ce
movq %r14, %rdi
callq 0x1180