// File: /workspace/github_cpp_makefile_star2_O3/magmastonealex[P]fbkeyboard/src/fbkeyboard.cpp
// Function: main
int main(int argc, char** argv) {

	opterr = 0;
	int c;
	
	int width = 0;
	int height = 0;
	int dpi = 0;
	char* tsdev = "";
	char* fbdev = "";
	char* prompt = "";
	bool password = false;

	while ((c = getopt (argc, argv, "w:h:d:t:f:pP:")) != -1)
	switch (c)
	{
		case 'p':
			password = true;
			break;
		case 'P':
			prompt = optarg;
			break;
		case 'f':
			fbdev = optarg;
			break;
		case 't':
			tsdev = optarg;
			break;
		case 'd':
			dpi = std::stoi(std::string(optarg));
			break;
		case 'h':
			height = std::stoi(std::string(optarg));
			break;
		case 'w':
			width = std::stoi(std::string(optarg));
			break;
		case '?':
			std::cerr << "Unknown Arguments" << std::endl;
			return 1;
		default:
			return 3;
	}

	if(width == 0 || height == 0 || dpi == 0 || strlen(tsdev) == 0 || strlen(fbdev) == 0) {
		std::cerr << "Invalid Arguments" << std::endl;
		return 4;
	}

	std::cout << width << height << dpi << tsdev << fbdev << std::endl;

	return run(width, height, dpi, std::string(fbdev), std::string(tsdev), std::string(prompt), password);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movl %edi, %ebp
movq 0x2e73(%rip), %rax      # 0x5fd0
movl $0x0, (%rax)
leaq 0xf2a(%rip), %rax       # 0x4094
xorl %r13d, %r13d
leaq 0xff5(%rip), %r12       # 0x4169
movq 0x2e35(%rip), %r14      # 0x5fb0
movq $0x0, 0x58(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq %rax, 0x60(%rsp)
xorl %ebx, %ebx
movl %ebx, %ecx
movl %ecx, %ebx
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2070
movb $0x1, %cl
cmpl $0x70, %eax
je 0x31a0
cmpl $0x65, %eax
jg 0x3283
cmpl $0x4f, %eax
jle 0x33f4
cmpl $0x50, %eax
je 0x33cd
cmpl $0x64, %eax
jne 0x35fd
movq %r13, %r12
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3d0c
movq 0x20(%rsp), %r13
callq 0x2050
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0x18(%rsp)
movl $0x0, (%r14)
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
movl $0xa, %edx
callq 0x2210
cmpq %r13, 0x40(%rsp)
je 0x369b
movslq %eax, %rdx
cmpq %rax, %rdx
jne 0x368f
movq %rax, %rcx
movl (%r14), %eax
cmpl $0x22, %eax
je 0x368f
testl %eax, %eax
movq %r12, %r13
jne 0x324f
movl 0x18(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
movq %rcx, 0x18(%rsp)
leaq 0xf01(%rip), %r12       # 0x4169
je 0x3277
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x2d32(%rip), %r14      # 0x5fb0
jmp 0x319e
cmpl $0x73, %eax
jg 0x3334
cmpl $0x66, %eax
je 0x33da
cmpl $0x68, %eax
jne 0x35fd
movq %r13, %r12
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3d0c
movq 0x20(%rsp), %r13
callq 0x2050
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movl $0x0, (%r14)
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
movl $0xa, %edx
callq 0x2210
cmpq %r13, 0x40(%rsp)
je 0x3683
movslq %eax, %rcx
movq %rax, 0x58(%rsp)
cmpq %rax, %rcx
jne 0x3677
movl (%r14), %eax
cmpl $0x22, %eax
je 0x3677
movq %r12, %r13
testl %eax, %eax
leaq 0xe56(%rip), %r12       # 0x4169
jne 0x331c
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
jne 0x326a
jmp 0x3277
cmpl $0x74, %eax
je 0x33e7
cmpl $0x77, %eax
jne 0x35fd
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3d0c
movq 0x20(%rsp), %r13
callq 0x2050
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movl $0x0, (%r14)
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
movl $0xa, %edx
callq 0x2210
cmpq %r13, 0x40(%rsp)
je 0x366b
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x365f
movq %rax, %r13
movl (%r14), %eax
cmpl $0x22, %eax
je 0x365f
testl %eax, %eax
jne 0x33b5
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
jne 0x326a
jmp 0x3277
movq (%r14), %rax
movq %rax, 0x60(%rsp)
jmp 0x319e
movq (%r14), %rax
movq %rax, 0x48(%rsp)
jmp 0x319e
movq (%r14), %rax
movq %rax, 0x50(%rsp)
jmp 0x319e
cmpl $-0x1, %eax
je 0x344e
cmpl $0x3f, %eax
jne 0x35fd
movq 0x2be7(%rip), %rbx      # 0x5ff0
leaq 0xd67(%rip), %rsi       # 0x4177
movl $0x11, %edx
movq %rbx, %rdi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x1, %ebx
jmp 0x364b
testl %r13d, %r13d
movq 0x58(%rsp), %r14
je 0x3604
testl %r14d, %r14d
je 0x3604
cmpl $0x0, 0x18(%rsp)
je 0x3604
movq 0x50(%rsp), %rax
cmpb $0x0, (%rax)
je 0x3604
movq 0x48(%rsp), %rax
cmpb $0x0, (%rax)
je 0x3604
movq 0x2b35(%rip), %rdi      # 0x5fc8
movl %r13d, %esi
callq 0x2270
movq %rax, %rdi
movl %r14d, %esi
callq 0x2270
movq %rax, %rdi
movq 0x18(%rsp), %rsi
movq %rsi, %rbp
callq 0x2270
movq %rax, %r14
movq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x20d0
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21c0
movq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x20d0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x21c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq %r15, %rdi
callq 0x20d0
leaq (%rax,%r15), %rdx
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x3de0
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r12, %rdi
callq 0x20d0
leaq (%rax,%r12), %rdx
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x3de0
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rsi
callq 0x3d0c
movzbl %bl, %eax
andl $0x1, %eax
movl %eax, (%rsp)
leaq 0x88(%rsp), %rcx
leaq 0x68(%rsp), %r8
leaq 0xa8(%rsp), %r9
movl %r13d, %edi
movq 0x58(%rsp), %rsi
movl %ebp, %edx
callq 0x3751
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35c5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x35dc
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
xorl %ebx, %ebx
cmpq %r14, %rdi
je 0x364b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x364b
movl $0x3, %ebx
jmp 0x364b
movq 0x29e5(%rip), %rbx      # 0x5ff0
leaq 0xb77(%rip), %rsi       # 0x4189
movl $0x11, %edx
movq %rbx, %rdi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x4, %ebx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb7d(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xb71(%rip), %rdi       # 0x41e3
callq 0x2100
leaq 0xb65(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xb59(%rip), %rdi       # 0x41e3
callq 0x2100
leaq 0xb4d(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xb41(%rip), %rdi       # 0x41e3
callq 0x2100
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36d0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x36d0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x36ec
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x36ec
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x3749
movq 0x98(%rsp), %rsi
jmp 0x3741
jmp 0x3707
jmp 0x3707
movq %rax, %rbx
jmp 0x3749
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x372d
movl 0x18(%rsp), %eax
jmp 0x372a
jmp 0x371d
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x372d
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3749
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280