// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/darknet.c
// Function: numops
long numops(network *net)
{
    int i;
    long ops = 0;
    for(i = 0; i < net->n; ++i){
        layer l = net->layers[i];
        if(l.type == CONVOLUTIONAL){
            ops += 2l * l.n * l.size*l.size*l.c/l.groups * l.out_h*l.out_w;
        } else if(l.type == CONNECTED){
            ops += 2l * l.inputs * l.outputs;
        } else if (l.type == RNN){
            ops += 2l * l.input_layer->inputs * l.input_layer->outputs;
            ops += 2l * l.self_layer->inputs * l.self_layer->outputs;
            ops += 2l * l.output_layer->inputs * l.output_layer->outputs;
        } else if (l.type == GRU){
            ops += 2l * l.uz->inputs * l.uz->outputs;
            ops += 2l * l.uh->inputs * l.uh->outputs;
            ops += 2l * l.ur->inputs * l.ur->outputs;
            ops += 2l * l.wz->inputs * l.wz->outputs;
            ops += 2l * l.wh->inputs * l.wh->outputs;
            ops += 2l * l.wr->inputs * l.wr->outputs;
        } else if (l.type == LSTM){
            ops += 2l * l.uf->inputs * l.uf->outputs;
            ops += 2l * l.ui->inputs * l.ui->outputs;
            ops += 2l * l.ug->inputs * l.ug->outputs;
            ops += 2l * l.uo->inputs * l.uo->outputs;
            ops += 2l * l.wf->inputs * l.wf->outputs;
            ops += 2l * l.wi->inputs * l.wi->outputs;
            ops += 2l * l.wg->inputs * l.wg->outputs;
            ops += 2l * l.wo->inputs * l.wo->outputs;
        }
    }
    return ops;
}

// Assembly:
movslq (%rdi), %rax
testq %rax, %rax
jle 0x52df9
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x20(%rdi), %rsi
imulq $0x4a0, %rax, %rdi      # imm = 0x4A0
xorl %r8d, %r8d
xorl %ecx, %ecx
movl (%rsi,%r8), %eax
cmpl $0xe, %eax
jle 0x52c9a
cmpl $0xf, %eax
je 0x52cc2
cmpl $0x10, %eax
je 0x52d0d
cmpl $0x11, %eax
jne 0x52de0
movq 0x488(%rsi,%r8), %rdx
movq 0x480(%rsi,%r8), %r10
movq 0x478(%rsi,%r8), %r9
movq 0x470(%rsi,%r8), %r11
movq 0x468(%rsi,%r8), %rbx
movq 0x460(%rsi,%r8), %r14
movq 0x450(%rsi,%r8), %r15
movq 0x458(%rsi,%r8), %rax
movslq 0x54(%r14), %r12
movslq 0x58(%r14), %r14
imulq %r12, %r14
movslq 0x54(%r11), %r12
movslq 0x58(%r11), %r11
imulq %r12, %r11
addq %r14, %r11
movslq 0x54(%r10), %r14
movslq 0x58(%r10), %r10
imulq %r14, %r10
movslq 0x54(%r15), %r14
movslq 0x58(%r15), %r15
imulq %r14, %r15
addq %r10, %r15
addq %r11, %r15
movslq 0x54(%rbx), %r10
movslq 0x58(%rbx), %r11
imulq %r10, %r11
movslq 0x54(%r9), %r10
movslq 0x58(%r9), %r9
imulq %r10, %r9
addq %r11, %r9
movslq 0x54(%rdx), %r10
movslq 0x58(%rdx), %rdx
imulq %r10, %rdx
addq %r9, %rdx
addq %r15, %rdx
movslq 0x54(%rax), %r9
movslq 0x58(%rax), %rax
imulq %r9, %rax
addq %rdx, %rax
jmp 0x52d04
testl %eax, %eax
je 0x52d9a
cmpl $0x2, %eax
jne 0x52de0
movslq 0x58(%rsi,%r8), %rax
movslq 0x54(%rsi,%r8), %rdx
imulq %rax, %rdx
leaq (%rcx,%rdx,2), %rcx
jmp 0x52de0
movq 0x3a0(%rsi,%r8), %rax
movq 0x390(%rsi,%r8), %rdx
movq 0x398(%rsi,%r8), %r9
movslq 0x54(%rdx), %r10
movslq 0x58(%rdx), %rdx
imulq %r10, %rdx
movslq 0x54(%r9), %r10
movslq 0x58(%r9), %r9
imulq %r10, %r9
addq %rdx, %r9
movslq 0x54(%rax), %rdx
movslq 0x58(%rax), %rax
imulq %rdx, %rax
addq %r9, %rax
leaq (%rcx,%rax,2), %rcx
jmp 0x52de0
movq 0x448(%rsi,%r8), %rax
movq 0x440(%rsi,%r8), %rdx
movq 0x438(%rsi,%r8), %r9
movq 0x430(%rsi,%r8), %r10
movq 0x420(%rsi,%r8), %r11
movq 0x428(%rsi,%r8), %rbx
movslq 0x54(%rbx), %r14
movslq 0x58(%rbx), %rbx
imulq %r14, %rbx
movslq 0x54(%rax), %r14
movslq 0x58(%rax), %rax
imulq %r14, %rax
addq %rbx, %rax
movslq 0x54(%r9), %rbx
movslq 0x58(%r9), %r9
imulq %rbx, %r9
movslq 0x54(%r11), %rbx
movslq 0x58(%r11), %r11
imulq %rbx, %r11
addq %r9, %r11
addq %rax, %r11
movslq 0x54(%rdx), %rax
movslq 0x58(%rdx), %rdx
imulq %rax, %rdx
movslq 0x54(%r10), %rax
movslq 0x58(%r10), %r9
imulq %rax, %r9
addq %rdx, %r9
addq %r11, %r9
leaq (%rcx,%r9,2), %rcx
jmp 0x52de0
movslq 0x90(%rsi,%r8), %rax
movslq 0x8c(%rsi,%r8), %r9
movslq 0x84(%rsi,%r8), %rdx
movslq 0x7c(%rsi,%r8), %r10
movslq 0x78(%rsi,%r8), %r11
movslq 0x74(%rsi,%r8), %rbx
imulq %rdx, %rbx
imulq %rax, %rax
imulq %rbx, %rax
addq %rax, %rax
cqto
idivq %r9
imulq %r10, %r11
imulq %rax, %r11
addq %r11, %rcx
addq $0x4a0, %r8             # imm = 0x4A0
cmpq %r8, %rdi
jne 0x52bbb
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x52dfb
xorl %ecx, %ecx
movq %rcx, %rax
retq