// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq 0x365d(%rip), %rbx      # 0x5fd0
leaq 0x176a(%rip), %rsi      # 0x40e4
movl $0x15, %edx
movq %rbx, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq 0x1745(%rip), %rsi      # 0x40fa
movl $0x27, %edx
movq %rbx, %rdi
callq 0x21b0
leaq 0x4(%r15), %r12
movq 0x3613(%rip), %r14      # 0x5fe0
movq %r14, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r14,%rax)
jne 0x2c69
cmpl $0x0, 0x4(%r15)
jle 0x2c69
addq $0x8, %r15
movq %r15, -0x58(%rbp)
movl $0x1, %r13d
leal -0x1(%r13), %eax
cmpl (%r12), %eax
jge 0x2c5a
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x173b(%rip), %rdx      # 0x4160
movq %rdx, %rsi
callq 0x3428
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0xd, %edx
movq %rbx, %rdi
leaq 0x16fd(%rip), %rsi      # 0x4140
callq 0x21b0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x2220
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x16e9(%rip), %rsi      # 0x414e
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x168e(%rip), %rsi      # 0x4154
callq 0x21b0
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x1655(%rip), %rsi      # 0x4161
callq 0x21b0
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r14,%rax)
sete %al
cmpl $0x3e8, -0x2c(%rbp)     # imm = 0x3E8
setge %r15b
andb %al, %r15b
je 0x2bd6
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %r13, -0x60(%rbp)
movl %r15d, %r13d
movq %rbx, %r15
movq %r14, %rbx
movq %r12, %r14
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r12
movq %r12, %rdi
callq 0x338e
movl -0x2c(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x58(%rbp), %rdi
movq %r12, %rsi
callq 0x34c2
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
movq %r14, %r12
je 0x2bc7
callq 0x2180
movq %rbx, %r14
movq %r15, %rbx
movl %r13d, %r15d
movq -0x60(%rbp), %r13
jmp 0x2c3c
movl $0x18, %edx
movq %rbx, %rdi
leaq 0x1583(%rip), %rsi      # 0x4168
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x2210
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %r14, %rdi
movl $0xa, %edx
callq 0x20f0
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2c4e
callq 0x2180
incl %r13d
testb %r15b, %r15b
jne 0x2a04
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14b2(%rip), %rsi      # 0x4122
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x2210
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %r14, %rdi
movl $0xa, %edx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2cf4
callq 0x2180
jmp 0x2cf4
jmp 0x2cf1
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2d06
callq 0x2180
movq %rbx, %rdi
callq 0x2240