// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
movq 0x4159(%rip), %rbx      # 0x6fc8
leaq 0x12fa(%rip), %rsi      # 0x4170
movq %rbx, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
leaq 0x12fa(%rip), %rsi      # 0x4187
movq %rbx, %rdi
callq 0x21c0
leaq 0x8(%r14), %rbx
movq 0x4140(%rip), %rdi      # 0x6fe0
movq %rbx, %rsi
callq 0x2220
leaq 0x1300(%rip), %rsi      # 0x41af
movq %rbx, %rdi
callq 0x2070
testl %eax, %eax
je 0x2f04
leaq 0x12f4(%rip), %rsi      # 0x41b6
movq %rbx, %rdi
callq 0x2070
testl %eax, %eax
je 0x2f04
movq 0x40f3(%rip), %rdi      # 0x6fc8
leaq 0x12e0(%rip), %rsi      # 0x41bc
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
leaq 0x13ec(%rip), %rsi      # 0x42dc
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22d0
leaq 0x13d1(%rip), %rsi      # 0x42dc
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x20a0
orl $-0x1, -0x24(%rbp)
movq 0x40a5(%rip), %r15      # 0x6fc8
leaq 0x12ab(%rip), %rsi      # 0x41d5
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ecx       # imm = 0xFFFFFF4F
andl 0x18(%r15,%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
leaq 0x1280(%rip), %rsi      # 0x41e7
movq %r15, %rdi
callq 0x21c0
movq 0x406a(%rip), %rdi      # 0x6fe0
leaq -0x48(%rbp), %rsi
callq 0x2220
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ecx       # imm = 0xFFFFFF4F
andl 0x18(%r15,%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
leaq 0x1248(%rip), %rsi      # 0x41f4
movq %r15, %rdi
callq 0x21c0
movq 0x4025(%rip), %r15      # 0x6fe0
leaq -0x24(%rbp), %rsi
movq %r15, %rdi
callq 0x2130
movq (%r15), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r15,%rax)
jne 0x3122
cmpl $0x3e7, -0x24(%rbp)     # imm = 0x3E7
jle 0x3122
movq 0x3fda(%rip), %rdi      # 0x6fc8
callq 0x20e0
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2230
movl -0x24(%rbp), %eax
leaq -0x70(%rbp), %r12
movl %eax, 0x20(%r12)
leaq 0x28(%r14), %rdi
movq %r12, %rsi
callq 0x3620
movq %r12, %rdi
callq 0x20c0
movq 0x3fa1(%rip), %r12      # 0x6fc8
leaq 0x11e6(%rip), %rsi      # 0x4214
movq %r12, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq (%r12), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r12,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ecx       # imm = 0xFFFFFF4F
andl 0x18(%r12,%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r12,%rax)
leaq 0x117b(%rip), %rsi      # 0x41e7
movq %r12, %rdi
callq 0x21c0
movq 0x3f65(%rip), %rdi      # 0x6fe0
leaq -0x48(%rbp), %rsi
callq 0x2220
movq (%r12), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r12,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ecx       # imm = 0xFFFFFF4F
andl 0x18(%r12,%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r12,%rax)
leaq 0x1142(%rip), %rsi      # 0x41f4
movq %r12, %rdi
callq 0x21c0
movq 0x3f1f(%rip), %r12      # 0x6fe0
leaq -0x24(%rbp), %rsi
movq %r12, %rdi
callq 0x2130
movq (%r12), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r12,%rax)
jne 0x3122
cmpl $0x3e7, -0x24(%rbp)     # imm = 0x3E7
jle 0x3122
movq 0x3edb(%rip), %rdi      # 0x6fc8
callq 0x20e0
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2230
movl -0x24(%rbp), %eax
leaq -0x70(%rbp), %rbx
movl %eax, 0x20(%rbx)
addq $0x50, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3620
movq %rbx, %rdi
callq 0x20c0
jmp 0x3171
movq 0x3e9f(%rip), %rdi      # 0x6fc8
leaq 0x10cb(%rip), %rsi      # 0x41fb
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2280
movq 0x3e8b(%rip), %rdi      # 0x6fe0
pushq $0xa
popq %rdx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
callq 0x2140
leaq 0x1173(%rip), %rsi      # 0x42dc
movq %rbx, %rdi
callq 0x22d0
leaq -0x48(%rbp), %rdi
callq 0x20c0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x318b
jmp 0x318b
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22b0
nop