// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/darknet.c
// Function: normalize_net
void normalize_net(char *cfgfile, char *weightfile, char *outfile)
{
    gpu_index = -1;
    network *net = load_network(cfgfile, weightfile, 0);
    int i;
    for(i = 0; i < net->n; ++i){
        layer l = net->layers[i];
        if(l.type == CONVOLUTIONAL && !l.batch_normalize){
            net->layers[i] = normalize_layer(l, l.n);
        }
        if (l.type == CONNECTED && !l.batch_normalize) {
            net->layers[i] = normalize_layer(l, l.outputs);
        }
        if (l.type == GRU && l.batch_normalize) {
            *l.input_z_layer = normalize_layer(*l.input_z_layer, l.input_z_layer->outputs);
            *l.input_r_layer = normalize_layer(*l.input_r_layer, l.input_r_layer->outputs);
            *l.input_h_layer = normalize_layer(*l.input_h_layer, l.input_h_layer->outputs);
            *l.state_z_layer = normalize_layer(*l.state_z_layer, l.state_z_layer->outputs);
            *l.state_r_layer = normalize_layer(*l.state_r_layer, l.state_r_layer->outputs);
            *l.state_h_layer = normalize_layer(*l.state_h_layer, l.state_h_layer->outputs);
            net->layers[i].batch_normalize=1;
        }
    }
    save_weights(net, outfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1528, %rsp           # imm = 0x1528
movq %rdx, 0x508(%rsp)
leaq 0x1936f(%rip), %rax     # 0x6a7c0
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %rbp
cmpl $0x0, (%rax)
jle 0x51cd5
xorl %ecx, %ecx
movq %rbp, 0x4c8(%rsp)
movq 0x20(%rbp), %r15
movq %rcx, 0x518(%rsp)
imulq $0x4a0, %rcx, %rbx      # imm = 0x4A0
leaq (%r15,%rbx), %r12
addq $0x88, %r12
movl -0x88(%r12), %eax
movl %eax, 0x4a8(%rsp)
movups -0x58(%r12), %xmm0
movups %xmm0, 0x67c(%rsp)
movups -0x64(%r12), %xmm0
movaps %xmm0, 0x670(%rsp)
movups -0x74(%r12), %xmm0
movaps %xmm0, 0x660(%rsp)
movups -0x84(%r12), %xmm0
movaps %xmm0, 0x650(%rsp)
movl -0x48(%r12), %ebp
movl -0x34(%r12), %eax
movl %eax, 0x550(%rsp)
movups -0x44(%r12), %xmm0
movaps %xmm0, 0x540(%rsp)
movl -0x30(%r12), %r13d
movups -0x1c(%r12), %xmm0
movaps %xmm0, 0x5c0(%rsp)
movq -0xc(%r12), %rax
movq %rax, 0x5d0(%rsp)
movups -0x2c(%r12), %xmm0
movaps %xmm0, 0x5b0(%rsp)
movl -0x4(%r12), %eax
movq %rax, 0x4d0(%rsp)
movl $0x1b8, %edx            # imm = 0x1B8
leaq 0xd18(%rsp), %rdi
movq %r12, %rsi
callq 0x32c0
leaq (%r15,%rbx), %rsi
addq $0x248, %rsi            # imm = 0x248
movl $0xd, %ecx
leaq 0x738(%rsp), %rdi
movq %rsi, 0x4c0(%rsp)
rep  movsq (%rsi), %es:(%rdi)
leaq 0x2c0(%r15,%rbx), %r14
movl $0x130, %edx            # imm = 0x130
leaq 0xab8(%rsp), %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x130(%r14), %rax
movq %rax, 0x4d8(%rsp)
movq 0x138(%r14), %rax
movq %rax, 0x4f0(%rsp)
movq 0x140(%r14), %rax
movq %rax, 0x4e0(%rsp)
movq 0x148(%r14), %rax
movq %rax, 0x4f8(%rsp)
movq 0x150(%r14), %rax
movq %rax, 0x4e8(%rsp)
movq 0x158(%r14), %rax
movq %rax, 0x500(%rsp)
movq %rbx, 0x4b0(%rsp)
leaq 0x420(%r15,%rbx), %rdx
movl $0x10, %ecx
leaq 0x888(%rsp), %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x4a8(%rsp), %ecx
movl %ecx, %eax
movl %ebp, 0x4a4(%rsp)
orl %ebp, %eax
movq 0x4c8(%rsp), %rbp
jne 0x5196f
movq 0x4b0(%rsp), %rax
leaq (%r15,%rax), %rbx
addq $0x4, %rbx
movslq 0x4d0(%rsp), %rax
movq %rax, 0x4b8(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x2c(%rbx), %xmm3
movups %xmm3, 0x6bc(%rsp)
movaps %xmm2, 0x6b0(%rsp)
movaps %xmm1, 0x6a0(%rsp)
movaps %xmm0, 0x690(%rsp)
movups 0x40(%rbx), %xmm0
movaps %xmm0, 0x560(%rsp)
movl 0x50(%rbx), %eax
movl %eax, 0x570(%rsp)
movups 0x58(%rbx), %xmm0
movups 0x68(%rbx), %xmm1
movaps %xmm0, 0x5e0(%rsp)
movaps %xmm1, 0x5f0(%rsp)
movq 0x78(%rbx), %rax
movq %rax, 0x600(%rsp)
movq %rdx, %rbp
movl $0x1b8, %edx            # imm = 0x1B8
leaq 0xed0(%rsp), %rdi
movq %r12, %rsi
callq 0x32c0
movl $0xd, %ecx
leaq 0x7a0(%rsp), %rdi
movq 0x4c0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x130, %edx            # imm = 0x130
leaq 0xbe8(%rsp), %rdi
movq %r14, %rsi
movq 0x4b8(%rsp), %r14
callq 0x32c0
movl $0x10, %ecx
leaq 0x908(%rsp), %rdi
movq %rbp, 0x4c0(%rsp)
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq 0x4d0(%rsp), %rcx
movq %rax, %rbp
testl %r14d, %r14d
jle 0x51748
xorl %eax, %eax
movl $0x3f800000, (%rbp,%rax,4) # imm = 0x3F800000
incq %rax
cmpq %rax, %rcx
jne 0x51738
addq 0x4b0(%rsp), %r15
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq %rax, 0x510(%rsp)
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq %rax, 0x4b8(%rsp)
movaps 0x690(%rsp), %xmm0
movaps 0x6a0(%rsp), %xmm1
movaps 0x6b0(%rsp), %xmm2
movaps %xmm0, 0x610(%rsp)
movaps %xmm1, 0x620(%rsp)
movaps %xmm2, 0x630(%rsp)
movups 0x6bc(%rsp), %xmm0
movups %xmm0, 0x63c(%rsp)
movaps 0x560(%rsp), %xmm0
movaps %xmm0, 0x520(%rsp)
movl 0x570(%rsp), %eax
movl %eax, 0x530(%rsp)
movaps 0x5e0(%rsp), %xmm0
movaps 0x5f0(%rsp), %xmm1
movaps %xmm0, 0x580(%rsp)
movaps %xmm1, 0x590(%rsp)
movq 0x600(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movl $0x1b8, %edx            # imm = 0x1B8
leaq 0x1370(%rsp), %r14
movq %r14, %rdi
leaq 0xed0(%rsp), %rsi
callq 0x32c0
movl $0xd, %ecx
leaq 0x6d0(%rsp), %rdi
leaq 0x7a0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x130, %edx            # imm = 0x130
leaq 0x988(%rsp), %rdi
leaq 0xbe8(%rsp), %rsi
callq 0x32c0
movl $0x10, %ecx
leaq 0x808(%rsp), %rdi
leaq 0x908(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movups 0x63c(%rsp), %xmm0
movups %xmm0, 0x2c(%rbx)
movaps 0x610(%rsp), %xmm0
movaps 0x620(%rsp), %xmm1
movaps 0x630(%rsp), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x1, 0x40(%r15)
movl 0x530(%rsp), %eax
movl %eax, 0x50(%rbx)
movaps 0x520(%rsp), %xmm0
movups %xmm0, 0x40(%rbx)
movq 0x5a0(%rsp), %rax
movq %rax, 0x78(%rbx)
movaps 0x580(%rsp), %xmm0
movaps 0x590(%rsp), %xmm1
movups %xmm1, 0x68(%rbx)
movups %xmm0, 0x58(%rbx)
movl $0x1b8, %edx            # imm = 0x1B8
movq %r12, %rdi
movq %r14, %rsi
callq 0x32c0
movq %rbp, 0x240(%r15)
leaq 0x248(%r15), %rdi
movl $0xd, %ecx
leaq 0x6d0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x510(%rsp), %rax
movq %rax, 0x2b0(%r15)
movq 0x4b8(%rsp), %rax
movq %rax, 0x2b8(%r15)
addq $0x2c0, %r15            # imm = 0x2C0
movl $0x130, %edx            # imm = 0x130
movq %r15, %rdi
leaq 0x988(%rsp), %rsi
callq 0x32c0
movl $0x10, %ecx
movq 0x4c0(%rsp), %rdi
leaq 0x808(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x4c8(%rsp), %rbp
movl 0x4a8(%rsp), %ecx
movl %ecx, %eax
xorl $0x2, %eax
orl 0x4a4(%rsp), %eax
jne 0x51b53
movl %ecx, %r12d
movslq %r13d, %r14
movq 0x20(%rbp), %r15
addq 0x4b0(%rsp), %r15
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq %rax, %rbx
testl %r14d, %r14d
jle 0x519b9
xorl %eax, %eax
movl $0x3f800000, (%rbx,%rax,4) # imm = 0x3F800000
incq %rax
cmpq %rax, %r13
jne 0x519aa
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq %rax, 0x4a8(%rsp)
movl $0x4, %esi
movq %r14, %rdi
callq 0x3260
movq %rax, %rbp
movl %r12d, (%r15)
movaps 0x650(%rsp), %xmm0
movaps 0x660(%rsp), %xmm1
movaps 0x670(%rsp), %xmm2
movups %xmm0, 0x4(%r15)
movups %xmm1, 0x14(%r15)
movups %xmm2, 0x24(%r15)
movups 0x67c(%rsp), %xmm0
movups %xmm0, 0x30(%r15)
movl $0x1, 0x40(%r15)
movl 0x550(%rsp), %eax
movl %eax, 0x54(%r15)
movaps 0x540(%rsp), %xmm0
movups %xmm0, 0x44(%r15)
movl %r14d, 0x58(%r15)
movaps 0x5b0(%rsp), %xmm0
movaps 0x5c0(%rsp), %xmm1
movups %xmm0, 0x5c(%r15)
movups %xmm1, 0x6c(%r15)
movq 0x5d0(%rsp), %rax
movq %rax, 0x7c(%r15)
movq 0x4d0(%rsp), %rax
movl %eax, 0x84(%r15)
leaq 0x88(%r15), %rdi
movl $0x1b8, %edx            # imm = 0x1B8
leaq 0xd18(%rsp), %rsi
callq 0x32c0
movq %rbx, 0x240(%r15)
leaq 0x248(%r15), %rdi
movl $0xd, %ecx
leaq 0x738(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x4a8(%rsp), %rax
movq %rax, 0x2b0(%r15)
movq %rbp, 0x2b8(%r15)
leaq 0x2c0(%r15), %rdi
movl $0x130, %edx            # imm = 0x130
leaq 0xab8(%rsp), %rsi
callq 0x32c0
movq 0x4d8(%rsp), %rax
movq %rax, 0x3f0(%r15)
movq 0x4f0(%rsp), %rax
movq %rax, 0x3f8(%r15)
movq 0x4e0(%rsp), %rax
movq %rax, 0x400(%r15)
movq 0x4f8(%rsp), %rax
movq %rax, 0x408(%r15)
movq 0x4e8(%rsp), %rax
movq %rax, 0x410(%r15)
movq 0x500(%rsp), %rax
movq %rax, 0x418(%r15)
addq $0x420, %r15            # imm = 0x420
movl $0x10, %ecx
movq %r15, %rdi
leaq 0x888(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r12d, %ecx
movq 0x4c8(%rsp), %rbp
cmpl $0x0, 0x4a4(%rsp)
setne %al
cmpl $0x10, %ecx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x51cbd
movq 0x4d8(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xed0(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x4e0(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x4e8(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x4f0(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x4f8(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x500(%rsp), %rbx
movl 0x58(%rbx), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl %eax, %esi
callq 0x513a3
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x20(%rbp), %rax
movq 0x4b0(%rsp), %rcx
movl $0x1, 0x40(%rax,%rcx)
movq 0x518(%rsp), %rcx
incq %rcx
movslq (%rbp), %rax
cmpq %rax, %rcx
jl 0x51474
movq %rbp, %rdi
movq 0x508(%rsp), %rsi
addq $0x1528, %rsp           # imm = 0x1528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66cd