// File: /workspace/github_cpp_makefile_star2_O1/cannam[P]mini-cpp-convnet/flower.cpp
// Function: activation(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&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<vector<vector<float>>>
activation(const vector<vector<vector<float>>> &in,
           string type)
{
    auto out(in);

    if (type == "relu") {
        for (size_t i = 0; i < out.size(); ++i) {
            for (size_t j = 0; j < out[i].size(); ++j) {
                for (size_t k = 0; k < out[i][j].size(); ++k) {
                    if (out[i][j][k] < 0.f) {
                        out[i][j][k] = 0.f;
                    }
                }
            }
        }
    } else {
        throw runtime_error("Unknown activation function '" + type + "'");
    }
        
    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rdi, %rbx
callq 0x1ed16
leaq 0x3efe(%rip), %rsi      # 0x2114c
movq %r15, %rdi
callq 0x2080
testl %eax, %eax
jne 0x1d30a
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
je 0x1d2fa
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
xorps %xmm0, %xmm0
leaq (%rsi,%rsi,2), %r8
movq (%rax,%r8,8), %rdi
movq 0x8(%rax,%r8,8), %r8
subq %rdi, %r8
je 0x1d2f2
sarq $0x3, %r8
imulq %rdx, %r8
cmpq $0x1, %r8
adcq $0x0, %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r11
movq (%rdi,%r11,8), %r10
movq 0x8(%rdi,%r11,8), %r11
subq %r10, %r11
je 0x1d2ea
sarq $0x2, %r11
cmpq $0x1, %r11
adcq $0x0, %r11
xorl %r14d, %r14d
ucomiss (%r10,%r14,4), %xmm0
jbe 0x1d2e2
movl $0x0, (%r10,%r14,4)
incq %r14
cmpq %r14, %r11
jne 0x1d2d3
incq %r9
cmpq %r8, %r9
jne 0x1d2b2
incq %rsi
cmpq %rcx, %rsi
jne 0x1d28d
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x3e33(%rip), %rsi      # 0x21151
leaq 0x20(%rsp), %rdi
movq %r15, %rdx
callq 0x1edaf
leaq 0x3e3b(%rip), %rsi      # 0x2116d
leaq 0x20(%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 0x1d35f
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x1d36b
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 %r14, %rdi
callq 0x2270
xorl %ebp, %ebp
movq 0x94c57(%rip), %rsi     # 0xb1ff0
movq 0x94c10(%rip), %rdx     # 0xb1fb0
movq %r14, %rdi
callq 0x22c0
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1d3c9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x1d3c9
movq %rax, %r15
movb $0x1, %bpl
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d3ec
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x1d3ec
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x1d3f9
movq %r14, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x1ecd4
movq %r15, %rdi
callq 0x22d0