// File: iannisdezwart[P]forcefield-visualiser/./lib/png++-0.2.9/generator.hpp
// Function: void png::generator<png::basic_rgb_pixel<unsigned char>, png::image<png::basic_rgb_pixel<unsigned char>, png::pixel_buffer<png::basic_rgb_pixel<unsigned char>>>::pixel_generator, png::image_info_ref_holder, true>::write<std::basic_ofstream<char, std::char_traits<char>>>(std::basic_ofstream<char, std::char_traits<char>>&)
void write(ostream& stream)
        {
            writer< ostream > wr(stream);
            wr.set_image_info(this->get_info());
            wr.write_info();

#if __BYTE_ORDER == __LITTLE_ENDIAN
            if (pixel_traits< pixel >::get_bit_depth() == 16)
            {
#ifdef PNG_WRITE_SWAP_SUPPORTED
                wr.set_swap();
#else
                throw error("Cannot write 16-bit image: recompile with PNG_WRITE_SWAP_SUPPORTED.");
#endif
            }
#endif

            size_t pass_count;
            if (this->get_info().get_interlace_type() != interlace_none)
            {
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
                if (interlacing_supported)
                {
                    pass_count = wr.set_interlace_handling();
                }
                else
                {
                    throw std::logic_error("Cannot write interlaced image: generator does not support it.");
                }
#else
                throw error("Cannot write interlaced image: interlace handling disabled.");
#endif
            }
            else
            {
                pass_count = 1;
            }
            pixgen* pixel_gen = static_cast< pixgen* >(this);
            for (size_t pass = 0; pass < pass_count; ++pass)
            {
                pixel_gen->reset(pass);

                for (uint_32 pos = 0; pos < this->get_info().get_height(); ++pos)
                {
                    wr.write_row(pixel_gen->get_next_row(pos));
                }
            }

            wr.write_end_info();
        }

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x118(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xb2b0
movq 0x28(%rsp), %rdi
callq 0xb370
movq %rax, 0x30(%rsp)
jmp 0xb067
movq 0x30(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xb340
jmp 0xb078
leaq 0x68(%rsp), %rdi
callq 0xb380
jmp 0xb084
callq 0x89c0
cmpl $0x10, %eax
jne 0xb0b9
leaq 0x68(%rsp), %rdi
callq 0xb430
jmp 0xb09a
jmp 0xb0b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xb680
jmp 0xb1e2
movq 0x28(%rsp), %rdi
callq 0xb370
movq %rax, 0x20(%rsp)
jmp 0xb0ca
movq 0x20(%rsp), %rdi
callq 0xb470
movl %eax, 0x1c(%rsp)
jmp 0xb0da
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
je 0xb100
leaq 0x68(%rsp), %rdi
callq 0xb480
movl %eax, 0x18(%rsp)
jmp 0xb0f3
movl 0x18(%rsp), %eax
cltq
movq %rax, 0x50(%rsp)
jmp 0xb109
movq $0x1, 0x50(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0xb1c4
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xb4c0
jmp 0xb13d
movl $0x0, 0x3c(%rsp)
movq 0x28(%rsp), %rdi
movl 0x3c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0xb370
movq %rax, 0x10(%rsp)
jmp 0xb15e
movq 0x10(%rsp), %rdi
callq 0xb4d0
movl %eax, 0x8(%rsp)
jmp 0xb16e
movl 0xc(%rsp), %eax
movl 0x8(%rsp), %ecx
cmpl %ecx, %eax
jae 0xb1af
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %eax
movl %eax, %esi
callq 0xb5a0
movq %rax, (%rsp)
jmp 0xb190
movq (%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xb4e0
jmp 0xb1a0
jmp 0xb1a2
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xb145
jmp 0xb1b1
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0xb11c
leaq 0x68(%rsp), %rdi
callq 0xb5d0
jmp 0xb1d0
leaq 0x68(%rsp), %rdi
callq 0xb680
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x60(%rsp), %rdi
callq 0x3590
nopl (%rax)