// File: /workspace/github_cpp_makefile_star2_O3/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 0x1e80c
leaq 0x35bf(%rip), %rsi      # 0x20174
movq %r15, %rdi
callq 0x2080
testl %eax, %eax
jne 0x1cc71
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
je 0x1cc61
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 0x1cc59
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 0x1cc51
sarq $0x2, %r11
cmpq $0x1, %r11
adcq $0x0, %r11
xorl %r14d, %r14d
ucomiss (%r10,%r14,4), %xmm0
jbe 0x1cc49
movl $0x0, (%r10,%r14,4)
incq %r14
cmpq %r14, %r11
jne 0x1cc3a
incq %r9
cmpq %r8, %r9
jne 0x1cc19
incq %rsi
cmpq %rcx, %rsi
jne 0x1cbf4
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 0x34f4(%rip), %rsi      # 0x20179
movq %rsp, %rdi
movq %r15, %rdx
callq 0x1e8a5
leaq 0x34fe(%rip), %rsi      # 0x20195
movq %rsp, %rdi
callq 0x22f0
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1ccc2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x1cccf
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq 0x8(%rax), %rdx
leaq 0x20(%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 0x942f1(%rip), %rsi     # 0xb0ff0
movq 0x942aa(%rip), %rdx     # 0xb0fb0
movq %r14, %rdi
callq 0x22c0
movq %rax, %r15
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1cd28
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cd43
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
testb %bpl, %bpl
jne 0x1cd6d
jmp 0x1cd75
movq %rax, %r15
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cd6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x1cd6d
movq %rax, %r15
movq %r14, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x1e7c4
movq %r15, %rdi
callq 0x22d0