// File: /workspace/github_cpp_makefile_star2_O3/cannam[P]mini-cpp-convnet/flower.cpp
// Function: read_image(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<vector<vector<float>>>
read_image(string filename)
{
    png_image image;
    memset(&image, 0, sizeof(image));
    image.version = PNG_IMAGE_VERSION;

    if (!png_image_begin_read_from_file(&image, filename.c_str())) {
        throw runtime_error
            (string("Failed to open image file: ") + image.message);
    }

    image.format = PNG_FORMAT_RGB;
    auto size = image.width * image.height * 3;
    vector<png_byte> buffer(size, 255);
    
    if (!png_image_finish_read(&image, nullptr, buffer.data(), 0, nullptr)) {
        throw runtime_error
            (string("Failed to read image file: ") + image.message);
    }

    vector<vector<vector<float>>> image_tensor;
    auto ptr = buffer.begin();
    
    for (png_uint_32 i = 0; i < image.height; ++i) {
        image_tensor.push_back(vector<vector<float>>());
        for (png_uint_32 j = 0; j < image.width; ++j) {
            image_tensor[i].push_back(vector<float>());
            for (png_uint_32 k = 0; k < 3; ++k) {
                image_tensor[i][j].push_back(*ptr++ / 255.f);
            }
        }
    }
        
    return image_tensor;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movq $0x0, 0x60(%rdi)
movl $0x1, 0x8(%rdi)
movq (%rsi), %rsi
callq 0x2210
testl %eax, %eax
je 0x1dc24
movl $0x2, 0x84(%rsp)
movl 0x7c(%rsp), %eax
imull 0x80(%rsp), %eax
leal (%rax,%rax,2), %esi
movq %rsp, %rdx
movb $-0x1, (%rdx)
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rcx
callq 0x1e9ec
movq 0x48(%rsp), %rdx
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2100
testl %eax, %eax
je 0x1dc87
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
cmpl $0x0, 0x80(%rsp)
je 0x1dbf8
movq 0x48(%rsp), %r13
xorl %r14d, %r14d
movq %rsp, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1efce
movq %rbp, %rdi
callq 0x1e770
cmpl $0x0, 0x7c(%rsp)
je 0x1dbe5
movq %r14, 0x60(%rsp)
leaq (%r14,%r14,2), %r12
leaq (,%r12,8), %rax
movq %rax, 0x68(%rsp)
movq $0x0, 0x20(%rsp)
movq %r13, %r15
movq (%rbx), %rdi
addq 0x68(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rbp, %rsi
callq 0x1f1d0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1db63
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rax
leaq (%rax,%rax,2), %r13
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r12,8), %rax
leaq (%rax,%r13,8), %rdi
movzbl (%r15,%r14), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x24c2(%rip), %xmm0     # 0x20050
movss %xmm0, (%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x1dbab
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x1dbb3
movq %rbp, %rdx
callq 0x1f3aa
incq %r14
cmpl $0x3, %r14d
jne 0x1db6f
movq 0x20(%rsp), %rdx
incq %rdx
movl 0x7c(%rsp), %eax
leaq (%r15,%r14), %r13
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
jb 0x1db2a
addq %r14, %r15
movq %r15, %r13
movq 0x60(%rsp), %r14
incq %r14
movl 0x80(%rsp), %eax
cmpq %rax, %r14
jb 0x1dadd
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x1dc0f
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x255e(%rip), %rsi      # 0x2019f
leaq 0x2572(%rip), %rdx      # 0x201ba
leaq 0x28(%rsp), %rdi
callq 0x1ef00
leaq 0x94(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x22f0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1dcea
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x1dcf6
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2517(%rip), %rsi      # 0x201bb
leaq 0x252b(%rip), %rdx      # 0x201d6
leaq 0x28(%rsp), %rdi
callq 0x1ef00
leaq 0x94(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x22f0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1dd35
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x1dd41
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x2270
xorl %ebp, %ebp
movq 0x932cc(%rip), %rsi     # 0xb0ff0
movq 0x93285(%rip), %rdx     # 0xb0fb0
movq %rbx, %rdi
callq 0x22c0
jmp 0x1dd7e
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x2270
xorl %ebp, %ebp
movq 0x93281(%rip), %rsi     # 0xb0ff0
movq 0x9323a(%rip), %rdx     # 0xb0fb0
movq %rbx, %rdi
callq 0x22c0
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1dd97
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1ddae
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
testb %bpl, %bpl
jne 0x1de2d
jmp 0x1de81
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1de2d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x1de2d
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1dded
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1de04
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
testb %bpl, %bpl
jne 0x1de3a
jmp 0x1de98
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1de3a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x1de3a
movq %rax, %r14
movq %rbx, %rdi
callq 0x2180
jmp 0x1de81
movq %rax, %r14
movq %rbx, %rdi
callq 0x2180
jmp 0x1de98
movq %rax, %r14
jmp 0x1de81
movq %rax, %r14
jmp 0x1de98
movq %rax, %r14
movq %rsp, %rdi
callq 0x1e770
jmp 0x1de79
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1de79
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x1de79
movq %rax, %r14
movq %rbx, %rdi
callq 0x1e7c4
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x1de98
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x22d0