// File: mahdibohloul[P]SnapTrip/./ORM/ObjectRelational.cpp
// Function: ObjectRelational::booked_out(Database::User::ReserveInfo&, Database::User*)
void ObjectRelational::booked_out(Database::User::ReserveInfo& reserve_info, Database::User* user)
{
    Database::Hotel* hotel = database->query_in_hotels(reserve_info.hotel_id);
    if(hotel == nullptr)
        throw Exception(ConstNames::Not_Found_msg);
    if(!hotel->have_room_with_this_specifications(reserve_info.type, reserve_info.quantity, reserve_info.check_in, reserve_info.check_out))
        throw Exception(ConstNames::Not_Enough_Room_msg);
    if(!user->can_pay(hotel->cost_to_reserve(reserve_info.type, reserve_info.quantity)))
        throw Exception(ConstNames::Not_Enough_Credit_msg);
    database->booked_out(user, hotel, reserve_info.quantity, reserve_info.check_in, reserve_info.check_out, reserve_info.type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x61d0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x54210
movq %rax, -0xd0(%rbp)
jmp 0x741b0
leaq -0x40(%rbp), %rdi
callq 0x6828
movq -0xd0(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x74281
movb $0x1, -0x71(%rbp)
movl $0x28, %edi
callq 0x6210
movq %rax, -0xf0(%rbp)
leaq 0xa1915(%rip), %rsi     # 0x115b00
leaq -0x70(%rbp), %rdi
callq 0x61d0
jmp 0x741f6
movq -0xf0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xabc90
jmp 0x74208
movq -0xf0(%rbp), %rdi
movb $0x0, -0x71(%rbp)
leaq 0x93a4e(%rip), %rsi     # 0x107c68
leaq 0x37adf(%rip), %rdx     # 0xabd00
callq 0x6710
jmp 0x74485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x6828
jmp 0x7447c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x74268
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6828
testb $0x1, -0x71(%rbp)
jne 0x74270
jmp 0x7427c
movq -0xf0(%rbp), %rdi
callq 0x6360
jmp 0x7447c
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x54(%rax), %edx
movq -0x10(%rbp), %rax
movl 0x58(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %r8d
callq 0x58df0
testb $0x1, %al
jne 0x74359
movb $0x1, -0x99(%rbp)
movl $0x28, %edi
callq 0x6210
movq %rax, -0xf8(%rbp)
leaq 0xa1872(%rip), %rsi     # 0x115b40
leaq -0x98(%rbp), %rdi
callq 0x61d0
jmp 0x742dc
movq -0xf8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xabc90
jmp 0x742f1
movq -0xf8(%rbp), %rdi
movb $0x0, -0x99(%rbp)
leaq 0x93962(%rip), %rsi     # 0x107c68
leaq 0x379f3(%rip), %rdx     # 0xabd00
callq 0x6710
jmp 0x74485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7433d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x6828
testb $0x1, -0x99(%rbp)
jne 0x74348
jmp 0x74354
movq -0xf8(%rbp), %rdi
callq 0x6360
jmp 0x7447c
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x54(%rax), %edx
callq 0x58f10
movq -0x100(%rbp), %rdi
movq %rsp, %rax
fstpt (%rax)
callq 0x67870
testb $0x1, %al
jne 0x7443b
movb $0x1, -0xc1(%rbp)
movl $0x28, %edi
callq 0x6210
movq %rax, -0x108(%rbp)
leaq 0xa17ad(%rip), %rsi     # 0x115b60
leaq -0xc0(%rbp), %rdi
callq 0x61d0
jmp 0x743c1
movq -0x108(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xabc90
jmp 0x743d6
movq -0x108(%rbp), %rdi
movb $0x0, -0xc1(%rbp)
leaq 0x9387d(%rip), %rsi     # 0x107c68
leaq 0x3790e(%rip), %rdx     # 0xabd00
callq 0x6710
jmp 0x74485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x74422
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x6828
testb $0x1, -0xc1(%rbp)
jne 0x7442d
jmp 0x74439
movq -0x108(%rbp), %rdi
callq 0x6360
jmp 0x7447c
movq -0xe8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x54(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x58(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %r9d
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, (%rsp)
callq 0x54530
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x6750
nopw %cs:(%rax,%rax)