// File: mahdibohloul[P]SnapTrip/./Models/Hotel.cpp
// Function: Database::Hotel::comparator(Database::Hotel::SortProperty, Database::Hotel const*) const
int Database::Hotel::comparator(enum SortProperty property, const Hotel *right_side) const
{
    auto map = get_map_of_rooms_price();
    auto rs_map = right_side->get_map_of_rooms_price();
    switch(property)
    {
        case SP_Id : return comparator(id, right_side->id);
        case SP_Name : return comparator(property_name, right_side->property_name);
        case SP_Star_Rating : return comparator(hotel_star_rating, right_side->hotel_star_rating);
        case SP_City : return comparator(city, right_side->city);
        case SP_StandardRoomPrice : return comparator(map[Room::Room_Class::Standard], rs_map[Room::Room_Class::Standard]);
        case SP_DeluxeRoomPrice : return comparator(map[Room::Room_Class::Deluxe], rs_map[Room::Room_Class::Deluxe]);
        case SP_LuxuryRoomPrice : return comparator(map[Room::Room_Class::Luxury], rs_map[Room::Room_Class::Luxury]);
        case SP_PremiumRoomPrice : return comparator(map[Room::Room_Class::Premium], rs_map[Room::Room_Class::Premium]);
        case SP_AvgRoomPrice : return comparator(avg_price, right_side->avg_price);
        case SP_RatingOverall : return comparator(default_rating.overall_rating, right_side->default_rating.overall_rating);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0xb8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x59560
movq -0x20(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x59560
jmp 0x5a0a9
movl -0x14(%rbp), %eax
movq %rax, -0xc0(%rbp)
subq $0x9, %rax
ja 0x5a440
movq -0xc0(%rbp), %rax
leaq 0x5b2d5(%rip), %rcx     # 0xb53a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x5a460
movq -0xb8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5b4a0
movl %eax, -0xc4(%rbp)
jmp 0x5a103
movl -0xc4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5b1d0
jmp 0x5a460
movq -0xb8(%rbp), %rdi
addq $0x20, %rdi
movq -0x20(%rbp), %rsi
addq $0x20, %rsi
callq 0x5b4a0
movl %eax, -0xc8(%rbp)
jmp 0x5a15b
movl -0xc8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movq -0xb8(%rbp), %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movq -0x20(%rbp), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
callq 0x5b500
movl %eax, -0xcc(%rbp)
jmp 0x5a199
movl -0xcc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movq -0xb8(%rbp), %rdi
subq $-0x80, %rdi
movq -0x20(%rbp), %rsi
subq $-0x80, %rsi
callq 0x5b4a0
movl %eax, -0xd0(%rbp)
jmp 0x5a1d1
movl -0xd0(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movl $0x0, -0x94(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0xd8(%rbp)
jmp 0x5a20c
movl $0x0, -0x98(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0xe0(%rbp)
jmp 0x5a22f
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdi
callq 0x5b550
movl %eax, -0xe4(%rbp)
jmp 0x5a24a
movl -0xe4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movl $0x1, -0x9c(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0xf0(%rbp)
jmp 0x5a285
movl $0x1, -0xa0(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0xf8(%rbp)
jmp 0x5a2a8
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdi
callq 0x5b550
movl %eax, -0xfc(%rbp)
jmp 0x5a2c3
movl -0xfc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movl $0x2, -0xa4(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0x108(%rbp)
jmp 0x5a2fe
movl $0x2, -0xa8(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0x110(%rbp)
jmp 0x5a321
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdi
callq 0x5b550
movl %eax, -0x114(%rbp)
jmp 0x5a33c
movl -0x114(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movl $0x3, -0xac(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xac(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0x120(%rbp)
jmp 0x5a377
movl $0x3, -0xb0(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x5b0f0
movq %rax, -0x128(%rbp)
jmp 0x5a39a
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdi
callq 0x5b550
movl %eax, -0x12c(%rbp)
jmp 0x5a3b5
movl -0x12c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movq -0xb8(%rbp), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
movq -0x20(%rbp), %rsi
addq $0x1d0, %rsi            # imm = 0x1D0
callq 0x5b550
movl %eax, -0x130(%rbp)
jmp 0x5a3f0
movl -0x130(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
movq -0xb8(%rbp), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movq -0x20(%rbp), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
callq 0x5b550
movl %eax, -0x134(%rbp)
jmp 0x5a42b
movl -0x134(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x5a442
ud2
leaq -0x80(%rbp), %rdi
callq 0x5b1d0
leaq -0x50(%rbp), %rdi
callq 0x5b1d0
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x5b1d0
movq -0x88(%rbp), %rdi
callq 0x6750
nopw %cs:(%rax,%rax)