// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pd2img/pd2img.cpp
// Function: main
int main(int argc, char **argv)
{
  // Parse program arguments
  if (!ParseArgs(argc, argv)) exit(-1);
  
  // Open pixel database
  R2PixelDatabase pd;
  if (!pd.OpenFile(input_pixel_database, "r")) exit(-1);

  // Write images
  if (!WriteImages(pd, output_image_directory)) exit(-1);

  // Close pixel database
  if (!pd.CloseFile()) exit(-1);

  // Return success
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x978, %rsp            # imm = 0x978
movq %rsi, %rbx
movl %edi, %ebp
movq 0x6a65f(%rip), %r13     # 0x704c8
movq 0x6a660(%rip), %r12     # 0x704d0
leaq 0x4718d(%rip), %r14     # 0x4d004
addq $0x8, %rbx
cmpl $0x2, %ebp
jl 0x5eec
movq (%rbx), %r15
cmpb $0x2d, (%r15)
jne 0x5ec2
cmpb $0x76, 0x1(%r15)
jne 0x5e97
cmpb $0x0, 0x2(%r15)
je 0x5eb9
movq %r15, %rdi
movq %r14, %rsi
callq 0x54f0
testl %eax, %eax
jne 0x616e
movb $0x1, 0x6a62b(%rip)     # 0x704dc
addq $0x8, %rbx
decl %ebp
jmp 0x5e7b
movb $0x1, 0x6a618(%rip)     # 0x704d8
jmp 0x5eb1
testq %r13, %r13
jne 0x5ed5
decl %ebp
movq %r15, 0x6a5f8(%rip)     # 0x704c8
movq %r15, %r13
jmp 0x5e77
testq %r12, %r12
jne 0x616e
decl %ebp
movq %r15, 0x6a5e9(%rip)     # 0x704d0
movq %r15, %r12
jmp 0x5e77
testq %r13, %r13
je 0x6187
testq %r12, %r12
je 0x6187
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0xfec0
movq 0x6a5b6(%rip), %rsi     # 0x704c8
leaq 0x4a15a(%rip), %rdx     # 0x50073
movq %rbx, %rdi
callq 0x1070a
testl %eax, %eax
je 0x6195
movq 0x6a5a0(%rip), %rax     # 0x704d0
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x1eed6
leaq 0x20(%rsp), %rdi
callq 0x61d4
cmpb $0x1, 0x6a588(%rip)     # 0x704d8
jne 0x5f74
leaq 0x47106(%rip), %rdi     # 0x4d05f
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x5060
movq 0x6a044(%rip), %rax     # 0x6ffb0
movq (%rax), %rdi
callq 0x53d0
leaq 0x90(%rsp), %r13
xorl %r14d, %r14d
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
movslq 0x64(%rsp), %rax
cmpq %rax, %rcx
jge 0x6100
movq %rcx, %r12
movq 0x30(%rsp), %rax
movq 0x78(%rsp), %rcx
movq (%rcx,%r14), %rbp
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq *0x20(%rax)
movl %eax, %ebx
testl %eax, %eax
js 0x6088
movq %r14, 0x18(%rsp)
cmpb $0x1, 0x6a513(%rip)     # 0x704dc
jne 0x5fdc
leaq 0x470c3(%rip), %rdi     # 0x4d095
movq %rbp, %rsi
xorl %eax, %eax
callq 0x5060
leaq 0x160(%rsp), %r15
movq %r15, %rdi
leaq 0x470ad(%rip), %rsi     # 0x4d09b
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x50b0
leaq 0x560(%rsp), %r14
movq %r14, %rdi
leaq 0x47092(%rip), %rsi     # 0x4d0a1
movq %r15, %rdx
xorl %eax, %eax
callq 0x50b0
movq %r14, %rdi
pushq $0x2f
popq %rsi
callq 0x53a0
testq %rax, %rax
je 0x602c
movb $0x0, (%rax)
leaq 0x560(%rsp), %rdi
callq 0x52d0
movq 0x18(%rsp), %r14
cmpl $0x1, %ebx
je 0x609b
testl %ebx, %ebx
jne 0x60de
movq %r13, %rdi
callq 0x16610
movq 0x30(%rsp), %rax
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq *0x10(%rax)
testl %eax, %eax
je 0x607e
movq %r13, %rdi
leaq 0x160(%rsp), %rsi
callq 0x18552
incl 0xc(%rsp)
movq %r13, %rdi
callq 0x16b5c
jmp 0x60f1
leaq 0x46fea(%rip), %rdi     # 0x4d079
movq %rbp, %rsi
xorl %eax, %eax
callq 0x216fa
jmp 0x60f1
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x61dc
movq 0x30(%rsp), %rax
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x18(%rax)
testl %eax, %eax
je 0x60d4
movq %r13, %rdi
leaq 0x160(%rsp), %rsi
callq 0xe810
incl 0xc(%rsp)
movq %r13, %rdi
callq 0x6d20
jmp 0x60f1
leaq 0x46fc8(%rip), %rdi     # 0x4d0ad
movl %ebx, %esi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x216fa
movq %r12, %rcx
incq %rcx
addq $0x20, %r14
jmp 0x5f89
cmpb $0x0, 0x6a3d1(%rip)     # 0x704d8
je 0x6142
leaq 0x20(%rsp), %rdi
callq 0x1ef10
leaq 0x46fb2(%rip), %rdi     # 0x4d0cc
movb $0x1, %al
callq 0x5060
leaq 0x46fb3(%rip), %rdi     # 0x4d0db
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x5060
movq 0x69e76(%rip), %rax     # 0x6ffb0
movq (%rax), %rdi
callq 0x53d0
leaq 0x30(%rsp), %rdi
callq 0x10818
testl %eax, %eax
je 0x6195
leaq 0x30(%rsp), %rdi
callq 0xff7e
xorl %eax, %eax
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x46e96(%rip), %rdi     # 0x4d00b
movq %r15, %rsi
xorl %eax, %eax
callq 0x216fa
pushq $0x1
popq %rdi
callq 0x5400
leaq 0x46e9a(%rip), %rdi     # 0x4d028
xorl %eax, %eax
callq 0x216fa
pushq $-0x1
jmp 0x6181
jmp 0x61bf
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x6d20
jmp 0x61c2
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x16b5c
jmp 0x61c2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xff7e
movq %rbx, %rdi
callq 0x5600