// File: /workspace/github_cpp_makefile_star2_O3/spatialfruitsalad[P]volume2position/label2color.cpp
// Function: main
int main( int argc, char *argv[] )
{

///////////////////////////////
// Parse command line arguments
///////////////////////////////
    if (argc != 5)
    {
        std::cerr << "wrong number of Command line arguments" << std::endl;
        std::cerr << "label2color [inFileName] [nx] [ny] [nz]";
        return 0;
    }

    std::string inFileName = argv[1];

    // the size of the tomogram
    unsigned long  nx = atoi(argv[2]);
    unsigned long  ny = atoi(argv[3]);
    unsigned long  nz = atoi(argv[4]);

///////////////////////////////
// Load Tomogram
///////////////////////////////
    std::cout << "loading tomogram from " << inFileName << std::endl;

    tomogram3d<uint16_t> original;
    original.read_raw(inFileName, "uint16_t", nx, ny, nz);

    std::cout << "tomogram successfully loaded" << std::endl;
    
    original.write_ppm(inFileName + "_51.ppm", 51);    
    original.write_ppm(inFileName + "_100.ppm", 100);    
    original.write_ppm(inFileName + "_255.ppm", 255);    
    original.write_ppm(inFileName + "_400.ppm", 400);    

    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
cmpl $0x5, %edi
jne 0x2776
movq %rsi, %r14
movq 0x8(%rsi), %rsi
movq %rsp, %rdi
leaq 0xa0(%rsp), %rdx
callq 0x20c0
movq 0x10(%r14), %rdi
callq 0x2280
movl %eax, %ebx
movq 0x18(%r14), %rdi
callq 0x2280
movl %eax, %ebp
movq 0x20(%r14), %rdi
callq 0x2280
movl %eax, %r14d
movq 0x3b24(%rip), %rdi      # 0x5fc8
leaq 0x1c6c(%rip), %rsi      # 0x4117
movl $0x16, %edx
callq 0x2210
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x3b03(%rip), %rdi      # 0x5fc8
callq 0x2210
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
leaq 0x100(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0x3310
leaq 0xe0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1bea(%rip), %rsi      # 0x412e
leaq 0x1beb(%rip), %rdx      # 0x4136
leaq 0xd0(%rsp), %rdi
callq 0x33a6
movslq %ebx, %rcx
movslq %ebp, %r8
movslq %r14d, %r9
leaq 0xa0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x287a
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x2590
callq 0x21c0
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x25a2
callq 0x21c0
movq 0x3a1f(%rip), %rbx      # 0x5fc8
leaq 0x1b87(%rip), %rsi      # 0x4137
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq 0x39ed(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x90(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0x3310
leaq 0x1b40(%rip), %rsi      # 0x4154
leaq 0x80(%rsp), %rdi
callq 0x22f0
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0x33, %edx
callq 0x2d02
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x264d
callq 0x21c0
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x3310
leaq 0x1ae9(%rip), %rsi      # 0x415c
leaq 0x60(%rsp), %rdi
callq 0x22f0
leaq 0xa0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x64, %edx
callq 0x2d02
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x26a3
callq 0x21c0
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3310
leaq 0x1a9c(%rip), %rsi      # 0x4165
leaq 0x40(%rsp), %rdi
callq 0x22f0
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl $0xff, %edx
callq 0x2d02
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x26f9
callq 0x21c0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3310
leaq 0x1a4f(%rip), %rsi      # 0x416e
leaq 0x20(%rsp), %rdi
callq 0x22f0
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x190, %edx            # imm = 0x190
callq 0x2d02
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x274f
callq 0x21c0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2761
callq 0x21c0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27cc
callq 0x21c0
jmp 0x27cc
movq 0x386b(%rip), %rbx      # 0x5fe8
leaq 0x1944(%rip), %rsi      # 0x40c8
movl $0x26, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x1930(%rip), %rsi      # 0x40ef
movl $0x27, %edx
movq %rbx, %rdi
callq 0x2210
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27e0
movq %rax, %rbx
movq 0x20(%rsp), %rdi
jmp 0x280f
jmp 0x27ec
movq %rax, %rbx
movq 0x40(%rsp), %rdi
jmp 0x280f
jmp 0x27f8
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x280f
jmp 0x2804
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
jne 0x283d
jmp 0x284c
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x2830
callq 0x21c0
jmp 0x2830
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x284c
callq 0x21c0
jmp 0x284c
movq %rax, %rbx
jmp 0x285e
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x285e
callq 0x21c0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2871
callq 0x21c0
movq %rbx, %rdi
callq 0x22d0
nop