// File: XuhuiSun95[P]Ticket-Booking-Service/server/ServerInterface.cpp
// Function: ServerInterface::Init()
void ServerInterface::Init() {

    std::cout << "Initializing Server..." << std::endl;
    std::cout << "Vending ticket type (movies or plays): ";
    std::cin >> mServerName;
    if(mServerName.compare("movies")!=0 && mServerName.compare("plays")!=0) {

        std::cout << "Please enter valid type!" << std::endl;
        mServerName = "";
        return;
    }

    std::string address = "";
    int port = -1;

    std::cout << "Enter Server INFO" << std::endl;
    std::cout << std::setw(20) << std::left << "IP address: ";
    std::cin >> address;
    std::cout << std::setw(20) << std::left << "Port: ";
    std::cin >> port;
    if(!std::cin.good() || port<1000) {

        std::cout << "Please enter valid port!" << std::endl;
        std::cin.clear();
        std::cin.ignore(INT_MAX, '\n');
        mServerName = "";
        return;
    }
    std::cout << std::endl;
    mServerInfo = std::make_pair(address, port);

    std::cout << "Enter Pair Server INFO" << std::endl;
    std::cout << std::setw(20) << std::left << "IP address: ";
    std::cin >> address;
    std::cout << std::setw(20) << std::left << "Port: ";
    std::cin >> port;
    if(!std::cin.good() || port<1000) {

        std::cout << "Please enter valid port!" << std::endl;
        std::cin.clear();
        std::cin.ignore(INT_MAX, '\n');
        mServerName = "";
        return;
    }
    std::cout << std::endl;
    mPairInfo = std::make_pair(address, port);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq 0x5f87(%rip), %rdi      # 0x9fc8
leaq 0x2128(%rip), %rsi      # 0x6170
callq 0x21f0
movq %rax, %rdi
movq 0x5f59(%rip), %rsi      # 0x9fb0
callq 0x2220
movq 0x5f65(%rip), %rdi      # 0x9fc8
leaq 0x211d(%rip), %rsi      # 0x6187
callq 0x21f0
movq -0xb0(%rbp), %rsi
addq $0x8, %rsi
movq 0x5f5f(%rip), %rdi      # 0x9fe0
callq 0x2270
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2117(%rip), %rsi      # 0x61af
callq 0x2090
cmpl $0x0, %eax
je 0x40fc
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2102(%rip), %rsi      # 0x61b6
callq 0x2090
cmpl $0x0, %eax
je 0x40fc
movq 0x5f03(%rip), %rdi      # 0x9fc8
leaq 0x20f0(%rip), %rsi      # 0x61bc
callq 0x21f0
movq %rax, %rdi
movq 0x5ed5(%rip), %rsi      # 0x9fb0
callq 0x2220
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x21ea(%rip), %rsi      # 0x62dc
callq 0x2280
jmp 0x45cb
leaq -0x29(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x2360
movq -0xb8(%rbp), %rdx
leaq 0x21c2(%rip), %rsi      # 0x62dc
leaq -0x28(%rbp), %rdi
callq 0x2290
jmp 0x4125
leaq -0x29(%rbp), %rdi
callq 0x2230
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movq 0x5e8c(%rip), %rdi      # 0x9fc8
leaq 0x2092(%rip), %rsi      # 0x61d5
callq 0x21f0
movq %rax, -0xc0(%rbp)
jmp 0x4151
movq -0xc0(%rbp), %rdi
movq 0x5e51(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x4166
movl $0x14, %edi
callq 0x4d10
movl %eax, -0xc4(%rbp)
jmp 0x4178
movl -0xc4(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
movq 0x5e3d(%rip), %rdi      # 0x9fc8
callq 0x2250
movq %rax, -0xd0(%rbp)
jmp 0x4199
movq -0xd0(%rbp), %rdi
leaq 0xbb9(%rip), %rsi       # 0x4d60
callq 0x20c0
movq %rax, -0xd8(%rbp)
jmp 0x41b5
movq -0xd8(%rbp), %rdi
leaq 0x2024(%rip), %rsi      # 0x61e7
callq 0x21f0
jmp 0x41ca
movq 0x5e0f(%rip), %rdi      # 0x9fe0
leaq -0x28(%rbp), %rsi
callq 0x2270
jmp 0x41dc
movl $0x14, %edi
callq 0x4d10
movl %eax, -0xdc(%rbp)
jmp 0x41ee
movl -0xdc(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %esi
movq 0x5dc7(%rip), %rdi      # 0x9fc8
callq 0x2250
movq %rax, -0xe8(%rbp)
jmp 0x420f
movq -0xe8(%rbp), %rdi
leaq 0xb43(%rip), %rsi       # 0x4d60
callq 0x20c0
movq %rax, -0xf0(%rbp)
jmp 0x422b
movq -0xf0(%rbp), %rdi
leaq 0x1fbb(%rip), %rsi      # 0x61f4
callq 0x21f0
jmp 0x4240
movq 0x5d99(%rip), %rdi      # 0x9fe0
leaq -0x40(%rbp), %rsi
callq 0x2140
jmp 0x4252
movq 0x5d87(%rip), %rdi      # 0x9fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2320
movb %al, -0xf1(%rbp)
jmp 0x4270
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x427c
jmp 0x4289
cmpl $0x3e8, -0x40(%rbp)     # imm = 0x3E8
jge 0x4345
movq 0x5d38(%rip), %rdi      # 0x9fc8
leaq 0x1f64(%rip), %rsi      # 0x61fb
callq 0x21f0
movq %rax, -0x100(%rbp)
jmp 0x42a5
movq -0x100(%rbp), %rdi
movq 0x5cfd(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x42ba
movq 0x5d1f(%rip), %rdi      # 0x9fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x2310
jmp 0x42d4
movq 0x5d05(%rip), %rdi      # 0x9fe0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0xa, %edx
callq 0x2160
jmp 0x42ec
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x1fde(%rip), %rsi      # 0x62dc
callq 0x2280
jmp 0x4305
movl $0x1, -0x4c(%rbp)
jmp 0x45c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x2230
jmp 0x45d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2150
jmp 0x45d4
movq 0x5c7c(%rip), %rdi      # 0x9fc8
movq 0x5c5d(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x435a
leaq -0x78(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d90
jmp 0x436d
movq -0xb0(%rbp), %rdi
addq $0x28, %rdi
leaq -0x78(%rbp), %rsi
movq %rsi, -0x110(%rbp)
callq 0x4dd0
movq -0x110(%rbp), %rdi
callq 0x2db0
movq 0x5c2d(%rip), %rdi      # 0x9fc8
leaq 0x1e72(%rip), %rsi      # 0x6214
callq 0x21f0
movq %rax, -0x108(%rbp)
jmp 0x43b0
movq -0x108(%rbp), %rdi
movq 0x5bf2(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x43c5
movl $0x14, %edi
callq 0x4d10
movl %eax, -0x114(%rbp)
jmp 0x43d7
movl -0x114(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %esi
movq 0x5bde(%rip), %rdi      # 0x9fc8
callq 0x2250
movq %rax, -0x120(%rbp)
jmp 0x43f8
movq -0x120(%rbp), %rdi
leaq 0x95a(%rip), %rsi       # 0x4d60
callq 0x20c0
movq %rax, -0x128(%rbp)
jmp 0x4414
movq -0x128(%rbp), %rdi
leaq 0x1dc5(%rip), %rsi      # 0x61e7
callq 0x21f0
jmp 0x4429
movq 0x5bb0(%rip), %rdi      # 0x9fe0
leaq -0x28(%rbp), %rsi
callq 0x2270
jmp 0x443b
movl $0x14, %edi
callq 0x4d10
movl %eax, -0x12c(%rbp)
jmp 0x444d
movl -0x12c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %esi
movq 0x5b68(%rip), %rdi      # 0x9fc8
callq 0x2250
movq %rax, -0x138(%rbp)
jmp 0x446e
movq -0x138(%rbp), %rdi
leaq 0x8e4(%rip), %rsi       # 0x4d60
callq 0x20c0
movq %rax, -0x140(%rbp)
jmp 0x448a
movq -0x140(%rbp), %rdi
leaq 0x1d5c(%rip), %rsi      # 0x61f4
callq 0x21f0
jmp 0x449f
movq 0x5b3a(%rip), %rdi      # 0x9fe0
leaq -0x40(%rbp), %rsi
callq 0x2140
jmp 0x44b1
movq 0x5b28(%rip), %rdi      # 0x9fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2320
movb %al, -0x141(%rbp)
jmp 0x44cf
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0x44db
jmp 0x44e8
cmpl $0x3e8, -0x40(%rbp)     # imm = 0x3E8
jge 0x456d
movq 0x5ad9(%rip), %rdi      # 0x9fc8
leaq 0x1d05(%rip), %rsi      # 0x61fb
callq 0x21f0
movq %rax, -0x150(%rbp)
jmp 0x4504
movq -0x150(%rbp), %rdi
movq 0x5a9e(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x4519
movq 0x5ac0(%rip), %rdi      # 0x9fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x2310
jmp 0x4533
movq 0x5aa6(%rip), %rdi      # 0x9fe0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0xa, %edx
callq 0x2160
jmp 0x454b
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x1d7f(%rip), %rsi      # 0x62dc
callq 0x2280
jmp 0x4564
movl $0x1, -0x4c(%rbp)
jmp 0x45c2
movq 0x5a54(%rip), %rdi      # 0x9fc8
movq 0x5a35(%rip), %rsi      # 0x9fb0
callq 0x2220
jmp 0x4582
leaq -0xa8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d90
jmp 0x4598
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4dd0
leaq -0xa8(%rbp), %rdi
callq 0x2db0
movl $0x0, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2150
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2350
nopl (%rax)