// File: tanguysegarra[P]libcsv/src/writer.hxx
// Function: csv::Writer::write_rows() const
void Writer::write_rows() const
    {
        std::ofstream ofs(filename_);
        if (!ofs.is_open())
            throw InvalidArgumentException("Could not open file: " + filename_);

        for (size_t i = 0; i < rows_.size(); i++)
        {
            ofs << rows_[i].first;
            if(i != rows_.size() - 1)
                ofs << delimiter_;
        }
        ofs << "\n";

        for (size_t i = 0; i < rows_[0].second.size(); i++)
        {
            for (size_t j = 0; j < rows_.size(); j++)
            {
                ofs << rows_[j].second[i];
                if (j != rows_.size() - 1)
                    ofs << delimiter_;
            }
            ofs << "\n";
        }

        ofs.close();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x270(%rbp)
addq $0x18, %rsi
leaq -0x208(%rbp), %rdi
movq %rdi, -0x268(%rbp)
movl $0x10, %edx
callq 0x5760
movq -0x268(%rbp), %rdi
callq 0x5320
movb %al, -0x259(%rbp)
jmp 0x677a
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0x6862
jmp 0x678a
movb $0x1, -0x239(%rbp)
movl $0x28, %edi
callq 0x51e0
movq -0x270(%rbp), %rdx
movq %rax, -0x278(%rbp)
addq $0x18, %rdx
leaq 0x2ea08(%rip), %rsi     # 0x351bc
leaq -0x238(%rbp), %rdi
callq 0x7450
jmp 0x67c2
movq -0x278(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x7560
jmp 0x67d7
movq -0x278(%rbp), %rdi
movb $0x0, -0x239(%rbp)
leaq 0x47294(%rip), %rsi     # 0x4da80
leaq 0xe0d(%rip), %rdx       # 0x7600
callq 0x5690
jmp 0x6ab5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x6a9d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x6846
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5270
testb $0x1, -0x239(%rbp)
jne 0x6851
jmp 0x685d
movq -0x278(%rbp), %rdi
callq 0x5300
jmp 0x6a9d
movq $0x0, -0x248(%rbp)
movq -0x270(%rbp), %rdi
movq -0x248(%rbp), %rax
movq %rax, -0x280(%rbp)
callq 0x7a80
movq %rax, %rcx
movq -0x280(%rbp), %rax
cmpq %rcx, %rax
jae 0x691f
movq -0x270(%rbp), %rdi
movq -0x248(%rbp), %rsi
callq 0x7b20
movq %rax, %rsi
leaq -0x208(%rbp), %rdi
callq 0x53a0
jmp 0x68be
movq -0x270(%rbp), %rdi
movq -0x248(%rbp), %rax
movq %rax, -0x288(%rbp)
callq 0x7a80
movq %rax, %rcx
movq -0x288(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x6906
movq -0x270(%rbp), %rax
movsbl 0x38(%rax), %esi
leaq -0x208(%rbp), %rdi
callq 0x54b0
jmp 0x6904
jmp 0x6906
jmp 0x6908
movq -0x248(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x248(%rbp)
jmp 0x686d
leaq 0x2e917(%rip), %rsi     # 0x3523d
leaq -0x208(%rbp), %rdi
callq 0x53d0
jmp 0x6934
movq $0x0, -0x250(%rbp)
movq -0x270(%rbp), %rdi
movq -0x250(%rbp), %rax
movq %rax, -0x290(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x7b20
movq %rax, %rdi
addq $0x20, %rdi
callq 0x7cc0
movq %rax, %rcx
movq -0x290(%rbp), %rax
cmpq %rcx, %rax
jae 0x6a7a
movq $0x0, -0x258(%rbp)
movq -0x270(%rbp), %rdi
movq -0x258(%rbp), %rax
movq %rax, -0x298(%rbp)
callq 0x7a80
movq %rax, %rcx
movq -0x298(%rbp), %rax
cmpq %rcx, %rax
jae 0x6a4c
movq -0x270(%rbp), %rdi
movq -0x258(%rbp), %rsi
callq 0x7b20
movq %rax, %rdi
addq $0x20, %rdi
movq -0x250(%rbp), %rsi
callq 0x7ce0
movq %rax, %rsi
leaq -0x208(%rbp), %rdi
callq 0x53a0
jmp 0x69eb
movq -0x270(%rbp), %rdi
movq -0x258(%rbp), %rax
movq %rax, -0x2a0(%rbp)
callq 0x7a80
movq %rax, %rcx
movq -0x2a0(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x6a33
movq -0x270(%rbp), %rax
movsbl 0x38(%rax), %esi
leaq -0x208(%rbp), %rdi
callq 0x54b0
jmp 0x6a31
jmp 0x6a33
jmp 0x6a35
movq -0x258(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x258(%rbp)
jmp 0x6987
leaq 0x2e7ea(%rip), %rsi     # 0x3523d
leaq -0x208(%rbp), %rdi
callq 0x53d0
jmp 0x6a61
jmp 0x6a63
movq -0x250(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x250(%rbp)
jmp 0x693f
leaq -0x208(%rbp), %rdi
callq 0x5580
jmp 0x6a88
leaq -0x208(%rbp), %rdi
callq 0x55b0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0x208(%rbp), %rdi
callq 0x55b0
movq -0x210(%rbp), %rdi
callq 0x56d0
nopw %cs:(%rax,%rax)