// File: tanguysegarra[P]libcsv/src/reader.hxx
// Function: csv::Reader::read_rows()
void Reader::read_rows()
    {
        std::ifstream ifs(filename_);
        if (!ifs.is_open())
            throw InvalidArgumentException("Could not load file: " + filename_);

        std::string col;
        std::string line;
        std::getline(ifs, line);
        std::stringstream ss(line);

        // Get columns names from the first line
        while (std::getline(ss, col, delimiter_))
        {
            std::stringstream quoted_col(col);
            quoted_col >> std::quoted(col);
            rows_.push_back({str::format_csv(col), std::vector<std::string>{}});
        }

        // Get all the values
        while (std::getline(ifs, line))
        {
            std::stringstream ss(line);
            int colIndex = 0;
            std::string val;
            while (getline(ss, val, delimiter_))
            {
                std::stringstream quoted_val(val);
                quoted_val >> std::quoted(val);
                rows_[colIndex].second.push_back(str::format_csv(val));
                colIndex++;
            }
        }

        ifs.close();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa40, %rsp            # imm = 0xA40
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x9c0(%rbp)
addq $0x18, %rsi
leaq -0x210(%rbp), %rdi
movq %rdi, -0x9b8(%rbp)
movl $0x8, %edx
callq 0x5610
movq -0x9b8(%rbp), %rdi
callq 0x5600
movb %al, -0x9a9(%rbp)
jmp 0x5caa
movb -0x9a9(%rbp), %al
testb $0x1, %al
jne 0x5d92
jmp 0x5cba
movb $0x1, -0x241(%rbp)
movl $0x28, %edi
callq 0x51e0
movq -0x9c0(%rbp), %rdx
movq %rax, -0x9c8(%rbp)
addq $0x18, %rdx
leaq 0x2f4aa(%rip), %rsi     # 0x3518e
leaq -0x240(%rbp), %rdi
callq 0x7450
jmp 0x5cf2
movq -0x9c8(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x7560
jmp 0x5d07
movq -0x9c8(%rbp), %rdi
movb $0x0, -0x241(%rbp)
leaq 0x47d64(%rip), %rsi     # 0x4da80
leaq 0x18dd(%rip), %rdx      # 0x7600
callq 0x5690
jmp 0x634f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x6337
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x5d76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x5270
testb $0x1, -0x241(%rbp)
jne 0x5d81
jmp 0x5d8d
movq -0x9c8(%rbp), %rdi
callq 0x5300
jmp 0x6337
leaq -0x268(%rbp), %rdi
callq 0x5550
leaq -0x288(%rbp), %rdi
movq %rdi, -0x9d0(%rbp)
callq 0x5550
movq -0x9d0(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x50a0
jmp 0x5dc6
movl $0x10, %edi
movl $0x8, %esi
callq 0x7640
movl %eax, -0x9d4(%rbp)
jmp 0x5ddd
movl -0x9d4(%rbp), %edx
leaq -0x410(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x55f0
jmp 0x5df8
jmp 0x5dfa
movq -0x9c0(%rbp), %rax
movsbl 0x38(%rax), %edx
leaq -0x410(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x5720
movq %rax, -0x9e0(%rbp)
jmp 0x5e21
movq -0x9e0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x54e0
movb %al, -0x9e1(%rbp)
jmp 0x5e3f
movb -0x9e1(%rbp), %al
testb $0x1, %al
jne 0x5e4e
jmp 0x6041
movl $0x10, %edi
movl $0x8, %esi
callq 0x7640
movl %eax, -0x9e8(%rbp)
jmp 0x5e65
movl -0x9e8(%rbp), %edx
leaq -0x598(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x55f0
jmp 0x5e80
leaq -0x268(%rbp), %rdi
movl $0x22, %esi
movl $0x5c, %edx
callq 0x77e0
movq %rdx, -0x9f8(%rbp)
movq %rax, -0x9f0(%rbp)
jmp 0x5ea6
movq -0x9f8(%rbp), %rax
movq -0x9f0(%rbp), %rcx
movq %rcx, -0x5b8(%rbp)
movq %rax, -0x5b0(%rbp)
movw -0x5b0(%rbp), %ax
movw %ax, -0x5a0(%rbp)
movq -0x5b8(%rbp), %rax
movq %rax, -0x5a8(%rbp)
leaq -0x598(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x7660
jmp 0x5ef3
movq -0x9c0(%rbp), %rax
movq %rax, -0xa00(%rbp)
leaq -0x610(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x5b40
jmp 0x5f16
xorps %xmm0, %xmm0
movaps %xmm0, -0x630(%rbp)
movq $0x0, -0x620(%rbp)
leaq -0x630(%rbp), %rdi
movq %rdi, -0xa08(%rbp)
callq 0x7850
movq -0xa08(%rbp), %rdx
leaq -0x5f0(%rbp), %rdi
leaq -0x610(%rbp), %rsi
callq 0x7870
jmp 0x5f5a
movq -0xa00(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
callq 0x7820
jmp 0x5f6f
leaq -0x5f0(%rbp), %rdi
callq 0x78b0
leaq -0x630(%rbp), %rdi
callq 0x78e0
leaq -0x610(%rbp), %rdi
callq 0x5270
leaq -0x598(%rbp), %rdi
callq 0x5310
jmp 0x5dfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x631f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x6313
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x6030
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x6018
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x5f0(%rbp), %rdi
callq 0x78b0
leaq -0x630(%rbp), %rdi
callq 0x78e0
leaq -0x610(%rbp), %rdi
callq 0x5270
leaq -0x598(%rbp), %rdi
callq 0x5310
jmp 0x6313
jmp 0x6043
leaq -0x210(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x50a0
movq %rax, -0xa10(%rbp)
jmp 0x605f
movq -0xa10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x54e0
movb %al, -0xa11(%rbp)
jmp 0x607d
movb -0xa11(%rbp), %al
testb $0x1, %al
jne 0x608c
jmp 0x62cc
movl $0x10, %edi
movl $0x8, %esi
callq 0x7640
movl %eax, -0xa18(%rbp)
jmp 0x60a3
movl -0xa18(%rbp), %edx
leaq -0x7b8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x55f0
jmp 0x60be
movl $0x0, -0x7bc(%rbp)
leaq -0x7e0(%rbp), %rdi
callq 0x5550
movq -0x9c0(%rbp), %rax
movsbl 0x38(%rax), %edx
leaq -0x7b8(%rbp), %rdi
leaq -0x7e0(%rbp), %rsi
callq 0x5720
movq %rax, -0xa20(%rbp)
jmp 0x60fb
movq -0xa20(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x54e0
movb %al, -0xa21(%rbp)
jmp 0x6119
movb -0xa21(%rbp), %al
testb $0x1, %al
jne 0x6128
jmp 0x6295
movl $0x10, %edi
movl $0x8, %esi
callq 0x7640
movl %eax, -0xa28(%rbp)
jmp 0x613f
movl -0xa28(%rbp), %edx
leaq -0x968(%rbp), %rdi
leaq -0x7e0(%rbp), %rsi
callq 0x55f0
jmp 0x615a
leaq -0x7e0(%rbp), %rdi
movl $0x22, %esi
movl $0x5c, %edx
callq 0x77e0
movq %rdx, -0xa38(%rbp)
movq %rax, -0xa30(%rbp)
jmp 0x6180
movq -0xa38(%rbp), %rax
movq -0xa30(%rbp), %rcx
movq %rcx, -0x988(%rbp)
movq %rax, -0x980(%rbp)
movw -0x980(%rbp), %ax
movw %ax, -0x970(%rbp)
movq -0x988(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq -0x968(%rbp), %rdi
leaq -0x978(%rbp), %rsi
callq 0x7660
jmp 0x61cd
movq -0x9c0(%rbp), %rdi
movslq -0x7bc(%rbp), %rsi
callq 0x7940
addq $0x20, %rax
movq %rax, -0xa40(%rbp)
leaq -0x9a8(%rbp), %rdi
leaq -0x7e0(%rbp), %rsi
callq 0x5b40
jmp 0x6200
movq -0xa40(%rbp), %rdi
leaq -0x9a8(%rbp), %rsi
callq 0x7960
jmp 0x6215
leaq -0x9a8(%rbp), %rdi
callq 0x5270
movl -0x7bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7bc(%rbp)
leaq -0x968(%rbp), %rdi
callq 0x5310
jmp 0x60d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x62b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x6287
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x9a8(%rbp), %rdi
callq 0x5270
leaq -0x968(%rbp), %rdi
callq 0x5310
jmp 0x62b2
leaq -0x7e0(%rbp), %rdi
callq 0x5270
leaq -0x7b8(%rbp), %rdi
callq 0x5310
jmp 0x6043
leaq -0x7e0(%rbp), %rdi
callq 0x5270
leaq -0x7b8(%rbp), %rdi
callq 0x5310
jmp 0x6313
leaq -0x210(%rbp), %rdi
callq 0x50b0
jmp 0x62da
leaq -0x410(%rbp), %rdi
callq 0x5310
leaq -0x288(%rbp), %rdi
callq 0x5270
leaq -0x268(%rbp), %rdi
callq 0x5270
leaq -0x210(%rbp), %rdi
callq 0x50d0
addq $0xa40, %rsp            # imm = 0xA40
popq %rbp
retq
leaq -0x410(%rbp), %rdi
callq 0x5310
leaq -0x288(%rbp), %rdi
callq 0x5270
leaq -0x268(%rbp), %rdi
callq 0x5270
leaq -0x210(%rbp), %rdi
callq 0x50d0
movq -0x218(%rbp), %rdi
callq 0x56d0
nop