// File: /workspace/github_cpp_makefile_star2_O3/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 0x6297
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0x6290
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6295
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x6297
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x625a
addl $-0x3, %esi
jmp 0x6297
addl $-0x2, %esi
jmp 0x6297
decl %esi
movl %esi, %esi
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x3300
movq (%r14), %rdi
movl 0x8(%r14), %esi
movq %r13, %rdx
callq 0xdf67
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32d0
leaq 0x30(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62fb
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x6301
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 0x11605(%rip), %rsi     # 0x17929
callq 0x3470
leaq 0x10(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x634f
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6355
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 0x63a4
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x63ab
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 0x1155d(%rip), %rax     # 0x1792b
leaq 0x1155b(%rip), %r14     # 0x17930
cmpb $0x0, 0x64(%rsp)
cmovneq %rax, %r14
movq %r14, %rsi
callq 0x3470
leaq 0xc0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6416
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x641c
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 0x6446
callq 0x3280
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6459
callq 0x3280
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x646d
callq 0x3280
movq %r13, 0x88(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6489
callq 0x3280
movq %rbx, %r13
shrq %r13
movl $0x1, %esi
cmpq $0x14, %rbx
jb 0x64e9
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0x64e2
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x64e7
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x64e9
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x64ac
addl $-0x3, %esi
jmp 0x64e9
addl $-0x2, %esi
jmp 0x64e9
decl %esi
movl %esi, %esi
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x90(%rsp), %rdi
xorl %edx, %edx
callq 0x3300
leaq 0x90(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movq %r13, %rdx
callq 0xdf67
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32d0
leaq 0x50(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6559
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x655f
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 0x113a2(%rip), %rsi     # 0x17929
callq 0x3470
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x65b4
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x65ba
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 0x660a
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6610
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 0x3470
movq %r15, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6655
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x665c
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 0x6687
callq 0x3280
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x669b
callq 0x3280
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x66af
callq 0x3280
subq 0x88(%rsp), %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x66d1
callq 0x3280
movl $0x1, %esi
cmpq $0xa, %rbx
jb 0x672b
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbx, %rcx
cmpq $0x63, %rcx
jbe 0x6724
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6729
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x672b
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x66ee
addl $-0x3, %esi
jmp 0x672b
addl $-0x2, %esi
jmp 0x672b
decl %esi
movl %esi, %esi
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xd8(%rsp), %rdi
xorl %edx, %edx
callq 0x3300
leaq 0xd8(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movq %rbx, %rdx
callq 0xdf67
movq (%rbp), %rcx
movq 0x8(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32d0
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 0x67af
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0x67b5
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 0x11149(%rip), %rsi     # 0x17929
callq 0x3470
leaq 0x50(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x680d
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x6813
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 0x686a
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x6870
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 0x3470
movq %r12, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x68b5
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x68bd
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 0x68e9
callq 0x3280
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x68fd
callq 0x3280
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x6917
callq 0x3280
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x6931
callq 0x3280
cmpb $0x0, 0x64(%rsp)
je 0x6a22
leaq 0x1a8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x198(%rsp), %rdi
callq 0x12fde
leaq 0x198(%rsp), %rsi
movq %rbp, %rdi
movq 0x88(%rsp), %rdx
callq 0x13cae
movq 0x198(%rsp), %rdi
cmpq %r14, %rdi
je 0x6992
callq 0x3280
leaq 0x188(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x178(%rsp), %rdi
callq 0x12fde
leaq 0x178(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x13cae
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
je 0x69dd
callq 0x3280
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x12fde
leaq 0x158(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x13cae
movq 0x158(%rsp), %rdi
jmp 0x6b03
leaq 0x148(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %rdi
callq 0x12fde
leaq 0x138(%rsp), %rsi
movq %rbp, %rdi
movq 0x88(%rsp), %rdx
callq 0x142bc
movq 0x138(%rsp), %rdi
cmpq %r14, %rdi
je 0x6a78
callq 0x3280
leaq 0x128(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x12fde
leaq 0x118(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x142bc
movq 0x118(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ac3
callq 0x3280
leaq 0x108(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0x12fde
leaq 0xf8(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x142bc
movq 0xf8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b0d
callq 0x3280
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6b1b
callq 0x3280
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6b2a
callq 0x3280
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x6b44
callq 0x3280
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 0x6ba2
movq %rax, %rbx
movq 0x158(%rsp), %rdi
jmp 0x6ba2
movq %rax, %rbx
movq 0x118(%rsp), %rdi
jmp 0x6ba2
movq %rax, %rbx
movq 0x178(%rsp), %rdi
jmp 0x6ba2
movq %rax, %rbx
movq 0x138(%rsp), %rdi
jmp 0x6ba2
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ce1
callq 0x3280
jmp 0x6ce1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6bd1
callq 0x3280
jmp 0x6bd1
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6bea
callq 0x3280
jmp 0x6bea
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x6c09
callq 0x3280
jmp 0x6c09
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
jmp 0x6cea
movq %rax, %rbx
jmp 0x6cf4
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6c41
callq 0x3280
jmp 0x6c41
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6c5a
callq 0x3280
jmp 0x6c5a
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6c73
callq 0x3280
jmp 0x6c73
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
jmp 0x6cfe
movq %rax, %rbx
jmp 0x6d08
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6ca1
callq 0x3280
jmp 0x6ca1
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6cb9
callq 0x3280
jmp 0x6cb9
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6cd2
callq 0x3280
jmp 0x6cd2
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
jmp 0x6d18
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6cf4
callq 0x3280
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x6d08
callq 0x3280
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x6d22
callq 0x3280
movq %rbx, %rdi
callq 0x3430