// File: /workspace/github_cpp_makefile_star2_O1/cannam[P]mini-cpp-convnet/flower.cpp
// Function: zeroPad(std::vector<std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>, std::allocator<std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>>> const&, unsigned long, unsigned long)
vector<vector<vector<float>>>
zeroPad(const vector<vector<vector<float>>> &in,
        size_t pad_y,
        size_t pad_x)
{
    size_t in_height = in.size();
    if (in_height == 0) {
        throw runtime_error("Input too small in zeroPad");
    }

    size_t in_width = in[0].size();
    if (in_width == 0) {
        throw runtime_error("Input too small in zeroPad");
    }
    
    size_t depth = in[0][0].size();
    
#ifdef VERBOSE
    cerr << "zeroPad: input size " << in_width << "x" << in_height
         << "; padding " << pad_x << "," << pad_y << "; output size "
         << in_width + 2 * pad_x << "x" << in_height + 2 * pad_y
         << " and depth " << depth << endl;
#endif
    
    auto out =
        vector<vector<vector<float>>>
        (in_height + 2 * pad_y,
         vector<vector<float>>
         (in_width + 2 * pad_x,
          vector<float>
          (depth,
           0.f)));

    for (size_t y = 0; y < in_height; ++y) {
        for (size_t x = 0; x < in_width; ++x) {
            for (size_t c = 0; c < depth; ++c) {
                out[y + pad_y][x + pad_x][c] = in[y][x][c];
            }
        }
    }

    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq (%rsi), %rax
movq %rsi, 0x30(%rsp)
movq 0x8(%rsi), %rcx
movq %rcx, %rbp
subq %rax, %rbp
je 0x1cd95
movq %rcx, 0x20(%rsp)
movq (%rax), %r12
movq %rax, 0x28(%rsp)
movq 0x8(%rax), %r13
movq %r13, 0x38(%rsp)
subq %r12, %r13
je 0x1cdb3
movq (%r12), %r14
movq 0x8(%r12), %rbx
movq %rbx, %r15
subq %r14, %r15
sarq $0x2, %r15
leaq 0x5c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x1ead4
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
sarq $0x3, %r13
imulq %rax, %r13
movq 0x18(%rsp), %rax
leaq (,%rax,2), %rsi
addq %r13, %rsi
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
leaq 0x6(%rsp), %rcx
callq 0x1eb56
sarq $0x3, %rbp
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rbp
movq 0x10(%rsp), %rax
leaq (,%rax,2), %rsi
addq %rbp, %rsi
leaq 0x60(%rsp), %rdx
leaq 0x5(%rsp), %rcx
movq 0x8(%rsp), %rdi
callq 0x1ebee
leaq 0x60(%rsp), %rdi
callq 0x1ec86
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1ccd2
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x1cd81
cmpq $0x1, %r15
adcq $0x0, %r15
cmpq $0x1, %r13
adcq $0x0, %r13
cmpq $0x1, %rbp
adcq $0x0, %rbp
xorl %eax, %eax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x18(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq %r12, 0x38(%rsp)
je 0x1cd79
leaq (,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rdi
movq 0x30(%rsp), %rsi
movq (%rsi), %rsi
addq %rdi, %rsi
movq 0x8(%rsp), %r8
addq (%r8), %rdi
leaq (%rdi,%rcx,8), %rdi
xorl %r8d, %r8d
cmpq %r14, %rbx
je 0x1cd71
movq (%rsi), %r9
leaq (,%r8,8), %r10
leaq (%r10,%r10,2), %r10
movq (%r9,%r10), %r9
addq (%rdi), %r10
movq (%r10,%rdx,8), %r10
xorl %r11d, %r11d
movss (%r9,%r11,4), %xmm0
movss %xmm0, (%r10,%r11,4)
incq %r11
cmpq %r11, %r15
jne 0x1cd5d
incq %r8
cmpq %r13, %r8
jne 0x1cd3b
incq %rax
cmpq %rbp, %rax
jne 0x1cd0e
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x430d(%rip), %rsi      # 0x210b6
movq %rax, %rdi
callq 0x20b0
jmp 0x1cdcf
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x42ef(%rip), %rsi      # 0x210b6
movq %rax, %rdi
callq 0x20b0
movq 0x9521a(%rip), %rsi     # 0xb1ff0
movq 0x951d3(%rip), %rdx     # 0xb1fb0
movq %r14, %rdi
callq 0x22c0
jmp 0x1cde7
movq %rax, %rbx
movq %r14, %rdi
callq 0x2180
jmp 0x1ce22
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1ec86
jmp 0x1ce06
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1ce22
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x1ce22
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22d0