// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: normalize_image2
void normalize_image2(image p)
{
    float *min = calloc(p.c, sizeof(float));
    float *max = calloc(p.c, sizeof(float));
    int i,j;
    for(i = 0; i < p.c; ++i) min[i] = max[i] = p.data[i*p.h*p.w];

    for(j = 0; j < p.c; ++j){
        for(i = 0; i < p.h*p.w; ++i){
            float v = p.data[i+j*p.h*p.w];
            if(v < min[j]) min[j] = v;
            if(v > max[j]) max[j] = v;
        }
    }
    for(i = 0; i < p.c; ++i){
        if(max[i] - min[i] < .000000001){
            min[i] = 0;
            max[i] = 1;
        }
    }
    for(j = 0; j < p.c; ++j){
        for(i = 0; i < p.w*p.h; ++i){
            p.data[i+j*p.h*p.w] = (p.data[i+j*p.h*p.w] - min[j])/(max[j]-min[j]);
        }
    }
    free(min);
    free(max);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movslq 0x8(%rax), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, -0x8(%rbp)
movslq 0x8(%rax), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x10ffd
movq -0x28(%rbp), %rdx
movq 0x10(%rdx), %rax
movl -0x14(%rbp), %ecx
imull 0x4(%rdx), %ecx
imull (%rdx), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x10fb2
movl $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x110c2
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x4(%rdx), %ecx
imull (%rdx), %ecx
cmpl %ecx, %eax
jge 0x110b2
movq -0x28(%rbp), %rsi
movq 0x10(%rsi), %rax
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
imull 0x4(%rsi), %edx
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm1
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1107d
movss -0x1c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x1c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
ucomiss (%rax,%rcx,4), %xmm0
jbe 0x110a2
movss -0x1c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x110a4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1101b
jmp 0x110b4
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x11004
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x11133
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x61d55(%rip), %xmm0    # 0x72e50
ucomisd %xmm1, %xmm0
jbe 0x11126
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss 0x5feeb(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
jmp 0x11128
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x110c9
movl $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x111e5
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rdx
movl -0x14(%rbp), %eax
movl (%rdx), %ecx
imull 0x4(%rdx), %ecx
cmpl %ecx, %eax
jge 0x111d5
movq -0x28(%rbp), %rsi
movq 0x10(%rsi), %rax
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
imull 0x4(%rsi), %edx
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
subss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
subss (%rax,%rcx,4), %xmm1
divss %xmm1, %xmm0
movq 0x10(%rsi), %rax
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
imull 0x4(%rsi), %edx
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x11151
jmp 0x111d7
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1113a
movq -0x8(%rbp), %rdi
callq 0x3030
movq -0x10(%rbp), %rdi
callq 0x3030
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)