LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/ep.cc
// Function: kvtest::EventuallyPersistentStore::flushSome(std::queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>*, kvtest::Callback<bool>&)
void EventuallyPersistentStore::flushSome(std::queue<std::string> *q,
                                             Callback<bool> &cb) {

        std::string key = q->front();
        q->pop();

        int bucket_num = storage.bucket(key);
        LockHolder lh(storage.getMutex(bucket_num));
        StoredValue *v = storage.unlocked_find(key, bucket_num);

        bool found = v != NULL;
        bool isDirty = (found && v->isDirty());
        const char *val = NULL;
        if (isDirty) {
            v->markClean();
            // Copy it for the duration.
            val = strdup(v->getValue());
        }
        lh.unlock();

        if (found && isDirty) {
            underlying->set(key, val, cb);
        } else if (!found) {
            underlying->del(key, cb);
        }

        free((void*)val);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rsi), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x32f0
movq %r15, %rdi
callq 0x7012
leaq 0x20(%r14), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x66d0
movl %eax, %ebp
movq %r15, %rdi
movl %eax, %esi
callq 0x671e
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x516e
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
movl %ebp, %edx
callq 0x67c0
movq %rax, %r12
movb $0x1, %bpl
testq %rax, %rax
je 0x63bb
cmpb $0x1, (%r12)
jne 0x63bb
movb $0x0, (%r12)
movq 0x28(%r12), %rdi
callq 0x33f0
movq %rax, %r15
xorl %ebp, %ebp
jmp 0x63be
xorl %r15d, %r15d
testq %r12, %r12
sete %r13b
leaq 0x8(%rsp), %rdi
callq 0x51d4
orb %bpl, %r13b
je 0x63ed
testq %r12, %r12
jne 0x6402
movq 0x8(%r14), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq *0x38(%rax)
jmp 0x6402
movq 0x8(%r14), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq *0x28(%rax)
movq %r15, %rdi
callq 0x32a0
leaq 0x8(%rsp), %rdi
callq 0x51d4
leaq 0x18(%rsp), %rdi
callq 0x30d0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x642f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x51d4
jmp 0x6441
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x33c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::HashTable(unsigned long, unsigned long)
HashTable(size_t s = 196613, size_t l = 193) {
            size = s;
            n_locks = l;
            active = true;
            values = (StoredValue**)calloc(s, sizeof(StoredValue**));
            mutexes = (pthread_mutex_t*)calloc(l, sizeof(pthread_mutex_t));
            for (int i = 0; i < (int)n_locks; i++) {
                pthread_mutex_init(&mutexes[i], NULL);
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
movb $0x1, 0x10(%rdi)
pushq $0x8
popq %rsi
movq %rax, %rdi
callq 0x3150
movq %rax, 0x18(%rbx)
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3150
movq %rax, 0x20(%rbx)
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq %r14d, %rax
cmpq %rax, %r12
jge 0x64b7
movq 0x20(%rbx), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x3330
incq %r12
movq 0x8(%rbx), %r14
addq $0x28, %r15
jmp 0x6494
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::~HashTable()
~HashTable() {
            clear();
            for (int i = 0; i < (int)n_locks; i++) {
                pthread_mutex_destroy(&mutexes[i]);
            }
            free(mutexes);
            free(values);
            mutexes = NULL;
            values = NULL;
            active = false;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x6630
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r15
jge 0x64f5
addq %r14, %rdi
callq 0x3290
incq %r15
addq $0x28, %r14
jmp 0x64d7
callq 0x32a0
movq 0x18(%rbx), %rdi
callq 0x32a0
movb $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x388d
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const*)
mutation_type_t set(std::string &key, const char *val) {
            assert(active);
            mutation_type_t rv = NOT_FOUND;
            int bucket_num = bucket(key);
            LockHolder lh(getMutex(bucket_num));
            StoredValue *v = unlocked_find(key, bucket_num);
            if (v) {
                rv = v->isClean() ? WAS_CLEAN : WAS_DIRTY;
                v->setValue(val);
            } else {
                v = new StoredValue(key, val, values[bucket_num]);
                values[bucket_num] = v;
            }
            return rv;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x0, 0x10(%rdi)
je 0x65ec
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x66d0
movl %eax, %ebp
movq %r14, %rdi
movl %eax, %esi
callq 0x671e
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x516e
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x67c0
testq %rax, %rax
je 0x65a3
movzbl (%rax), %ebp
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6b08
incl %ebp
jmp 0x65d1
pushq $0x38
popq %rdi
callq 0x3250
movq %rax, %r12
movq 0x18(%r14), %rax
movslq %ebp, %r13
movq (%rax,%r13,8), %rcx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6b34
movq 0x18(%r14), %rax
movq %r12, (%rax,%r13,8)
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdi
callq 0x51d4
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21aa(%rip), %rdi      # 0x879d
leaq 0x217f(%rip), %rsi      # 0x8779
leaq 0x21a3(%rip), %rcx      # 0x87a4
movl $0x81, %edx
callq 0x3140
movq %rax, %rbx
pushq $0x38
popq %rsi
movq %r12, %rdi
callq 0x3260
jmp 0x661e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x51d4
movq %rbx, %rdi
callq 0x33c0
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::clear()
void clear() {
            assert(active);
            for (int i = 0; i < (int)size; i++) {
                LockHolder lh(getMutex(i));
                while (values[i]) {
                    StoredValue *v = values[i];
                    values[i] = v->next;
                    delete v;
                }
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpb $0x1, 0x10(%rdi)
jne 0x66b3
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsp, %r15
pushq $0x38
popq %r12
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x66a5
movq %rbx, %rdi
movl %r14d, %esi
callq 0x671e
movq %r15, %rdi
movq %rax, %rsi
callq 0x516e
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %r13
testq %r13, %r13
je 0x6698
movq 0x30(%r13), %rcx
movq %rcx, (%rax,%r14,8)
movq %r13, %rdi
callq 0x6b9a
movq %r13, %rdi
movq %r12, %rsi
callq 0x3260
jmp 0x666e
movq %r15, %rdi
callq 0x51d4
incq %r14
jmp 0x6650
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x20e3(%rip), %rdi      # 0x879d
leaq 0x20b8(%rip), %rsi      # 0x8779
leaq 0x2120(%rip), %rcx      # 0x87e8
pushq $0x69
popq %rdx
callq 0x3140
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::bucket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
inline int bucket(std::string &key) {
            assert(active);
            int h=5381;
            int i=0;
            const char *str=key.c_str();

            for(i=0; str[i] != 0x00; i++) {
                h = ((h << 5) + h) ^ str[i];
            }

            return abs(h) % (int)size;
        }

// Assembly:
pushq %rax
cmpb $0x0, 0x10(%rdi)
je 0x66fe
movq (%rsi), %rax
movl $0x1505, %ecx           # imm = 0x1505
movsbl (%rax), %edx
testl %edx, %edx
je 0x66f0
imull $0x21, %ecx, %ecx
xorl %edx, %ecx
incq %rax
jmp 0x66df
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cltd
idivl (%rdi)
movl %edx, %eax
popq %rcx
retq
leaq 0x2098(%rip), %rdi      # 0x879d
leaq 0x206d(%rip), %rsi      # 0x8779
leaq 0x20f5(%rip), %rcx      # 0x8808
movl $0x9c, %edx
callq 0x3140
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::getMutex(int)
inline pthread_mutex_t *getMutex(int bucket_num) {
            assert(active);
            assert(bucket_num < (int)size);
            assert(bucket_num >= 0);
            int lock_num = bucket_num % (int)n_locks;
            assert(lock_num < (int)n_locks);
            assert(lock_num >= 0);
            return &mutexes[lock_num];
        }

// Assembly:
pushq %rax
cmpb $0x0, 0x10(%rdi)
je 0x6744
cmpl %esi, (%rdi)
jle 0x6763
testl %esi, %esi
js 0x6782
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
js 0x67a1
movl %esi, %eax
xorl %edx, %edx
divl %ecx
imulq $0x28, %rdx, %rax
addq 0x20(%rdi), %rax
popq %rcx
retq
leaq 0x2052(%rip), %rdi      # 0x879d
leaq 0x2027(%rip), %rsi      # 0x8779
leaq 0x20dc(%rip), %rcx      # 0x8835
movl $0xaa, %edx
callq 0x3140
leaq 0x20fd(%rip), %rdi      # 0x8867
leaq 0x2008(%rip), %rsi      # 0x8779
leaq 0x20bd(%rip), %rcx      # 0x8835
movl $0xab, %edx
callq 0x3140
leaq 0x20f5(%rip), %rdi      # 0x887e
leaq 0x1fe9(%rip), %rsi      # 0x8779
leaq 0x209e(%rip), %rcx      # 0x8835
movl $0xac, %edx
callq 0x3140
leaq 0x20e6(%rip), %rdi      # 0x888e
leaq 0x1fca(%rip), %rsi      # 0x8779
leaq 0x207f(%rip), %rcx      # 0x8835
movl $0xae, %edx
callq 0x3140
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::unlocked_find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int)
StoredValue *unlocked_find(std::string &key, int bucket_num) {
            StoredValue *v = values[bucket_num];
            while (v) {
                if (key.compare(v->key) == 0) {
                    return v;
                }
                v = v->next;
            }
            return NULL;
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movslq %edx, %r14
shlq $0x3, %r14
addq 0x18(%rdi), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x67f0
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3040
testl %eax, %eax
je 0x67f0
addq $0x30, %r14
jmp 0x67d2
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::HashTable::del(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool del(std::string &key) {
            assert(active);
            int bucket_num = bucket(key);
            LockHolder lh(getMutex(bucket_num));

            StoredValue *v = values[bucket_num];

            // Special case empty bucket.
            if (!v) {
                return false;
            }

            // Special case the first one
            if (key.compare(v->key) == 0) {
                values[bucket_num] = v->next;
                delete v;
                return true;
            }

            while (v->next) {
                if (key.compare(v->next->key) == 0) {
                    StoredValue *tmp = v->next;
                    v->next = v->next->next;
                    delete tmp;
                    return true;
                }
            }

            return false;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, 0x10(%rdi)
je 0x68c5
movq %rsi, %rbx
movq %rdi, %r15
callq 0x66d0
movl %eax, %ebp
movq %r15, %rdi
movl %eax, %esi
callq 0x671e
movq %rsp, %rdi
movq %rax, %rsi
callq 0x516e
movq 0x18(%r15), %rax
movslq %ebp, %r12
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x6889
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3040
testl %eax, %eax
je 0x688d
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x6889
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x3040
testl %eax, %eax
jne 0x6854
movq 0x30(%r14), %rbx
movq 0x30(%rbx), %rax
movq %rax, 0x30(%r14)
movq %rbx, %rdi
callq 0x6b9a
pushq $0x38
popq %rsi
movq %rbx, %rdi
jmp 0x68a7
xorl %ebx, %ebx
jmp 0x68ae
movq 0x30(%r14), %rax
movq 0x18(%r15), %rcx
movq %rax, (%rcx,%r12,8)
movq %r14, %rdi
callq 0x6b9a
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x3260
movb $0x1, %bl
movq %rsp, %rdi
callq 0x51d4
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ed1(%rip), %rdi      # 0x879d
leaq 0x1ea6(%rip), %rsi      # 0x8779
leaq 0x1fcc(%rip), %rcx      # 0x88a6
movl $0xb5, %edx
callq 0x3140
jmp 0x68e6
movq %rax, %rbx
movq %rsp, %rdi
callq 0x51d4
movq %rbx, %rdi
callq 0x33c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::Flusher::run()
void run() {
            try {
                while(running) {
                    store->flush(true);
                }
                std::cout << "Shutting down flusher." << std::endl;
            } catch(std::runtime_error &e) {
                std::cerr << "Exception in executor loop: "
                          << e.what() << std::endl;
                assert(false);
            }
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rbp
movb 0x8(%rbx), %al
cmpb $0x1, %al
jne 0x6917
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x6080
jmp 0x6904
movq 0x66aa(%rip), %rdi      # 0xcfc8
leaq 0x1e1a(%rip), %rsi      # 0x873f
callq 0x3240
movq %rax, %rdi
callq 0x30e0
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x6939
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x69a5
movq %rbx, %rdi
callq 0x30b0
movq %rax, %rbx
movq 0x6695(%rip), %rdi      # 0xcfe8
leaq 0x1dfc(%rip), %rsi      # 0x8756
callq 0x3240
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x30e0
leaq 0x1dee(%rip), %rdi      # 0x8773
leaq 0x1ded(%rip), %rsi      # 0x8779
leaq 0x1dee(%rip), %rcx      # 0x8781
movl $0x11c, %edx            # imm = 0x11C
callq 0x3140
movq %rax, %rbx
callq 0x3390
movq %rbx, %rdi
callq 0x33c0
movq %rax, %rdi
callq 0x388d
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./ep.hh
// Function: kvtest::StoredValue::StoredValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const*, kvtest::StoredValue*)
StoredValue(std::string &k, const char *v, StoredValue *n) {
            key = k;
            value = NULL;
            setValue(v);
            dirty = true;
            next = n;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rdi, %r15
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movq %r14, %rdi
callq 0x3120
andq $0x0, 0x28(%r15)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6b08
movb $0x1, (%r15)
movq %rbx, 0x30(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x33c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/tests/multinet.cpp
// Function: CConnman::OnNeedOutgoingConnections[abi:cxx11](int)
std::list<CConnection> OnNeedOutgoingConnections(int need_count) final
    {
        std::list<CConnection> ret;
        if (!m_connections.empty())
            ret.splice(ret.end(), m_connections);
        return ret;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x10(%rsi), %rdx
cmpq %rdx, 0x10(%rsi)
je 0x4a65
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x4cc0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/tests/multinet.cpp
// Function: CConnman::OnOutgoingConnection(long, CConnection const&, CConnection const&)
bool OnOutgoingConnection(ConnID id, const CConnection& conn, const CConnection& resolved_conn) final
    {
        if (resolved_conn.GetNetConfig().message_start == mainnet_message_start)
            printf("mainnet connected first\n");
        else if (resolved_conn.GetNetConfig().message_start == testnet_message_start)
            printf("testnet connected first\n");
        Shutdown();
        return true;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x63f0
leaq 0x10(%rax), %rdi
leaq 0x16931(%rip), %rsi     # 0x1b3c8
callq 0x4d90
testb %al, %al
je 0x4aa9
leaq 0xb66f(%rip), %rdi      # 0x10116
jmp 0x4acc
movq %r14, %rdi
callq 0x63f0
leaq 0x10(%rax), %rdi
leaq 0x16924(%rip), %rsi     # 0x1b3e0
callq 0x4d90
testb %al, %al
je 0x4ad1
leaq 0xb632(%rip), %rdi      # 0x100fe
callq 0x4570
movq %rbx, %rdi
callq 0x6b6e
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnectionBase::GetSockAddr(sockaddr*, int*) const
bool CConnectionBase::GetSockAddr(sockaddr* paddr, int* addrlen) const
{
    if (!addr.empty() && (addrlen != nullptr) && static_cast<size_t>(*addrlen) >= addr.size()) {
        memcpy(paddr, &addr[0], addr.size());
        *addrlen = addr.size();
        return true;
    }
    return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %rdx
cmpq %rdx, %rax
sete %cl
testq %rbx, %rbx
sete %dil
orb %cl, %dil
jne 0x5d39
movslq (%rbx), %rcx
subq %rax, %rdx
cmpq %rcx, %rdx
jbe 0x5d3d
xorl %eax, %eax
jmp 0x5d54
movq %rsi, %rdi
movq %rax, %rsi
callq 0x42e0
movl 0x30(%r14), %eax
subl 0x28(%r14), %eax
movl %eax, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnectionBase::GetHost[abi:cxx11]() const
std::string CConnectionBase::GetHost() const
{
    if (isDns || isOnion)
        return host;

    std::string rethost;
    if (!addr.empty()) {
        std::array<char, NI_MAXHOST> hostbuf{};
        sockaddr_storage addr_stor;
        memset(&addr_stor, 0, sizeof(addr_stor));
        memcpy(&addr_stor, addr.data(), addr.size());
        if (getnameinfo(reinterpret_cast<sockaddr*>(&addr_stor), addr.size(), hostbuf.data(), hostbuf.size(), nullptr, 0, NI_NUMERICHOST) == 0)
            rethost.assign(hostbuf.data());
    }
    return rethost;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rdi, %rbx
cmpb $0x0, 0x22(%rsi)
jne 0x5d81
cmpb $0x1, 0x23(%rsi)
jne 0x5d9d
movq %rbx, %rdi
callq 0x44b0
movq %rbx, %rax
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x28(%rsi), %r12
movq 0x30(%rsi), %r14
cmpq %r14, %r12
je 0x5d89
leaq 0x9f(%rsp), %r15
movl $0x401, %edx            # imm = 0x401
movq %r15, %rdi
xorl %esi, %esi
callq 0x41e0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r13
movaps %xmm0, 0x70(%r13)
movaps %xmm0, 0x60(%r13)
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
subq %r12, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x42e0
movl $0x1, (%rsp)
movq %r13, %rdi
movl %r14d, %esi
movq %r15, %rdx
movl $0x401, %ecx            # imm = 0x401
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4240
testl %eax, %eax
jne 0x5d89
leaq 0x9f(%rsp), %rsi
movq %rbx, %rdi
callq 0x46f0
jmp 0x5d89
movq %rax, %r14
movq %rbx, %rdi
callq 0x41a0
movq %r14, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnectionBase::GetPort() const
unsigned short CConnectionBase::GetPort() const
{
    if (isDns || isOnion)
        return port;

    if (!addr.empty()) {
        std::array<char, NI_MAXSERV> servbuf{};
        sockaddr_storage addr_stor;
        memset(&addr_stor, 0, sizeof(addr_stor));
        memcpy(&addr_stor, addr.data(), addr.size());
        if (getnameinfo(reinterpret_cast<sockaddr*>(&addr_stor), addr.size(), nullptr, 0, servbuf.data(), servbuf.size(), NI_NUMERICSERV) == 0)
            return std::atoi(servbuf.data());
    }
    return 0;
}

// Assembly:
cmpb $0x0, 0x22(%rdi)
jne 0x5e6e
cmpb $0x1, 0x23(%rdi)
jne 0x5e73
movzwl 0x20(%rdi), %eax
retq
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq 0x28(%rdi), %rsi
movq 0x30(%rdi), %rbx
cmpq %rbx, %rsi
je 0x5ef7
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0x30(%rsp), %r15
movaps %xmm0, 0x70(%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
subq %rsi, %rbx
movq %r15, %rdi
movq %rbx, %rdx
callq 0x42e0
movl $0x2, (%rsp)
pushq $0x20
popq %r9
movq %r15, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x4240
testl %eax, %eax
je 0x5efb
xorl %eax, %eax
jmp 0x5f05
leaq 0x10(%rsp), %rdi
callq 0x4580
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnection::CanConnectDirect(sockaddr*, CConnectionOptions::Family)
bool CConnection::CanConnectDirect(sockaddr* sock, CConnectionOptions::Family family)
{
    assert(sock != nullptr);
#ifndef _WIN32
    if(sock->sa_family == AF_UNIX && (family & CConnectionOptions::UNIX) == CConnectionOptions::UNIX)
        return true;
#endif
    return (sock->sa_family == AF_INET && (family & CConnectionOptions::IPV4) == CConnectionOptions::IPV4) ||
           (sock->sa_family == AF_INET6 && (family & CConnectionOptions::IPV6) == CConnectionOptions::IPV6);
}

// Assembly:
testq %rdi, %rdi
je 0x6436
movzwl (%rdi), %ecx
cmpw $0x1, %cx
sete %dl
movl %esi, %edi
shrb $0x3, %dil
movb $0x1, %al
testb %dl, %dil
jne 0x6435
cmpw $0x2, %cx
sete %dl
movl %esi, %edi
shrb %dil
testb %dl, %dil
jne 0x6435
cmpw $0xa, %cx
sete %al
shrb $0x2, %sil
andb %al, %sil
movl %esi, %eax
retq
pushq %rax
leaq 0x9d3c(%rip), %rdi      # 0x1017a
leaq 0x9d45(%rip), %rsi      # 0x1018a
leaq 0x9d51(%rip), %rcx      # 0x1019d
movl $0x114, %edx            # imm = 0x114
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnection::CanConnectDirect() const
bool CConnection::CanConnectDirect() const
{
    if (!IsSet())
        return false;
    if (IsDNS())
        return false;
    if (IsOnion())
        return false;

    sockaddr_storage addr_stor;
    int socksize = sizeof(addr_stor);
    memset(&addr_stor, 0, socksize);
    sockaddr* sock = reinterpret_cast<sockaddr*>(&addr_stor);

    if (!GetSockAddr(sock, &socksize))
        return false;
    return CanConnectDirect(sock, opts.nFamily);
}

// Assembly:
cmpb $0x1, 0x24(%rdi)
jne 0x64c3
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x22(%rdi)
jne 0x64c6
cmpb $0x0, 0x23(%rbx)
jne 0x64c6
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movq %rbx, %rdi
callq 0x5d0a
testb %al, %al
je 0x64c6
movl 0x138(%rbx), %esi
leaq 0x10(%rsp), %rdi
callq 0x63f8
jmp 0x64c8
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnection::CanConnectProxy() const
bool CConnection::CanConnectProxy() const
{
    if (!IsSet())
        return false;
    if (!proxy.IsSet())
        return false;
    if (IsDNS())
        return opts.doResolve == CConnectionOptions::RESOLVE_CONNECT;
    if (IsOnion())
        return ((opts.nFamily & CConnectionOptions::ONION_PROXY) == CConnectionOptions::ONION_PROXY);

    sockaddr_storage addr_stor;
    int socksize = sizeof(addr_stor);
    memset(&addr_stor, 0, socksize);
    sockaddr* sock = reinterpret_cast<sockaddr*>(&addr_stor);

    if (!GetSockAddr(sock, &socksize))
        return false;
    return CanConnectDirect(sock, opts.nFamily);
}

// Assembly:
cmpb $0x1, 0x24(%rdi)
jne 0x64fe
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
cmpb $0x1, 0x84(%rdi)
jne 0x6564
cmpb $0x1, 0x22(%rbx)
jne 0x6501
cmpl $0x4, 0x114(%rbx)
sete %al
jmp 0x6566
xorl %eax, %eax
retq
cmpb $0x1, 0x23(%rbx)
jne 0x6514
movb 0x138(%rbx), %al
andb $0x10, %al
shrb $0x4, %al
jmp 0x6566
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movq %rbx, %rdi
callq 0x5d0a
testb %al, %al
je 0x6564
movl 0x138(%rbx), %esi
leaq 0x10(%rsp), %rdi
callq 0x63f8
jmp 0x6566
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::CConnectionHandlerInt(CConnectionHandler&, bool)
CConnectionHandlerInt::CConnectionHandlerInt(CConnectionHandler& handler, bool enable_threading)
    : m_interface(handler), m_connection_index(0), m_bytes_read(0), m_bytes_written(0), m_outgoing_conn_count(0), m_incoming_conn_count(0), m_outgoing_conn_limit(0), m_enable_threading(enable_threading), m_shutdown(false)
{
    bool result = true;
    if (m_enable_threading)
        result = setup_threads();
    assert(result);
    (void)result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
leaq 0x38(%rdi), %rax
andl $0x0, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movq %rax, 0x50(%rdi)
andq $0x0, 0x58(%rdi)
leaq 0x68(%rdi), %rax
andl $0x0, 0x68(%rdi)
andq $0x0, 0x70(%rdi)
movq %rax, 0x78(%rdi)
movq %rax, 0x80(%rdi)
andq $0x0, 0x88(%rdi)
leaq 0x98(%rdi), %rax
andl $0x0, 0x98(%rdi)
andq $0x0, 0xa0(%rdi)
movq %rax, 0xa8(%rdi)
movq %rax, 0xb0(%rdi)
andq $0x0, 0xb8(%rdi)
movq %rsi, 0xc0(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
movups %xmm0, 0xc8(%rdi)
andl $0x0, 0xe8(%rdi)
movb %dl, 0xec(%rdi)
movb $0x0, 0xed(%rdi)
addq $0xf0, %rdi
leaq 0x1a0(%rbx), %r15
movl $0xb0, %edx
xorl %esi, %esi
callq 0x41e0
movq %r15, %rdi
callq 0xf748
leaq 0x1c8(%rbx), %r12
movq %r12, %rdi
callq 0xf748
cmpb $0x1, 0xec(%rbx)
jne 0x7604
callq 0x43d0
testl %eax, %eax
jne 0x7613
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x91ea(%rip), %rdi      # 0x10804
leaq 0x91ea(%rip), %rsi      # 0x1080b
leaq 0x91f3(%rip), %rcx      # 0x1081b
pushq $0x25
popq %rdx
callq 0x4260
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0xf842
jmp 0x7644
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0xf842
jmp 0x7653
movq %rax, 0x8(%rsp)
leaq 0x198(%rbx), %rdi
leaq 0x190(%rbx), %r13
leaq 0x188(%rbx), %rbp
leaq 0x180(%rbx), %r14
leaq 0x178(%rbx), %r15
leaq 0x170(%rbx), %r12
leaq 0x90(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x30(%rbx), %rax
movq %rax, 0x20(%rsp)
callq 0x941c
movq %r13, %rdi
callq 0x942c
movq %rbp, %rdi
callq 0x943c
movq %r14, %rdi
callq 0x943c
movq %r15, %rdi
callq 0x944c
movq %r12, %rdi
callq 0x944c
movq 0x10(%rsp), %rdi
callq 0x982c
movq 0x18(%rsp), %rdi
callq 0x988c
movq 0x20(%rsp), %rdi
callq 0x98ec
movq %rbx, %rdi
callq 0x98ec
movq 0x8(%rsp), %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::RequestOutgoingInt()
void CConnectionHandlerInt::RequestOutgoingInt()
{
    assert(IsEventThread());
    size_t need = static_cast<size_t>(std::min(g_max_simultaneous_connecting, m_outgoing_conn_limit - m_outgoing_conn_count - static_cast<int>(m_connecting.size())));
    if (need > 0) {
        std::list<CConnection> conns(m_interface.OnNeedOutgoingConnections(need));
        auto end = conns.begin();
        std::advance(end, std::min(conns.size(), static_cast<size_t>(need)));
        for (auto it = conns.begin(); it != end; ++it) {
            if (it->IsSet())
                StartConnection(std::move(*it));
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x8016
testb %al, %al
je 0x7c44
movl 0xe0(%rbx), %ecx
movl 0xe8(%rbx), %eax
addl 0x58(%rbx), %ecx
subl %ecx, %eax
je 0x7c3a
cmpl $0x8, %eax
pushq $0x8
popq %rcx
cmovll %eax, %ecx
movslq %ecx, %r15
movq 0xc0(%rbx), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r15d, %edx
callq *0x10(%rax)
movq (%r14), %rax
movq 0x10(%r14), %rcx
movq %rsp, %rdi
movq %rax, (%rdi)
cmpq %r15, %rcx
cmovbq %rcx, %r15
movq %r15, %rsi
callq 0xa80d
movq (%r14), %r14
cmpq (%rsp), %r14
je 0x7c30
leaq 0x10(%r14), %r15
movq %r15, %rdi
callq 0x5f12
testb %al, %al
je 0x7c0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8cb2
jmp 0x7c0a
leaq 0x8(%rsp), %rdi
callq 0x4cf2
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8cce(%rip), %rdi      # 0x10919
leaq 0x8bb9(%rip), %rsi      # 0x1080b
leaq 0x9275(%rip), %rcx      # 0x10ece
movl $0x192, %edx            # imm = 0x192
callq 0x4260
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4cf2
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::IsEventThread() const
bool CConnectionHandlerInt::IsEventThread() const
{
#ifdef NO_THREADS
    return true;
#else
    if (!m_enable_threading)
        return true;
    return m_main_thread == std::this_thread::get_id();
#endif
}

// Assembly:
movb $0x1, %al
cmpb $0x1, 0xec(%rdi)
jne 0x8035
pushq %rbx
movq 0x168(%rdi), %rbx
callq 0x4320
cmpq %rax, %rbx
sete %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnResolveFailure(long, CConnection const&, int, bool)
void CConnectionHandlerInt::OnResolveFailure(ConnID id, const CConnection& conn, int /*error*/, bool retry)
{
    assert(IsEventThread());
    retry = retry && !m_shutdown;
    bool ret = m_interface.OnDnsFailure(conn, retry);
    auto it = m_dns_resolves.find(id);
    assert(it != m_dns_resolves.end());
    if (retry && ret)
        it->second->Retry();
    else
        m_dns_resolves.erase(it);
    if (m_request_event)
        m_request_event.active();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, (%rsp)
callq 0x8016
testb %al, %al
je 0x8196
movb 0xed(%rbx), %r15b
xorb $0x1, %r15b
andb %bpl, %r15b
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
movzbl %r15b, %edx
movq %r14, %rsi
callq *0x28(%rax)
movl %eax, %ebp
leaq 0x90(%rbx), %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x9e34
leaq 0x98(%rbx), %rcx
cmpq %rcx, %rax
je 0x81b5
andb %bpl, %r15b
cmpb $0x1, %r15b
jne 0x8165
movq 0x28(%rax), %rdi
callq 0xf2e0
jmp 0x8170
movq %r14, %rdi
movq %rax, %rsi
callq 0x9e6a
addq $0x1a0, %rbx            # imm = 0x1A0
movq %rbx, %rdi
callq 0xf87e
testb %al, %al
je 0x818b
movq %rbx, %rdi
callq 0xf8d0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x877c(%rip), %rdi      # 0x10919
leaq 0x8667(%rip), %rsi      # 0x1080b
leaq 0x889d(%rip), %rcx      # 0x10a48
movl $0xbe, %edx
callq 0x4260
leaq 0x88e1(%rip), %rdi      # 0x10a9d
leaq 0x8648(%rip), %rsi      # 0x1080b
leaq 0x887e(%rip), %rcx      # 0x10a48
movl $0xc2, %edx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnDisconnected(long, bool)
void CConnectionHandlerInt::OnDisconnected(ConnID id, bool reconnect)
{
    assert(IsEventThread());
    std::unique_ptr<ConnectionBase> moved;
    reconnect = reconnect && !m_shutdown;
    {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        assert(it != m_connected.end());
        moved.swap(it->second);
        m_connected.erase(it);
    }

    bool outgoing = moved->IsOutgoing();
    if (outgoing)
        m_outgoing_conn_count--;
    else
        m_incoming_conn_count--;

    bool ret = m_interface.OnDisconnected(id, reconnect);
    if (reconnect && ret) {
        ConnID newId = GetNextConnectionIndex();
        auto it = m_connecting.emplace_hint(m_connecting.end(), newId, std::move(moved));
        it->second->Retry(newId);
    } else if (m_request_event)
        m_request_event.active();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rdi, %r14
movq %rsi, 0x20(%rsp)
callq 0x8016
testb %al, %al
je 0x8364
andq $0x0, 0x8(%rsp)
movb 0xed(%r14), %r15b
leaq 0xf0(%r14), %rdi
movb 0xec(%r14), %al
movq %rdi, 0x10(%rsp)
movb %al, 0x18(%rsp)
cmpb $0x1, %al
jne 0x8274
callq 0x994c
xorl %ebx, %ebx
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x9e94
leaq 0x8(%r14), %rcx
cmpq %rcx, %rax
je 0x8383
movq 0x28(%rax), %rbx
movq %rbx, 0x8(%rsp)
andq $0x0, 0x28(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x9c10
leaq 0x10(%rsp), %rdi
callq 0x96b0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
xorb $0x1, %r15b
andb %bpl, %r15b
testb %al, %al
je 0x82d0
decl 0xe0(%r14)
jmp 0x82d7
decl 0xe4(%r14)
movq 0xc0(%r14), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
movzbl %r15b, %edx
callq *0x50(%rax)
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x8335
movq %r14, %rdi
callq 0x83e0
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x30(%r14), %rdi
addq $0x38, %r14
leaq 0x8(%rsp), %rcx
movq %r14, %rsi
callq 0x9eea
movq 0x28(%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0xc37c
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
jne 0x8350
jmp 0x8359
addq $0x1a0, %r14            # imm = 0x1A0
movq %r14, %rdi
callq 0xf87e
testb %al, %al
je 0x8350
movq %r14, %rdi
callq 0xf8d0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x85ae(%rip), %rdi      # 0x10919
leaq 0x8499(%rip), %rsi      # 0x1080b
leaq 0x877e(%rip), %rcx      # 0x10af7
movl $0xd3, %edx
callq 0x4260
leaq 0x87a6(%rip), %rdi      # 0x10b30
leaq 0x847a(%rip), %rsi      # 0x1080b
leaq 0x875f(%rip), %rcx      # 0x10af7
movl $0xd9, %edx
callq 0x4260
jmp 0x83a4
movq %rax, %r14
movq 0x8(%rsp), %rbx
jmp 0x83c9
movq %rax, %r14
xorl %ebx, %ebx
jmp 0x83c9
jmp 0x83b7
movq %rax, %r14
jmp 0x83ce
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x96b0
testq %rbx, %rbx
je 0x83d7
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnIncomingConnection(CConnection const&, int, sockaddr*, int)
void CConnectionHandlerInt::OnIncomingConnection(const CConnection& bind, evutil_socket_t sock, sockaddr* address, int socklen)
{
    assert(IsEventThread());

    ConnID id = GetNextConnectionIndex();
    std::unique_ptr<ConnectionBase> ptr(new CIncomingConn(*this, bind, id, sock, address, socklen));
    {
        auto it = m_connecting.emplace_hint(m_connecting.end(), id, std::move(ptr));
        it->second->Connect();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %r8d, %r12d
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x8016
testb %al, %al
je 0x84f9
movq %rbx, %rdi
callq 0x83e0
movq %rax, %r13
movq %rax, 0x18(%rsp)
movl $0x4b8, %edi            # imm = 0x4B8
callq 0x4360
movq %rax, %r14
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x6bee
movl %r12d, (%rsp)
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rcx
movl %ebp, %r8d
movq 0x10(%rsp), %r9
callq 0xf598
leaq 0x8(%rsp), %r15
movq %r14, (%r15)
leaq 0x20(%rsp), %rdi
callq 0x4d22
leaq 0x30(%rbx), %rdi
addq $0x38, %rbx
leaq 0x18(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x9eea
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x84e7
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8419(%rip), %rdi      # 0x10919
leaq 0x8304(%rip), %rsi      # 0x1080b
leaq 0x863a(%rip), %rcx      # 0x10b48
movl $0xef, %edx
callq 0x4260
jmp 0x851a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8549
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x8549
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4d22
jmp 0x8541
movq %rax, %rbx
movq %r14, %rdi
callq 0x4350
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnListenFailure(long, CConnection const&)
void CConnectionHandlerInt::OnListenFailure(ConnID id, const CConnection& bind)
{
    assert(IsEventThread());
    m_interface.OnBindFailure(bind);
    optional_lock(m_bind_mutex, m_enable_threading);
    m_binds.erase(id);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, 0x10(%rsp)
callq 0x8016
testb %al, %al
je 0x85bc
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
leaq 0x118(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, (%rsp)
movb %al, 0x8(%rsp)
cmpb $0x1, %al
jne 0x859b
callq 0x994c
addq $0x60, %rbx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xa14a
movq %rsp, %rdi
callq 0x96b0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x8356(%rip), %rdi      # 0x10919
leaq 0x8241(%rip), %rsi      # 0x1080b
leaq 0x85d3(%rip), %rcx      # 0x10ba4
movl $0xfb, %edx
callq 0x4260
movq %rax, %rbx
movq %rsp, %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnConnectionFailure(long, ConnectionFailureType, int, CConnection, bool)
void CConnectionHandlerInt::OnConnectionFailure(ConnID id, ConnectionFailureType type, int /*error*/, CConnection failed, bool retry)
{
    assert(IsEventThread());
    auto it = m_connecting.find(id);
    assert(it != m_connecting.end());
    auto ptr = std::move(it->second);
    m_connecting.erase(it);
    retry = retry && !m_shutdown;
    bool ret = false;

    if ((type & ConnectionFailureType::PROXY) != 0)
        ret = m_interface.OnProxyFailure(failed, retry);
    else if ((type & ConnectionFailureType::RESOLVE) != 0)
        ret = m_interface.OnDnsFailure(std::move(failed), retry);
    else
        ret = m_interface.OnConnectionFailure(failed, failed, retry);
    if (retry && ret) {
        ConnID newId = GetNextConnectionIndex();
        auto newit = m_connecting.emplace_hint(m_connecting.end(), newId, std::move(ptr));
        newit->second->Retry(newId);
    } else if (m_request_event)
        m_request_event.active();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %r12d
movq %r8, %rbx
movl %edx, %ebp
movq %rdi, %r14
movq %rsi, 0x20(%rsp)
callq 0x8016
testb %al, %al
je 0x8722
leaq 0x30(%r14), %r15
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x9e94
leaq 0x38(%r14), %rcx
cmpq %rcx, %rax
je 0x8741
movq %rbx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x28(%rax), %rbx
movq %rbx, (%rsp)
andq $0x0, 0x28(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x9c10
movb 0xed(%r14), %r13b
xorb $0x1, %r13b
andb %r12b, %r13b
testb $0x4, %bpl
jne 0x868e
movq 0xc0(%r14), %rdi
movq (%rdi), %rax
testb $0x2, %bpl
jne 0x869e
movzbl %r13b, %ecx
movq 0x8(%rsp), %rdx
movq %rdx, %rsi
callq *0x30(%rax)
jmp 0x86ad
movq 0xc0(%r14), %rdi
movq (%rdi), %rax
addq $0x38, %rax
jmp 0x86a2
addq $0x28, %rax
movzbl %r13b, %edx
movq 0x8(%rsp), %rsi
callq *(%rax)
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x86ea
movq %r14, %rdi
callq 0x83e0
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %rsp, %rcx
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x9eea
movq 0x28(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0xc37c
movq (%rsp), %rbx
jmp 0x8705
addq $0x1a0, %r14            # imm = 0x1A0
movq %r14, %rdi
callq 0xf87e
testb %al, %al
je 0x8705
movq %r14, %rdi
callq 0xf8d0
testq %rbx, %rbx
je 0x8713
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x81f0(%rip), %rdi      # 0x10919
leaq 0x80db(%rip), %rsi      # 0x1080b
leaq 0x84b6(%rip), %rcx      # 0x10bed
movl $0x103, %edx            # imm = 0x103
callq 0x4260
leaq 0x850c(%rip), %rdi      # 0x10c54
leaq 0x80bc(%rip), %rsi      # 0x1080b
leaq 0x8497(%rip), %rcx      # 0x10bed
movl $0x105, %edx            # imm = 0x105
callq 0x4260
jmp 0x8762
movq %rax, %r14
movq (%rsp), %rbx
jmp 0x8770
jmp 0x876d
movq %rax, %r14
testq %rbx, %rbx
je 0x877e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnIncomingConnected(long, CConnection const&, CConnection const&)
void CConnectionHandlerInt::OnIncomingConnected(ConnID id, const CConnection& conn, const CConnection& resolved_conn)
{
    assert(IsEventThread());
    DEBUG_PRINT(LOGVERBOSE, "id:", id);
    auto it = m_connecting.find(id);
    assert(it != m_connecting.end());
    std::unique_ptr<ConnectionBase> moved(nullptr);
    it->second.swap(moved);
    m_connecting.erase(it);

    if (!m_interface.OnIncomingConnection(id, conn, resolved_conn))
        return;
    moved->SetRateLimitGroup(m_incoming_rate_limit);
    moved->Enable();
    {
        optional_lock(m_conn_mutex, m_enable_threading);
        m_connected.emplace_hint(m_connected.end(), id, std::move(moved));
    }
    m_incoming_conn_count++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
callq 0x8016
testb %al, %al
je 0x887a
leaq 0x30(%rbx), %r13
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x9e94
leaq 0x38(%rbx), %rcx
cmpq %rcx, %rax
je 0x8899
movq 0x28(%rax), %r14
andq $0x0, 0x28(%rax)
movq %r14, (%rsp)
movq %r13, %rdi
movq %rax, %rsi
callq 0x9c10
movq 0xc0(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
movq %r12, %rdx
movq %r15, %rcx
callq *0x48(%rax)
testb %al, %al
je 0x885e
leaq 0x180(%rbx), %rsi
movq %r14, %rdi
callq 0xc5b2
movq %r14, %rdi
callq 0xc34e
leaq 0xf0(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x10(%rsp)
movb %al, 0x18(%rsp)
cmpb $0x1, %al
jne 0x8836
callq 0x994c
leaq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
callq 0x9eea
leaq 0x10(%rsp), %rdi
callq 0x96b0
incl 0xe4(%rbx)
movq (%rsp), %r14
testq %r14, %r14
je 0x886c
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x8098(%rip), %rdi      # 0x10919
leaq 0x7f83(%rip), %rsi      # 0x1080b
leaq 0x83de(%rip), %rcx      # 0x10c6d
movl $0x11b, %edx            # imm = 0x11B
callq 0x4260
leaq 0x83b4(%rip), %rdi      # 0x10c54
leaq 0x7f64(%rip), %rsi      # 0x1080b
leaq 0x83bf(%rip), %rcx      # 0x10c6d
movl $0x11e, %edx            # imm = 0x11E
callq 0x4260
jmp 0x88cd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x96b0
movq (%rsp), %r14
jmp 0x88d0
movq %rax, %rbx
testq %r14, %r14
je 0x88de
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnOutgoingConnected(long, CConnection const&, CConnection const&)
void CConnectionHandlerInt::OnOutgoingConnected(ConnID id, const CConnection& conn, const CConnection& resolved_conn)
{
    assert(IsEventThread());
    DEBUG_PRINT(LOGVERBOSE, "id:", id);
    auto it = m_connecting.find(id);
    assert(it != m_connecting.end());
    std::unique_ptr<ConnectionBase> moved(nullptr);
    it->second.swap(moved);
    m_connecting.erase(it);

    if (!m_interface.OnOutgoingConnection(id, conn, resolved_conn))
        return;
    moved->SetRateLimitGroup(m_outgoing_rate_limit);
    moved->Enable();
    {
        optional_lock(m_conn_mutex, m_enable_threading);
        m_connected.emplace_hint(m_connected.end(), id, std::move(moved));
    }
    m_outgoing_conn_count++;
    m_interface.OnReadyForFirstSend(id);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %rbx
movq %rsi, (%rsp)
callq 0x8016
testb %al, %al
je 0x89e9
leaq 0x30(%rbx), %r13
movq %rsp, %rsi
movq %r13, %rdi
callq 0x9e94
leaq 0x38(%rbx), %rcx
cmpq %rcx, %rax
je 0x8a08
movq 0x28(%rax), %r14
andq $0x0, 0x28(%rax)
movq %r14, 0x8(%rsp)
movq %r13, %rdi
movq %rax, %rsi
callq 0x9c10
movq 0xc0(%rbx), %rdi
movq (%rsp), %rsi
movq (%rdi), %rax
movq %r12, %rdx
movq %r15, %rcx
callq *0x40(%rax)
testb %al, %al
je 0x89cd
leaq 0x188(%rbx), %rsi
movq %r14, %rdi
callq 0xc5b2
movq %r14, %rdi
callq 0xc34e
leaq 0xf0(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x10(%rsp)
movb %al, 0x18(%rsp)
cmpb $0x1, %al
jne 0x8993
callq 0x994c
leaq 0x8(%rbx), %rsi
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x9eea
leaq 0x10(%rsp), %rdi
callq 0x96b0
incl 0xe0(%rbx)
movq 0xc0(%rbx), %rdi
movq (%rsp), %rsi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x8(%rsp), %r14
testq %r14, %r14
je 0x89db
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x7f29(%rip), %rdi      # 0x10919
leaq 0x7e14(%rip), %rsi      # 0x1080b
leaq 0x82d1(%rip), %rcx      # 0x10ccf
movl $0x130, %edx            # imm = 0x130
callq 0x4260
leaq 0x8245(%rip), %rdi      # 0x10c54
leaq 0x7df5(%rip), %rsi      # 0x1080b
leaq 0x82b2(%rip), %rcx      # 0x10ccf
movl $0x133, %edx            # imm = 0x133
callq 0x4260
jmp 0x8a38
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x96b0
jmp 0x8a3b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8a4b
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::Bind(CConnection)
bool CConnectionHandlerInt::Bind(CConnection conn)
{
    assert(IsEventThread());
    ConnID id = GetNextConnectionIndex();
    std::unique_ptr<CConnListener> listener(new CConnListener(*this, m_event_base, id, std::move(conn)));
    bool ret = listener->Bind();
    if (ret) {
        optional_lock(m_bind_mutex, m_enable_threading);
        auto it = m_binds.emplace_hint(m_binds.end(), id, std::move(listener));
        it->second->Enable();
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r15
movq %rdi, %rbx
callq 0x8016
testb %al, %al
je 0x8c56
movq %rbx, %rdi
callq 0x83e0
movq %rax, %r12
movq %rax, 0x18(%rsp)
movl $0x198, %edi            # imm = 0x198
callq 0x4360
movq %rax, %r14
leaq 0x190(%rbx), %r13
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x9720
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0xebac
movq %r14, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x4d22
movq %r14, %rdi
callq 0xec1e
movl %eax, %ebp
testb %al, %al
je 0x8c3a
leaq 0x118(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x8c0f
callq 0x994c
leaq 0x60(%rbx), %rdi
addq $0x68, %rbx
leaq 0x18(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rsi
callq 0xa2de
movq 0x28(%rax), %rdi
callq 0xed6a
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rsp, %rdi
callq 0x9786
movl %ebp, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7cbc(%rip), %rdi      # 0x10919
leaq 0x7ba7(%rip), %rsi      # 0x1080b
leaq 0x816c(%rip), %rcx      # 0x10dd7
movl $0x15c, %edx            # imm = 0x15C
callq 0x4260
jmp 0x8c88
jmp 0x8c79
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
jmp 0x8c8b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9786
jmp 0x8caa
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4d22
movq %r14, %rdi
callq 0x4350
movq %rbx, %rdi
callq 0x4660