// File: /workspace/github_cpp_makefile_star2_O2/XuhuiSun95[P]Ticket-Booking-Service/client/UserInterface.cpp
// Function: UserInterface::Init()
void UserInterface::Init() {

    std::cout << "Initializing Kiosk..." << std::endl;
    std::cout << "Number of server(s) trying to connect: ";
    std::cin >> mServers;
    if(!std::cin.good() || mServers<1) {

        std::cout << "Please enter valid server(s)!" << std::endl;
        std::cin.clear();
        std::cin.ignore(INT_MAX, '\n');
        return;
    }

    for(int i=0; i<mServers; i++) {

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

        std::cout << "Enter Server " << i + 1 << " 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');
            mServers = -1;
            return;
        }
        std::cout << std::endl;
        mServerList.push_back(std::make_pair(address, port));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq 0x37e3(%rip), %r15      # 0x5fd0
leaq 0x18f0(%rip), %rsi      # 0x40e4
movq %r15, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x18ef(%rip), %rsi      # 0x40fa
movq %r15, %rdi
callq 0x2180
leaq 0x4(%r14), %rsi
movq 0x37c2(%rip), %rbx      # 0x5fe0
movq %rbx, %rdi
movq %rsi, -0x38(%rbp)
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x2a09
cmpl $0x0, 0x4(%r14)
jle 0x2a09
addq $0x8, %r14
movq %r14, -0x40(%rbp)
pushq $0x1
popq %r13
leaq -0x88(%rbp), %rbx
leaq -0x68(%rbp), %rdx
leal -0x1(%r13), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x29fa
movq %rbx, %rdi
leaq 0x18e8(%rip), %rsi      # 0x4160
callq 0x2090
orl $-0x1, -0x2c(%rbp)
movq %r15, %rdi
leaq 0x18b5(%rip), %rsi      # 0x4140
callq 0x2180
movq %rax, %rdi
movl %r13d, %esi
callq 0x2220
movq %rax, %rdi
leaq 0x18a9(%rip), %rsi      # 0x414e
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %r15, %rdi
leaq 0x1870(%rip), %rsi      # 0x4154
callq 0x2180
movq 0x36f0(%rip), %rdi      # 0x5fe0
movq %rbx, %rsi
callq 0x21a0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %r15, %rdi
leaq 0x1837(%rip), %rsi      # 0x4161
callq 0x2180
movq 0x36aa(%rip), %rdi      # 0x5fe0
leaq -0x2c(%rbp), %rsi
callq 0x2100
movq 0x369a(%rip), %rcx      # 0x5fe0
movq (%rcx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rcx,%rax)
sete %al
cmpl $0x3e8, -0x2c(%rbp)     # imm = 0x3E8
setge %r12b
andb %al, %r12b
je 0x2998
movq %r15, %rdi
callq 0x20c0
movq %rbx, %rsi
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x21c0
movl -0x2c(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x2e52
movq %r14, %rdi
callq 0x20b0
jmp 0x29e2
movq %r15, %rdi
leaq 0x17c6(%rip), %rsi      # 0x4168
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movq 0x362a(%rip), %rcx      # 0x5fe0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %esi, %esi
callq 0x2210
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq 0x360d(%rip), %rdi      # 0x5fe0
pushq $0xa
popq %rdx
callq 0x2110
movq -0x38(%rbp), %rax
orl $-0x1, (%rax)
movq %rbx, %rdi
callq 0x20b0
incl %r13d
testb %r12b, %r12b
leaq -0x68(%rbp), %rdx
jne 0x285e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x35c0(%rip), %rdi      # 0x5fd0
leaq 0x170b(%rip), %rsi      # 0x4122
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movq 0x35b5(%rip), %rbx      # 0x5fe0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x2210
pushq $0xa
popq %rdx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0x2a6d
jmp 0x2a6a
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2230
nop