// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rsi, %r12
movl %edi, %r13d
movq 0x30d6(%rip), %rax      # 0x5fd0
andl $0x0, (%rax)
leaq 0x1190(%rip), %r15      # 0x4094
movq $0x0, 0x30(%rsp)
leaq 0x1255(%rip), %rbx      # 0x4169
movl $0x0, 0x18(%rsp)
movl $0x0, 0x1c(%rsp)
movq %r15, 0x20(%rsp)
movq %r15, 0x28(%rsp)
xorl %ebp, %ebp
movl %ebp, %ecx
movl %ecx, %ebp
movl %r13d, %edi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2060
movb $0x1, %cl
cmpl $0x70, %eax
je 0x2f32
cmpl $-0x1, %eax
je 0x3071
cmpl $0x3f, %eax
je 0x3048
cmpl $0x77, %eax
je 0x300d
cmpl $0x64, %eax
je 0x2fde
cmpl $0x66, %eax
je 0x2f92
cmpl $0x68, %eax
je 0x2faf
cmpl $0x74, %eax
je 0x2fa3
cmpl $0x50, %eax
jne 0x306a
movq 0x3028(%rip), %rax      # 0x5fb0
movq (%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x2f30
movq 0x3017(%rip), %rax      # 0x5fb0
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x2f30
movq 0x3006(%rip), %rax      # 0x5fb0
movq (%rax), %r15
jmp 0x2f30
movq 0x2ffa(%rip), %rax      # 0x5fb0
movq (%rax), %rsi
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x16(%rsp), %rdx
callq 0x359a
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x357e
movl %eax, 0x18(%rsp)
jmp 0x303b
movq 0x2fcb(%rip), %rax      # 0x5fb0
movq (%rax), %rsi
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x16(%rsp), %rdx
callq 0x359a
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x357e
movl %eax, 0x1c(%rsp)
jmp 0x303b
movq 0x2f9c(%rip), %rax      # 0x5fb0
movq (%rax), %rsi
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x16(%rsp), %rdx
callq 0x359a
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x357e
movq %rax, 0x30(%rsp)
movq %r14, %rdi
callq 0x20b0
jmp 0x2f30
movq 0x2fa1(%rip), %rdi      # 0x5ff0
leaq 0x1121(%rip), %rsi      # 0x4177
callq 0x2160
movq %rax, %rdi
callq 0x20c0
pushq $0x1
jmp 0x31a0
pushq $0x3
jmp 0x31a0
movq 0x30(%rsp), %rbx
testl %ebx, %ebx
sete %al
movl 0x18(%rsp), %r14d
testl %r14d, %r14d
sete %cl
orb %al, %cl
movl 0x1c(%rsp), %r12d
testl %r12d, %r12d
sete %al
orb %cl, %al
jne 0x3183
cmpb $0x0, (%r15)
je 0x3183
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax)
je 0x3183
movq 0x2f06(%rip), %rdi      # 0x5fc0
movl %ebx, %esi
callq 0x2250
movq %rax, %rdi
movl %r14d, %esi
callq 0x2250
movq %rax, %rdi
movl %r12d, %esi
callq 0x2250
movq %rax, %rdi
movq %r15, %rsi
callq 0x2160
movq %rax, %rdi
movq 0x20(%rsp), %r13
movq %r13, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20c0
leaq 0x98(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r13, %rsi
callq 0x359a
leaq 0x78(%rsp), %rdi
leaq 0x16(%rsp), %rdx
movq %r15, %rsi
callq 0x359a
leaq 0x58(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq 0x28(%rsp), %rsi
callq 0x359a
movzbl %bpl, %eax
andl $0x1, %eax
movl %eax, (%rsp)
leaq 0x98(%rsp), %rcx
leaq 0x78(%rsp), %r8
leaq 0x58(%rsp), %r9
movl %ebx, %edi
movl %r14d, %esi
movl %r12d, %edx
callq 0x3202
leaq 0x58(%rsp), %rdi
callq 0x20b0
leaq 0x78(%rsp), %rdi
callq 0x20b0
leaq 0x98(%rsp), %rdi
callq 0x20b0
xorl %eax, %eax
jmp 0x31a1
movq 0x2e66(%rip), %rdi      # 0x5ff0
leaq 0xff8(%rip), %rsi       # 0x4189
callq 0x2160
movq %rax, %rdi
callq 0x20c0
pushq $0x4
popq %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x20b0
jmp 0x31c5
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x20b0
jmp 0x31d4
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x31f0
jmp 0x31f7
jmp 0x31e8
jmp 0x31f7
jmp 0x31e8
jmp 0x31f7
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x20b0
jmp 0x31fa
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2260