// File: cannam[P]mini-cpp-convnet/flower.cpp
// Function: classify(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&)
vector<float>
classify(const vector<vector<vector<float>>> &image)
{
    vector<vector<vector<float>>> t;

    t = zeroPad(image, 1, 1);
    t = convolve(t, weights_firstConv, biases_firstConv);
    t = activation(t, "relu");
    t = maxPool(t, 2, 2);

    t = zeroPad(t, 1, 1);
    t = convolve(t, weights_secondConv, biases_secondConv);
    t = activation(t, "relu");
    t = maxPool(t, 2, 2);

    t = zeroPad(t, 1, 1);
    t = convolve(t, weights_thirdConv, biases_thirdConv);
    t = activation(t, "relu");
    t = maxPool(t, 2, 2);

    t = zeroPad(t, 1, 1);
    t = convolve(t, weights_fourthConv, biases_fourthConv);
    t = activation(t, "relu");
    t = maxPool(t, 2, 2);

    vector<float> flat = flatten(t);
    
    flat = dense(flat, weights_firstDense, biases_firstDense);
    flat = activation(flat, "relu");

    flat = dense(flat, weights_labeller, biases_labeller);
    flat = activation(flat, "softmax");

    return flat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp            # imm = 0x450
movq %rdi, -0x320(%rbp)
movq %rdi, %rax
movq %rax, -0x318(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4afb0
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movl $0x1, %ecx
movq %rcx, %rdx
callq 0x47dc0
jmp 0x48e64
leaq -0x28(%rbp), %rdi
movq %rdi, -0x328(%rbp)
leaq -0x40(%rbp), %rsi
movq %rsi, -0x330(%rbp)
callq 0x4afd0
movq -0x330(%rbp), %rdi
callq 0x4ab80
movq -0x328(%rbp), %rsi
leaq 0xa0397(%rip), %rdx     # 0xe9230
leaq 0xa03a8(%rip), %rcx     # 0xe9248
leaq -0x68(%rbp), %rdi
callq 0x471c0
jmp 0x48eab
leaq -0x28(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movq %rsi, -0x340(%rbp)
callq 0x4afd0
movq -0x340(%rbp), %rdi
callq 0x4ab80
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x33c0
movq -0x338(%rbp), %rdx
leaq 0xa258(%rip), %rsi      # 0x53144
leaq -0xa0(%rbp), %rdi
callq 0x4b000
jmp 0x48efa
leaq -0x80(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x48820
jmp 0x48f10
leaq -0x28(%rbp), %rdi
movq %rdi, -0x348(%rbp)
leaq -0x80(%rbp), %rsi
movq %rsi, -0x350(%rbp)
callq 0x4afd0
movq -0x350(%rbp), %rdi
callq 0x4ab80
leaq -0xa0(%rbp), %rdi
callq 0x3180
leaq -0xa1(%rbp), %rdi
callq 0x32b0
movq -0x348(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x478c0
jmp 0x48f6c
leaq -0x28(%rbp), %rdi
movq %rdi, -0x358(%rbp)
leaq -0xc0(%rbp), %rsi
movq %rsi, -0x360(%rbp)
callq 0x4afd0
movq -0x360(%rbp), %rdi
callq 0x4ab80
movq -0x358(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movl $0x1, %ecx
movq %rcx, %rdx
callq 0x47dc0
jmp 0x48fb3
leaq -0x28(%rbp), %rdi
movq %rdi, -0x368(%rbp)
leaq -0xd8(%rbp), %rsi
movq %rsi, -0x370(%rbp)
callq 0x4afd0
movq -0x370(%rbp), %rdi
callq 0x4ab80
movq -0x368(%rbp), %rsi
leaq 0xa0275(%rip), %rdx     # 0xe9260
leaq 0xa0286(%rip), %rcx     # 0xe9278
leaq -0xf0(%rbp), %rdi
callq 0x471c0
jmp 0x49000
leaq -0x28(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
movq %rsi, -0x380(%rbp)
callq 0x4afd0
movq -0x380(%rbp), %rdi
callq 0x4ab80
leaq -0x129(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x33c0
movq -0x378(%rbp), %rdx
leaq 0xa100(%rip), %rsi      # 0x53144
leaq -0x128(%rbp), %rdi
callq 0x4b000
jmp 0x49052
leaq -0x108(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0x48820
jmp 0x4906b
leaq -0x28(%rbp), %rdi
movq %rdi, -0x388(%rbp)
leaq -0x108(%rbp), %rsi
movq %rsi, -0x390(%rbp)
callq 0x4afd0
movq -0x390(%rbp), %rdi
callq 0x4ab80
leaq -0x128(%rbp), %rdi
callq 0x3180
leaq -0x129(%rbp), %rdi
callq 0x32b0
movq -0x388(%rbp), %rsi
leaq -0x148(%rbp), %rdi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x478c0
jmp 0x490ca
leaq -0x28(%rbp), %rdi
movq %rdi, -0x398(%rbp)
leaq -0x148(%rbp), %rsi
movq %rsi, -0x3a0(%rbp)
callq 0x4afd0
movq -0x3a0(%rbp), %rdi
callq 0x4ab80
movq -0x398(%rbp), %rsi
leaq -0x160(%rbp), %rdi
movl $0x1, %ecx
movq %rcx, %rdx
callq 0x47dc0
jmp 0x49111
leaq -0x28(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
leaq -0x160(%rbp), %rsi
movq %rsi, -0x3b0(%rbp)
callq 0x4afd0
movq -0x3b0(%rbp), %rdi
callq 0x4ab80
movq -0x3a8(%rbp), %rsi
leaq 0xa0147(%rip), %rdx     # 0xe9290
leaq 0xa0158(%rip), %rcx     # 0xe92a8
leaq -0x178(%rbp), %rdi
callq 0x471c0
jmp 0x4915e
leaq -0x28(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movq %rsi, -0x3c0(%rbp)
callq 0x4afd0
movq -0x3c0(%rbp), %rdi
callq 0x4ab80
leaq -0x1b1(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x33c0
movq -0x3b8(%rbp), %rdx
leaq 0x9fa2(%rip), %rsi      # 0x53144
leaq -0x1b0(%rbp), %rdi
callq 0x4b000
jmp 0x491b0
leaq -0x190(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
callq 0x48820
jmp 0x491c9
leaq -0x28(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
leaq -0x190(%rbp), %rsi
movq %rsi, -0x3d0(%rbp)
callq 0x4afd0
movq -0x3d0(%rbp), %rdi
callq 0x4ab80
leaq -0x1b0(%rbp), %rdi
callq 0x3180
leaq -0x1b1(%rbp), %rdi
callq 0x32b0
movq -0x3c8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x478c0
jmp 0x49228
leaq -0x28(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
leaq -0x1d0(%rbp), %rsi
movq %rsi, -0x3e0(%rbp)
callq 0x4afd0
movq -0x3e0(%rbp), %rdi
callq 0x4ab80
movq -0x3d8(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
movl $0x1, %ecx
movq %rcx, %rdx
callq 0x47dc0
jmp 0x4926f
leaq -0x28(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
leaq -0x1e8(%rbp), %rsi
movq %rsi, -0x3f0(%rbp)
callq 0x4afd0
movq -0x3f0(%rbp), %rdi
callq 0x4ab80
movq -0x3e8(%rbp), %rsi
leaq 0xa0019(%rip), %rdx     # 0xe92c0
leaq 0xa002a(%rip), %rcx     # 0xe92d8
leaq -0x200(%rbp), %rdi
callq 0x471c0
jmp 0x492bc
leaq -0x28(%rbp), %rdi
leaq -0x200(%rbp), %rsi
movq %rsi, -0x400(%rbp)
callq 0x4afd0
movq -0x400(%rbp), %rdi
callq 0x4ab80
leaq -0x239(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
callq 0x33c0
movq -0x3f8(%rbp), %rdx
leaq 0x9e44(%rip), %rsi      # 0x53144
leaq -0x238(%rbp), %rdi
callq 0x4b000
jmp 0x4930e
leaq -0x218(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x238(%rbp), %rdx
callq 0x48820
jmp 0x49327
leaq -0x28(%rbp), %rdi
movq %rdi, -0x408(%rbp)
leaq -0x218(%rbp), %rsi
movq %rsi, -0x410(%rbp)
callq 0x4afd0
movq -0x410(%rbp), %rdi
callq 0x4ab80
leaq -0x238(%rbp), %rdi
callq 0x3180
leaq -0x239(%rbp), %rdi
callq 0x32b0
movq -0x408(%rbp), %rsi
leaq -0x258(%rbp), %rdi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x478c0
jmp 0x49386
leaq -0x28(%rbp), %rdi
movq %rdi, -0x418(%rbp)
leaq -0x258(%rbp), %rsi
movq %rsi, -0x420(%rbp)
callq 0x4afd0
movq -0x420(%rbp), %rdi
callq 0x4ab80
movq -0x320(%rbp), %rdi
movq -0x418(%rbp), %rsi
movb $0x0, -0x259(%rbp)
callq 0x481c0
jmp 0x493cc
movq -0x320(%rbp), %rsi
leaq 0x9ff16(%rip), %rdx     # 0xe92f0
leaq 0x9ff27(%rip), %rcx     # 0xe9308
leaq -0x278(%rbp), %rdi
callq 0x48460
jmp 0x493ef
movq -0x320(%rbp), %rdi
leaq -0x278(%rbp), %rsi
movq %rsi, -0x430(%rbp)
callq 0x4b0b0
movq -0x430(%rbp), %rdi
callq 0x4aa80
leaq -0x2b1(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x33c0
movq -0x428(%rbp), %rdx
leaq 0x9d0e(%rip), %rsi      # 0x53144
leaq -0x2b0(%rbp), %rdi
callq 0x4b000
jmp 0x49444
movq -0x320(%rbp), %rsi
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rdx
callq 0x48b10
jmp 0x49460
movq -0x320(%rbp), %rdi
leaq -0x290(%rbp), %rsi
movq %rsi, -0x438(%rbp)
callq 0x4b0b0
movq -0x438(%rbp), %rdi
callq 0x4aa80
leaq -0x2b0(%rbp), %rdi
callq 0x3180
leaq -0x2b1(%rbp), %rdi
callq 0x32b0
movq -0x320(%rbp), %rsi
leaq 0x9fe74(%rip), %rdx     # 0xe9320
leaq 0x9fe85(%rip), %rcx     # 0xe9338
leaq -0x2d0(%rbp), %rdi
callq 0x48460
jmp 0x494c1
movq -0x320(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
movq %rsi, -0x448(%rbp)
callq 0x4b0b0
movq -0x448(%rbp), %rdi
callq 0x4aa80
leaq -0x309(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x33c0
movq -0x440(%rbp), %rdx
leaq 0x9c5f(%rip), %rsi      # 0x53167
leaq -0x308(%rbp), %rdi
callq 0x4b000
jmp 0x49516
movq -0x320(%rbp), %rsi
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rdx
callq 0x48b10
jmp 0x49532
movq -0x320(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x4b0b0
leaq -0x2e8(%rbp), %rdi
callq 0x4aa80
leaq -0x308(%rbp), %rdi
callq 0x3180
leaq -0x309(%rbp), %rdi
callq 0x32b0
movb $0x1, -0x259(%rbp)
testb $0x1, -0x259(%rbp)
jne 0x496f4
jmp 0x496e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x495b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3180
leaq -0xa1(%rbp), %rdi
callq 0x32b0
jmp 0x49719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x495f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x3180
leaq -0x129(%rbp), %rdi
callq 0x32b0
jmp 0x49719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49627
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x3180
leaq -0x1b1(%rbp), %rdi
callq 0x32b0
jmp 0x49719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4965e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x3180
leaq -0x239(%rbp), %rdi
callq 0x32b0
jmp 0x49719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4970d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x496a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x3180
leaq -0x2b1(%rbp), %rdi
callq 0x32b0
jmp 0x4970d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x496da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x3180
leaq -0x309(%rbp), %rdi
callq 0x32b0
jmp 0x4970d
movq -0x320(%rbp), %rdi
callq 0x4aa80
leaq -0x28(%rbp), %rdi
callq 0x4ab80
movq -0x318(%rbp), %rax
addq $0x450, %rsp            # imm = 0x450
popq %rbp
retq
movq -0x320(%rbp), %rdi
callq 0x4aa80
leaq -0x28(%rbp), %rdi
callq 0x4ab80
movq -0x48(%rbp), %rdi
callq 0x33b0
nopl (%rax,%rax)