// File: loadzero[P]geoloc/geoloc/test.cpp
// Function: test_poddable_roundtrip()
static int test_poddable_roundtrip()
{
    std::vector<Poddable> bar_vec;

    {
        for (size_t i = 0; i < 100; ++i)
        {
            Poddable bar;
            bar.a = 100 + i;
            bar.b = 1000 + i;
            bar.c = 10000 + i;

            bar_vec.push_back(bar);
        }

        BinaryFile bf;
        
        bf.open("tmp/foo.bin");
        bf.save_pod_vector(bar_vec);
    }

    MemoryFile mf;
    mf.open("tmp/foo.bin");

    MappedVector<Poddable> foo;
    mf.load_mapped_vector(foo);

    assert(foo.size() != 0);
    assert(foo.size() == bar_vec.size());

    for (size_t i = 0; i < bar_vec.size(); ++i)
    {
        assert(foo[i] == bar_vec[i]);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
leaq -0x18(%rbp), %rdi
callq 0x30e0
movq $0x0, -0x20(%rbp)
cmpq $0x64, -0x20(%rbp)
jae 0x24a2
movl -0x20(%rbp), %eax
addl $0x64, %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %eax
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, -0x28(%rbp)
movl -0x20(%rbp), %eax
addl $0x2710, %eax           # imm = 0x2710
movl %eax, -0x24(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3100
jmp 0x2481
jmp 0x2483
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x244c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x26fd
leaq -0x60(%rbp), %rdi
callq 0x3170
jmp 0x24ad
leaq 0x7b64(%rip), %rsi      # 0xa018
leaq -0x60(%rbp), %rdi
callq 0x31a0
jmp 0x24bf
leaq -0x60(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x31f0
jmp 0x24ce
leaq -0x60(%rbp), %rdi
callq 0x32c0
jmp 0x24d9
leaq -0x78(%rbp), %rdi
callq 0x3340
jmp 0x24e4
leaq 0x7b2d(%rip), %rsi      # 0xa018
leaq -0x78(%rbp), %rdi
callq 0x3370
jmp 0x24f6
leaq -0x80(%rbp), %rdi
callq 0x33a0
jmp 0x2501
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x33c0
jmp 0x2510
leaq -0x80(%rbp), %rdi
callq 0x3420
movq %rax, -0x90(%rbp)
jmp 0x2522
movq -0x90(%rbp), %rax
cmpq $0x0, %rax
je 0x2531
jmp 0x2597
leaq 0x7aec(%rip), %rdi      # 0xa024
leaq 0x7af5(%rip), %rsi      # 0xa034
movl $0x43, %edx
leaq 0x7af9(%rip), %rcx      # 0xa044
callq 0x2120
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32c0
jmp 0x2567
jmp 0x26fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x26f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x34f0
jmp 0x26da
leaq -0x80(%rbp), %rdi
callq 0x3420
movq %rax, -0x98(%rbp)
jmp 0x25a9
leaq -0x18(%rbp), %rdi
callq 0x3440
movq %rax, -0xa0(%rbp)
jmp 0x25bb
movq -0x98(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq %rcx, %rax
jne 0x25d0
jmp 0x25ef
leaq 0x7a8b(%rip), %rdi      # 0xa062
leaq 0x7a56(%rip), %rsi      # 0xa034
movl $0x44, %edx
leaq 0x7a5a(%rip), %rcx      # 0xa044
callq 0x2120
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x3440
movq %rax, -0xa8(%rbp)
jmp 0x261a
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x26c4
movq -0x88(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3470
movq %rax, -0xb8(%rbp)
jmp 0x264a
movq -0x88(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x34d0
movq %rax, -0xc0(%rbp)
jmp 0x2663
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x34a0
movb %al, -0xc1(%rbp)
jmp 0x267e
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x268a
jmp 0x268c
jmp 0x26ab
leaq 0x79ec(%rip), %rdi      # 0xa07f
leaq 0x799a(%rip), %rsi      # 0xa034
movl $0x48, %edx
leaq 0x799e(%rip), %rcx      # 0xa044
callq 0x2120
jmp 0x26ad
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x25fa
leaq -0x80(%rbp), %rdi
callq 0x34f0
jmp 0x26cf
leaq -0x78(%rbp), %rdi
callq 0x3500
jmp 0x26dc
jmp 0x26f0
leaq -0x18(%rbp), %rdi
callq 0x3520
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x3500
jmp 0x26fb
jmp 0x26fd
leaq -0x18(%rbp), %rdi
callq 0x3520
jmp 0x2708
jmp 0x270a
movq -0x38(%rbp), %rdi
callq 0x2290
movq %rax, %rdi
callq 0x3330
nopl (%rax,%rax)