LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/pipeline.hpp
// Function: FileReader::FileReader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
explicit FileReader(const std::string &fn)
        :
        buffer_(0),
        cap_(0),
        file_(0)
    {
        if (fn == "-")
        {
            file_ = stdin;
        }
        else
        {
            file_ = fopen(fn.c_str(), "r");
        }

        if (!file_)
        {
            FATAL_ERROR("could not open %s", fn.c_str());
        }

        if (file_ == 0)
        {
            fprintf(stderr, "file %s dne\n", fn.c_str());
            exit(1);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
andq $0x0, 0x8(%rdi)
movq %rsi, %rbx
leaq 0xb388(%rip), %rax      # 0xfa28
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
leaq 0x5c76(%rip), %rsi      # 0xa32c
movq %rbx, %rdi
callq 0x4978
testb %al, %al
je 0x46ce
movq 0xb907(%rip), %rax      # 0xffd0
movq (%rax), %rax
jmp 0x46dd
movq (%rbx), %rdi
leaq 0x5f82(%rip), %rsi      # 0xa65a
callq 0x3220
movq %rax, 0x20(%r14)
testq %rax, %rax
jne 0x4708
movq (%rbx), %rcx
leaq 0x5c3e(%rip), %rdi      # 0xa32e
leaq 0x5c4b(%rip), %rdx      # 0xa342
pushq $0x28
popq %rsi
xorl %eax, %eax
callq 0x94d0
cmpq $0x0, 0x20(%r14)
je 0x4710
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0xb8c1(%rip), %rax      # 0xffd8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0x5c30(%rip), %rsi      # 0xa354
xorl %eax, %eax
callq 0x3300
pushq $0x1
popq %rdi
callq 0x3240
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/blocks.hpp
// Function: save_blocks(BinaryFile&, std::vector<Block, std::allocator<Block>> const&)
inline bool save_blocks(BinaryFile &file, const std::vector<Block> &v)
{
    std::vector<unsigned> start_ip;
    std::vector<unsigned> end_ip;
    std::vector<unsigned> loc;

    start_ip.resize(v.size());
    end_ip.resize(v.size());
    loc.resize(v.size());

    unsigned last = 0;

    // split into columns and check sortedness

    for (size_t i = 0; i < v.size(); ++i)
    {
        assert(v[i].start_ip > last);
        assert(v[i].end_ip >= v[i].start_ip);

        start_ip[i] = v[i].start_ip;
        end_ip[i] = v[i].end_ip;
        loc[i] = v[i].loc;

        last = v[i].end_ip;
    }

    file.save_pod_vector(start_ip);
    file.save_pod_vector(end_ip);
    file.save_pod_vector(loc);

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
pushq $0xc
popq %r15
cqto
idivq %r15
movq %rax, %rsi
xorl %edx, %edx
callq 0x4e62
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
idivq %r15
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4e62
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
idivq %r15
movq %rsp, %rdi
xorl %r12d, %r12d
movq %rax, %rsi
xorl %edx, %edx
callq 0x4e62
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
cqto
idivq %r15
movq 0x40(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq (%rsp), %rdi
addq $0x8, %rcx
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x4839
movl -0x8(%rcx), %r9d
cmpl %r12d, %r9d
jbe 0x48a1
cmpl %r9d, -0x4(%rcx)
jb 0x4888
movl %r9d, (%rdx,%r8,4)
movl -0x4(%rcx), %r9d
movl %r9d, (%rsi,%r8,4)
movl (%rcx), %r9d
movl %r9d, (%rdi,%r8,4)
movl -0x4(%rcx), %r12d
incq %r8
addq $0xc, %rcx
jmp 0x4801
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x4ea0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x4ea0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4ea0
movq %rsp, %rdi
callq 0x530a
leaq 0x20(%rsp), %rdi
callq 0x530a
leaq 0x40(%rsp), %rdi
callq 0x530a
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5b4e(%rip), %rdi      # 0xa3dd
leaq 0x5afa(%rip), %rsi      # 0xa390
leaq 0x5b05(%rip), %rcx      # 0xa3a2
pushq $0x68
jmp 0x48b8
leaq 0x5ad3(%rip), %rdi      # 0xa37b
leaq 0x5ae1(%rip), %rsi      # 0xa390
leaq 0x5aec(%rip), %rcx      # 0xa3a2
pushq $0x67
popq %rdx
callq 0x3170
movq %rax, %rbx
jmp 0x48df
movq %rax, %rbx
jmp 0x48d5
jmp 0x48ca
movq %rax, %rbx
movq %rsp, %rdi
callq 0x530a
leaq 0x20(%rsp), %rdi
callq 0x530a
leaq 0x40(%rsp), %rdi
callq 0x530a
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x3e8f
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/pipeline.hpp
// Function: FileReader::~FileReader()
virtual ~FileReader()
    {
        if (file_ && file_ != stdin)
        {
            fclose(file_);
        }

        if (buffer_)
        {
            free(buffer_);
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xb0d7(%rip), %rax      # 0xfa28
movq %rax, (%rdi)
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x496e
movq 0xb66c(%rip), %rax      # 0xffd0
cmpq (%rax), %rdi
je 0x496e
callq 0x31e0
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/blocks.hpp
// Function: BlockParser::consume(Buffer const&)
void consume(const Buffer &b)
    {
        line_++;
        if (line_ < 3) return;

        csv_split((const char*) b.data(), b.size(), scratch_, toks_);

        if (toks_.size() != 3)
        {
            // we just silently drop bad lines
            return;
        }

        Block block;

        block.start_ip = to_u(toks_[0]);
        block.end_ip = to_u(toks_[1]);
        block.loc = to_u(toks_[2]);

        emit(Buffer(&block, sizeof(block)));
    }

// Assembly:
movq 0x48(%rdi), %rax
incq %rax
movq %rax, 0x48(%rdi)
cmpq $0x3, %rax
jb 0x4a75
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
leaq 0x10(%rbx), %rdx
leaq 0x30(%rbx), %rcx
callq 0x4a76
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x18, %rcx
jne 0x4a6e
movq (%rax), %rdi
callq 0x4b25
leaq 0xc(%rsp), %r14
movl %eax, (%r14)
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x4b25
movl %eax, 0x4(%r14)
movq 0x30(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x4b25
movl %eax, 0x8(%r14)
leaq 0x18(%rsp), %rsi
movq %r14, (%rsi)
movq $0xc, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/csv.hpp
// Function: csv_split(char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<char*, std::allocator<char*>>&)
inline void csv_split(const char* s,
                      size_t n,
                      std::string &scratch,
                      std::vector<char*> &toks)
{
    toks.clear();
    scratch.clear();

    scratch.assign(s, n);

    // csv splitter needs to handle quote marks.
 
    char* ptr = &scratch[0];
    bool first = true;
    char* begin = 0;

    while (*ptr)
    {
        if (!first)
        {
            *ptr = '\0';
            ++ptr;
        }
        else
        {
            first = false;
        }

        if (*ptr != '"')
        {
            begin = ptr;
            while (*ptr && *ptr != ',') ++ptr;
            toks.push_back(begin);
        }
        else
        {
            // skip quote
            ++ptr;
            begin = ptr;

            while (*ptr && *ptr != '"') ++ptr;

            if (*ptr == '"')
            {
                *ptr = '\0';
                ++ptr;
            }

            toks.push_back(begin);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %rdx
movq %rdi, %rsi
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x4a98
movq %rax, 0x8(%rbx)
andq $0x0, 0x8(%r14)
movq (%r14), %rax
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x32b0
movq (%r14), %r15
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movb $0x1, %cl
movb (%r15), %al
testb %al, %al
je 0x4b1b
testb $0x1, %cl
jne 0x4ad0
movb $0x0, (%r15)
movb 0x1(%r15), %al
incq %r15
cmpb $0x22, %al
jne 0x4aee
incq %r15
movq %r15, 0x8(%rsp)
movzbl (%r15), %eax
testl %eax, %eax
je 0x4b0c
cmpl $0x22, %eax
je 0x4b05
incq %r15
jmp 0x4adc
movq %r15, 0x8(%rsp)
movzbl (%r15), %eax
testl %eax, %eax
je 0x4b0c
cmpl $0x2c, %eax
je 0x4b0c
incq %r15
jmp 0x4af3
movb $0x0, (%r15)
incq %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4b30
xorl %ecx, %ecx
jmp 0x4ab9
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/pipeline.hpp
// Function: FileReader::produce_one()
bool produce_one()
    {
        ssize_t n = getline(&buffer_, &cap_, file_);

        if (n <= 0)
        {
            return false;
        }

        if (buffer_[n-1] == '\n')
        {
            buffer_[n-1] = '\0';
            n--;
        }

        emit(Buffer(buffer_, n));

        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
leaq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rdx
movq %r15, %rdi
callq 0x3290
movq %rax, %r14
testq %rax, %rax
jle 0x4e51
movq (%r15), %rax
cmpb $0xa, -0x1(%rax,%r14)
jne 0x4e3c
movb $0x0, -0x1(%rax,%r14)
leaq -0x1(%r14), %rcx
movq (%r15), %rax
jmp 0x4e3f
movq %r14, %rcx
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testq %r14, %r14
setg %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: void BinaryFile::save_pod_vector<unsigned int>(std::vector<unsigned int, std::allocator<unsigned int>> const&)
void save_pod_vector(const std::vector<T> &v)
    {
        save_type("PODV");
        save_unsigned(0);

        off_t top = offset();
        save_unsigned(v.size());
        save_bytes_padded(&v[0], v.size() * sizeof(T));

        off_t bottom = offset();
        unsigned size = (bottom - top);

        seek(top-4);
        save_unsigned(size);
        seek(bottom);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x555d(%rip), %rsi      # 0xa411
callq 0x5192
movq %rbx, %rdi
xorl %esi, %esi
callq 0x520a
movq %rbx, %rdi
callq 0x5246
movq %rax, %r14
movq 0x8(%r15), %rsi
subq (%r15), %rsi
shrq $0x2, %rsi
movq %rbx, %rdi
callq 0x520a
movq (%r15), %rsi
movq 0x8(%r15), %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x524e
movq %rbx, %rdi
callq 0x5246
movq %rax, %r15
movl %r15d, %ebp
subl %r14d, %ebp
addq $-0x4, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x529a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x520a
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x529a
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: BinaryFile::save_type(char const*)
void save_type(const char* x)
    {
        assert(strlen(x) == 4);
        size_t rn = fwrite(x, 1, 4, file_);

        if (rn != 4)
        {
            FATAL_ERROR("failed to save_type 4 bytes");
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x30e0
cmpq $0x4, %rax
jne 0x51ea
movq (%r14), %rcx
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x33d0
cmpq $0x4, %rax
jne 0x51c9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x510b(%rip), %rdi      # 0xa2db
leaq 0x5277(%rip), %rdx      # 0xa44e
movl $0xcb, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x94d0
leaq 0x5225(%rip), %rdi      # 0xa416
leaq 0x50e3(%rip), %rsi      # 0xa2db
leaq 0x5226(%rip), %rcx      # 0xa425
movl $0xc6, %edx
callq 0x3170
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: BinaryFile::save_bytes_padded(void const*, unsigned long)
void save_bytes_padded(const void* b, size_t n)
    {
        size_t rn = fwrite(b, 1, n, file_);

        if (rn != n)
        {
            FATAL_ERROR("failed to save_bytes_padded %zu bytes", n);
        }

        return pad();
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
movq (%rdi), %rcx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x33d0
cmpq %r14, %rax
je 0x528b
leaq 0x5066(%rip), %rdi      # 0xa2db
leaq 0x520e(%rip), %rdx      # 0xa48a
movl $0xdf, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x94d0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x52d0
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: BinaryFile::pad()
void pad()
    {
        // given the current offset, emit some padding bytes.

        unsigned padded = ((unsigned) (offset()) + 3) & ~0x3U;
        unsigned pad_bytes = padded - offset();
        char padding[] = {0,0,0,0};

        return save_bytes_raw(padding, pad_bytes);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x5246
leal 0x3(%rax), %r14d
andl $-0x4, %r14d
movq %rbx, %rdi
callq 0x5246
subl %eax, %r14d
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x422a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/locations.hpp
// Function: LocationParser::consume(Buffer const&)
void consume(const Buffer &b)
    {
        line_++;
        if (line_ < 3) return;

        csv_split((const char*) b.data(), b.size(), scratch_, toks_);

        if (toks_.size() != 9)
        {
            return;
        }

        Location loc;

        loc.id = to_u(toks_[0]);
        loc.country = toks_[1];
        loc.region = toks_[2];
        loc.city = toks_[3];
        loc.lat = toks_[5];
        loc.lon = toks_[6];

        emit(Buffer(&loc, sizeof(loc)));
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq 0x68(%rdi), %rax
incq %rax
movq %rax, 0x68(%rdi)
cmpq $0x3, %rax
jb 0x5782
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
leaq 0x30(%rbx), %rdx
leaq 0x50(%rbx), %r14
movq %r14, %rcx
callq 0x4a76
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
cmpq $0x48, %rcx
jne 0x5782
leaq 0x8(%rsp), %r15
andl $0x0, -0x8(%r15)
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rcx)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rcx)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
andq $0x0, -0x8(%r12)
movb %dl, (%r12)
leaq 0x98(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rcx)
movq (%rax), %rdi
callq 0x4b25
movl %eax, -0x78(%r12)
movq (%r14), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x33c0
leaq 0x28(%rsp), %rdi
movq (%r14), %rax
movq 0x10(%rax), %rsi
callq 0x33c0
leaq 0x48(%rsp), %rdi
movq (%r14), %rax
movq 0x18(%rax), %rsi
callq 0x33c0
leaq 0x68(%rsp), %rdi
movq (%r14), %rax
movq 0x28(%rax), %rsi
callq 0x33c0
leaq 0x88(%rsp), %rdi
movq (%r14), %rax
movq 0x30(%rax), %rsi
callq 0x33c0
movq %rsp, %rax
leaq 0xa8(%rsp), %rsi
movq %rax, (%rsi)
movq $0xa8, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rsp, %rdi
callq 0x57ae
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x5793
movq %rax, %rbx
movq %rsp, %rdi
callq 0x57ae
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x3e8f
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/string_table.hpp
// Function: StringTable::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void insert(const std::string &s)
    {
        if (string_to_id_.count(s))
        {
            return;
        }

        unsigned index = indices_.size();
        string_to_id_[s] = index;

        indices_.push_back(strings_.size());

        strings_.insert(strings_.end(), s.begin(), s.end());
        strings_.push_back('\0');
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5fb6
testq %rax, %rax
jne 0x5c27
leaq 0x30(%r14), %r15
movq 0x38(%r14), %r12
subq 0x30(%r14), %r12
shrq $0x2, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x600e
movl %r12d, (%rax)
leaq 0x48(%r14), %r12
movl 0x50(%r14), %eax
subl 0x48(%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x60fc
movq 0x50(%r14), %rsi
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
addq %rdx, %rcx
movq %r12, %rdi
callq 0x65d6
leaq 0x3(%rsp), %rsi
movb $0x0, (%rsi)
movq %r12, %rdi
callq 0x611a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/string_table.hpp
// Function: StringTable::index_of(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
unsigned index_of(const std::string &s) const
    {
        hash_map<std::string, unsigned>::const_iterator iter = 
            string_to_id_.find(s);

        if (iter == string_to_id_.end())
        {
            return 0xFFFFFFFF;
        }

        return iter->second;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x6bb8
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0x5cbc
movl 0x20(%rax), %eax
jmp 0x5cbf
pushq $-0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/asns.hpp
// Function: ASNParser::consume(Buffer const&)
void consume(const Buffer &b)
    {
        ++line_;

        csv_split((const char*) b.data(), b.size(), scratch_, toks);

        if (toks.size() != 3)
        {
            return;
        }

        ASN asn;

        asn.start_ip = to_u(toks[0]);
        asn.end_ip = to_u(toks[1]);
        parse_text(toks[2], asn.number, asn.text);

        emit(Buffer(&asn, sizeof(asn)));
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
incq 0x68(%rdi)
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
leaq 0x30(%rbx), %rdx
leaq 0x50(%rbx), %rcx
callq 0x4a76
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
cmpq $0x18, %rcx
jne 0x7036
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
andq $0x0, -0x8(%r15)
leaq 0x10(%rsp), %r14
movb $0x0, (%r15)
movq (%rax), %rdi
callq 0x4b25
movl %eax, -0x20(%r15)
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x4b25
movl %eax, -0x1c(%r15)
movq 0x50(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x705e
movq %rsp, %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq $0x30, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %r14, %rdi
callq 0x3260
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7042
movq %rax, %rbx
movq %r14, %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x3e8f
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/asns.hpp
// Function: ASNParser::parse_text(char*, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void parse_text(char* str, unsigned &num, std::string &txt)
    {
        scratch_ = str;

        char* iter = &scratch_[0];
        char* end = iter + scratch_.size();

        char* sp = strchr(iter, ' ');

        const char* tok0 = iter;
        const char* tok1 = sp ? sp + 1 : end;

        REL_ASSERT(strlen(tok0) > 2);

        num = to_u(tok0 + 2);
        txt = tok1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
addq $0x30, %rdi
callq 0x33c0
movq 0x30(%r12), %r15
movq 0x38(%r12), %rbp
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x30b0
movq %rax, %r12
movq %r15, %rdi
callq 0x30e0
cmpq $0x2, %rax
ja 0x70b9
leaq 0x3491(%rip), %rdi      # 0xa539
leaq 0x349a(%rip), %rdx      # 0xa549
pushq $0x48
popq %rsi
xorl %eax, %eax
callq 0x94d0
addq %r15, %rbp
leaq 0x1(%r12), %r13
testq %r12, %r12
cmoveq %rbp, %r13
addq $0x2, %r15
movq %r15, %rdi
callq 0x4b25
movl %eax, (%r14)
movq %rbx, %rdi
movq %r13, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33c0
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: GeoData::open(char const*)
void open(const char* fn)
    {
        LOG_CONTEXT("GeoData open %s", fn);

        bool ok = mem_file_.open(fn);

        if (!ok)
        {
            FATAL_ERROR("could not open %s for reading", fn);
        }

        LOG_CONTEXT("GeoData read header");
        read_header();

        LOG_CONTEXT("GeoData load location_ip_blocks");
        location_ip_blocks_.load(mem_file_);

        LOG_CONTEXT("GeoData load location_data");
        location_data_.load(mem_file_);

        LOG_CONTEXT("GeoData load asn_ip_blocks");
        asn_ip_blocks_.load(mem_file_);

        LOG_CONTEXT("GeoData load asn_data");
        asn_data_.load(mem_file_);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2c4f(%rip), %rdi      # 0xa5ea
leaq 0x2c78(%rip), %rdx      # 0xa61a
pushq $0x40
popq %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x93b8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7f40
testb %al, %al
jne 0x79d9
leaq 0x2c25(%rip), %rdi      # 0xa5ea
leaq 0x2c5e(%rip), %rdx      # 0xa62a
pushq $0x46
popq %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x94d0
leaq 0x2c0a(%rip), %r14      # 0xa5ea
leaq 0x2c61(%rip), %rdx      # 0xa648
pushq $0x49
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x93b8
movq %rbx, %rdi
callq 0x7d06
leaq 0x2c59(%rip), %rdx      # 0xa65c
pushq $0x4c
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x93b8
leaq 0x18(%rbx), %rdi
movq %rbx, %rsi
callq 0x7e80
leaq 0x2c59(%rip), %rdx      # 0xa67c
pushq $0x4f
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x93b8
leaq 0x30(%rbx), %rdi
movq %rbx, %rsi
callq 0x7ed0
leaq 0x2c54(%rip), %rdx      # 0xa697
pushq $0x52
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x93b8
leaq 0x68(%rbx), %rdi
movq %rbx, %rsi
callq 0x7e80
leaq 0x2c4f(%rip), %rdx      # 0xa6b2
pushq $0x55
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x93b8
leaq 0x80(%rbx), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7f14
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: GeoData::read_header()
void read_header()
    {
        const char* raw = (const char*) mem_file_.get_mem(32);

        std::string header(raw, raw + 32);
        std::string scratch;
        std::vector<char*> toks;

        char_split(header, scratch, toks, ' ');

        if (toks.size() != 5)
        {
            FATAL_ERROR("header is corrupt - %s", header.c_str());
        }

        check_header_value("header1", toks[0], "geoloc");
        check_header_value("header2", toks[1], "loadzero");
        check_header_value("version", toks[2], "v001");
        check_header_value("endian", toks[3], get_endian());
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
subq %rax, %rcx
cmpq $0x20, %rcx
jae 0x7d25
xorl %esi, %esi
jmp 0x7d33
movq (%rbx), %rsi
addq %rax, %rsi
addq $0x20, %rax
movq %rax, 0x10(%rbx)
leaq 0x20(%rsi), %rdx
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x80f4
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x38(%rsp), %rsi
pushq $0x20
popq %rcx
movq %r14, %rdi
callq 0x8023
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
cmpq $0x28, %rcx
je 0x7daf
movq 0x18(%rsp), %rcx
leaq 0x2850(%rip), %rdi      # 0xa5ea
leaq 0x2971(%rip), %rdx      # 0xa712
pushq $0x70
popq %rsi
xorl %eax, %eax
callq 0x94d0
movq (%rsp), %rax
movq (%rax), %rdx
leaq 0x2970(%rip), %rsi      # 0xa729
leaq 0x2971(%rip), %rcx      # 0xa731
movq %rbx, %rdi
callq 0x80aa
movq (%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x2961(%rip), %rsi      # 0xa738
leaq 0x2962(%rip), %rcx      # 0xa740
movq %rbx, %rdi
callq 0x80aa
movq (%rsp), %rax
movq 0x10(%rax), %rdx
leaq 0x2954(%rip), %rsi      # 0xa749
leaq 0x2955(%rip), %rcx      # 0xa751
movq %rbx, %rdi
callq 0x80aa
movq (%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x2943(%rip), %rsi      # 0xa756
leaq 0x24ba(%rip), %rcx      # 0xa2d4
movq %rbx, %rdi
callq 0x80aa
movq %rsp, %rdi
callq 0x5326
leaq 0x38(%rsp), %rdi
callq 0x3260
leaq 0x18(%rsp), %rdi
callq 0x3260
addq $0x58, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x7e65
movq %rax, %rbx
jmp 0x7e5b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5326
leaq 0x38(%rsp), %rdi
callq 0x3260
leaq 0x18(%rsp), %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3370
movq %rax, %rdi
callq 0x3e8f
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/blocks.hpp
// Function: BlockTable::load(MemoryFile&)
void load(MemoryFile& file)
    {
        LOG_CONTEXT("BlockTable load");

        file.load_mapped_vector(start_ip);
        file.load_mapped_vector(end_ip);
        file.load_mapped_vector(loc);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x24ff(%rip), %rdi      # 0xa390
leaq 0x28e3(%rip), %rdx      # 0xa77b
pushq $0x22
popq %rsi
xorl %eax, %eax
callq 0x93b8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x81a0
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x81a0
addq $0x10, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x81a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/locations.hpp
// Function: LocationTable::load(MemoryFile&)
void load(MemoryFile& file)
    {
        file.load_mapped_string_vector(country);
        file.load_mapped_string_vector(region);
        file.load_mapped_string_vector(city);
        file.load_mapped_vector(locations);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x8296
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x8296
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x8296
addq $0x30, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8304
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: MemoryMap::open(char const*)
bool open(const char* fn)
    {
        int fd = ::open(fn, O_RDONLY);

        if (fd < 0)
        {
            return false;
        }

        off_t end = lseek(fd, 0, SEEK_END);

        if (end == -1)
        {
            LOG_CONTEXT("could not seek to end of %s", fn);
            return false;
        }

        off_t beg = lseek(fd, 0, SEEK_SET);

        if (beg == -1)
        {
            LOG_CONTEXT("could not seek to beg of %s", fn);
            return false;
        }

        len_ = end;
        data_ = mmap(0, len_, PROT_READ, MAP_SHARED, fd, 0);

        if (!data_)
        {
            LOG_CONTEXT("could not mmap %s", fn);
            close(fd);
            return false;
        }

        int rc = ::close(fd);
        UNUSED(rc);

        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq %rsi, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3190
testl %eax, %eax
js 0x7fec
movl %eax, %ebp
pushq $0x2
popq %rdx
movl %eax, %edi
xorl %esi, %esi
callq 0x33a0
cmpq $-0x1, %rax
je 0x7fb9
movq %rax, %r15
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33a0
cmpq $-0x1, %rax
je 0x7fce
movq %r15, 0x8(%r14)
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %r15, %rsi
movl %ecx, %edx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x3380
movq %rax, (%r14)
testq %rax, %rax
je 0x7ffa
movl %ebp, %edi
callq 0x33f0
movb $0x1, %r15b
jmp 0x7fec
leaq 0x231b(%rip), %rdi      # 0xa2db
leaq 0x2701(%rip), %rdx      # 0xa6c8
xorl %r15d, %r15d
pushq $0x76
jmp 0x7fe1
leaq 0x2306(%rip), %rdi      # 0xa2db
leaq 0x2708(%rip), %rdx      # 0xa6e4
xorl %r15d, %r15d
pushq $0x7e
popq %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x93b8
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22da(%rip), %rdi      # 0xa2db
leaq 0x26f8(%rip), %rdx      # 0xa700
xorl %r15d, %r15d
movl $0x87, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x93b8
movl %ebp, %edi
callq 0x33f0
jmp 0x7fec
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/csv.hpp
// Function: char_split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<char*, std::allocator<char*>>&, char)
inline void char_split(const std::string &s,
                      std::string &scratch,
                      std::vector<char*> &toks,
                      char delim)
{
    toks.clear();
    scratch.clear();

    scratch.assign(s.begin(), s.end());

    char* ptr = &scratch[0];
    bool first = true;

    while (*ptr)
    {
        if (!first)
        {
            first = false;
            *ptr = '\0';
            ++ptr;
        }
        else
        {
            first = false;
        }

        char* begin = ptr;
        while (*ptr && *ptr != delim) ++ptr;

        toks.push_back(begin);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x8040
movq %rax, 0x8(%r14)
andq $0x0, 0x8(%r15)
movq (%r15), %rax
movb $0x0, (%rax)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x818a
movq (%r15), %r12
movb $0x1, %al
movq %rsp, %r15
cmpb $0x0, (%r12)
je 0x809e
testb $0x1, %al
jne 0x8078
movb $0x0, (%r12)
incq %r12
movq %r12, (%rsp)
decq %r12
movb 0x1(%r12), %al
incq %r12
testb %al, %al
je 0x808f
cmpb %bl, %al
jne 0x807f
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b30
xorl %eax, %eax
jmp 0x8065
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: void MemoryFile::load_mapped_vector<unsigned int>(MappedVector<unsigned int>&)
void load_mapped_vector(MappedVector<T> &out)
    {
        const RawMappedVector<T>* foo = load_raw_mapped_vector<T>();

        if (!foo)
        {
            FATAL_ERROR("could not load_mapped_vector");
        }

        out.init(foo);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x81da
movq %rax, %r14
testq %rax, %rax
jne 0x81ce
leaq 0x2120(%rip), %rdi      # 0xa2db
leaq 0x25c9(%rip), %rdx      # 0xa78b
movl $0x195, %esi            # imm = 0x195
xorl %eax, %eax
callq 0x94d0
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: RawMappedVector<unsigned int> const* MemoryFile::load_raw_mapped_vector<unsigned int>()
const RawMappedVector<T>* load_raw_mapped_vector()
    {
        const char* type = load_type();

        if (type == 0)
        {
            return 0;
        }

        if (memcmp(type, "PODV", 4) != 0)
        {
            return 0;
        }

        const unsigned* len = load_unsigned();

        if (len == 0)
        {
            return 0;
        }

        return (const RawMappedVector<T>*)(get_mem(*len));
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x8222
testq %rax, %rax
je 0x81f0
cmpl $0x56444f50, (%rax)     # imm = 0x56444F50
je 0x81f4
xorl %eax, %eax
popq %rbx
retq
movq %rbx, %rdi
callq 0x8246
testq %rax, %rax
je 0x81f0
movl (%rax), %ecx
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
subq %rdx, %rax
cmpq %rcx, %rax
jb 0x81f0
movq (%rbx), %rax
addq %rdx, %rax
addq %rdx, %rcx
movq %rcx, 0x10(%rbx)
jmp 0x81f2
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/serialization.hpp
// Function: MemoryFile::load_mapped_string_vector(MappedStringVector&)
void load_mapped_string_vector(MappedStringVector &out)
    {
        const RawMappedVector<unsigned>* foo = 
            load_raw_mapped_vector<unsigned>();

        if (!foo)
        {
            FATAL_ERROR("could not load_mapped_string_vector indices");
        }

        const RawMappedVector<char>* str = load_raw_mapped_vector<char>();

        if (!str)
        {
            FATAL_ERROR("could not load_mapped_string_vector strings");
        }

        out.init(str->data_, foo);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x81da
movq %rax, %r14
testq %rax, %rax
jne 0x82c8
leaq 0x2026(%rip), %rdi      # 0xa2db
leaq 0x250e(%rip), %rdx      # 0xa7ca
movl $0x1a2, %esi            # imm = 0x1A2
xorl %eax, %eax
callq 0x94d0
movq %r15, %rdi
callq 0x833e
movq %rax, %r15
testq %rax, %rax
jne 0x82f2
leaq 0x1ffc(%rip), %rdi      # 0xa2db
leaq 0x2510(%rip), %rdx      # 0xa7f6
movl $0x1a9, %esi            # imm = 0x1A9
xorl %eax, %eax
callq 0x94d0
addq $0x4, %r15
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: IPParser::consume(Buffer const&)
void consume(const Buffer &b)
    {
        str_.assign((char*) b.data(), b.size());
        char_split(str_, scratch_, toks, '.');

        if (toks.size() != 4)
        {
            return;
        }

        unsigned quad = to_u(toks[0]) << 24 | 
                        to_u(toks[1]) << 16 | 
                        to_u(toks[2]) << 8 | 
                        to_u(toks[3]);

        emit(Buffer(&quad, sizeof(quad)));
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x32b0
leaq 0x30(%rbx), %rsi
leaq 0x50(%rbx), %rdx
pushq $0x2e
popq %rcx
movq %r14, %rdi
callq 0x8023
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
cmpq $0x20, %rcx
jne 0x87c2
movq (%rax), %rdi
callq 0x4b25
movl %eax, %ebp
shll $0x18, %ebp
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x4b25
movl %eax, %r14d
shll $0x10, %r14d
orl %ebp, %r14d
movq 0x50(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x4b25
movl %eax, %ebp
shll $0x8, %ebp
movq 0x50(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x4b25
orl %ebp, %eax
orl %r14d, %eax
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq $0x4, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: IPScanner::consume(Buffer const&)
void consume(const Buffer &b)
    {
        unsigned quad = *(unsigned*)(b.data());

        IPResult result;
        geo_data_.query(quad, result);

        emit(Buffer(&result, sizeof(result)));
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movl (%rax), %esi
leaq 0x10(%rsp), %r14
andl $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x28(%r14)
movq 0x10(%rdi), %rdi
movq %r14, %rdx
callq 0x8820
movq %rsp, %rsi
movq %r14, (%rsi)
movq $0x38, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: GeoData::query(unsigned int, IPResult&) const
void query(unsigned quad, IPResult &result) const
    {
        result.quad = quad;

        unsigned block_idx = block_query(location_ip_blocks_, quad);

        if (block_idx != -1U)
        {
            unsigned loc_idx = location_ip_blocks_.loc[block_idx];
            const PackedLocation& loc = location_data_.locations[loc_idx];

            result.country = location_data_.country[loc.country];
            result.region = location_data_.region[loc.region];
            result.city = location_data_.city[loc.city];
            result.lat = loc.lat;
            result.lon = loc.lon;
        }

        block_idx = block_query(asn_ip_blocks_, quad);

        if (block_idx != -1U)
        {
            unsigned asn_idx = asn_ip_blocks_.loc[block_idx];
            const PackedASN& asn = asn_data_.asns[asn_idx];

            result.asn = &asn.number;
            result.asn_text = asn_data_.text[asn.text];
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, (%rdx)
leaq 0x18(%rdi), %rsi
movl %ebp, %edx
callq 0x88e6
cmpl $-0x1, %eax
je 0x8897
movl %eax, %eax
movq 0x28(%r14), %rcx
movq 0x38(%r14), %rdx
movl 0x4(%rcx,%rax,4), %eax
movq 0x60(%r14), %rcx
imulq $0x18, %rax, %rax
movl 0x8(%rcx,%rax), %esi
movl 0x4(%rdx,%rsi,4), %edx
addq 0x30(%r14), %rdx
movq %rdx, 0x8(%rbx)
movl 0xc(%rcx,%rax), %edx
movq 0x48(%r14), %rsi
movl 0x4(%rsi,%rdx,4), %edx
addq 0x40(%r14), %rdx
movq %rdx, 0x10(%rbx)
movl 0x10(%rcx,%rax), %edx
movq 0x58(%r14), %rsi
movl 0x4(%rsi,%rdx,4), %edx
addq 0x50(%r14), %rdx
movq %rdx, 0x18(%rbx)
movsd 0x14(%rcx,%rax), %xmm0
movsd %xmm0, 0x20(%rbx)
leaq 0x68(%r14), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x88e6
cmpl $-0x1, %eax
je 0x88e0
movl %eax, %eax
movq 0x78(%r14), %rcx
movq 0x90(%r14), %rdx
movl 0x4(%rcx,%rax,4), %eax
leaq (%rdx,%rax,8), %rax
addq $0x4, %rax
movq %rax, 0x28(%rbx)
movl 0x4(%rax), %eax
movq 0x88(%r14), %rcx
movl 0x4(%rcx,%rax,4), %eax
addq 0x80(%r14), %rax
movq %rax, 0x30(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: GeoData::block_query(BlockTable const&, unsigned int) const
unsigned block_query(const BlockTable &blocks, unsigned quad) const
    {
        // find first pos compares gt quad
        
        const unsigned* iter = 
            std::upper_bound(blocks.start_ip.begin(),
                             blocks.start_ip.end(),
                             quad);

        if (iter == blocks.start_ip.begin())
        {
            return -1;
        }

        unsigned idx = iter - blocks.start_ip.begin();
        unsigned ri = idx - 1;

        if (quad >= blocks.start_ip[ri] &&
            quad <= blocks.end_ip[ri])
        {
            return ri;
        }

        return -1;
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
leaq 0xc(%rsp), %rax
movl %edx, (%rax)
movq (%rsi), %rcx
leaq 0x4(%rcx), %rdi
movl (%rcx), %edx
leaq (%rcx,%rdx,4), %rsi
addq $0x4, %rsi
movq %rax, %rdx
callq 0x893e
movq (%rbx), %rdx
addq $0x4, %rdx
pushq $-0x1
popq %rcx
subq %rdx, %rax
je 0x8936
shrq $0x2, %rax
decl %eax
movl 0xc(%rsp), %esi
cmpl (%rdx,%rax,4), %esi
jb 0x8936
movq 0x8(%rbx), %rdx
cmpl 0x4(%rdx,%rax,4), %esi
jbe 0x8938
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: IPResultEmitter::consume(Buffer const&)
void consume(const Buffer &b)
    {
        const IPResult* result = (const IPResult*)(b.data());

        print_buf_.clear();

        print_ip(result->quad); delimit();
        print(result->country); delimit();
        print(result->region); delimit();
        print(result->city); delimit();
        print(result->lat); delimit();
        print(result->lon); delimit();
        print_as(result->asn); delimit();
        print(result->asn_text);
        newline();

        size_t n = fwrite(&print_buf_[0], print_buf_.size(), 1, stdout);
        REL_ASSERT(n == 1);

        print_buf_.clear();
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r14
andq $0x0, 0x18(%rdi)
movq 0x10(%rdi), %rax
movb $0x0, (%rax)
movl (%r14), %esi
callq 0x8a7c
movq %rbx, %rdi
callq 0x8aa8
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x8ab8
movq %rbx, %rdi
callq 0x8aa8
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x8ab8
movq %rbx, %rdi
callq 0x8aa8
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x8ab8
movq %rbx, %rdi
callq 0x8aa8
movss 0x20(%r14), %xmm0
movq %rbx, %rdi
callq 0x8ad6
movq %rbx, %rdi
callq 0x8aa8
movss 0x24(%r14), %xmm0
movq %rbx, %rdi
callq 0x8ad6
movq %rbx, %rdi
callq 0x8aa8
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x8b0e
movq %rbx, %rdi
callq 0x8aa8
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x8ab8
movq %rbx, %rdi
callq 0x8b56
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x757b(%rip), %rax      # 0xffb8
movq (%rax), %rcx
pushq $0x1
popq %rdx
callq 0x33d0
cmpq $0x1, %rax
je 0x8a68
leaq 0x1b95(%rip), %rdi      # 0xa5ea
leaq 0x1e5a(%rip), %rdx      # 0xa8b6
movl $0x171, %esi            # imm = 0x171
xorl %eax, %eax
callq 0x94d0
andq $0x0, 0x18(%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: IPResultEmitter::print_as(unsigned int const*)
void print_as(const unsigned *asn) 
    {
        char sbuf[32];
        int nb = 0;

        if (!asn)
        {
            nb = sprintf(sbuf, "%%");
        }
        else
        {
            nb = sprintf(sbuf, "AS%u", *asn);
        }

        writes(sbuf, nb);
    }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
je 0x8b30
movl (%rsi), %edx
leaq 0x1dbe(%rip), %rsi      # 0xa8e2
movq %rsp, %rdi
xorl %eax, %eax
callq 0x3060
jmp 0x8b41
leaq 0x1da8(%rip), %rsi      # 0xa8df
movq %rsp, %rdi
xorl %eax, %eax
callq 0x3060
movslq %eax, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x8b94
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: ip_to_s(char*, unsigned int)
inline int ip_to_s(char* out, unsigned quad)
{
    int a = (quad >> 24) & 0xff;
    int b = (quad >> 16) & 0xff;
    int c = (quad >> 8) & 0xff;
    int d = (quad) & 0xff;

    return sprintf(out, "%d.%d.%d.%d", a, b, c, d);
}

// Assembly:
movl %esi, %ecx
shrl $0x10, %ecx
movl $0xff, %r9d
andl %r9d, %ecx
movl %esi, %r8d
shrl $0x8, %r8d
andl %r9d, %r8d
andl %esi, %r9d
movl %esi, %edx
shrl $0x18, %edx
leaq 0x1d41(%rip), %rsi      # 0xa8cd
xorl %eax, %eax
jmp 0x3060
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/query.hpp
// Function: escape(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const*)
inline void escape(std::string &out, const char* str)
{
    if (!str)
    {
        out = "%";
        return;
    }

    size_t n = strlen(str);

    if (n == 0)
    {
        out = "%";
        return;
    }

    out.resize(n);

    char* out_iter = &out[0];
    const char* in_iter = str;

    while (*in_iter)
    {
        int outc = (*in_iter == ' ') ? '+' : *in_iter;
        *out_iter++ = outc;

        ++in_iter;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
testq %rsi, %rsi
je 0x8c07
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x30e0
testq %rax, %rax
je 0x8c07
movq %r14, %rdi
movq %rax, %rsi
callq 0x32e0
movq (%r14), %rax
xorl %ecx, %ecx
movzbl (%rbx,%rcx), %edx
movb $0x2b, %sil
cmpl $0x20, %edx
je 0x8bfe
testl %edx, %edx
je 0x8c1d
movl %edx, %esi
movb %sil, (%rax,%rcx)
incq %rcx
jmp 0x8bec
leaq 0x1cd2(%rip), %rsi      # 0xa8e0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x33c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/error.cpp
// Function: log_context(char const*, unsigned int, char const*, ...)
void log_context(const char* file, unsigned line, const char* fmt, ...)
{
    va_list ap;
    int n = 0;

    va_start(ap, fmt);
    n = vsnprintf(print_buf_, 4096, fmt, ap);
    va_end(ap);

    if (n > 4095) n = 4095;

    // replace the nul terminator with a new line

    print_buf_[n] = '\n';

    memcpy(error_buf_ + error_offset_, print_buf_, n + 1);
    memcpy(error_buf_ + error_offset_ + 4096, print_buf_, n + 1);

    error_offset_ += n+1;
    error_offset_ = error_offset_ % 4096;

    avail_ += (n+1);

    if (avail_ > 4096)
    {
        avail_ = 4096;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x9415
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0x6df4(%rip), %rbx      # 0x10230
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x3160
movl $0xfff, %ebp            # imm = 0xFFF
cmpl %ebp, %eax
cmovgel %ebp, %eax
movslq %eax, %r13
movb $0xa, (%r13,%rbx)
movq 0x9dcd(%rip), %r12      # 0x13230
leaq 0x7dc6(%rip), %r14      # 0x11230
addq %r12, %r14
leaq 0x1(%r13), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x31b0
movl $0x1000, %eax           # imm = 0x1000
addq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x31b0
leal (%r12,%r13), %eax
incl %eax
andl %ebp, %eax
movq %rax, 0x9d8c(%rip)      # 0x13230
addq 0x9d8d(%rip), %r15      # 0x13238
movl $0x1000, %eax           # imm = 0x1000
cmpq %rax, %r15
cmovaeq %rax, %r15
movq %r15, 0x9d7a(%rip)      # 0x13238
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/loadzero[P]geoloc/geoloc/error.cpp
// Function: fatal_error(char const*, unsigned int, char const*, ...)
void fatal_error(const char* file, unsigned line, const char* fmt, ...)
{
    va_list ap;
    fprintf(stderr, "%s:%d: error: ", file, line);

    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);

    fprintf(stderr, "\n");

    if (avail_)
    {
        fprintf(stderr, "context:\n");
        log_dump();
    }

    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdx, %rbx
movl %esi, %r10d
movq %rdi, %rdx
leaq 0x20(%rsp), %r15
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x9531
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x6aa0(%rip), %r14      # 0xffd8
movq (%r14), %rdi
leaq 0x1459(%rip), %rsi      # 0xa99b
movl %r10d, %ecx
xorl %eax, %eax
callq 0x3300
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x32a0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3280
cmpq $0x0, 0x9cae(%rip)      # 0x13238
je 0x95c5
movq (%r14), %rcx
leaq 0x1414(%rip), %rdi      # 0xa9aa
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x33d0
leaq 0x7c88(%rip), %rdi      # 0x11230
addq 0x9c81(%rip), %rdi      # 0x13230
subq 0x9c82(%rip), %rdi      # 0x13238
addq $0x1000, %rdi           # imm = 0x1000
movq (%r14), %rsi
callq 0x3210
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/t0mm4rx[P]piscine_cpp/day01/ex00/main.cpp
// Function: main
int main(void)
{
	std::cout << "Pony on the stack, doesn't call any destructor" << std::endl;
	ponyOnTheStack();
	std::cout << std::endl << "Pony on the heap, call delete" << std::endl;
	ponyOnTheHeap();
}

// Assembly:
pushq %rbx
movq 0x2ae6(%rip), %rbx      # 0x3fd8
leaq 0xb5c(%rip), %rsi       # 0x2055
movq %rbx, %rdi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
callq 0x1436
movq %rbx, %rdi
callq 0x1070
leaq 0xb67(%rip), %rsi       # 0x2084
movq %rax, %rdi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
callq 0x1378
xorl %eax, %eax
popq %rbx
retq