// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl (%rdi), %eax
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
imulq $0x4a0, %rax, %r8       # imm = 0x4A0
xorl %ecx, %ecx
cmpq %rsi, %r8
je 0x4a1db
movq 0x20(%rdi), %rdx
movl (%rdx,%rsi), %eax
cmpl $0x11, %eax
je 0x4a114
cmpl $0x2, %eax
je 0x4a026
cmpl $0xf, %eax
je 0x4a0cd
cmpl $0x10, %eax
je 0x4a03d
testl %eax, %eax
jne 0x4a1cf
movslq 0x90(%rdx,%rsi), %rax
movslq 0x8c(%rdx,%rsi), %r9
movslq 0x84(%rdx,%rsi), %r10
movslq 0x7c(%rdx,%rsi), %r11
movslq 0x78(%rdx,%rsi), %rbx
movslq 0x74(%rdx,%rsi), %rdx
imulq %r10, %rdx
imulq %rax, %rax
imulq %rdx, %rax
addq %rax, %rax
cqto
idivq %r9
imulq %r11, %rbx
imulq %rax, %rbx
addq %rbx, %rcx
jmp 0x4a1cf
movslq 0x58(%rdx,%rsi), %rax
movslq 0x54(%rdx,%rsi), %rdx
imulq %rax, %rdx
leaq (%rcx,%rdx,2), %rcx
jmp 0x4a1cf
movq 0x448(%rdx,%rsi), %rax
movq 0x440(%rdx,%rsi), %r9
movq 0x438(%rdx,%rsi), %r10
movq 0x430(%rdx,%rsi), %r11
movq 0x420(%rdx,%rsi), %rbx
movq 0x428(%rdx,%rsi), %rdx
movslq 0x54(%rdx), %r14
movslq 0x58(%rdx), %rdx
imulq %r14, %rdx
movslq 0x54(%rax), %r14
movslq 0x58(%rax), %rax
imulq %r14, %rax
addq %rdx, %rax
movslq 0x54(%r10), %rdx
movslq 0x58(%r10), %r10
imulq %rdx, %r10
movslq 0x54(%rbx), %rdx
movslq 0x58(%rbx), %rbx
imulq %rdx, %rbx
addq %r10, %rbx
addq %rax, %rbx
movslq 0x54(%r9), %rax
movslq 0x58(%r9), %rdx
imulq %rax, %rdx
movslq 0x54(%r11), %rax
movslq 0x58(%r11), %r9
imulq %rax, %r9
addq %rdx, %r9
addq %rbx, %r9
leaq (%rcx,%r9,2), %rcx
jmp 0x4a1cf
movq 0x3a0(%rdx,%rsi), %rax
movq 0x390(%rdx,%rsi), %r9
movq 0x398(%rdx,%rsi), %rdx
movslq 0x54(%r9), %r10
movslq 0x58(%r9), %r9
imulq %r10, %r9
movslq 0x54(%rdx), %r10
movslq 0x58(%rdx), %rdx
imulq %r10, %rdx
addq %r9, %rdx
movslq 0x54(%rax), %r9
movslq 0x58(%rax), %rax
imulq %r9, %rax
addq %rdx, %rax
jmp 0x4a1cb
movq 0x488(%rdx,%rsi), %r9
movq 0x480(%rdx,%rsi), %r11
movq 0x478(%rdx,%rsi), %r10
movq 0x470(%rdx,%rsi), %rbx
movq 0x468(%rdx,%rsi), %r14
movq 0x460(%rdx,%rsi), %r15
movq 0x450(%rdx,%rsi), %r12
movq 0x458(%rdx,%rsi), %rax
movslq 0x54(%r15), %rdx
movslq 0x58(%r15), %r15
imulq %rdx, %r15
movslq 0x54(%rbx), %rdx
movslq 0x58(%rbx), %rbx
imulq %rdx, %rbx
addq %r15, %rbx
movslq 0x54(%r11), %rdx
movslq 0x58(%r11), %r11
imulq %rdx, %r11
movslq 0x54(%r12), %rdx
movslq 0x58(%r12), %r15
imulq %rdx, %r15
addq %r11, %r15
addq %rbx, %r15
movslq 0x54(%r14), %rdx
movslq 0x58(%r14), %r11
imulq %rdx, %r11
movslq 0x54(%r10), %rdx
movslq 0x58(%r10), %r10
imulq %rdx, %r10
addq %r11, %r10
movslq 0x54(%r9), %rdx
movslq 0x58(%r9), %r9
imulq %rdx, %r9
addq %r10, %r9
addq %r15, %r9
movslq 0x54(%rax), %rdx
movslq 0x58(%rax), %rax
imulq %rdx, %rax
addq %r9, %rax
leaq (%rcx,%rax,2), %rcx
addq $0x4a0, %rsi            # imm = 0x4A0
jmp 0x49fa7
movq %rcx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
retq