// File: 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
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq 0x61cf(%rip), %rdi      # 0x8fd0
leaq 0x32d0(%rip), %rsi      # 0x60d8
callq 0x21d0
movq %rax, %rdi
movq 0x6199(%rip), %rsi      # 0x8fb0
callq 0x21f0
movq 0x61ad(%rip), %rdi      # 0x8fd0
leaq 0x32c4(%rip), %rsi      # 0x60ee
callq 0x21d0
movq -0x88(%rbp), %rsi
addq $0x4, %rsi
movq 0x619f(%rip), %rdi      # 0x8fe0
callq 0x2140
movq 0x6193(%rip), %rax      # 0x8fe0
movq (%rax), %rax
movq 0x6189(%rip), %rdi      # 0x8fe0
addq -0x18(%rax), %rdi
callq 0x22c0
testb $0x1, %al
jne 0x2e66
jmp 0x2e73
movq -0x88(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jge 0x2ecc
movq 0x6156(%rip), %rdi      # 0x8fd0
leaq 0x3295(%rip), %rsi      # 0x6116
callq 0x21d0
movq %rax, %rdi
movq 0x6120(%rip), %rsi      # 0x8fb0
callq 0x21f0
movq 0x6144(%rip), %rax      # 0x8fe0
movq (%rax), %rax
movq 0x613a(%rip), %rdi      # 0x8fe0
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x22b0
movq 0x6128(%rip), %rdi      # 0x8fe0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0xa, %edx
callq 0x2160
jmp 0x31f1
movl $0x0, -0xc(%rbp)
movq -0x88(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x31f1
leaq -0x31(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x22f0
movq -0x90(%rbp), %rdx
leaq 0x3250(%rip), %rsi      # 0x6154
leaq -0x30(%rbp), %rdi
callq 0x2240
jmp 0x2f0f
leaq -0x31(%rbp), %rdi
callq 0x2200
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movq 0x60aa(%rip), %rdi      # 0x8fd0
leaq 0x3207(%rip), %rsi      # 0x6134
callq 0x21d0
movq %rax, -0x98(%rbp)
jmp 0x2f3b
movq -0x98(%rbp), %rdi
movl -0xc(%rbp), %esi
incl %esi
callq 0x22d0
movq %rax, -0xa0(%rbp)
jmp 0x2f55
movq -0xa0(%rbp), %rdi
leaq 0x31df(%rip), %rsi      # 0x6142
callq 0x21d0
movq %rax, -0xa8(%rbp)
jmp 0x2f71
movq -0xa8(%rbp), %rdi
movq 0x6031(%rip), %rsi      # 0x8fb0
callq 0x21f0
jmp 0x2f86
movl $0x14, %edi
callq 0x3740
movl %eax, -0xac(%rbp)
jmp 0x2f98
movl -0xac(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %esi
movq 0x6025(%rip), %rdi      # 0x8fd0
callq 0x2210
movq %rax, -0xb8(%rbp)
jmp 0x2fb9
movq -0xb8(%rbp), %rdi
leaq 0x829(%rip), %rsi       # 0x37f0
callq 0x2090
movq %rax, -0xc0(%rbp)
jmp 0x2fd5
movq -0xc0(%rbp), %rdi
leaq 0x3165(%rip), %rsi      # 0x6148
callq 0x21d0
jmp 0x2fea
movq 0x5fef(%rip), %rdi      # 0x8fe0
leaq -0x30(%rbp), %rsi
callq 0x2220
jmp 0x2ffc
movl $0x14, %edi
callq 0x3740
movl %eax, -0xc4(%rbp)
jmp 0x300e
movl -0xc4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %esi
movq 0x5faf(%rip), %rdi      # 0x8fd0
callq 0x2210
movq %rax, -0xd0(%rbp)
jmp 0x302f
movq -0xd0(%rbp), %rdi
leaq 0x7b3(%rip), %rsi       # 0x37f0
callq 0x2090
movq %rax, -0xd8(%rbp)
jmp 0x304b
movq -0xd8(%rbp), %rdi
leaq 0x30fc(%rip), %rsi      # 0x6155
callq 0x21d0
jmp 0x3060
movq 0x5f79(%rip), %rdi      # 0x8fe0
leaq -0x48(%rbp), %rsi
callq 0x2140
jmp 0x3072
movq 0x5f67(%rip), %rdi      # 0x8fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22c0
movb %al, -0xd9(%rbp)
jmp 0x3090
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x309c
jmp 0x30a9
cmpl $0x3e8, -0x48(%rbp)     # imm = 0x3E8
jge 0x3151
movq 0x5f20(%rip), %rdi      # 0x8fd0
leaq 0x30a5(%rip), %rsi      # 0x615c
callq 0x21d0
movq %rax, -0xe8(%rbp)
jmp 0x30c5
movq -0xe8(%rbp), %rdi
movq 0x5edd(%rip), %rsi      # 0x8fb0
callq 0x21f0
jmp 0x30da
movq 0x5eff(%rip), %rdi      # 0x8fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x22b0
jmp 0x30f4
movq 0x5ee5(%rip), %rdi      # 0x8fe0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0xa, %edx
callq 0x2160
jmp 0x310c
movq -0x88(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl $0x1, -0x54(%rbp)
jmp 0x31ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x2200
jmp 0x31fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x31e6
movq 0x5e78(%rip), %rdi      # 0x8fd0
movq 0x5e51(%rip), %rsi      # 0x8fb0
callq 0x21f0
jmp 0x3166
movq -0x88(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xf0(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x3850
jmp 0x318b
movq -0xf0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3820
jmp 0x319d
leaq -0x80(%rbp), %rdi
callq 0x3890
movl $0x0, -0x54(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2150
movl -0x54(%rbp), %eax
testl %eax, %eax
je 0x31c1
jmp 0x31bf
jmp 0x31f1
jmp 0x31c3
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2ed3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3890
leaq -0x30(%rbp), %rdi
callq 0x2150
jmp 0x31fa
addq $0xf0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)