LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/captcha.c
// Function: test_captcha
void test_captcha(char *cfgfile, char *weightfile, char *filename)
{
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);
    srand(2222222);
    int i = 0;
    char **names = get_labels("/data/captcha/reimgs.labels.list");
    char buff[256];
    char *input = buff;
    int indexes[26];
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        }else{
            //printf("Enter Image Path: ");
            //fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input, net->w, net->h);
        float *X = im.data;
        float *predictions = network_predict(net, X);
        top_predictions(net, 26, indexes);
        //printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        for(i = 0; i < 26; ++i){
            int index = indexes[i];
            if(i != 0) printf(", ");
            printf("%s %f", names[index], predictions[index]);
        }
        printf("\n");
        fflush(stdout);
        free_image(im);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdx, %rbx
xorl %edx, %edx
callq 0x22658
pushq $0x1
popq %rsi
movq %rax, 0x20(%rsp)
movq %rax, %rdi
callq 0x22f00
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3220
leaq 0x1a39a(%rip), %rdi     # 0x50efc
callq 0x1e673
movq %rax, %r15
leaq 0xc0(%rsp), %r12
leaq 0x1a430(%rip), %r13     # 0x50fa9
leaq 0x1a457(%rip), %rbp     # 0x50fd7
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
je 0x36b9c
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3080
jmp 0x36bce
movq 0x2d435(%rip), %rax     # 0x63fd8
movq (%rax), %rdx
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x3230
testq %rax, %rax
je 0x36c8b
movq %rax, %r12
movq %rax, %rdi
leaq 0x1a950(%rip), %rsi     # 0x51519
callq 0x33b0
movq 0x20(%rsp), %r14
movl 0x90(%r14), %ecx
movl 0x94(%r14), %edx
leaq 0x38(%rsp), %rdi
movq %r12, 0x30(%rsp)
movq %r12, %rsi
callq 0xbf36
movq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x233e2
movq %rax, %rbx
movq %r14, %rdi
pushq $0x1a
popq %rsi
leaq 0x50(%rsp), %rdx
callq 0x233cb
xorl %r14d, %r14d
cmpq $0x1a, %r14
je 0x36c49
movslq 0x50(%rsp,%r14,4), %r12
testq %r14, %r14
je 0x36c30
movq %rbp, %rdi
xorl %eax, %eax
callq 0x3160
movq (%r15,%r12,8), %rsi
cvtss2sd (%rbx,%r12,4), %xmm0
movq %r13, %rdi
movb $0x1, %al
callq 0x3160
incq %r14
jmp 0x36c16
pushq $0xa
popq %rdi
callq 0x3060
movq 0x2d378(%rip), %rax     # 0x63fd0
movq (%rax), %rdi
callq 0x3310
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
movq 0x30(%rsp), %r12
je 0x36b85
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/captcha.c
// Function: run_captcha
void run_captcha(int argc, char **argv)
{
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *filename = (argc > 5) ? argv[5]: 0;
    if(0==strcmp(argv[2], "train")) train_captcha(cfg, weights);
    else if(0==strcmp(argv[2], "test")) test_captcha(cfg, weights, filename);
    else if(0==strcmp(argv[2], "valid")) valid_captcha(cfg, weights, filename);
    //if(0==strcmp(argv[2], "test")) test_captcha(cfg, weights);
    //else if(0==strcmp(argv[2], "encode")) encode_captcha(cfg, weights);
    //else if(0==strcmp(argv[2], "decode")) decode_captcha(cfg, weights);
    //else if(0==strcmp(argv[2], "valid")) validate_captcha(cfg, weights);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jle 0x36f38
cmpl $0x4, %edi
jne 0x36ea3
xorl %ebx, %ebx
jmp 0x36eb2
movq 0x20(%rsi), %rbx
cmpl $0x6, %edi
jb 0x36eb2
movq 0x28(%rsi), %r14
jmp 0x36eb5
xorl %r14d, %r14d
movq 0x18(%rsi), %r15
movq 0x10(%rsi), %r12
leaq 0x1a450(%rip), %rsi     # 0x51314
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x36f62
leaq 0x1b23a(%rip), %rsi     # 0x52115
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x36f06
leaq 0x18096(%rip), %rsi     # 0x4ef84
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x36f1f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x36b26
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x36c9d
movq 0x2d0b9(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
leaq 0x1a08a(%rip), %rsi     # 0x50fda
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3270
movq %r15, %rdi
movq %rbx, %rsi
callq 0x367db
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/lsd.c
// Function: slerp
void slerp(float *start, float *end, float s, int n, float *out)
{
    float omega = acos(dot_cpu(n, start, 1, end, 1));
    float so = sin(omega);
    fill_cpu(n, 0, out, 1);
    axpy_cpu(n, sin((1-s)*omega)/so, start, 1, out, 1);
    axpy_cpu(n, sin(s*omega)/so, end, 1, out, 1);

    float mag = mag_array(out, n);
    scale_array(out, n, 1./mag);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movl %edx, %ebx
movss %xmm0, 0x4(%rsp)
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rbp
movl %edx, %edi
movq %r12, %rsi
movl %ebp, %edx
movq %r15, %rcx
movl %ebp, %r8d
callq 0x1b847
cvtss2sd %xmm0, %xmm0
callq 0x3200
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rsp)
cvtss2sd %xmm0, %xmm0
callq 0x33d0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movl %ebx, %edi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1b449
movss 0x1502a(%rip), %xmm0    # 0x4c008
subss 0x4(%rsp), %xmm0
mulss (%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x33d0
cvtss2sd 0x8(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl %ebx, %edi
movq %r12, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1b3ed
movss (%rsp), %xmm0
mulss 0x4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x33d0
divsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movl %ebx, %edi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1b3ed
movq %r14, %rdi
movl %ebx, %esi
callq 0x4b4c
movss 0x14fae(%rip), %xmm1    # 0x4c008
divss %xmm0, %xmm1
movq %r14, %rdi
movl %ebx, %esi
movaps %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4b7e
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/lsd.c
// Function: random_unit_vector_image
image random_unit_vector_image(int w, int h, int c)
{
    image im = make_image(w, h, c);
    int i;
    for(i = 0; i < im.w*im.h*im.c; ++i){
        im.data[i] = rand_normal();
    }
    float mag = mag_array(im.data, im.w*im.h*im.c);
    scale_array(im.data, im.w*im.h*im.c, 1./mag);
    return im;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xb45a
xorl %r14d, %r14d
movslq (%rbx), %rax
movslq 0x4(%rbx), %rcx
imulq %rax, %rcx
movslq 0x8(%rbx), %rsi
imulq %rcx, %rsi
cmpq %rsi, %r14
jge 0x370b4
xorl %eax, %eax
callq 0x4cf7
movq 0x10(%rbx), %rax
movss %xmm0, (%rax,%r14,4)
incq %r14
jmp 0x37086
movq 0x10(%rbx), %rdi
callq 0x4b4c
movq 0x10(%rbx), %rdi
movl 0x4(%rbx), %esi
imull (%rbx), %esi
imull 0x8(%rbx), %esi
movss 0x14f35(%rip), %xmm1    # 0x4c008
divss %xmm0, %xmm1
movaps %xmm1, %xmm0
callq 0x4b7e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/lsd.c
// Function: test_dcgan
void test_dcgan(char *cfgfile, char *weightfile)
{
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);
    srand(2222222);

    clock_t time;
    char buff[256];
    char *input = buff;
    int imlayer = 0;

    imlayer = net->n-1;

    while(1){
        image im = make_image(net->w, net->h, net->c);
        int i;
        for(i = 0; i < im.w*im.h*im.c; ++i){
            im.data[i] = rand_normal();
        }
        //float mag = mag_array(im.data, im.w*im.h*im.c);
        //scale_array(im.data, im.w*im.h*im.c, 1./mag);

        float *X = im.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image_layer(net, imlayer);
        //yuv_to_rgb(out);
        normalize_image(out);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        save_image(out, "out");
        show_image(out, "out", 0);

        free_image(im);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
xorl %edx, %edx
callq 0x22658
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x22f00
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3220
movl (%rbx), %ebp
decl %ebp
leaq 0x50(%rsp), %r13
leaq 0x1ade4(%rip), %r14     # 0x521d6
movl 0x90(%rbx), %edx
movl 0x94(%rbx), %esi
movl 0x98(%rbx), %ecx
leaq 0x20(%rsp), %rdi
callq 0xb45a
xorl %r15d, %r15d
movslq 0x20(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq %rax, %rcx
movslq 0x28(%rsp), %rax
imulq %rcx, %rax
cmpq %rax, %r15
jge 0x37444
xorl %eax, %eax
callq 0x4cf7
movq 0x30(%rsp), %rax
movss %xmm0, (%rax,%r15,4)
incq %r15
jmp 0x37411
movq 0x30(%rsp), %r15
callq 0x3120
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x233e2
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x232a7
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xd27c
callq 0x3120
subq %r12, %rax
movq %rax, %rdi
callq 0x437c
cvtss2sd %xmm0, %xmm0
leaq 0x19b7e(%rip), %rdi     # 0x5101c
movq %r13, %rsi
movb $0x1, %al
callq 0x3160
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0xd514
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0xd4c7
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
jmp 0x373f2
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/lsd.c
// Function: set_network_alpha_beta
void set_network_alpha_beta(network *net, float alpha, float beta)
{
    int i;
    for(i = 0; i < net->n; ++i){
        if(net->layers[i].type == SHORTCUT){
            net->layers[i].alpha = alpha;
            net->layers[i].beta = beta;
        }
    }
}

// Assembly:
movslq (%rdi), %rax
movl $0x138, %ecx            # imm = 0x138
xorl %edx, %edx
cmpq %rax, %rdx
jge 0x37531
movq 0x20(%rdi), %rsi
cmpl $0xd, -0x138(%rsi,%rcx)
jne 0x37525
movss %xmm0, -0x4(%rsi,%rcx)
movss %xmm1, (%rsi,%rcx)
incq %rdx
addq $0x4a0, %rcx            # imm = 0x4A0
jmp 0x37507
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/super.c
// Function: test_super
void test_super(char *cfgfile, char *weightfile, char *filename)
{
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);
    srand(2222222);

    clock_t time;
    char buff[256];
    char *input = buff;
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        }else{
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input, 0, 0);
        resize_network(net, im.w, im.h);
        printf("%d %d\n", im.w, im.h);

        float *X = im.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image(net);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        save_image(out, "out");
        show_image(out, "out", 0);

        free_image(im);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, %rbx
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x22f00
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3220
leaq 0x50(%rsp), %r13
leaq 0x1a462(%rip), %r12     # 0x521d6
testq %rbx, %rbx
je 0x37d8b
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3080
jmp 0x37dda
leaq 0x192b0(%rip), %rdi     # 0x51042
xorl %eax, %eax
callq 0x3160
movq 0x2c230(%rip), %rax     # 0x63fd0
movq (%rax), %rdi
callq 0x3310
movq 0x2c229(%rip), %rax     # 0x63fd8
movq (%rax), %rdx
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x3230
testq %rax, %rax
je 0x37eb4
movq %rax, %r13
movq %rax, %rdi
leaq 0x19744(%rip), %rsi     # 0x51519
callq 0x33b0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xbf36
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r14, %rdi
callq 0x22f25
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
leaq 0x18ad2(%rip), %rdi     # 0x508dc
xorl %eax, %eax
callq 0x3160
movq 0x30(%rsp), %r15
callq 0x3120
movq %rax, %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x233e2
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x2330a
callq 0x3120
subq %rbp, %rax
movq %rax, %rdi
callq 0x437c
cvtss2sd %xmm0, %xmm0
leaq 0x191cb(%rip), %rdi     # 0x5101c
movq %r13, %rsi
movb $0x1, %al
callq 0x3160
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0xd514
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0xd4c7
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
testq %rbx, %rbx
je 0x37d74
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/super.c
// Function: run_super
void run_super(int argc, char **argv)
{
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *filename = (argc > 5) ? argv[5] : 0;
    int clear = find_arg(argc, argv, "-clear");
    if(0==strcmp(argv[2], "train")) train_super(cfg, weights, clear);
    else if(0==strcmp(argv[2], "test")) test_super(cfg, weights, filename);
    /*
    else if(0==strcmp(argv[2], "valid")) validate_super(cfg, weights);
    */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
cmpl $0x3, %edi
jle 0x37f68
cmpl $0x4, %edi
jne 0x37ee3
xorl %ebx, %ebx
jmp 0x37ef2
movq 0x20(%r15), %rbx
cmpl $0x6, %edi
jb 0x37ef2
movq 0x28(%r15), %r14
jmp 0x37ef5
xorl %r14d, %r14d
movq 0x18(%r15), %r12
leaq 0x19155(%rip), %rdx     # 0x51055
movq %r15, %rsi
callq 0x3fdd
movl %eax, %ebp
movq 0x10(%r15), %r15
leaq 0x193ff(%rip), %rsi     # 0x51314
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x37f3d
leaq 0x1a1ed(%rip), %rsi     # 0x52115
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x37f52
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x37980
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x37d35
movq 0x2c089(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x1905a(%rip), %rsi     # 0x50fda
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3270
nop
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/tag.c
// Function: run_tag
void run_tag(int argc, char **argv)
{
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    int clear = find_arg(argc, argv, "-clear");
    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *filename = (argc > 5) ? argv[5] : 0;
    if(0==strcmp(argv[2], "train")) train_tag(cfg, weights, clear);
    else if(0==strcmp(argv[2], "test")) test_tag(cfg, weights, filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
cmpl $0x3, %edi
jle 0x387a2
movl %edi, %r15d
leaq 0x1893c(%rip), %rdx     # 0x51055
movq %r14, %rsi
callq 0x3fdd
movl %eax, %ebp
cmpl $0x4, %r15d
jne 0x3872d
xorl %ebx, %ebx
jmp 0x3873d
movq 0x20(%r14), %rbx
cmpl $0x6, %r15d
jb 0x3873d
movq 0x28(%r14), %r15
jmp 0x38740
xorl %r15d, %r15d
movq 0x18(%r14), %r12
movq 0x10(%r14), %r14
leaq 0x18bc5(%rip), %rsi     # 0x51314
movq %r14, %rdi
callq 0x3260
testl %eax, %eax
je 0x38777
leaq 0x199b3(%rip), %rsi     # 0x52115
movq %r14, %rdi
callq 0x3260
testl %eax, %eax
je 0x3878c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x37fa0
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x384fe
movq 0x2b84f(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x18820(%rip), %rsi     # 0x50fda
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3270
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: test_cifar_multi
void test_cifar_multi(char *filename, char *weightfile)
{
    network *net = load_network(filename, weightfile, 0);
    set_batch_network(net, 1);
    srand(time(0));

    float avg_acc = 0;
    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");

    int i;
    for(i = 0; i < test.X.rows; ++i){
        image im = float_to_image(32, 32, 3, test.X.vals[i]);

        float pred[10] = {0};

        float *p = network_predict(net, im.data);
        axpy_cpu(10, 1, p, 1, pred, 1);
        flip_image(im);
        p = network_predict(net, im.data);
        axpy_cpu(10, 1, p, 1, pred, 1);

        int index = max_index(pred, 10);
        int class = max_index(test.y.vals[i], 10);
        if(index == class) avg_acc += 1;
        free_image(im);
        printf("%4d: %.2f%%\n", i, 100.*avg_acc/(i+1));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x22658
movq %rax, %rbx
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x22f00
xorl %edi, %edi
callq 0x32c0
movl %eax, %edi
callq 0x3220
leaq 0x1835f(%rip), %rsi     # 0x5121b
leaq 0x68(%rsp), %rdi
callq 0x2142b
xorpd %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
pushq $0xa
popq %r13
leaq 0x40(%rsp), %r14
movslq 0x70(%rsp), %rax
cmpq %rax, %r15
jge 0x39004
movq 0x78(%rsp), %rax
movq (%rax,%r15,8), %r8
leaq 0x28(%rsp), %rdi
pushq $0x20
popq %rdx
movl %edx, %esi
pushq $0x3
popq %rcx
callq 0xc3de
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
andq $0x0, 0x60(%rsp)
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x233e2
movl %r13d, %edi
movss 0x130d8(%rip), %xmm0    # 0x4c008
movq %rax, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1b3ed
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x233e2
movl %r13d, %edi
movss 0x13098(%rip), %xmm0    # 0x4c008
movq %rax, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1b3ed
movq %r14, %rdi
movl %r13d, %esi
callq 0x4c73
movl %eax, %r12d
movq 0x88(%rsp), %rax
movq (%rax,%r15,8), %rdi
movl %r13d, %esi
callq 0x4c73
cmpl %eax, %r12d
jne 0x38fbb
movss 0x24(%rsp), %xmm0
addss 0x13053(%rip), %xmm0    # 0x4c008
movss %xmm0, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
cvtss2sd 0x24(%rsp), %xmm0
mulsd 0x18207(%rip), %xmm0    # 0x511e8
incq %r15
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
leal -0x1(%r15), %esi
leaq 0x18252(%rip), %rdi     # 0x5124a
movb $0x1, %al
callq 0x3160
jmp 0x38ed9
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: test_cifar
void test_cifar(char *filename, char *weightfile)
{
    network *net = load_network(filename, weightfile, 0);
    srand(time(0));

    clock_t time;
    float avg_acc = 0;
    float avg_top5 = 0;
    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");

    time=clock();

    float *acc = network_accuracies(net, test, 2);
    avg_acc += acc[0];
    avg_top5 += acc[1];
    printf("top1: %f, %lf seconds, %d images\n", avg_acc, sec(clock()-time), test.X.rows);
    free_data(test);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
xorl %edi, %edi
callq 0x32c0
movl %eax, %edi
callq 0x3220
leaq 0x181da(%rip), %rsi     # 0x5121b
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x2142b
callq 0x3120
movq %rax, %r15
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)
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x23f37
xorps %xmm0, %xmm0
addss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
callq 0x3120
subq %r15, %rax
movq %rax, %rdi
callq 0x437c
cvtss2sd %xmm0, %xmm1
movl 0x8(%rbx), %esi
leaq 0x181a5(%rip), %rdi     # 0x51257
movsd 0x48(%rsp), %xmm0
movb $0x2, %al
callq 0x3160
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 0x1e69d
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: extract_cifar
void extract_cifar()
{
char *labels[] = {"airplane","automobile","bird","cat","deer","dog","frog","horse","ship","truck"};
    int i;
    data train = load_all_cifar10();
    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");
    for(i = 0; i < train.X.rows; ++i){
        image im = float_to_image(32, 32, 3, train.X.vals[i]);
        int class = max_index(train.y.vals[i], 10);
        char buff[256];
        sprintf(buff, "data/cifar/train/%d_%s",i,labels[class]);
        save_image_options(im, buff, PNG, 0);
    }
    for(i = 0; i < test.X.rows; ++i){
        image im = float_to_image(32, 32, 3, test.X.vals[i]);
        int class = max_index(test.y.vals[i], 10);
        char buff[256];
        sprintf(buff, "data/cifar/test/%d_%s",i,labels[class]);
        save_image_options(im, buff, PNG, 0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x21749
leaq 0x18104(%rip), %rsi     # 0x5121b
leaq 0x30(%rsp), %rdi
callq 0x2142b
pushq $0x20
popq %rbp
pushq $0xa
popq %r15
leaq 0x2ac51(%rip), %r14     # 0x63d80
leaq 0x1817b(%rip), %r12     # 0x512b1
leaq 0xb0(%rsp), %r13
xorl %ebx, %ebx
movslq 0x78(%rsp), %rax
cmpq %rax, %rbx
jge 0x391b4
movq 0x80(%rsp), %rax
movq (%rax,%rbx,8), %r8
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
movl %ebp, %edx
pushq $0x3
popq %rcx
callq 0xc3de
movq 0x90(%rsp), %rax
movq (%rax,%rbx,8), %rdi
movl %r15d, %esi
callq 0x4c73
cltq
movq (%r14,%rax,8), %rcx
movq %r13, %rdi
movq %r12, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3420
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd51f
incq %rbx
jmp 0x39140
pushq $0x20
popq %rbp
pushq $0xa
popq %r15
leaq 0x18106(%rip), %r12     # 0x512c8
leaq 0xb0(%rsp), %r13
xorl %ebx, %ebx
movslq 0x38(%rsp), %rax
cmpq %rax, %rbx
jge 0x3923a
movq 0x40(%rsp), %rax
movq (%rax,%rbx,8), %r8
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
movl %ebp, %edx
pushq $0x3
popq %rcx
callq 0xc3de
movq 0x50(%rsp), %rax
movq (%rax,%rbx,8), %rdi
movl %r15d, %esi
callq 0x4c73
cltq
movq (%r14,%rax,8), %rcx
movq %r13, %rdi
movq %r12, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3420
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd51f
incq %rbx
jmp 0x391cc
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: test_cifar_csv
void test_cifar_csv(char *filename, char *weightfile)
{
    network *net = load_network(filename, weightfile, 0);
    srand(time(0));

    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");

    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 %r15d, %r15d
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
xorl %edi, %edi
callq 0x32c0
movl %eax, %edi
callq 0x3220
leaq 0x17f9c(%rip), %rsi     # 0x5121b
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x2142b
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)
movq %r14, 0x48(%rsp)
movq %r14, %rdi
callq 0x23a7d
movq %rax, %rbx
movq %rdx, %r14
leaq 0x90(%rsp), %r12
pushq $0x20
popq %rbp
pushq $0x3
popq %r13
movslq 0x58(%rsp), %rax
cmpq %rax, %r15
jge 0x39315
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %r8
movq %r12, %rdi
movl %ebp, %esi
movl %ebp, %edx
movl %r13d, %ecx
callq 0xc3de
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
incq %r15
jmp 0x392d0
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 0x23a7d
movq %rax, %r15
movq %rdx, %r12
movss 0x12edd(%rip), %xmm0    # 0x4c234
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21fe0
movq %r15, %rdi
movq %r12, %rsi
movss 0x12ec4(%rip), %xmm0    # 0x4c234
callq 0x21fe0
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x220de
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2241d
movq 0x2ac60(%rip), %rax     # 0x63ff8
movq (%rax), %r15
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
pushq $0x1
popq %r8
movq %rbx, %rdx
movq %r14, %rcx
callq 0x21f11
cvtss2sd %xmm0, %xmm0
leaq 0x17f1f(%rip), %rsi     # 0x512de
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 0x1e69d
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15d, %r15d
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
xorl %edi, %edi
callq 0x32c0
movl %eax, %edi
callq 0x3220
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21749
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)
movq %r14, 0x48(%rsp)
movq %r14, %rdi
callq 0x23a7d
movq %rax, %rbx
movq %rdx, %r14
leaq 0x90(%rsp), %r12
pushq $0x20
popq %rbp
pushq $0x3
popq %r13
movslq 0x58(%rsp), %rax
cmpq %rax, %r15
jge 0x394ce
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %r8
movq %r12, %rdi
movl %ebp, %esi
movl %ebp, %edx
movl %r13d, %ecx
callq 0xc3de
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
incq %r15
jmp 0x39489
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 0x23a7d
movq %rax, %r15
movq %rdx, %r12
movss 0x12d24(%rip), %xmm0    # 0x4c234
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21fe0
movq %r15, %rdi
movq %r12, %rsi
movss 0x12d0b(%rip), %xmm0    # 0x4c234
callq 0x21fe0
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x220de
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2241d
movq 0x2aaa7(%rip), %rax     # 0x63ff8
movq (%rax), %r15
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
pushq $0x1
popq %r8
movq %rbx, %rdx
movq %r14, %rcx
callq 0x21f11
cvtss2sd %xmm0, %xmm0
leaq 0x17d66(%rip), %rsi     # 0x512de
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 0x1e69d
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x17c43(%rip), %rsi     # 0x5121b
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x2142b
leaq 0x17d00(%rip), %rdi     # 0x512ec
callq 0x22350
movq %rax, %r14
movq %rdx, %r15
movq 0x2a9fa(%rip), %r12     # 0x63ff8
movq (%r12), %rdi
movq %rax, %rcx
shrq $0x20, %rcx
leaq 0x172cc(%rip), %rsi     # 0x508dc
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 0x21f11
cvtss2sd %xmm0, %xmm0
leaq 0x17c9e(%rip), %rsi     # 0x512de
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 0x1e69d
movq %r14, %rdi
movq %r15, %rsi
callq 0x21edc
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: run_cifar
void run_cifar(int argc, char **argv)
{
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    if(0==strcmp(argv[2], "train")) train_cifar(cfg, weights);
    else if(0==strcmp(argv[2], "extract")) extract_cifar();
    else if(0==strcmp(argv[2], "distill")) train_cifar_distill(cfg, weights);
    else if(0==strcmp(argv[2], "test")) test_cifar(cfg, weights);
    else if(0==strcmp(argv[2], "multi")) test_cifar_multi(cfg, weights);
    else if(0==strcmp(argv[2], "csv")) test_cifar_csv(cfg, weights);
    else if(0==strcmp(argv[2], "csvtrain")) test_cifar_csvtrain(cfg, weights);
    else if(0==strcmp(argv[2], "eval")) eval_cifar_csv();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x3, %edi
jle 0x397a6
cmpl $0x4, %edi
jne 0x396a2
xorl %ebx, %ebx
jmp 0x396a6
movq 0x20(%rsi), %rbx
movq 0x18(%rsi), %r14
movq 0x10(%rsi), %r15
leaq 0x17c5f(%rip), %rsi     # 0x51314
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x3976c
leaq 0x17c35(%rip), %rsi     # 0x51301
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x3977c
leaq 0x17c26(%rip), %rsi     # 0x51309
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x39786
leaq 0x18a1b(%rip), %rsi     # 0x52115
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x39796
leaq 0x181c2(%rip), %rsi     # 0x518d3
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x397ca
leaq 0x17bd5(%rip), %rsi     # 0x512fd
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x397da
leaq 0x17bd2(%rip), %rsi     # 0x51311
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x397ea
leaq 0x17bc4(%rip), %rsi     # 0x5131a
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x397fa
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x387cc
popq %rbx
popq %r14
popq %r15
jmp 0x390f3
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x38afc
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x39016
movq 0x2a84b(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
leaq 0x1781c(%rip), %rsi     # 0x50fda
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x3270
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x38e7c
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3924c
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3940a
popq %rbx
popq %r14
popq %r15
jmp 0x395c3
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: fgetgo
char *fgetgo(FILE *fp)
{
    if(feof(fp)) return 0;
    size_t size = 96;
    char *line = malloc(size*sizeof(char));
    if(size != fread(line, sizeof(char), size, fp)){
        free(line);
        return 0;
    }

    return line;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x3290
testl %eax, %eax
jne 0x39843
pushq $0x60
popq %r15
movq %r15, %rdi
callq 0x3300
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x30d0
cmpq $0x60, %rax
je 0x39845
movq %rbx, %rdi
callq 0x3040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: load_go_moves
moves load_go_moves(char *filename)
{
    moves m;
    m.n = 128;
    m.data = calloc(128, sizeof(char*));
    FILE *fp = fopen(filename, "rb");
    int count = 0;
    char *line = 0;
    while ((line = fgetgo(fp))) {
        if (count >= m.n) {
            m.n *= 2;
            m.data = realloc(m.data, m.n*sizeof(char*));
        }
        m.data[count] = line;
        ++count;
    }
    printf("%d\n", count);
    m.n = count;
    m.data = realloc(m.data, count*sizeof(char*));
    return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x8
popq %rsi
movl $0x80, %edi
callq 0x3250
movq %rax, %rbx
leaq 0x1283d(%rip), %rsi     # 0x4c0b0
movq %r14, %rdi
callq 0x3390
movq %rax, %r12
movl $0x80, %ebp
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x39804
testq %rax, %rax
je 0x398c2
movq %rax, %r13
movslq %ebp, %rax
cmpq %rax, %r14
jl 0x398b5
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x3350
movq %rax, %rbx
movq %r13, (%rbx,%r15)
incq %r14
addq $0x8, %r15
jmp 0x39889
leaq 0x17b88(%rip), %rdi     # 0x51451
movl %r14d, %esi
xorl %eax, %eax
callq 0x3160
movabsq $0x7fffffff8, %rax      # imm = 0x7FFFFFFF8
andq %rax, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3350
movl %r14d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: string_to_board
void string_to_board(char *s, float *board)
{
    int i, j;
    memset(board, 0, 2*19*19*sizeof(float));
    int count = 0;
    for(i = 0; i < 91; ++i){
        char c = s[i];
        for(j = 0; j < 4; ++j){
            int me = (c >> (2*j)) & 1;
            int you = (c >> (2*j + 1)) & 1;
            if (me) board[count] = 1;
            else if (you) board[count + 19*19] = 1;
            ++count;
            if(count >= 19*19) break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl $0xb48, %edx            # imm = 0xB48
movq %rsi, %rdi
xorl %esi, %esi
callq 0x31c0
leaq 0x5a4(%rbx), %rax
xorl %edi, %edi
cmpq $0x5b, %r15
je 0x39974
movsbl (%r14,%r15), %edx
movslq %edi, %rsi
xorl %ecx, %ecx
cmpl $0x8, %ecx
je 0x3996c
btl %ecx, %edx
movq %rbx, %rdi
jb 0x3994f
movl %edx, %r8d
shrl %cl, %r8d
movq %rax, %rdi
testb $0x2, %r8b
je 0x39956
movl $0x3f800000, (%rdi,%rsi,4) # imm = 0x3F800000
leaq 0x1(%rsi), %rdi
addq $0x2, %rcx
cmpq $0x168, %rsi            # imm = 0x168
movq %rdi, %rsi
jl 0x39933
jmp 0x3996f
movq %rsi, %rdi
incq %r15
jmp 0x39923
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: board_to_string
void board_to_string(char *s, float *board)
{
    int i, j;
    memset(s, 0, (19*19/4+1)*sizeof(char));
    int count = 0;
    for(i = 0; i < 91; ++i){
        for(j = 0; j < 4; ++j){
            int me = (board[count] == 1);
            int you = (board[count + 19*19] == 1);
            if (me) s[i] = s[i] | (1<<(2*j));
            if (you) s[i] = s[i] | (1<<(2*j + 1));
            ++count;
            if(count >= 19*19) break;
        }
    }
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x4b(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %eax, %eax
movss 0x1266a(%rip), %xmm0    # 0x4c008
pushq $0x1
popq %rdx
pushq $0x2
popq %r8
xorl %r10d, %r10d
cmpq $0x5b, %rax
je 0x39a08
movslq %r10d, %r9
xorl %ecx, %ecx
cmpl $0x8, %ecx
je 0x39a00
movss (%rsi,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
movss 0x5a4(%rsi,%r9,4), %xmm1
jne 0x399d9
jp 0x399d9
movl %edx, %r10d
shll %cl, %r10d
orb %r10b, (%rdi,%rax)
ucomiss %xmm0, %xmm1
jne 0x399ea
jp 0x399ea
movl %r8d, %r10d
shll %cl, %r10d
orb %r10b, (%rdi,%rax)
leaq 0x1(%r9), %r10
addq $0x2, %rcx
cmpq $0x168, %r9             # imm = 0x168
movq %r10, %r9
jl 0x399b3
jmp 0x39a03
movq %r9, %r10
incq %rax
jmp 0x399a8
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: flip_board
void flip_board(float *board)
{
    int i;
    for(i = 0; i < 19*19; ++i){
        float swap = board[i];
        board[i] = board[i+19*19];
        board[i+19*19] = swap;
        board[i+19*19*2] = 1-board[i+19*19*2];
    }
}

// Assembly:
movq $-0x5a4, %rax           # imm = 0xFA5C
movss 0x11d8a(%rip), %xmm0    # 0x4c008
testq %rax, %rax
je 0x3a2c2
movss 0x5a4(%rdi,%rax), %xmm1
movss 0xb48(%rdi,%rax), %xmm2
movss %xmm2, 0x5a4(%rdi,%rax)
movss %xmm1, 0xb48(%rdi,%rax)
movaps %xmm0, %xmm1
subss 0x10ec(%rdi,%rax), %xmm1
movss %xmm1, 0x10ec(%rdi,%rax)
addq $0x4, %rax
jmp 0x3a27e
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: move_go
void move_go(float *b, int p, int r, int c)
{
    int *l = calculate_liberties(b);
    if(p > 0) b[r*19 + c] = 1;
    else b[19*19 + r*19 + c] = 1;
    remove_connected(b, l, -p, r+1, c);
    remove_connected(b, l, -p, r-1, c);
    remove_connected(b, l, -p, r, c+1);
    remove_connected(b, l, -p, r, c-1);
    free(l);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r12
callq 0x3a552
movq %rax, %r15
imull $0x13, %r14d, %eax
leal 0x169(%rax), %ecx
testl %ebp, %ebp
cmovgl %eax, %ecx
addl %ebx, %ecx
movslq %ecx, %rax
movl $0x3f800000, (%r12,%rax,4) # imm = 0x3F800000
negl %ebp
leal 0x1(%r14), %ecx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x3a739
leal -0x1(%r14), %ecx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x3a739
leal 0x1(%rbx), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x3a739
decl %ebx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x3a739
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3040
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: remove_connected
static void remove_connected(float *b, int *lib, int p, int r, int c)
{
    if (r < 0 || r >= 19 || c < 0 || c >= 19) return;
    if (occupied(b, r*19 + c) != p) return;
    if (lib[r*19 + c] != 1) return;
    b[r*19 + c] = 0;
    b[19*19 + r*19 + c] = 0;
    remove_connected(b, lib, p, r+1, c);
    remove_connected(b, lib, p, r-1, c);
    remove_connected(b, lib, p, r, c+1);
    remove_connected(b, lib, p, r, c-1);
}

// Assembly:
cmpl $0x12, %ecx
ja 0x3a817
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
imull $0x13, %ecx, %r13d
leal 0x1(%r14), %eax
movl %eax, 0x4(%rsp)
leal -0x1(%r14), %eax
movl %eax, (%rsp)
addl %r8d, %r13d
cmpl $0x12, %ebx
ja 0x3a809
movl %r13d, %eax
movss (%r12,%rax,4), %xmm0
ucomiss 0x118ee(%rip), %xmm0    # 0x4c078
pushq $0x1
popq %rcx
jne 0x3a7a8
jp 0x3a7a8
movss 0x5a4(%r12,%rax,4), %xmm0
cmpneqss 0x118d4(%rip), %xmm0    # 0x4c078
movd %xmm0, %ecx
cmpl %ebp, %ecx
jne 0x3a809
cmpl $0x1, (%r15,%rax,4)
jne 0x3a809
andl $0x0, (%r12,%rax,4)
leal 0x169(%r13), %eax
andl $0x0, (%r12,%rax,4)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl 0x4(%rsp), %ecx
movl %ebx, %r8d
callq 0x3a739
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl (%rsp), %ecx
movl %ebx, %r8d
callq 0x3a739
leal 0x1(%rbx), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x3a739
decl %r13d
decl %ebx
jmp 0x3a771
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: free_mcts
void free_mcts(mcts_tree *root)
{
    if(!root) return;
    int i;
    free(root->board);
    for(i = 0; i < 19*19+1; ++i){
        if(root->children[i]) free_mcts(root->children[i]);
    }
    free(root->children);
    free(root->prior);
    free(root->visit_count);
    free(root->value);
    free(root->mean);
    free(root->prob);
    free(root);
}

// Assembly:
testq %rdi, %rdi
je 0x3a8a6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3040
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
cmpq $0x16a, %r14            # imm = 0x16A
je 0x3a865
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x3a860
callq 0x3a82e
incq %r14
jmp 0x3a845
callq 0x3040
movq 0x10(%rbx), %rdi
callq 0x3040
movq 0x18(%rbx), %rdi
callq 0x3040
movq 0x20(%rbx), %rdi
callq 0x3040
movq 0x28(%rbx), %rdi
callq 0x3040
movq 0x30(%rbx), %rdi
callq 0x3040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3040
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: expand
mcts_tree *expand(float *next, float *ko, network *net)
{
    mcts_tree *root = calloc(1, sizeof(mcts_tree));
    root->board = next;
    root->children = calloc(19*19+1, sizeof(mcts_tree*));
    root->prior = calloc(19*19 + 1, sizeof(float));
    root->prob = calloc(19*19 + 1, sizeof(float));
    root->mean = calloc(19*19 + 1, sizeof(float));
    root->value = calloc(19*19 + 1, sizeof(float));
    root->visit_count = calloc(19*19 + 1, sizeof(int));
    root->total_count = 1;
    int i;
    float *pred = network_predict_rotations(net, next);
    copy_cpu(19*19+1, pred, 1, root->prior, 1);
    float val = 2*pred[19*19 + 1] - 1;
    root->result = val;
    for(i = 0; i < 19*19+1; ++i) {
        root->visit_count[i] = 0;
        root->value[i] = 0;
        root->mean[i] = val;
        if(i < 19*19 && occupied(next, i)){
            root->value[i] = -1;
            root->mean[i] = -1;
            root->prior[i] = 0;
        }
    }
    //print_board(stderr, next, flip?-1:1, 0);
    return root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3250
movq %rax, %r14
movq %rbx, (%rax)
pushq $0x8
popq %rsi
movl $0x16a, %edi            # imm = 0x16A
callq 0x3250
movq %rax, 0x8(%r14)
pushq $0x4
popq %rbp
movl $0x16a, %edi            # imm = 0x16A
movq %rbp, %rsi
callq 0x3250
movq %rax, %r15
movq %rax, 0x10(%r14)
movl $0x16a, %edi            # imm = 0x16A
movq %rbp, %rsi
callq 0x3250
movq %rax, 0x30(%r14)
movl $0x16a, %edi            # imm = 0x16A
movq %rbp, %rsi
callq 0x3250
movq %rax, %r12
movq %rax, 0x28(%r14)
movl $0x16a, %edi            # imm = 0x16A
movq %rbp, %rsi
callq 0x3250
movq %rax, %r13
movq %rax, 0x20(%r14)
movl $0x16a, %edi            # imm = 0x16A
movq %rbp, %rsi
callq 0x3250
movq %rax, %rbp
movq %rax, 0x18(%r14)
movl $0x1, 0x38(%r14)
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x3a8a7
movq %rax, (%rsp)
pushq $0x1
popq %rdx
movl $0x16a, %edi            # imm = 0x16A
movq %rax, %rsi
movq %r15, %rcx
movl %edx, %r8d
callq 0x1b5a3
movq (%rsp), %rax
movss 0x5a8(%rax), %xmm0
addss %xmm0, %xmm0
addss 0x116bd(%rip), %xmm0    # 0x4c264
movss %xmm0, 0x3c(%r14)
xorl %eax, %eax
xorps %xmm1, %xmm1
movl $0xbf800000, %ecx       # imm = 0xBF800000
cmpq $0x5a8, %rax            # imm = 0x5A8
je 0x3ac0a
andl $0x0, (%rbp,%rax)
andl $0x0, (%r13,%rax)
movss %xmm0, (%r12,%rax)
cmpq $0x5a4, %rax            # imm = 0x5A4
je 0x3ac04
movss (%rbx,%rax), %xmm2
ucomiss %xmm1, %xmm2
jne 0x3abe4
jnp 0x3abf4
movl %ecx, (%r13,%rax)
movl %ecx, (%r12,%rax)
andl $0x0, (%r15,%rax)
jmp 0x3ac04
movss 0x5a4(%rbx,%rax), %xmm2
ucomiss %xmm1, %xmm2
jne 0x3abe4
jp 0x3abe4
addq $0x4, %rax
jmp 0x3abb7
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: legal_go
int legal_go(float *b, float *ko, int p, int r, int c)
{
    if (occupied(b, r*19+c)) return 0;
    float curr[19*19*3];
    copy_cpu(19*19*3, b, 1, curr, 1);
    move_go(curr, p, r, c);
    if(check_ko(curr, ko)) return 0;
    if(suicide_go(b, p, r, c)) return 0;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10f8, %rsp           # imm = 0x10F8
movl %ecx, %ebp
imull $0x13, %ecx, %eax
addl %r8d, %eax
movslq %eax, %rcx
movss (%rdi,%rcx,4), %xmm1
xorl %eax, %eax
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x3aea8
jnp 0x3aeba
addq $0x10f8, %rsp           # imm = 0x10F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r15
movss 0x5a4(%rdi,%rcx,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x3aea8
jp 0x3aea8
movl %r8d, %ebx
movl %edx, %r14d
movq %rsi, %r12
movq %rsp, %r13
pushq $0x1
popq %rdx
movl $0x43b, %edi            # imm = 0x43B
movq %r15, %rsi
movq %r13, %rcx
movl %edx, %r8d
callq 0x1b5a3
movq %r13, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x3a4b9
movq %r13, %rdi
movq %r12, %rsi
callq 0x3b459
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x3aea8
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x3b350
xorl $0x1, %eax
jmp 0x3aea8