// File: tanguysegarra[P]libcsv/src/main.cc
// Function: main
int main(void)
{
    /* TESTING READER CLASS */ 
    auto r = csv::Reader("tests/test.csv", ';');
    auto colnames = r.get_column_names();
    for (size_t i = 0; i < colnames.size(); i++)
    {
        std::cout << colnames[i];
        if (i != colnames.size() - 1)
            std::cout << " | ";
    }
    std::cout << "\n";

    for (auto& colname : colnames)
    {
        std::cout << colname << ": ";
        for (auto& val : r[colname])
            std::cout << val << ", ";
        std::cout << "\n";
    }

    for (auto& val : r["NAME"])
        std::cout << val << ", ";

    std::cout << "\n";

    /* TESTING WRITER CLASS */ 

    auto data = r.get_rows();

    auto w = csv::Writer("output.csv", ';');
    w.set_rows(data);
    w.write_rows();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movl $0x0, -0x4(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x56e0
movq -0x1e0(%rbp), %rdx
leaq 0x2e6b2(%rip), %rsi     # 0x351d2
leaq -0x68(%rbp), %rdi
callq 0x7280
jmp 0x6b2b
movb $0x3b, -0x7d(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x7d(%rbp), %rdx
callq 0x6350
jmp 0x6b42
leaq -0x68(%rbp), %rdi
callq 0x5270
leaq -0x69(%rbp), %rdi
callq 0x5430
leaq -0x98(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x6410
jmp 0x6b66
movq $0x0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x7cc0
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6c72
movq -0xa0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x7f50
movq %rax, %rsi
movq 0x473fd(%rip), %rdi     # 0x4dfb8
callq 0x53a0
jmp 0x6bc2
movq -0xa0(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x7cc0
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x6c59
movq 0x473c2(%rip), %rdi     # 0x4dfb8
leaq 0x2e5e4(%rip), %rsi     # 0x351e1
callq 0x53d0
jmp 0x6c04
jmp 0x6c59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x6c29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5270
leaq -0x69(%rbp), %rdi
callq 0x5430
jmp 0x70ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x70e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x70d9
jmp 0x6c5b
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x6b71
movq 0x4733f(%rip), %rdi     # 0x4dfb8
leaq 0x2e5bd(%rip), %rsi     # 0x3523d
callq 0x53d0
jmp 0x6c87
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x7f70
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x7fa0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x7fd0
testb $0x1, %al
jne 0x6cd7
jmp 0x6e26
leaq -0xb0(%rbp), %rdi
callq 0x8010
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rsi
movq 0x472c0(%rip), %rdi     # 0x4dfb8
callq 0x53a0
movq %rax, -0x1f8(%rbp)
jmp 0x6d06
movq -0x1f8(%rbp), %rdi
leaq 0x2e48d(%rip), %rsi     # 0x351a1
callq 0x53d0
jmp 0x6d1b
movq -0xc0(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x65f0
jmp 0x6d34
leaq -0xe0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x7f70
movq %rax, -0xe8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x7fa0
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x7fd0
testb $0x1, %al
jne 0x6d8d
leaq -0xe0(%rbp), %rdi
callq 0x78e0
jmp 0x6dfe
leaq -0xe8(%rbp), %rdi
callq 0x8010
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rsi
movq 0x4720a(%rip), %rdi     # 0x4dfb8
callq 0x53a0
movq %rax, -0x200(%rbp)
jmp 0x6dbc
movq -0x200(%rbp), %rdi
leaq 0x2e41b(%rip), %rsi     # 0x351e5
callq 0x53d0
jmp 0x6dd1
jmp 0x6dd3
leaq -0xe8(%rbp), %rdi
callq 0x8030
jmp 0x6d68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x78e0
jmp 0x70d9
movq 0x471b3(%rip), %rdi     # 0x4dfb8
leaq 0x2e431(%rip), %rsi     # 0x3523d
callq 0x53d0
jmp 0x6e13
jmp 0x6e15
leaq -0xb0(%rbp), %rdi
callq 0x8030
jmp 0x6cbb
leaq -0x139(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x56e0
movq -0x208(%rbp), %rdx
leaq 0x2e3a1(%rip), %rsi     # 0x351e8
leaq -0x138(%rbp), %rdi
callq 0x7280
jmp 0x6e55
leaq -0x118(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x65f0
jmp 0x6e6e
leaq -0x138(%rbp), %rdi
callq 0x5270
leaq -0x139(%rbp), %rdi
callq 0x5430
leaq -0x118(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rdi
callq 0x7f70
movq %rax, -0x148(%rbp)
movq -0x100(%rbp), %rdi
callq 0x7fa0
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x7fd0
testb $0x1, %al
jne 0x6f19
leaq -0x118(%rbp), %rdi
callq 0x78e0
jmp 0x6f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x6f08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x5270
leaq -0x139(%rbp), %rdi
callq 0x5430
jmp 0x70d9
leaq -0x148(%rbp), %rdi
callq 0x8010
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rsi
movq 0x4707e(%rip), %rdi     # 0x4dfb8
callq 0x53a0
movq %rax, -0x210(%rbp)
jmp 0x6f48
movq -0x210(%rbp), %rdi
leaq 0x2e28f(%rip), %rsi     # 0x351e5
callq 0x53d0
jmp 0x6f5d
jmp 0x6f5f
leaq -0x148(%rbp), %rdi
callq 0x8030
jmp 0x6eba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x78e0
jmp 0x70d9
movq 0x47024(%rip), %rdi     # 0x4dfb8
leaq 0x2e2a2(%rip), %rsi     # 0x3523d
callq 0x53d0
jmp 0x6fa2
leaq -0x170(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x63e0
jmp 0x6fb4
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x56e0
movq -0x218(%rbp), %rdx
leaq 0x2e218(%rip), %rsi     # 0x351ed
leaq -0x1d0(%rbp), %rdi
callq 0x7280
jmp 0x6fe3
movb $0x3b, -0x1d2(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x1d2(%rbp), %rdx
callq 0x66c0
jmp 0x7006
leaq -0x1d0(%rbp), %rdi
callq 0x5270
leaq -0x1d1(%rbp), %rdi
callq 0x5430
leaq -0x1b0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x6ac0
jmp 0x7033
leaq -0x1b0(%rbp), %rdi
callq 0x6730
jmp 0x7041
movl $0x0, -0x4(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x8050
leaq -0x170(%rbp), %rdi
callq 0x73f0
leaq -0x98(%rbp), %rdi
callq 0x78e0
leaq -0x48(%rbp), %rdi
callq 0x8080
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x70a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x5270
leaq -0x1d1(%rbp), %rdi
callq 0x5430
jmp 0x70cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x8050
leaq -0x170(%rbp), %rdi
callq 0x73f0
leaq -0x98(%rbp), %rdi
callq 0x78e0
leaq -0x48(%rbp), %rdi
callq 0x8080
movq -0x78(%rbp), %rdi
callq 0x56d0
nopw (%rax,%rax)