LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x7990
movq 0x30(%rsp), %rdi
callq 0x43a0
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x43c0
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4580
movq %rax, 0x20(%rsp)
movb $0x1, 0x1f(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax)
je 0x78c5
testb $0x1, 0x1f(%rsp)
jne 0x77ce
movq 0x20(%rsp), %rax
movb $0x0, (%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x77d3
movb $0x0, 0x1f(%rsp)
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0x783a
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, 0xf(%rsp)
je 0x780c
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x7816
jmp 0x7826
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x77ea
movq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x79b0
jmp 0x78c0
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, 0xe(%rsp)
je 0x7874
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
setne %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x787e
jmp 0x788e
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x7852
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x78b1
movq 0x20(%rsp), %rax
movb $0x0, (%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x79b0
jmp 0x77a1
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, %rdi
addq $0x10, %rdi
movq %rax, %rsi
addq $0x18, %rsi
movq 0x20(%rax), %rdx
callq 0x4370
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jg 0x9341
movb $0x0, 0x47(%rsp)
jmp 0x93dc
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x9380
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq 0x30(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x30(%rsp), %rdx
leaq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x7950
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x93af
leaq 0x20(%rsp), %rdi
callq 0x7980
movb $0x1, 0x47(%rsp)
jmp 0x93dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x7980
jmp 0x93da
jmp 0x93e7
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x12eca(%rip), %rsi     # 0x1c3f9
callq 0xa9d0
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xaa70
movq 0x8(%rsp), %rdi
callq 0xaad0
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x9740
movq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0xaa70
movq 0x28(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xab70
movq %rax, (%rsp)
movq 0x28(%rsp), %rdi
callq 0x9740
movq (%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %rax, %rdx
shlq $0x2, %rdx
callq 0xaaf0
movq 0x8(%rsp), %rdi
callq 0xaad0
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
subq 0x20(%rsp), %rax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rsi
subq $0x4, %rsi
callq 0xab90
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0xaa70
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xab90
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x4120
cmpq $0x4, %rax
jne 0xa9fa
jmp 0xaa19
leaq 0x119fd(%rip), %rdi     # 0x1c3fe
leaq 0x118bb(%rip), %rsi     # 0x1c2c3
movl $0xc6, %edx
leaq 0x119f9(%rip), %rcx     # 0x1c40d
callq 0x41c0
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rdi
movq (%rax), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x4540
movq %rax, 0x10(%rsp)
cmpq $0x4, 0x10(%rsp)
je 0xaa5c
leaq 0x1187a(%rip), %rdi     # 0x1c2c3
movl $0xcb, %esi
leaq 0x119e1(%rip), %rdx     # 0x1c436
movb $0x0, %al
callq 0x1b800
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq (%rax), %rcx
movl $0x1, %esi
callq 0x4540
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0xab53
movq 0x10(%rsp), %rcx
leaq 0x11783(%rip), %rdi     # 0x1c2c3
movl $0xdf, %esi
leaq 0x11926(%rip), %rdx     # 0x1c472
movb $0x0, %al
callq 0x1b800
movq (%rsp), %rdi
callq 0xabf0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xaad0
movq 0x8(%rsp), %rdi
addl $0x3, %eax
andl $-0x4, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq %rax, (%rsp)
callq 0xaad0
movq %rax, %rcx
movq (%rsp), %rax
subq %rcx, %rax
movl %eax, 0x18(%rsp)
leaq 0x14(%rsp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x4160
movq 0x8(%rsp), %rdi
leaq 0x14(%rsp), %rsi
movl 0x18(%rsp), %eax
movl %eax, %edx
callq 0x6390
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x68(%rax)
cmpq $0x3, 0x68(%rax)
jae 0xb53c
jmp 0xb6ad
movq 0xe8(%rsp), %rdi
callq 0x78d0
movq %rax, 0x10(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x78e0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rcx
movq %rax, %rsi
movq %rcx, %rdx
addq $0x30, %rdx
addq $0x50, %rcx
callq 0x7740
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
callq 0x78f0
cmpq $0x9, %rax
je 0xb591
jmp 0xb6ad
leaq 0x40(%rsp), %rdi
callq 0xb710
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movq %rdi, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq 0x8(%rsp), %rdi
movl %eax, 0x40(%rsp)
movl $0x1, %esi
callq 0x7930
movq (%rax), %rsi
leaq 0x48(%rsp), %rdi
callq 0x43e0
jmp 0xb5dc
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movl $0x2, %esi
callq 0x7930
movq (%rax), %rsi
leaq 0x68(%rsp), %rdi
callq 0x43e0
jmp 0xb5fe
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movl $0x3, %esi
callq 0x7930
movq (%rax), %rsi
leaq 0x88(%rsp), %rdi
callq 0x43e0
jmp 0xb623
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movl $0x5, %esi
callq 0x7930
movq (%rax), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x43e0
jmp 0xb648
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movl $0x6, %esi
callq 0x7930
movq (%rax), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x43e0
jmp 0xb66d
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl $0xa8, %edx
callq 0x7950
jmp 0xb683
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
leaq 0x20(%rsp), %rsi
callq *%rax
jmp 0xb697
leaq 0x20(%rsp), %rdi
callq 0x7980
jmp 0xb6a3
leaq 0x40(%rsp), %rdi
callq 0xb820
addq $0xf8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0xb6e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x7980
jmp 0xb6df
jmp 0xb6e1
leaq 0x40(%rsp), %rdi
callq 0xb820
jmp 0xb6ed
jmp 0xb6ef
movq 0x38(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x48(%rsp), %rsi
callq 0xd990
cmpq $0x0, %rax
je 0xc89d
jmp 0xc967
movq 0x18(%rsp), %rdi
addq $0x30, %rdi
callq 0x9740
movq 0x18(%rsp), %rdi
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x48(%rsp), %rsi
callq 0xda50
movl 0x4(%rsp), %ecx
movq 0x18(%rsp), %rdi
movl %ecx, (%rax)
movq %rdi, %rax
addq $0x30, %rax
movq %rax, 0x8(%rsp)
addq $0x48, %rdi
callq 0xdd00
movq 0x8(%rsp), %rdi
movl %eax, 0x40(%rsp)
leaq 0x40(%rsp), %rsi
callq 0xdc90
movq 0x18(%rsp), %rdi
movq %rdi, %rax
addq $0x48, %rax
movq %rax, 0x10(%rsp)
addq $0x48, %rdi
callq 0xdd80
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
callq 0x4280
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rdi
callq 0x4520
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0xdd20
movq 0x18(%rsp), %rdi
addq $0x48, %rdi
movb $0x0, 0x27(%rsp)
leaq 0x27(%rsp), %rsi
callq 0xddb0
addq $0x58, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x30(%rsp), %rsi
callq 0x11cc0
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
callq 0x11da0
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x11d80
testb $0x1, %al
jne 0xcb55
jmp 0xcb5f
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xcb70
leaq 0x20(%rsp), %rdi
callq 0x11de0
movl 0x20(%rax), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x68(%rax)
movq 0x68(%rsp), %rdi
callq 0x78d0
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rdi
callq 0x78e0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq %rax, %rsi
movq %rcx, %rdx
addq $0x30, %rdx
addq $0x50, %rcx
callq 0x7740
movq 0x10(%rsp), %rdi
addq $0x50, %rdi
callq 0x78f0
cmpq $0x3, %rax
je 0x128b3
jmp 0x12960
leaq 0x38(%rsp), %rdi
callq 0x129c0
movq 0x10(%rsp), %rdi
addq $0x50, %rdi
movq %rdi, (%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq (%rsp), %rdi
movl %eax, 0x38(%rsp)
movl $0x1, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq (%rsp), %rdi
movl %eax, 0x3c(%rsp)
movl $0x2, %esi
callq 0x7930
movq 0x10(%rsp), %rdi
movq (%rax), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x129e0
jmp 0x12920
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movl $0x30, %edx
callq 0x7950
jmp 0x12936
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
leaq 0x18(%rsp), %rsi
callq *%rax
jmp 0x1294a
leaq 0x18(%rsp), %rdi
callq 0x7980
jmp 0x12956
leaq 0x38(%rsp), %rdi
callq 0x12af0
addq $0x78, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x12991
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x7980
jmp 0x1298f
jmp 0x12991
leaq 0x38(%rsp), %rdi
callq 0x12af0
jmp 0x1299d
jmp 0x1299f
movq 0x30(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x58(%rsp), %rsi
addq $0x30, %rdi
callq 0x43e0
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4580
movq 0x10(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
addq $0x30, %rdi
callq 0x41e0
movq %rax, %rcx
movq 0x18(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movl $0x20, %esi
callq 0x40d0
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x12a85
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x12a8f
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x4120
cmpq $0x2, %rax
ja 0x12ac3
leaq 0x9a47(%rip), %rdi      # 0x1c4f7
movl $0x48, %esi
leaq 0x9a4b(%rip), %rdx      # 0x1c507
movb $0x0, %al
callq 0x1b800
movq 0x28(%rsp), %rdi
addq $0x2, %rdi
callq 0x7910
movl %eax, %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rsi
movq 0x48(%rsp), %rdi
callq 0x43e0
addq $0x68, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rcx
leaq 0x6444(%rip), %rdi      # 0x1c5a8
movl $0x40, %esi
leaq 0x6468(%rip), %rdx      # 0x1c5d8
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x16be0
andb $0x1, %al
movb %al, 0x17(%rsp)
testb $0x1, 0x17(%rsp)
jne 0x161b2
movq 0x18(%rsp), %rcx
leaq 0x6409(%rip), %rdi      # 0x1c5a8
movl $0x46, %esi
leaq 0x643d(%rip), %rdx      # 0x1c5e8
movb $0x0, %al
callq 0x1b800
leaq 0x63ef(%rip), %rdi      # 0x1c5a8
movl $0x49, %esi
leaq 0x6441(%rip), %rdx      # 0x1c606
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rdi
callq 0x16c10
leaq 0x63cb(%rip), %rdi      # 0x1c5a8
movl $0x4c, %esi
leaq 0x6431(%rip), %rdx      # 0x1c61a
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rsi
movq %rsi, %rdi
addq $0x18, %rdi
callq 0x16e90
leaq 0x63a0(%rip), %rdi      # 0x1c5a8
movl $0x4f, %esi
leaq 0x6426(%rip), %rdx      # 0x1c63a
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rsi
movq %rsi, %rdi
addq $0x30, %rdi
callq 0x16f00
leaq 0x6375(%rip), %rdi      # 0x1c5a8
movl $0x52, %esi
leaq 0x6416(%rip), %rdx      # 0x1c655
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rsi
movq %rsi, %rdi
addq $0x68, %rdi
callq 0x16e90
leaq 0x634a(%rip), %rdi      # 0x1c5a8
movl $0x55, %esi
leaq 0x6406(%rip), %rdx      # 0x1c670
movb $0x0, %al
callq 0x1b650
movq 0x8(%rsp), %rsi
movq %rsi, %rdi
addq $0x80, %rdi
callq 0x16f60
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: loadzero[P]geoloc/geoloc/blocks.hpp
// Function: BlockTable::~BlockTable()
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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x10, %rdi
callq 0x16b20
jmp 0x16a3e
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x16b20
jmp 0x16a4e
movq 0x8(%rsp), %rdi
callq 0x16b20
addq $0x28, %rsp
retq
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
addq $0x8, %rdi
callq 0x16b20
jmp 0x16a8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
jmp 0x16a8d
jmp 0x16a8d
movq 0x8(%rsp), %rdi
callq 0x16b20
jmp 0x16a99
jmp 0x16a9b
movq 0x18(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq 0x8(%rsp), %rdi
callq 0x17840
movq (%rsp), %rsi
movq 0x8(%rsp), %rdi
addq $0x10, %rsi
callq 0x17840
movq (%rsp), %rsi
movq 0x8(%rsp), %rdi
addq $0x20, %rsi
callq 0x17840
movq (%rsp), %rsi
movq 0x8(%rsp), %rdi
addq $0x30, %rsi
callq 0x178d0
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x4200
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0x16fdb
movb $0x0, 0x47(%rsp)
jmp 0x170e2
movl 0x2c(%rsp), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x4510
movq %rax, 0x20(%rsp)
cmpq $-0x1, 0x20(%rsp)
jne 0x17023
movq 0x30(%rsp), %rcx
leaq 0x52bd(%rip), %rdi      # 0x1c2c3
movl $0x76, %esi
leaq 0x5674(%rip), %rdx      # 0x1c686
movb $0x0, %al
callq 0x1b650
movb $0x0, 0x47(%rsp)
jmp 0x170e2
movl 0x2c(%rsp), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4510
movq %rax, 0x18(%rsp)
cmpq $-0x1, 0x18(%rsp)
jne 0x17065
movq 0x30(%rsp), %rcx
leaq 0x5278(%rip), %rdi      # 0x1c2c3
movl $0x7e, %esi
leaq 0x564b(%rip), %rdx      # 0x1c6a2
movb $0x0, %al
callq 0x1b650
movb $0x0, 0x47(%rsp)
jmp 0x170e2
movq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rsi
movl 0x2c(%rsp), %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %ecx
movq %r9, %rdi
movl %ecx, %edx
callq 0x44f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jne 0x170d0
movq 0x30(%rsp), %rcx
leaq 0x5216(%rip), %rdi      # 0x1c2c3
movl $0x87, %esi
leaq 0x5605(%rip), %rdx      # 0x1c6be
movb $0x0, %al
callq 0x1b650
movl 0x2c(%rsp), %edi
callq 0x4560
movb $0x0, 0x47(%rsp)
jmp 0x170e2
movl 0x2c(%rsp), %edi
callq 0x4560
movl %eax, 0x14(%rsp)
movb $0x1, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopl (%rax)
// File: loadzero[P]geoloc/geoloc/serialization.hpp
// Function: MemoryFile::get_mem(unsigned long)
const void* get_mem(size_t n)
    {
        if (n > avail())
        {
            return 0;
        }

        void* out = iter();
        offset_ += n;

        return out;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x17370
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jbe 0x1712f
movq $0x0, 0x30(%rsp)
jmp 0x1715d
movq 0x8(%rsp), %rdi
callq 0x173a0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rsp)
movq 0x20(%rsp), %rcx
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x58, %rsp
movb %cl, %al
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movb %al, 0x3f(%rsp)
movq 0x40(%rsp), %rdi
callq 0x7990
movq 0x48(%rsp), %rdi
callq 0x43a0
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4280
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4520
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x17610
movq 0x48(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4580
movq %rax, 0x20(%rsp)
movb $0x1, 0x1f(%rsp)
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax)
je 0x17306
testb $0x1, 0x1f(%rsp)
jne 0x172a3
movb $0x0, 0x1f(%rsp)
movq 0x20(%rsp), %rax
movb $0x0, (%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x172a8
movb $0x0, 0x1f(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, 0x7(%rsp)
je 0x172d8
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movsbl 0x3f(%rsp), %ecx
cmpl %ecx, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x172e2
jmp 0x172f2
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x172b2
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x79b0
jmp 0x17271
addq $0x58, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x176d0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x176bd
leaq 0x4c19(%rip), %rdi      # 0x1c2c3
movl $0x195, %esi            # imm = 0x195
leaq 0x50bd(%rip), %rdx      # 0x1c773
movb $0x0, %al
callq 0x1b800
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x17770
addq $0x18, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x17790
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x176ff
movq $0x0, 0x20(%rsp)
jmp 0x17759
movq 0x10(%rsp), %rax
movl (%rax), %eax
subl $0x56444f50, %eax       # imm = 0x56444F50
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x17721
movq $0x0, 0x20(%rsp)
jmp 0x17759
movq (%rsp), %rdi
callq 0x177b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x17742
movq $0x0, 0x20(%rsp)
jmp 0x17759
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x170f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x176d0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x17883
leaq 0x4a53(%rip), %rdi      # 0x1c2c3
movl $0x1a2, %esi            # imm = 0x1A2
leaq 0x4f36(%rip), %rdx      # 0x1c7b2
movb $0x0, %al
callq 0x1b800
movq (%rsp), %rdi
callq 0x17920
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x178b3
leaq 0x4a23(%rip), %rdi      # 0x1c2c3
movl $0x1a9, %esi            # imm = 0x1A9
leaq 0x4f32(%rip), %rdx      # 0x1c7de
movb $0x0, %al
callq 0x1b800
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x4, %rsi
movq 0x10(%rsp), %rdx
callq 0x179c0
addq $0x28, %rsp
retq
// File: 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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x17e90
movq 0xf8(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x17f40
jmp 0x17bf8
leaq 0x18(%rsp), %rdi
callq 0x17f80
jmp 0x17c04
movq 0x100(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq 0x90(%rsp), %rsi
callq *%rax
movq %rax, 0x10(%rsp)
jmp 0x17c24
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq 0x78(%rsp), %rsi
callq *%rax
movq %rax, 0x8(%rsp)
jmp 0x17c3e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq 0x18(%rsp), %rsi
callq *%rax
jmp 0x17c53
movq 0x100(%rsp), %rdi
callq 0x6e30
jmp 0x17c62
leaq 0x18(%rsp), %rdi
callq 0x18000
jmp 0x17c6e
leaq 0x90(%rsp), %rdi
callq 0x18070
addq $0x108, %rsp            # imm = 0x108
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x17caf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x18000
jmp 0x17cad
jmp 0x17caf
leaq 0x90(%rsp), %rdi
callq 0x18070
jmp 0x17cbe
jmp 0x17cc0
movq 0x70(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x10, %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rdi
callq 0x78d0
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rdi
callq 0x78e0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0x43c0
movq 0x38(%rsp), %rdx
movq %rdx, %rdi
addq $0x10, %rdi
movq %rdx, %rsi
addq $0x30, %rsi
addq $0x50, %rdx
movl $0x2e, %ecx
callq 0x171f0
movq 0x38(%rsp), %rdi
addq $0x50, %rdi
callq 0x78f0
cmpq $0x4, %rax
je 0x18196
jmp 0x18262
movq 0x38(%rsp), %rdi
addq $0x50, %rdi
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq 0x10(%rsp), %rdi
shll $0x18, %eax
movl %eax, 0xc(%rsp)
movl $0x1, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq 0x10(%rsp), %rdi
movl %eax, %ecx
movl 0xc(%rsp), %eax
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, 0x18(%rsp)
movl $0x2, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movq 0x10(%rsp), %rdi
movl %eax, %ecx
movl 0x18(%rsp), %eax
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, 0x1c(%rsp)
movl $0x3, %esi
callq 0x7930
movq (%rax), %rdi
callq 0x7910
movl %eax, %ecx
movl 0x1c(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x64(%rsp)
leaq 0x50(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x64(%rsp), %rsi
movl $0x4, %edx
callq 0x7950
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x18258
leaq 0x50(%rsp), %rdi
callq 0x7980
addq $0x78, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x7980
jmp 0x18281
jmp 0x18283
movq 0x48(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0x78d0
movl (%rax), %eax
movl %eax, 0x74(%rsp)
leaq 0x38(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x18370
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x74(%rsp), %esi
callq 0x183c0
movq (%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0x38, %edx
callq 0x7950
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x18321
leaq 0x28(%rsp), %rdi
callq 0x7980
addq $0x88, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7980
jmp 0x1834d
jmp 0x1834f
movq 0x20(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0x3c(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movq %rdi, %rsi
addq $0x18, %rsi
movl 0x3c(%rsp), %edx
callq 0x18580
movl %eax, 0x2c(%rsp)
cmpl $-0x1, 0x2c(%rsp)
je 0x184dd
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
addq $0x10, %rdi
movl 0x2c(%rsp), %eax
movl %eax, %esi
callq 0x18690
movq 0x8(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x28(%rsp)
addq $0x30, %rdi
addq $0x30, %rdi
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0x186c0
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x30, %rdi
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
callq 0x186e0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
addq $0x30, %rdi
addq $0x10, %rdi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
callq 0x186e0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
addq $0x30, %rdi
addq $0x20, %rdi
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, %esi
callq 0x186e0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
movss 0x10(%rax), %xmm0
movq 0x30(%rsp), %rax
movss %xmm0, 0x20(%rax)
movq 0x20(%rsp), %rax
movss 0x14(%rax), %xmm0
movq 0x30(%rsp), %rax
movss %xmm0, 0x24(%rax)
movq 0x8(%rsp), %rdi
movq %rdi, %rsi
addq $0x68, %rsi
movl 0x3c(%rsp), %edx
callq 0x18580
movl %eax, 0x2c(%rsp)
cmpl $-0x1, 0x2c(%rsp)
je 0x18570
movq 0x8(%rsp), %rdi
addq $0x68, %rdi
addq $0x10, %rdi
movl 0x2c(%rsp), %eax
movl %eax, %esi
callq 0x18690
movq 0x8(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
addq $0x80, %rdi
addq $0x10, %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x18710
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x28(%rax)
addq $0x80, %rdi
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
callq 0x186e0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x30(%rax)
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movq 0x40(%rsp), %rdi
callq 0x18790
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rdi
callq 0x187b0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
leaq 0x3c(%rsp), %rdx
callq 0x18740
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
callq 0x18790
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jne 0x185f0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1867e
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x18790
movq %rax, %rcx
movq 0x8(%rsp), %rax
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0x18690
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl (%rcx), %eax
jb 0x18676
movl 0x3c(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0x18690
movq %rax, %rcx
movl 0x4(%rsp), %eax
cmpl (%rcx), %eax
ja 0x18676
movl 0x28(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x1867e
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x78d0
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x10, %rdi
callq 0x43a0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movl (%rax), %esi
callq 0x18b90
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x18bf0
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x18bf0
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x18bf0
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movss 0x20(%rax), %xmm0
callq 0x18c50
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movss 0x24(%rax), %xmm0
callq 0x18c50
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x18cb0
movq 0x8(%rsp), %rdi
callq 0x18bd0
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rsi
callq 0x18bf0
movq 0x8(%rsp), %rdi
callq 0x18d30
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4580
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
addq $0x10, %rdi
callq 0x41e0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0xe477(%rip), %rax      # 0x26fb8
movq (%rax), %rcx
movl $0x1, %edx
callq 0x4540
movq %rax, 0x18(%rsp)
cmpq $0x1, 0x18(%rsp)
je 0x18b75
leaq 0x3a46(%rip), %rdi      # 0x1c5a8
movl $0x171, %esi            # imm = 0x171
leaq 0x3d30(%rip), %rdx      # 0x1c89e
movb $0x0, %al
callq 0x1b800
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x43a0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x18cf0
leaq 0x10(%rsp), %rdi
leaq 0x3be4(%rip), %rsi      # 0x1c8c7
movb $0x0, %al
callq 0x4080
movl %eax, 0xc(%rsp)
jmp 0x18d0e
leaq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rax
movl (%rax), %edx
leaq 0x3bc7(%rip), %rsi      # 0x1c8ca
movb $0x0, %al
callq 0x4080
movl %eax, 0xc(%rsp)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
callq 0x18dd0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movl %eax, 0x18(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, 0x14(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
andl $0xff, %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %r8d
movl 0xc(%rsp), %r9d
leaq 0x3afd(%rip), %rsi      # 0x1c8b5
movb $0x0, %al
callq 0x4080
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x18eac
movq 0x30(%rsp), %rdi
leaq 0x3a26(%rip), %rsi      # 0x1c8c8
callq 0x43e0
jmp 0x18f63
movq 0x28(%rsp), %rdi
callq 0x4120
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x18ed9
movq 0x30(%rsp), %rdi
leaq 0x39f9(%rip), %rsi      # 0x1c8c8
callq 0x43e0
jmp 0x18f63
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4400
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4580
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
je 0x18f63
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x18f24
movb $0x2b, %al
movb %al, 0xb(%rsp)
jmp 0x18f2f
movq 0x10(%rsp), %rax
movb (%rax), %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
movsbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movb %al, %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x18f05
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: loadzero[P]geoloc/geoloc/pipeline.hpp
// Function: StringInjector::produce_one()
bool produce_one()
    {
        if (index_ == strings_.size())
        {
            return false;
        }

        const std::string& str = strings_[index_];

        emit(Buffer(str.c_str(), str.size()));
        index_++;

        return true;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x10(%rax), %rdi
callq 0x16020
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jne 0x19e0c
movb $0x0, 0x57(%rsp)
jmp 0x19ea3
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x167b0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x4100
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x41e0
movq (%rsp), %rsi
movq %rax, %rdx
leaq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7950
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x19e65
leaq 0x30(%rsp), %rdi
callq 0x7980
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movb $0x1, 0x57(%rsp)
jmp 0x19ea3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x7980
jmp 0x19ea1
jmp 0x19eae
movb 0x57(%rsp), %al
andb $0x1, %al
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40