// File: /workspace/github_cpp_makefile_star2_O3/dnegovan[P]Intruder-On-Donnar-V/dansLibrary.cpp
// Function: getInteger()
int getInteger()
{
    int input;
	std::string stringNumber;

    while(true)
	{
        std::getline(std::cin, stringNumber); //get string input
		std::stringstream convert(stringNumber); //turns the string into stream

		if(convert >> input) //Try to convert to a number
		{
			std::string leftovers;
			std::getline(convert,leftovers); //Reads the rest from the input

			if(leftovers == "") //If leftovers is empty, we have a correct number
			{
                //std::cin.ignore(std::numeric_limits<std::streamsize>::max());
				return input;
			}
            else
            {
				std::cout << "Please enter a valid integer." << std::endl;
			}
		}
        else
        {
			std::cout << "Please enter a valid integer." << std::endl;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xc8bb(%rip), %r14      # 0x1bfd8
leaq -0x70(%rbp), %r12
leaq -0x1f8(%rbp), %r13
movq 0xc899(%rip), %rbx      # 0x1bfc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3350
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x32b0
movq %r13, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0xf7be
movl $0x1d, %edx
movq %rbx, %rdi
leaq 0x6d61(%rip), %rsi      # 0x164eb
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movb $0x1, %r15b
movq %rax, %rdi
callq 0x3140
jmp 0xf866
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq -0x1f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3350
leaq -0x50(%rbp), %rdi
leaq 0x7141(%rip), %rsi      # 0x16945
callq 0x3070
testl %eax, %eax
setne %r15b
je 0xf84e
movl $0x1d, %edx
movq %rbx, %rdi
leaq 0x6ccb(%rip), %rsi      # 0x164eb
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
jmp 0xf854
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf866
callq 0x31c0
movq %r13, %rdi
movq 0xc730(%rip), %rsi      # 0x1bfa0
callq 0x3170
leaq -0x178(%rbp), %rdi
callq 0x3090
testb %r15b, %r15b
jne 0xf72f
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf89c
callq 0x31c0
movl -0x2c(%rbp), %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf8ca
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf8d6
callq 0x31c0
jmp 0xf8d6
movq %rax, %rbx
leaq -0x60(%rbp), %r14
jmp 0xf8f9
movq %rax, %rbx
leaq -0x60(%rbp), %r14
movq 0xc6bf(%rip), %rsi      # 0x1bfa0
leaq -0x1f8(%rbp), %rdi
callq 0x3170
leaq -0x178(%rbp), %rdi
callq 0x3090
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0xf907
callq 0x31c0
movq %rbx, %rdi
callq 0x3320