// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
leaq 0x48(%rdi), %rbx
movq %rdi, -0x40(%rbp)
movq 0x48(%rdi), %r12
cmpq %rbx, %r12
sete %r14b
je 0x16e86
movq %rsi, %r13
leaq 0x10(%r12), %r15
movq %r15, %rdi
callq 0x10b40
movq 0x8(%rax), %rdx
cmpq 0x8(%r13), %rdx
jne 0x16e79
testq %rdx, %rdx
je 0x16eb8
movq (%r13), %rsi
movq (%rax), %rdi
callq 0x42e0
testl %eax, %eax
je 0x16eb8
movq (%r12), %r12
cmpq %rbx, %r12
sete %r14b
jne 0x16e4d
movl $0x10, %edi
callq 0x4170
movq %rax, %r14
leaq 0x4d48(%rip), %rsi      # 0x1bbe2
movq %rax, %rdi
callq 0x44d0
movq 0xc10f(%rip), %rsi      # 0x22fb8
movq 0xc0e8(%rip), %rdx      # 0x22f98
movq %r14, %rdi
callq 0x4440
movq %r15, %rdi
callq 0x10b4a
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0xf530
movq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0x12838
movq %rdx, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x16efc
callq 0x4280
movl 0x48(%rbx), %eax
imull -0x2c(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %r12
movl 0x88(%r12), %ebx
imull -0x30(%rbp), %ebx
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0xf530
movq %r12, %rdi
movq %r13, %rsi
callq 0x1389e
movq %rdx, %rdi
callq 0x104a4
movl %eax, %r13d
movq %r15, %rdi
callq 0x10c84
addl -0x34(%rbp), %ebx
addl (%rax), %ebx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x16f6a
callq 0x4280
cmpl %ebx, %r13d
jl 0x16f96
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x10ffa
testb $0x1, %r14b
jne 0x16e86
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4170
leaq 0xbc69(%rip), %rcx      # 0x22c10
movq %rcx, (%rax)
leaq 0x4c01(%rip), %rcx      # 0x1bbb2
movq %rcx, 0x8(%rax)
leaq 0xbc2c(%rip), %rsi      # 0x22be8
movq 0xc005(%rip), %rdx      # 0x22fc8
movq %rax, %rdi
callq 0x4440
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
jne 0x16fe9
jmp 0x16ffb
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x16ffb
callq 0x4280
jmp 0x16ffb
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
movq %rbx, %rdi
callq 0x4490
nop