// File: Karunika[P]Taxi_Agency_OODB/./src/TaxiAgency.cpp
// Function: TaxiAgency::extend_shift_tenure(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
void TaxiAgency::extend_shift_tenure(string customer_uuid, int del_running_kms, int del_waiting_hours){
    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 del_total_cost = del_running_kms*taxi.data->fare_amount + del_waiting_hours*WaitingCharges;
            if(search_customer_by_uuid(customer_uuid).data->getBalance() < i->getTotalCost()+del_total_cost)
                throw booking_unsuccessful("Not enough balance to increase the shift tenure");

            i->extend_tenure(del_running_kms, del_waiting_hours);
            return;
        }
    throw invalid_argument("Customer with the supplied UUID is IDLE");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
addq $0x48, %rdi
callq 0x2aa60
movq %rax, -0x20(%rbp)
movq -0xa0(%rbp), %rdi
addq $0x48, %rdi
callq 0x2aac0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2aa90
testb $0x1, %al
jne 0x28622
jmp 0x28843
leaq -0x20(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fab0
movq -0xa8(%rbp), %rsi
movq %rax, %rdi
callq 0x1d6b0
testb $0x1, %al
jne 0x2864b
jmp 0x28833
leaq -0x20(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fac0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x4170
movq -0xa0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x23860
movq %rdx, -0xb8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x28691
movq -0xb8(%rbp), %rax
movl -0xac(%rbp), %ecx
movl %ecx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x41f0
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
movl 0x48(%rcx), %ecx
imull %ecx, %eax
movl -0x18(%rbp), %ecx
movl 0x88(%rdx), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x68(%rbp)
leaq -0x98(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x4170
movq -0xa0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x24a20
movq %rdx, -0xd0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x2870f
movq -0xd0(%rbp), %rax
movl -0xc4(%rbp), %ecx
movl %ecx, -0x78(%rbp)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x1f0d0
movl %eax, -0xdc(%rbp)
jmp 0x28734
leaq -0x20(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
callq 0x1fc60
movq %rax, -0xe8(%rbp)
jmp 0x2874e
movq -0xe8(%rbp), %rax
movl (%rax), %eax
addl -0x68(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x41f0
movl -0xec(%rbp), %ecx
movl -0xdc(%rbp), %eax
cmpl %ecx, %eax
jge 0x28813
movl $0x10, %edi
callq 0x41a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf8(%rbp)
leaq 0x97bd(%rip), %rsi      # 0x31f5b
callq 0x2ab30
jmp 0x287a5
movq -0xf8(%rbp), %rdi
leaq 0x1d435(%rip), %rsi     # 0x45be8
leaq -0xa68a(%rip), %rdx     # 0x1e130
callq 0x44b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x41f0
jmp 0x2889a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x41f0
jmp 0x2889a
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x4240
jmp 0x2889a
leaq -0x20(%rbp), %rdi
callq 0x2aaf0
movq %rax, %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x20120
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
jmp 0x28835
leaq -0x20(%rbp), %rdi
callq 0x2ab10
jmp 0x285f8
movl $0x10, %edi
callq 0x41a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x100(%rbp)
leaq 0x972a(%rip), %rsi      # 0x31f8b
callq 0x4530
jmp 0x28868
movq -0x100(%rbp), %rdi
movq 0x1d752(%rip), %rsi     # 0x45fc8
movq 0x1d72b(%rip), %rdx     # 0x45fa8
callq 0x44b0
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x4240
movq -0x60(%rbp), %rdi
callq 0x44f0
nopw %cs:(%rax,%rax)