// File: spatialfruitsalad[P]volume2position/./tomogram.hpp
// Function: tomogram3d<float>::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:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rsi, 0x58(%rsp)
movq %rdi, 0x2c0(%rsp)
movq %rsi, 0x2b8(%rsp)
movq %rdx, 0x2b0(%rsp)
movq 0x2c0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x18be8(%rip), %rdi     # 0x33fc0
leaq 0xd4e3(%rip), %rsi      # 0x288c2
callq 0x3290
movq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
leaq 0xd499(%rip), %rsi      # 0x28894
callq 0x3290
movq %rax, %rdi
movq 0x18bbe(%rip), %rsi     # 0x33fc8
callq 0x32c0
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x3450
movq 0x58(%rsp), %rdi
callq 0x3110
movq 0x60(%rsp), %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x3060
jmp 0x1b43f
leaq 0xd49b(%rip), %rsi      # 0x288e1
leaq 0xb0(%rsp), %rdi
callq 0x3290
movq %rax, 0x48(%rsp)
jmp 0x1b45a
movq 0x48(%rsp), %rdi
movq 0x18b3a(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1b46d
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x3090
movq %rax, 0x40(%rsp)
jmp 0x1b48a
movq 0x40(%rsp), %rdi
leaq 0xd7b2(%rip), %rsi      # 0x28c48
callq 0x3290
movq %rax, 0x38(%rsp)
jmp 0x1b4a2
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x3090
movq %rax, 0x30(%rsp)
jmp 0x1b4bc
movq 0x30(%rsp), %rdi
movq 0x18ad8(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1b4cf
movq 0x50(%rsp), %rdi
callq 0x1b760
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x88(%rsp)
movq 0x2b0(%rsp), %rsi
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
imulq %rcx, %rsi
imulq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x1b790
movq 0x50(%rsp), %rdi
movq %rax, 0x90(%rsp)
callq 0x1b760
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x78(%rsp)
movq 0x2b0(%rsp), %rsi
incq %rsi
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
imulq %rcx, %rsi
imulq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x1b790
movq %rax, 0x80(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x1b710
movq %rax, 0x28(%rsp)
jmp 0x1b576
movq 0x28(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x1b7d0
movss (%rax), %xmm0
movss %xmm0, 0xa0(%rsp)
cvttss2si 0xa0(%rsp), %esi
leaq 0xb0(%rsp), %rdi
callq 0x3470
movq %rax, 0x20(%rsp)
jmp 0x1b5ba
movq 0x20(%rsp), %rdi
movq 0x189da(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1b5cd
movq $0x0, 0x70(%rsp)
movq 0x50(%rsp), %rcx
movq 0x70(%rsp), %rax
cmpq 0x20(%rcx), %rax
je 0x1b6a6
movq $0x0, 0x68(%rsp)
movq 0x50(%rsp), %rcx
movq 0x68(%rsp), %rax
cmpq 0x18(%rcx), %rax
je 0x1b691
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x2b0(%rsp), %rcx
callq 0x15be0
movss %xmm0, 0x1c(%rsp)
jmp 0x1b62b
movss 0x1c(%rsp), %xmm0
cvttss2si %xmm0, %esi
leaq 0xb0(%rsp), %rdi
callq 0x3470
movq %rax, 0x10(%rsp)
jmp 0x1b649
movq 0x10(%rsp), %rdi
movq 0x1894b(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1b65c
jmp 0x1b65e
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x1b5f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x3390
jmp 0x1b6f7
jmp 0x1b693
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x1b5d6
leaq 0xb0(%rsp), %rdi
callq 0x3370
jmp 0x1b6b5
movq 0x18904(%rip), %rdi     # 0x33fc0
leaq 0xd187(%rip), %rsi      # 0x2884a
callq 0x3290
movq %rax, 0x8(%rsp)
jmp 0x1b6cf
movq 0x8(%rsp), %rdi
movq 0x188c5(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1b6e2
leaq 0xb0(%rsp), %rdi
callq 0x3390
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq 0xa8(%rsp), %rdi
callq 0x34a0
nopw %cs:(%rax,%rax)
nop