LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/yolo_layer.c
// Function: avg_flipped_yolo
void avg_flipped_yolo(layer l)
{
    int i,j,n,z;
    float *flip = l.output + l.outputs;
    for (j = 0; j < l.h; ++j) {
        for (i = 0; i < l.w/2; ++i) {
            for (n = 0; n < l.n; ++n) {
                for(z = 0; z < l.classes + 4 + 1; ++z){
                    int i1 = z*l.w*l.h*l.n + n*l.w*l.h + j*l.w + i;
                    int i2 = z*l.w*l.h*l.n + n*l.w*l.h + j*l.w + (l.w - i - 1);
                    float swap = flip[i1];
                    flip[i1] = flip[i2];
                    flip[i2] = swap;
                    if(z == 0){
                        flip[i1] = -flip[i1];
                        flip[i2] = -flip[i2];
                    }
                }
            }
        }
    }
    for(i = 0; i < l.outputs; ++i){
        l.output[i] = (l.output[i] + flip[i])/2.;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x2a0(%rsp), %rax
movslq 0x90(%rsp), %rcx
movq %rax, -0x10(%rsp)
movq %rcx, -0x18(%rsp)
leaq (%rax,%rcx,4), %rdx
movl 0xa4(%rsp), %eax
movl %eax, -0x38(%rsp)
testl %eax, %eax
jle 0x3fd45
leaq 0x38(%rsp), %rax
movl 0x70(%rax), %ecx
movl 0x84(%rax), %r8d
movl %ecx, %esi
shrl $0x1f, %esi
addl %ecx, %esi
sarl %esi
movl %esi, -0x1c(%rsp)
movl 0xfc(%rax), %r10d
leal 0x4(%r10), %r11d
xorl %esi, %esi
testl %r11d, %r11d
movl $0x0, %eax
movq %rax, -0x28(%rsp)
cmovlel %esi, %r11d
incl %r11d
movl -0x38(%rsp), %ebp
imull %ecx, %ebp
movl %ebp, %r14d
imull %r8d, %r14d
leal -0x1(%rcx), %eax
movl %eax, -0x34(%rsp)
movaps 0x134e1(%rip), %xmm0    # 0x53150
xorl %esi, %esi
movq %rcx, -0x8(%rsp)
movl %esi, -0x20(%rsp)
cmpl $0x2, %ecx
jl 0x3fd20
xorl %r13d, %r13d
movl -0x34(%rsp), %eax
movl %eax, -0x2c(%rsp)
movq -0x28(%rsp), %rax
movl %eax, -0x30(%rsp)
testl %r8d, %r8d
jle 0x3fd0a
xorl %eax, %eax
movl -0x2c(%rsp), %ecx
movl -0x30(%rsp), %ebx
cmpl $-0x4, %r10d
jl 0x3fcff
movl %ecx, %r15d
movl %ebx, %esi
xorl %r9d, %r9d
movslq %esi, %r12
movss (%rdx,%r12,4), %xmm1
movslq %r15d, %rdi
movss (%rdx,%rdi,4), %xmm2
movss %xmm2, (%rdx,%r12,4)
movss %xmm1, (%rdx,%rdi,4)
testq %r9, %r9
jne 0x3fcf1
movss (%rdx,%r12,4), %xmm1
xorps %xmm0, %xmm1
movss %xmm1, (%rdx,%r12,4)
movss (%rdx,%rdi,4), %xmm1
xorps %xmm0, %xmm1
movss %xmm1, (%rdx,%rdi,4)
incq %r9
addl %r14d, %esi
addl %r14d, %r15d
cmpq %r9, %r11
jne 0x3fcb4
incl %eax
addl %ebp, %ebx
addl %ebp, %ecx
cmpl %r8d, %eax
jne 0x3fca6
incl %r13d
incl -0x30(%rsp)
decl -0x2c(%rsp)
cmpl -0x1c(%rsp), %r13d
jne 0x3fc97
movl -0x20(%rsp), %esi
incl %esi
movq -0x8(%rsp), %rcx
movq -0x28(%rsp), %rax
addl %ecx, %eax
movq %rax, -0x28(%rsp)
addl %ecx, -0x34(%rsp)
cmpl -0x38(%rsp), %esi
jne 0x3fc76
movq -0x18(%rsp), %rsi
testl %esi, %esi
movq -0x10(%rsp), %rcx
jle 0x3fd78
xorl %eax, %eax
movss 0x134d7(%rip), %xmm0    # 0x53234
movss (%rcx,%rax,4), %xmm1
addss (%rdx,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%rcx,%rax,4)
incq %rax
cmpq %rax, %rsi
jne 0x3fd5d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/iseg_layer.c
// Function: resize_iseg_layer
void resize_iseg_layer(layer *l, int w, int h)
{
    l->w = w;
    l->h = h;

    l->outputs = h*w*l->c;
    l->inputs = l->outputs;

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

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x70(%rdi)
movl %edx, 0x6c(%rdi)
imull %esi, %edx
movslq 0x74(%rdi), %rax
movslq %edx, %rcx
imulq %rax, %rcx
movl %ecx, 0x58(%rdi)
movl %ecx, 0x54(%rdi)
movq 0x268(%rdi), %rdi
movslq 0x48(%rbx), %rsi
imulq %rcx, %rsi
shlq $0x2, %rsi
callq 0x3360
movq %rax, 0x268(%rbx)
movq 0x260(%rbx), %rdi
movslq 0x48(%rbx), %rax
movslq 0x58(%rbx), %rsi
imulq %rax, %rsi
shlq $0x2, %rsi
callq 0x3360
movq %rax, 0x260(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/captcha.c
// Function: fix_data_captcha
void fix_data_captcha(data d, int mask)
{
    matrix labels = d.y;
    int i, j;
    for(i = 0; i < d.y.rows; ++i){
        for(j = 0; j < d.y.cols; j += 2){
            if (mask){
                if(!labels.vals[i][j]){
                    labels.vals[i][j] = SECRET_NUM;
                    labels.vals[i][j+1] = SECRET_NUM;
                }else if(labels.vals[i][j+1]){
                    labels.vals[i][j] = 0;
                }
            } else{
                if (labels.vals[i][j]) {
                    labels.vals[i][j+1] = 0;
                } else {
                    labels.vals[i][j+1] = 1;
                }
            }
        }
    }
}

// Assembly:
movslq 0x20(%rsp), %rax
testq %rax, %rax
jle 0x4095a
leaq 0x8(%rsp), %rdx
movq 0x20(%rdx), %rcx
movslq 0x1c(%rdx), %rdx
xorl %esi, %esi
xorps %xmm0, %xmm0
movabsq $-0x3b65bfff3b65c000, %r8 # imm = 0xC49A4000C49A4000
testl %edx, %edx
jle 0x40952
xorl %r9d, %r9d
testl %edi, %edi
je 0x4091e
movq (%rcx,%rsi,8), %r10
movss (%r10,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x40906
jnp 0x4093a
movss 0x4(%r10,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x40914
jnp 0x40949
movl $0x0, (%r10,%r9,4)
jmp 0x40949
movq (%rcx,%rsi,8), %r10
movss (%r10,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x4092f
jnp 0x40940
movl $0x0, 0x4(%r10,%r9,4)
jmp 0x40949
movq %r8, (%r10,%r9,4)
jmp 0x40949
movl $0x3f800000, 0x4(%r10,%r9,4) # imm = 0x3F800000
addq $0x2, %r9
cmpq %rdx, %r9
jl 0x408f1
incq %rsi
cmpq %rax, %rsi
jne 0x408ea
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2f9e4
movq %rax, 0x20(%rsp)
movq %rax, %rdi
movl $0x1, %esi
callq 0x302d4
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3230
leaq 0x17183(%rip), %rdi     # 0x57ec4
callq 0x2b6d3
movq %rax, %r15
leaq 0xc0(%rsp), %rbp
leaq 0x17219(%rip), %r13     # 0x57f71
leaq 0x17240(%rip), %r12     # 0x57f9f
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
je 0x40d7b
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3080
jmp 0x40dad
movq 0x29256(%rip), %rax     # 0x69fd8
movq (%rax), %rdx
movq %rbp, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x3240
testq %rax, %rax
je 0x40e6e
movq %rax, %rbp
movq %rax, %rdi
leaq 0x17761(%rip), %rsi     # 0x58509
callq 0x33c0
movq 0x20(%rsp), %r14
movl 0x90(%r14), %ecx
movl 0x94(%r14), %edx
leaq 0x38(%rsp), %rdi
movq %rbp, 0x30(%rsp)
movq %rbp, %rsi
callq 0x160b6
movq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x307ea
movq %rax, %rbx
movq %r14, %rdi
movl $0x1a, %esi
leaq 0x50(%rsp), %rdx
callq 0x307d3
xorl %r14d, %r14d
movslq 0x50(%rsp,%r14,4), %rbp
testq %r14, %r14
je 0x40e0b
movq %r12, %rdi
xorl %eax, %eax
callq 0x3170
movq (%r15,%rbp,8), %rsi
xorps %xmm0, %xmm0
cvtss2sd (%rbx,%rbp,4), %xmm0
movq %r13, %rdi
movb $0x1, %al
callq 0x3170
incq %r14
cmpq $0x1a, %r14
jne 0x40df7
movl $0xa, %edi
callq 0x3060
movq 0x29195(%rip), %rax     # 0x69fd0
movq (%rax), %rdi
callq 0x3320
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
movq 0x30(%rsp), %rbp
je 0x40d64
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/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 0x41129
cmpl $0x4, %edi
jne 0x41098
xorl %ebx, %ebx
jmp 0x4109c
movq 0x20(%rsi), %rbx
cmpl $0x6, %edi
jl 0x410a7
movq 0x28(%rsi), %r14
jmp 0x410aa
xorl %r14d, %r14d
movq 0x18(%rsi), %r15
movq 0x10(%rsi), %r12
leaq 0x17223(%rip), %rsi     # 0x582dc
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x41133
leaq 0x18031(%rip), %rsi     # 0x590fd
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x410f7
leaq 0x14ead(%rip), %rsi     # 0x55f8c
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x41110
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 0x40d03
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x40e80
movq %rsi, %rdi
callq 0x8c23
jmp 0x410eb
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4095b
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl %edx, %ebx
movss %xmm0, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r12
movl %edx, %edi
movq %r12, %rsi
movl $0x1, %edx
movq %r15, %rcx
movl $0x1, %r8d
callq 0x28a42
cvtss2sd %xmm0, %xmm0
callq 0x3210
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
cvtss2sd %xmm0, %xmm0
callq 0x33e0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2863b
movss 0x11e54(%rip), %xmm0    # 0x53008
subss 0xc(%rsp), %xmm0
mulss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x33e0
cvtss2sd 0x10(%rsp), %xmm1
movsd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl %ebx, %edi
movq %r12, %rsi
movl $0x1, %edx
movq %r14, %rcx
movl $0x1, %r8d
callq 0x285e9
movss 0x8(%rsp), %xmm0
mulss 0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x33e0
divsd 0x10(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movl %ebx, %edi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %rcx
movl $0x1, %r8d
callq 0x285e9
movq %r14, %rdi
movl %ebx, %esi
callq 0xf121
movss 0x11dca(%rip), %xmm1    # 0x53008
divss %xmm0, %xmm1
movq %r14, %rdi
movl %ebx, %esi
movaps %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf152
// File: /workspace/github_c_makefile_star2_O1/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 0x1529e
movl 0x4(%rbx), %esi
imull (%rbx), %esi
imull 0x8(%rbx), %esi
testl %esi, %esi
jle 0x412a3
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xf308
movq 0x10(%rbx), %rax
movss %xmm0, (%rax,%r14,4)
incq %r14
movslq (%rbx), %rax
movslq 0x4(%rbx), %rcx
imulq %rax, %rcx
movslq 0x8(%rbx), %rsi
imulq %rcx, %rsi
cmpq %rsi, %r14
jl 0x41277
movq 0x10(%rbx), %rdi
callq 0xf121
movq 0x10(%rbx), %rdi
movl 0x4(%rbx), %esi
imull (%rbx), %esi
imull 0x8(%rbx), %esi
movss 0x11d46(%rip), %xmm1    # 0x53008
divss %xmm0, %xmm1
movaps %xmm1, %xmm0
callq 0xf152
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2f9e4
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x302d4
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3230
movl (%rbx), %ebp
decl %ebp
leaq 0x50(%rsp), %r13
leaq 0x17bc5(%rip), %r14     # 0x591be
movl 0x90(%rbx), %edx
movl 0x94(%rbx), %esi
movl 0x98(%rbx), %ecx
leaq 0x20(%rsp), %rdi
callq 0x1529e
movl 0x24(%rsp), %eax
imull 0x20(%rsp), %eax
imull 0x28(%rsp), %eax
testl %eax, %eax
jle 0x4165b
xorl %r15d, %r15d
xorl %eax, %eax
callq 0xf308
movq 0x30(%rsp), %rax
movss %xmm0, (%rax,%r15,4)
incq %r15
movslq 0x20(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq %rax, %rcx
movslq 0x28(%rsp), %rax
imulq %rcx, %rax
cmpq %rax, %r15
jl 0x4162a
movq 0x30(%rsp), %r15
callq 0x3130
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x307ea
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x306a2
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x177d6
callq 0x3130
subq %r12, %rax
movq %rax, %rdi
callq 0xe8d4
cvtss2sd %xmm0, %xmm0
leaq 0x1692f(%rip), %rdi     # 0x57fe4
movq %r13, %rsi
movb $0x1, %al
callq 0x3170
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x17a72
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x3f2e
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
jmp 0x415f9
// File: /workspace/github_c_makefile_star2_O1/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), %rcx
testq %rcx, %rcx
jle 0x4174d
movq 0x20(%rdi), %rax
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
xorl %edx, %edx
cmpl $0xd, (%rax,%rdx)
jne 0x41741
movss %xmm0, 0x134(%rax,%rdx)
movss %xmm1, 0x138(%rax,%rdx)
addq $0x4a0, %rdx            # imm = 0x4A0
cmpq %rdx, %rcx
jne 0x41729
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2f9e4
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
callq 0x302d4
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3230
leaq 0x50(%rsp), %r13
leaq 0x17214(%rip), %r12     # 0x591be
testq %rbx, %rbx
je 0x41fc1
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3080
jmp 0x42010
leaq 0x16042(%rip), %rdi     # 0x5800a
xorl %eax, %eax
callq 0x3170
movq 0x27ffa(%rip), %rax     # 0x69fd0
movq (%rax), %rdi
callq 0x3320
movq 0x27ff3(%rip), %rax     # 0x69fd8
movq (%rax), %rdx
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x3240
testq %rax, %rax
je 0x420ea
movq %rax, %r13
movq %rax, %rdi
leaq 0x164fe(%rip), %rsi     # 0x58509
callq 0x33c0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x160b6
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r14, %rdi
callq 0x302fd
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
leaq 0x15844(%rip), %rdi     # 0x57884
xorl %eax, %eax
callq 0x3170
movq 0x30(%rsp), %r15
callq 0x3130
movq %rax, %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x307ea
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x30708
callq 0x3130
subq %rbp, %rax
movq %rax, %rdi
callq 0xe8d4
cvtss2sd %xmm0, %xmm0
leaq 0x15f5d(%rip), %rdi     # 0x57fe4
movq %r13, %rsi
movb $0x1, %al
callq 0x3170
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x17a72
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x3f2e
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
testq %rbx, %rbx
je 0x41faa
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/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 0x4219e
cmpl $0x4, %edi
jne 0x42119
xorl %ebx, %ebx
jmp 0x4211d
movq 0x20(%r15), %rbx
cmpl $0x6, %edi
jl 0x42128
movq 0x28(%r15), %r14
jmp 0x4212b
xorl %r14d, %r14d
movq 0x18(%r15), %r12
leaq 0x15ee7(%rip), %rdx     # 0x5801d
movq %r15, %rsi
callq 0xe439
movl %eax, %ebp
movq 0x10(%r15), %r15
leaq 0x16191(%rip), %rsi     # 0x582dc
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x42173
leaq 0x16f9f(%rip), %rsi     # 0x590fd
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x42188
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 0x41b74
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x41f69
movq %r15, %rdi
callq 0x8c67
jmp 0x4216a
// File: /workspace/github_c_makefile_star2_O1/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 0x42445
movl %edi, %r15d
leaq 0x15c4c(%rip), %rdx     # 0x5801d
movq %r14, %rsi
callq 0xe439
movl %eax, %ebp
cmpl $0x4, %r15d
jne 0x423e5
xorl %ebx, %ebx
jmp 0x423e9
movq 0x20(%r14), %rbx
cmpl $0x6, %r15d
jl 0x423f5
movq 0x28(%r14), %r15
jmp 0x423f8
xorl %r15d, %r15d
movq 0x18(%r14), %r12
movq 0x10(%r14), %r14
leaq 0x15ed5(%rip), %rsi     # 0x582dc
movq %r14, %rdi
callq 0x3270
testl %eax, %eax
je 0x4244f
leaq 0x16ce3(%rip), %rsi     # 0x590fd
movq %r14, %rdi
callq 0x3270
testl %eax, %eax
je 0x4242f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x421b8
movq %r14, %rdi
callq 0x91fc
jmp 0x42426
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8c89
// File: /workspace/github_c_makefile_star2_O1/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 %edx, %edx
callq 0x2f9e4
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x302d4
xorl %edi, %edi
callq 0x32d0
movl %eax, %edi
callq 0x3230
leaq 0x155f0(%rip), %rsi     # 0x581e3
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x2e687
cmpl $0x0, 0x8(%r14)
jle 0x42d6a
xorpd %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
xorl %r15d, %r15d
leaq 0x28(%rsp), %r14
leaq 0x40(%rsp), %r12
leaq 0x155e9(%rip), %r13     # 0x58212
movq 0x78(%rsp), %rax
movq (%rax,%r15,8), %r8
movq %r14, %rdi
movl $0x20, %esi
movl $0x20, %edx
movl $0x3, %ecx
callq 0x1675b
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x307ea
movl $0xa, %edi
movss 0x1038c(%rip), %xmm0    # 0x53008
movq %rax, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
callq 0x285e9
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x16f91
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x307ea
movl $0xa, %edi
movss 0x10344(%rip), %xmm0    # 0x53008
movq %rax, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
callq 0x285e9
movq %r12, %rdi
movl $0xa, %esi
callq 0xf278
movl %eax, %ebp
movq 0x88(%rsp), %rax
movq (%rax,%r15,8), %rdi
movl $0xa, %esi
callq 0xf278
cmpl %eax, %ebp
jne 0x42d17
movss 0x24(%rsp), %xmm0
addss 0x102f7(%rip), %xmm0    # 0x53008
movss %xmm0, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
xorps %xmm0, %xmm0
cvtss2sd 0x24(%rsp), %xmm0
mulsd 0x15470(%rip), %xmm0    # 0x581b0
leaq 0x1(%r15), %rbp
cvtsi2sd %ebp, %xmm1
divsd %xmm1, %xmm0
movq %r13, %rdi
movl %r15d, %esi
movb $0x1, %al
callq 0x3170
movslq 0x70(%rsp), %rax
movq %rbp, %r15
cmpq %rax, %rbp
jl 0x42c29
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/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 0x2f9e4
movq %rax, %r14
xorl %edi, %edi
callq 0x32d0
movl %eax, %edi
callq 0x3230
leaq 0x1543c(%rip), %rsi     # 0x581e3
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x2e687
callq 0x3130
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)
movq %r14, %rdi
movl $0x2, %esi
callq 0x3139e
xorps %xmm0, %xmm0
addss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
callq 0x3130
subq %r15, %rax
movq %rax, %rdi
callq 0xe8d4
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movl 0x8(%rbx), %esi
leaq 0x15402(%rip), %rdi     # 0x5821f
movsd 0x48(%rsp), %xmm0
movb $0x2, %al
callq 0x3170
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 0x2b6fd
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e9af
leaq 0x1535f(%rip), %rsi     # 0x581e3
leaq 0x30(%rsp), %rdi
callq 0x2e687
cmpl $0x0, 0x8(%rbx)
jle 0x42f32
leaq 0x18(%rsp), %rbx
leaq 0x26edc(%rip), %r13     # 0x69d80
leaq 0x153ce(%rip), %r14     # 0x58279
leaq 0xb0(%rsp), %r15
xorl %r12d, %r12d
movq 0x80(%rsp), %rax
movq (%rax,%r12,8), %r8
movq %rbx, %rdi
movl $0x20, %esi
movl $0x20, %edx
movl $0x3, %ecx
callq 0x1675b
movq 0x90(%rsp), %rax
movq (%rax,%r12,8), %rdi
movl $0xa, %esi
callq 0xf278
cltq
movq (%r13,%rax,8), %rcx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x3430
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x17a81
incq %r12
movslq 0x78(%rsp), %rax
cmpq %rax, %r12
jl 0x42eb6
cmpl $0x0, 0x38(%rsp)
jle 0x42fd1
leaq 0x18(%rsp), %rbx
leaq 0x26e37(%rip), %r13     # 0x69d80
leaq 0x15340(%rip), %r14     # 0x58290
leaq 0xb0(%rsp), %r15
xorl %r12d, %r12d
movq 0x40(%rsp), %rax
movq (%rax,%r12,8), %r8
movq %rbx, %rdi
movl $0x20, %esi
movl $0x20, %edx
movl $0x3, %ecx
callq 0x1675b
movq 0x50(%rsp), %rax
movq (%rax,%r12,8), %rdi
movl $0xa, %esi
callq 0xf278
cltq
movq (%r13,%rax,8), %rcx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x3430
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x17a81
incq %r12
movslq 0x38(%rsp), %rax
cmpq %rax, %r12
jl 0x42f5b
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x430fd
cmpl $0x4, %edi
jne 0x42ff9
xorl %ebx, %ebx
jmp 0x42ffd
movq 0x20(%rsi), %rbx
movq 0x18(%rsi), %r14
movq 0x10(%rsi), %r15
leaq 0x152d0(%rip), %rsi     # 0x582dc
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x430c3
leaq 0x152a6(%rip), %rsi     # 0x582c9
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x430d3
leaq 0x15297(%rip), %rsi     # 0x582d1
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x430dd
leaq 0x160ac(%rip), %rsi     # 0x590fd
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x430ed
leaq 0x1585b(%rip), %rsi     # 0x588c3
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x4310b
leaq 0x15246(%rip), %rsi     # 0x582c5
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x4311b
leaq 0x15243(%rip), %rsi     # 0x582d9
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
je 0x4312b
leaq 0x15235(%rip), %rsi     # 0x582e2
movq %r15, %rdi
callq 0x3270
testl %eax, %eax
jne 0x43105
popq %rbx
popq %r14
popq %r15
jmp 0x95b1
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x42464
popq %rbx
popq %r14
popq %r15
jmp 0x42e5e
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x427e3
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x42d7c
movq %rsi, %rdi
callq 0x9679
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x42bb6
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x921e
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x93ea
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x32a0
testl %eax, %eax
jne 0x4317c
movl $0x60, %edi
callq 0x3310
movq %rax, %rbx
movl $0x1, %esi
movl $0x60, %edx
movq %rax, %rdi
movq %r14, %rcx
callq 0x30e0
cmpq $0x60, %rax
je 0x4317e
movq %rbx, %rdi
callq 0x3040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movq %rdi, %r14
movl $0x80, %edi
movl $0x8, %esi
callq 0x3260
movq %rax, %rbx
leaq 0xff03(%rip), %rsi      # 0x530b0
movq %r14, %rdi
callq 0x33a0
movq %rax, %r15
movq %rax, %rdi
callq 0x4313c
testq %rax, %rax
je 0x43205
movq %rax, %r12
movl $0x80, %ebp
xorl %r14d, %r14d
movslq %ebp, %rax
cmpq %rax, %r14
jl 0x431ec
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movq %r12, (%rbx,%r14,8)
incq %r14
movq %r15, %rdi
callq 0x4313c
movq %rax, %r12
testq %rax, %rax
jne 0x431d0
jmp 0x43208
xorl %r14d, %r14d
leaq 0x15232(%rip), %rdi     # 0x58441
movl %r14d, %esi
xorl %eax, %eax
callq 0x3170
movl %r14d, %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x3360
movl %r14d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x31d0
leaq 0x5a4(%rbx), %rax
xorl %r8d, %r8d
movsbl (%r14,%r15), %edx
movslq %r8d, %rdi
xorl %ecx, %ecx
xorl %esi, %esi
btl %ecx, %edx
movq %rbx, %r8
jb 0x4327e
movl %edx, %r9d
shrl %cl, %r9d
movq %rax, %r8
testb $0x2, %r9b
je 0x43286
movl $0x3f800000, (%r8,%rdi,4) # imm = 0x3F800000
leaq 0x1(%rdi), %r8
cmpq $0x167, %rdi            # imm = 0x167
jg 0x432a5
leal 0x1(%rsi), %r9d
addl $0x2, %ecx
movq %r8, %rdi
cmpl $0x3, %esi
movl %r9d, %esi
jb 0x43267
incq %r15
cmpq $0x5b, %r15
jne 0x4325b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xfd30(%rip), %xmm0     # 0x53008
xorl %edx, %edx
movslq %edx, %rdx
leaq (%rsi,%rdx,4), %r8
xorl %ecx, %ecx
xorl %r9d, %r9d
movss (%r8,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
movss 0x5a4(%r8,%r9,4), %xmm1
jne 0x4330a
jp 0x4330a
movl $0x1, %r10d
shll %cl, %r10d
orb %r10b, (%rdi,%rax)
ucomiss %xmm0, %xmm1
jne 0x4331e
jp 0x4331e
movl $0x2, %r10d
shll %cl, %r10d
orb %r10b, (%rdi,%rax)
leaq (%rdx,%r9), %r11
leaq 0x1(%r9), %r10
cmpq $0x167, %r11            # imm = 0x167
jg 0x4333b
addl $0x2, %ecx
cmpl $0x3, %r9d
movq %r10, %r9
jb 0x432e6
incq %rax
addq %r10, %rdx
cmpq $0x5b, %rax
jne 0x432da
retq
// File: /workspace/github_c_makefile_star2_O1/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 $-0x169, %rax           # imm = 0xFE97
movss 0xf3b7(%rip), %xmm0     # 0x53008
movss 0x5a4(%rdi,%rax,4), %xmm1
movss 0xb48(%rdi,%rax,4), %xmm2
movss %xmm2, 0x5a4(%rdi,%rax,4)
movss %xmm1, 0xb48(%rdi,%rax,4)
movaps %xmm0, %xmm1
subss 0x10ec(%rdi,%rax,4), %xmm1
movss %xmm1, 0x10ec(%rdi,%rax,4)
incq %rax
jne 0x43c51
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x43f36
movq %rax, %r15
testl %ebp, %ebp
leal (%r14,%r14,8), %eax
leal (%r14,%rax,2), %ecx
leal 0x169(%r14,%rax,2), %eax
cmovgl %ecx, %eax
addl %ebx, %eax
cltq
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 0x441ac
leal -0x1(%r14), %ecx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x441ac
leal 0x1(%rbx), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x441ac
decl %ebx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x441ac
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3040
// File: /workspace/github_c_makefile_star2_O1/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:
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
leal (%r14,%r14,8), %eax
leal (%r14,%rax,2), %r13d
addl %r8d, %r13d
leal 0x1(%r14), %eax
movl %eax, 0x4(%rsp)
leal -0x1(%r14), %eax
movl %eax, (%rsp)
cmpl $0x12, %r14d
ja 0x44283
cmpl $0x12, %ebx
ja 0x44283
movl %r13d, %eax
movss (%r12,%rax,4), %xmm0
movl $0x1, %ecx
ucomiss 0xee71(%rip), %xmm0     # 0x53078
jne 0x44222
jp 0x44222
movss 0x5a4(%r12,%rax,4), %xmm0
cmpneqss 0xee5a(%rip), %xmm0     # 0x53078
movd %xmm0, %ecx
cmpl %ebp, %ecx
jne 0x44283
cmpl $0x1, (%r15,%rax,4)
jne 0x44283
xorl %ecx, %ecx
movl %ecx, (%r12,%rax,4)
leal 0x169(%r13), %eax
movl %ecx, (%r12,%rax,4)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl 0x4(%rsp), %ecx
movl %ebx, %r8d
callq 0x441ac
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl (%rsp), %ecx
movl %ebx, %r8d
callq 0x441ac
leal 0x1(%rbx), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x441ac
decl %r13d
decl %ebx
jmp 0x441df
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/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 0x44322
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3040
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x442d1
callq 0x442a8
incq %r14
cmpq $0x16a, %r14            # imm = 0x16A
jne 0x442bf
movq 0x8(%rbx), %rdi
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_O1/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
movl $0x1, %edi
movl $0x48, %esi
callq 0x3260
movq %rax, %r14
movq %rbx, (%rax)
movl $0x16a, %edi            # imm = 0x16A
movl $0x8, %esi
callq 0x3260
movq %rax, 0x8(%r14)
movl $0x16a, %edi            # imm = 0x16A
movl $0x4, %esi
callq 0x3260
movq %rax, %r15
movq %rax, 0x10(%r14)
movl $0x16a, %edi            # imm = 0x16A
movl $0x4, %esi
callq 0x3260
movq %rax, 0x30(%r14)
movl $0x16a, %edi            # imm = 0x16A
movl $0x4, %esi
callq 0x3260
movq %rax, %r12
movq %rax, 0x28(%r14)
movl $0x16a, %edi            # imm = 0x16A
movl $0x4, %esi
callq 0x3260
movq %rax, %r13
movq %rax, 0x20(%r14)
movl $0x16a, %edi            # imm = 0x16A
movl $0x4, %esi
callq 0x3260
movq %rax, %rbp
movq %rax, 0x18(%r14)
movl $0x1, 0x38(%r14)
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x44323
movq %rax, (%rsp)
movl $0x16a, %edi            # imm = 0x16A
movq %rax, %rsi
movl $0x1, %edx
movq %r15, %rcx
movl $0x1, %r8d
callq 0x2879c
movq (%rsp), %rax
movss 0x5a8(%rax), %xmm0
addss %xmm0, %xmm0
addss 0xec3f(%rip), %xmm0     # 0x53268
movss %xmm0, 0x3c(%r14)
xorl %eax, %eax
xorps %xmm1, %xmm1
movl $0xbf800000, %ecx       # imm = 0xBF800000
xorl %edx, %edx
movl %eax, (%rbp,%rdx)
movl %eax, (%r13,%rdx)
movss %xmm0, (%r12,%rdx)
cmpq $0x5a4, %rdx            # imm = 0x5A4
je 0x44682
movss (%rbx,%rdx), %xmm2
ucomiss %xmm1, %xmm2
jne 0x4465f
jnp 0x44672
movl %ecx, (%r13,%rdx)
movl %ecx, (%r12,%rdx)
movl $0x0, (%r15,%rdx)
jmp 0x44682
movss 0x5a4(%rbx,%rdx), %xmm2
ucomiss %xmm1, %xmm2
jne 0x4465f
jp 0x4465f
addq $0x4, %rdx
cmpq $0x5a8, %rdx            # imm = 0x5A8
jne 0x4463b
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_O1/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, %r14d
leal (%r14,%r14,8), %eax
leal (%r14,%rax,2), %eax
addl %r8d, %eax
movslq %eax, %rcx
movss (%rdi,%rcx,4), %xmm1
xorl %eax, %eax
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x449cf
jnp 0x449e1
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 0x449cf
jp 0x449cf
movl %r8d, %ebx
movl %edx, %ebp
movq %rsi, %r12
movq %rsp, %r13
movl $0x43b, %edi            # imm = 0x43B
movq %r15, %rsi
movl $0x1, %edx
movq %r13, %rcx
movl $0x1, %r8d
callq 0x2879c
movq %r13, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x43e98
movq %r13, %rdi
movq %r12, %rsi
callq 0x44d87
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x449cf
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x44c6f
xorl $0x1, %eax
jmp 0x449cf