// File: /workspace/github_c_makefile_star2_O2/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 $0xde8, %rsp            # imm = 0xDE8
movq %rdx, 0x4a0(%rsp)
leaq 0x19dbc(%rip), %rax     # 0x647c0
orl $-0x1, (%rax)
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
leaq 0x4a8(%rsp), %r15
leaq 0x948(%rsp), %r12
xorl %ebx, %ebx
movslq (%r14), %rax
cmpq %rax, %rbx
jge 0x4ac4a
movq 0x20(%r14), %r13
addq %rbp, %r13
movl $0x4a0, %edx            # imm = 0x4A0
movq %r15, %rdi
movq %r13, %rsi
callq 0x32b0
movl 0x4a8(%rsp), %ecx
movl 0x4e8(%rsp), %eax
movl %eax, %edx
orl %ecx, %edx
jne 0x4aa99
movl 0x52c(%rsp), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movl 0x4a8(%rsp), %ecx
movl 0x4e8(%rsp), %eax
movl %ecx, %edx
xorl $0x2, %edx
orl %eax, %edx
jne 0x4aae6
movq 0x20(%r14), %r13
addq %rbp, %r13
movl 0x500(%rsp), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movl 0x4a8(%rsp), %ecx
movl 0x4e8(%rsp), %eax
cmpl $0x10, %ecx
jne 0x4ac3b
testl %eax, %eax
je 0x4ac3b
movq 0x898(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x8a8(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x8b8(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x8a0(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x8b0(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x8c0(%rsp), %r13
movl 0x58(%r13), %eax
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movl %eax, %esi
callq 0x4a951
movl $0x4a0, %edx            # imm = 0x4A0
movq %r13, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0x20(%r14), %rax
movl $0x1, 0x40(%rax,%rbp)
incq %rbx
addq $0x4a0, %rbp            # imm = 0x4A0
jmp 0x4aa25
movq %r14, %rdi
movq 0x4a0(%rsp), %rsi
addq $0xde8, %rsp            # imm = 0xDE8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x28aed