LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: load_alphabet
image **load_alphabet()
{
    int i, j;
    const int nsize = 8;
    image **alphabets = calloc(nsize, sizeof(image));
    for(j = 0; j < nsize; ++j){
        alphabets[j] = calloc(128, sizeof(image));
        for(i = 32; i < 127; ++i){
            char buff[256];
            sprintf(buff, "data/labels/%d_%d.png", i, j);
            alphabets[j][i] = load_image_color(buff, 0, 0);
        }
    }
    return alphabets;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl $0x8, %edi
movl $0x18, %esi
callq 0x3250
movq %rax, (%rsp)
leaq 0x20(%rsp), %r15
xorl %r13d, %r13d
movl $0x80, %edi
movl $0x18, %esi
callq 0x3250
movq %rax, %rbp
movq (%rsp), %rax
movq %rbp, (%rax,%r13,8)
movl $0x20, %ebx
movl $0x300, %r14d           # imm = 0x300
leaq 0x8(%rsp), %r12
movq %r15, %rdi
leaq 0x40d03(%rip), %rsi     # 0x5776d
movl %ebx, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x3420
movq %r12, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq 0x1b21a
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbp,%r14)
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rbp,%r14)
incl %ebx
addq $0x18, %r14
cmpq $0xbe8, %r14            # imm = 0xBE8
jne 0x16a60
incq %r13
cmpq $0x8, %r13
jne 0x16a36
movq (%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: threshold_image
image threshold_image(image im, float thresh)
{
    int i;
    image t = make_image(im.w, im.h, im.c);
    for(i = 0; i < im.w*im.h*im.c; ++i){
        t.data[i] = im.data[i]>thresh ? 1 : 0;
    }
    return t;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss %xmm0, 0xc(%rsp)
movq %rdi, %rbx
movl 0x30(%rsp), %eax
movl 0x34(%rsp), %ebp
movl 0x38(%rsp), %ecx
movl %ebp, 0x4(%rdi)
movl %eax, (%rdi)
movl %ecx, 0x8(%rdi)
imull %eax, %ebp
imull %ecx, %ebp
movslq %ebp, %r14
movl $0x4, %esi
movq %r14, %rdi
callq 0x3250
movss 0xc(%rsp), %xmm2
movq %rax, 0x10(%rbx)
testl %r14d, %r14d
jle 0x1757c
leaq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl %ebp, %edx
xorl %esi, %esi
movss 0x3daa5(%rip), %xmm0    # 0x55008
movaps %xmm2, %xmm1
cmpltss (%rcx,%rsi,4), %xmm1
andps %xmm0, %xmm1
movss %xmm1, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x17563
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: transpose_image
void transpose_image(image im)
{
    assert(im.w == im.h);
    int n, m;
    int c;
    for(c = 0; c < im.c; ++c){
        for(n = 0; n < im.w-1; ++n){
            for(m = n + 1; m < im.w; ++m){
                float swap = im.data[m + im.w*(n + im.h*c)];
                im.data[m + im.w*(n + im.h*c)] = im.data[n + im.w*(m + im.h*c)];
                im.data[n + im.w*(m + im.h*c)] = swap;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x40(%rsp), %eax
cmpl 0x44(%rsp), %eax
jne 0x17650
leaq 0x40(%rsp), %rsi
movslq 0x8(%rsi), %rcx
testq %rcx, %rcx
jle 0x17641
movslq %eax, %r10
leal -0x1(%rax), %edx
movq 0x10(%rsi), %rsi
leaq (,%r10,4), %rdi
leaq 0x4(,%r10,4), %r8
leaq (%rsi,%r10,4), %r9
imulq %r10, %r10
shlq $0x2, %r10
addq $0x4, %rsi
movq %rax, %r11
decq %r11
movq %r11, (%rsp)
xorl %ebx, %ebx
cmpl $0x2, %eax
jl 0x17633
movq (%rsp), %r14
movq %r9, %r15
movq %rsi, %r12
xorl %r13d, %r13d
incq %r13
movq %r15, %rbp
xorl %r11d, %r11d
movss (%r12,%r11,4), %xmm0
movss (%rbp), %xmm1
movss %xmm1, (%r12,%r11,4)
movss %xmm0, (%rbp)
incq %r11
addq %rdi, %rbp
cmpq %r11, %r14
jne 0x17604
addq %r8, %r12
addq %r8, %r15
decq %r14
cmpq %rdx, %r13
jne 0x175fb
incq %rbx
addq %r10, %rsi
addq %r10, %r9
cmpq %rcx, %rbx
jne 0x175e9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40138(%rip), %rdi     # 0x5778f
leaq 0x4013e(%rip), %rsi     # 0x5779c
leaq 0x4013f(%rip), %rcx     # 0x577a4
movl $0x13a, %edx            # imm = 0x13A
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rotate_image_cw
void rotate_image_cw(image im, int times)
{
    assert(im.w == im.h);
    times = (times + 400) % 4;
    int i, x, y, c;
    int n = im.w;
    for(i = 0; i < times; ++i){
        for(c = 0; c < im.c; ++c){
            for(x = 0; x < n/2; ++x){
                for(y = 0; y < (n-1)/2 + 1; ++y){
                    float temp = im.data[y + im.w*(x + im.h*c)];
                    im.data[y + im.w*(x + im.h*c)] = im.data[n-1-x + im.w*(y + im.h*c)];
                    im.data[n-1-x + im.w*(y + im.h*c)] = im.data[n-1-y + im.w*(n-1-x + im.h*c)];
                    im.data[n-1-y + im.w*(n-1-x + im.h*c)] = im.data[x + im.w*(n-1-y + im.h*c)];
                    im.data[x + im.w*(n-1-y + im.h*c)] = temp;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movslq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl 0xa4(%rsp), %eax
jne 0x1784b
leal 0x190(%rdi), %eax
leal 0x193(%rdi), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x4, %ecx
negl %ecx
leal (%rdi,%rcx), %eax
addl $0x190, %eax            # imm = 0x190
movl %eax, 0xc(%rsp)
testl %eax, %eax
jle 0x1783c
leaq 0xa0(%rsp), %rax
movl 0x8(%rax), %ecx
movq %rcx, 0x18(%rsp)
movq 0x10(%rsp), %r8
movl %r8d, %esi
shrl $0x1f, %esi
addl %r8d, %esi
sarl %esi
leal -0x1(%r8), %ecx
movslq %ecx, %rdx
shrl $0x1f, %ecx
leal (%r8,%rcx), %edi
decl %edi
sarl %edi
movq 0x10(%rax), %rcx
xorl %r9d, %r9d
testl %edi, %edi
cmovlel %r9d, %edi
movq %r8, %rax
imulq %r8, %rax
shlq $0x2, %rax
movq %rax, 0x60(%rsp)
leaq (,%r8,4), %r11
leaq 0x4(,%r8,4), %rax
imulq %rdx, %rax
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq %r11, %r14
negq %r14
movq %r8, %rax
imulq %rdx, %rax
leaq (%rcx,%rax,4), %rax
movq %rax, 0x40(%rsp)
movq %rcx, 0x50(%rsp)
leaq (%rcx,%rdx,4), %rax
movq %rax, 0x38(%rsp)
notq %rdi
movq %r9, 0x58(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x17829
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %r9
xorl %r12d, %r12d
cmpl $0x2, 0x10(%rsp)
jl 0x17804
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rbx
movq %r9, %rax
xorl %edx, %edx
movq %r15, %r13
movq %rcx, %rbp
xorl %r10d, %r10d
movq %rax, %r8
movss (%r8), %xmm0
movss (%r13), %xmm1
movss %xmm1, (%r8)
movss (%rbx,%r10,4), %xmm1
movss %xmm1, (%r13)
movss (%rbp), %xmm1
movss %xmm1, (%rbx,%r10,4)
movss %xmm0, (%rbp)
addq $0x4, %r8
decq %r10
addq %r14, %rbp
addq %r11, %r13
cmpq %r10, %rdi
jne 0x177b0
incq %rdx
addq %r11, %rax
addq %r14, %rbx
addq $0x4, %rcx
addq $-0x4, %r15
cmpq %rsi, %rdx
jne 0x177a4
incq %r12
movq 0x60(%rsp), %rax
addq %rax, %r9
addq %rax, 0x20(%rsp)
addq %rax, 0x28(%rsp)
addq %rax, 0x30(%rsp)
cmpq 0x18(%rsp), %r12
jne 0x17789
movq 0x58(%rsp), %r9
incl %r9d
cmpl 0xc(%rsp), %r9d
jne 0x17753
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ff3d(%rip), %rdi     # 0x5778f
leaq 0x3ff43(%rip), %rsi     # 0x5779c
leaq 0x3ff60(%rip), %rcx     # 0x577c0
movl $0x14a, %edx            # imm = 0x14A
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: flip_image
void flip_image(image a)
{
    int i,j,k;
    for(k = 0; k < a.c; ++k){
        for(i = 0; i < a.h; ++i){
            for(j = 0; j < a.w/2; ++j){
                int index = j + a.w*(i + a.h*(k));
                int flip = (a.w - j - 1) + a.w*(i + a.h*(k));
                float swap = a.data[flip];
                a.data[flip] = a.data[index];
                a.data[index] = swap;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x38(%rsp), %rax
testq %rax, %rax
jle 0x17911
leaq 0x30(%rsp), %rdi
movl 0x4(%rdi), %ecx
movslq (%rdi), %rdx
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
movq 0x10(%rdi), %rdi
movslq %ecx, %r8
imulq %rdx, %r8
shlq $0x2, %r8
leaq (%rdi,%rdx,4), %r9
addq $-0x4, %r9
movq %rdx, %r10
shlq $0x2, %r10
negq %rsi
xorl %r11d, %r11d
testl %ecx, %ecx
jle 0x17903
movq %r9, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpl $0x2, %edx
jl 0x178f5
xorl %r12d, %r12d
movq %r14, %r13
movss (%rbx,%r12,4), %xmm0
movss (%r13), %xmm1
movss %xmm1, (%rbx,%r12,4)
movss %xmm0, (%r13)
addq $0x4, %r13
decq %r12
cmpq %r12, %rsi
jne 0x178d1
incq %r15
addq %r10, %r14
addq %r10, %rbx
cmpq %rcx, %r15
jne 0x178c6
incq %r11
addq %r8, %rdi
addq %r8, %r9
cmpq %rax, %r11
jne 0x178b9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: image_distance
image image_distance(image a, image b)
{
    int i,j;
    image dist = make_image(a.w, a.h, 1);
    for(i = 0; i < a.c; ++i){
        for(j = 0; j < a.h*a.w; ++j){
            dist.data[j] += pow(a.data[i*a.h*a.w+j]-b.data[i*a.h*a.w+j],2);
        }
    }
    for(j = 0; j < a.h*a.w; ++j){
        dist.data[j] = sqrt(dist.data[j]);
    }
    return dist;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x30(%rsp), %eax
movl 0x34(%rsp), %ebp
movl %ebp, 0x4(%rdi)
movl %eax, (%rdi)
movl $0x1, 0x8(%rdi)
imull %eax, %ebp
movslq %ebp, %rdi
movl $0x4, %esi
callq 0x3250
movq %rax, %r14
movq %rax, 0x10(%rbx)
movslq 0x38(%rsp), %rax
movl %ebp, %r15d
testq %rax, %rax
jle 0x179c6
leaq 0x48(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rdx), %rdx
xorl %esi, %esi
xorl %edi, %edi
testl %ebp, %ebp
jle 0x179bc
movslq %esi, %r9
leaq (%rcx,%r9,4), %r8
leaq (%rdx,%r9,4), %r9
xorl %r10d, %r10d
movss (%r8,%r10,4), %xmm0
subss (%r9,%r10,4), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r14,%r10,4), %xmm1
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%r14,%r10,4)
incq %r10
cmpq %r10, %r15
jne 0x17986
incq %rdi
addl %ebp, %esi
cmpq %rax, %rdi
jne 0x17974
testl %ebp, %ebp
jle 0x179f7
xorl %r12d, %r12d
xorps %xmm1, %xmm1
movss (%r14,%r12,4), %xmm0
ucomiss %xmm1, %xmm0
jb 0x179e1
sqrtss %xmm0, %xmm0
jmp 0x179e9
callq 0x32e0
xorps %xmm1, %xmm1
movss %xmm0, (%r14,%r12,4)
incq %r12
cmpq %r12, %r15
jne 0x179d0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: blocky_image
void blocky_image(image im, int s)
{
    int i,j,k;
    for(k = 0; k < im.c; ++k){
        for(j = 0; j < im.h; ++j){
            for(i = 0; i < im.w; ++i){
                im.data[i + im.w*(j + im.h*k)] = im.data[i/s*s + im.w*(j/s*s + im.h*k)];
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x40(%rsp), %rax
movq %rax, -0x8(%rsp)
testq %rax, %rax
jle 0x17d34
leaq 0x38(%rsp), %rax
movl (%rax), %r9d
movl 0x4(%rax), %r10d
movq 0x10(%rax), %r11
movslq %r9d, %rbx
movslq %r10d, %rax
imulq %rbx, %rax
shlq $0x2, %rax
movq %rax, -0x10(%rsp)
shlq $0x2, %rbx
xorl %r15d, %r15d
movq %r11, %r8
xorl %r13d, %r13d
testl %r10d, %r10d
jle 0x17d22
movl %r15d, %ebp
movq %r8, %r12
xorl %ecx, %ecx
testl %r9d, %r9d
jle 0x17d15
movl %ecx, %eax
cltd
idivl %edi
movl %ebp, %r14d
subl %edx, %r14d
imull %r9d, %r14d
xorl %esi, %esi
movl %esi, %eax
cltd
idivl %edi
leal (%r14,%rsi), %eax
subl %edx, %eax
cltq
movss (%r11,%rax,4), %xmm0
movss %xmm0, (%r12,%rsi,4)
incq %rsi
cmpq %rsi, %r9
jne 0x17cf4
incq %rcx
addq %rbx, %r12
incl %ebp
cmpq %r10, %rcx
jne 0x17cde
incq %r13
addq -0x10(%rsp), %r8
addl %r10d, %r15d
cmpq -0x8(%rsp), %r13
jne 0x17cd1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: censor_image
void censor_image(image im, int dx, int dy, int w, int h)
{
    int i,j,k;
    int s = 32;
    if(dx < 0) dx = 0;
    if(dy < 0) dy = 0;

    for(k = 0; k < im.c; ++k){
        for(j = dy; j < dy + h && j < im.h; ++j){
            for(i = dx; i < dx + w && i < im.w; ++i){
                im.data[i + im.w*(j + im.h*k)] = im.data[i/s*s + im.w*(j/s*s + im.h*k)];
                //im.data[i + j*im.w + k*im.w*im.h] = 0;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %eax
movslq 0x40(%rsp), %rdi
movq %rdi, -0x8(%rsp)
testq %rdi, %rdi
jle 0x17e1e
xorl %r8d, %r8d
testl %esi, %esi
cmovlel %r8d, %esi
testl %eax, %eax
cmovlel %r8d, %eax
leaq 0x38(%rsp), %rdi
addl %esi, %ecx
movl (%rdi), %r9d
movl 0x4(%rdi), %r10d
cmpl %r10d, %ecx
cmovgel %r10d, %ecx
addl %eax, %edx
cmpl %r9d, %edx
cmovgel %r9d, %edx
movq 0x10(%rdi), %r11
movslq %r9d, %rbx
movl %r10d, -0x14(%rsp)
movslq %r10d, %r10
movq %rbx, %rdi
imulq %rsi, %rdi
leaq (%r11,%rdi,4), %r15
imulq %rbx, %r10
shlq $0x2, %r10
movq %r10, -0x10(%rsp)
shlq $0x2, %rbx
cmpl %ecx, %esi
jge 0x17e0f
movl %r8d, %ebp
imull -0x14(%rsp), %ebp
movq %r15, %r12
movq %rsi, %r13
cmpl %edx, %eax
jge 0x17e04
movl %r13d, %r10d
andl $0x7fffffe0, %r10d      # imm = 0x7FFFFFE0
addl %ebp, %r10d
imull %r9d, %r10d
movq %rax, %rdi
movl %edi, %r14d
andl $0x7fffffe0, %r14d      # imm = 0x7FFFFFE0
addl %r10d, %r14d
movslq %r14d, %r14
movss (%r11,%r14,4), %xmm0
movss %xmm0, (%r12,%rdi,4)
incq %rdi
cmpq %rdi, %rdx
jne 0x17de0
incq %r13
addq %rbx, %r12
cmpq %rcx, %r13
jne 0x17dc8
incq %r8
addq -0x10(%rsp), %r15
cmpq -0x8(%rsp), %r8
jne 0x17db6
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: collapse_image_layers
image collapse_image_layers(image source, int border)
{
    int h = source.h;
    h = (h+border)*source.c - border;
    image dest = make_image(source.w, h, 1);
    int i;
    for(i = 0; i < source.c; ++i){
        image layer = get_image_layer(source, i);
        int h_offset = i*(source.h+border);
        embed_image(layer, dest, 0, h_offset);
        free_image(layer);
    }
    return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl 0xa0(%rsp), %ecx
movl 0xa4(%rsp), %eax
movq %rax, 0x38(%rsp)
leal (%rax,%rsi), %edx
movslq 0xa8(%rsp), %r14
movl %r14d, %eax
movl %edx, 0x30(%rsp)
imull %edx, %eax
subl %esi, %eax
movl %eax, 0x4(%rdi)
movl %ecx, (%rdi)
movl $0x1, 0x8(%rdi)
movl %ecx, 0x34(%rsp)
imull %ecx, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3250
movq %rax, 0x10(%rbx)
movq %r14, 0x60(%rsp)
testq %r14, %r14
jle 0x17f96
leaq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x58(%rsp)
movl 0x34(%rsp), %eax
movl %eax, %r13d
imull 0x38(%rsp), %r13d
movslq %r13d, %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x38(%rsp), %rax
movl %eax, 0x44(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x40(%rsp)
movl $0x1, 0x48(%rsp)
movl $0x4, %esi
movq %r14, %rdi
callq 0x3250
movq %rax, %r15
movq %rax, 0x50(%rsp)
testl %r13d, %r13d
jle 0x17f45
movslq %ebp, %rax
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, (%r15,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x17efd
movl 0x30(%rsp), %esi
imull %r12d, %esi
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x162c2
jmp 0x17f7d
movl 0x30(%rsp), %esi
imull %r12d, %esi
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x162c2
testq %r15, %r15
je 0x17f85
movq %r15, %rdi
callq 0x3040
incq %r12
addl %r13d, %ebp
cmpq 0x60(%rsp), %r12
jne 0x17ebc
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: get_image_layer
image get_image_layer(image m, int l)
{
    image out = make_image(m.w, m.h, 1);
    int i;
    for(i = 0; i < m.h*m.w; ++i){
        out.data[i] = m.data[i+l*m.h*m.w];
    }
    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x40(%rsp), %r15d
movl 0x44(%rsp), %r12d
movl %r12d, 0x4(%rdi)
movl %r15d, (%rdi)
movl $0x1, 0x8(%rdi)
movl %r12d, %r13d
imull %r15d, %r13d
movslq %r13d, %r14
movl $0x4, %esi
movq %r14, %rdi
callq 0x3250
movq %rax, 0x10(%rbx)
testl %r14d, %r14d
jle 0x1801f
leaq 0x40(%rsp), %rsi
imull %ebp, %r12d
imull %r15d, %r12d
movslq %r12d, %rcx
movl %r13d, %edx
shlq $0x2, %rcx
addq 0x10(%rsi), %rcx
xorl %esi, %esi
movss (%rcx,%rsi,4), %xmm0
movss %xmm0, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x1800d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: constrain_image
void constrain_image(image im)
{
    int i;
    for(i = 0; i < im.w*im.h*im.c; ++i){
        if(im.data[i] < 0) im.data[i] = 0;
        if(im.data[i] > 1) im.data[i] = 1;
    }
}

// Assembly:
movl 0xc(%rsp), %ecx
imull 0x8(%rsp), %ecx
imull 0x10(%rsp), %ecx
testl %ecx, %ecx
jle 0x1807a
leaq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, %ecx
xorl %edx, %edx
movss 0x3cfb0(%rip), %xmm0    # 0x55008
movss (%rax,%rdx,4), %xmm2
xorps %xmm1, %xmm1
ucomiss %xmm2, %xmm1
ja 0x1806d
ucomiss %xmm0, %xmm2
movaps %xmm0, %xmm1
jbe 0x18072
movss %xmm1, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x18058
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: normalize_image
void normalize_image(image p)
{
    int i;
    float min = 9999999;
    float max = -999999;

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

// Assembly:
movl 0x8(%rsp), %edx
imull 0xc(%rsp), %edx
imull 0x10(%rsp), %edx
testl %edx, %edx
jle 0x18124
leaq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rsi
movl %edx, %eax
movss 0x3d1d4(%rip), %xmm2    # 0x55278
movss 0x3d1d0(%rip), %xmm0    # 0x5527c
xorl %edi, %edi
movaps %xmm2, %xmm1
movaps %xmm0, %xmm3
movss (%rsi,%rdi,4), %xmm0
movaps %xmm0, %xmm2
minss %xmm1, %xmm2
maxss %xmm3, %xmm0
incq %rdi
cmpq %rdi, %rax
jne 0x180ae
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
xorps %xmm3, %xmm3
cvtss2sd %xmm1, %xmm3
movsd 0x3f46e(%rip), %xmm4    # 0x57550
ucomisd %xmm3, %xmm4
xorps %xmm1, %xmm1
ja 0x180ee
movaps %xmm2, %xmm1
testl %edx, %edx
jle 0x18124
ucomisd %xmm3, %xmm4
jbe 0x18100
movss 0x3cf08(%rip), %xmm0    # 0x55008
movq 0x10(%rcx), %rcx
subss %xmm1, %xmm0
xorl %edx, %edx
movss (%rcx,%rdx,4), %xmm2
subss %xmm1, %xmm2
divss %xmm0, %xmm2
movss %xmm2, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x1810a
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movslq 0x28(%rsp), %rbx
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3250
movq %rax, %r14
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3250
movq %rax, %r15
testq %rbx, %rbx
jle 0x18284
leaq 0x20(%rsp), %rax
movq 0x10(%rax), %rcx
movl 0x4(%rax), %edx
imull (%rax), %edx
xorl %esi, %esi
xorl %edi, %edi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm0
movss %xmm0, (%r15,%rdi,4)
movss %xmm0, (%r14,%rdi,4)
incq %rdi
addl %edx, %esi
cmpq %rdi, %rbx
jne 0x1816b
testl %ebx, %ebx
jle 0x18284
movl (%rax), %ecx
imull 0x4(%rax), %ecx
movq 0x10(%rax), %rdx
xorl %esi, %esi
xorl %edi, %edi
testl %ecx, %ecx
jle 0x181e4
movslq %esi, %r8
leaq (%rdx,%r8,4), %r8
movss (%r14,%rdi,4), %xmm1
movss (%r15,%rdi,4), %xmm0
xorl %r9d, %r9d
movaps %xmm1, %xmm2
movaps %xmm0, %xmm3
movss (%r8,%r9,4), %xmm0
movaps %xmm0, %xmm1
minss %xmm2, %xmm1
maxss %xmm3, %xmm0
incq %r9
cmpq %r9, %rcx
jne 0x181b9
movss %xmm1, (%r14,%rdi,4)
movss %xmm0, (%r15,%rdi,4)
incq %rdi
addl %ecx, %esi
cmpq %rbx, %rdi
jne 0x1819f
testl %ebx, %ebx
jle 0x18284
xorl %ecx, %ecx
movsd 0x3f350(%rip), %xmm0    # 0x57550
movss (%r15,%rcx,4), %xmm1
subss (%r14,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x18226
movl $0x0, (%r14,%rcx,4)
movl $0x3f800000, (%r15,%rcx,4) # imm = 0x3F800000
incq %rcx
cmpq %rcx, %rbx
jne 0x18200
testl %ebx, %ebx
jle 0x18284
movl 0x4(%rax), %ecx
imull (%rax), %ecx
movq 0x10(%rax), %rax
xorl %edx, %edx
xorl %esi, %esi
testl %ecx, %ecx
jle 0x1827a
movslq %edx, %rdi
leaq (%rax,%rdi,4), %rdi
movss (%r14,%rsi,4), %xmm0
movss (%r15,%rsi,4), %xmm1
subss %xmm0, %xmm1
xorl %r8d, %r8d
movss (%rdi,%r8,4), %xmm2
subss %xmm0, %xmm2
divss %xmm1, %xmm2
movss %xmm2, (%rdi,%r8,4)
incq %r8
cmpq %r8, %rcx
jne 0x1825e
incq %rsi
addl %ecx, %edx
cmpq %rbx, %rsi
jne 0x18240
movq %r14, %rdi
callq 0x3040
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3040
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rgbgr_image
void rgbgr_image(image im)
{
    int i;
    for(i = 0; i < im.w*im.h; ++i){
        float swap = im.data[i];
        im.data[i] = im.data[i+im.w*im.h*2];
        im.data[i+im.w*im.h*2] = swap;
    }
}

// Assembly:
movl 0xc(%rsp), %ecx
imull 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0x18300
leaq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
leal (%rcx,%rcx), %edx
movl %ecx, %ecx
leaq (%rax,%rdx,4), %rdx
xorl %esi, %esi
movss (%rax,%rsi,4), %xmm0
movss (%rdx,%rsi,4), %xmm1
movss %xmm1, (%rax,%rsi,4)
movss %xmm0, (%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x182e4
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: show_image_layers
void show_image_layers(image p, char *name)
{
    int i;
    char buff[256];
    for(i = 0; i < p.c; ++i){
        sprintf(buff, "%s - Layer %d", name, i);
        image layer = get_image_layer(p, i);
        show_image(layer, buff, 1);
        free_image(layer);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x30(%rsp)
movslq 0x198(%rsp), %r13
testq %r13, %r13
jle 0x185eb
leaq 0x190(%rsp), %rax
movl (%rax), %ecx
movl 0x4(%rax), %edx
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
movl %edx, 0x18(%rsp)
movl %edx, %r14d
movl %ecx, 0x1c(%rsp)
imull %ecx, %r14d
movslq %r14d, %rax
movq %rax, 0x28(%rsp)
leaq 0x50(%rsp), %r12
xorl %ebx, %ebx
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x3f31f(%rip), %rsi     # 0x5784b
movq 0x30(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3420
movl $0x4, %esi
movq 0x28(%rsp), %rdi
callq 0x3250
movq %rax, %r15
testl %r14d, %r14d
jle 0x18572
movslq %ebx, %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, (%r15,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0x1855f
movl 0x1c(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl $0x1, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movq 0x53a62(%rip), %rax     # 0x6bff8
movq (%rax), %rdi
leaq 0x3f241(%rip), %rsi     # 0x577e1
movq %r12, %rdx
xorl %eax, %eax
callq 0x3270
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
movl $0x3, %esi
movl $0x50, %edx
callq 0x18310
testq %r15, %r15
je 0x185dc
movq %r15, %rdi
callq 0x3040
incq %rbp
addl %r14d, %ebx
cmpq %r13, %rbp
jne 0x18522
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: make_random_image
image make_random_image(int w, int h, int c)
{
    image out = make_empty_image(w,h,c);
    out.data = calloc(h*w*c, sizeof(float));
    int i;
    for(i = 0; i < w*h*c; ++i){
        out.data[i] = (rand_normal() * .25) + .5;
    }
    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
movl %edx, 0x4(%rdi)
movl %esi, (%rdi)
movl %ecx, 0x8(%rdi)
imull %esi, %ebp
imull %ecx, %ebp
movslq %ebp, %r15
movl $0x4, %esi
movq %r15, %rdi
callq 0x3250
movq %rax, 0x10(%rbx)
testl %r15d, %r15d
jle 0x18667
movq %rax, %r14
movl %ebp, %r15d
xorl %r12d, %r12d
xorl %eax, %eax
callq 0xfb17
cvtss2sd %xmm0, %xmm0
mulsd 0x3eeeb(%rip), %xmm0    # 0x57538
addsd 0x3caf3(%rip), %xmm0    # 0x55148
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r14,%r12,4)
incq %r12
cmpq %r12, %r15
jne 0x1863a
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: place_image
void place_image(image im, int w, int h, int dx, int dy, image canvas)
{
    int x, y, c;
    for(c = 0; c < im.c; ++c){
        for(y = 0; y < h; ++y){
            for(x = 0; x < w; ++x){
                float rx = ((float)x / w) * im.w;
                float ry = ((float)y / h) * im.h;
                float val = bilinear_interpolate(im, rx, ry, c);
                set_pixel(canvas, x + dx, y + dy, c, val);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, 0x18(%rsp)
movl %edi, 0x20(%rsp)
movl 0xb8(%rsp), %eax
movl %eax, 0x34(%rsp)
testl %eax, %eax
jle 0x1883e
movl 0x20(%rsp), %edi
cvtsi2ss %edi, %xmm0
movss %xmm0, 0x48(%rsp)
leaq 0xb0(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2ssl (%rax), %xmm0
movss %xmm0, 0x44(%rsp)
movl 0x18(%rsp), %esi
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
movss %xmm0, 0x3c(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x4(%rax), %xmm0
movss %xmm0, 0x38(%rsp)
leaq 0xc8(%rsp), %rax
movslq (%rax), %r9
movslq 0x4(%rax), %r8
movl 0x8(%rax), %r10d
movl %r10d, 0x40(%rsp)
movslq %edx, %rbp
movslq %ecx, %rcx
movl %esi, %edx
movq %rdx, 0x60(%rsp)
movl %edi, %ebx
leaq (,%rbp,4), %rdx
addq 0x10(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, %rax
movq %rcx, 0x58(%rsp)
imull %r9d, %eax
movl %eax, 0x1c(%rsp)
movq %r8, 0x70(%rsp)
movl %r8d, %eax
movq %r9, %r13
imull %r9d, %eax
movl %eax, 0x30(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x18(%rsp)
jle 0x18828
movl 0x1c(%rsp), %eax
movl %eax, 0x24(%rsp)
movq $0x0, 0x28(%rsp)
cmpl $0x0, 0x20(%rsp)
jle 0x1880b
movslq 0x24(%rsp), %rax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x68(%rsp)
movq 0x28(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss 0x3c(%rsp), %xmm0
mulss 0x38(%rsp), %xmm0
movss %xmm0, 0x4c(%rsp)
movq 0x58(%rsp), %rax
leaq (%rcx,%rax), %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
divss 0x48(%rsp), %xmm0
mulss 0x44(%rsp), %xmm0
leaq 0xb0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm1
movups %xmm1, (%rsp)
movss 0x4c(%rsp), %xmm1
movl %r14d, %edi
callq 0x1884d
leaq (%r12,%rbp), %rax
movl %eax, %ecx
orl %r15d, %ecx
js 0x18803
cmpq %r13, %rax
jge 0x18803
cmpq 0x70(%rsp), %r15
jge 0x18803
cmpl %r14d, 0x40(%rsp)
jle 0x18803
movq 0x68(%rsp), %rax
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbx
jne 0x187a0
movq 0x28(%rsp), %rcx
incq %rcx
addl %r13d, 0x24(%rsp)
movq %rcx, 0x28(%rsp)
cmpq 0x60(%rsp), %rcx
jne 0x18758
incl %r14d
movl 0x30(%rsp), %eax
addl %eax, 0x1c(%rsp)
cmpl 0x34(%rsp), %r14d
jne 0x1873c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: bilinear_interpolate
static float bilinear_interpolate(image im, float x, float y, int c)
{
    int ix = (int) floorf(x);
    int iy = (int) floorf(y);

    float dx = x - ix;
    float dy = y - iy;

    float val = (1-dy) * (1-dx) * get_pixel_extend(im, ix, iy, c) + 
        dy     * (1-dx) * get_pixel_extend(im, ix, iy+1, c) + 
        (1-dy) *   dx   * get_pixel_extend(im, ix+1, iy, c) +
        dy     *   dx   * get_pixel_extend(im, ix+1, iy+1, c);
    return val;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %edi, %ebx
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movaps %xmm2, 0x60(%rsp)
movaps %xmm1, %xmm0
callq 0x33c0
movaps %xmm0, 0x50(%rsp)
movaps 0x20(%rsp), %xmm0
callq 0x33c0
unpcklps 0x50(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm1
movaps 0x60(%rsp), %xmm2
subps %xmm1, %xmm2
movaps %xmm2, 0x60(%rsp)
movaps 0x3ca4d(%rip), %xmm3    # 0x552f0
subps %xmm2, %xmm3
movaps %xmm3, 0x40(%rsp)
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
movaps %xmm1, 0x20(%rsp)
movaps %xmm3, %xmm2
mulss %xmm1, %xmm2
movaps %xmm2, 0x70(%rsp)
movd %xmm0, %ebp
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %r15d
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
callq 0x15f66
movss %xmm0, 0x3c(%rsp)
movaps 0x60(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0x50(%rsp)
movaps 0x40(%rsp), %xmm1
mulss %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
leal 0x1(%r15), %r14d
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0x15f66
mulss 0x40(%rsp), %xmm0
movss 0x3c(%rsp), %xmm1
mulss 0x70(%rsp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x40(%rsp)
movaps 0x20(%rsp), %xmm0
mulss 0x60(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
incl %ebp
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
callq 0x15f66
mulss 0x20(%rsp), %xmm0
addss 0x40(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movaps 0x50(%rsp), %xmm0
mulss 0x60(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0x15f66
mulss 0x50(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: center_crop_image
image center_crop_image(image im, int w, int h)
{
    int m = (im.w < im.h) ? im.w : im.h;   
    image c = crop_image(im, (im.w - m) / 2, (im.h - m)/2, m, m);
    image r = resize_image(c, w, h);
    free_image(c);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %edi
cmpl %edi, %eax
movl %edi, %ecx
cmovll %eax, %ecx
subl %ecx, %eax
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
subl %ecx, %edi
movl %edi, %edx
shrl $0x1f, %edx
addl %edi, %edx
sarl %edx
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x60(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl %ecx, %r8d
callq 0x18a89
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x170fa
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x18a7b
callq 0x3040
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: crop_image
image crop_image(image im, int dx, int dy, int w, int h)
{
    image cropped = make_image(w, h, im.c);
    int i, j, k;
    for(k = 0; k < im.c; ++k){
        for(j = 0; j < h; ++j){
            for(i = 0; i < w; ++i){
                int r = j + dy;
                int c = i + dx;
                float val = 0;
                r = constrain_int(r, 0, im.h-1);
                c = constrain_int(c, 0, im.w-1);
                val = get_pixel(im, c, r, k);
                set_pixel(cropped, i, j, k, val);
            }
        }
    }
    return cropped;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %ebp
movq %rdx, 0x58(%rsp)
movl %esi, %ebx
movq %rdi, %r14
movslq 0xb8(%rsp), %r15
movl %r8d, 0x4(%rdi)
movl %ecx, (%rdi)
movl %r15d, 0x8(%rdi)
movl %r8d, 0x18(%rsp)
movl %r8d, %eax
imull %ecx, %eax
movl %eax, 0x34(%rsp)
imull %r15d, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3250
movq %r14, 0x40(%rsp)
movq %rax, 0x50(%rsp)
movq %rax, 0x10(%r14)
movq %r15, 0x48(%rsp)
testq %r15, %r15
jle 0x18c0d
leaq 0xb0(%rsp), %rax
movl (%rax), %ecx
movl 0x4(%rax), %r13d
decl %r13d
decl %ecx
movl %ecx, 0x3c(%rsp)
movl 0x18(%rsp), %eax
movq %rax, 0x60(%rsp)
movl %ebp, %esi
movl %ebx, %eax
movq %rax, 0x68(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r15d, %r15d
movl %ebp, 0x38(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x18bf1
movq 0x20(%rsp), %rax
movl %eax, 0x1c(%rsp)
movq $0x0, 0x28(%rsp)
testl %ebp, %ebp
jle 0x18bd1
movl 0x1c(%rsp), %eax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x70(%rsp)
movq 0x58(%rsp), %rax
movq 0x28(%rsp), %rcx
leal (%rcx,%rax), %r14d
xorl %ebp, %ebp
movl %r14d, %edi
movq %rsi, %rbx
xorl %esi, %esi
movl %r13d, %edx
callq 0xf807
movl %eax, %r12d
movq 0x68(%rsp), %rax
leal (%rax,%rbp), %edi
xorl %esi, %esi
movl 0x3c(%rsp), %edx
callq 0xf807
leaq 0xb0(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, 0x10(%rsp)
movups (%rdx), %xmm0
movups %xmm0, (%rsp)
movl %eax, %edi
movl %r12d, %esi
movl %r15d, %edx
callq 0x15f12
movq %rbx, %rsi
movq 0x70(%rsp), %rax
movss %xmm0, (%rax,%rbp,4)
incq %rbp
cmpq %rbp, %rbx
jne 0x18b71
movq 0x28(%rsp), %rcx
incq %rcx
movl 0x38(%rsp), %ebp
addl %ebp, 0x1c(%rsp)
movq %rcx, 0x28(%rsp)
cmpq 0x60(%rsp), %rcx
jne 0x18b47
incq %r15
movq 0x20(%rsp), %rax
addl 0x34(%rsp), %eax
movq %rax, 0x20(%rsp)
cmpq 0x48(%rsp), %r15
jne 0x18b2a
movq 0x40(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rotate_image
image rotate_image(image im, float rad)
{
    int x, y, c;
    float cx = im.w/2.;
    float cy = im.h/2.;
    image rot = make_image(im.w, im.h, im.c);
    for(c = 0; c < im.c; ++c){
        for(y = 0; y < im.h; ++y){
            for(x = 0; x < im.w; ++x){
                float rx = cos(rad)*(x-cx) - sin(rad)*(y-cy) + cx;
                float ry = sin(rad)*(x-cx) + cos(rad)*(y-cy) + cy;
                float val = bilinear_interpolate(im, rx, ry, c);
                set_pixel(rot, x, y, c, val);
            }
        }
    }
    return rot;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movss %xmm0, 0x20(%rsp)
movq %rdi, %rbx
movl 0xd0(%rsp), %r12d
movl 0xd4(%rsp), %eax
movslq 0xd8(%rsp), %r14
movl %eax, 0x4(%rdi)
movl %r12d, (%rdi)
movl %r14d, 0x8(%rdi)
movq %rax, 0x38(%rsp)
imull %r12d, %eax
imull %r14d, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3250
movq %rbx, 0x68(%rsp)
movq %rax, 0x78(%rsp)
movq %rax, 0x10(%rbx)
movq %r14, 0x70(%rsp)
testq %r14, %r14
jle 0x19177
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd 0x3c18f(%rip), %xmm1    # 0x55148
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm2
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0xd0(%rsp), %rbx
xorps %xmm1, %xmm1
cvtss2sd 0x20(%rsp), %xmm1
movss %xmm2, 0x54(%rsp)
cvtss2sd %xmm2, %xmm2
movsd %xmm2, 0x88(%rsp)
movss %xmm0, 0x50(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x80(%rsp)
imull %r12d, %eax
movl %eax, 0x4c(%rsp)
movq $0x0, 0x30(%rsp)
xorl %r15d, %r15d
movsd %xmm1, 0x20(%rsp)
cmpl $0x0, 0x38(%rsp)
jle 0x1915b
movq 0x30(%rsp), %rax
movl %eax, 0x2c(%rsp)
xorl %r14d, %r14d
testl %r12d, %r12d
jle 0x19148
movl 0x2c(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
movq 0x78(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
subss 0x50(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x58(%rsp)
xorl %ebp, %ebp
movaps %xmm1, %xmm0
callq 0x31e0
xorps %xmm1, %xmm1
cvtsi2ss %ebp, %xmm1
movsd %xmm0, 0x40(%rsp)
subss 0x54(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x33d0
mulsd 0x58(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
mulsd 0x60(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x88(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x40(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x33d0
movsd %xmm0, 0x90(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x31e0
mulsd 0x58(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
mulsd 0x60(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x80(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movss 0x40(%rsp), %xmm0
movl %r15d, %edi
callq 0x1884d
movsd 0x20(%rsp), %xmm1
movss %xmm0, (%r13,%rbp,4)
incq %rbp
cmpq %rbp, %r12
jne 0x1906d
incq %r14
addl %r12d, 0x2c(%rsp)
cmpq 0x38(%rsp), %r14
jne 0x1903d
incq %r15
movq 0x30(%rsp), %rax
addl 0x4c(%rsp), %eax
movq %rax, 0x30(%rsp)
cmpq 0x70(%rsp), %r15
jne 0x19026
movq 0x68(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: best_3d_shift_r
int best_3d_shift_r(image a, image b, int min, int max)
{
    if(min == max) return min;
    int mid = floor((min + max) / 2.);
    image c1 = crop_image(b, 0, mid, b.w, b.h);
    image c2 = crop_image(b, 0, mid+1, b.w, b.h);
    float d1 = dist_array(c1.data, a.data, a.w*a.h*a.c, 10);
    float d2 = dist_array(c2.data, a.data, a.w*a.h*a.c, 10);
    free_image(c1);
    free_image(c2);
    if(d1 < d2) return best_3d_shift_r(a, b, min, mid);
    else return best_3d_shift_r(a, b, mid+1, max);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edi, %ebx
cmpl %esi, %edi
je 0x194a6
movl %esi, %r14d
leaq 0xc8(%rsp), %r15
leal (%r14,%rbx), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x3be03(%rip), %xmm0    # 0x55148
callq 0x33e0
cvttsd2si %xmm0, %ebp
movl (%r15), %r12d
movl 0x4(%r15), %r13d
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x18a89
movq %rbp, 0x40(%rsp)
leal 0x1(%rbp), %edx
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
movl %edx, 0x34(%rsp)
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x18a89
leaq 0x60(%rsp), %rax
movq 0x10(%rax), %r12
leaq 0xb0(%rsp), %rax
movq 0x10(%rax), %rbp
movl 0x4(%rax), %r15d
imull (%rax), %r15d
imull 0x8(%rax), %r15d
movq %r12, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl $0xa, %ecx
callq 0xf827
movss %xmm0, 0x3c(%rsp)
leaq 0x48(%rsp), %rax
movq 0x10(%rax), %r13
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl $0xa, %ecx
callq 0xf827
movss %xmm0, 0x38(%rsp)
testq %r12, %r12
je 0x19413
movq %r12, %rdi
callq 0x3040
testq %r13, %r13
je 0x19420
movq %r13, %rdi
callq 0x3040
movss 0x38(%rsp), %xmm0
ucomiss 0x3c(%rsp), %xmm0
jbe 0x19467
leaq 0xc8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x28(%rsp)
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xb0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
movq 0x40(%rsp), %rsi
jmp 0x1949f
leaq 0xc8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x28(%rsp)
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xb0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl 0x34(%rsp), %edi
movl %r14d, %esi
callq 0x19312
movl %eax, %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: best_3d_shift
int best_3d_shift(image a, image b, int min, int max)
{
    int i;
    int best = 0;
    float best_distance = FLT_MAX;
    for(i = min; i <= max; i += 2){
        image c = crop_image(b, 0, i, b.w, b.h);
        float d = dist_array(c.data, a.data, a.w*a.h*a.c, 100);
        if(d < best_distance){
            best_distance = d;
            best = i;
        }
        printf("%d %f\n", i, d);
        free_image(c);
    }
    return best;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorl %r12d, %r12d
movl %esi, 0x28(%rsp)
cmpl %esi, %edi
jg 0x195a0
movl %edi, %ebp
leaq 0x98(%rsp), %rcx
leaq 0x80(%rsp), %rax
movl (%rcx), %edx
movl %edx, 0x24(%rsp)
movl 0x4(%rcx), %r15d
movq 0x10(%rax), %r13
movl 0x4(%rax), %ebx
imull (%rax), %ebx
imull 0x8(%rax), %ebx
xorl %r12d, %r12d
movss 0x3bd77(%rip), %xmm0    # 0x55280
movss %xmm0, 0x20(%rsp)
leaq 0x98(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl %ebp, %edx
movl 0x24(%rsp), %ecx
movl %r15d, %r8d
callq 0x18a89
movq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movl $0x64, %ecx
callq 0xf827
movss 0x20(%rsp), %xmm1
ucomiss %xmm0, %xmm1
cmoval %ebp, %r12d
movss %xmm0, 0x2c(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x3e2e8(%rip), %rdi     # 0x57859
movl %ebp, %esi
movb $0x1, %al
callq 0x3160
testq %r14, %r14
je 0x19587
movq %r14, %rdi
callq 0x3040
movss 0x2c(%rsp), %xmm0
minss 0x20(%rsp), %xmm0
addl $0x2, %ebp
cmpl 0x28(%rsp), %ebp
jle 0x19509
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: load_image
image load_image(char *filename, int w, int h, int c)
{
    image out = load_image_stb(filename, c);

    if((h && w) && (h != out.h || w != out.w)){
        image resized = resize_image(out, w, h);
        free_image(out);
        out = resized;
    }
    return out;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
movl %r8d, %edx
callq 0x1b21a
testl %ebp, %ebp
sete %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
jne 0x19804
cmpl %ebp, 0x4(%rbx)
jne 0x197c6
cmpl %r14d, (%rbx)
je 0x19804
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x18(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x170fa
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x197f3
callq 0x3040
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: letterbox_image_into
void letterbox_image_into(image im, int w, int h, image boxed)
{
    int new_w = im.w;
    int new_h = im.h;
    if (((float)w/im.w) < ((float)h/im.h)) {
        new_w = w;
        new_h = (im.h * w)/im.w;
    } else {
        new_h = h;
        new_w = (im.w * h)/im.h;
    }
    image resized = resize_image(im, new_w, new_h);
    embed_image(resized, boxed, (w-new_w)/2, (h-new_h)/2); 
    free_image(resized);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movl %edi, %ebp
leaq 0x98(%rsp), %r13
leaq 0x80(%rsp), %rcx
movd %esi, %xmm0
movd %edi, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2ps %xmm1, %xmm1
movsd (%rcx), %xmm0
cvtdq2ps %xmm0, %xmm2
divps %xmm2, %xmm1
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
ucomiss %xmm1, %xmm2
jbe 0x19872
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, %eax
imull %ebp, %eax
movd %xmm0, %esi
cltd
idivl %esi
movl %eax, %r15d
movl %ebp, %r12d
jmp 0x1988b
movd %xmm0, %eax
imull %ebx, %eax
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %esi
cltd
idivl %esi
movl %eax, %r12d
movl %ebx, %r15d
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x170fa
subl %r12d, %ebp
movl %ebp, %edi
shrl $0x1f, %edi
addl %ebp, %edi
sarl %edi
subl %r15d, %ebx
movl %ebx, %esi
shrl $0x1f, %esi
addl %ebx, %esi
sarl %esi
movq 0x10(%r13), %rax
movq %rax, 0x28(%rsp)
movups (%r13), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x162c2
movq 0x10(%r14), %rdi
addq $0x48, %rsp
testq %rdi, %rdi
je 0x1990b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3040
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: resize_max
image resize_max(image im, int max)
{
    int w = im.w;
    int h = im.h;
    if(w > h){
        h = (h * max) / w;
        w = max;
    } else {
        w = (w * max) / h;
        h = max;
    }
    if(w == im.w && h == im.h) return im;
    image resized = resize_image(im, w, h);
    return resized;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %esi, %ecx
movq %rdi, %rbx
movl 0x30(%rsp), %edi
movl 0x34(%rsp), %r8d
cmpl %r8d, %edi
jle 0x19b6b
movl %r8d, %eax
imull %ecx, %eax
cltd
idivl %edi
movl %ecx, %esi
movl %eax, %ecx
jmp 0x19b76
movl %edi, %eax
imull %ecx, %eax
cltd
idivl %r8d
movl %eax, %esi
leaq 0x30(%rsp), %rax
xorl %esi, %edi
xorl %ecx, %r8d
orl %edi, %r8d
jne 0x19b95
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movups (%rax), %xmm0
movups %xmm0, (%rbx)
jmp 0x19baf
movq 0x10(%rax), %rdx
movq %rdx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %ecx, %edx
callq 0x170fa
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: resize_min
image resize_min(image im, int min)
{
    int w = im.w;
    int h = im.h;
    if(w < h){
        h = (h * min) / w;
        w = min;
    } else {
        w = (w * min) / h;
        h = min;
    }
    if(w == im.w && h == im.h) return im;
    image resized = resize_image(im, w, h);
    return resized;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %esi, %ecx
movq %rdi, %rbx
movl 0x30(%rsp), %edi
movl 0x34(%rsp), %r8d
cmpl %r8d, %edi
jge 0x19bdf
movl %r8d, %eax
imull %ecx, %eax
cltd
idivl %edi
movl %ecx, %esi
movl %eax, %ecx
jmp 0x19bea
movl %edi, %eax
imull %ecx, %eax
cltd
idivl %r8d
movl %eax, %esi
leaq 0x30(%rsp), %rax
xorl %esi, %edi
xorl %ecx, %r8d
orl %edi, %r8d
jne 0x19c09
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movups (%rax), %xmm0
movups %xmm0, (%rbx)
jmp 0x19c23
movq 0x10(%rax), %rdx
movq %rdx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %ecx, %edx
callq 0x170fa
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq