LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/blas.c
// Function: logistic_x_ent_cpu
void logistic_x_ent_cpu(int n, float *pred, float *truth, float *delta, float *error)
{
    int i;
    for(i = 0; i < n; ++i){
        float t = truth[i];
        float p = pred[i];
        error[i] = -t*log(p) - (1-t)*log(1-p);
        delta[i] = t-p;
    }
}

// Assembly:
testl %edi, %edi
jle 0x28a14
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %r13d
xorl %ebp, %ebp
movss (%r15,%rbp,4), %xmm0
movaps %xmm0, 0x20(%rsp)
movss (%r12,%rbp,4), %xmm1
movss %xmm1, 0x4(%rsp)
xorps 0x2a7d2(%rip), %xmm0    # 0x53150
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
callq 0x31e0
movsd %xmm0, 0x10(%rsp)
movss 0x2a666(%rip), %xmm1    # 0x53008
movaps %xmm1, %xmm0
subss 0x20(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movaps %xmm1, %xmm0
subss 0x4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x31e0
mulsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbx,%rbp,4)
movaps 0x20(%rsp), %xmm0
subss 0x4(%rsp), %xmm0
movss %xmm0, (%r14,%rbp,4)
incq %rbp
cmpq %rbp, %r13
jne 0x28960
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/blas.c
// Function: l2_cpu
void l2_cpu(int n, float *pred, float *truth, float *delta, float *error)
{
    int i;
    for(i = 0; i < n; ++i){
        float diff = truth[i] - pred[i];
        error[i] = diff * diff;
        delta[i] = diff;
    }
}

// Assembly:
testl %edi, %edi
jle 0x28a41
movl %edi, %eax
xorl %edi, %edi
movss (%rdx,%rdi,4), %xmm0
subss (%rsi,%rdi,4), %xmm0
movaps %xmm0, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%r8,%rdi,4)
movss %xmm0, (%rcx,%rdi,4)
incq %rdi
cmpq %rdi, %rax
jne 0x28a1d
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/blas.c
// Function: softmax
void softmax(float *input, int n, float temp, int stride, float *output)
{
    int i;
    float sum = 0;
    float largest = -FLT_MAX;
    for(i = 0; i < n; ++i){
        if(input[i*stride] > largest) largest = input[i*stride];
    }
    for(i = 0; i < n; ++i){
        float e = exp(input[i*stride]/temp - largest/temp);
        sum += e;
        output[i*stride] = e;
    }
    for(i = 0; i < n; ++i){
        output[i*stride] /= sum;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movaps %xmm0, %xmm1
movq %rdi, %r14
movslq %edx, %rdi
movl %esi, %r15d
testl %esi, %esi
jle 0x28ac1
leaq (,%rdi,4), %rax
movss 0x2dc7a(%rip), %xmm0    # 0x56720
movq %r15, %rcx
movq %r14, %rdx
movss (%rdx), %xmm3
maxss %xmm0, %xmm3
addq %rax, %rdx
movaps %xmm3, %xmm0
decq %rcx
jne 0x28aac
jmp 0x28ac9
movss 0x2dc57(%rip), %xmm3    # 0x56720
movl %esi, (%rsp)
testl %esi, %esi
movq %rdi, 0x10(%rsp)
jle 0x28b3b
divss %xmm1, %xmm3
leaq (,%rdi,4), %r13
xorps %xmm2, %xmm2
xorl %ebp, %ebp
movq %r15, %r12
movss %xmm1, 0x8(%rsp)
movss %xmm3, 0x4(%rsp)
movss %xmm2, 0xc(%rsp)
movss (%r14,%rbp), %xmm0
divss %xmm1, %xmm0
subss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x34e0
movss 0x4(%rsp), %xmm3
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
cvtsd2ss %xmm0, %xmm0
addss %xmm0, %xmm2
movss %xmm0, (%rbx,%rbp)
addq %r13, %rbp
decq %r12
jne 0x28af5
jmp 0x28b3e
xorps %xmm2, %xmm2
cmpl $0x0, (%rsp)
movq 0x10(%rsp), %rax
jle 0x28b61
shlq $0x2, %rax
movss (%rbx), %xmm0
divss %xmm2, %xmm0
movss %xmm0, (%rbx)
addq %rax, %rbx
decq %r15
jne 0x28b4d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/blas.c
// Function: softmax_cpu
void softmax_cpu(float *input, int n, int batch, int batch_offset, int groups, int group_offset, int stride, float temp, float *output)
{
    int g, b;
    for(b = 0; b < batch; ++b){
        for(g = 0; g < groups; ++g){
            softmax(input + b*batch_offset + g*group_offset, n, temp, stride, output + b*batch_offset + g*group_offset);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, (%rsp)
movq %rdi, 0x10(%rsp)
testl %edx, %edx
jle 0x28c23
movl %esi, %ebp
movq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x70(%rsp), %r15d
movslq %r9d, %r14
movslq %ecx, %rax
movl %edx, %ecx
movq %rcx, 0x20(%rsp)
movl (%rsp), %ecx
movq %rcx, 0x18(%rsp)
shlq $0x2, %rax
movq %rax, 0x28(%rsp)
shlq $0x2, %r14
xorl %ecx, %ecx
movss %xmm0, 0x4(%rsp)
movq %rcx, 0x30(%rsp)
cmpl $0x0, (%rsp)
jle 0x28c05
movq 0x18(%rsp), %rbx
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebp, %esi
movss 0x4(%rsp), %xmm0
movl %r15d, %edx
movq %r12, %rcx
callq 0x28a75
addq %r14, %r13
addq %r14, %r12
decq %rbx
jne 0x28be4
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x28(%rsp), %rax
addq %rax, 0x10(%rsp)
addq %rax, 0x8(%rsp)
cmpq 0x20(%rsp), %rcx
jne 0x28bca
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/blas.c
// Function: upsample_cpu
void upsample_cpu(float *in, int w, int h, int c, int batch, int stride, int forward, float scale, float *out)
{
    int i, j, k, b;
    for(b = 0; b < batch; ++b){
        for(k = 0; k < c; ++k){
            for(j = 0; j < h*stride; ++j){
                for(i = 0; i < w*stride; ++i){
                    int in_index = b*w*h*c + k*w*h + (j/stride)*w + i/stride;
                    int out_index = b*w*h*c*stride*stride + k*w*h*stride*stride + j*w*stride + i;
                    if(forward) out[out_index] = scale*in[in_index];
                    else in[in_index] += scale*out[out_index];
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, -0x2c(%rsp)
movl %r8d, -0x14(%rsp)
testl %r8d, %r8d
jle 0x28d79
movl 0x38(%rsp), %ebp
movl %r9d, %r12d
imull %edx, %r12d
movl %r9d, %r13d
imull %esi, %r13d
movl %r9d, %eax
imull %r9d, %eax
imull %esi, %edx
movl %edx, %ecx
imull %eax, %ecx
movl %ecx, -0xc(%rsp)
imull -0x2c(%rsp), %eax
movl %edx, -0x10(%rsp)
imull %edx, %eax
movl %eax, -0x18(%rsp)
movq $0x0, -0x20(%rsp)
movl $0x0, -0x28(%rsp)
cmpl $0x0, -0x2c(%rsp)
jle 0x28d57
movl -0x28(%rsp), %eax
imull -0x2c(%rsp), %eax
movq %rax, -0x8(%rsp)
xorl %r8d, %r8d
movq -0x20(%rsp), %rax
movl %eax, -0x24(%rsp)
testl %r12d, %r12d
jle 0x28d3d
movq -0x8(%rsp), %rax
leal (%r8,%rax), %ecx
imull -0x10(%rsp), %ecx
movl -0x24(%rsp), %r10d
xorl %r11d, %r11d
testl %r13d, %r13d
jle 0x28d32
movslq %r10d, %rax
movq 0x40(%rsp), %rdx
leaq (%rdx,%rax,4), %r15
movl %r11d, %eax
cltd
idivl %r9d
movl %eax, %ebx
imull %esi, %ebx
addl %ecx, %ebx
xorl %r14d, %r14d
movl %r14d, %eax
cltd
idivl %r9d
addl %ebx, %eax
cltq
testl %ebp, %ebp
je 0x28d16
movss (%rdi,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%r15,%r14,4)
jmp 0x28d2a
movss (%r15,%r14,4), %xmm1
mulss %xmm0, %xmm1
addss (%rdi,%rax,4), %xmm1
movss %xmm1, (%rdi,%rax,4)
incq %r14
cmpq %r14, %r13
jne 0x28cf6
incq %r11
addl %r13d, %r10d
cmpq %r12, %r11
jne 0x28cd4
incl %r8d
movl -0x24(%rsp), %eax
addl -0xc(%rsp), %eax
movl %eax, -0x24(%rsp)
cmpl -0x2c(%rsp), %r8d
jne 0x28cb9
movl -0x28(%rsp), %ecx
incl %ecx
movq -0x20(%rsp), %rax
addl -0x18(%rsp), %eax
movq %rax, -0x20(%rsp)
movl %ecx, -0x28(%rsp)
cmpl -0x14(%rsp), %ecx
jne 0x28c94
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/crop_layer.c
// Function: get_crop_image
image get_crop_image(crop_layer l)
{
    int h = l.out_h;
    int w = l.out_w;
    int c = l.out_c;
    return float_to_image(w,h,c,l.output);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x88(%rsp), %edx
movl 0x8c(%rsp), %esi
movl 0x90(%rsp), %ecx
movq 0x278(%rsp), %r8
callq 0x1675b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/crop_layer.c
// Function: resize_crop_layer
void resize_crop_layer(layer *l, int w, int h)
{
    l->w = w;
    l->h = h;

    l->out_w =  l->scale*w;
    l->out_h =  l->scale*h;

    l->inputs = l->w * l->h * l->c;
    l->outputs = l->out_h * l->out_w * l->out_c;

    l->output = realloc(l->output, l->batch*l->outputs*sizeof(float));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x70(%rdi)
movl %edx, 0x6c(%rdi)
movss 0x194(%rdi), %xmm0
cvtsi2ss %esi, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl %eax, 0x7c(%rdi)
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movl %ecx, 0x78(%rdi)
imull %esi, %edx
imull 0x74(%rdi), %edx
movl %edx, 0x54(%rdi)
imull %eax, %ecx
movslq 0x80(%rdi), %rax
movslq %ecx, %rcx
imulq %rax, %rcx
movl %ecx, 0x58(%rdi)
movq 0x268(%rdi), %rdi
movslq 0x48(%rbx), %rsi
imulq %rcx, %rsi
shlq $0x2, %rsi
callq 0x3360
movq %rax, 0x268(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/dropout_layer.c
// Function: forward_dropout_layer
void forward_dropout_layer(dropout_layer l, network net)
{
    int i;
    if (!net.train) return;
    for(i = 0; i < l.batch * l.inputs; ++i){
        float r = rand_uniform(0, 1);
        l.rand[i] = r;
        if(r < l.probability) net.input[i] = 0;
        else net.input[i] *= l.scale;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x5c8(%rsp)
je 0x29076
leaq 0x30(%rsp), %rcx
movl 0x54(%rcx), %eax
imull 0x48(%rcx), %eax
testl %eax, %eax
jle 0x29076
leaq 0x4d0(%rsp), %rdx
movq 0x1d0(%rcx), %rbx
movss 0x190(%rcx), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x194(%rcx), %xmm0
movss %xmm0, (%rsp)
movq 0xd8(%rdx), %r14
movl %eax, %r15d
xorl %r12d, %r12d
xorps %xmm0, %xmm0
movss 0x29fc4(%rip), %xmm1    # 0x53008
callq 0xf201
movss %xmm0, (%rbx,%r12,4)
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
xorps %xmm0, %xmm0
ja 0x29068
movss (%r14,%r12,4), %xmm0
mulss (%rsp), %xmm0
movss %xmm0, (%r14,%r12,4)
incq %r12
cmpq %r12, %r15
jne 0x29039
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/dropout_layer.c
// Function: backward_dropout_layer
void backward_dropout_layer(dropout_layer l, network net)
{
    int i;
    if(!net.delta) return;
    for(i = 0; i < l.batch * l.inputs; ++i){
        float r = l.rand[i];
        if(r < l.probability) net.delta[i] = 0;
        else net.delta[i] *= l.scale;
    }
}

// Assembly:
movq 0x590(%rsp), %rax
testq %rax, %rax
je 0x290d9
leaq 0x8(%rsp), %rsi
movl 0x54(%rsi), %edx
imull 0x48(%rsi), %edx
testl %edx, %edx
jle 0x290d9
movq 0x1d0(%rsi), %rcx
movss 0x190(%rsi), %xmm0
movss 0x194(%rsi), %xmm1
movl %edx, %edx
xorl %esi, %esi
xorps %xmm2, %xmm2
ucomiss (%rcx,%rsi,4), %xmm0
ja 0x290cc
movss (%rax,%rsi,4), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x290ba
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/maxpool_layer.c
// Function: get_maxpool_image
image get_maxpool_image(maxpool_layer l)
{
    int h = l.out_h;
    int w = l.out_w;
    int c = l.c;
    return float_to_image(w,h,c,l.output);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x84(%rsp), %ecx
movl 0x88(%rsp), %edx
movl 0x8c(%rsp), %esi
movq 0x278(%rsp), %r8
callq 0x1675b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/maxpool_layer.c
// Function: get_maxpool_delta
image get_maxpool_delta(maxpool_layer l)
{
    int h = l.out_h;
    int w = l.out_w;
    int c = l.c;
    return float_to_image(w,h,c,l.delta);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x84(%rsp), %ecx
movl 0x88(%rsp), %edx
movl 0x8c(%rsp), %esi
movq 0x270(%rsp), %r8
callq 0x1675b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/maxpool_layer.c
// Function: backward_maxpool_layer
void backward_maxpool_layer(const maxpool_layer l, network net)
{
    int i;
    int h = l.out_h;
    int w = l.out_w;
    int c = l.c;
    for(i = 0; i < h*w*c*l.batch; ++i){
        int index = l.indexes[i];
        net.delta[index] += l.delta[i];
    }
}

// Assembly:
movl 0x84(%rsp), %esi
imull 0x80(%rsp), %esi
imull 0x7c(%rsp), %esi
imull 0x50(%rsp), %esi
testl %esi, %esi
jle 0x2945d
leaq 0x4a8(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq 0x1a0(%rcx), %rax
movq 0x260(%rcx), %rcx
movq 0xe8(%rdx), %rdx
movl %esi, %esi
xorl %edi, %edi
movslq (%rax,%rdi,4), %r8
movss (%rcx,%rdi,4), %xmm0
addss (%rdx,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
incq %rdi
cmpq %rdi, %rsi
jne 0x29440
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/maxpool_layer.c
// Function: resize_maxpool_layer
void resize_maxpool_layer(maxpool_layer *l, int w, int h)
{
    l->h = h;
    l->w = w;
    l->inputs = h*w*l->c;

    l->out_w = (w + l->pad - l->size)/l->stride + 1;
    l->out_h = (h + l->pad - l->size)/l->stride + 1;
    l->outputs = l->out_w * l->out_h * l->c;
    int output_size = l->outputs * l->batch;

    l->indexes = realloc(l->indexes, output_size * sizeof(int));
    l->output = realloc(l->output, output_size * sizeof(float));
    l->delta = realloc(l->delta, output_size * sizeof(float));

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ecx
movq %rdi, %rbx
movl %edx, 0x6c(%rdi)
movl %esi, 0x70(%rdi)
movl %edx, %eax
imull %esi, %eax
movl 0x74(%rdi), %r8d
movl 0x90(%rdi), %r9d
imull %r8d, %eax
movl %eax, 0x54(%rdi)
movl 0xa8(%rdi), %edi
leal (%rsi,%rdi), %eax
subl %r9d, %eax
movl 0x98(%rbx), %r10d
cltd
idivl %r10d
movl %eax, %esi
incl %esi
movl %esi, 0x7c(%rbx)
addl %ecx, %edi
subl %r9d, %edi
movl %edi, %eax
cltd
idivl %r10d
incl %eax
movl %eax, 0x78(%rbx)
imull %r8d, %esi
imull %eax, %esi
movl %esi, 0x58(%rbx)
movslq 0x48(%rbx), %rax
movslq %esi, %r14
imulq %rax, %r14
movq 0x1a0(%rbx), %rdi
shlq $0x2, %r14
movq %r14, %rsi
callq 0x3360
movq %rax, 0x1a0(%rbx)
movq 0x268(%rbx), %rdi
movq %r14, %rsi
callq 0x3360
movq %rax, 0x268(%rbx)
movq 0x260(%rbx), %rdi
movq %r14, %rsi
callq 0x3360
movq %rax, 0x260(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/softmax_layer.c
// Function: make_softmax_layer
softmax_layer make_softmax_layer(int batch, int inputs, int groups)
{
    assert(inputs%groups == 0);
    fprintf(stderr, "softmax                                        %4d\n",  inputs);
    softmax_layer l = {0};
    l.type = SOFTMAX;
    l.batch = batch;
    l.groups = groups;
    l.inputs = inputs;
    l.outputs = inputs;
    l.loss = calloc(inputs*batch, sizeof(float));
    l.output = calloc(inputs*batch, sizeof(float));
    l.delta = calloc(inputs*batch, sizeof(float));
    l.cost = calloc(1, sizeof(float));

    l.forward = forward_softmax_layer;
    l.backward = backward_softmax_layer;
    return l;
}

// Assembly:
pushq %rbx
movl %edx, %r9d
movl %edx, %eax
cltd
idivl %ecx
testl %edx, %edx
jne 0x2953e
movl %esi, %r8d
movq %rdi, %rbx
movl %r9d, %edi
movq %rbx, %rsi
movl %r8d, %edx
callq 0x48c7
movq %rbx, %rax
popq %rbx
retq
leaq 0x2d30b(%rip), %rdi     # 0x56850
leaq 0x2d317(%rip), %rsi     # 0x56863
leaq 0x2d320(%rip), %rcx     # 0x56873
movl $0xd, %edx
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/softmax_layer.c
// Function: forward_softmax_layer
void forward_softmax_layer(const softmax_layer l, network net)
{
    if(l.softmax_tree){
        int i;
        int count = 0;
        for (i = 0; i < l.softmax_tree->groups; ++i) {
            int group_size = l.softmax_tree->group_size[i];
            softmax_cpu(net.input + count, group_size, l.batch, l.inputs, 1, 0, 1, l.temperature, l.output + count);
            count += group_size;
        }
    } else {
        softmax_cpu(net.input, l.inputs/l.groups, l.batch, l.inputs, l.groups, l.inputs/l.groups, 1, l.temperature, l.output);
    }

    if(net.truth && !l.noloss){
        softmax_x_ent_cpu(l.batch*l.inputs, l.output, net.truth, l.delta, l.loss);
        l.cost[0] = sum_array(l.loss, l.batch*l.inputs);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x4f0(%rsp), %rax
leaq 0x50(%rsp), %r10
movq 0x490(%r10), %r13
testq %r13, %r13
je 0x29615
cmpl $0x0, 0x30(%r13)
jle 0x29657
movq 0xd8(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x50(%rsp), %rax
movl 0x48(%rax), %ecx
movl %ecx, 0xc(%rsp)
movl 0x54(%rax), %ebp
movss 0x18c(%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movq 0x268(%rax), %r15
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x38(%r13), %rax
movl (%rax,%r12,4), %r14d
movslq %ebx, %rbx
movq 0x10(%rsp), %rax
leaq (%rax,%rbx,4), %rdi
leaq (%r15,%rbx,4), %rax
movl %r14d, %esi
movl 0xc(%rsp), %edx
movl %ebp, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
movss 0x8(%rsp), %xmm0
pushq %rax
pushq $0x1
callq 0x28b70
addq $0x10, %rsp
addl %r14d, %ebx
incq %r12
movslq 0x30(%r13), %rax
cmpq %rax, %r12
jl 0x295c8
jmp 0x29657
movq 0xd8(%rax), %rdi
movl 0x48(%r10), %ecx
movl 0x54(%r10), %r9d
movl 0x8c(%r10), %r8d
movl %r9d, %eax
cltd
idivl %r8d
movss 0x18c(%r10), %xmm0
movl %eax, %esi
movl %ecx, %edx
movl %r9d, %ecx
movl %eax, %r9d
pushq 0x268(%r10)
pushq $0x1
callq 0x28b70
addq $0x10, %rsp
leaq 0x4f0(%rsp), %rax
movq 0xe0(%rax), %rdx
testq %rdx, %rdx
leaq 0x50(%rsp), %r15
je 0x296b7
cmpl $0x0, 0xf4(%r15)
jne 0x296b7
movl 0x54(%r15), %ebx
imull 0x48(%r15), %ebx
movq 0x268(%r15), %rsi
movq 0x260(%r15), %rcx
movq 0x270(%r15), %r14
movl %ebx, %edi
movq %r14, %r8
callq 0x288ac
movq %r14, %rdi
movl %ebx, %esi
callq 0xedee
movq 0x1d8(%r15), %rax
movss %xmm0, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: get_paths
list *get_paths(char *filename)
{
    char *path;
    FILE *file = fopen(filename, "r");
    if(!file) file_error(filename);
    list *lines = make_list();
    while((path=fgetl(file))){
        list_insert(lines, path);
    }
    fclose(file);
    return lines;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x2f5cb(%rip), %rsi     # 0x58cd1
callq 0x33a0
movq %rax, %rbx
testq %rax, %rax
jne 0x2971b
movq %r14, %rdi
callq 0xe142
xorl %eax, %eax
callq 0x10ea0
movq %rax, %r14
movq %rbx, %rdi
callq 0xe165
testq %rax, %rax
je 0x2973f
movq %r14, %rdi
movq %rax, %rsi
callq 0x10ef9
jmp 0x29725
movq %rbx, %rdi
callq 0x3140
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: get_random_paths
char **get_random_paths(char **paths, int n, int m)
{
    char **random_paths = calloc(n, sizeof(char*));
    int i;
    pthread_mutex_lock(&mutex);
    for(i = 0; i < n; ++i){
        int index = rand()%m;
        random_paths[i] = paths[index];
        //if(i == 0) printf("%s\n", paths[index]);
    }
    pthread_mutex_unlock(&mutex);
    return random_paths;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movslq %esi, %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x3260
movq %rax, %r15
leaq 0x4106a(%rip), %rdi     # 0x6a7e8
callq 0x34d0
testl %r12d, %r12d
jle 0x297a9
movl %ebp, %r12d
xorl %r13d, %r13d
callq 0x34f0
cltd
idivl %ebx
movslq %edx, %rax
movq (%r14,%rax,8), %rax
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x2978e
leaq 0x41038(%rip), %rdi     # 0x6a7e8
callq 0x3300
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: find_replace_paths
char **find_replace_paths(char **paths, int n, char *find, char *replace)
{
    char **replace_paths = calloc(n, sizeof(char*));
    int i;
    for(i = 0; i < n; ++i){
        char replaced[4096];
        find_replace(paths[i], find, replace, replaced);
        replace_paths[i] = copy_string(replaced);
    }
    return replace_paths;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movslq %esi, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movq %rax, %r12
testl %r13d, %r13d
jle 0x2982e
movl %ebp, %ebp
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movq (%r15,%rbx,8), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rcx
callq 0xe842
movq %r13, %rdi
callq 0xe753
movq %rax, (%r12,%rbx,8)
incq %rbx
cmpq %rbx, %rbp
jne 0x29806
movq %r12, %rax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_image_paths_gray
matrix load_image_paths_gray(char **paths, int n, int w, int h)
{
    int i;
    matrix X;
    X.rows = n;
    X.vals = calloc(X.rows, sizeof(float*));
    X.cols = 0;

    for(i = 0; i < n; ++i){
        image im = load_image(paths[i], w, h, 3);

        image gray = grayscale_image(im);
        free_image(im);
        im = gray;

        X.vals[i] = im.data;
        X.cols = im.h*im.w*im.c;
    }
    return X;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %r12
movslq %esi, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movq %rax, %rbx
movl %r13d, %r14d
testl %r13d, %r13d
jle 0x298fd
xorl %r13d, %r13d
movq (%r12,%r13,8), %rsi
leaq 0x20(%rsp), %rdi
movl %r15d, %edx
movl %ebp, %ecx
movl $0x3, %r8d
callq 0x18ef1
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x19f68
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movups 0x40(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rax, (%rbx,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0x2987b
movl 0x24(%rsp), %eax
imull 0x20(%rsp), %eax
imull 0x28(%rsp), %eax
shlq $0x20, %rax
jmp 0x298ff
xorl %eax, %eax
orq %rax, %r14
movq %r14, %rax
movq %rbx, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_image_paths
matrix load_image_paths(char **paths, int n, int w, int h)
{
    int i;
    matrix X;
    X.rows = n;
    X.vals = calloc(X.rows, sizeof(float*));
    X.cols = 0;

    for(i = 0; i < n; ++i){
        image im = load_image_color(paths[i], w, h);
        X.vals[i] = im.data;
        X.cols = im.h*im.w*im.c;
    }
    return X;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %r12
movslq %esi, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movq %rax, %rbx
movl %r13d, %r14d
testl %r13d, %r13d
jle 0x29980
xorl %r13d, %r13d
movq (%r12,%r13,8), %rsi
movq %rsp, %rdi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x160b6
movq 0x10(%rsp), %rax
movq %rax, (%rbx,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0x2994b
movl 0x4(%rsp), %eax
imull (%rsp), %eax
imull 0x8(%rsp), %eax
shlq $0x20, %rax
jmp 0x29982
xorl %eax, %eax
orq %rax, %r14
movq %r14, %rax
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_image_augment_paths
matrix load_image_augment_paths(char **paths, int n, int min, int max, int size, float angle, float aspect, float hue, float saturation, float exposure, int center)
{
    int i;
    matrix X;
    X.rows = n;
    X.vals = calloc(X.rows, sizeof(float*));
    X.cols = 0;

    for(i = 0; i < n; ++i){
        image im = load_image_color(paths[i], 0, 0);
        image crop;
        if(center){
            crop = center_crop_image(im, size, size);
        } else {
            crop = random_augment_image(im, angle, aspect, min, max, size, size);
        }
        int flip = rand()%2;
        if (flip) flip_image(crop);
        random_distort_image(crop, hue, saturation, exposure);

        /*
        show_image(im, "orig");
        show_image(crop, "crop");
        cvWaitKey(0);
        */
        //grayscale_image_3c(crop);
        free_image(im);
        X.vals[i] = crop.data;
        X.cols = crop.h*crop.w*crop.c;
    }
    return X;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, %ebp
movss %xmm4, 0x54(%rsp)
movss %xmm3, 0x50(%rsp)
movss %xmm2, 0x4c(%rsp)
movss %xmm1, 0x48(%rsp)
movss %xmm0, 0x44(%rsp)
movl %r8d, %r15d
movl %ecx, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movq %rdi, %r12
movslq %esi, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movq %rax, %rbx
movl %r13d, %r14d
testl %r13d, %r13d
jle 0x29b11
xorl %r13d, %r13d
movq (%r12,%r13,8), %rsi
leaq 0x58(%rsp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x160b6
testl %ebp, %ebp
je 0x29a37
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
movl %r15d, %esi
movl %r15d, %edx
callq 0x18163
jmp 0x29a6e
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
movss 0x44(%rsp), %xmm0
movss 0x48(%rsp), %xmm1
movl 0x3c(%rsp), %esi
movl 0x40(%rsp), %edx
movl %r15d, %ecx
movl %r15d, %r8d
callq 0x19445
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
callq 0x34f0
testb $0x1, %al
je 0x29aa6
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x16f91
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0x4c(%rsp), %xmm0
movss 0x50(%rsp), %xmm1
movss 0x54(%rsp), %xmm2
callq 0x1a8a2
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x30(%rsp), %rax
movq %rax, (%rbx,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0x299fc
movl 0x24(%rsp), %eax
imull 0x20(%rsp), %eax
imull 0x28(%rsp), %eax
shlq $0x20, %rax
jmp 0x29b13
xorl %eax, %eax
orq %rax, %r14
movq %r14, %rax
movq %rbx, %rdx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: read_boxes
box_label *read_boxes(char *filename, int *n)
{
    FILE *file = fopen(filename, "r");
    if(!file) file_error(filename);
    float x, y, h, w;
    int id;
    int count = 0;
    int size = 64;
    box_label *boxes = calloc(size, sizeof(box_label));
    while(fscanf(file, "%d %f %f %f %f", &id, &x, &y, &w, &h) == 5){
        if(count == size) {
            size = size * 2;
            boxes = realloc(boxes, size*sizeof(box_label));
        }
        boxes[count].id = id;
        boxes[count].x = x;
        boxes[count].y = y;
        boxes[count].h = h;
        boxes[count].w = w;
        boxes[count].left   = x - w/2;
        boxes[count].right  = x + w/2;
        boxes[count].top    = y - h/2;
        boxes[count].bottom = y + h/2;
        ++count;
    }
    fclose(file);
    *n = count;
    return boxes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x2f188(%rip), %rsi     # 0x58cd1
callq 0x33a0
movq %rax, %r14
testq %rax, %rax
jne 0x29b5e
movq %rbx, %rdi
callq 0xe142
movl $0x40, %edi
movl $0x24, %esi
callq 0x3260
movq %rax, %r15
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0x2cdc0(%rip), %rsi     # 0x56940
xorl %r13d, %r13d
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0xc(%rsp), %r9
movq %r14, %rdi
xorl %eax, %eax
callq 0x30b0
cmpl $0x5, %eax
jne 0x29cc9
movq %r12, 0x20(%rsp)
movl $0x40, %ebp
movl $0x20, %ebx
leaq 0xc(%rsp), %r12
xorl %r13d, %r13d
movl %ebp, %eax
cmpq %rax, %r13
jne 0x29be0
addl %ebp, %ebp
movslq %ebp, %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rsi
movq %r15, %rdi
callq 0x3360
movq %rax, %r15
movl 0x1c(%rsp), %eax
movl %eax, -0x20(%r15,%rbx)
movss 0x18(%rsp), %xmm0
movss %xmm0, -0x1c(%r15,%rbx)
movss 0x14(%rsp), %xmm0
movss %xmm0, -0x18(%r15,%rbx)
movss 0x10(%rsp), %xmm0
movss %xmm0, -0x10(%r15,%rbx)
movss 0xc(%rsp), %xmm0
movss %xmm0, -0x14(%r15,%rbx)
movss 0x18(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
movss 0x29603(%rip), %xmm2    # 0x53234
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0xc(%r15,%rbx)
movss 0xc(%rsp), %xmm0
mulss %xmm2, %xmm0
addss 0x18(%rsp), %xmm0
movss %xmm0, -0x8(%r15,%rbx)
movss 0x14(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x4(%r15,%rbx)
movss 0x10(%rsp), %xmm0
mulss %xmm2, %xmm0
addss 0x14(%rsp), %xmm0
movss %xmm0, (%r15,%rbx)
incq %r13
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x2cca2(%rip), %rsi     # 0x56940
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x30b0
addq $0x24, %rbx
cmpl $0x5, %eax
je 0x29bc1
movq 0x20(%rsp), %r12
movq %r14, %rdi
callq 0x3140
movl %r13d, (%r12)
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: randomize_boxes
void randomize_boxes(box_label *b, int n)
{
    int i;
    for(i = 0; i < n; ++i){
        box_label swap = b[i];
        int index = rand()%n;
        b[i] = b[index];
        b[index] = swap;
    }
}

// Assembly:
testl %esi, %esi
jle 0x29d89
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %eax
shlq $0x2, %rax
leaq (%rax,%rax,8), %r15
xorl %r12d, %r12d
movl 0x20(%r14,%r12), %eax
movl %eax, 0x20(%rsp)
movups (%r14,%r12), %xmm0
movups 0x10(%r14,%r12), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
callq 0x34f0
cltd
idivl %ebx
movslq %edx, %rax
leaq (%rax,%rax,8), %rax
movl 0x20(%r14,%rax,4), %ecx
movl %ecx, 0x20(%r14,%r12)
movups (%r14,%rax,4), %xmm0
movups 0x10(%r14,%rax,4), %xmm1
movups %xmm1, 0x10(%r14,%r12)
movups %xmm0, (%r14,%r12)
movl 0x20(%rsp), %ecx
movl %ecx, 0x20(%r14,%rax,4)
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%r14,%rax,4)
movups %xmm0, (%r14,%rax,4)
addq $0x24, %r12
cmpq %r12, %r15
jne 0x29d0c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth_swag
void fill_truth_swag(char *path, float *truth, int classes, int flip, float dx, float dy, float sx, float sy)
{
    char labelpath[4096];
    find_replace(path, "images", "labels", labelpath);
    find_replace(labelpath, "JPEGImages", "labels", labelpath);
    find_replace(labelpath, ".jpg", ".txt", labelpath);
    find_replace(labelpath, ".JPG", ".txt", labelpath);
    find_replace(labelpath, ".JPEG", ".txt", labelpath);

    int count = 0;
    box_label *boxes = read_boxes(labelpath, &count);
    randomize_boxes(boxes, count);
    correct_boxes(boxes, count, dx, dy, sx, sy, flip);
    float x,y,w,h;
    int id;
    int i;

    for (i = 0; i < count && i < 90; ++i) {
        x =  boxes[i].x;
        y =  boxes[i].y;
        w =  boxes[i].w;
        h =  boxes[i].h;
        id = boxes[i].id;

        if (w < .0 || h < .0) continue;

        int index = (4+classes) * i;

        truth[index++] = x;
        truth[index++] = y;
        truth[index++] = w;
        truth[index++] = h;

        if (id < classes) truth[index+id] = 1;
    }
    free(boxes);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1020, %rsp           # imm = 0x1020
movss %xmm3, 0x18(%rsp)
movss %xmm2, 0x14(%rsp)
movss %xmm1, 0x10(%rsp)
movss %xmm0, 0xc(%rsp)
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
leaq 0x2c94d(%rip), %rsi     # 0x5694f
leaq 0x2c94d(%rip), %r12     # 0x56956
leaq 0x20(%rsp), %r15
movq %r12, %rdx
movq %r15, %rcx
callq 0xe842
leaq 0x2c93d(%rip), %rsi     # 0x5695d
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0xe842
leaq 0x2b71f(%rip), %rsi     # 0x55754
leaq 0x2e77d(%rip), %r12     # 0x587b9
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0xe842
leaq 0x2c917(%rip), %rsi     # 0x56968
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0xe842
leaq 0x2c907(%rip), %rsi     # 0x5696d
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0xe842
leaq 0x1c(%rsp), %r12
movl $0x0, (%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x29b2e
movq %rax, %r15
movl (%r12), %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x29ce7
movq %r15, %rdi
movl %r12d, %esi
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x18(%rsp), %xmm3
movl %ebp, %edx
callq 0x29d8a
testl %r12d, %r12d
jle 0x2a13f
leal 0x4(%rbx), %eax
cltq
decl %r12d
addq $0xc, %r14
shlq $0x2, %rax
cmpq $0x59, %r12
movl $0x59, %ecx
cmovbq %r12, %rcx
leaq (%rcx,%rcx,8), %rcx
leaq 0x24(,%rcx,4), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
movss 0xc(%r15,%rdx), %xmm1
ucomiss %xmm1, %xmm0
ja 0x2a133
movss 0x10(%r15,%rdx), %xmm2
ucomiss %xmm2, %xmm0
ja 0x2a133
movslq (%r15,%rdx), %rsi
movq 0x4(%r15,%rdx), %rdi
movq %rdi, -0xc(%r14)
movss %xmm1, -0x4(%r14)
movss %xmm2, (%r14)
cmpl %ebx, %esi
jge 0x2a133
movl $0x3f800000, 0x4(%r14,%rsi,4) # imm = 0x3F800000
addq %rax, %r14
addq $0x24, %rdx
cmpq %rdx, %rcx
jne 0x2a0f6
movq %r15, %rdi
callq 0x3040
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_rle
void load_rle(image im, int *rle, int n)
{
    int count = 0;
    int curr = 0;
    int i,j;
    for(i = 0; i < n; ++i){
        for(j = 0; j < rle[i]; ++j){
            im.data[count++] = curr;
        }
        curr = 1 - curr;
    }
    for(; count < im.h*im.w*im.c; ++count){
        im.data[count] = curr;
    }
}

// Assembly:
pushq %rbx
leaq 0x10(%rsp), %rax
testl %esi, %esi
jle 0x2a3e0
movq 0x10(%rax), %rdx
movl %esi, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %ecx, %ecx
movl (%rdi,%r8,4), %r10d
testl %r10d, %r10d
jle 0x2a3c2
xorps %xmm0, %xmm0
cvtsi2ss %r9d, %xmm0
movslq %ecx, %r11
leaq (%rdx,%r11,4), %rbx
xorl %r11d, %r11d
movss %xmm0, (%rbx,%r11,4)
incq %r11
cmpl %r11d, %r10d
jne 0x2a3b1
addl %r11d, %ecx
movl $0x1, %r10d
subl %r9d, %r10d
incq %r8
movl %r10d, %r9d
cmpq %rsi, %r8
jne 0x2a396
xorps %xmm0, %xmm0
cvtsi2ss %r10d, %xmm0
jmp 0x2a3e5
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movslq 0x4(%rax), %rdx
movslq (%rax), %rsi
imulq %rdx, %rsi
movslq 0x8(%rax), %rdx
imulq %rsi, %rdx
cmpl %edx, %ecx
jge 0x2a410
movq 0x10(%rax), %rax
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %rdx
jne 0x2a403
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: exclusive_image
void exclusive_image(image src)
{
    int k, j, i;
    int s = src.w*src.h;
    for(k = 0; k < src.c-1; ++k){
        for(i = 0; i < s; ++i){
            if (src.data[k*s + i]){
                for(j = k+1; j < src.c; ++j){
                    src.data[j*s + i] = 0;
                }
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x38(%rsp), %rax
cmpq $0x2, %rax
jl 0x2a4fb
leaq 0x30(%rsp), %rsi
movl 0x4(%rsi), %ecx
imull (%rsi), %ecx
leal -0x1(%rax), %edx
movq 0x10(%rsi), %rsi
movl %ecx, %edi
leaq (,%rdi,4), %r8
leaq (%rsi,%rdi,4), %r9
movl $0x1, %r10d
xorl %r11d, %r11d
xorps %xmm0, %xmm0
testl %ecx, %ecx
jle 0x2a4ed
movq %r11, %rbx
imulq %rdi, %rbx
leaq (%rsi,%rbx,4), %rbx
movq %r9, %r14
xorl %r15d, %r15d
movss (%rbx,%r15,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2a4c8
jnp 0x2a4e1
movq %rax, %r12
movq %r14, %r13
movl $0x0, (%r13)
addq %r8, %r13
decq %r12
cmpq %r12, %r10
jne 0x2a4ce
incq %r15
addq $0x4, %r14
cmpq %rdi, %r15
jne 0x2a4bb
incq %r11
incq %r10
addq %r8, %r9
cmpq %rdx, %r11
jne 0x2a4a6
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: bound_image
box bound_image(image im)
{
    int x,y;
    int minx = im.w;
    int miny = im.h;
    int maxx = 0;
    int maxy = 0;
    for(y = 0; y < im.h; ++y){
        for(x = 0; x < im.w; ++x){
            if(im.data[y*im.w + x]){
                minx = (x < minx) ? x : minx;
                miny = (y < miny) ? y : miny;
                maxx = (x > maxx) ? x : maxx;
                maxy = (y > maxy) ? y : maxy;
            }
        }
    }
    box b = {minx, miny, maxx-minx + 1, maxy-miny + 1};
    //printf("%f %f %f %f\n", b.x, b.y, b.w, b.h);
    return b;
}

// Assembly:
pushq %rbx
movl 0x10(%rsp), %edx
movslq 0x14(%rsp), %rsi
testq %rsi, %rsi
jle 0x2a576
leaq 0x10(%rsp), %rax
movq 0x10(%rax), %r9
leaq (,%rdx,4), %r10
xorl %r11d, %r11d
xorps %xmm0, %xmm0
xorl %eax, %eax
xorl %ecx, %ecx
movl %esi, %edi
movl %edx, %r8d
testl %edx, %edx
jle 0x2a569
xorl %ebx, %ebx
movss (%r9,%rbx,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2a547
jnp 0x2a561
cmpl %r8d, %ebx
cmovll %ebx, %r8d
cmpl %edi, %r11d
cmovll %r11d, %edi
cmpl %ecx, %ebx
cmovgl %ebx, %ecx
cmpl %eax, %r11d
cmovgl %r11d, %eax
incq %rbx
cmpq %rbx, %rdx
jne 0x2a53a
incq %r11
addq %r10, %r9
cmpq %rsi, %r11
jne 0x2a534
jmp 0x2a57f
xorl %ecx, %ecx
movl %edx, %r8d
movl %esi, %edi
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %r8d, %xmm0
cvtsi2ss %edi, %xmm2
subl %r8d, %ecx
incl %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
subl %edi, %eax
incl %eax
cvtsi2ss %eax, %xmm3
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: print_letters
void print_letters(float *pred, int n)
{
    int i;
    for(i = 0; i < n; ++i){
        int index = max_index(pred+i*NUMCHARS, NUMCHARS);
        printf("%c", int_to_alphanum(index));
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x2afb1
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
movq %rbx, %rdi
movl $0x25, %esi
callq 0xf278
movl %eax, %edi
callq 0xe78e
movsbl %al, %edi
callq 0x3060
addq $0x94, %rbx
decq %r14
jne 0x2af82
addq $0x8, %rsp
popq %rbx
popq %r14
movl $0xa, %edi
jmp 0x3060
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth_captcha
void fill_truth_captcha(char *path, int n, float *truth)
{
    char *begin = strrchr(path, '/');
    ++begin;
    int i;
    for(i = 0; i < strlen(begin) && i < n && begin[i] != '.'; ++i){
        int index = alphanum_to_int(begin[i]);
        if(index > 35) printf("Bad %c\n", begin[i]);
        truth[i*NUMCHARS+index] = 1;
    }
    for(;i < n; ++i){
        truth[i*NUMCHARS + NUMCHARS-1] = 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %ebx
movl $0x2f, %esi
callq 0x31a0
xorl %ecx, %ecx
testl %ebx, %ebx
jle 0x2b069
movq %rax, %r14
cmpb $0x0, 0x1(%rax)
je 0x2b069
movq %r14, %r15
incq %r15
movl %ebx, 0xc(%rsp)
movl %ebx, %r12d
movl $0x1, %ebp
xorl %ebx, %ebx
movb (%r14,%rbp), %al
cmpb $0x2e, %al
je 0x2b05f
movsbl %al, %edi
callq 0xe780
movl %eax, %r13d
cmpl $0x24, %eax
jl 0x2b02c
movsbl (%r14,%rbp), %esi
leaq 0x2b95d(%rip), %rdi     # 0x56982
xorl %eax, %eax
callq 0x3170
addl %ebx, %r13d
movslq %r13d, %rax
movq 0x10(%rsp), %rcx
movl $0x3f800000, (%rcx,%rax,4) # imm = 0x3F800000
movq %r15, %rdi
callq 0x3150
leaq 0x1(%rbp), %rcx
cmpq %r12, %rbp
jae 0x2b05a
addl $0x25, %ebx
cmpq %rbp, %rax
movq %rcx, %rbp
ja 0x2b001
decq %rcx
jmp 0x2b065
decq %rbp
movq %rbp, %rcx
movl 0xc(%rsp), %ebx
cmpl %ebx, %ecx
jge 0x2b09c
movl %ecx, %edx
movl %ebx, %eax
imulq $0x94, %rdx, %rcx
movq 0x10(%rsp), %rsi
addq %rsi, %rcx
addq $0x90, %rcx
subq %rdx, %rax
movl $0x3f800000, (%rcx)     # imm = 0x3F800000
addq $0x94, %rcx
decq %rax
jne 0x2b08a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_captcha
data load_data_captcha(char **paths, int n, int m, int k, int w, int h)
{
    if(m) paths = get_random_paths(paths, n, m);
    data d = {0};
    d.shallow = 0;
    d.X = load_image_paths(paths, n, w, h);
    d.y = make_matrix(n, k*NUMCHARS);
    int i;
    for(i = 0; i < n; ++i){
        fill_truth_captcha(paths[i], k, d.y.vals[i]);
    }
    if(m) free(paths);
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r13d
movl %r8d, %r14d
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
movl 0x40(%rsp), %ebp
testl %ecx, %ecx
movl %ecx, 0x4(%rsp)
je 0x2b0e1
movq %r15, %rdi
movl %r12d, %esi
movl %ecx, %edx
callq 0x29752
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x29917
movq %rax, 0x8(%rbx)
movq %rdx, 0x10(%rbx)
leal (%r14,%r14,8), %eax
leal (%r14,%rax,4), %esi
movl %r12d, %edi
callq 0x2f52e
movq %rax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
testl %r12d, %r12d
jle 0x2b149
movq %rdx, %r13
movl %r12d, %r12d
xorl %ebp, %ebp
movq (%r15,%rbp,8), %rdi
movq (%r13,%rbp,8), %rdx
movl %r14d, %esi
callq 0x2afbb
incq %rbp
cmpq %rbp, %r12
jne 0x2b130
cmpl $0x0, 0x4(%rsp)
je 0x2b158
movq %r15, %rdi
callq 0x3040
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_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_captcha_encode
data load_data_captcha_encode(char **paths, int n, int m, int w, int h)
{
    if(m) paths = get_random_paths(paths, n, m);
    data d = {0};
    d.shallow = 0;
    d.X = load_image_paths(paths, n, w, h);
    d.X.cols = 17100;
    d.y = d.X;
    if(m) free(paths);
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r15d
movl %r8d, %r12d
movl %ecx, %ebp
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
testl %ecx, %ecx
je 0x2b19a
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x29752
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x29917
movq %rax, 0x8(%rbx)
movq %rdx, 0x10(%rbx)
movl $0x42cc, 0xc(%rbx)      # imm = 0x42CC
movl 0x8(%rbx), %eax
movl %eax, 0x18(%rbx)
movl 0xc(%rbx), %eax
movl %eax, 0x1c(%rbx)
movq 0x10(%rbx), %rax
movq %rax, 0x20(%rbx)
testl %ebp, %ebp
je 0x2b1ec
movq %r14, %rdi
callq 0x3040
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_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth
void fill_truth(char *path, char **labels, int k, float *truth)
{
    int i;
    memset(truth, 0, k*sizeof(float));
    int count = 0;
    for(i = 0; i < k; ++i){
        if(strstr(path, labels[i])){
            truth[i] = 1;
            ++count;
            //printf("%s %s %d\n", path, labels[i], i);
        }
    }
    if(count != 1 && (k != 1 || count != 0)) printf("Too many or too few labels: %d, %s\n", count, path);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movslq %edx, %r13
leaq (,%r13,4), %rdx
xorl %r14d, %r14d
movq %rcx, %rdi
xorl %esi, %esi
callq 0x31d0
testl %r13d, %r13d
jle 0x2b261
movl 0x4(%rsp), %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq (%r12,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x34c0
testq %rax, %rax
je 0x2b259
movl $0x3f800000, (%r15,%rbp,4) # imm = 0x3F800000
incl %r14d
incq %rbp
cmpq %rbp, %r13
jne 0x2b23d
cmpl $0x1, %r14d
je 0x2b295
movl 0x4(%rsp), %eax
xorl $0x1, %eax
orl %r14d, %eax
je 0x2b295
leaq 0x2b710(%rip), %rdi     # 0x5698a
movl %r14d, %esi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3170
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_hierarchy
void fill_hierarchy(float *truth, int k, tree *hierarchy)
{
    int j;
    for(j = 0; j < k; ++j){
        if(truth[j]){
            int parent = hierarchy->parent[j];
            while(parent >= 0){
                truth[parent] = 1;
                parent = hierarchy->parent[parent];
            }
        }
    }
    int i;
    int count = 0;
    for(j = 0; j < hierarchy->groups; ++j){
        //printf("%d\n", count);
        int mask = 1;
        for(i = 0; i < hierarchy->group_size[j]; ++i){
            if(truth[count + i]){
                mask = 0;
                break;
            }
        }
        if (mask) {
            for(i = 0; i < hierarchy->group_size[j]; ++i){
                truth[count + i] = SECRET_NUM;
            }
        }
        count += hierarchy->group_size[j];
    }
}

// Assembly:
testl %esi, %esi
jle 0x2b2e1
movl %esi, %eax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movss (%rdi,%rcx,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2b2bb
jnp 0x2b2d9
movq 0x10(%rdx), %rsi
movl (%rsi,%rcx,4), %r8d
testl %r8d, %r8d
js 0x2b2d9
movl %r8d, %r8d
movl $0x3f800000, (%rdi,%r8,4) # imm = 0x3F800000
movl (%rsi,%r8,4), %r8d
jmp 0x2b2c3
incq %rcx
cmpq %rax, %rcx
jne 0x2b2af
movslq 0x30(%rdx), %rax
testq %rax, %rax
jle 0x2b347
movq 0x38(%rdx), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
xorl %esi, %esi
movslq (%rcx,%rdx,4), %r8
movslq %esi, %r9
testq %r8, %r8
jle 0x2b31d
leaq (%rdi,%r9,4), %r10
xorl %r11d, %r11d
movss (%r10,%r11,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2b339
jp 0x2b339
incq %r11
cmpq %r11, %r8
jne 0x2b308
testl %r8d, %r8d
jle 0x2b339
leaq (%rdi,%r9,4), %r9
xorl %r10d, %r10d
movl $0xc49a4000, (%r9,%r10,4) # imm = 0xC49A4000
incq %r10
cmpq %r10, %r8
jne 0x2b329
addl %esi, %r8d
incq %rdx
movl %r8d, %esi
cmpq %rax, %rdx
jne 0x2b2f5
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_labels_paths
matrix load_labels_paths(char **paths, int n, char **labels, int k, tree *hierarchy)
{
    matrix y = make_matrix(n, k);
    int i;
    for(i = 0; i < n && labels; ++i){
        fill_truth(paths[i], labels, k, y.vals[i]);
        if(hierarchy){
            fill_hierarchy(y.vals[i], k, hierarchy);
        }
    }
    return y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, 0x10(%rsp)
movl %esi, %edi
movl %ecx, %esi
callq 0x2f52e
movq %rax, 0x8(%rsp)
movq %rdx, %r13
testq %r14, %r14
sete %al
testl %r12d, %r12d
setle %cl
orb %al, %cl
jne 0x2b5c4
movl %r12d, %r12d
movl $0x1, %r15d
movq 0x10(%rsp), %rax
movq -0x8(%rax,%r15,8), %rdi
movq -0x8(%r13,%r15,8), %rcx
movq %r14, %rsi
movl %ebp, %edx
callq 0x2b1fe
testq %rbx, %rbx
je 0x2b5b3
movq -0x8(%r13,%r15,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2b2a4
testq %r14, %r14
je 0x2b5c4
leaq 0x1(%r15), %rax
cmpq %r12, %r15
movq %rax, %r15
jb 0x2b586
movq 0x8(%rsp), %rax
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq