LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: lega911[P]ijson/src/json.cpp
// Function: Json::read_object()
Slice Json::read_object() {
    int lvl = 0;
    int start = index;
    while(true) {
        char a = next();
        if(a == '{' || a == '[') {
            lvl++;
        } else if(a == '}' || a == ']') {
            lvl--;
            if(lvl==0) return Slice(&_data.ptr()[start], index - start);
        } else if(a == '"') {
            index--;
            read_string();
            continue;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl 0x38(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
callq 0x24130
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x7b, %eax
je 0x23cdf
movsbl -0x21(%rbp), %eax
cmpl $0x5b, %eax
jne 0x23ced
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x23d73
movsbl -0x21(%rbp), %eax
cmpl $0x7d, %eax
je 0x23cff
movsbl -0x21(%rbp), %eax
cmpl $0x5d, %eax
jne 0x23d48
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x23d46
movq -0x40(%rbp), %rdi
addq $0x28, %rdi
callq 0x1e6f0
movq -0x40(%rbp), %rcx
movq %rax, %rsi
movslq -0x20(%rbp), %rdx
movl %edx, %eax
addq %rdx, %rsi
movl 0x38(%rcx), %edx
subl %eax, %edx
leaq -0x10(%rbp), %rdi
callq 0x1ea20
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %edx
addq $0x40, %rsp
popq %rbp
retq
jmp 0x23d71
movsbl -0x21(%rbp), %eax
cmpl $0x22, %eax
jne 0x23d6f
movq -0x40(%rbp), %rdi
movl 0x38(%rdi), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rdi)
callq 0x23b30
movq %rax, -0x38(%rbp)
movl %edx, -0x30(%rbp)
jmp 0x23cc1
jmp 0x23d71
jmp 0x23d73
jmp 0x23cc1
nopl (%rax,%rax)
// File: lega911[P]ijson/src/json.cpp
// Function: Json::read_value()
Slice Json::read_value() {
    // 0-9, null, true, false
    int start = index;
    char a;
    bool is_number = true;
    while(true) {
        a = next();
        if(a == ' ' || a == ',' || a == '}' || a == '\n' || a == '\r') break;
        if(a < '0' || a > '9') is_number = false;
        if(!is_number && (index - start > 5)) throw error::InvalidData();
    }
    index--;
    Slice result(&_data.ptr()[start], index - start);
    if(!is_number) {
        if(!(result == "null" || result == "true" || result == "false")) throw error::InvalidData();
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movl 0x38(%rax), %eax
movl %eax, -0x1c(%rbp)
movb $0x1, -0x1e(%rbp)
movq -0x38(%rbp), %rdi
callq 0x24130
movb %al, -0x1d(%rbp)
movsbl -0x1d(%rbp), %eax
cmpl $0x20, %eax
je 0x23dd7
movsbl -0x1d(%rbp), %eax
cmpl $0x2c, %eax
je 0x23dd7
movsbl -0x1d(%rbp), %eax
cmpl $0x7d, %eax
je 0x23dd7
movsbl -0x1d(%rbp), %eax
cmpl $0xa, %eax
je 0x23dd7
movsbl -0x1d(%rbp), %eax
cmpl $0xd, %eax
jne 0x23dd9
jmp 0x23e55
movsbl -0x1d(%rbp), %eax
cmpl $0x30, %eax
jl 0x23deb
movsbl -0x1d(%rbp), %eax
cmpl $0x39, %eax
jle 0x23def
movb $0x0, -0x1e(%rbp)
testb $0x1, -0x1e(%rbp)
jne 0x23e50
movq -0x38(%rbp), %rax
movl 0x38(%rax), %eax
subl -0x1c(%rbp), %eax
cmpl $0x5, %eax
jle 0x23e50
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
callq 0x1ee60
jmp 0x23e1f
movq -0x40(%rbp), %rdi
leaq 0x22e2e(%rip), %rsi     # 0x46c58
leaq -0x5131(%rip), %rdx     # 0x1ed00
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x19210
jmp 0x23f26
jmp 0x23d9e
movq -0x38(%rbp), %rdi
movl 0x38(%rdi), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rdi)
addq $0x28, %rdi
callq 0x1e6f0
movq %rax, %rsi
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rsi
movl 0x38(%rax), %edx
subl -0x1c(%rbp), %edx
leaq -0x10(%rbp), %rdi
callq 0x1ea20
testb $0x1, -0x1e(%rbp)
jne 0x23f19
leaq -0x10(%rbp), %rdi
leaq 0x156e9(%rip), %rsi     # 0x39586
callq 0x1ee30
testb $0x1, %al
jne 0x23f17
leaq -0x10(%rbp), %rdi
leaq 0x14cc7(%rip), %rsi     # 0x38b78
callq 0x1ee30
testb $0x1, %al
jne 0x23f17
leaq -0x10(%rbp), %rdi
leaq 0x142c6(%rip), %rsi     # 0x3818b
callq 0x1ee30
testb $0x1, %al
jne 0x23f17
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x1ee60
jmp 0x23ee9
movq -0x48(%rbp), %rdi
leaq 0x22d64(%rip), %rsi     # 0x46c58
leaq -0x51fb(%rip), %rdx     # 0x1ed00
callq 0x19480
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x19210
jmp 0x23f26
jmp 0x23f19
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %edx
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x194a0
nop
// File: lega911[P]ijson/src/buffer.h
// Function: ISlice::hextoi() const
i64 hextoi() const {
        if(!size()) throw error::NoData();
        i64 value = 0;
        char *p = ptr();
        char *end = p + size();
        for(;p < end; p++) {
           char a = *p;
           if(a >= '0' && a <= '9') value = (value << 4) + a - '0';
           else if(a >= 'A' && a <= 'F') value = (value << 4) + a - 'A' + 10;
           else if(a >= 'a' && a <= 'f') value = (value << 4) + a - 'a' + 10;
           else throw error::InvalidData();
        }
        return value;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x1e6d0
cmpl $0x0, %eax
jne 0x23fda
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x202a0
jmp 0x23fa9
movq -0x48(%rbp), %rdi
leaq 0x22cbc(%rip), %rsi     # 0x46c70
leaq -0x3f6b(%rip), %rdx     # 0x20050
callq 0x19480
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x19210
jmp 0x24120
movq -0x40(%rbp), %rdi
movq $0x0, -0x20(%rbp)
callq 0x1e6f0
movq -0x40(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
callq 0x1e6d0
movl %eax, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x24116
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x31(%rbp)
movsbl -0x31(%rbp), %eax
cmpl $0x30, %eax
jl 0x24056
movsbl -0x31(%rbp), %eax
cmpl $0x39, %eax
jg 0x24056
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movsbq -0x31(%rbp), %rcx
addq %rcx, %rax
subq $0x30, %rax
movq %rax, -0x20(%rbp)
jmp 0x24103
movsbl -0x31(%rbp), %eax
cmpl $0x41, %eax
jl 0x24086
movsbl -0x31(%rbp), %eax
cmpl $0x46, %eax
jg 0x24086
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movsbq -0x31(%rbp), %rcx
addq %rcx, %rax
subq $0x41, %rax
addq $0xa, %rax
movq %rax, -0x20(%rbp)
jmp 0x24101
movsbl -0x31(%rbp), %eax
cmpl $0x61, %eax
jl 0x240b6
movsbl -0x31(%rbp), %eax
cmpl $0x66, %eax
jg 0x240b6
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movsbq -0x31(%rbp), %rcx
addq %rcx, %rax
subq $0x61, %rax
addq $0xa, %rax
movq %rax, -0x20(%rbp)
jmp 0x240ff
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
callq 0x1ee60
jmp 0x240d1
movq -0x58(%rbp), %rdi
leaq 0x22b7c(%rip), %rsi     # 0x46c58
leaq -0x53e3(%rip), %rdx     # 0x1ed00
callq 0x19480
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x19210
jmp 0x24120
jmp 0x24101
jmp 0x24103
jmp 0x24105
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x24010
movq -0x20(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x194a0
nopl (%rax)
// File: lega911[P]ijson/src/mapper.cpp
// Function: Mapper::Mapper(Server*)
Mapper::Mapper(Server *server) {
    this->server = server;
    _cap = 4;
    _size = 1;
    char *buf = (char*)_malloc(_cap * sizeof(Step));
    memset(buf, 0, _cap * sizeof(Step));
    abuf = buf;
    buf_t = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x8, %rdi
callq 0x203a0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movl $0x4, 0x44(%rax)
movl $0x1, 0x40(%rax)
movslq 0x44(%rax), %rax
imulq $0xc4, %rax, %rax
movl %eax, %edi
callq 0x271e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movslq 0x44(%rax), %rax
imulq $0xc4, %rax, %rdx
xorl %esi, %esi
callq 0x191b0
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x30, %rdi
callq 0x26740
movq -0x20(%rbp), %rax
movq $0x0, 0x38(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: lega911[P]ijson/src/mapper.cpp
// Function: Mapper::_next()
u16 Mapper::_next() {
    _size += 1;
    if(_size <= _cap) return _size;

    int old_size = sizeof(Step) * _cap;
    if(_cap >= 512) _cap += 256;
    else _cap *= 2;

    if(buf_t) {
        char *p = (char*)_realloc(buf_t, _cap * sizeof(Step));
        if(!p) THROW("Realloc error");
        buf_t = p;
    } else {
        buf_t = (char*)_malloc(_cap * sizeof(Step));
        memcpy(buf_t, abuf.load(), old_size);
    };
    memset(&buf_t[old_size], 0, sizeof(Step) * _cap - old_size);
    return _size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movl 0x40(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x40(%rcx)
movl 0x40(%rcx), %eax
cmpl 0x44(%rcx), %eax
jg 0x260b5
movq -0x38(%rbp), %rax
movl 0x40(%rax), %eax
movw %ax, -0x2(%rbp)
jmp 0x2620b
movq -0x38(%rbp), %rax
movslq 0x44(%rax), %rcx
imulq $0xc4, %rcx, %rcx
movl %ecx, -0x14(%rbp)
cmpl $0x200, 0x44(%rax)      # imm = 0x200
jl 0x260e2
movq -0x38(%rbp), %rax
movl 0x44(%rax), %ecx
addl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x44(%rax)
jmp 0x260ee
movq -0x38(%rbp), %rax
movl 0x44(%rax), %ecx
shll %ecx
movl %ecx, 0x44(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x26194
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
movslq 0x44(%rax), %rax
imulq $0xc4, %rax, %rsi
callq 0x19460
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x26186
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x12943(%rip), %rsi     # 0x38a7e
leaq 0x13096(%rip), %rdx     # 0x391d8
leaq 0x1309e(%rip), %r8      # 0x391e7
movl $0x1b, %ecx
callq 0x22ba0
jmp 0x26155
movq -0x40(%rbp), %rdi
leaq 0x20ba0(%rip), %rsi     # 0x46d00
leaq -0x3057(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x19210
jmp 0x26215
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x38(%rax)
jmp 0x261d8
movq -0x38(%rbp), %rax
movslq 0x44(%rax), %rax
imulq $0xc4, %rax, %rax
movl %eax, %edi
callq 0x271e0
movq -0x38(%rbp), %rdi
movq %rax, 0x38(%rdi)
movq 0x38(%rdi), %rax
movq %rax, -0x48(%rbp)
addq $0x30, %rdi
movl $0x5, %esi
callq 0x26770
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movslq -0x14(%rbp), %rdx
callq 0x19260
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
movslq -0x14(%rbp), %rcx
addq %rcx, %rdi
movslq 0x44(%rax), %rax
imulq $0xc4, %rax, %rdx
movslq -0x14(%rbp), %rax
subq %rax, %rdx
xorl %esi, %esi
callq 0x191b0
movq -0x38(%rbp), %rax
movl 0x40(%rax), %eax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x194a0
nop
// File: lega911[P]ijson/src/mapper.cpp
// Function: Mapper::find(ISlice)
u16 Mapper::find(ISlice name) {
    u16 std = 0;
    int next;
    char *ptr = abuf.load();
    Step *step = _get_step(ptr, 1);
    for(int i=0;;i++) {
        if(step->std) std = step->std;
        if(i >= name.size()) {
            if(step->end) return step->end;
            return std;
        }
        u16 a = name.ptr()[i];

        if(a < 32 || a >= 128) return std;
        a -= 32;

        next = step->k[a];
        if(!next) return std;
        step = _get_step(ptr, next);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x18(%rbp)
movl %edx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movw $0x0, -0x22(%rbp)
addq $0x30, %rdi
movl $0x5, %esi
callq 0x26770
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x269b0
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
cmpw $0x0, 0x2(%rax)
je 0x264af
movq -0x38(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x22(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1e6d0
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jl 0x264eb
movq -0x38(%rbp), %rax
cmpw $0x0, (%rax)
je 0x264e1
movq -0x38(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x2(%rbp)
jmp 0x26567
movw -0x22(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x26567
leaq -0x18(%rbp), %rdi
callq 0x1e6f0
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movw %ax, -0x3e(%rbp)
movzwl -0x3e(%rbp), %eax
cmpl $0x20, %eax
jl 0x26514
movzwl -0x3e(%rbp), %eax
cmpl $0x80, %eax
jl 0x2651e
movw -0x22(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x26567
movzwl -0x3e(%rbp), %eax
subl $0x20, %eax
movw %ax, -0x3e(%rbp)
movq -0x38(%rbp), %rax
movzwl -0x3e(%rbp), %ecx
movzwl 0x4(%rax,%rcx,2), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x26549
movw -0x22(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x26567
movq -0x30(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x269b0
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x26498
movw -0x2(%rbp), %ax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: lega911[P]ijson/src/mapper.cpp
// Function: Mapper::del(ISlice)
u16 Mapper::del(ISlice name) {
    int next;
    char *ptr = abuf.load();
    Step *step = _get_step(ptr, 1);
    for(int i=0;;i++) {
        if(i >= name.size()) {
            auto result = step->end;
            step->end = 0;
            return result;
        }
        u16 a = name.ptr()[i];

        if(a == '*') {
            auto result = step->std;
            step->std = 0;
            return result;
        }

        if(a < 32 || a >= 128) return 0;
        a -= 32;

        next = step->k[a];
        if(!next) return 0;
        step = _get_step(ptr, next);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x18(%rbp)
movl %edx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
movl $0x5, %esi
callq 0x26770
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x269b0
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1e6d0
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jl 0x265fb
movq -0x38(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x3e(%rbp)
movq -0x38(%rbp), %rax
movw $0x0, (%rax)
movw -0x3e(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x2669c
leaq -0x18(%rbp), %rdi
callq 0x1e6f0
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movw %ax, -0x40(%rbp)
movzwl -0x40(%rbp), %eax
cmpl $0x2a, %eax
jne 0x26639
movq -0x38(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x42(%rbp)
movq -0x38(%rbp), %rax
movw $0x0, 0x2(%rax)
movw -0x42(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x2669c
movzwl -0x40(%rbp), %eax
cmpl $0x20, %eax
jl 0x2664d
movzwl -0x40(%rbp), %eax
cmpl $0x80, %eax
jl 0x26655
movw $0x0, -0x2(%rbp)
jmp 0x2669c
movzwl -0x40(%rbp), %eax
subl $0x20, %eax
movw %ax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movzwl -0x40(%rbp), %ecx
movzwl 0x4(%rax,%rcx,2), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x2667e
movw $0x0, -0x2(%rbp)
jmp 0x2669c
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x269b0
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x265c2
movw -0x2(%rbp), %ax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x38, %rdi
callq 0x25c80
cmpq $0x0, %rax
jne 0x27a4c
movb $0x1, -0x1(%rbp)
jmp 0x27aad
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x38, %rdi
callq 0x25c80
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x27aa9
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
movslq -0x18(%rbp), %rsi
callq 0x2cc40
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x27550
testb $0x1, %al
jne 0x27a96
jmp 0x27a9c
movb $0x1, -0x1(%rbp)
jmp 0x27aad
jmp 0x27a9e
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x27a53
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movl 0x4(%rcx), %edx
movq -0x10(%rbp), %rax
movl %edx, 0x3c(%rax)
movq -0x10(%rbp), %rax
movl %edx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d550
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x27e89
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x11556(%rip), %rsi     # 0x39394
leaq 0x11401(%rip), %rdx     # 0x39246
leaq 0x11565(%rip), %r8      # 0x393b1
movl $0xd1, %ecx
callq 0x22ba0
jmp 0x27e58
movq -0x40(%rbp), %rdi
leaq 0x1ee9d(%rip), %rsi     # 0x46d00
leaq -0x4d5a(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x19210
jmp 0x27f54
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x191b0
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x27eb7
movl -0x30(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x27ecb
movl -0x30(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x1, %esi
leaq -0x30(%rbp), %rcx
callq 0x193b0
cmpl $0x0, %eax
jge 0x27f4e
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
leaq 0x114c8(%rip), %rsi     # 0x393ce
leaq 0x11339(%rip), %rdx     # 0x39246
leaq 0x1149d(%rip), %r8      # 0x393b1
movl $0xe0, %ecx
callq 0x22ba0
jmp 0x27f20
movq -0x48(%rbp), %rdi
leaq 0x1edd5(%rip), %rsi     # 0x46d00
leaq -0x4e22(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x19210
jmp 0x27f54
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x194a0
nopl (%rax)
// File: 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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x27690
cmpl $0x0, %eax
je 0x27f83
jmp 0x280b2
callq 0x36940
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, %ecx
movq %rcx, 0x20180(%rax)
cmpl $0x1, 0x28(%rax)
jge 0x27fa8
movq -0x40(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x40(%rbp), %rax
cmpl $0x3e, 0x28(%rax)
jle 0x27fdd
movq -0x40(%rbp), %rax
movl $0x3e, 0x28(%rax)
movl 0x20(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x27fdb
movq 0x1f001(%rip), %rdi     # 0x46fd0
leaq 0x113a0(%rip), %rsi     # 0x39376
callq 0x192e0
jmp 0x27fdd
movq -0x40(%rbp), %rax
movslq 0x28(%rax), %rax
shlq $0x3, %rax
movl %eax, %edi
callq 0x271e0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20050(%rax)
movl $0x0, -0xc(%rbp)
movq -0x40(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x28(%rcx), %eax
jge 0x28082
movl $0xa8, %edi
callq 0x27250
movq -0x40(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movl -0xc(%rbp), %edx
callq 0x28880
jmp 0x28033
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x280e0
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rdx
movq 0x20050(%rax), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x28005
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0xa8, %esi
callq 0x19300
jmp 0x280cd
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x2cf90
movq -0x50(%rbp), %rdi
callq 0x353d0
jmp 0x2809e
movq -0x40(%rbp), %rdi
callq 0x27ac0
jmp 0x280a9
leaq -0x38(%rbp), %rdi
callq 0x2cfc0
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2cfc0
movq -0x20(%rbp), %rdi
callq 0x194a0
nopw %cs:(%rax,%rax)
// File: 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
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x38(%rbp)
movb $0x0, -0x15(%rbp)
callq 0x2cfe0
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x28(%rcx), %eax
jge 0x281be
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x281b1
movq -0x48(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x36b60
jmp 0x28198
jmp 0x281b1
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x2d010
jmp 0x281db
jmp 0x281b3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x28176
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x281d1
movq -0x48(%rbp), %rdi
callq 0x2d010
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x194a0
nopw %cs:(%rax,%rax)
// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x28c50
jmp 0x2894b
jmp 0x28a7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x289a9
movq -0x10(%rbp), %rdi
callq 0x19120
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x28a75
movq -0x28(%rbp), %rdi
leaq 0x10a5b(%rip), %rsi     # 0x393f8
callq 0x22ff0
jmp 0x289a4
jmp 0x28a75
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x28a82
movq -0x10(%rbp), %rdi
callq 0x19120
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x28a59
callq 0x36960
movq %rax, -0x40(%rbp)
jmp 0x289e7
movq -0x40(%rbp), %rsi
movq 0x1e5de(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, -0x48(%rbp)
jmp 0x289fd
movq -0x48(%rbp), %rdi
leaq 0x10790(%rip), %rsi     # 0x39198
callq 0x192e0
movq %rax, -0x50(%rbp)
jmp 0x28a13
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x192e0
movq %rax, -0x58(%rbp)
jmp 0x28a32
movq -0x58(%rbp), %rdi
movq 0x1e573(%rip), %rsi     # 0x46fb0
callq 0x19320
jmp 0x28a44
jmp 0x28a59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x19450
jmp 0x28a60
callq 0x19450
jmp 0x28a7a
jmp 0x28a82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x19450
jmp 0x28a80
callq 0x19450
addq $0x60, %rsp
popq %rbp
retq
jmp 0x28a82
movq -0x10(%rbp), %rdi
callq 0x194a0
movq %rax, %rdi
callq 0x1eb30
nopw %cs:(%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x18(%rax), %rax
cmpl $0x0, 0x30(%rax)
jne 0x28ba3
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
addq $0x20058, %rsi          # imm = 0x20058
leaq -0x10(%rbp), %rdi
callq 0x1f5d0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x30(%rax)
jne 0x28b06
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x190b0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x30(%rax)
jge 0x28b8a
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x10758(%rip), %rsi     # 0x39287
leaq 0x10710(%rip), %rdx     # 0x39246
leaq 0x108a9(%rip), %r8      # 0x393e6
movl $0xea, %ecx
callq 0x22ba0
jmp 0x28b49
movq -0x38(%rbp), %rdi
leaq 0x1e1ac(%rip), %rsi     # 0x46d00
leaq -0x5a4b(%rip), %rdx     # 0x23110
callq 0x19480
jmp 0x28c4f
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x19210
jmp 0x28b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x28b95
leaq -0x10(%rbp), %rdi
callq 0x1f880
jmp 0x28ba3
leaq -0x10(%rbp), %rdi
callq 0x1f880
jmp 0x28c46
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x191b0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movl 0x30(%rcx), %ecx
movl %ecx, -0x24(%rbp)
movl (%rax), %edi
movq 0x18(%rax), %rax
movl 0x30(%rax), %edx
movl $0x1, %esi
leaq -0x28(%rbp), %rcx
callq 0x193b0
cmpl $0x0, %eax
jge 0x28c40
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x107d6(%rip), %rsi     # 0x393ce
leaq 0x10647(%rip), %rdx     # 0x39246
leaq 0x107e0(%rip), %r8      # 0x393e6
movl $0xef, %ecx
callq 0x22ba0
jmp 0x28c12
movq -0x40(%rbp), %rdi
leaq 0x1e0e3(%rip), %rsi     # 0x46d00
leaq -0x5b14(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x19210
jmp 0x28c46
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x194a0
nop
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x2937b
movq -0x30(%rbp), %rax
movl (%rax), %edi
movl -0xc(%rbp), %edx
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x193b0
cmpl $0x0, %eax
jge 0x29376
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x101df(%rip), %rsi     # 0x3950a
leaq 0xff14(%rip), %rdx      # 0x39246
leaq 0x101e9(%rip), %r8      # 0x39522
movl $0x218, %ecx            # imm = 0x218
callq 0x22ba0
jmp 0x29345
movq -0x38(%rbp), %rdi
leaq 0x1d9b0(%rip), %rsi     # 0x46d00
leaq -0x6247(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x19210
jmp 0x2943e
jmp 0x29438
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x191b0
movl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x293a5
movl -0x28(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x293b9
movl -0x28(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
movl -0xc(%rbp), %edx
movl $0x3, %esi
leaq -0x28(%rbp), %rcx
callq 0x193b0
cmpl $0x0, %eax
jge 0x29438
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x10155(%rip), %rsi     # 0x39545
leaq 0xfe4f(%rip), %rdx      # 0x39246
leaq 0x10124(%rip), %r8      # 0x39522
movl $0x221, %ecx            # imm = 0x221
callq 0x22ba0
jmp 0x2940a
movq -0x40(%rbp), %rdi
leaq 0x1d8eb(%rip), %rsi     # 0x46d00
leaq -0x630c(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x19210
jmp 0x2943e
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x194a0
nopw (%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x18(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq 0x50(%rcx,%rdx,8), %rcx
movq %rcx, -0x18(%rbp)
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x294df
callq 0x36960
movq %rax, %rsi
movq 0x1db3a(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, %rdi
leaq 0x100b8(%rip), %rsi     # 0x3955d
callq 0x192e0
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x19490
movq %rax, %rdi
leaq 0xf1e5(%rip), %rsi      # 0x386a4
callq 0x192e0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x19250
movq %rax, %rdi
movq 0x1dad6(%rip), %rsi     # 0x46fb0
callq 0x19320
cmpq $0x0, -0x18(%rbp)
jne 0x29549
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x1006f(%rip), %rsi     # 0x39570
leaq 0xfd3e(%rip), %rdx      # 0x39246
leaq 0x1007c(%rip), %r8      # 0x3958b
movl $0x229, %ecx            # imm = 0x229
callq 0x22ba0
jmp 0x2951b
movq -0x38(%rbp), %rdi
leaq 0x1d7da(%rip), %rsi     # 0x46d00
leaq -0x641d(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x19210
jmp 0x29594
movq -0x18(%rbp), %rdi
callq 0x1e9b0
movq -0x18(%rbp), %rdi
callq 0x2d5a0
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2aec0
movq -0x18(%rbp), %rdi
callq 0x19950
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq $0x0, 0x50(%rax,%rcx,8)
movl -0xc(%rbp), %edi
callq 0x19500
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x194a0
nopl (%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x60, %rdi
callq 0x20c90
cmpq $0x0, %rax
jne 0x29945
jmp 0x299af
movq -0x30(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20b40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20990
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2d560
testb $0x1, %al
jne 0x2997e
jmp 0x299a2
leaq -0x18(%rbp), %rdi
callq 0x21050
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x2d5a0
leaq -0x18(%rbp), %rdi
callq 0x2d5e0
jmp 0x2996b
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
callq 0x2d600
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x20, %rdi
callq 0x20c90
cmpq $0x0, %rax
jne 0x29c08
jmp 0x29d1a
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
callq 0x2d620
testb $0x1, %al
jne 0x29c1e
jmp 0x29d1a
movq -0x30(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20b40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20990
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2d560
testb $0x1, %al
jne 0x29c5a
jmp 0x29d00
leaq -0x18(%rbp), %rdi
callq 0x21050
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2d660
cmpl $0x0, %eax
jne 0x29cf0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x29cc9
callq 0x36960
movq %rax, %rsi
movq 0x1d336(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, %rdi
leaq 0xf83a(%rip), %rsi      # 0x394e3
callq 0x192e0
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x19250
movq %rax, %rdi
movq 0x1d2ec(%rip), %rsi     # 0x46fb0
callq 0x19320
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x29cee
movq -0x38(%rbp), %rdi
callq 0x2d680
movq -0x38(%rbp), %rdi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x19300
jmp 0x29cf0
jmp 0x29cf2
leaq -0x18(%rbp), %rdi
callq 0x2d5e0
jmp 0x29c44
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x2d600
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
callq 0x1fa80
addq $0x40, %rsp
popq %rbp
retq
// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
testb $0x1, 0x10(%rax)
jne 0x29d3f
jmp 0x29e21
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x18(%rbp), %rdi
callq 0x28140
movq -0x58(%rbp), %rax
movb $0x0, 0x10(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x1c(%rbp), %eax
movq 0x18(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jg 0x29e18
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq 0x50(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x29da2
movq -0x58(%rbp), %rcx
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
cmpl 0x4(%rcx), %eax
je 0x29da4
jmp 0x29e0a
movq -0x28(%rbp), %rax
cmpl $0x3, 0xcc(%rax)
je 0x29db3
jmp 0x29e0a
movq -0x28(%rbp), %rdi
callq 0x1fcc0
movb %al, -0x59(%rbp)
jmp 0x29dc1
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x29dca
jmp 0x29de3
jmp 0x29e0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x2d010
jmp 0x29e27
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movups 0xb8(%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rsi
movl -0x48(%rbp), %edx
callq 0x29e30
jmp 0x29e08
jmp 0x29e0a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x29d62
leaq -0x18(%rbp), %rdi
callq 0x2d010
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x194a0
// File: 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
subq $0x70, %rsp
movq %rsi, -0x10(%rbp)
movl %edx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1e6f0
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1e9d0
movl -0x30(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1e6d0
movl %eax, %ecx
movl -0x6c(%rbp), %eax
cmpl %ecx, %eax
jge 0x2b431
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x2b3d1
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0x2b421
movq -0x28(%rbp), %rsi
movslq -0x2c(%rbp), %rax
addq %rax, %rsi
movl -0x30(%rbp), %edx
subl -0x2c(%rbp), %edx
leaq -0x40(%rbp), %rdi
callq 0x201e0
movq -0x68(%rbp), %rdi
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rcx
movq -0x50(%rbp), %rsi
movl -0x48(%rbp), %edx
callq 0x2b490
cmpl $0x1, %eax
jne 0x2b41f
jmp 0x2b487
jmp 0x2b421
jmp 0x2b423
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2b393
movl -0x2c(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1e6d0
movl %eax, %ecx
movl -0x70(%rbp), %eax
cmpl %ecx, %eax
jge 0x2b487
movq -0x28(%rbp), %rsi
movslq -0x2c(%rbp), %rax
addq %rax, %rsi
movl -0x30(%rbp), %edx
subl -0x2c(%rbp), %edx
leaq -0x40(%rbp), %rdi
callq 0x201e0
movq -0x68(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rcx
movq -0x60(%rbp), %rsi
movl -0x58(%rbp), %edx
callq 0x2b490
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x3c(%rcx), %eax
jne 0x2c89e
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2c89e
movq 0x1a73e(%rip), %rdi     # 0x46fd0
leaq 0xce68(%rip), %rsi      # 0x39701
callq 0x192e0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x1, 0x40(%rcx)
movq -0x18(%rbp), %rcx
movb $0x1, 0x40(%rcx)
movq -0x10(%rbp), %rcx
movl 0x3c(%rcx), %edx
movq -0x18(%rbp), %rcx
movl %edx, 0x3c(%rcx)
movq 0x18(%rax), %rax
movl 0x20(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x2c95e
movq 0x1a6f6(%rip), %rdi     # 0x46fd0
leaq 0xce4f(%rip), %rsi      # 0x39730
callq 0x192e0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x19490
movq %rax, %rdi
leaq 0xcc06(%rip), %rsi      # 0x39505
callq 0x192e0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %esi
callq 0x19490
movq %rax, %rdi
leaq 0xce22(%rip), %rsi      # 0x3973f
callq 0x192e0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x19490
movq %rax, %rdi
leaq 0xcbc7(%rip), %rsi      # 0x39502
callq 0x192e0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x19490
movq %rax, %rdi
movq 0x1a657(%rip), %rsi     # 0x46fb0
callq 0x19320
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq 0x88(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rax)
movq -0x18(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2ca16
movl $0x30, %edi
callq 0x19180
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0xcca0(%rip), %rsi      # 0x3966b
leaq 0xc874(%rip), %rdx      # 0x39246
leaq 0xccaf(%rip), %r8       # 0x39688
movl $0x3ac, %ecx            # imm = 0x3AC
callq 0x22ba0
jmp 0x2c9e5
movq -0x40(%rbp), %rdi
leaq 0x1a310(%rip), %rsi     # 0x46d00
leaq -0x98e7(%rip), %rdx     # 0x23110
callq 0x19480
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x19210
jmp 0x2cacf
movq -0x18(%rbp), %rax
testb $0x1, 0xf3(%rax)
jne 0x2ca39
movq -0x18(%rbp), %rax
movb $0x0, 0xf1(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0xf0(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x120(%rax)
movq -0x20(%rbp), %rdi
callq 0x19950
movq -0x20(%rbp), %rdi
callq 0x1fcc0
testb $0x1, %al
jne 0x2ca60
jmp 0x2ca69
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2cac6
movq -0x20(%rbp), %rax
movl $0x0, 0xcc(%rax)
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
leaq 0xb7ab(%rip), %rsi      # 0x38231
callq 0x1b6d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
addq $0xd0, %rsi
callq 0x1be40
movq -0x18(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x3c(%rcx), %eax
je 0x2cabf
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c850
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x194a0
nopl (%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
addq $0xc, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x2fa40
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2fa70
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x8(%rax), %rdi
addq $0x200b0, %rdi          # imm = 0x200B0
callq 0x26eb0
cmpq $0x0, %rax
jne 0x357cf
jmp 0x358ae
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x20088, %rdi          # imm = 0x20088
callq 0x1fa50
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x200b0, %rsi          # imm = 0x200B0
leaq -0x20(%rbp), %rdi
callq 0x35e10
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x200b0, %rdi          # imm = 0x200B0
callq 0x35f00
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x20088, %rdi          # imm = 0x20088
callq 0x1fa80
jmp 0x35825
movl $0x2710, %edi           # imm = 0x2710
callq 0x193d0
jmp 0x35831
leaq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x26db0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x26c40
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x35f20
testb $0x1, %al
jne 0x35866
jmp 0x358a5
leaq -0x40(%rbp), %rdi
callq 0x35f60
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
callq 0x27220
jmp 0x35881
jmp 0x35883
leaq -0x40(%rbp), %rdi
callq 0x35f80
jmp 0x35853
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x24e50
jmp 0x358b4
leaq -0x20(%rbp), %rdi
callq 0x24e50
addq $0x60, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x194a0
nopl (%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
movq %rcx, -0x18(%rbp)
movq 0x8(%rax), %rax
andq -0x18(%rbp), %rax
cmpq $0x0, %rax
je 0x36b9a
jmp 0x36bc5
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq (%rax), %rax
movq 0x20050(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x38, %rdi
callq 0x1fa50
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x1, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
movq (%rcx), %rcx
cmpl 0x28(%rcx), %eax
jge 0x36c49
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x36c33
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x20050(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x38, %rdi
callq 0x1fa80
movq -0x10(%rbp), %rax
shlq %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x36bf3
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)