LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::cancel(void const*)
void DNSResolver::cancel(const void *context) {
    for (auto it: active) {
        if (it.second->ctx == context) {
            ongoing.erase(std::make_pair(it.second->name, it.second->qtype));
            delete it.second;
            active.erase(it.first);
            assert(active.size() == ongoing.size());
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x48fb
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
movups 0x8(%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rsp), %rbp
cmpq %rsi, 0x30(%rbp)
je 0x4868
movq (%rax), %rax
testq %rax, %rax
jne 0x4848
jmp 0x48fb
leaq 0x70(%rbx), %r15
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x3c70
movzwl 0xc(%rbp), %eax
movw %ax, 0x20(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x7cf0
movq %r15, %rdi
movq %rax, %rsi
callq 0x7dbc
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x48c4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0x48e3
movq %r15, %rdi
callq 0x6ff2
movl $0x78, %esi
movq %r15, %rdi
callq 0x32b0
movq %rsp, %rsi
movq %r14, %rdi
callq 0x7e60
movq 0x50(%rbx), %rax
cmpq 0x98(%rbx), %rax
jne 0x490a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67a7(%rip), %rdi      # 0xb0b8
leaq 0x67c0(%rip), %rsi      # 0xb0d8
leaq 0x67c2(%rip), %rcx      # 0xb0e1
movl $0x124, %edx            # imm = 0x124
callq 0x31b0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x4943
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x3400
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::call_user_rec(Query*, dns_error)
void DNSResolver::call_user_rec(Query *q, enum dns_error err) {
    // If this query has dependencies don't report it
    for (auto de: q->deps)
        call_user_rec(de, err);

    call_user(this, q->name, q->qtype, NULL, q->callback, q->ctx, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq 0x58(%rsi), %r12
leaq 0x48(%rsi), %r13
cmpq %r13, %r12
je 0x4fb9
movq %rdi, %r15
movq 0x20(%r12), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x4f78
movq %r12, %rdi
callq 0x3300
movq %rax, %r12
cmpq %r13, %rax
jne 0x4f9a
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0x3c70
movzwl 0xc(%r14), %esi
movq 0x30(%r14), %r8
movq 0x38(%r14), %rcx
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r9d
callq 0x5038
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x5009
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x5030
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x3400
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: call_user(DNSResolver*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned short, cache_entry const*, void (*)(dns_cb_data*), void*, dns_error)
static void
call_user(DNSResolver *dns, std::string name, uint16_t qtype, 
          const struct cache_entry *entry, dns_callback_t cb, void *ctx, enum dns_error error)
{
    struct dns_cb_data cbd;
    cbd.context = ctx;
    cbd.query_type = (enum dns_record_type) qtype;
    cbd.error = error;
    cbd.name = name;

    if (entry)
        cbd.replies = entry->replies;

    if (cb)
        cb(&cbd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %rax
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %ecx, %ecx
movq %rcx, -0x8(%r12)
movb $0x0, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq %rcx, 0x20(%r12)
movq %r8, -0x20(%r12)
movl %esi, -0x14(%r12)
movl %r9d, -0x18(%r12)
movq %rax, %rsi
callq 0x3170
leaq 0x30(%rsp), %r15
testq %r14, %r14
je 0x50a1
movq %r15, %rdi
movq %r14, %rsi
callq 0x3a6a
testq %rbx, %rbx
je 0x50ab
movq %rsp, %rdi
callq *%rbx
movq %r15, %rdi
callq 0x3b82
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x50ca
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x72da
movq %rbx, %rdi
callq 0x3400
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::createQuery(unsigned int, void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, dns_record_type, void (*)(dns_cb_data*))
Query * DNSResolver::createQuery(unsigned niter, void *ctx, std::string name,
                    enum dns_record_type qtype, dns_callback_t callback) {

    std::transform(name.begin(), name.end(), name.begin(), ::tolower);

    time_t now = time(NULL);
    Query * query = new Query();
    query->ctx = ctx;
    query->qtype = (uint16_t) qtype;
    query->callback = callback;
    query->atimeout = now + this->atimeout;
    query->niter = niter + 1;
    query->name = name;

    return query;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0x4(%rsp)
movq %rcx, %rbx
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, 0x8(%rsp)
movq 0x8(%rcx), %r14
testq %r14, %r14
je 0x677a
movq (%rbx), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x3390
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r14
jne 0x6764
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x3260
movq %rax, %r15
movl $0x78, %edi
callq 0x32a0
movq %rax, %r14
movl %r12d, 0x8(%rax)
leaq 0x10(%rax), %rdi
addq $0x20, %rax
movq %rax, 0x10(%r14)
movq %r12, 0x18(%r14)
movb $0x0, 0x20(%r14)
leaq 0x48(%r14), %rax
movl %r12d, 0x48(%r14)
movq %r12, 0x50(%r14)
movq %rax, 0x58(%r14)
movq %rax, 0x60(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%r14)
movq %r13, 0x30(%r14)
movl 0x4(%rsp), %eax
movw %ax, 0xc(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x38(%r14)
movq 0x8(%rsp), %rax
movl 0xd0(%rax), %eax
addq %r15, %rax
movq %rax, (%r14)
incl %ebp
movl %ebp, 0x8(%r14)
movq %rbx, %rsi
callq 0x3170
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::getNewTid()
uint16_t DNSResolver::getNewTid() {
    while(1) {
        uint16_t n = ++tidseq;
        if (active.count(n) == 0)
            return n;
        std::cout << "Dup!" << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
leaq 0x6(%rsp), %r15
movq 0x9562(%rip), %r12      # 0xffd0
movl 0x10(%rbx), %eax
incl %eax
movw %ax, 0x10(%rbx)
movw %ax, 0x6(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7b6a
movq %rax, %r13
testq %rax, %rax
je 0x6acd
movl $0x4, %edx
movq %r12, %rdi
leaq 0x4744(%rip), %rsi      # 0xb1e2
callq 0x32f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
jmp 0x6ad2
movzwl 0x6(%rsp), %ebp
testq %r13, %r13
jne 0x6a6e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::DNSResolver(std::__cxx11::list<sockaddr_storage, std::allocator<sockaddr_storage>>, unsigned int)
DNSResolver(std::list<struct sockaddr_storage> serverbundle, unsigned atimeout)
      : pkts_dns_servers(0), pkts_auth_servers(0), dns_servers(serverbundle), atimeout(atimeout) {
        this->sock4 = socket(PF_INET,  SOCK_DGRAM, 17);
        this->sock6 = socket(PF_INET6, SOCK_DGRAM, 17);
        /* Make it non blocking */
        nonblock(sock4);
        nonblock(sock6);
        /* Increase socket's receive buffer */
        int rcvbufsiz = 128 * 1024;
        (void) setsockopt(sock4, SOL_SOCKET, SO_RCVBUF,
            (char *) &rcvbufsiz, sizeof(rcvbufsiz));
        (void) setsockopt(sock6, SOL_SOCKET, SO_RCVBUF,
            (char *) &rcvbufsiz, sizeof(rcvbufsiz));
        tidseq = 0;
        active.rehash(MAX_CACHE_ENTRIES*2);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r14
leaq 0x8f6d(%rip), %rax      # 0xfd50
movq %rax, (%rdi)
xorl %r12d, %r12d
movq %r12, 0x14(%rdi)
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x6d7c
leaq 0x38(%r14), %r15
leaq 0x68(%r14), %rax
movq %rax, 0x38(%r14)
movq $0x1, 0x40(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r14)
movl $0x3f800000, 0x58(%r14) # imm = 0x3F800000
movups %xmm0, 0x60(%r14)
leaq 0x78(%r14), %rax
movl %r12d, 0x78(%r14)
movq %r12, 0x80(%r14)
movq %rax, 0x88(%r14)
movq %rax, 0x90(%r14)
movq %r12, 0x98(%r14)
leaq 0xa8(%r14), %rax
movl %r12d, 0xa8(%r14)
movq %r12, 0xb0(%r14)
movq %rax, 0xb8(%r14)
movq %rax, 0xc0(%r14)
movq %r12, 0xc8(%r14)
movl %ebp, 0xd0(%r14)
movl $0x2, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x30d0
movl %eax, 0x8(%r14)
movl $0xa, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x30d0
movl %eax, 0xc(%r14)
movl 0x8(%r14), %edi
callq 0xa031
movl 0xc(%r14), %edi
callq 0xa031
leaq 0x4(%rsp), %r12
movl $0x20000, (%r12)        # imm = 0x20000
movl 0x8(%r14), %edi
movl $0x1, %esi
movl $0x8, %edx
movq %r12, %rcx
movl $0x4, %r8d
callq 0x3410
movl 0xc(%r14), %edi
movl $0x1, %esi
movl $0x8, %edx
movq %r12, %rcx
movl $0x4, %r8d
callq 0x3410
movw $0x0, 0x10(%r14)
movl $0x20000, %esi          # imm = 0x20000
movq %r15, %rdi
callq 0x7472
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6f23
movq %rax, %r12
leaq 0x70(%r14), %r13
addq $0xa0, %r14
movq %r14, %rdi
callq 0x765c
movq %r13, %rdi
callq 0x76e0
movq %r15, %rdi
callq 0x7758
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x6f66
movq (%rdi), %r14
movl $0x90, %esi
callq 0x32b0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x6f51
movq %r12, %rdi
callq 0x3400
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::~DNSResolver()
~DNSResolver() {
        if (sock4 != -1)
            (void) closesocket(sock4);
        if (sock6 != -1)
            (void) closesocket(sock6);

        for (auto it: active)
            delete it.second;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x89a2(%rip), %rax      # 0xfd50
movq %rax, (%rdi)
movl 0x8(%rdi), %edi
cmpl $-0x1, %edi
je 0x73be
callq 0x3470
movl 0xc(%rbx), %edi
cmpl $-0x1, %edi
je 0x73cb
callq 0x3470
leaq 0x38(%rbx), %r14
movq 0x48(%rbx), %r12
testq %r12, %r12
je 0x73fd
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x73f7
movq %r15, %rdi
callq 0x6ff2
movl $0x78, %esi
movq %r15, %rdi
callq 0x32b0
movq (%r12), %r12
jmp 0x73d3
leaq 0xa0(%rbx), %rdi
callq 0x765c
leaq 0x70(%rbx), %rdi
callq 0x76e0
movq %r14, %rdi
callq 0x7758
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x743c
movq (%rdi), %r14
movl $0x90, %esi
callq 0x32b0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x7427
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x3c0d
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns_common.cc
// Function: fetch(unsigned char const*, unsigned char const*, int, char*, int)
unsigned fetch(const uint8_t *pkt, const uint8_t *s, int pktsiz, char *dst, int dstlen) {
    const uint8_t *e = pkt + pktsiz;
    unsigned skip = 0;
    bool labelj = false;
    int j, i = 0, n = 0;

    while (*s != 0 && s < e) {
        if (n > 0)
            dst[i++] = '.';

        if (i >= dstlen)
            break;

        if (((n = *s++) & 0xc0) == 0xc0) {
            s = pkt + (((n&3) << 8) | *s);    /* New offset */
            n = 0;
            if (!labelj)
                skip += 2;
            labelj = true;
        } else {
            if (!labelj)
                skip += std::min(n, dstlen - i) + 1;
            for (j = 0; j < n && i < dstlen; j++)
                dst[i++] = *s++;
        }
    }

    dst[i] = '\0';
    return skip + (labelj ? 0 : 1);
}

// Assembly:
movslq %edx, %rax
addq %rdi, %rax
cmpb $0x0, (%rsi)
setne %dl
cmpq %rsi, %rax
seta %r9b
andb %dl, %r9b
xorl %edx, %edx
cmpb $0x1, %r9b
jne 0x966a
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %r8d, %r11
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x95ae
movslq %edx, %rbx
incl %edx
movb $0x2e, (%rcx,%rbx)
movl %r8d, %r15d
subl %edx, %r15d
jle 0x964f
leaq 0x1(%rsi), %r14
movzbl (%rsi), %ebx
movl %ebx, %ebp
notl %ebp
testb $-0x40, %bpl
jne 0x95f0
andl $0x3, %ebx
shll $0x8, %ebx
movzbl (%r14), %esi
orl %ebx, %esi
addq %rdi, %rsi
leal 0x2(%r10), %ebp
testb $0x1, %r9b
cmovnel %r10d, %ebp
movb $0x1, %r9b
xorl %ebx, %ebx
movl %ebp, %r10d
jmp 0x9641
testb $0x1, %r9b
jne 0x9603
cmpl %ebx, %r15d
cmovgel %ebx, %r15d
addl %r15d, %r10d
incl %r10d
testl %ebx, %ebx
je 0x963e
cmpl %edx, %r8d
jle 0x963e
movslq %edx, %r15
incq %r15
movl $0x1, %r14d
movb (%rsi,%r14), %bpl
movb %bpl, -0x1(%rcx,%r15)
movl %r14d, %ebp
incl %edx
incq %r14
cmpl %ebx, %ebp
jae 0x9639
leaq 0x1(%r15), %r12
cmpq %r11, %r15
movq %r12, %r15
jl 0x9618
addq %r14, %rsi
jmp 0x9641
movq %r14, %rsi
cmpb $0x0, (%rsi)
je 0x964f
cmpq %rax, %rsi
jb 0x95a1
movslq %edx, %rdx
notb %r9b
andb $0x1, %r9b
movzbl %r9b, %eax
addl %r10d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x966f
movl $0x1, %eax
movb $0x0, (%rcx,%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns_common.cc
// Function: serializeName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned char*)
unsigned serializeName(std::string dom, uint8_t *out) {
    uint8_t * oout = out;
    unsigned off = 0;
    while (off < dom.size()) {
        auto s = dom.find('.', off);
        unsigned l = (s != std::string::npos) ? s - off : dom.size() - off;
        unsigned a = (s != std::string::npos) ? l + 1 : l;

        *out++ = l;
        memcpy(out, &dom[off], l);
        out += l;
        off += a;
    }
    *out++ = 0;

    return out - oout;  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
cmpq $0x0, 0x8(%rdi)
movq %rsi, 0x10(%rsp)
je 0x9d5d
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x10(%rsp), %r14
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movl $0x2e, %esi
movq %r15, %rdx
callq 0x3350
movq %rax, %rbp
cmpq $-0x1, %rax
jne 0x9d20
movq 0x8(%rbx), %rbp
xorl %r12d, %r12d
cmpq $-0x1, %rax
setne %r12b
movl %ebp, %r13d
subl 0xc(%rsp), %r13d
leaq 0x1(%r14), %rdi
movb %r13b, (%r14)
addq (%rbx), %r15
movq %r15, %rsi
movq %r13, %rdx
callq 0x3230
addq %r13, %r14
incq %r14
addl %ebp, %r12d
movq %r12, %r15
movl %r12d, %eax
cmpq %r12, 0x8(%rbx)
ja 0x9cff
movb $0x0, (%r14)
subl 0x10(%rsp), %r14d
incl %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns_common.cc
// Function: serialize_answer(dns_record const*, unsigned char*)
unsigned serialize_answer(const struct dns_record *rec, uint8_t *out) {
    uint8_t * oout = out;

    bool namec = (rec->rtype == DNS_MX_RECORD || 
                  rec->rtype == DNS_NS_RECORD ||
                  rec->rtype == DNS_CNAME_RECORD);

    // Getting the size is a bit convoluted depending on type and the domain itself
    unsigned dlen = namec ? (rec->addr.size() ? rec->addr.size() + 2 : 1) : rec->addr.size();

    // Name goes first
    out += serializeName(rec->name, out);

    ((uint16_t*)out)[0] = htons(rec->rtype);
    ((uint16_t*)out)[1] = htons(0x0001);  // Assuming Internet yo!
    ((uint32_t*)out)[1] = htonl(rec->ttl);
    ((uint16_t*)out)[4] = htons(dlen);
    out += 10;

    if (namec) {
        out += serializeName(rec->addr, out);
    } else {
        memcpy(out, rec->addr.data(), rec->addr.size());
        out += rec->addr.size();
    }

    return out - oout;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r15
movl (%rdi), %ecx
cmpl $0x10, %ecx
setb %al
movl $0x8024, %ebp           # imm = 0x8024
shrl %cl, %ebp
movq %rsi, %rbx
andb %al, %bpl
movq 0x30(%rdi), %rax
leaq 0x2(%rax), %rcx
testq %rax, %rax
movl $0x1, %r13d
cmovneq %rcx, %r13
testb %bpl, %bpl
cmoveq %rax, %r13
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3c70
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9cd5
movl %eax, %r14d
movq %rbx, (%rsp)
addq %rbx, %r14
movq (%r12), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9e0e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32b0
movzwl (%r15), %eax
rolw $0x8, %ax
movw %ax, (%r14)
movw $0x100, 0x2(%r14)       # imm = 0x100
movl 0x48(%r15), %eax
bswapl %eax
rolw $0x8, %r13w
movl %eax, 0x4(%r14)
movw %r13w, 0x8(%r14)
addq $0xa, %r14
testb %bpl, %bpl
je 0x9e84
leaq 0x38(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x3c70
movq %r15, %rdi
movq %r14, %rsi
callq 0x9cd5
movl %eax, %r12d
movq (%r15), %rdi
cmpq %rbx, %rdi
je 0x9e98
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x9e98
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
movq %r14, %rdi
callq 0x3230
movq 0x30(%r15), %r12
addl %r12d, %r14d
subl (%rsp), %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidgfnet[P]tadns/tadns_common.cc
// Function: serialize_udp_packet(dns_packet*, unsigned char*)
unsigned serialize_udp_packet(struct dns_packet *in, uint8_t *out) {
    uint8_t *oout = out;
    const uint8_t *e = out + DNS_PACKET_LEN;
    struct header *h = (struct header*)out;

    h->tid      = htons(in->header.tid);
    h->flags    = htons(in->header.flags);
    h->nqueries = htons(in->header.nqueries);
    h->nanswers = htons(in->header.nanswers);
    h->nauth    = htons(in->header.nauth);
    h->nother   = htons(in->header.nother);

    out = &h->data[0];

    for (const auto &q: in->questions) {
        unsigned s = serializeName(q.name, out);
        out += s;

        if (out + 4 >= e) return 0;

        ((uint16_t*)out)[0] = htons(q.qtype);
        ((uint16_t*)out)[1] = htons(q.qclass);
        out += 4;
    }

    for (unsigned i = 0; i < RESPONSE_LAST; i++) {
        for (const auto &r: in->answers) {
            if (r.resptype == i) {
                out += serialize_answer(&r, out);
            }
        }
    }

    return out - oout;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movzwl (%rdi), %eax
rolw $0x8, %ax
movw %ax, (%rsi)
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
movzwl 0x4(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0x4(%rsi)
movzwl 0x6(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0x6(%rsi)
movzwl 0x8(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0x8(%rsi)
movzwl 0xa(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0xa(%rsi)
movq 0x10(%rdi), %r13
movq %rdi, 0x10(%rsp)
movq 0x18(%rdi), %rcx
movq %rsi, (%rsp)
leaq 0xc(%rsi), %r15
movq %rcx, 0x8(%rsp)
cmpq %rcx, %r13
sete %r12b
je 0x9fdb
movl $0xc, %ebx
leaq 0x28(%rsp), %r14
movq %r14, 0x18(%rsp)
movq 0x8(%r13), %rsi
movq 0x10(%r13), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c70
movq %rbp, %rdi
movq %r15, %rsi
callq 0x9cd5
movl %eax, %ebp
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x9f77
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32b0
movl %ebp, %eax
addq %rax, %rbx
movq %rbx, %rax
cmpq $0x7fb, %rbx            # imm = 0x7FB
jg 0x9fab
leaq 0x4(%rbx), %rax
movzwl (%r13), %ecx
rolw $0x8, %cx
movq (%rsp), %rdx
movw %cx, (%rdx,%rbx)
movzwl 0x2(%r13), %ecx
rolw $0x8, %cx
movw %cx, 0x2(%rdx,%rbx)
cmpq $0x7fc, %rbx            # imm = 0x7FC
jge 0x9fd4
addq $0x28, %r13
movq (%rsp), %rcx
leaq (%rcx,%rax), %r15
movq %rax, %rbx
cmpq 0x8(%rsp), %r13
sete %r12b
jne 0x9f31
jmp 0x9fdb
addq (%rsp), %rax
movq %rax, %r15
xorl %eax, %eax
testb $0x1, %r12b
je 0xa022
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq 0x28(%rax), %r12
movq 0x30(%rax), %r13
cmpq %r13, %r12
je 0xa014
cmpl %ebx, 0x4(%r12)
jne 0xa00e
movq %r12, %rdi
movq %r15, %rsi
callq 0x9d7b
movl %eax, %eax
addq %rax, %r15
addq $0x50, %r12
jmp 0x9ff2
incl %ebx
cmpl $0x3, %ebx
jne 0x9fe5
subl (%rsp), %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/img2img/img2img.cpp
// Function: main
int main(int argc, char **argv)
{
  // Check arguments
  if (argc != 3) {
    RNFail("Usage: img2img inputfile outputfile\n");
    return 1;
  }

  // Read and write image file 
  R2Image image;
  if (!image.Read(argv[1])) return -1;
  if (!image.Write(argv[2])) return -1;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpl $0x3, %edi
jne 0x35db
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x361c
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x3640
testl %eax, %eax
je 0x35f0
movq 0x10(%rbx), %rsi
movq %rsp, %rdi
callq 0x5778
xorl %ebx, %ebx
cmpl $0x1, %eax
sbbl %ebx, %ebx
jmp 0x35f5
leaq 0x33a22(%rip), %rdi     # 0x37004
xorl %eax, %eax
callq 0x6d0a
movl $0x1, %ebx
jmp 0x35fd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rsp, %rdi
callq 0x3ba6
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3ba6
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::Reader(std::istream&, unsigned long, unsigned long)
Reader::Reader(std::istream &istream, size_t buffer_capacity,
               size_t buffer_count)
    : m_buffer_count(buffer_count), m_buffer_capacity(buffer_capacity),
      m_istream(istream), m_buffers(buffer_count),
      m_buffer_index(buffer_count - 1), m_buffer_offset(buffer_capacity),
      m_buffer_size(buffer_capacity)
{
    for (size_t i = 0; i < m_buffer_count; ++i) {
        try {
            m_buffers[i] = std::shared_ptr<char[]>(new char[m_buffer_capacity]);
        } catch (const std::bad_alloc &e) {
            throw Error("cannot allocate buffer for input stream data");
        }
    }

    refill_next_buffer();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdx, %r15
movq %rdi, %r14
leaq 0x8306(%rip), %rax      # 0xbb00
movq %rax, (%rdi)
movq %rcx, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
movq %rsp, %rdx
movq %rbx, %rdi
movq %rcx, %rsi
callq 0x4034
decq %r12
movq %r12, 0x38(%r14)
movq %r15, 0x40(%r14)
movq %r15, 0x48(%r14)
cmpq $0x0, 0x8(%r14)
je 0x3895
movl $0x8, %r12d
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
movq 0x10(%r14), %rdi
callq 0x3030
movq %rax, (%rsp)
movq %r15, %rdi
movq %rax, %rsi
callq 0x426e
movq (%rbx), %rax
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq (%rax,%r12), %rdi
movups %xmm0, -0x8(%rax,%r12)
testq %rdi, %rdi
je 0x3879
callq 0x413a
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3888
callq 0x413a
incq %r13
addq $0x10, %r12
cmpq 0x8(%r14), %r13
jb 0x383f
movq %r14, %rdi
callq 0x3978
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x3960
movq %rax, %r15
jmp 0x3968
movq %rax, %r15
cmpl $0x1, %edx
jne 0x3960
movq %r15, %rdi
callq 0x30f0
movl $0x10, %edi
callq 0x3130
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4732(%rip), %rsi      # 0x8020
leaq 0x4757(%rip), %rdx      # 0x804c
movq %rsp, %rdi
callq 0x41c2
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x32d0
leaq 0x827e(%rip), %rax      # 0xbb90
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x820a(%rip), %rsi      # 0xbb28
movq 0x868b(%rip), %rdx      # 0xbfb0
movq %r14, %rdi
callq 0x3360
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x394e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3240
jmp 0x394e
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x395b
movq %r14, %rdi
callq 0x3190
callq 0x3350
movq %rbx, %rdi
callq 0x40b8
movq %r15, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x40ac
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::refill_next_buffer()
void
Reader::refill_next_buffer()
{
    if (m_buffer_size == 0) {
        // Current buffer is the last one. Don't fill the next one.
        return;
    }

    // Current buffer must be completely read before filling the next one
    assert(m_buffer_offset == m_buffer_size);

    m_buffer_index = (m_buffer_index + 1) % m_buffer_count;
    auto buf = m_buffers[m_buffer_index];
    // Buffer for new data must not in use
    assert(buf.use_count() == 2);

    m_buffer_size = read_stream(buf, m_buffer_capacity);
    m_buffer_offset = 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x3a43
movq %rdi, %r14
cmpq %rax, 0x40(%rdi)
jne 0x3a6a
movq 0x20(%r14), %rcx
movq 0x38(%r14), %rax
incq %rax
xorl %edx, %edx
divq 0x8(%r14)
movq %rdx, 0x38(%r14)
shlq $0x4, %rdx
movq 0x8(%rcx,%rdx), %rbx
testq %rbx, %rbx
je 0x3a4b
movq (%rcx,%rdx), %rcx
movq 0x85f5(%rip), %rax      # 0xbfc0
cmpb $0x0, (%rax)
je 0x39d5
incl 0x8(%rbx)
jmp 0x39d9
lock
incl 0x8(%rbx)
testq %rbx, %rbx
je 0x3a4b
movl 0x8(%rbx), %edx
cmpl $0x2, %edx
jne 0x3a4b
movq %rcx, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x3a03
cmpb $0x0, (%rax)
je 0x39ff
incl 0x8(%rbx)
jmp 0x3a03
lock
incl 0x8(%rbx)
movq 0x10(%r14), %rdx
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x3c6a
movq %rax, 0x48(%r14)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a27
callq 0x413a
movq $0x0, 0x40(%r14)
testq %rbx, %rbx
je 0x3a43
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x413a
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x46ed(%rip), %rdi      # 0x813f
leaq 0x4608(%rip), %rsi      # 0x8061
leaq 0x46ad(%rip), %rcx      # 0x810d
movl $0x84, %edx
callq 0x3160
leaq 0x467b(%rip), %rdi      # 0x80ec
leaq 0x45e9(%rip), %rsi      # 0x8061
leaq 0x468e(%rip), %rcx      # 0x810d
movl $0x7f, %edx
callq 0x3160
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a9b
callq 0x413a
testq %rbx, %rbx
je 0x3aa8
movq %rbx, %rdi
callq 0x413a
movq %r14, %rdi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::read(unsigned long, char*)
size_t
Reader::read(size_t data_size, char *dest_buf)
{
    size_t retry_count{0};
    size_t offset{0};
    size_t to_read{data_size};

    while ((to_read > 0) && (retry_count < 2)) {
        const DataPart dp{readMultipart(to_read)};
        if (dp.size == 0) {
            ++retry_count;
            continue;
        }

        retry_count = 0;
        memcpy(dest_buf + offset, dp.data.get(), dp.size);
        offset += dp.size;
        to_read -= dp.size;
    }

    assert(offset <= data_size);
    return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
movq %rsi, 0x8(%rsp)
je 0x3b2c
movq %rdx, %r15
movq %rdi, %r12
xorl %r14d, %r14d
movq %rsi, %rbp
xorl %r13d, %r13d
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3b68
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x3b0d
leaq (%r15,%r14), %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x31c0
addq %rbx, %r14
subq %rbx, %rbp
xorl %r13d, %r13d
jmp 0x3b10
incq %r13
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3b1f
callq 0x413a
testq %rbp, %rbp
je 0x3b2f
cmpq $0x2, %r13
jb 0x3ad7
jmp 0x3b2f
xorl %r14d, %r14d
cmpq 0x8(%rsp), %r14
ja 0x3b48
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44fe(%rip), %rdi      # 0x804d
leaq 0x450b(%rip), %rsi      # 0x8061
leaq 0x4518(%rip), %rcx      # 0x8075
movl $0x4d, %edx
callq 0x3160
nop
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::readMultipart(unsigned long)
DataPart
Reader::readMultipart(size_t data_size)
{
    const size_t size_left{m_buffer_size - m_buffer_offset};
    if (size_left == 0) {
        refill_next_buffer();
        if (m_buffer_size == 0) {
            return DataPart{.size = 0, .data = std::shared_ptr<char[]>()};
        }
    }
    // There is at least one byte in the buffer
    const DataPart dp{read_current_buffer(data_size)};
    assert(dp.size > 0);
    return dp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x48(%rsi), %rax
cmpq 0x40(%rsi), %rax
jne 0x3b8f
movq %r15, %rdi
callq 0x3978
cmpq $0x0, 0x48(%r15)
je 0x3bac
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3bdc
cmpq $0x0, (%rbx)
je 0x3bbc
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x3ba3
leaq 0x44e6(%rip), %rdi      # 0x80a9
leaq 0x4497(%rip), %rsi      # 0x8061
leaq 0x44e4(%rip), %rcx      # 0x80b5
movl $0x5d, %edx
callq 0x3160
nop
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::read_current_buffer(unsigned long)
DataPart
Reader::read_current_buffer(size_t data_size)
{
    DataPart dp;

    // Set data
    if (m_buffer_offset == 0) {
        dp.data = std::shared_ptr<char[]>{m_buffers[m_buffer_index]};
    } else {
        dp.data = std::shared_ptr<char[]>{
            m_buffers[m_buffer_index],
            static_cast<char *>(m_buffers[m_buffer_index].get()) +
                m_buffer_offset};
    }

    const size_t size_left{m_buffer_size - m_buffer_offset};
    dp.size = std::min(data_size, size_left);
    m_buffer_offset += dp.size;
    return dp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq 0x40(%rsi), %rcx
movq 0x20(%rsi), %rax
movq 0x38(%rsi), %rsi
shlq $0x4, %rsi
leaq (%rax,%rsi), %rdx
movq (%rax,%rsi), %rax
testq %rcx, %rcx
je 0x3c11
addq %rcx, %rax
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x3c2f
movq 0x839f(%rip), %rdx      # 0xbfc0
cmpb $0x0, (%rdx)
je 0x3c2b
incl 0x8(%rcx)
jmp 0x3c2f
lock
incl 0x8(%rcx)
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
movq %rcx, 0x10(%r14)
testq %rdi, %rdi
je 0x3c45
callq 0x413a
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
cmpq %r15, %rcx
cmovaeq %r15, %rcx
movq %rcx, (%r14)
addq %rax, %rcx
movq %rcx, 0x40(%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Reader::read_stream(std::shared_ptr<char []>, unsigned long)
size_t
Reader::read_stream(std::shared_ptr<char[]> data, size_t data_size)
{
    m_istream.read(data.get(), data_size);

    if (!m_istream.good() && !m_istream.eof()) {
        throw Error("cannot read from stream");
    }

    return m_istream.gcount();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
callq 0x32e0
movq 0x18(%rbx), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ecx
testl %ecx, %ecx
sete %dl
andl $0x2, %ecx
shrl %ecx
orb %dl, %cl
je 0x3caf
movq 0x8(%rax), %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3130
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4488(%rip), %rsi      # 0x8154
leaq 0x4498(%rip), %rdx      # 0x816b
leaq 0x8(%rsp), %rdi
callq 0x41c2
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x32d0
leaq 0x7e9c(%rip), %rax      # 0xbb90
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x7e28(%rip), %rsi      # 0xbb28
movq 0x82a9(%rip), %rdx      # 0xbfb0
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d31
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3240
jmp 0x3d31
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3d3e
movq %rbx, %rdi
callq 0x3190
movq %r14, %rdi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Writer::Writer(std::ostream&, unsigned long)
Writer::Writer(std::ostream &ostream, size_t buffer_capacity)
    : m_ostream(ostream), m_buffer_size(0), m_buffer_capacity(buffer_capacity)
{
    try {
        m_buffer = std::make_unique<char[]>(m_buffer_capacity);
    } catch (const std::bad_alloc &e) {
        throw Error("cannot allocate buffer for output stream data");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
leaq 0x7df4(%rip), %rax      # 0xbb50
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x10(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq %rdx, 0x20(%rdi)
movq %rdx, %rdi
callq 0x3030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3150
movq %r14, (%r15)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3e3e
movq %r14, %rdi
callq 0x30f0
movl $0x10, %edi
callq 0x3130
movq %rax, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x43a0(%rip), %rsi      # 0x816c
leaq 0x43c6(%rip), %rdx      # 0x8199
movq %rsp, %rdi
callq 0x41c2
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x32d0
leaq 0x7da0(%rip), %rax      # 0xbb90
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x7d2c(%rip), %rsi      # 0xbb28
movq 0x81ad(%rip), %rdx      # 0xbfb0
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3e2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3240
jmp 0x3e2c
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3e39
movq %rbx, %rdi
callq 0x3190
callq 0x3350
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3e4b
callq 0x32f0
movq $0x0, (%r15)
movq %r14, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x40ac
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/buffered_stream.cpp
// Function: BufferedStream::Writer::write(char const*, unsigned long)
void
Writer::write(const char *data, size_t data_size)
{
    size_t free{m_buffer_capacity - m_buffer_size};
    if (data_size <= free) {
        // There is free space in the buffer
        write_buffer(data, data_size);
    } else {
        // No free space
        flush_buffer();
        if (data_size <= m_buffer_capacity) {
            // Data fits into the buffer
            write_buffer(data, data_size);
        } else {
            // Doesn't fit
            write_stream(data, data_size);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x20(%rdi), %rax
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rdx
subq %rdx, %rax
cmpq %rbx, %rax
jae 0x3f25
movq %r14, %rdi
callq 0x3f6a
movq $0x0, 0x18(%r14)
cmpq %rbx, 0x20(%r14)
jae 0x3f2d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3f6a
addq %rdx, %rsi
movq %rsi, %rdi
jmp 0x3f31
movq 0x10(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x31c0
addq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Writer::writeDiffRecord(unsigned long, unsigned long, std::vector<FormatV2::RecordData, std::allocator<FormatV2::RecordData>>)
void writeDiffRecord(
        uint64_t offset, size_t size,
        std::vector<RecordData> data) // cppcheck-suppress passedByValue
    {
        writeOffset(offset);
        writeSize(size);
        for (auto it = data.begin(); it != data.end(); ++it) {
            writeData(*it);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
bswapq %rsi
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movl $0x8, %edx
movq %rax, %rsi
callq 0x3eda
bswapl %r15d
leaq 0x4(%rsp), %rsi
movl %r15d, (%rsi)
movl $0x4, %edx
movq %r14, %rdi
callq 0x3eda
movq (%rbx), %r12
cmpq 0x8(%rbx), %r12
je 0x53c8
movq 0x6c3c(%rip), %r13      # 0xbfc0
movq (%r12), %rdx
movq 0x8(%r12), %rsi
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x53a9
cmpb $0x0, (%r13)
je 0x53a4
incl 0x8(%r15)
jmp 0x53a9
lock
incl 0x8(%r15)
movq %r14, %rdi
callq 0x3eda
testq %r15, %r15
je 0x53be
movq %r15, %rdi
callq 0x413a
addq $0x18, %r12
cmpq 0x8(%rbx), %r12
jne 0x5384
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
testq %r15, %r15
je 0x53e6
movq %r15, %rdi
callq 0x413a
movq %rbx, %rdi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/create.cpp
// Function: PagedStreamReader::getNextPage()
Page getNextPage()
    {
        const BufferedStream::DataPart dp{
            m_reader.readMultipart(m_page_size_bytes)};

        m_stream_pos_bytes += dp.size;

        return Page{dp.data, m_stream_pos_bytes - dp.size, m_stream_pos_bytes};
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rsi
movq (%r14), %rdx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3b68
movq (%r15), %rax
addq %rax, 0x58(%r14)
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x58b6
movq 0x6718(%rip), %rcx      # 0xbfc0
cmpb $0x0, (%rcx)
je 0x58b2
incl 0x8(%rax)
jmp 0x58b6
lock
incl 0x8(%rax)
movq 0x58(%r14), %rcx
movq %rcx, %rdx
subq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5aaa
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x58e0
callq 0x413a
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x58ef
callq 0x413a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/main.cpp
// Function: main
int
main(int argc, char **argv)
{
    try {
        if (Options::Parser::isHelp(argc, argv)) {
            Options::printUsage();
        } else if (Options::Parser::isVersion(argc, argv)) {
            print_version();
        } else if (Options::Parser::isCreate(argc, argv)) {
            create(Options::Parser::parseCreate(argc, argv));
        } else if (Options::Parser::isRestore(argc, argv)) {
            restore(Options::Parser::parseRestore(argc, argv));
        } else {
            Options::printUsage();
            exit(1);
        }
    } catch (const Options::Error &e) {
        Options::printUsage();
        std::cerr << "ERROR: " << e.what() << std::endl;
        exit(1);
    } catch (const DiffddError &e) {
        std::cerr << "ERROR: " << e.what() << std::endl;
        exit(1);
    }

    exit(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movl %edi, %ebp
callq 0x625a
testb %al, %al
je 0x5e38
callq 0x5fe0
xorl %edi, %edi
callq 0x32b0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x62a6
testb %al, %al
je 0x5e4d
callq 0x5da0
jmp 0x5e31
movl %ebp, %edi
movq %rbx, %rsi
callq 0x62ce
testb %al, %al
je 0x5e7a
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x631e
movq %rsp, %rdi
callq 0x45df
movq %rsp, %rdi
callq 0x5fbc
jmp 0x5e31
movl %ebp, %edi
movq %rbx, %rsi
callq 0x62f6
testb %al, %al
je 0x5eb6
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x695e
movq %rsp, %rdi
callq 0x7138
leaq 0x30(%rsp), %rdi
callq 0x4bb2
leaq 0x8(%rsp), %rdi
callq 0x4bb2
jmp 0x5e31
callq 0x5fe0
jmp 0x5f8f
movq %rdx, %r14
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4bb2
leaq 0x8(%rsp), %rdi
callq 0x4bb2
jmp 0x5ef6
jmp 0x5ef0
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5fbc
jmp 0x5ef6
jmp 0x5ef0
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0x5f46
movq %rbx, %rdi
callq 0x30f0
movq %rax, %rbx
callq 0x5fe0
movq 0x60dd(%rip), %rdi      # 0xbff0
leaq 0x2872(%rip), %rsi      # 0x878c
movl $0x7, %edx
callq 0x3280
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x60bc(%rip), %rdi      # 0xbff0
movq %rax, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3120
jmp 0x5f8f
cmpl $0x1, %r14d
jne 0x5fab
movq %rbx, %rdi
callq 0x30f0
movq %rax, %rbx
movq 0x6092(%rip), %rdi      # 0xbff0
leaq 0x2827(%rip), %rsi      # 0x878c
movl $0x7, %edx
callq 0x3280
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x6071(%rip), %rdi      # 0xbff0
movq %rax, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3120
movl $0x1, %edi
callq 0x32b0
movq %rax, %rbx
callq 0x3350
jmp 0x5fab
movq %rax, %rbx
callq 0x3350
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x40ac
nop
// File: /workspace/github_cpp_makefile_star2_O1/jansucan[P]diff-dd/src/./format_v2.h
// Function: FormatV2::Reader::readRecordData(unsigned long)
RecordData readRecordData(size_t size)
    {
        const BufferedStream::DataPart dp = m_reader.readMultipart(size);
        return RecordData{
            .size = dp.size,
            .data = dp.data,
        };
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x3b68
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x7701
movq 0x48cd(%rip), %rcx      # 0xbfc0
cmpb $0x0, (%rcx)
je 0x76fd
incl 0x8(%rax)
jmp 0x7701
lock
incl 0x8(%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7710
callq 0x413a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jasmeet13n[P]HTTP-Proxy-Server-Client/client.cpp
// Function: get_http_request(char*)
char *get_http_request(char *url){
	int len = strlen(url);
	char *output = (char *)malloc((len+50)*sizeof(char));
	int i=0, k=4;
	output[0]='G';output[1]='E';output[2]='T';output[3]=' ';
	if(len>7){
		if(url[0]=='h' && url[1]=='t' && url[2]=='t' && url[3]=='p' && url[4]==':' && url[5]=='/' && url[6]=='/')
			i = 7;
	}
	int tmp = i;								// Seperate the URL into file name and host name
	while(i<len && url[tmp]!='/')
		tmp++;
	output[k++]='/';
	tmp++;
	while(tmp<len)
		output[k++]=url[tmp++];
	output[k++]=' ';output[k++]='H';output[k++]='T';output[k++]='T';output[k++]='P';output[k++]='/';
	output[k++]='1';output[k++]='.';output[k++]='0';output[k++]='\r';output[k++]='\n';
	output[k++]='H';output[k++]='o';output[k++]='s';output[k++]='t';output[k++]=':';output[k++]=' ';
	while(i<len && url[i]!='/')
		output[k++] = url[i++];
	output[k++]='\r';output[k++]='\n';output[k++]='\r';output[k++]='\n';output[k]='\0';
	return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x2090
movq %rax, %rbx
addl $0x32, %eax
movslq %eax, %rdi
callq 0x21b0
movl $0x20544547, (%rax)     # imm = 0x20544547
xorl %r12d, %r12d
cmpl $0x8, %ebx
jl 0x2526
cmpb $0x68, (%r14)
jne 0x2526
cmpb $0x74, 0x1(%r14)
jne 0x2526
cmpb $0x74, 0x2(%r14)
jne 0x2526
cmpb $0x70, 0x3(%r14)
jne 0x2526
cmpb $0x3a, 0x4(%r14)
jne 0x2526
cmpb $0x2f, 0x5(%r14)
jne 0x2526
xorl %ecx, %ecx
cmpb $0x2f, 0x6(%r14)
movl $0x7, %r12d
cmovnel %ecx, %r12d
movl %r12d, %r13d
movl %r12d, %edx
cmpl %ebx, %r12d
jge 0x2543
movq %r13, %rdx
cmpb $0x2f, (%r14,%rdx)
je 0x2543
incq %rdx
cmpl %ebx, %r12d
jl 0x2534
movb $0x2f, 0x4(%rax)
leal 0x1(%rdx), %ecx
movl $0x5, %r15d
cmpl %ebx, %ecx
jge 0x2583
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
addq $0x5, %rdi
movl %edx, %ecx
leaq (%r14,%rcx), %rsi
incq %rsi
movl %ebx, %r15d
subl %edx, %r15d
leal -0x2(%r15), %edx
incq %rdx
callq 0x20f0
movq -0x30(%rbp), %rax
addl $0x4, %r15d
movl %r15d, %ecx
movaps 0xa83(%rip), %xmm0      # 0x3010
movups %xmm0, (%rax,%rcx)
addl $0x11, %r15d
movb $0x20, 0x10(%rax,%rcx)
cmpl %ebx, %r12d
jge 0x25bc
movl %r15d, %r15d
movl %ebx, %edx
movb (%r14,%r13), %cl
cmpb $0x2f, %cl
je 0x25bc
incq %r13
movb %cl, (%rax,%r15)
incq %r15
cmpq %r13, %rdx
jne 0x25a4
movl %r15d, %ecx
movl $0xa0d0a0d, (%rax,%rcx) # imm = 0xA0D0A0D
movb $0x0, 0x4(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jasmeet13n[P]HTTP-Proxy-Server-Client/client.cpp
// Function: get_filename(char*)
char *get_filename(char *qq){
	char *name = (char *)malloc(512*sizeof(char));
	int k=0;
	int last = 0;
	int i=0;
	int len = strlen(qq);
	while(i < len){
		if(qq[i]=='/')
			last = i;
		i++;
	}
	if(last!=0){
		memcpy(name,&qq[last+1],(len-last-1));
		name[len-last]='\0';
	}
	if(strlen(name)==0){
		name[k++]='i';name[k++]='n';name[k++]='d';name[k++]='e';name[k++]='x';name[k++]='.';		// if filename cannot be extracted, set default name to index.html
		name[k++]='h';name[k++]='t';name[k++]='m';name[k++]='l';name[k]='\0';
		return name;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x200, %edi            # imm = 0x200
callq 0x21b0
movq %rax, %rbx
movq %r15, %rdi
callq 0x2090
movq %rax, %r14
testl %r14d, %r14d
jle 0x2623
movl %r14d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
xorl %eax, %eax
cmpb $0x2f, (%r15,%rdx)
cmovel %edx, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2611
jmp 0x2625
xorl %eax, %eax
testl %eax, %eax
je 0x264c
movslq %eax, %rcx
leaq (%r15,%rcx), %rsi
incq %rsi
subl %eax, %r14d
leal -0x1(%r14), %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x20f0
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
cmpb $0x0, (%rbx)
jne 0x2668
movabsq $0x74682e7865646e69, %rax # imm = 0x74682E7865646E69
movq %rax, (%rbx)
movw $0x6c6d, 0x8(%rbx)      # imm = 0x6C6D
movb $0x0, 0xa(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tlaloc1313[P]chess-project/draw.cpp
// Function: drawMoves(Board*)
void drawMoves(Board* gameBoard){
  cout<< "Moves: \n";

  //Loops from start to current point in game.
  for (int i = 0; i < gameBoard->getMoveNumber(); i++){
    if (i%2 == 0) {
      cout << (i/2)+1 << ". ";
    }

    cout << gameBoard->getPastPiece(i) << gameBoard->getPastSquare(i) << "  ";
  }
  cout << std::endl << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x6449(%rip), %rbx      # 0x8fd0
leaq 0x3686(%rip), %rsi      # 0x6214
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x428c
testl %eax, %eax
jle 0x2c75
xorl %r15d, %r15d
leaq 0x3668(%rip), %r12      # 0x621d
testb $0x1, %r15b
jne 0x2bde
movl %r15d, %esi
shrl %esi
incl %esi
movq %rbx, %rdi
callq 0x21b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x35b8(%rip), %rsi      # 0x6191
callq 0x2120
movq %r14, %rdi
movl %r15d, %esi
callq 0x4178
testq %rax, %rax
je 0x2c09
movq %rax, %r13
movq %rax, %rdi
callq 0x2080
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2120
jmp 0x2c20
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21a0
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x4266
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2120
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2c61
callq 0x20f0
incl %r15d
movq %r14, %rdi
callq 0x428c
cmpl %eax, %r15d
jl 0x2bb5
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2cea
callq 0x20f0
movq %rbx, %rdi
callq 0x21c0