// File: /workspace/github_cpp_makefile_star2_O1/spatialfruitsalad[P]volume2position/./common.hpp
// Function: void WriteImages<unsigned short>(tomogram3d<unsigned short>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, bool)
inline void WriteImages(tomogram3d<VALUE>& t, std::string path, std::string name, unsigned long nz, bool randomcolors = false)
{
    unsigned long sliceTenPercent = nz/10;
    unsigned long sliceFiftyPercent = nz/2;
    unsigned long sliceNinetyPercent = nz - sliceTenPercent;

    std::string Tenstring = path +    std::to_string(sliceTenPercent)   + "_" + name  + ((randomcolors)? ".ppm" : ".pgm");
    std::string Fiftystring = path +  std::to_string(sliceFiftyPercent) + "_" + name  + ((randomcolors)? ".ppm" : ".pgm");
    std::string Ninetystring = path + std::to_string(sliceNinetyPercent)+ "_" + name  + ((randomcolors)? ".ppm" : ".pgm");

    if(randomcolors)
    {
        t.write_ppm(Tenstring, sliceTenPercent);
        t.write_ppm(Fiftystring, sliceFiftyPercent);
        t.write_ppm(Ninetystring, sliceNinetyPercent);
    }
    else
    {
        t.write_pgm(Tenstring, sliceTenPercent);
        t.write_pgm(Fiftystring, sliceFiftyPercent);
        t.write_pgm(Ninetystring, sliceNinetyPercent);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl %r8d, 0x64(%rsp)
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, 0xd0(%rsp)
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
movq %rbx, %rax
mulq %rcx
movq %rdx, %r13
shrq $0x3, %r13
movl $0x1, %esi
cmpq $0x64, %rbx
jb 0x6342
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0x633b
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6340
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x6342
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x6305
addl $-0x3, %esi
jmp 0x6342
addl $-0x2, %esi
jmp 0x6342
decl %esi
movl %esi, %esi
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x3310
movq (%r14), %rdi
movl 0x8(%r14), %esi
movq %r13, %rdx
callq 0xe07f
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32e0
leaq 0x30(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63a6
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x63ac
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1156a(%rip), %rsi     # 0x17939
callq 0x3480
leaq 0x10(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63fa
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6400
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
callq 0x30b0
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x644f
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x6456
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x114c2(%rip), %rax     # 0x1793b
leaq 0x114c0(%rip), %r14     # 0x17940
cmpb $0x0, 0x64(%rsp)
cmovneq %rax, %r14
movq %r14, %rsi
callq 0x3480
leaq 0xc0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x64c1
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x64c7
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x64f1
callq 0x3290
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6504
callq 0x3290
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6518
callq 0x3290
movq %r13, 0x88(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6534
callq 0x3290
movq %rbx, %r13
shrq %r13
movl $0x1, %esi
cmpq $0x14, %rbx
jb 0x6594
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0x658d
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6592
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x6594
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x6557
addl $-0x3, %esi
jmp 0x6594
addl $-0x2, %esi
jmp 0x6594
decl %esi
movl %esi, %esi
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x90(%rsp), %rdi
xorl %edx, %edx
callq 0x3310
leaq 0x90(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movq %r13, %rdx
callq 0xe07f
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32e0
leaq 0x50(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6604
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x660a
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
leaq 0x78(%rsp), %r15
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x11307(%rip), %rsi     # 0x17939
callq 0x3480
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x665f
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x6665
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
callq 0x30b0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x66b5
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x66bb
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rsi
callq 0x3480
movq %r15, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6700
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x6707
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6732
callq 0x3290
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6746
callq 0x3290
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x675a
callq 0x3290
subq 0x88(%rsp), %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x677c
callq 0x3290
movl $0x1, %esi
cmpq $0xa, %rbx
jb 0x67d6
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbx, %rcx
cmpq $0x63, %rcx
jbe 0x67cf
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x67d4
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x67d6
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x6799
addl $-0x3, %esi
jmp 0x67d6
addl $-0x2, %esi
jmp 0x67d6
decl %esi
movl %esi, %esi
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xd8(%rsp), %rdi
xorl %edx, %edx
callq 0x3310
leaq 0xd8(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movq %rbx, %rdx
callq 0xe07f
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32e0
leaq 0xa0(%rsp), %rsi
movq %rsi, 0x90(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq 0xd0(%rsp), %rbp
je 0x685a
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0x6860
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
leaq 0x78(%rsp), %r15
movq 0x8(%rax), %rdx
leaq 0x90(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x110ae(%rip), %rsi     # 0x17939
callq 0x3480
leaq 0x50(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x68b8
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x68be
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
callq 0x30b0
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x10(%rsp), %r12
je 0x6915
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x691b
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rsi
callq 0x3480
movq %r12, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6960
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6968
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6994
callq 0x3290
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x69a8
callq 0x3290
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x69c2
callq 0x3290
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x69dc
callq 0x3290
cmpb $0x0, 0x64(%rsp)
je 0x6acd
leaq 0x1a8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x198(%rsp), %rdi
callq 0x1312e
leaq 0x198(%rsp), %rsi
movq %rbp, %rdi
movq 0x88(%rsp), %rdx
callq 0x13df6
movq 0x198(%rsp), %rdi
cmpq %r14, %rdi
je 0x6a3d
callq 0x3290
leaq 0x188(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x178(%rsp), %rdi
callq 0x1312e
leaq 0x178(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x13df6
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
je 0x6a88
callq 0x3290
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x1312e
leaq 0x158(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x13df6
movq 0x158(%rsp), %rdi
jmp 0x6bae
leaq 0x148(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %rdi
callq 0x1312e
leaq 0x138(%rsp), %rsi
movq %rbp, %rdi
movq 0x88(%rsp), %rdx
callq 0x1440a
movq 0x138(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b23
callq 0x3290
leaq 0x128(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x1312e
leaq 0x118(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x1440a
movq 0x118(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b6e
callq 0x3290
leaq 0x108(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0x1312e
leaq 0xf8(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x1440a
movq 0xf8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6bb8
callq 0x3290
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6bc6
callq 0x3290
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6bd5
callq 0x3290
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x6bef
callq 0x3290
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
jmp 0x6c4d
movq %rax, %rbx
movq 0x158(%rsp), %rdi
jmp 0x6c4d
movq %rax, %rbx
movq 0x118(%rsp), %rdi
jmp 0x6c4d
movq %rax, %rbx
movq 0x178(%rsp), %rdi
jmp 0x6c4d
movq %rax, %rbx
movq 0x138(%rsp), %rdi
jmp 0x6c4d
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r14, %rdi
je 0x6d8c
callq 0x3290
jmp 0x6d8c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6c7c
callq 0x3290
jmp 0x6c7c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6c95
callq 0x3290
jmp 0x6c95
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x6cb4
callq 0x3290
jmp 0x6cb4
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
jmp 0x6d95
movq %rax, %rbx
jmp 0x6d9f
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6cec
callq 0x3290
jmp 0x6cec
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6d05
callq 0x3290
jmp 0x6d05
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6d1e
callq 0x3290
jmp 0x6d1e
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
jmp 0x6da9
movq %rax, %rbx
jmp 0x6db3
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6d4c
callq 0x3290
jmp 0x6d4c
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6d64
callq 0x3290
jmp 0x6d64
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6d7d
callq 0x3290
jmp 0x6d7d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
jmp 0x6dc3
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6d9f
callq 0x3290
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x6db3
callq 0x3290
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x6dcd
callq 0x3290
movq %rbx, %rdi
callq 0x3440
nop