// File: /workspace/github_cpp_makefile_star2_O3/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 0x975f(%rip), %r12      # 0x1cfc8
leaq 0x40c5(%rip), %rsi      # 0x17935
movl $0x6, %edx
movq %r12, %rdi
callq 0x32f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x32f0
movq %rax, %r12
leaq 0x4071(%rip), %rsi      # 0x17907
movl $0x5, %edx
movq %rax, %rdi
callq 0x32f0
movq %r12, %rdi
callq 0x31e0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3400
movq (%r15), %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x4085(%rip), %rsi      # 0x17954
leaq 0x8(%rsp), %r15
movl $0x2, %edx
movq %r15, %rdi
callq 0x32f0
movq 0x8(%rsp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x32a0
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 0x4393(%rip), %rsi      # 0x17cb7
movl $0x1, %edx
movq %rax, %rdi
callq 0x32f0
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 0x32a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq (%r14), %rsi
movq 0x18(%r14), %rcx
imulq 0x20(%r14), %rcx
movq %rcx, %rdx
imulq %rbx, %rdx
leaq (%rsi,%rdx), %rax
leaq 0x1(%rbx), %rdi
imulq %rcx, %rdi
addq %rdi, %rsi
cmpq %rdi, %rdx
sete %dil
movq %rax, %rdx
incq %rdx
cmpq %rsi, %rdx
sete %sil
orb %dil, %sil
jne 0x139c1
movb (%rax), %sil
decq %rcx
movzbl (%rdx), %edi
cmpb %dil, %sil
movzbl %sil, %esi
cmovbel %edi, %esi
cmovbq %rdx, %rax
incq %rdx
decq %rcx
jne 0x139a8
movzbl (%rax), %esi
leaq 0x8(%rsp), %rdi
callq 0x3420
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x13a75
movq 0x18(%r14), %r13
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
testq %r13, %r13
je 0x13a6a
xorl %r13d, %r13d
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xe968
movzbl %al, %esi
movq %r12, %rdi
callq 0x3420
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x32a0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
incq %r13
cmpq 0x18(%r14), %r13
jne 0x13a15
movq 0x20(%r14), %rax
jmp 0x13a6d
xorl %r13d, %r13d
incq %r15
cmpq %rax, %r15
jne 0x13a0d
leaq 0x8(%rsp), %rdi
callq 0x3360
movq 0x9542(%rip), %rbx      # 0x1cfc8
leaq 0x3e30(%rip), %rsi      # 0x178bd
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32a0
movsbl %al, %esi
movq 0x9510(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x94ec(%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 0x3250
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 0x13b0d
jmp 0x13b0d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3380
movq %rbx, %rdi
callq 0x3430