// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/pd2img/pd2img.cpp
// Function: main
static int 
ParseArgs(int argc, char **argv)
{
  // Parse arguments
  argc--; argv++;
  while (argc > 0) {
    if ((*argv)[0] == '-') {
      if (!strcmp(*argv, "-v")) print_verbose = 1;
      else if (!strcmp(*argv, "-debug")) print_debug = 1;
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
    else {
      if (!input_pixel_database) input_pixel_database = *argv;
      else if (!output_image_directory) output_image_directory = *argv;
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
  }

  // Check filenames
  if (!input_pixel_database || !output_image_directory) {
    RNFail("Usage: pd2img inputpixeldatabase outputimagedirectory\n");
    return 0;
  }

  // Return OK status 
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x968, %rsp            # imm = 0x968
cmpl $0x2, %edi
jl 0x6087
movq %rsi, %rbx
movl %edi, %ebp
movq 0x6f4ae(%rip), %r15     # 0x754b0
movq 0x6f49f(%rip), %r13     # 0x754a8
incl %ebp
addq $0x8, %rbx
leaq 0x4dfee(%rip), %r14     # 0x54004
movq (%rbx), %r12
cmpb $0x2d, (%r12)
jne 0x604f
movq %r12, %rdi
movq %r14, %rsi
callq 0x54a0
testl %eax, %eax
je 0x6069
movq %r12, %rdi
leaq 0x4dfce(%rip), %rsi     # 0x54007
callq 0x54a0
testl %eax, %eax
jne 0x6326
movb $0x1, 0x6f46f(%rip)     # 0x754bc
jmp 0x607c
testq %r13, %r13
je 0x6072
testq %r15, %r15
jne 0x6326
movq %r12, 0x6f44c(%rip)     # 0x754b0
movq %r12, %r15
jmp 0x607c
movb $0x1, 0x6f448(%rip)     # 0x754b8
jmp 0x607c
movq %r12, 0x6f42f(%rip)     # 0x754a8
movq %r12, %r13
decl %ebp
addq $0x8, %rbx
cmpl $0x2, %ebp
jg 0x6016
cmpq $0x0, 0x6f419(%rip)     # 0x754a8
je 0x6341
cmpq $0x0, 0x6f413(%rip)     # 0x754b0
je 0x6341
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x10e78
movq 0x6f3f1(%rip), %rsi     # 0x754a8
leaq 0x51225(%rip), %rdx     # 0x572e3
movq %rbx, %rdi
callq 0x11880
testl %eax, %eax
je 0x634f
movq 0x6f3db(%rip), %rax     # 0x754b0
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x2189c
movq $0x0, (%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x5570
cmpb $0x1, 0x6f3b9(%rip)     # 0x754b8
jne 0x6123
leaq 0x4df5a(%rip), %rdi     # 0x54062
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x5060
movq 0x6ee85(%rip), %rax     # 0x74fa0
movq (%rax), %rdi
callq 0x53a0
cmpl $0x0, 0x54(%rsp)
jle 0x62b8
xorl %r15d, %r15d
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq 0x20(%rsp), %rax
movq 0x68(%rsp), %rcx
movq (%rcx,%r15), %rbx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq *0x20(%rax)
movl %eax, %r14d
testl %eax, %eax
js 0x6233
cmpb $0x1, 0x6f355(%rip)     # 0x754bc
jne 0x617a
leaq 0x4df28(%rip), %rdi     # 0x54098
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5060
leaq 0x150(%rsp), %r12
movq %r12, %rdi
leaq 0x4df12(%rip), %rsi     # 0x5409e
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x50b0
leaq 0x550(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4def7(%rip), %rsi     # 0x540a4
movq %r12, %rdx
xorl %eax, %eax
callq 0x50b0
movq %rbp, %rdi
movl $0x2f, %esi
callq 0x5370
testq %rax, %rax
je 0x61cc
movb $0x0, (%rax)
leaq 0x550(%rsp), %rdi
callq 0x52b0
leaq 0x80(%rsp), %r12
cmpl $0x1, %r14d
je 0x6246
testl %r14d, %r14d
jne 0x628f
movq %r12, %rdi
callq 0x181a4
movq 0x20(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *0x10(%rax)
testl %eax, %eax
je 0x6229
movq %r12, %rdi
leaq 0x150(%rsp), %rsi
callq 0x1a300
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
movq %r12, %rdi
callq 0x1872e
jmp 0x62a3
leaq 0x4de42(%rip), %rdi     # 0x5407c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x248f2
jmp 0x62a3
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6394
movq 0x20(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq *0x18(%rax)
testl %eax, %eax
je 0x6285
movq %r12, %rdi
leaq 0x150(%rsp), %rsi
callq 0xf6ba
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
movq %r12, %rdi
callq 0x6fb4
jmp 0x62a3
leaq 0x4de1a(%rip), %rdi     # 0x540b0
movl %r14d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x248f2
incq %r13
movslq 0x54(%rsp), %rax
addq $0x20, %r15
cmpq %rax, %r13
jl 0x613c
cmpb $0x0, 0x6f1f9(%rip)     # 0x754b8
je 0x62fa
leaq 0x10(%rsp), %rdi
callq 0x218fe
leaq 0x4ddfd(%rip), %rdi     # 0x540cf
movb $0x1, %al
callq 0x5060
leaq 0x4ddfe(%rip), %rdi     # 0x540de
movq (%rsp), %rsi
xorl %eax, %eax
callq 0x5060
movq 0x6ecae(%rip), %rax     # 0x74fa0
movq (%rax), %rdi
callq 0x53a0
leaq 0x20(%rsp), %rdi
callq 0x1199e
testl %eax, %eax
je 0x634f
leaq 0x20(%rsp), %rdi
callq 0x10f7a
xorl %eax, %eax
addq $0x968, %rsp            # imm = 0x968
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4dce1(%rip), %rdi     # 0x5400e
movq %r12, %rsi
xorl %eax, %eax
callq 0x248f2
movl $0x1, %edi
callq 0x53d0
leaq 0x4dce3(%rip), %rdi     # 0x5402b
xorl %eax, %eax
callq 0x248f2
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x53d0
jmp 0x637f
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x6fb4
jmp 0x6382
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1872e
jmp 0x6382
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x10f7a
movq %rbx, %rdi
callq 0x55b0