// File: /workspace/github_cpp_makefile_star2_O1/supervoltage[P]morsetran/source/main.cpp
// Function: main
int main(int argc, char** argv)
{
	if(argc <= 1)
	{	
		cout << "ERROR: No input present\n";
		return 0;
	}
	
	string helpChk = argv[1];
	
	if(helpChk == "--help" || helpChk == "-h")
	{
		cout << "Usage: " << argv[0] << " [TEXT]\n" << "       " <<
				argv[0] << " [MORSE]\n";
		cout << "Translate text into morse code or morse code into text.\n\n";
		cout << "  -h, --help\t\tdisplay this help\n\n";
		
		cout << "Examples:\n\t" << argv[0] << " example text\n";
		cout << "\t" << argv[0] <<
				" . -..- .- -- .--. .-.. .  / -- --- .-. ... .\n\n";
		cout << "Report bugs and suggestions to <ubervoltage@gmail.com>\n";
		return 0;
	}
	
	char prFind;			//determine if program should run in
	prFind = argv[1][0];	//morse-to-text mode or text-to-morse mode
	
	if(prFind == '.' || prFind == '/' || prFind == '-')
		morseToTextMode(argc, argv);
	else
		textToMorseMode(argc, argv);
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpl $0x1, %edi
jg 0x12eb
movq 0x3d03(%rip), %rdi      # 0x4fd8
leaq 0x1d28(%rip), %rsi      # 0x3004
movl $0x18, %edx
callq 0x10c0
jmp 0x1576
movq %rsi, %rbx
movl %edi, %r14d
movq 0x8(%rsi), %rsi
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x15aa
leaq 0x1d11(%rip), %rsi      # 0x301d
movq %r15, %rdi
callq 0x1040
testl %eax, %eax
je 0x134c
leaq 0x1d05(%rip), %rsi      # 0x3024
leaq -0x40(%rbp), %rdi
callq 0x1040
testl %eax, %eax
je 0x134c
movq 0x8(%rbx), %rax
movb (%rax), %al
addb $-0x2d, %al
cmpb $0x2, %al
ja 0x1552
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1684
jmp 0x155d
movq 0x3c85(%rip), %r14      # 0x4fd8
leaq 0x1ccd(%rip), %rsi      # 0x3027
movl $0x7, %edx
movq %r14, %rdi
callq 0x10c0
movq (%rbx), %r15
testq %r15, %r15
je 0x138b
movq %r15, %rdi
callq 0x1050
movq 0x3c5a(%rip), %rdi      # 0x4fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x10c0
jmp 0x13a3
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x10f0
movq 0x3c2e(%rip), %rdi      # 0x4fd8
leaq 0x1c7e(%rip), %rsi      # 0x302f
movl $0x8, %edx
callq 0x10c0
movq 0x3c16(%rip), %r14      # 0x4fd8
leaq 0x1c6f(%rip), %rsi      # 0x3038
movl $0x7, %edx
movq %r14, %rdi
callq 0x10c0
movq (%rbx), %r15
testq %r15, %r15
je 0x13fa
movq %r15, %rdi
callq 0x1050
movq 0x3beb(%rip), %rdi      # 0x4fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x10c0
jmp 0x1412
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x10f0
movq 0x3bbf(%rip), %rdi      # 0x4fd8
leaq 0x1c20(%rip), %rsi      # 0x3040
movl $0x9, %edx
callq 0x10c0
movq 0x3ba7(%rip), %rdi      # 0x4fd8
leaq 0x1c12(%rip), %rsi      # 0x304a
movl $0x39, %edx
callq 0x10c0
movq 0x3b8f(%rip), %rdi      # 0x4fd8
leaq 0x1c34(%rip), %rsi      # 0x3084
movl $0x21, %edx
callq 0x10c0
movq 0x3b77(%rip), %r14      # 0x4fd8
leaq 0x1c3e(%rip), %rsi      # 0x30a6
movl $0xb, %edx
movq %r14, %rdi
callq 0x10c0
movq (%rbx), %r15
testq %r15, %r15
je 0x1499
movq %r15, %rdi
callq 0x1050
movq 0x3b4c(%rip), %rdi      # 0x4fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x10c0
jmp 0x14b1
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x10f0
movq 0x3b20(%rip), %rdi      # 0x4fd8
leaq 0x1bf3(%rip), %rsi      # 0x30b2
movl $0xe, %edx
callq 0x10c0
movq 0x3b08(%rip), %r14      # 0x4fd8
leaq 0x1bd9(%rip), %rsi      # 0x30b0
movl $0x1, %edx
movq %r14, %rdi
callq 0x10c0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1508
movq %rbx, %rdi
callq 0x1050
movq 0x3add(%rip), %rdi      # 0x4fd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x10c0
jmp 0x1520
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x10f0
movq 0x3ab1(%rip), %rdi      # 0x4fd8
leaq 0x1b93(%rip), %rsi      # 0x30c1
movl $0x2f, %edx
callq 0x10c0
movq 0x3a99(%rip), %rdi      # 0x4fd8
leaq 0x1bab(%rip), %rsi      # 0x30f1
movl $0x37, %edx
callq 0x10c0
jmp 0x155d
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1e98
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1576
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10b0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1585
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15a1
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1100
nop