// File: Karunika[P]Taxi_Agency_OODB/./src/TaxiAgency.cpp
// Function: TaxiAgency::end_shift(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void TaxiAgency::end_shift(string customer_uuid){
    for(list<Shift>::iterator i = current_shifts.begin(); i != current_shifts.end(); ++i)
        if(i->getCustomerUUID() == customer_uuid){
            IndexInstance<Taxi> taxi = retrieve_taxi_by_id(i->getCarID());
            int total_cost = i->getRunningKms()*taxi.data->fare_amount + i->getWaitingHours()*WaitingCharges;
            shift_history.push_back(*i);
            current_shifts.erase(i);
            search_customer_by_uuid(customer_uuid).data->makeTransaction(total_cost);
            return;
        }
    throw invalid_argument("Customer with the supplied UUID is IDLE");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rsi, -0xb0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
addq $0x48, %rdi
callq 0x2aa60
movq %rax, -0x18(%rbp)
movq -0xa8(%rbp), %rdi
addq $0x48, %rdi
callq 0x2aac0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2aa90
testb $0x1, %al
jne 0x289ec
jmp 0x28be9
leaq -0x18(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fab0
movq -0xb0(%rbp), %rsi
movq %rax, %rdi
callq 0x1d6b0
testb $0x1, %al
jne 0x28a15
jmp 0x28bd9
leaq -0x18(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fac0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x4170
movq -0xa8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x23860
movq %rdx, -0xc0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x28a5b
movq -0xc0(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, -0x30(%rbp)
movq %rax, -0x28(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41f0
leaq -0x18(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fb20
movq -0xf0(%rbp), %rdi
movl (%rax), %eax
movq -0x28(%rbp), %rcx
movl 0x48(%rcx), %ecx
imull %ecx, %eax
movl %eax, -0xfc(%rbp)
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fbc0
movl -0xfc(%rbp), %ecx
movq -0xf0(%rbp), %rdi
movq %rax, %rdx
movq -0xa8(%rbp), %rax
movl (%rdx), %edx
movl 0x88(%rax), %esi
imull %esi, %edx
addl %edx, %ecx
movl %ecx, -0x60(%rbp)
addq $0x60, %rax
movq %rax, -0xf8(%rbp)
callq 0x2ab70
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x2aa20
movq -0xf0(%rbp), %rsi
movq -0xa8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0xe8(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2acc0
movq -0xe8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2ac70
movq -0xb0(%rbp), %rsi
movq %rax, -0x70(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x4170
movq -0xa8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x24a20
movq %rdx, -0xd8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x28b6e
movq -0xd8(%rbp), %rax
movl -0xcc(%rbp), %ecx
movl %ecx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x1f0f0
jmp 0x28b90
leaq -0xa0(%rbp), %rdi
callq 0x41f0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41f0
jmp 0x28c40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x41f0
jmp 0x28c40
jmp 0x28bdb
leaq -0x18(%rbp), %rdi
callq 0x2ab10
jmp 0x289c2
movl $0x10, %edi
callq 0x41a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x108(%rbp)
leaq 0x9384(%rip), %rsi      # 0x31f8b
callq 0x4530
jmp 0x28c0e
movq -0x108(%rbp), %rdi
movq 0x1d3ac(%rip), %rsi     # 0x45fc8
movq 0x1d385(%rip), %rdx     # 0x45fa8
callq 0x44b0
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x4240
movq -0x58(%rbp), %rdi
callq 0x44f0
nopl (%rax)