// File: /workspace/github_cpp_makefile_star2_O1/spatialfruitsalad[P]volume2position/./tomogram.hpp
// Function: tomogram3d<unsigned char>::write_pgm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long) const
void write_pgm (std::string outfilename, unsigned long picnumber) const
    {
        std::cout << "write " << outfilename << " ... " << std::flush;
        std::ofstream myfile;
        myfile.open (outfilename.c_str());
        myfile << "P2" << std::endl;
        myfile << sx << " " << sy << std::endl;

        VALUE maxvalue = *std::max_element (data.begin()+(picnumber*sx*sy),data.begin()+((picnumber+1)*sx*sy));

        myfile << int(maxvalue) << std::endl;
        for (unsigned long j = 0; j != sy; ++j)
            for (unsigned long i = 0; i != sx; ++i)
            {
                myfile << int(get(i,j,picnumber)) << std::endl;
            }
        myfile.close();
        std::cout << " done" << std::endl;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x960b(%rip), %r12      # 0x1cfc8
leaq 0x3f81(%rip), %rsi      # 0x17945
movl $0x6, %edx
movq %r12, %rdi
callq 0x3300
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x3300
movq %rax, %r12
leaq 0x3f2d(%rip), %rsi      # 0x17917
movl $0x5, %edx
movq %rax, %rdi
callq 0x3300
movq %r12, %rdi
callq 0x31e0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3410
movq (%r15), %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x3f41(%rip), %rsi      # 0x17964
leaq 0x8(%rsp), %r15
movl $0x2, %edx
movq %r15, %rdi
callq 0x3300
movq 0x8(%rsp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
leaq 0x8(%rsp), %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x18(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x31d0
movq %rax, %r15
leaq 0x424f(%rip), %rsi      # 0x17cc7
movl $0x1, %edx
movq %rax, %rdi
callq 0x3300
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x31d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq (%r14), %rsi
movq 0x18(%r14), %rax
imulq 0x20(%r14), %rax
movq %rax, %rdx
imulq %rbx, %rdx
leaq (%rsi,%rdx), %rcx
leaq 0x1(%rbx), %rdi
imulq %rax, %rdi
addq %rdi, %rsi
cmpq %rdi, %rdx
sete %dil
movq %rcx, %rdx
incq %rdx
cmpq %rsi, %rdx
sete %sil
orb %dil, %sil
je 0x13afb
movq %rcx, %rsi
jmp 0x13b17
decq %rax
movb (%rcx), %dil
movq %rdx, %rsi
cmpb (%rdx), %dil
jb 0x13b0c
movq %rcx, %rsi
incq %rdx
movq %rsi, %rcx
decq %rax
jne 0x13afe
movzbl (%rsi), %esi
leaq 0x8(%rsp), %rdi
callq 0x3430
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
cmpq $0x0, 0x20(%r14)
je 0x13bbf
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
cmpq $0x0, 0x18(%r14)
je 0x13bb6
xorl %r13d, %r13d
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xeaa4
movzbl %al, %esi
movq %r12, %rdi
callq 0x3430
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
incq %r13
cmpq 0x18(%r14), %r13
jne 0x13b67
incq %r15
cmpq 0x20(%r14), %r15
jne 0x13b5d
leaq 0x8(%rsp), %rdi
callq 0x3370
movq 0x93f8(%rip), %rbx      # 0x1cfc8
leaq 0x3cf6(%rip), %rsi      # 0x178cd
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq 0x93c6(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x93a2(%rip), %rax      # 0x1cfb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x3260
leaq 0x100(%rsp), %rdi
callq 0x30c0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13c57
jmp 0x13c57
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x3440