LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/etl.hpp
// Function: etl(char const*, char const*, char const*, char const*)
inline void etl(const char* city_blocks,
                const char* city_locs,
                const char* geo_asns,
                const char* output)
{
    LOG_CONTEXT("etl blocks %s locs %s asns %s into file %s", 
                 city_blocks,
                 city_locs,
                 geo_asns,
                 output);

    BinaryFile file;
    bool ok = file.open(output);

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

    char buf[32]; get_header(buf, sizeof(buf));

    file.save_bytes_raw(buf, sizeof(buf));
    build_geo_data(file, city_blocks, city_locs, geo_asns);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rcx, (%rsp)
leaq 0x7006(%rip), %rdi      # 0xb277
leaq 0x700e(%rip), %rdx      # 0xb286
movl $0x6b, %esi
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xa47c
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x702a(%rip), %rsi      # 0xb2cf
movq %r12, %rdi
callq 0x3240
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x42d4
leaq 0x6fb9(%rip), %rdi      # 0xb277
leaq 0x6fec(%rip), %rdx      # 0xb2b1
movl $0x72, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0xa594
movaps 0x6d35(%rip), %xmm0     # 0xb010
leaq 0x30(%rsp), %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x6fe3(%rip), %rdx      # 0xb2d1
leaq 0x700d(%rip), %rcx      # 0xb302
movl $0x20, %esi
xorl %eax, %eax
callq 0x3320
movl %eax, %ebp
testl %eax, %eax
jns 0x4321
leaq 0x6f69(%rip), %rdi      # 0xb277
leaq 0x6fd5(%rip), %rdx      # 0xb2ea
movl $0x57, %esi
xorl %eax, %eax
callq 0xa594
cmpl $0x1f, %ebp
movl $0x1f, %eax
cmovll %ebp, %eax
cltq
movb $0x2d, 0x30(%rsp,%rax)
leaq 0x30(%rsp), %rsi
movb $0xa, 0x1f(%rsi)
leaq 0x10(%rsp), %rdi
movl $0x20, %edx
callq 0x44f4
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x4552
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x46e1
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x488d
leaq 0x10(%rsp), %rdi
callq 0x4530
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x438b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4530
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x4185
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/query.hpp
// Function: query(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, bool)
inline void query(const char* data_file_name,
                  const std::vector<std::string> &data_sources,
                  bool show_headers)
{
    LOG_CONTEXT("query data %s with %zu sources", data_file_name, data_sources.size());

    GeoData data;
    data.open(data_file_name);

    if (show_headers)
    {
        IPResultEmitter::show_headers();
    }

    for (size_t i = 0; i < data_sources.size(); ++i)
    {
        query(data, data_sources[i]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r8
subq (%rsi), %r8
sarq $0x5, %r8
leaq 0x7247(%rip), %rdi      # 0xb618
leaq 0x7251(%rip), %rdx      # 0xb629
movl $0x1b3, %esi            # imm = 0x1B3
movq %r14, %rcx
xorl %eax, %eax
callq 0xa47c
leaq 0x8(%rsp), %r15
movl $0x98, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3120
movq %r15, %rdi
movq %r14, %rsi
callq 0x885c
testb %bpl, %bpl
je 0x442b
movq 0xbba6(%rip), %rax      # 0xffb8
movq (%rax), %rcx
leaq 0x7434(%rip), %rdi      # 0xb850
movl $0x39, %esi
movl $0x1, %edx
callq 0x33a0
movq (%rbx), %rsi
cmpq %rsi, 0x8(%rbx)
je 0x4464
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
xorl %r12d, %r12d
addq %r15, %rsi
movq %r14, %rdi
callq 0x8975
incq %r12
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r15
cmpq %rax, %r12
jb 0x443f
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4478
movq 0x10(%rsp), %rsi
callq 0x3140
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x448a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x44a1
movq 0x10(%rsp), %rsi
callq 0x3140
movq %rbx, %rdi
callq 0x3350
nop
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/etl.hpp
// Function: build_blocks(BinaryFile&, char const*)
inline void build_blocks(BinaryFile &file, const char* source)
{
    LOG_CONTEXT("build_blocks from %s", source);

    FileReader reader(source);
    BlockParser parser;

    std::vector<Block> blocks;
    Collector<Block> collector(blocks);

    reader | parser | collector;
    reader.produce();

    save_blocks(file, blocks);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x6d08(%rip), %rdi      # 0xb277
leaq 0x6dcf(%rip), %rdx      # 0xb345
movl $0x27, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xa47c
leaq 0x48(%rsp), %rdi
movq %rsp, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x30e0
leaq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %r15
movq %r15, %rsi
callq 0x4a3a
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45bd
callq 0x31d0
leaq 0xb4d4(%rip), %r13      # 0xfa98
leaq 0x68(%rsp), %r12
movq %r13, -0x20(%r12)
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movups %xmm0, 0x20(%r12)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x98(%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0xb4de(%rip), %rax      # 0xfae8
movq %rax, (%rcx)
movq %r14, 0x10(%rcx)
leaq 0x20(%rsp), %r14
movq %r15, 0x8(%r14)
movq %rcx, -0x18(%r12)
movq %r14, %rdi
callq 0x51ce
testb %al, %al
jne 0x461f
leaq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4ad2
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x464f
callq 0x31d0
movq %r13, 0x48(%rsp)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x4663
callq 0x31d0
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x4672
callq 0x31d0
leaq 0x20(%rsp), %rdi
callq 0x4cd0
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x46d1
callq 0x31d0
jmp 0x46d1
movq %rax, %rbx
jmp 0x46d1
jmp 0x46ac
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x46bd
callq 0x31d0
leaq 0x48(%rsp), %rdi
callq 0x4c9e
leaq 0x20(%rsp), %rdi
callq 0x4cd0
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x4185
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/etl.hpp
// Function: build_locations(BinaryFile&, char const*)
inline void build_locations(BinaryFile &file, const char* source)
{
    LOG_CONTEXT("build_locations from %s", source);

    FileReader reader(source);
    LocationParser parser;

    std::vector<Location> locations;
    Collector<Location> collector(locations);

    reader | parser | collector;
    reader.produce();

    save_locations(file, locations);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x6b78(%rip), %rdi      # 0xb277
leaq 0x6df4(%rip), %rdx      # 0xb4fa
movl $0x17, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xa47c
leaq 0x40(%rsp), %rdi
movq %rsp, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x30e0
leaq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x4a3a
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x474d
callq 0x31d0
leaq 0xb3e4(%rip), %rbp      # 0xfb38
leaq 0x60(%rsp), %r12
movq %rbp, -0x20(%r12)
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movups %xmm0, 0x20(%r13)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0xb0(%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0xb3dd(%rip), %rax      # 0xfb88
movq %rax, (%rcx)
movq %r14, 0x10(%rcx)
leaq 0x18(%rsp), %r14
movq %r15, 0x8(%r14)
movq %rcx, -0x38(%r13)
movq %r14, %rdi
callq 0x51ce
testb %al, %al
jne 0x47bf
leaq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5a62
movq %rsp, %rdi
callq 0x5e5a
movq %rbp, 0x40(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x4800
callq 0x31d0
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x480f
callq 0x31d0
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x481e
callq 0x31d0
leaq 0x18(%rsp), %rdi
callq 0x4cd0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4869
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x487d
callq 0x31d0
jmp 0x487d
movq %rax, %rbx
jmp 0x487d
jmp 0x485e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5e5a
leaq 0x40(%rsp), %rdi
callq 0x5e9e
leaq 0x18(%rsp), %rdi
callq 0x4cd0
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x4185
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/etl.hpp
// Function: build_asns(BinaryFile&, char const*)
inline void build_asns(BinaryFile &file, const char* source)
{
    LOG_CONTEXT("build_asns from %s", source);

    FileReader reader(source);
    ASNParser parser;

    std::vector<ASN> asns;
    Collector<ASN> collector(asns);

    reader | parser | collector;
    reader.produce();

    save_asns(file, asns);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x69cc(%rip), %rdi      # 0xb277
leaq 0x6ca2(%rip), %rdx      # 0xb554
movl $0x37, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xa47c
leaq 0x40(%rsp), %rdi
movq %rsp, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x30e0
leaq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x4a3a
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x48f9
callq 0x31d0
leaq 0xb2d8(%rip), %rbp      # 0xfbd8
leaq 0x60(%rsp), %r12
movq %rbp, -0x20(%r12)
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movups %xmm0, 0x20(%r13)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0xb0(%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0xb2d1(%rip), %rax      # 0xfc28
movq %rax, (%rcx)
movq %r14, 0x10(%rcx)
leaq 0x18(%rsp), %r14
movq %r15, 0x8(%r14)
movq %rcx, -0x38(%r13)
movq %r14, %rdi
callq 0x51ce
testb %al, %al
jne 0x496b
leaq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x77d3
movq %rsp, %rdi
callq 0x7be8
movq %rbp, 0x40(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x49ac
callq 0x31d0
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x49bb
callq 0x31d0
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x49ca
callq 0x31d0
leaq 0x18(%rsp), %rdi
callq 0x4cd0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4a15
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a29
callq 0x31d0
jmp 0x4a29
movq %rax, %rbx
jmp 0x4a29
jmp 0x4a0a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7be8
leaq 0x40(%rsp), %rdi
callq 0x7c3a
leaq 0x18(%rsp), %rdi
callq 0x4cd0
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x4185
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movq %rax, 0x8(%rdi)
leaq 0xafd7(%rip), %rcx      # 0xfa28
movq %rcx, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq %rax, 0x20(%rdi)
leaq 0x68f4(%rip), %rsi      # 0xb35a
movq %rbx, %rdi
callq 0x3080
testl %eax, %eax
je 0x4a83
movq (%rbx), %rdi
leaq 0x6c0c(%rip), %rsi      # 0xb688
callq 0x3240
jmp 0x4a8d
movq 0xb546(%rip), %rax      # 0xffd0
movq (%rax), %rax
movq %rax, 0x20(%r14)
testq %rax, %rax
jne 0x4aba
movq (%rbx), %rcx
leaq 0x68bc(%rip), %rdi      # 0xb35c
leaq 0x68c9(%rip), %rdx      # 0xb370
movl $0x28, %esi
xorl %eax, %eax
callq 0xa594
cmpq $0x0, 0x20(%r14)
je 0x4ac2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x33f3
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x60, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %rcx, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq %rcx, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
movq %rdi, %rbx
sarq $0x2, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x5236
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x2, %rsi
imulq %r15, %rsi
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x5236
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x2, %rsi
imulq %r15, %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x5236
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
je 0x4bca
sarq $0x2, %rcx
imulq %r15, %rcx
movq 0x40(%rsp), %rdx
movq 0x20(%rsp), %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq (%rsp), %rdi
addq $0x8, %rax
xorl %r8d, %r8d
xorl %r9d, %r9d
movl -0x8(%rax), %r10d
cmpl %r9d, %r10d
jbe 0x4c46
cmpl %r10d, -0x4(%rax)
jb 0x4c27
movl %r10d, (%rdx,%r8,4)
movl -0x4(%rax), %r9d
movl %r9d, (%rsi,%r8,4)
movl (%rax), %r9d
movl %r9d, (%rdi,%r8,4)
movl -0x4(%rax), %r9d
incq %r8
addq $0xc, %rax
cmpq %r8, %rcx
jne 0x4b90
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x5274
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x5274
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5274
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4bfd
callq 0x31d0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4c0c
callq 0x31d0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4c1b
callq 0x31d0
movb $0x1, %al
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x67dd(%rip), %rdi      # 0xb40b
leaq 0x6789(%rip), %rsi      # 0xb3be
leaq 0x6794(%rip), %rcx      # 0xb3d0
movl $0x68, %edx
callq 0x3170
leaq 0x675c(%rip), %rdi      # 0xb3a9
leaq 0x676a(%rip), %rsi      # 0xb3be
leaq 0x6775(%rip), %rcx      # 0xb3d0
movl $0x67, %edx
callq 0x3170
jmp 0x4c67
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4c78
callq 0x31d0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4c87
callq 0x31d0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4c96
callq 0x31d0
movq %rbx, %rdi
callq 0x3350
// File: /workspace/github_cpp_makefile_star2_O3/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 0xad4d(%rip), %rax      # 0xfa28
movq %rax, (%rdi)
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x4cf8
movq 0xb2e2(%rip), %rax      # 0xffd0
cmpq (%rax), %rdi
je 0x4cf8
callq 0x31e0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x4d07
popq %rbx
jmp 0x3250
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4e0e
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 0x4e0f
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x18, %rcx
jne 0x4e07
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
leaq 0xc(%rsp), %r14
movl %eax, (%r14)
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movl %eax, 0x4(%r14)
movq 0x30(%rbx), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
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_O3/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, %r8
movq %rdi, %rcx
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4e31
movq %rax, 0x8(%rbx)
xorl %r15d, %r15d
movq %r15, 0x8(%r14)
movq (%r14), %rax
movb $0x0, (%rax)
movq 0x8(%r14), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x3300
movq (%r14), %rax
movq %r15, 0x8(%rsp)
movb (%rax), %cl
testb %cl, %cl
je 0x4ef6
movb $0x1, %dl
leaq 0x8(%rsp), %r14
testb $0x1, %dl
jne 0x4e73
movb $0x0, (%rax)
movb 0x1(%rax), %cl
incq %rax
cmpb $0x22, %cl
jne 0x4e95
incq %rax
movq %rax, 0x8(%rsp)
movq %rax, %r15
movzbl (%r15), %eax
testl %eax, %eax
je 0x4ec2
cmpl $0x22, %eax
je 0x4ebb
incq %r15
jmp 0x4e83
movq %rax, 0x8(%rsp)
movq %rax, %r15
movzbl (%r15), %ecx
testl %ecx, %ecx
je 0x4eaf
cmpl $0x2c, %ecx
je 0x4eaf
incq %r15
jmp 0x4e9d
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x4ed1
jmp 0x4edb
movb $0x0, (%r15)
incq %r15
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4edb
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x4ee6
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4f00
movb (%r15), %cl
xorl %edx, %edx
movq %r15, %rax
testb %cl, %cl
jne 0x4e65
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x32a0
movq %rax, %r14
testq %rax, %rax
jle 0x5225
movq (%r15), %rax
cmpb $0xa, -0x1(%rax,%r14)
jne 0x5210
movb $0x0, -0x1(%rax,%r14)
leaq -0x1(%r14), %rcx
movq (%r15), %rax
jmp 0x5213
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_O3/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 0x61b7(%rip), %rsi      # 0xb43f
callq 0x58e2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x595e
movq (%rbx), %rdi
callq 0x3280
movq %rax, %r14
movq 0x8(%r15), %rsi
subq (%r15), %rsi
shrq $0x2, %rsi
movq %rbx, %rdi
callq 0x595e
movq (%r15), %rsi
movq 0x8(%r15), %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x599e
movq (%rbx), %rdi
callq 0x3280
movq %rax, %r15
movl %r15d, %ebp
subl %r14d, %ebp
addq $-0x4, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59ec
movq %rbx, %rdi
movl %ebp, %esi
callq 0x595e
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x59ec
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3100
cmpq $0x4, %rax
jne 0x593e
movq (%r14), %rcx
movl $0x1, %esi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x33a0
cmpq $0x4, %rax
jne 0x591d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x59e5(%rip), %rdi      # 0xb309
leaq 0x5b51(%rip), %rdx      # 0xb47c
movl $0xcb, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa594
leaq 0x5aff(%rip), %rdi      # 0xb444
leaq 0x59bd(%rip), %rsi      # 0xb309
leaq 0x5b00(%rip), %rcx      # 0xb453
movl $0xc6, %edx
callq 0x3170
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x1, %esi
movq %rax, %rdi
callq 0x33a0
cmpq %r14, %rax
je 0x59dd
leaq 0x5942(%rip), %rdi      # 0xb309
leaq 0x5aea(%rip), %rdx      # 0xb4b8
movl $0xdf, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xa594
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a22
// File: /workspace/github_cpp_makefile_star2_O3/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
movq (%rdi), %rdi
callq 0x3280
leal 0x3(%rax), %r14d
andl $-0x4, %r14d
movq (%rbx), %rdi
callq 0x3280
subl %eax, %r14d
leaq 0x4(%rsp), %rsi
movl $0x0, (%rsi)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x44f4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x69fa
testq %rax, %rax
jne 0x6788
movq 0x38(%rbx), %r15
subq 0x30(%rbx), %r15
shrq $0x2, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a6c
movl %r15d, (%rax)
leaq 0x48(%rbx), %r15
movq 0x50(%rbx), %rsi
movl 0x48(%rbx), %eax
movl %esi, %ecx
subl %eax, %ecx
movl %ecx, 0xc(%rsp)
movq 0x38(%rbx), %rax
cmpq 0x40(%rbx), %rax
je 0x673c
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x38(%rbx)
jmp 0x6751
leaq 0x30(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movq %rax, %rsi
callq 0x7062
movq 0x50(%rbx), %rsi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
addq %rdx, %rcx
movq %r15, %rdi
callq 0x713a
movb $0x0, 0xb(%rsp)
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x677b
movb $0x0, (%rsi)
incq 0x50(%rbx)
jmp 0x6788
leaq 0xb(%rsp), %rdx
movq %r15, %rdi
callq 0x731c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4e0f
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
cmpq $0x18, %rcx
jne 0x7d3e
leaq 0x10(%rsp), %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movl %eax, -0x20(%r15)
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movl %eax, -0x1c(%r15)
movq 0x50(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x7d64
movq %rsp, %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq $0x30, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d3e
callq 0x31d0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7d4a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d5c
callq 0x31d0
movq %rbx, %rdi
callq 0x3350
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2dab(%rip), %rdi      # 0xb618
leaq 0x2dd4(%rip), %rdx      # 0xb648
movl $0x40, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xa47c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8e8c
testb %al, %al
jne 0x88af
leaq 0x2d7f(%rip), %rdi      # 0xb618
leaq 0x2db8(%rip), %rdx      # 0xb658
movl $0x46, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xa594
leaq 0x2d62(%rip), %r14      # 0xb618
leaq 0x2db9(%rip), %rdx      # 0xb676
movq %r14, %rdi
movl $0x49, %esi
xorl %eax, %eax
callq 0xa47c
movq %rbx, %rdi
callq 0x8bee
leaq 0x2daf(%rip), %rdx      # 0xb68a
movq %r14, %rdi
movl $0x4c, %esi
xorl %eax, %eax
callq 0xa47c
leaq 0x18(%rbx), %rdi
movq %rbx, %rsi
callq 0x8df6
leaq 0x2dad(%rip), %rdx      # 0xb6aa
movq %r14, %rdi
movl $0x4f, %esi
xorl %eax, %eax
callq 0xa47c
leaq 0x30(%rbx), %rdi
movq %rbx, %rsi
callq 0x8e48
leaq 0x2da6(%rip), %rdx      # 0xb6c5
movq %r14, %rdi
movl $0x52, %esi
xorl %eax, %eax
callq 0xa47c
leaq 0x68(%rbx), %rdi
movq %rbx, %rsi
callq 0x8df6
leaq 0x2d9f(%rip), %rdx      # 0xb6e0
movq %r14, %rdi
movl $0x55, %esi
xorl %eax, %eax
callq 0xa47c
leaq 0x80(%rbx), %rsi
movq %rbx, %rdi
callq 0x914c
leaq 0x90(%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x92bc
// File: /workspace/github_cpp_makefile_star2_O3/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 0x25b7(%rip), %rdi      # 0xb3be
leaq 0x299b(%rip), %rdx      # 0xb7a9
movl $0x22, %esi
xorl %eax, %eax
callq 0xa47c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x905e
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x905e
addq $0x10, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x905e
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x914c
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x914c
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x914c
addq $0x30, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x91ba
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x8f44
movl %eax, %ebp
movl %eax, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3380
cmpq $-0x1, %rax
je 0x8f0c
movq %rax, %r15
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3380
cmpq $-0x1, %rax
je 0x8f24
movq %r15, 0x8(%r14)
xorl %edi, %edi
movq %r15, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x3360
movq %rax, (%r14)
testq %rax, %rax
je 0x8f52
movl %ebp, %edi
callq 0x33b0
movb $0x1, %r15b
jmp 0x8f44
leaq 0x23f6(%rip), %rdi      # 0xb309
leaq 0x27dc(%rip), %rdx      # 0xb6f6
xorl %r15d, %r15d
movl $0x76, %esi
jmp 0x8f3a
leaq 0x23de(%rip), %rdi      # 0xb309
leaq 0x27e0(%rip), %rdx      # 0xb712
xorl %r15d, %r15d
movl $0x7e, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xa47c
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23b0(%rip), %rdi      # 0xb309
leaq 0x27ce(%rip), %rdx      # 0xb72e
xorl %r15d, %r15d
movl $0x87, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xa47c
movl %ebp, %edi
callq 0x33b0
jmp 0x8f44
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9098
movq %rax, %r14
testq %rax, %rax
jne 0x908c
leaq 0x2290(%rip), %rdi      # 0xb309
leaq 0x2739(%rip), %rdx      # 0xb7b9
movl $0x195, %esi            # imm = 0x195
xorl %eax, %eax
callq 0xa594
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9098
movq %rax, %r14
testq %rax, %rax
jne 0x917e
leaq 0x219e(%rip), %rdi      # 0xb309
leaq 0x2686(%rip), %rdx      # 0xb7f8
movl $0x1a2, %esi            # imm = 0x1A2
xorl %eax, %eax
callq 0xa594
movq %r15, %rdi
callq 0x91f4
movq %rax, %r15
testq %rax, %rax
jne 0x91a8
leaq 0x2174(%rip), %rdi      # 0xb309
leaq 0x2688(%rip), %rdx      # 0xb824
movl $0x1a9, %esi            # imm = 0x1A9
xorl %eax, %eax
callq 0xa594
addq $0x4, %r15
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/loadzero[P]geoloc/geoloc/query.hpp
// Function: void query<FileReader>(FileReader&, GeoData&)
inline void query(T &reader, GeoData &data)
{
    IPParser parser;
    IPScanner scanner(data);

    IPResultEmitter emitter;

    reader | parser | scanner | emitter;
    reader.produce();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x90(%rsp), %r14
movq %rax, -0x18(%r14)
leaq 0x68f6(%rip), %rcx      # 0xfc78
movq %rcx, -0x20(%r14)
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq %rax, 0x20(%r15)
movq %rax, 0x10(%rsp)
leaq 0x690c(%rip), %rcx      # 0xfcc8
movq %rcx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
leaq 0x40(%rsp), %r13
movq %rax, -0x18(%r13)
leaq 0x6942(%rip), %rbp      # 0xfd18
movq %rbp, -0x20(%r13)
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
movq (%rdi), %rax
leaq 0x70(%rsp), %rsi
callq *0x20(%rax)
movq (%rax), %rcx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq *0x20(%rcx)
movq (%rax), %rcx
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq *0x20(%rcx)
movq %rbx, %rdi
callq 0x51ce
testb %al, %al
jne 0x9420
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq %rbp, 0x20(%rsp)
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x9449
callq 0x31d0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x9458
callq 0x31d0
leaq 0x6819(%rip), %rax      # 0xfc78
movq %rax, 0x70(%rsp)
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x9476
callq 0x31d0
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x9488
callq 0x31d0
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x949a
callq 0x31d0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x94ae
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9652
leaq 0x70(%rsp), %rdi
callq 0x9688
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x4185
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
addq $0x10, %rdi
movq (%rsi), %rcx
movq 0x8(%rsi), %r8
movq 0x18(%rbx), %rdx
xorl %esi, %esi
callq 0x3300
leaq 0x30(%rbx), %rdi
movq 0x50(%rbx), %rax
cmpq %rax, 0x58(%rbx)
je 0x9702
movq %rax, 0x58(%rbx)
movq $0x0, 0x38(%rbx)
movq 0x30(%rbx), %rax
movb $0x0, (%rax)
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %r8
movq 0x38(%rbx), %rdx
xorl %esi, %esi
callq 0x3230
movq 0x30(%rbx), %r12
cmpb $0x0, (%r12)
je 0x978b
leaq 0x50(%rbx), %r14
movb $0x1, %al
leaq 0x8(%rsp), %r15
testb $0x1, %al
jne 0x9746
movb $0x0, (%r12)
incq %r12
movq %r12, %rax
movq %r12, 0x8(%rsp)
decq %r12
movzbl 0x1(%r12), %ecx
incq %r12
cmpl $0x2e, %ecx
je 0x9763
testl %ecx, %ecx
jne 0x9751
movq 0x58(%rbx), %rsi
cmpq 0x60(%rbx), %rsi
je 0x9777
movq %rax, (%rsi)
addq $0x8, 0x58(%rbx)
jmp 0x9782
movq %r14, %rdi
movq %r15, %rdx
callq 0x4f00
xorl %eax, %eax
cmpb $0x0, (%r12)
jne 0x973a
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
cmpq $0x20, %rcx
jne 0x9828
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movq %rax, %r15
shll $0x18, %r15d
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movq %rax, %r14
shll $0x10, %r14d
orl %r15d, %r14d
movq 0x50(%rbx), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
movq %rax, %r15
shll $0x8, %r15d
movq 0x50(%rbx), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x30b0
orl %r15d, %eax
orl %r14d, %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq $0x4, 0x8(%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r12
leaq 0x10(%rdi), %r14
movq $0x0, 0x18(%rdi)
movq 0x10(%rdi), %rax
movb $0x0, (%rax)
movl (%r12), %esi
callq 0x9b5c
movq 0x18(%rbx), %rsi
leaq 0x1fe9(%rip), %r15      # 0xb9d6
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x9bba
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x9bba
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x9bba
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movss 0x20(%r12), %xmm0
movq %rbx, %rdi
callq 0x9c4c
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movss 0x24(%r12), %xmm0
movq %rbx, %rdi
callq 0x9c4c
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movq 0x28(%r12), %rsi
movq %rbx, %rdi
callq 0x9c8e
movq 0x18(%rbx), %rsi
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3230
movq 0x30(%r12), %rsi
movq %rbx, %rdi
callq 0x9bba
movq 0x18(%rbx), %rsi
leaq 0x16d9(%rip), %rcx      # 0xb1cd
movl $0x1, %r8d
movq %r14, %rdi
xorl %edx, %edx
callq 0x3230
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x64a5(%rip), %rax      # 0xffb8
movq (%rax), %rcx
movl $0x1, %edx
callq 0x33a0
cmpq $0x1, %rax
je 0x9b40
leaq 0x1aeb(%rip), %rdi      # 0xb618
leaq 0x1db0(%rip), %rdx      # 0xb8e4
movl $0x171, %esi            # imm = 0x171
xorl %eax, %eax
callq 0xa594
movq $0x0, 0x18(%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9cb0
movl (%rsi), %edx
leaq 0x1c6c(%rip), %rsi      # 0xb910
movq %rsp, %rdi
xorl %eax, %eax
callq 0x3060
jmp 0x9cc1
leaq 0x1c56(%rip), %rsi      # 0xb90d
movq %rsp, %rdi
xorl %eax, %eax
callq 0x3060
movslq %eax, %r8
movq 0x18(%rbx), %rsi
addq $0x10, %rbx
movq %rsp, %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3230
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa4d9
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 0x5d10(%rip), %rbx      # 0x10210
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 0x8ce9(%rip), %r12      # 0x13210
leaq 0x6ce2(%rip), %r14      # 0x11210
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, 0x8ca8(%rip)      # 0x13210
addq 0x8ca9(%rip), %r15      # 0x13218
movl $0x1000, %eax           # imm = 0x1000
cmpq %rax, %r15
cmovaeq %rax, %r15
movq %r15, 0x8c96(%rip)      # 0x13218
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa5f5
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 0x59dc(%rip), %r14      # 0xffd8
movq (%r14), %rdi
leaq 0x13c3(%rip), %rsi      # 0xb9c9
movl %r10d, %ecx
xorl %eax, %eax
callq 0x32e0
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 0x32b0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
cmpq $0x0, 0x8bc8(%rip)      # 0x13218
je 0xa68f
movq (%r14), %rcx
leaq 0x137c(%rip), %rdi      # 0xb9d8
movl $0x9, %esi
movl $0x1, %edx
callq 0x33a0
leaq 0x6b9e(%rip), %rdi      # 0x11210
addq 0x8b97(%rip), %rdi      # 0x13210
subq 0x8b98(%rip), %rdi      # 0x13218
addq $0x1000, %rdi           # imm = 0x1000
movq (%r14), %rsi
callq 0x3220
movl $0x1, %edi
callq 0x3260
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28e4(%rip), %rbx      # 0x3fd8
leaq 0x984(%rip), %rsi       # 0x207f
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x10d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
callq 0x15e9
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq %rax, %rbx
leaq 0x949(%rip), %rsi       # 0x20ae
movl $0x1d, %edx
movq %rax, %rdi
callq 0x10d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
callq 0x14d0
xorl %eax, %eax
popq %rbx
retq