// File: 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:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x9400
leaq 0xb8(%rsp), %rdi
callq 0x9400
jmp 0x6ea3
leaq 0x90(%rsp), %rdi
callq 0x9400
jmp 0x6eb2
movq 0xe8(%rsp), %rdi
callq 0x8eb0
movq %rax, %rsi
leaq 0xd0(%rsp), %rdi
xorl %edx, %edx
callq 0x9410
jmp 0x6ed3
movq 0xe8(%rsp), %rdi
callq 0x8eb0
movq %rax, %rsi
leaq 0xb8(%rsp), %rdi
xorl %edx, %edx
callq 0x9410
jmp 0x6ef4
movq 0xe8(%rsp), %rdi
callq 0x8eb0
movq %rax, %rsi
leaq 0x90(%rsp), %rdi
xorl %edx, %edx
callq 0x9410
jmp 0x6f15
movl $0x0, 0x8c(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x8eb0
movq %rax, %rcx
movq 0x78(%rsp), %rax
cmpq %rcx, %rax
jae 0x719e
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x70(%rsp)
jmp 0x6f73
movq 0x70(%rsp), %rax
movl (%rax), %eax
cmpl 0x8c(%rsp), %eax
jbe 0x6f85
jmp 0x6ffc
leaq 0x153d7(%rip), %rdi     # 0x1c363
leaq 0x153e5(%rip), %rsi     # 0x1c378
movl $0x67, %edx
leaq 0x153eb(%rip), %rcx     # 0x1c38a
callq 0x41c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x722d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x721c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x95f0
jmp 0x7201
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x68(%rsp)
jmp 0x7018
movq 0x68(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x5c(%rsp)
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x60(%rsp)
jmp 0x7040
movl 0x5c(%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl (%rcx), %eax
jb 0x704f
jmp 0x706e
leaq 0x1536f(%rip), %rdi     # 0x1c3c5
leaq 0x1531b(%rip), %rsi     # 0x1c378
movl $0x68, %edx
leaq 0x15321(%rip), %rcx     # 0x1c38a
callq 0x41c0
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x50(%rsp)
jmp 0x708a
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x44(%rsp)
movq 0x80(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x94f0
movq %rax, 0x48(%rsp)
jmp 0x70b1
movq 0x48(%rsp), %rax
movl 0x44(%rsp), %ecx
movl %ecx, (%rax)
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x38(%rsp)
jmp 0x70d8
movq 0x38(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x80(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x94f0
movq %rax, 0x30(%rsp)
jmp 0x7100
movq 0x30(%rsp), %rax
movl 0x2c(%rsp), %ecx
movl %ecx, (%rax)
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x20(%rsp)
jmp 0x7127
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x80(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x94f0
movq %rax, 0x18(%rsp)
jmp 0x714f
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
movq 0xe8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x94d0
movq %rax, 0x8(%rsp)
jmp 0x7176
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8c(%rsp)
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x6f2c
movq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x9510
jmp 0x71b5
movq 0xf0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x9510
jmp 0x71cc
movq 0xf0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x9510
jmp 0x71e3
leaq 0x90(%rsp), %rdi
callq 0x95f0
jmp 0x71f2
leaq 0xb8(%rsp), %rdi
callq 0x95f0
jmp 0x7203
jmp 0x721c
leaq 0xd0(%rsp), %rdi
callq 0x95f0
movb $0x1, %al
andb $0x1, %al
addq $0xf8, %rsp
retq
leaq 0xb8(%rsp), %rdi
callq 0x95f0
jmp 0x722b
jmp 0x722d
leaq 0xd0(%rsp), %rdi
callq 0x95f0
jmp 0x723c
jmp 0x723e
movq 0xb0(%rsp), %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x5b40
nopw %cs:(%rax,%rax)
nopl (%rax)