// File: /workspace/github_cpp_makefile_star2_O1/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 0x2dbb(%rip), %rax      # 0x5fd0
movl $0x0, (%rax)
leaq 0xe72(%rip), %rax       # 0x4094
xorl %r13d, %r13d
leaq 0xf3d(%rip), %r12       # 0x4169
movq 0x2d7d(%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 0x3258
cmpl $0x65, %eax
jg 0x333b
cmpl $0x4f, %eax
jle 0x34ac
cmpl $0x50, %eax
je 0x3485
cmpl $0x64, %eax
jne 0x36b5
movq %r13, %r12
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3dc4
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 0x3753
movslq %eax, %rdx
cmpq %rax, %rdx
jne 0x3747
movq %rax, %rcx
movl (%r14), %eax
cmpl $0x22, %eax
je 0x3747
testl %eax, %eax
movq %r12, %r13
jne 0x3307
movl 0x18(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
movq %rcx, 0x18(%rsp)
leaq 0xe49(%rip), %r12       # 0x4169
je 0x332f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x2c7a(%rip), %r14      # 0x5fb0
jmp 0x3256
cmpl $0x73, %eax
jg 0x33ec
cmpl $0x66, %eax
je 0x3492
cmpl $0x68, %eax
jne 0x36b5
movq %r13, %r12
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3dc4
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 0x373b
movslq %eax, %rcx
movq %rax, 0x58(%rsp)
cmpq %rax, %rcx
jne 0x372f
movl (%r14), %eax
cmpl $0x22, %eax
je 0x372f
movq %r12, %r13
testl %eax, %eax
leaq 0xd9e(%rip), %r12       # 0x4169
jne 0x33d4
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
jne 0x3322
jmp 0x332f
cmpl $0x74, %eax
je 0x349f
cmpl $0x77, %eax
jne 0x36b5
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x13(%rsp), %rdx
callq 0x3dc4
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 0x3723
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3717
movq %rax, %r13
movl (%r14), %eax
cmpl $0x22, %eax
je 0x3717
testl %eax, %eax
jne 0x346d
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
jne 0x3322
jmp 0x332f
movq (%r14), %rax
movq %rax, 0x60(%rsp)
jmp 0x3256
movq (%r14), %rax
movq %rax, 0x48(%rsp)
jmp 0x3256
movq (%r14), %rax
movq %rax, 0x50(%rsp)
jmp 0x3256
cmpl $-0x1, %eax
je 0x3506
cmpl $0x3f, %eax
jne 0x36b5
movq 0x2b2f(%rip), %rbx      # 0x5ff0
leaq 0xcaf(%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 0x3703
testl %r13d, %r13d
movq 0x58(%rsp), %r14
je 0x36bc
testl %r14d, %r14d
je 0x36bc
cmpl $0x0, 0x18(%rsp)
je 0x36bc
movq 0x50(%rsp), %rax
cmpb $0x0, (%rax)
je 0x36bc
movq 0x48(%rsp), %rax
cmpb $0x0, (%rax)
je 0x36bc
movq 0x2a7d(%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 0x3e92
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 0x3e92
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rsi
callq 0x3dc4
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 0x3809
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x367d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3694
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
xorl %ebx, %ebx
cmpq %r14, %rdi
je 0x3703
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3703
movl $0x3, %ebx
jmp 0x3703
movq 0x292d(%rip), %rbx      # 0x5ff0
leaq 0xabf(%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 0xac5(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xab9(%rip), %rdi       # 0x41e3
callq 0x2100
leaq 0xaad(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xaa1(%rip), %rdi       # 0x41e3
callq 0x2100
leaq 0xa95(%rip), %rdi       # 0x41e3
callq 0x2220
leaq 0xa89(%rip), %rdi       # 0x41e3
callq 0x2100
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3788
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3788
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x37a4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x37a4
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x3801
movq 0x98(%rsp), %rsi
jmp 0x37f9
jmp 0x37bf
jmp 0x37bf
movq %rax, %rbx
jmp 0x3801
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x37e5
movl 0x18(%rsp), %eax
jmp 0x37e2
jmp 0x37d5
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x37e5
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3801
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280