// File: /workspace/github_cpp_makefile_star2_O2/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, 0x14(%rsp)
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
pushq $0xa
popq %rcx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r15
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0xa351
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xd73f
leaq 0xc5ba(%rip), %rdx      # 0x118ee
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x9c69
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0xd720
leaq 0xc594(%rip), %rax      # 0x118f0
leaq 0xc592(%rip), %rbp      # 0x118f5
cmpb $0x0, 0x14(%rsp)
cmovneq %rax, %rbp
leaq 0xb8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
movq %rbp, %rdx
callq 0x9c69
movq %rbx, %r12
shrq %r12
leaq 0x78(%rsp), %rdi
callq 0x3488
leaq 0x18(%rsp), %rdi
callq 0x3488
leaq 0x38(%rsp), %rdi
callq 0x3488
leaq 0x58(%rsp), %rdi
callq 0x3488
leaq 0x98(%rsp), %rdi
movq %r12, %rsi
callq 0xa351
leaq 0x58(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq %r14, %rsi
callq 0xd73f
leaq 0xc513(%rip), %rdx      # 0x118ee
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x9c69
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r13, %rdx
callq 0xd720
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %rbp, %rdx
callq 0x9c69
subq %r15, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3488
leaq 0x38(%rsp), %rdi
callq 0x3488
leaq 0x58(%rsp), %rdi
callq 0x3488
leaq 0x98(%rsp), %rdi
callq 0x3488
leaq 0x158(%rsp), %rdi
movq %rbx, %rsi
callq 0xa351
leaq 0x98(%rsp), %rdi
leaq 0x158(%rsp), %rdx
movq %r14, %rsi
callq 0xd73f
leaq 0xc483(%rip), %rdx      # 0x118ee
leaq 0x58(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x9c69
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movq %r13, %rdx
callq 0xd720
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %rbp, %rdx
callq 0x9c69
leaq 0x38(%rsp), %rdi
callq 0x3488
leaq 0x58(%rsp), %rdi
callq 0x3488
leaq 0x98(%rsp), %rdi
callq 0x3488
leaq 0x158(%rsp), %rdi
callq 0x3488
cmpb $0x0, 0x14(%rsp)
je 0x556f
leaq 0x138(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x3320
leaq 0x138(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xeb38
leaq 0x138(%rsp), %rdi
callq 0x3488
leaq 0x118(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x3320
leaq 0x118(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xeb38
leaq 0x118(%rsp), %rdi
callq 0x3488
leaq 0x198(%rsp), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3320
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xeb38
jmp 0x55ff
leaq 0xf8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x3320
leaq 0xf8(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xef10
leaq 0xf8(%rsp), %rdi
callq 0x3488
leaq 0xd8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x3320
leaq 0xd8(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xef10
leaq 0xd8(%rsp), %rdi
callq 0x3488
leaq 0x178(%rsp), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3320
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xef10
movq %r14, %rdi
callq 0x3488
leaq 0x18(%rsp), %rdi
callq 0x3488
leaq 0x78(%rsp), %rdi
callq 0x3488
leaq 0xb8(%rsp), %rdi
callq 0x3488
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x5686
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
jmp 0x5686
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x5686
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x5686
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x5686
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x3488
jmp 0x5751
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3488
jmp 0x56a2
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3488
jmp 0x56b1
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3488
jmp 0x56c3
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x5756
movq %rax, %rbx
jmp 0x575b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3488
jmp 0x56ea
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3488
jmp 0x56f9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3488
jmp 0x5708
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x5760
movq %rax, %rbx
jmp 0x5765
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3488
jmp 0x5729
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3488
jmp 0x5738
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3488
jmp 0x5747
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x576d
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3488
leaq 0x78(%rsp), %rdi
callq 0x3488
leaq 0xb8(%rsp), %rdi
callq 0x3488
movq %rbx, %rdi
callq 0x3420