// File: /workspace/github_cpp_makefile_star2_O2/spatialfruitsalad[P]volume2position/./tomogram.hpp
// Function: tomogram3d<unsigned short>::write_raw(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) const
void write_raw (std::string outfilename, std::string type) const
    {
        std::cout << "write " << outfilename << " ... " << std::flush;
        std::ofstream outfile;
        outfile.open(outfilename.c_str());

        if (type == "uint8_t")
        {
            for (unsigned long i = 0; i<sx*sy*sz; i++)
            {
                uint8_t number;
                if (data.at(i) < 0 || data.at(i) > std::numeric_limits<uint8_t>::max())
                    throw std::runtime_error ("Cant't write file: Numbers are to big for selected class type");
                number = uint8_t(data.at(i));
                outfile.write ((char *)&number,sizeof (number));
            }
        }

        else if (type == "uint16_t")
        {
            for (unsigned long i = 0; i<sx*sy*sz; i++)
            {
                uint16_t number;
                if (data.at(i) < 0 || data.at(i) > std::numeric_limits<uint16_t>::max())
                    throw std::runtime_error ("Cant't write file: Numbers are to big for selected class type");
                number = uint16_t(data.at(i));
                outfile.write ((char *)&number,sizeof (number));
            }
        }

        else if (type == "uint32_t")
        {
            for (unsigned long i = 0; i<sx*sy*sz; i++)
            {
                uint32_t number;
                if (data.at(i) < 0 || data.at(i) > static_cast<uint32_t>(std::numeric_limits<uint32_t>::max()))
                    throw std::runtime_error ("Cant't write file: Numbers are to big for selected class type");
                number = uint32_t(data.at(i));
                outfile.write ((char *)&number,sizeof (number));
            }
        }

        else if (type == "int")
        {
            for (unsigned long i = 0; i<sx*sy*sz; i++)
            {
                int number;
                if (data.at(i) > std::numeric_limits<int>::max())
                    throw std::runtime_error ("Cant't write file: Numbers are to big for selected class type");
                number = int(data.at(i));
                outfile.write ((char *)&number,sizeof (number));
            }
        }
        else
        {
            throw std::runtime_error ("can't write raw type");
        }

        outfile.close();
        std::cout << " done" << std::endl;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x1218c(%rip), %rdi     # 0x17fc8
leaq 0xbab7(%rip), %rsi      # 0x118fa
callq 0x3260
movq %rax, %rdi
movq %r15, %rsi
callq 0x3230
leaq 0xba72(%rip), %rsi      # 0x118cc
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x31b0
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x33f0
movq (%r15), %rsi
pushq $0x10
popq %rdx
movq %r12, %rdi
callq 0x3040
leaq 0xb5cb(%rip), %rsi      # 0x11457
movq %r14, %rdi
callq 0xe944
testb %al, %al
je 0x5f05
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
pushq $0x1
popq %r13
movq 0x20(%rbx), %rax
imulq 0x18(%rbx), %rax
imulq 0x28(%rbx), %rax
cmpq %rax, %r14
jae 0x605d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
cmpw $0x100, (%rax)          # imm = 0x100
jae 0x609d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movb (%rax), %al
movb %al, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3310
incq %r14
jmp 0x5ea9
leaq 0xb330(%rip), %rsi      # 0x1123c
movq %r14, %rdi
callq 0xe944
testb %al, %al
je 0x5f7c
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
pushq $0x2
popq %r13
movq 0x20(%rbx), %rax
imulq 0x18(%rbx), %rax
imulq 0x28(%rbx), %rax
cmpq %rax, %r14
jae 0x605d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movzwl (%rax), %eax
movw %ax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3310
incq %r14
jmp 0x5f29
leaq 0xbbb8(%rip), %rsi      # 0x11b3b
movq %r14, %rdi
callq 0xe944
testb %al, %al
je 0x5ff2
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
pushq $0x4
popq %r13
movq 0x20(%rbx), %rax
imulq 0x18(%rbx), %rax
imulq 0x28(%rbx), %rax
cmpq %rax, %r14
jae 0x605d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movzwl (%rax), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3310
incq %r14
jmp 0x5fa0
leaq 0xbacc(%rip), %rsi      # 0x11ac5
movq %r14, %rdi
callq 0xe944
testb %al, %al
je 0x60cf
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
pushq $0x4
popq %r13
movq 0x20(%rbx), %rax
imulq 0x18(%rbx), %rax
imulq 0x28(%rbx), %rax
cmpq %rax, %r14
jae 0x605d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf3c0
movzwl (%rax), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3310
incq %r14
jmp 0x601a
leaq 0x10(%rsp), %rdi
callq 0x3330
movq 0x11f5a(%rip), %rdi     # 0x17fc8
leaq 0xb80d(%rip), %rsi      # 0x11882
callq 0x3260
movq %rax, %rdi
callq 0x3110
leaq 0x10(%rsp), %rdi
callq 0x3350
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x3120
movq %rax, %r14
leaq 0xba4e(%rip), %rsi      # 0x11afd
movq %rax, %rdi
callq 0x30c0
movq 0x11f32(%rip), %rsi     # 0x17ff0
movq 0x11efb(%rip), %rdx     # 0x17fc0
movq %r14, %rdi
callq 0x3400
jmp 0x60ff
pushq $0x10
popq %rdi
callq 0x3120
movq %rax, %r14
leaq 0xba63(%rip), %rsi      # 0x11b44
movq %rax, %rdi
callq 0x30c0
movq 0x11f00(%rip), %rsi     # 0x17ff0
movq 0x11ec9(%rip), %rdx     # 0x17fc0
movq %r14, %rdi
callq 0x3400
jmp 0x6105
jmp 0x6118
jmp 0x6118
movq %rax, %rbx
movq %r14, %rdi
callq 0x31d0
jmp 0x611b
jmp 0x6118
jmp 0x6118
jmp 0x6118
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3420
nop