// File: /workspace/github_cpp_makefile_star2_O2/Karunika[P]Taxi_Agency_OODB/./src/TaxiAgency.cpp
// Function: TaxiAgency::populate_drivers_db(char const*)
void TaxiAgency::populate_drivers_db(const char* DRIVERS_FILE){
    ifstream File;
    File.open(DRIVERS_FILE);
    Driver driver;
    if(File.is_open()){
        string t, fields[Driver::DriverAttributesCount];
        getline(File, t); // skip heading row
        while(getline(File, t)){
            populate_fields(t, fields, Driver::DriverAttributesCount);
            driver = Driver(fields[0].substr(1, fields[0].length()-2),
                        fields[1].substr(1, fields[1].length()-2),
                        fields[2].substr(1, fields[2].length()-2),
                        fields[3].substr(1, fields[3].length()-2),
                        fields[4].substr(1, fields[4].length()-2) == "IDLE" ? IDLE : ONSHIFT
                    );
            stats["drivers"]++;
            driver_db.push_back(driver);
        }
        File.close();
    }else{
        throw runtime_error("File couldn't be resolved");
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x460(%rbp), %r14
movq %r14, %rdi
callq 0x42e0
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41e0
leaq -0x1d0(%rbp), %rdi
callq 0x11ebe
leaq -0x3e8(%rbp), %rdi
callq 0x40d0
testb %al, %al
je 0xfacd
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsp, -0x38(%rbp)
movb $0x0, (%rax)
movl 0xea66(%rip), %r14d     # 0x1e298
movq %rsp, %rbx
movq %r14, %rax
shlq $0x5, %rax
subq %rax, %rbx
movq %rbx, %rsp
testq %r14, %r14
je 0xf861
leaq 0x10(%rbx), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rcx
addq $-0x20, %rax
jne 0xf84b
leaq -0x460(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4080
leaq 0x20(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0x40(%rbx), %rax
movq %rax, -0x60(%rbp)
leaq 0x60(%rbx), %rax
movq %rax, -0x58(%rbp)
movq %rbx, -0x30(%rbp)
leaq 0x80(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq 0xa0(%r15), %rax
movq %rax, -0x48(%rbp)
addq $0x18, %r15
movq %r15, -0x40(%rbp)
leaq -0x460(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4080
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xfa6a
leaq -0x128(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4360
pushq $0x1
popq %r13
leaq -0xa8(%rbp), %r15
movl 0xe9a1(%rip), %edx      # 0x1e298
leaq -0x128(%rbp), %r12
movq %r12, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0xe410
movq %r12, %rdi
callq 0x4170
movq 0x8(%rbx), %rcx
addq $-0x2, %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x42c0
movq 0x28(%rbx), %rcx
addq $-0x2, %rcx
leaq -0x108(%rbp), %r13
movq %r13, %rdi
movq -0x68(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x42c0
movq 0x48(%rbx), %rcx
addq $-0x2, %rcx
leaq -0xe8(%rbp), %rdi
movq -0x60(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x42c0
leaq -0x148(%rbp), %r15
leaq -0x258(%rbp), %r12
movq 0x68(%rbx), %rcx
addq $-0x2, %rcx
leaq -0xc8(%rbp), %rdi
movq -0x58(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x42c0
movq 0x88(%rbx), %rcx
addq $-0x2, %rcx
movq %r15, %rdi
movq -0x50(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x42c0
movq %r15, %rdi
leaq 0x62d4(%rip), %rsi      # 0x15c85
callq 0x11b89
movzbl %al, %r9d
movq %r12, %rdi
leaq -0xa8(%rbp), %rsi
movq %r13, %rdx
movq %r15, %rbx
movq %r12, %r15
leaq -0xe8(%rbp), %r13
movq %r13, %rcx
leaq -0xc8(%rbp), %r12
movq %r12, %r8
callq 0xc5c8
leaq -0x1d0(%rbp), %rdi
movq %r15, %rsi
callq 0x11ee4
movq %r15, %rdi
callq 0x11f18
movq %rbx, %rdi
callq 0x4170
movq %r12, %rdi
callq 0x4170
movq %r13, %rdi
callq 0x4170
leaq -0x108(%rbp), %rdi
callq 0x4170
leaq -0xa8(%rbp), %rdi
callq 0x4170
movq %r15, %rdi
leaq 0x6040(%rip), %rsi      # 0x15a77
movq %rbx, %rdx
callq 0x4140
movq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0xd8f8
incl (%rax)
movq %r15, %rdi
callq 0x4170
movq -0x40(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x11f38
jmp 0xf8ae
leaq -0x460(%rbp), %rdi
movq -0x30(%rbp), %rbx
callq 0x40a0
testq %r14, %r14
je 0xfa96
addq $-0x20, %rbx
shlq $0x5, %r14
leaq (%rbx,%r14), %rdi
callq 0x4170
addq $-0x20, %r14
jne 0xfa87
movq -0x38(%rbp), %rsp
leaq -0x88(%rbp), %rdi
callq 0x4170
leaq -0x1d0(%rbp), %rdi
callq 0x11f18
leaq -0x460(%rbp), %rdi
callq 0x40e0
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x4190
movq %rax, %rbx
leaq 0x5d46(%rip), %rsi      # 0x15825
movq %rax, %rdi
callq 0x4130
movq 0xe4fa(%rip), %rsi      # 0x1dfe8
movq 0xe473(%rip), %rdx      # 0x1df68
movq %rbx, %rdi
callq 0x4410
movq %rax, %r15
jmp 0xfbcd
movq %rax, %r15
movq %rbx, %rdi
callq 0x4220
jmp 0xfbcd
jmp 0xfb17
movq %rax, %r15
jmp 0xfbd9
jmp 0xfb99
movq %rax, %r15
leaq -0x128(%rbp), %rdi
jmp 0xfb92
jmp 0xfb9e
movq %rax, %r15
jmp 0xfb69
movq %rax, %r15
leaq -0x148(%rbp), %rdi
callq 0x4170
jmp 0xfb48
movq %rax, %r15
leaq -0xc8(%rbp), %rdi
callq 0x4170
jmp 0xfb59
movq %rax, %r15
leaq -0xe8(%rbp), %rdi
callq 0x4170
movq -0x30(%rbp), %rbx
leaq -0x108(%rbp), %rdi
callq 0x4170
jmp 0xfb8b
movq %rax, %r15
leaq -0x258(%rbp), %rdi
callq 0x4170
jmp 0xfba1
movq %rax, %r15
leaq -0xa8(%rbp), %rdi
callq 0x4170
jmp 0xfba5
movq %rax, %r15
jmp 0xfba5
movq %rax, %r15
movq -0x30(%rbp), %rbx
testq %r14, %r14
je 0xfbc1
addq $-0x20, %rbx
shlq $0x5, %r14
leaq (%rbx,%r14), %rdi
callq 0x4170
addq $-0x20, %r14
jne 0xfbb2
leaq -0x88(%rbp), %rdi
callq 0x4170
leaq -0x1d0(%rbp), %rdi
callq 0x11f18
leaq -0x460(%rbp), %rdi
callq 0x40e0
movq %r15, %rdi
callq 0x4450
nop