// File: 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
subq $0x510, %rsp            # imm = 0x510
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x460(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x458(%rbp)
callq 0x4340
movq -0x458(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x4200
jmp 0x256e8
leaq -0x2b0(%rbp), %rdi
callq 0x2a110
jmp 0x256f6
leaq -0x218(%rbp), %rdi
callq 0x4450
movb %al, -0x461(%rbp)
jmp 0x2570a
movb -0x461(%rbp), %al
testb $0x1, %al
jne 0x25719
jmp 0x25ce3
leaq -0x2d0(%rbp), %rdi
callq 0x43e0
movl 0x20bd5(%rip), %eax     # 0x46300
movq %rax, -0x478(%rbp)
movq %rsp, %rcx
movq %rcx, -0x2d8(%rbp)
movq %rax, %rdx
shlq $0x5, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x470(%rbp)
movq %rcx, %rsp
movq %rax, -0x2e0(%rbp)
cmpq $0x0, %rax
je 0x257b7
movq -0x470(%rbp), %rax
movq -0x478(%rbp), %rdx
shlq $0x5, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x488(%rbp)
movq %rax, -0x480(%rbp)
movq -0x480(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x43e0
movq -0x490(%rbp), %rax
movq -0x488(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x480(%rbp)
jne 0x25786
leaq -0x218(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x4090
jmp 0x257cc
jmp 0x257ce
leaq -0x218(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x4090
movq %rax, -0x498(%rbp)
jmp 0x257ea
movq -0x498(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4380
movb %al, -0x499(%rbp)
jmp 0x25808
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0x25817
jmp 0x25c02
leaq -0x300(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x4170
jmp 0x2582c
movq -0x470(%rbp), %rsi
movl 0x20ac7(%rip), %edx     # 0x46300
leaq -0x300(%rbp), %rdi
callq 0x23670
jmp 0x25847
leaq -0x300(%rbp), %rdi
callq 0x41f0
movq -0x470(%rbp), %rdi
callq 0x4430
movq -0x470(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
leaq -0x3a8(%rbp), %rdi
movl $0x1, %edx
callq 0x4300
jmp 0x25880
movq -0x470(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x4430
movq -0x4a8(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
leaq -0x3c8(%rbp), %rdi
movl $0x1, %edx
callq 0x4300
jmp 0x258b8
movq -0x470(%rbp), %rdi
addq $0x40, %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x4430
movq -0x4b0(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
leaq -0x3e8(%rbp), %rdi
movl $0x1, %edx
callq 0x4300
jmp 0x258f0
movq -0x470(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x4430
movq -0x4b8(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
leaq -0x408(%rbp), %rdi
movl $0x1, %edx
callq 0x4300
jmp 0x25928
movq -0x470(%rbp), %rdi
subq $-0x80, %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x4430
movq -0x4c0(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
leaq -0x428(%rbp), %rdi
movl $0x1, %edx
callq 0x4300
jmp 0x25960
leaq 0xc647(%rip), %rsi      # 0x31fae
leaq -0x428(%rbp), %rdi
callq 0x295d0
movb %al, -0x4c1(%rbp)
jmp 0x2597b
movb -0x4c1(%rbp), %al
movzbl %al, %r9d
andl $0x1, %r9d
leaq -0x388(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
leaq -0x3e8(%rbp), %rcx
leaq -0x408(%rbp), %r8
callq 0x1eac0
jmp 0x259b3
leaq -0x2b0(%rbp), %rdi
leaq -0x388(%rbp), %rsi
movq %rsi, -0x4e0(%rbp)
callq 0x2a140
movq -0x4e0(%rbp), %rdi
callq 0x2a190
leaq -0x428(%rbp), %rdi
callq 0x41f0
leaq -0x408(%rbp), %rdi
callq 0x41f0
leaq -0x3e8(%rbp), %rdi
callq 0x41f0
leaq -0x3c8(%rbp), %rdi
callq 0x41f0
leaq -0x3a8(%rbp), %rdi
callq 0x41f0
movq -0x460(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x4d8(%rbp)
leaq -0x449(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x4500
movq -0x4d0(%rbp), %rdx
leaq 0xc356(%rip), %rsi      # 0x31da0
leaq -0x448(%rbp), %rdi
callq 0x43d0
jmp 0x25a58
movq -0x4d8(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x203b0
movq %rax, -0x4e8(%rbp)
jmp 0x25a74
movq -0x4e8(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0x448(%rbp), %rdi
callq 0x41f0
leaq -0x449(%rbp), %rdi
callq 0x4330
movq -0x460(%rbp), %rdi
addq $0x18, %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x2a1c0
jmp 0x25ab2
jmp 0x257ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25d6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25d61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25c80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x41f0
jmp 0x25c80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25bb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25ba5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25b99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25b8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x41f0
leaq -0x408(%rbp), %rdi
callq 0x41f0
leaq -0x3e8(%rbp), %rdi
callq 0x41f0
leaq -0x3c8(%rbp), %rdi
callq 0x41f0
leaq -0x3a8(%rbp), %rdi
callq 0x41f0
jmp 0x25c80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x25bf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x41f0
leaq -0x449(%rbp), %rdi
callq 0x4330
jmp 0x25c80
leaq -0x218(%rbp), %rdi
callq 0x40b0
jmp 0x25c10
movq -0x470(%rbp), %rcx
movq -0x478(%rbp), %rdx
shlq $0x5, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x4f0(%rbp)
je 0x25c65
movq -0x4f0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x4f8(%rbp)
callq 0x41f0
movq -0x470(%rbp), %rcx
movq -0x4f8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4f0(%rbp)
jne 0x25c34
movq -0x2d8(%rbp), %rax
movq %rax, %rsp
leaq -0x2d0(%rbp), %rdi
callq 0x41f0
jmp 0x25d44
movq -0x470(%rbp), %rcx
movq -0x478(%rbp), %rdx
shlq $0x5, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x500(%rbp)
je 0x25cd5
movq -0x500(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x508(%rbp)
callq 0x41f0
movq -0x470(%rbp), %rcx
movq -0x508(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x500(%rbp)
jne 0x25ca4
leaq -0x2d0(%rbp), %rdi
callq 0x41f0
jmp 0x25d61
movl $0x10, %edi
callq 0x41a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x510(%rbp)
leaq 0xbe4d(%rip), %rsi      # 0x31b4e
callq 0x4140
jmp 0x25d08
movq -0x510(%rbp), %rdi
movq 0x202da(%rip), %rsi     # 0x45ff0
movq 0x20253(%rip), %rdx     # 0x45f70
callq 0x44b0
jmp 0x25d85
movq -0x510(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
callq 0x4240
jmp 0x25d61
leaq -0x2b0(%rbp), %rdi
callq 0x2a190
leaq -0x218(%rbp), %rdi
callq 0x40f0
movq %rbp, %rsp
popq %rbp
retq
leaq -0x2b0(%rbp), %rdi
callq 0x2a190
leaq -0x218(%rbp), %rdi
callq 0x40f0
movq -0x220(%rbp), %rdi
callq 0x44f0
nopw %cs:(%rax,%rax)