// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
leaq 0x48(%rdi), %rbx
movq 0x48(%rdi), %r14
cmpq %rbx, %r14
je 0x16ce9
movq %rsi, %r13
movq %rdi, %r12
leaq 0x10(%r14), %r15
movq %r15, %rdi
callq 0x10a96
movq 0x8(%rax), %rdx
cmpq 0x8(%r13), %rdx
jne 0x16ce1
testq %rdx, %rdx
je 0x16d1b
movq (%r13), %rsi
movq (%rax), %rdi
callq 0x42e0
testl %eax, %eax
je 0x16d1b
movq (%r14), %r14
cmpq %rbx, %r14
jne 0x16cb6
movl $0x10, %edi
callq 0x4170
movq %rax, %r14
leaq 0x4ee5(%rip), %rsi      # 0x1bbe2
movq %rax, %rdi
callq 0x44d0
movq 0xc2ac(%rip), %rsi      # 0x22fb8
movq 0xc285(%rip), %rdx      # 0x22f98
movq %r14, %rdi
callq 0x4440
movq %r15, %rdi
callq 0x10aa0
leaq -0x60(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0xf492
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12776
movq %rdx, %rbx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x16d5d
callq 0x4280
movl 0x48(%rbx), %ebx
imull -0x2c(%rbp), %ebx
movl 0x88(%r12), %r14d
imull -0x30(%rbp), %r14d
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r13
movq %r13, %rdi
callq 0xf492
movq %r12, %rdi
movq %r13, %rsi
callq 0x137ac
movq %rdx, %rdi
callq 0x1042c
movl %eax, %r12d
movq %r15, %rdi
callq 0x10bda
addl %ebx, %r14d
addl (%rax), %r14d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x16dc6
callq 0x4280
cmpl %r14d, %r12d
jl 0x16de8
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x10f50
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4170
leaq 0xbe17(%rip), %rcx      # 0x22c10
movq %rcx, (%rax)
leaq 0x4daf(%rip), %rcx      # 0x1bbb2
movq %rcx, 0x8(%rax)
leaq 0xbdda(%rip), %rsi      # 0x22be8
movq 0xc1b3(%rip), %rdx      # 0x22fc8
movq %rax, %rdi
callq 0x4440
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
jne 0x16e3b
jmp 0x16e4d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x16e4d
callq 0x4280
jmp 0x16e4d
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
movq %rbx, %rdi
callq 0x4490
nop