// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/network.c
// Function: get_current_rate
float get_current_rate(network *net)
{
    size_t batch_num = get_current_batch(net);
    int i;
    float rate;
    if (batch_num < net->burn_in) return net->learning_rate * pow((float)batch_num / net->burn_in, net->power);
    switch (net->policy) {
        case CONSTANT:
            return net->learning_rate;
        case STEP:
            return net->learning_rate * pow(net->scale, batch_num/net->step);
        case STEPS:
            rate = net->learning_rate;
            for(i = 0; i < net->num_steps; ++i){
                if(net->steps[i] > batch_num) return rate;
                rate *= net->scales[i];
            }
            return rate;
        case EXP:
            return net->learning_rate * pow(net->gamma, batch_num);
        case POLY:
            return net->learning_rate * pow(1 - (float)batch_num / net->max_batches, net->power);
        case RANDOM:
            return net->learning_rate * pow(rand_uniform(0,1), net->power);
        case SIG:
            return net->learning_rate * (1./(1.+exp(net->gamma*(batch_num - net->step))));
        default:
            fprintf(stderr, "Policy is weird!\n");
            return net->learning_rate;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rax
movslq 0x4(%rdi), %rcx
movslq 0x1c(%rdi), %rsi
imulq %rcx, %rsi
xorl %edx, %edx
divq %rsi
movslq 0x6c(%rdi), %rcx
cmpq %rcx, %rax
jae 0x31758
cvtss2sd 0x34(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
testq %rax, %rax
js 0x3177c
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x31794
movl 0x30(%rbx), %ecx
cmpq $0x6, %rcx
ja 0x31924
leaq 0x27484(%rip), %rdx     # 0x58bf0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movss 0x34(%rbx), %xmm0
jmp 0x317b7
movq %rax, %rdx
shrq %rdx
andl $0x1, %eax
orq %rdx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %ecx, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x48(%rbx), %xmm1
callq 0x3110
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
addq $0x10, %rsp
popq %rbx
retq
movss 0x34(%rbx), %xmm0
movslq 0x68(%rbx), %rcx
testq %rcx, %rcx
jle 0x317b7
movq 0x60(%rbx), %rdx
xorl %esi, %esi
movslq (%rdx,%rsi,4), %rdi
cmpq %rdi, %rax
jb 0x317b7
movq 0x58(%rbx), %rdi
mulss (%rdi,%rsi,4), %xmm0
incq %rsi
cmpq %rsi, %rcx
jne 0x317d1
jmp 0x317b7
cvtss2sd 0x34(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rbx), %xmm0
jmp 0x3183f
cvtss2sd 0x34(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
testq %rax, %rax
js 0x318a3
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x318bb
cvtss2sd 0x34(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x44(%rbx), %xmm0
movslq 0x50(%rbx), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %xmm2
punpckldq 0x27384(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x2738c(%rip), %xmm2    # 0x58be0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
jmp 0x317a8
cvtss2sd 0x34(%rbx), %xmm0
movslq 0x50(%rbx), %rcx
subq %rcx, %rax
movsd %xmm0, 0x8(%rsp)
js 0x318dc
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x318f4
cvtss2sd 0x34(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movss 0x23772(%rip), %xmm1    # 0x55008
xorps %xmm0, %xmm0
callq 0xfa10
jmp 0x3179c
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
cvtsi2ssl 0x54(%rbx), %xmm1
divss %xmm1, %xmm0
movss 0x2373c(%rip), %xmm1    # 0x55008
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
jmp 0x317a0
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
mulss 0x40(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x34d0
movsd 0x23846(%rip), %xmm1    # 0x55150
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
jmp 0x317b7
movq 0x3a6cd(%rip), %rax     # 0x6bff8
movq (%rax), %rcx
leaq 0x273ab(%rip), %rdi     # 0x58ce0
movl $0x11, %esi
movl $0x1, %edx
callq 0x3440
jmp 0x31775