LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: test_cifar_csvtrain
void test_cifar_csvtrain(char *cfg, char *weights)
{
    network *net = load_network(cfg, weights, 0);
    srand(time(0));

    data test = load_all_cifar10();

    matrix pred = network_predict_data(net, test);

    int i;
    for(i = 0; i < test.X.rows; ++i){
        image im = float_to_image(32, 32, 3, test.X.vals[i]);
        flip_image(im);
    }
    matrix pred2 = network_predict_data(net, test);
    scale_matrix(pred, .5);
    scale_matrix(pred2, .5);
    matrix_add_matrix(pred2, pred);

    matrix_to_csv(pred);
    fprintf(stderr, "Accuracy: %f\n", matrix_topk_accuracy(test.y, pred, 1));
    free_data(test);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorl %edx, %edx
callq 0x316bc
movq %rax, %rbx
xorl %edi, %edi
callq 0x32c0
movl %eax, %edi
callq 0x3220
leaq 0x50(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x30679
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups 0x30(%r12), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, 0x48(%rsp)
movq %rbx, %rdi
callq 0x32f01
movq %rax, %rbx
movq %rdx, %r14
cmpl $0x0, 0x8(%r12)
jle 0x9a93
xorl %r15d, %r15d
leaq 0x90(%rsp), %r12
pushq $0x20
popq %rbp
pushq $0x3
popq %r13
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %r8
movq %r12, %rdi
movl %ebp, %esi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x170ea
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1786a
incq %r15
movslq 0x58(%rsp), %rax
cmpq %rax, %r15
jl 0x9a50
movups 0x50(%rsp), %xmm0
movups 0x60(%rsp), %xmm1
movups 0x70(%rsp), %xmm2
movups 0x80(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq 0x48(%rsp), %rdi
callq 0x32f01
movq %rax, %r15
movq %rdx, %r12
movss 0x4b78f(%rip), %xmm0    # 0x55264
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31007
movq %r15, %rdi
movq %r12, %rsi
movss 0x4b776(%rip), %xmm0    # 0x55264
callq 0x31007
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x310ef
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31440
movq 0x624e2(%rip), %rax     # 0x6bff8
movq (%rax), %r15
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
pushq $0x1
popq %r8
movq %rbx, %rdx
movq %r14, %rcx
callq 0x30f1c
cvtss2sd %xmm0, %xmm0
leaq 0x508a1(%rip), %rsi     # 0x5a3de
movq %r15, %rdi
movb $0x1, %al
callq 0x3270
movups 0x50(%rsp), %xmm0
movups 0x60(%rsp), %xmm1
movups 0x70(%rsp), %xmm2
movups 0x80(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2d296
addq $0xa8, %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/cifar.c
// Function: eval_cifar_csv
void eval_cifar_csv()
{
    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");

    matrix pred = csv_to_matrix("results/combined.csv");
    fprintf(stderr, "%d %d\n", pred.rows, pred.cols);

    fprintf(stderr, "Accuracy: %f\n", matrix_topk_accuracy(test.y, pred, 1));
    free_data(test);
    free_matrix(pred);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
leaq 0x5077e(%rip), %rsi     # 0x5a31b
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x30336
leaq 0x5083b(%rip), %rdi     # 0x5a3ec
callq 0x31352
movq %rax, %r14
movq %rdx, %r15
movq 0x62435(%rip), %r12     # 0x6bff8
movq (%r12), %rdi
movq %rax, %rcx
shrq $0x20, %rcx
leaq 0x4fdb7(%rip), %rsi     # 0x5998c
movl %r14d, %edx
xorl %eax, %eax
callq 0x3270
movq (%r12), %r12
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rsi
pushq $0x1
popq %r8
movq %r14, %rdx
movq %r15, %rcx
callq 0x30f1c
cvtss2sd %xmm0, %xmm0
leaq 0x507d9(%rip), %rsi     # 0x5a3de
movq %r12, %rdi
movb $0x1, %al
callq 0x3270
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2d296
movq %r14, %rdi
movq %r15, %rsi
callq 0x30ee4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: ponder
mcts_tree *ponder(mcts_tree *tree, network *net, float *b, float *ko, int player, float cpuct)
{
    double t = what_time_is_it_now();
    int count = 0;
    if (tree) count = tree->total_count;
    while(!stdin_ready()){
        if (what_time_is_it_now() - t > 120) break;
        tree = run_mcts(tree, net, b, ko, player, 100000, cpuct, .1);
    }
    fprintf(stderr, "Pondered %d moves...\n", tree->total_count - count);
    return tree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movss %xmm0, 0x4(%rsp)
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
xorl %r13d, %r13d
xorl %eax, %eax
callq 0xe79c
movsd %xmm0, 0x8(%rsp)
testq %rbx, %rbx
je 0x9f78
movl 0x38(%rbx), %r13d
movl %r13d, (%rsp)
xorpd %xmm0, %xmm0
leaq 0x28(%rsp), %rsi
movupd %xmm0, 0x68(%rsi)
movupd %xmm0, 0x58(%rsi)
movupd %xmm0, 0x48(%rsi)
movupd %xmm0, 0x38(%rsi)
movupd %xmm0, 0x28(%rsi)
movupd %xmm0, 0x18(%rsi)
andq $0x0, 0x78(%rsi)
movupd %xmm0, 0x8(%rsi)
leaq 0x10(%rsp), %r8
movapd %xmm0, (%r8)
movq $0x1, (%rsi)
pushq $0x1
popq %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x32d0
testl %eax, %eax
jne 0xa07d
leaq 0x30(%rsp), %r13
xorl %eax, %eax
callq 0xe79c
subsd 0x8(%rsp), %xmm0
ucomisd 0x504a4(%rip), %xmm0    # 0x5a490
ja 0xa07d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movl $0x186a0, %r9d          # imm = 0x186A0
movss 0x4(%rsp), %xmm0
movss 0x4b283(%rip), %xmm1    # 0x55298
callq 0x46d4b
movq %rax, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x60(%r13)
movupd %xmm0, 0x50(%r13)
movupd %xmm0, 0x40(%r13)
movupd %xmm0, 0x30(%r13)
movupd %xmm0, 0x20(%r13)
andq $0x0, 0x70(%r13)
movupd %xmm0, 0x10(%r13)
movupd %xmm0, (%r13)
movapd %xmm0, 0x10(%rsp)
movq $0x1, 0x28(%rsp)
pushq $0x1
popq %rdi
leaq 0x28(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x10(%rsp), %r8
callq 0x32d0
testl %eax, %eax
je 0x9fd7
movq 0x61f74(%rip), %rax     # 0x6bff8
movq (%rax), %rdi
movl 0x38(%rbx), %edx
subl (%rsp), %edx
leaq 0x50560(%rip), %rsi     # 0x5a5f4
xorl %eax, %eax
callq 0x3270
movq %rbx, %rax
addq $0xa8, %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/gemm.c
// Function: gemm_bin
void gemm_bin(int M, int N, int K, float ALPHA, 
        char  *A, int lda, 
        float *B, int ldb,
        float *C, int ldc)
{
    int i,j,k;
    for(i = 0; i < M; ++i){
        for(k = 0; k < K; ++k){
            char A_PART = A[i*lda+k];
            if(A_PART){
                for(j = 0; j < N; ++j){
                    C[i*ldc+j] += B[k*ldb+j];
                }
            } else {
                for(j = 0; j < N; ++j){
                    C[i*ldc+j] -= B[k*ldb+j];
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x8(%rsp)
testl %edi, %edi
jle 0xe24f
movq 0x40(%rsp), %rax
movslq 0x38(%rsp), %r10
movslq %r8d, %r9
movslq 0x48(%rsp), %r11
movl %edi, %edi
movl %edx, %ebx
movl %esi, %r14d
shlq $0x2, %r11
shlq $0x2, %r10
xorl %r15d, %r15d
testl %edx, %edx
jle 0xe244
movq %r15, %r12
imulq %r9, %r12
addq %rcx, %r12
movq -0x8(%rsp), %r13
xorl %ebp, %ebp
cmpb $0x0, (%r12,%rbp)
je 0xe217
testl %esi, %esi
jle 0xe239
xorl %r8d, %r8d
movss (%r13,%r8,4), %xmm0
addss (%rax,%r8,4), %xmm0
movss %xmm0, (%rax,%r8,4)
incq %r8
cmpq %r8, %r14
jne 0xe1fa
jmp 0xe239
testl %esi, %esi
jle 0xe239
xorl %r8d, %r8d
movss (%rax,%r8,4), %xmm0
subss (%r13,%r8,4), %xmm0
movss %xmm0, (%rax,%r8,4)
incq %r8
cmpq %r8, %r14
jne 0xe21e
incq %rbp
addq %r10, %r13
cmpq %rbx, %rbp
jne 0xe1ec
incq %r15
addq %r11, %rax
cmpq %rdi, %r15
jne 0xe1d7
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/gemm.c
// Function: random_matrix
float *random_matrix(int rows, int cols)
{
    int i;
    float *m = calloc(rows*cols, sizeof(float));
    for(i = 0; i < rows*cols; ++i){
        m[i] = (float)rand()/RAND_MAX;
    }
    return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
imull %esi, %ebp
movslq %ebp, %r14
movl $0x4, %esi
movq %r14, %rdi
callq 0x3250
movq %rax, %rbx
testl %r14d, %r14d
jle 0xe2a6
movl %ebp, %r14d
xorl %r15d, %r15d
callq 0x34e0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x46d6c(%rip), %xmm0    # 0x55004
movss %xmm0, (%rbx,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0xe284
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/gemm.c
// Function: time_random_matrix
void time_random_matrix(int TA, int TB, int m, int k, int n)
{
    float *a;
    if(!TA) a = random_matrix(m,k);
    else a = random_matrix(k,m);
    int lda = (!TA)?k:m;
    float *b;
    if(!TB) b = random_matrix(k,n);
    else b = random_matrix(n,k);
    int ldb = (!TB)?n:k;

    float *c = random_matrix(m,n);
    int i;
    clock_t start = clock(), end;
    for(i = 0; i<10; ++i){
        gemm_cpu(TA,TB,m,n,k,1,a,lda,b,ldb,1,c,n);
    }
    end = clock();
    printf("Matrix Multiplication %dx%d * %dx%d, TA=%d, TB=%d: %lf ms\n",m,k,k,n, TA, TB, (float)(end-start)/CLOCKS_PER_SEC);
    free(a);
    free(b);
    free(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r14d
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %r15d
testl %edi, %edi
je 0xe2e2
movl %ebp, %edi
movl %r12d, %esi
callq 0xe25a
movl %r12d, %ecx
jmp 0xe2ee
movl %r12d, %edi
movl %ebp, %esi
callq 0xe25a
movl %ebp, %ecx
movq %rcx, 0x30(%rsp)
movq %rax, 0x18(%rsp)
movl %r12d, 0x4(%rsp)
movq %rbx, 0x20(%rsp)
testl %ebx, %ebx
je 0xe31c
movl %r14d, %edi
movl %ebp, %esi
callq 0xe25a
movq %rax, 0x8(%rsp)
movl %ebp, %r13d
movl %ebp, %ebx
jmp 0xe331
movl %ebp, %r13d
movl %ebp, %edi
movl %r14d, %esi
callq 0xe25a
movq %rax, 0x8(%rsp)
movl %r14d, %ebx
movl 0x4(%rsp), %edi
movl %r14d, %esi
callq 0xe25a
movq %rax, 0x10(%rsp)
movl $0xa, %ebp
callq 0x3120
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %r12
subq $0x8, %rsp
movl %r15d, %edi
movq 0x28(%rsp), %rsi
movl 0xc(%rsp), %edx
movl %r14d, %ecx
movl %r13d, %r8d
movss 0x46c94(%rip), %xmm0    # 0x55008
movq 0x20(%rsp), %r9
movaps %xmm0, %xmm1
pushq %r14
pushq 0x20(%rsp)
pushq %rbx
pushq 0x28(%rsp)
pushq %r12
callq 0xe40a
addq $0x30, %rsp
decl %ebp
jne 0xe356
callq 0x3120
subq 0x28(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss 0x46c5c(%rip), %xmm0    # 0x5500c
cvtss2sd %xmm0, %xmm0
subq $0x8, %rsp
leaq 0x46c51(%rip), %rdi     # 0x55010
movl 0xc(%rsp), %esi
movl %r13d, %edx
movl %r13d, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
movb $0x1, %al
pushq 0x28(%rsp)
callq 0x3160
addq $0x10, %rsp
movq 0x18(%rsp), %rdi
callq 0x3040
movq 0x8(%rsp), %rdi
callq 0x3040
movq 0x10(%rsp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3040
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/gemm.c
// Function: gemm_cpu
void gemm_cpu(int TA, int TB, int M, int N, int K, float ALPHA, 
        float *A, int lda, 
        float *B, int ldb,
        float BETA,
        float *C, int ldc)
{
    //printf("cpu: %d %d %d %d %d %f %d %d %f %d\n",TA, TB, M, N, K, ALPHA, lda, ldb, BETA, ldc);
    int i, j;
    for(i = 0; i < M; ++i){
        for(j = 0; j < N; ++j){
            C[i*ldc + j] *= BETA;
        }
    }
    if(!TA && !TB)
        gemm_nn(M, N, K, ALPHA,A,lda, B, ldb,C,ldc);
    else if(TA && !TB)
        gemm_tn(M, N, K, ALPHA,A,lda, B, ldb,C,ldc);
    else if(!TA && TB)
        gemm_nt(M, N, K, ALPHA,A,lda, B, ldb,C,ldc);
    else
        gemm_tt(M, N, K, ALPHA,A,lda, B, ldb,C,ldc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rax
movl %r8d, %r10d
movl 0x60(%rsp), %ebx
movq 0x58(%rsp), %r11
testl %edx, %edx
jle 0xe465
movslq %ebx, %r8
movl %edx, %r9d
movl %ecx, %r14d
shlq $0x2, %r8
xorl %r15d, %r15d
movq %r11, %r12
testl %ecx, %ecx
jle 0xe45a
xorl %r13d, %r13d
movss (%r12,%r13,4), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, (%r12,%r13,4)
incq %r13
cmpq %r13, %r14
jne 0xe442
incq %r15
addq %r8, %r12
cmpq %r9, %r15
jne 0xe43b
movl 0x50(%rsp), %r14d
movq 0x48(%rsp), %r9
movl 0x40(%rsp), %r8d
movl %esi, %ebp
orl %edi, %ebp
je 0xe4b6
testl %esi, %esi
setne %bpl
testl %edi, %edi
sete %r15b
orb %bpl, %r15b
je 0xe4d0
testl %edi, %edi
setne %dil
testl %esi, %esi
sete %sil
subq $0x8, %rsp
orb %dil, %sil
jne 0xe4ea
movl %edx, %edi
movl %ecx, %esi
movl %r10d, %edx
movq %rax, %rcx
pushq %rbx
pushq %r11
pushq %r14
callq 0xe5b4
jmp 0xe4fe
subq $0x8, %rsp
movl %edx, %edi
movl %ecx, %esi
movl %r10d, %edx
movq %rax, %rcx
pushq %rbx
pushq %r11
pushq %r14
callq 0xe512
jmp 0xe4fe
subq $0x8, %rsp
movl %edx, %edi
movl %ecx, %esi
movl %r10d, %edx
movq %rax, %rcx
pushq %rbx
pushq %r11
pushq %r14
callq 0xe650
jmp 0xe4fe
movl %edx, %edi
movl %ecx, %esi
movl %r10d, %edx
movq %rax, %rcx
pushq %rbx
pushq %r11
pushq %r14
callq 0xe6ec
addq $0x28, %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/gemm.c
// Function: gemm_nn
void gemm_nn(int M, int N, int K, float ALPHA, 
        float *A, int lda, 
        float *B, int ldb,
        float *C, int ldc)
{
    int i,j,k;
    #pragma omp parallel for
    for(i = 0; i < M; ++i){
        for(k = 0; k < K; ++k){
            register float A_PART = ALPHA*A[i*lda+k];
            for(j = 0; j < N; ++j){
                C[i*ldc+j] += A_PART*B[k*ldb+j];
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x8(%rsp)
testl %edi, %edi
jle 0xe5a9
movq 0x40(%rsp), %rax
movslq 0x38(%rsp), %r10
movslq %r8d, %r9
movslq 0x48(%rsp), %r11
movl %edi, %edi
movl %edx, %ebx
movl %esi, %r14d
shlq $0x2, %r11
shlq $0x2, %r10
xorl %r15d, %r15d
testl %edx, %edx
jle 0xe59e
movq %r15, %r8
imulq %r9, %r8
leaq (%rcx,%r8,4), %r12
movq -0x8(%rsp), %r13
xorl %ebp, %ebp
testl %esi, %esi
jle 0xe593
movss (%r12,%rbp,4), %xmm1
mulss %xmm0, %xmm1
xorl %r8d, %r8d
movss (%r13,%r8,4), %xmm2
mulss %xmm1, %xmm2
addss (%rax,%r8,4), %xmm2
movss %xmm2, (%rax,%r8,4)
incq %r8
cmpq %r8, %r14
jne 0xe574
incq %rbp
addq %r10, %r13
cmpq %rbx, %rbp
jne 0xe563
incq %r15
addq %r11, %rax
cmpq %rdi, %r15
jne 0xe54d
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/gemm.c
// Function: gemm_nt
void gemm_nt(int M, int N, int K, float ALPHA, 
        float *A, int lda, 
        float *B, int ldb,
        float *C, int ldc)
{
    int i,j,k;
    #pragma omp parallel for
    for(i = 0; i < M; ++i){
        for(j = 0; j < N; ++j){
            register float sum = 0;
            for(k = 0; k < K; ++k){
                sum += ALPHA*A[i*lda+k]*B[j*ldb + k];
            }
            C[i*ldc+j] += sum;
        }
    }
}

// Assembly:
testl %edi, %edi
jle 0xe64f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x38(%rsp), %r10
movslq %r8d, %r8
movslq 0x48(%rsp), %r11
movl %edi, %edi
movl %esi, %ebx
movl %edx, %r14d
shlq $0x2, %r10
shlq $0x2, %r8
xorl %r15d, %r15d
testl %esi, %esi
jle 0xe63a
movq %r15, %rax
imulq %r11, %rax
movq 0x40(%rsp), %r12
leaq (%r12,%rax,4), %r12
movq %r9, %r13
xorl %ebp, %ebp
xorps %xmm1, %xmm1
testl %edx, %edx
jle 0xe623
xorl %eax, %eax
movss (%rcx,%rax,4), %xmm2
mulss %xmm0, %xmm2
mulss (%r13,%rax,4), %xmm2
addss %xmm2, %xmm1
incq %rax
cmpq %rax, %r14
jne 0xe607
addss (%r12,%rbp,4), %xmm1
movss %xmm1, (%r12,%rbp,4)
incq %rbp
addq %r10, %r13
cmpq %rbx, %rbp
jne 0xe5fe
incq %r15
addq %r8, %rcx
cmpq %rdi, %r15
jne 0xe5e5
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/gemm.c
// Function: gemm_tt
void gemm_tt(int M, int N, int K, float ALPHA, 
        float *A, int lda, 
        float *B, int ldb,
        float *C, int ldc)
{
    int i,j,k;
    #pragma omp parallel for
    for(i = 0; i < M; ++i){
        for(j = 0; j < N; ++j){
            register float sum = 0;
            for(k = 0; k < K; ++k){
                sum += ALPHA*A[i+k*lda]*B[k+j*ldb];
            }
            C[i*ldc+j] += sum;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x8(%rsp)
testl %edi, %edi
jle 0xe78e
movq %rcx, %rax
movslq %r8d, %r8
movslq 0x38(%rsp), %r10
movslq 0x48(%rsp), %r9
movl %edi, %edi
movl %esi, %ebx
movl %edx, %r14d
shlq $0x2, %r10
shlq $0x2, %r8
xorl %r15d, %r15d
testl %esi, %esi
jle 0xe782
movq %r15, %rcx
imulq %r9, %rcx
movq 0x40(%rsp), %r11
leaq (%r11,%rcx,4), %r12
movq -0x8(%rsp), %r13
xorl %ebp, %ebp
xorps %xmm1, %xmm1
testl %edx, %edx
jle 0xe76b
movq %rax, %rcx
xorl %r11d, %r11d
movss (%rcx), %xmm2
mulss %xmm0, %xmm2
mulss (%r13,%r11,4), %xmm2
addss %xmm2, %xmm1
incq %r11
addq %r8, %rcx
cmpq %r11, %r14
jne 0xe74d
addss (%r12,%rbp,4), %xmm1
movss %xmm1, (%r12,%rbp,4)
incq %rbp
addq %r10, %r13
cmpq %rbx, %rbp
jne 0xe740
incq %r15
addq $0x4, %rax
cmpq %rdi, %r15
jne 0xe725
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: read_intlist
int *read_intlist(char *gpu_list, int *ngpus, int d)
{
    int *gpus = 0;
    if(gpu_list){
        int len = strlen(gpu_list);
        *ngpus = 1;
        int i;
        for(i = 0; i < len; ++i){
            if (gpu_list[i] == ',') ++*ngpus;
        }
        gpus = calloc(*ngpus, sizeof(int));
        for(i = 0; i < *ngpus; ++i){
            gpus[i] = atoi(gpu_list);
            gpu_list = strchr(gpu_list, ',')+1;
        }
    } else {
        gpus = calloc(1, sizeof(float));
        *gpus = d;
        *ngpus = 1;
    }
    return gpus;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
testq %rdi, %rdi
je 0xe833
movq %rdi, %rbx
callq 0x3140
movl $0x1, (%r14)
testl %eax, %eax
jle 0xe852
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ebp
xorl %ecx, %ecx
cmpb $0x2c, (%rbx,%rcx)
jne 0xe811
incl %ebp
movl %ebp, (%r14)
incq %rcx
cmpq %rcx, %rax
jne 0xe806
movslq %ebp, %r14
movl $0x4, %esi
movq %r14, %rdi
callq 0x3250
movq %rax, %r15
testl %r14d, %r14d
jg 0xe869
jmp 0xe896
movl %edx, %ebp
movl $0x1, %edi
movl $0x4, %esi
callq 0x3250
movq %rax, %r15
movl %ebp, (%rax)
movl $0x1, (%r14)
jmp 0xe896
movl $0x1, %edi
movl $0x4, %esi
callq 0x3250
movq %rax, %r15
movl $0x1, %ebp
movl %ebp, %r14d
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x3400
movl %eax, (%r15,%r12,4)
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x3150
movq %rax, %rbx
incq %rbx
incq %r12
cmpq %r12, %r14
jne 0xe86f
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: read_map
int *read_map(char *filename)
{
    int n = 0;
    int *map = 0;
    char *str;
    FILE *file = fopen(filename, "r");
    if(!file) file_error(filename);
    while((str=fgetl(file))){
        ++n;
        map = realloc(map, n*sizeof(int));
        map[n-1] = atoi(str);
    }
    return map;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x4c575(%rip), %rsi     # 0x5ae29
callq 0x3390
testq %rax, %rax
je 0xe91d
movq %rax, %rbx
movq %rax, %rdi
callq 0xe948
testq %rax, %rax
je 0xe90b
movq %rax, %r12
movl $0x4, %r15d
xorl %r14d, %r14d
movq %r14, %rdi
movq %r15, %rsi
callq 0x3350
movq %rax, %r14
movq %r12, %rdi
callq 0x3400
movl %eax, -0x4(%r14,%r15)
movq %rbx, %rdi
callq 0xe948
movq %rax, %r12
addq $0x4, %r15
testq %rax, %rax
jne 0xe8da
jmp 0xe90e
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x3500
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: fgetl
char *fgetl(FILE *fp)
{
    if(feof(fp)) return 0;
    size_t size = 512;
    char *line = malloc(size*sizeof(char));
    if(!fgets(line, size, fp)){
        free(line);
        return 0;
    }

    size_t curr = strlen(line);

    while((line[curr-1] != '\n') && !feof(fp)){
        if(curr == size-1){
            size *= 2;
            line = realloc(line, size*sizeof(char));
            if(!line) {
                printf("%ld\n", size);
                malloc_error();
            }
        }
        size_t readsize = size-curr;
        if(readsize > INT_MAX) readsize = INT_MAX-1;
        fgets(&line[curr], readsize, fp);
        curr = strlen(line);
    }
    if(line[curr-1] == '\n') line[curr-1] = '\0';

    return line;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x3290
testl %eax, %eax
je 0xe973
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x200, %edi            # imm = 0x200
callq 0x3300
movq %rax, %rbx
movq %rax, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdx
callq 0x3230
testq %rax, %rax
je 0xea42
movq %rbx, %rdi
callq 0x3140
leaq -0x1(%rax), %r13
cmpb $0xa, -0x1(%rbx,%rax)
je 0xea35
movq %rax, %r15
movq %r14, %rdi
callq 0x3290
testl %eax, %eax
jne 0xea2a
movl $0x200, %r12d           # imm = 0x200
movl $0x7ffffffe, %ebp       # imm = 0x7FFFFFFE
leaq -0x1(%r12), %rax
cmpq %rax, %r15
jne 0xe9ea
addq %r12, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
testq %rax, %rax
je 0xea4f
movq %rax, %rbx
movq %r12, %rsi
subq %r15, %rsi
addq %rbx, %r15
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
cmoval %ebp, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x3230
movq %rbx, %rdi
callq 0x3140
leaq -0x1(%rax), %r13
cmpb $0xa, -0x1(%rbx,%rax)
je 0xea35
movq %rax, %r15
movq %r14, %rdi
callq 0x3290
testl %eax, %eax
je 0xe9ca
cmpb $0xa, (%rbx,%r13)
jne 0xe961
addq %rbx, %r13
movb $0x0, (%r13)
jmp 0xe961
movq %rbx, %rdi
callq 0x3040
jmp 0xe95f
movq %r12, %rdi
callq 0x3523
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: sorta_shuffle
void sorta_shuffle(void *arr, size_t n, size_t size, size_t sections)
{
    size_t i;
    for(i = 0; i < sections; ++i){
        size_t start = n*i/sections;
        size_t end = n*(i+1)/sections;
        size_t num = end-start;
        shuffle(arr+(start*size), num, size);
    }
}

// Assembly:
testq %rcx, %rcx
je 0xeab7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq %rcx, %rbp
movq %r13, %rax
xorl %edx, %edx
divq %rbx
movq %rax, %rdi
addq %r15, %r13
movq %r13, %rax
xorl %edx, %edx
divq %rbx
subq %rdi, %rax
imulq %r14, %rdi
addq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xeab8
decq %rbp
jne 0xea79
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/utils.c
// Function: shuffle
void shuffle(void *arr, size_t n, size_t size)
{
    size_t i;
    void *swp = calloc(1, size);
    for(i = 0; i < n-1; ++i){
        size_t j = i + rand()/(RAND_MAX / (n-i)+1);
        memcpy(swp,          arr+(j*size), size);
        memcpy(arr+(j*size), arr+(i*size), size);
        memcpy(arr+(i*size), swp,          size);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, (%rsp)
movl $0x1, %edi
movq %rdx, %rsi
callq 0x3250
cmpq $0x1, %r14
je 0xeb4f
movq %rax, %r12
xorl %r15d, %r15d
movq (%rsp), %r13
callq 0x34e0
movslq %eax, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %r14
movq %rax, %rsi
incq %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
leaq (%rax,%r15), %rbp
imulq %rbx, %rbp
addq (%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x32b0
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x32b0
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x32b0
incq %r15
decq %r14
addq %rbx, %r13
cmpq $0x1, %r14
jne 0xeaea
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/utils.c
// Function: random_index_order
int *random_index_order(int min, int max)
{
    int *inds = calloc(max-min, sizeof(int));
    int i;
    for(i = min; i < max; ++i){
        inds[i] = i;
    }
    for(i = min; i < max-1; ++i){
        int swap = inds[i];
        int index = i + rand()%(max-i);
        inds[i] = inds[index];
        inds[index] = swap;
    }
    return inds;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
movl %esi, %eax
subl %edi, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3250
movq %rax, %rbx
movl %ebp, %r15d
movslq %r14d, %rax
subl %r14d, %r15d
jle 0xec33
movslq %ebp, %rdx
subq %rax, %rdx
leaq 0x1(%rdx), %rcx
andq $-0x2, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rbx,%rax,4), %rdx
addq $0x4, %rdx
xorl %esi, %esi
movdqa 0x464c6(%rip), %xmm1    # 0x55080
movdqa 0x464ce(%rip), %xmm2    # 0x55090
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movl %r14d, %edi
movq %rsi, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %r8d
notl %r8d
testb $0x1, %r8b
je 0xec0f
movl %edi, -0x4(%rdx,%rsi,4)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %r8d
testb $0x1, %r8b
je 0xec27
leal 0x1(%rdi), %r8d
movl %r8d, (%rdx,%rsi,4)
addq $0x2, %rsi
addl $0x2, %edi
cmpq %rsi, %rcx
jne 0xebcd
decl %ebp
cmpl %r14d, %ebp
jle 0xec65
leaq (%rbx,%rax,4), %r14
movl (%r14), %ebp
callq 0x34e0
cltd
idivl %r15d
movslq %edx, %rax
movl (%r14,%rax,4), %ecx
movl %ecx, (%r14)
movl %ebp, (%r14,%rax,4)
addq $0x4, %r14
decl %r15d
cmpl $0x1, %r15d
jne 0xec3e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: find_arg
int find_arg(int argc, char* argv[], char *arg)
{
    int i;
    for(i = 0; i < argc; ++i) {
        if(!argv[i]) continue;
        if(0==strcmp(argv[i], arg)) {
            del_arg(argc, argv, i);
            return 1;
        }
    }
    return 0;
}

// Assembly:
testl %edi, %edi
jle 0xecdd
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
movl %edi, %r12d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0xecd1
movq %r14, %rsi
callq 0x3260
testl %eax, %eax
je 0xece0
incq %r15
cmpq %r15, %r12
jne 0xecbc
xorl %eax, %eax
jmp 0xed0f
xorl %eax, %eax
retq
decl %ebp
cmpl %r15d, %ebp
jle 0xed02
movslq %ebp, %rax
movq 0x8(%rbx,%r15,8), %rcx
movq %rcx, (%rbx,%r15,8)
leaq 0x1(%r15), %rcx
movq %rcx, %r15
cmpq %rcx, %rax
jne 0xecea
movq %rax, %r15
movq $0x0, (%rbx,%r15,8)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: find_int_arg
int find_int_arg(int argc, char **argv, char *arg, int def)
{
    int i;
    for(i = 0; i < argc-1; ++i){
        if(!argv[i]) continue;
        if(0==strcmp(argv[i], arg)){
            def = atoi(argv[i+1]);
            del_arg(argc, argv, i);
            del_arg(argc, argv, i);
            break;
        }
    }
    return def;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
cmpl $0x2, %edi
jl 0xeda6
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
decl %ebp
movl %ebp, %r13d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
testq %rdi, %rdi
je 0xed4f
movq %r15, %rsi
callq 0x3260
testl %eax, %eax
je 0xed59
incq %r12
cmpq %r12, %r13
jne 0xed3a
jmp 0xeda6
movq 0x8(%r14,%r12,8), %rdi
callq 0x3400
movl %eax, %ebx
movslq %ebp, %rax
movq %r12, %rcx
movq 0x8(%r14,%rcx,8), %rdx
movq %rdx, (%r14,%rcx,8)
leaq 0x1(%rcx), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
jne 0xed6b
movq $0x0, (%r14,%rax,8)
movq 0x8(%r14,%r12,8), %rcx
movq %rcx, (%r14,%r12,8)
leaq 0x1(%r12), %rcx
movq %rcx, %r12
cmpq %rcx, %rax
jne 0xed88
movq $0x0, (%r14,%rax,8)
movl %ebx, %eax
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/utils.c
// Function: find_float_arg
float find_float_arg(int argc, char **argv, char *arg, float def)
{
    int i;
    for(i = 0; i < argc-1; ++i){
        if(!argv[i]) continue;
        if(0==strcmp(argv[i], arg)){
            def = atof(argv[i+1]);
            del_arg(argc, argv, i);
            del_arg(argc, argv, i);
            break;
        }
    }
    return def;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movss %xmm0, 0xc(%rsp)
cmpl $0x2, %edi
jl 0xee55
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
decl %ebp
movl %ebp, %r12d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0xedf7
movq %r14, %rsi
callq 0x3260
testl %eax, %eax
je 0xee01
incq %r15
cmpq %r15, %r12
jne 0xede2
jmp 0xee55
movq 0x8(%rbx,%r15,8), %rdi
callq 0x30f0
movslq %ebp, %rax
movq %r15, %rcx
movq 0x8(%rbx,%rcx,8), %rdx
movq %rdx, (%rbx,%rcx,8)
leaq 0x1(%rcx), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
jne 0xee11
movq $0x0, (%rbx,%rax,8)
movq 0x8(%rbx,%r15,8), %rcx
movq %rcx, (%rbx,%r15,8)
leaq 0x1(%r15), %rcx
movq %rcx, %r15
cmpq %rcx, %rax
jne 0xee2e
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq $0x0, (%rbx,%rax,8)
movss 0xc(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: find_char_arg
char *find_char_arg(int argc, char **argv, char *arg, char *def)
{
    int i;
    for(i = 0; i < argc-1; ++i){
        if(!argv[i]) continue;
        if(0==strcmp(argv[i], arg)){
            def = argv[i+1];
            del_arg(argc, argv, i);
            del_arg(argc, argv, i);
            break;
        }
    }
    return def;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpl $0x2, %edi
jl 0xeef0
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
decl %ebp
movl %ebp, %r13d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
testq %rdi, %rdi
je 0xeea0
movq %r15, %rsi
callq 0x3260
testl %eax, %eax
je 0xeeaa
incq %r12
cmpq %r12, %r13
jne 0xee8b
jmp 0xeef0
movq 0x8(%r14,%r12,8), %rbx
movslq %ebp, %rax
movq %r12, %rcx
movq 0x8(%r14,%rcx,8), %rdx
movq %rdx, (%r14,%rcx,8)
leaq 0x1(%rcx), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
jne 0xeeb5
movq $0x0, (%r14,%rax,8)
movq 0x8(%r14,%r12,8), %rcx
movq %rcx, (%r14,%r12,8)
leaq 0x1(%r12), %rcx
movq %rcx, %r12
cmpq %rcx, %rax
jne 0xeed2
movq $0x0, (%r14,%rax,8)
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/utils.c
// Function: basecfg
char *basecfg(char *cfgfile)
{
    char *c = cfgfile;
    char *next;
    while((next = strchr(c, '/')))
    {
        c = next+1;
    }
    c = copy_string(c);
    next = strchr(c, '.');
    if (next) *next = 0;
    return c;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x3150
leaq 0x1(%rax), %rdi
testq %rax, %rax
jne 0xef03
movq %rbx, %rdi
callq 0xef3e
movq %rax, %rbx
movq %rax, %rdi
movl $0x2e, %esi
callq 0x3150
testq %rax, %rax
je 0xef39
movb $0x0, (%rax)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: pm
void pm(int M, int N, float *A)
{
    int i,j;
    for(i =0 ; i < M; ++i){
        printf("%d ", i+1);
        for(j = 0; j < N; ++j){
            printf("%2.4f, ", A[i*N+j]);
        }
        printf("\n");
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
testl %edi, %edi
jle 0xf015
movq %rdx, %rbx
movl 0xc(%rsp), %r13d
movl %edi, %eax
movq %rax, 0x10(%rsp)
leaq (,%r13,4), %rbp
leaq 0x460e3(%rip), %r15     # 0x550a8
xorl %r12d, %r12d
incq %r12
leaq 0x460d2(%rip), %rdi     # 0x550a4
movl %r12d, %esi
xorl %eax, %eax
callq 0x3160
cmpl $0x0, 0xc(%rsp)
jle 0xf001
xorl %r14d, %r14d
xorps %xmm0, %xmm0
cvtss2sd (%rbx,%r14,4), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x3160
incq %r14
cmpq %r14, %r13
jne 0xefe6
movl $0xa, %edi
callq 0x3060
addq %rbp, %rbx
cmpq 0x10(%rsp), %r12
jne 0xefc8
movl $0xa, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3060
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: find_replace
void find_replace(char *str, char *orig, char *rep, char *output)
{
    char buffer[4096] = {0};
    char *p;

    sprintf(buffer, "%s", str);
    if(!(p = strstr(buffer, orig))){  // Is 'orig' even in 'str'?
        sprintf(output, "%s", str);
        return;
    }

    *p = '\0';

    sprintf(output, "%s%s%s", buffer, rep, p+strlen(orig));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %r13
movl $0x1000, %edx           # imm = 0x1000
movq %r13, %rdi
xorl %esi, %esi
callq 0x31c0
movq %r13, %rdi
movq %r12, %rsi
callq 0x3090
movq %r13, %rdi
movq %r15, %rsi
callq 0x34b0
testq %rax, %rax
je 0xf0a3
movq %rax, %r13
movb $0x0, (%rax)
movq %r15, %rdi
callq 0x3140
addq %rax, %r13
leaq 0x46022(%rip), %rsi     # 0x550b0
movq %rsp, %rdx
movq %rbx, %rdi
movq %r14, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x3420
jmp 0xf0ae
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3090
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: top_k
void top_k(float *a, int n, int k, int *index)
{
    int i,j;
    for(j = 0; j < k; ++j) index[j] = -1;
    for(i = 0; i < n; ++i){
        int curr = i;
        for(j = 0; j < k; ++j){
            if((index[j] < 0) || a[curr] > a[index[j]]){
                int swap = curr;
                curr = index[j];
                index[j] = swap;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movl %edx, %r12d
testl %edx, %edx
jle 0xf0fc
leaq (,%r12,4), %rdx
movq %rbx, %rdi
movl $0xff, %esi
callq 0x31c0
testl %r14d, %r14d
jle 0xf138
xorl %eax, %eax
testl %ebp, %ebp
jle 0xf131
xorl %ecx, %ecx
movl %eax, %edx
movslq (%rbx,%rcx,4), %rsi
testq %rsi, %rsi
js 0xf124
movslq %edx, %rdi
movss (%r15,%rdi,4), %xmm0
ucomiss (%r15,%rsi,4), %xmm0
jbe 0xf129
movl %edx, (%rbx,%rcx,4)
movl %esi, %edx
incq %rcx
cmpq %rcx, %r12
jne 0xf10b
incl %eax
cmpl %r14d, %eax
jne 0xf103
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: read_file
unsigned char *read_file(char *filename)
{
    FILE *fp = fopen(filename, "rb");
    size_t size;

    fseek(fp, 0, SEEK_END); 
    size = ftell(fp);
    fseek(fp, 0, SEEK_SET); 

    unsigned char *text = calloc(size+1, sizeof(char));
    fread(text, 1, size, fp);
    fclose(fp);
    return text;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x45f66(%rip), %rsi     # 0x550d8
callq 0x3390
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3340
movq %rbx, %rdi
callq 0x3280
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3340
leaq 0x1(%r14), %rdi
movl $0x1, %esi
callq 0x3250
movq %rax, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x30d0
movq %rbx, %rdi
callq 0x3130
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: split_str
list *split_str(char *s, char delim)
{
    size_t i;
    size_t len = strlen(s);
    list *l = make_list();
    list_insert(l, s);
    for(i = 0; i < len; ++i){
        if(s[i] == delim){
            s[i] = '\0';
            list_insert(l, &(s[i+1]));
        }
    }
    return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x3140
movq %rax, %r15
xorl %eax, %eax
callq 0x11828
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x11881
testq %r15, %r15
je 0xf250
incq %r14
cmpb %bl, -0x1(%r14)
jne 0xf248
movb $0x0, -0x1(%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x11881
incq %r14
decq %r15
jne 0xf232
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: strip
void strip(char *s)
{
    size_t i;
    size_t len = strlen(s);
    size_t offset = 0;
    for(i = 0; i < len; ++i){
        char c = s[i];
        if(c==' '||c=='\t'||c=='\n') ++offset;
        else s[i-offset] = c;
    }
    s[len-offset] = '\0';
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x3140
xorl %ecx, %ecx
testq %rax, %rax
je 0xf2a5
movabsq $0x100000600, %rdx      # imm = 0x100000600
movq %rax, %rsi
movq %rbx, %rdi
movzbl (%rdi), %r8d
cmpq $0x20, %r8
ja 0xf294
btq %r8, %rdx
jae 0xf294
incq %rcx
jmp 0xf29d
movq %rdi, %r9
subq %rcx, %r9
movb %r8b, (%r9)
incq %rdi
decq %rsi
jne 0xf27f
subq %rcx, %rax
movb $0x0, (%rbx,%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: strip_char
void strip_char(char *s, char bad)
{
    size_t i;
    size_t len = strlen(s);
    size_t offset = 0;
    for(i = 0; i < len; ++i){
        char c = s[i];
        if(c==bad) ++offset;
        else s[i-offset] = c;
    }
    s[len-offset] = '\0';
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3140
xorl %ecx, %ecx
testq %rax, %rax
je 0xf2e6
movq %rax, %rdx
movq %rbx, %rsi
movb (%rsi), %dil
cmpb %bpl, %dil
jne 0xf2d5
incq %rcx
jmp 0xf2de
movq %rsi, %r8
subq %rcx, %r8
movb %dil, (%r8)
incq %rsi
decq %rdx
jne 0xf2c8
subq %rcx, %rax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: read_all
void read_all(int fd, char *buffer, size_t bytes)
{
    size_t n = 0;
    while(n < bytes){
        int next = read(fd, buffer + n, bytes-n);
        if(next <= 0) error("read failed");
        n += next;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xf42c
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
leaq (%r14,%r15), %rsi
movq %rbx, %rdx
subq %r15, %rdx
movl %ebp, %edi
callq 0x3210
testl %eax, %eax
jle 0xf437
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r15
cmpq %rbx, %r15
jb 0xf40a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x3585
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: write_all
void write_all(int fd, char *buffer, size_t bytes)
{
    size_t n = 0;
    while(n < bytes){
        size_t next = write(fd, buffer + n, bytes-n);
        if(next <= 0) error("write failed");
        n += next;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xf471
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
leaq (%r14,%r15), %rsi
movq %rbx, %rdx
subq %r15, %rdx
movl %ebp, %edi
callq 0x3100
testq %rax, %rax
je 0xf47c
addq %rax, %r15
cmpq %rbx, %r15
jb 0xf453
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x35b1
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: parse_csv_line
list *parse_csv_line(char *line)
{
    list *l = make_list();
    char *c, *p;
    int in = 0;
    for(c = line, p = line; *c != '\0'; ++c){
        if(*c == '"') in = !in;
        else if(*c == ',' && !in){
            *c = '\0';
            list_insert(l, copy_string(p));
            p = c+1;
        }
    }
    list_insert(l, copy_string(p));
    return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x11828
movq %rax, %rbx
leaq 0x1(%r14), %r15
movzbl -0x1(%r15), %eax
cmpl $0x22, %eax
je 0xf4d0
testl %eax, %eax
je 0xf4de
cmpb $0x2c, %al
jne 0xf4d9
testl %ebp, %ebp
jne 0xf4d9
movb $0x0, -0x1(%r15)
movq %r14, %rdi
callq 0xef3e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11881
xorl %ebp, %ebp
movq %r15, %r14
jmp 0xf4d9
xorl %eax, %eax
testl %ebp, %ebp
sete %al
movl %eax, %ebp
incq %r15
jmp 0xf49b
movq %r14, %rdi
callq 0xef3e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11881
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: count_fields
int count_fields(char *line)
{
    int count = 0;
    int done = 0;
    char *c;
    for(c = line; !done; ++c){
        done = (*c == '\0');
        if(*c == ',' || done) ++count;
    }
    return count;
}

// Assembly:
xorl %eax, %eax
movzbl (%rdi), %ecx
cmpl $0x2c, %ecx
je 0xf50d
testl %ecx, %ecx
jne 0xf50f
incl %eax
incq %rdi
testb %cl, %cl
jne 0xf501
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: parse_fields
float *parse_fields(char *line, int n)
{
    float *field = calloc(n, sizeof(float));
    char *c, *p, *end;
    int count = 0;
    int done = 0;
    for(c = line, p = line; !done; ++c){
        done = (*c == '\0');
        if(*c == ',' || done){
            *c = '\0';
            field[count] = strtod(p, &end);
            if(p == c) field[count] = nan("");
            if(end != c && (end != c-1 || *end != '\r')) field[count] = nan(""); //DOS file formats!
            p = c+1;
            ++count;
        }
    }
    return field;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
movslq %esi, %rdi
movl $0x4, %esi
callq 0x3250
movq %rax, %rbx
xorl %ebp, %ebp
movq %r12, %r13
movzbl (%r13), %r15d
cmpl $0x2c, %r15d
je 0xf54a
testl %r15d, %r15d
jne 0xf5b5
movb $0x0, (%r13)
movq %r12, %rdi
movq %rsp, %rsi
callq 0x30e0
cvtsd2ss %xmm0, %xmm0
movslq %ebp, %r14
movss %xmm0, (%rbx,%r14,4)
cmpq %r12, %r13
jne 0xf582
leaq 0x4a76b(%rip), %rdi     # 0x59cde
callq 0x3450
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx,%r14,4)
movq (%rsp), %rax
cmpq %rax, %r13
je 0xf5af
leaq -0x1(%r13), %rcx
cmpq %rax, %rcx
jne 0xf599
cmpb $0xd, (%rax)
je 0xf5af
leaq 0x4a73e(%rip), %rdi     # 0x59cde
callq 0x3450
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx,%r14,4)
leaq 0x1(%r13), %r12
incl %ebp
incq %r13
testb %r15b, %r15b
jne 0xf53a
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/utils.c
// Function: mean_arrays
void mean_arrays(float **a, int n, int els, float *avg)
{
    int i;
    int j;
    memset(avg, 0, els*sizeof(float));
    for(j = 0; j < n; ++j){
        for(i = 0; i < els; ++i){
            avg[i] += a[j][i];
        }
    }
    for(i = 0; i < els; ++i){
        avg[i] /= n;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r15
movslq %edx, %rdx
shlq $0x2, %rdx
movq %rcx, %rdi
xorl %esi, %esi
callq 0x31c0
movl %r14d, %eax
testl %ebp, %ebp
jle 0xf66e
movl %ebp, %ecx
xorl %edx, %edx
testl %r14d, %r14d
jle 0xf666
movq (%r15,%rdx,8), %rsi
xorl %edi, %edi
movss (%rsi,%rdi,4), %xmm0
addss (%rbx,%rdi,4), %xmm0
movss %xmm0, (%rbx,%rdi,4)
incq %rdi
cmpq %rdi, %rax
jne 0xf64f
incq %rdx
cmpq %rcx, %rdx
jne 0xf644
testl %r14d, %r14d
jle 0xf692
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
xorl %ecx, %ecx
movss (%rbx,%rcx,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%rbx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0xf67c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: variance_array
float variance_array(float *a, int n)
{
    int i;
    float sum = 0;
    float mean = mean_array(a, n);
    for(i = 0; i < n; ++i) sum += (a[i] - mean)*(a[i]-mean);
    float variance = sum/n;
    return variance;
}

// Assembly:
testl %esi, %esi
jle 0xf7bf
movl %esi, %eax
xorps %xmm1, %xmm1
xorl %ecx, %ecx
addss (%rdi,%rcx,4), %xmm1
incq %rcx
cmpq %rcx, %rax
jne 0xf786
cvtsi2ss %esi, %xmm2
testl %esi, %esi
jle 0xf7c3
divss %xmm2, %xmm1
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movss (%rdi,%rcx,4), %xmm3
subss %xmm1, %xmm3
mulss %xmm3, %xmm3
addss %xmm3, %xmm0
incq %rcx
cmpq %rcx, %rax
jne 0xf7a4
jmp 0xf7c6
cvtsi2ss %esi, %xmm2
xorps %xmm0, %xmm0
divss %xmm2, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: normalize_array
void normalize_array(float *a, int n)
{
    int i;
    float mu = mean_array(a,n);
    float sigma = sqrt(variance_array(a,n));
    for(i = 0; i < n; ++i){
        a[i] = (a[i] - mu)/sigma;
    }
    mu = mean_array(a,n);
    sigma = sqrt(variance_array(a,n));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
xorps %xmm0, %xmm0
testl %esi, %esi
jle 0xf894
xorl %eax, %eax
addss (%r14,%rax,4), %xmm0
incq %rax
cmpq %rax, %r15
jne 0xf886
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0xf77b
ucomiss 0x457f5(%rip), %xmm0    # 0x550a0
jb 0xf8b3
sqrtss %xmm0, %xmm0
jmp 0xf8b8
callq 0x32e0
testl %ebx, %ebx
movss 0xc(%rsp), %xmm2
jle 0xf8e8
cvtsi2ss %ebx, %xmm1
divss %xmm1, %xmm2
xorl %eax, %eax
movss (%r14,%rax,4), %xmm1
subss %xmm2, %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%r14,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0xf8cc
movq %r14, %rdi
movl %ebx, %esi
callq 0xf77b
xorps %xmm1, %xmm1
addq $0x10, %rsp
ucomiss %xmm1, %xmm0
jb 0xf904
popq %rbx
popq %r14
popq %r15
retq
popq %rbx
popq %r14
popq %r15
jmp 0x32e0
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: mag_array
float mag_array(float *a, int n)
{
    int i;
    float sum = 0;
    for(i = 0; i < n; ++i){
        sum += a[i]*a[i];   
    }
    return sqrt(sum);
}

// Assembly:
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
testl %esi, %esi
jle 0xf950
movl %esi, %eax
xorl %ecx, %ecx
movss (%rdi,%rcx,4), %xmm2
mulss %xmm2, %xmm2
addss %xmm2, %xmm0
incq %rcx
cmpq %rcx, %rax
jne 0xf93b
ucomiss %xmm1, %xmm0
jb 0x32e0
sqrtss %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/utils.c
// Function: sample_array
int sample_array(float *a, int n)
{
    float sum = sum_array(a, n);
    scale_array(a, n, 1./sum);
    float r = rand_uniform(0, 1);
    int i;
    for(i = 0; i < n; ++i){
        r = r - a[i];
        if (r <= 0) return i;
    }
    return n-1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
testl %esi, %esi
jle 0xf9fd
movq %rdi, %r14
movl %ebx, %r15d
xorps %xmm0, %xmm0
xorl %eax, %eax
addss (%r14,%rax,4), %xmm0
incq %rax
cmpq %rax, %r15
jne 0xf993
movss 0x4565f(%rip), %xmm1    # 0x55008
divss %xmm0, %xmm1
xorl %eax, %eax
movss (%r14,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, (%r14,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0xf9af
callq 0x34e0
testl %ebx, %ebx
jle 0xfa02
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x45625(%rip), %xmm0    # 0x55004
xorps %xmm1, %xmm1
addss %xmm1, %xmm0
xorl %eax, %eax
subss (%r14,%rax,4), %xmm0
ucomiss %xmm0, %xmm1
jae 0xfa0c
incq %rax
cmpq %rax, %r15
jne 0xf9e8
jmp 0xfa02
callq 0x34e0
decl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %ebx
jmp 0xfa04