LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_avgpool
avgpool_layer parse_avgpool(list *options, size_params params)
{
    int batch,w,h,c;
    w = params.w;
    h = params.h;
    c = params.c;
    batch=params.batch;
    if(!(h && w && c)) error("Layer before avgpool layer must output image.");

    avgpool_layer layer = make_avgpool_layer(batch,w,h,c);
    return layer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x3c(%rsp), %ebp
movl 0x30(%rsp), %r12d
movl 0x38(%rsp), %r14d
movl 0x40(%rsp), %r15d
testl %r14d, %r14d
setne %al
testl %ebp, %ebp
setne %cl
andb %al, %cl
testl %r15d, %r15d
setne %al
testb %al, %cl
jne 0x26517
leaq 0x29f1a(%rip), %rdi     # 0x5042c
callq 0x43df
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x2c350
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_dropout
dropout_layer parse_dropout(list *options, size_params params)
{
    float probability = option_find_float(options, "probability", .5);
    dropout_layer layer = make_dropout_layer(params.batch, params.inputs, probability);
    layer.out_w = params.w;
    layer.out_h = params.h;
    layer.out_c = params.c;
    return layer;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x29f16(%rip), %rsi     # 0x5045a
movss 0x25ce8(%rip), %xmm0    # 0x4c234
movq %rax, %rdi
callq 0x298c3
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movq %rbx, %rdi
callq 0x1bf0c
movq 0x18(%rsp), %rax
movq %rax, 0x78(%rbx)
movl 0x20(%rsp), %eax
movl %eax, 0x80(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_normalization
layer parse_normalization(list *options, size_params params)
{
    float alpha = option_find_float(options, "alpha", .0001);
    float beta =  option_find_float(options, "beta" , .75);
    float kappa = option_find_float(options, "kappa", 1);
    int size = option_find_int(options, "size", 5);
    layer l = make_normalization_layer(params.batch, params.w, params.h, params.c, size, alpha, beta, kappa);
    return l;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x28746(%rip), %rsi     # 0x4ecd6
movss 0x2991c(%rip), %xmm0    # 0x4feb4
movq %r14, %rdi
callq 0x298c3
movss %xmm0, 0x14(%rsp)
leaq 0x29eb9(%rip), %rsi     # 0x50466
movss 0x29903(%rip), %xmm0    # 0x4feb8
movq %r14, %rdi
callq 0x298c3
movss %xmm0, 0x10(%rsp)
leaq 0x29ea1(%rip), %rsi     # 0x5046b
movss 0x25a36(%rip), %xmm0    # 0x4c008
movq %r14, %rdi
callq 0x298c3
movss %xmm0, 0xc(%rsp)
leaq 0x2aff3(%rip), %rsi     # 0x515da
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x2977d
movl 0x3c(%rsp), %edx
movl 0x30(%rsp), %esi
movl 0x38(%rsp), %ecx
movl 0x40(%rsp), %r8d
movq %rbx, %rdi
movl %eax, %r9d
movss 0x14(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
callq 0x2be1c
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_shortcut
layer parse_shortcut(list *options, size_params params, network *net)
{
    char *l = option_find(options, "from");
    int index = atoi(l);
    if(index < 0) index = params.index + index;

    int batch = params.batch;
    layer from = net->layers[index];

    layer s = make_shortcut_layer(batch, index, params.w, params.h, params.c, from.out_w, from.out_h, from.out_c);

    char *activation_s = option_find_str(options, "activation", "linear");
    ACTIVATION activation = get_activation(activation_s);
    s.activation = activation;
    s.alpha = option_find_float_quiet(options, "alpha", 1);
    s.beta = option_find_float_quiet(options, "beta", 1);
    return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x29e12(%rip), %rsi     # 0x50471
movq %r14, %rdi
callq 0x2983b
movq %rax, %rdi
callq 0x3400
movl %eax, %ecx
sarl $0x1f, %ecx
andl 0x34(%rsp), %ecx
addl %eax, %ecx
movq 0x20(%r15), %rax
movslq %ecx, %rdx
imulq $0x4a0, %rdx, %rcx      # imm = 0x4A0
movl 0x78(%rax,%rcx), %r10d
movl 0x7c(%rax,%rcx), %r11d
movl 0x80(%rax,%rcx), %eax
movl 0x2c(%rsp), %ecx
movl 0x20(%rsp), %esi
movl 0x28(%rsp), %r8d
movl 0x30(%rsp), %r9d
subq $0x8, %rsp
movq %rbx, %rdi
pushq %rax
pushq %r10
pushq %r11
callq 0x2d0f4
addq $0x20, %rsp
leaq 0x2957b(%rip), %rsi     # 0x4fc42
leaq 0x2900e(%rip), %rdx     # 0x4f6dc
movq %r14, %rdi
callq 0x29737
movq %rax, %rdi
callq 0x1a016
movl %eax, 0x4(%rbx)
leaq 0x285ee(%rip), %rsi     # 0x4ecd6
movss 0x25918(%rip), %xmm0    # 0x4c008
movq %r14, %rdi
callq 0x2989e
movss %xmm0, 0x134(%rbx)
leaq 0x29d5f(%rip), %rsi     # 0x50466
movq %r14, %rdi
movss 0x258f6(%rip), %xmm0    # 0x4c008
callq 0x2989e
movss %xmm0, 0x138(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_l2norm
layer parse_l2norm(list *options, size_params params)
{
    layer l = make_l2norm_layer(params.batch, params.inputs);
    l.h = l.out_h = params.h;
    l.w = l.out_w = params.w;
    l.c = l.out_c = params.c;
    return l;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x3478c
movdqu 0x18(%rsp), %xmm0
movq 0x1c(%rsp), %rax
movq %rax, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movq %rax, 0x7c(%rbx)
pshufd $0x34, %xmm0, %xmm0     # xmm0 = xmm0[0,1,3,0]
movdqu %xmm0, 0x6c(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_logistic
layer parse_logistic(list *options, size_params params)
{
    layer l = make_logistic_layer(params.batch, params.inputs);
    l.h = l.out_h = params.h;
    l.w = l.out_w = params.w;
    l.c = l.out_c = params.c;
    return l;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x2d424
movdqu 0x18(%rsp), %xmm0
movq 0x1c(%rsp), %rax
movq %rax, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movq %rax, 0x7c(%rbx)
pshufd $0x34, %xmm0, %xmm0     # xmm0 = xmm0[0,1,3,0]
movdqu %xmm0, 0x6c(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_activation
layer parse_activation(list *options, size_params params)
{
    char *activation_s = option_find_str(options, "activation", "linear");
    ACTIVATION activation = get_activation(activation_s);

    layer l = make_activation_layer(params.batch, params.inputs, activation);

    l.h = l.out_h = params.h;
    l.w = l.out_w = params.w;
    l.c = l.out_c = params.c;

    return l;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2949c(%rip), %rsi     # 0x4fc42
leaq 0x28f2f(%rip), %rdx     # 0x4f6dc
movq %rax, %rdi
callq 0x29737
movq %rax, %rdi
callq 0x1a016
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movq %rbx, %rdi
movl %eax, %ecx
callq 0x2d5a4
movdqu 0x18(%rsp), %xmm0
movq 0x1c(%rsp), %rax
movq %rax, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movq %rax, 0x7c(%rbx)
pshufd $0x34, %xmm0, %xmm0     # xmm0 = xmm0[0,1,3,0]
movdqu %xmm0, 0x6c(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: get_policy
learning_rate_policy get_policy(char *s)
{
    if (strcmp(s, "random")==0) return RANDOM;
    if (strcmp(s, "poly")==0) return POLY;
    if (strcmp(s, "constant")==0) return CONSTANT;
    if (strcmp(s, "step")==0) return STEP;
    if (strcmp(s, "exp")==0) return EXP;
    if (strcmp(s, "sigmoid")==0) return SIG;
    if (strcmp(s, "steps")==0) return STEPS;
    fprintf(stderr, "Couldn't find policy %s, going with constant\n", s);
    return CONSTANT;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x29859(%rip), %rsi     # 0x50263
callq 0x3260
testl %eax, %eax
je 0x26a89
leaq 0x29a82(%rip), %rsi     # 0x5049c
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x26a8d
leaq 0x29a74(%rip), %rsi     # 0x504a1
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x26a91
leaq 0x29a6a(%rip), %rsi     # 0x504aa
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x26a95
leaq 0x29a5c(%rip), %rsi     # 0x504af
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x26a99
leaq 0x29a4d(%rip), %rsi     # 0x504b3
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x26a9d
leaq 0x29a9c(%rip), %rsi     # 0x50515
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
jne 0x26aa9
pushq $0x4
jmp 0x26a9f
pushq $0x6
jmp 0x26a9f
pushq $0x3
jmp 0x26a9f
xorl %ebp, %ebp
jmp 0x26aa0
pushq $0x1
jmp 0x26a9f
pushq $0x2
jmp 0x26a9f
pushq $0x5
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x3d548(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
leaq 0x29a01(%rip), %rsi     # 0x504bb
xorl %ebp, %ebp
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3270
jmp 0x26aa0
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: read_cfg
list *read_cfg(char *filename)
{
    FILE *file = fopen(filename, "r");
    if(file == 0) file_error(filename);
    char *line;
    int nu = 0;
    list *options = make_list();
    section *current = 0;
    while((line=fgetl(file)) != 0){
        ++ nu;
        strip(line);
        switch(line[0]){
            case '[':
                current = malloc(sizeof(section));
                list_insert(options, current);
                current->options = make_list();
                current->type = line;
                break;
            case '\0':
            case '#':
            case ';':
                free(line);
                break;
            default:
                if(!read_option(line, current->options)){
                    fprintf(stderr, "Config file error line %d, could parse: %s\n", nu, line);
                    free(line);
                }
                break;
        }
    }
    fclose(file);
    return options;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x29b3f(%rip), %rsi     # 0x51ce9
callq 0x3390
movq %rax, %rbx
testq %rax, %rax
jne 0x281bf
movq %r14, %rdi
callq 0x3d0f
xorl %eax, %eax
callq 0x7220
movq %rax, %r14
leaq 0x28505(%rip), %r12     # 0x506d5
xorl %ebp, %ebp
xorl %r13d, %r13d
incl %ebp
movq %rbx, %rdi
callq 0x3d32
testq %rax, %rax
je 0x28263
movq %rax, %r15
movq %rax, %rdi
callq 0x44f1
movzbl (%r15), %eax
testl %eax, %eax
je 0x2822f
cmpl $0x23, %eax
je 0x2822f
cmpl $0x3b, %eax
je 0x2822f
cmpl $0x5b, %eax
je 0x28239
movq 0x8(%r13), %rsi
movq %r15, %rdi
callq 0x2965b
testl %eax, %eax
jne 0x281d5
movq 0x3bddb(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq %r12, %rsi
movl %ebp, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x3270
movq %r15, %rdi
callq 0x3040
jmp 0x281d5
pushq $0x10
popq %rdi
callq 0x3300
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0x7271
xorl %eax, %eax
callq 0x7220
movq %rax, 0x8(%r13)
movq %r15, (%r13)
jmp 0x281d5
movq %rbx, %rdi
callq 0x3130
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/parser.c
// Function: save_convolutional_weights_binary
void save_convolutional_weights_binary(layer l, FILE *fp)
{
    binarize_weights(l.weights, l.n, l.c*l.size*l.size, l.binary_weights);
    int size = l.c*l.size*l.size;
    int i, j, k;
    fwrite(l.biases, sizeof(float), l.n, fp);
    if (l.batch_normalize){
        fwrite(l.scales, sizeof(float), l.n, fp);
        fwrite(l.rolling_mean, sizeof(float), l.n, fp);
        fwrite(l.rolling_variance, sizeof(float), l.n, fp);
    }
    for(i = 0; i < l.n; ++i){
        float mean = l.binary_weights[i*size];
        if(mean < 0) mean = -mean;
        fwrite(&mean, sizeof(float), 1, fp);
        for(j = 0; j < size/8; ++j){
            int index = i*size + j*8;
            unsigned char c = 0;
            for(k = 0; k < 8; ++k){
                if (j*8 + k >= size) break;
                if (l.binary_weights[index + k] > 0) c = (c | 1<<k);
            }
            fwrite(&c, sizeof(char), 1, fp);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
movq 0x2c0(%rsp), %rdi
movl 0xf4(%rsp), %ebx
movl 0x100(%rsp), %eax
movl 0xe4(%rsp), %r13d
imull %eax, %r13d
imull %eax, %r13d
movq 0x298(%rsp), %rcx
movl %ebx, %esi
movl %r13d, %edx
movq %rcx, 0x8(%rsp)
callq 0x5be1
movq 0x2a0(%rsp), %rdi
movq %rbx, %r14
movslq %ebx, %r12
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3440
cmpl $0x0, 0xb0(%rsp)
je 0x28338
leaq 0x70(%rsp), %rbx
movq 0x240(%rbx), %rdi
pushq $0x4
popq %rbp
movq %rbp, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3440
movq 0x2b0(%rbx), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3440
movq 0x2b8(%rbx), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3440
pushq $0x8
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x30(%rsp)
movslq %r13d, %r13
testl %r14d, %r14d
cmovlel %ecx, %r14d
movq %r14, 0x18(%rsp)
leaq (,%r13,4), %rax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %r14
movq 0x8(%rsp), %rbp
cmpq 0x18(%rsp), %rcx
je 0x28431
movq %rcx, 0x28(%rsp)
movq %rcx, %rax
imulq %r13, %rax
movq 0x8(%rsp), %rcx
movss (%rcx,%rax,4), %xmm0
movaps %xmm0, %xmm1
xorps 0x23db3(%rip), %xmm1    # 0x4c150
maxss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
leaq 0x4(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %r12
movq %r15, %rcx
callq 0x3440
xorl %r15d, %r15d
movq %rbp, 0x20(%rsp)
xorl %ebx, %ebx
cmpq 0x30(%rsp), %rbx
je 0x28417
xorl %ecx, %ecx
xorl %eax, %eax
xorps %xmm1, %xmm1
cmpq $0x7, %rcx
ja 0x283ff
leaq (%r15,%rcx), %rdx
cmpq %r13, %rdx
jge 0x283ff
movl %r14d, %edx
shll %cl, %edx
movss (%rbp,%rcx,4), %xmm0
ucomiss %xmm1, %xmm0
ja 0x283f6
xorl %edx, %edx
orb %al, %dl
incq %rcx
movl %edx, %eax
jmp 0x283d5
movsbl %al, %edi
movq %r12, %rsi
callq 0x31f0
incq %rbx
addq $0x20, %rbp
addq $0x8, %r15
jmp 0x283c7
movq 0x28(%rsp), %rcx
incq %rcx
movq 0x20(%rsp), %rbp
addq 0x10(%rsp), %rbp
movq %r12, %r15
jmp 0x28372
addq $0x38, %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/parser.c
// Function: save_convolutional_weights
void save_convolutional_weights(layer l, FILE *fp)
{
    if(l.binary){
        //save_convolutional_weights_binary(l, fp);
        //return;
    }
    int num = l.nweights;
    fwrite(l.biases, sizeof(float), l.n, fp);
    if (l.batch_normalize){
        fwrite(l.scales, sizeof(float), l.n, fp);
        fwrite(l.rolling_mean, sizeof(float), l.n, fp);
        fwrite(l.rolling_variance, sizeof(float), l.n, fp);
    }
    fwrite(l.weights, sizeof(float), num, fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x30(%rsp), %r13
movslq 0x5c(%r13), %r14
movq 0x230(%r13), %rdi
movslq 0x84(%r13), %r15
pushq $0x4
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3440
cmpl $0x0, 0x40(%r13)
je 0x284bb
movq 0x240(%r13), %rdi
pushq $0x4
popq %r12
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x2b0(%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x2b8(%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x250(%r13), %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3440
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: save_connected_weights
void save_connected_weights(layer l, FILE *fp)
{
    fwrite(l.biases, sizeof(float), l.outputs, fp);
    fwrite(l.weights, sizeof(float), l.outputs*l.inputs, fp);
    if (l.batch_normalize){
        fwrite(l.scales, sizeof(float), l.outputs, fp);
        fwrite(l.rolling_mean, sizeof(float), l.outputs, fp);
        fwrite(l.rolling_variance, sizeof(float), l.outputs, fp);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x260(%rsp), %rdi
movslq 0x88(%rsp), %r14
pushq $0x4
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x280(%rsp), %rdi
movslq 0x84(%rsp), %rdx
imulq %r14, %rdx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x3440
cmpl $0x0, 0x70(%rsp)
je 0x285dd
leaq 0x30(%rsp), %r12
movq 0x240(%r12), %rdi
pushq $0x4
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x2b0(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x2b8(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3440
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: transpose_matrix
void transpose_matrix(float *a, int rows, int cols)
{
    float *transpose = calloc(rows*cols, sizeof(float));
    int x, y;
    for(x = 0; x < rows; ++x){
        for(y = 0; y < cols; ++y){
            transpose[y*rows + x] = a[x*cols + y];
        }
    }
    memcpy(a, transpose, rows*cols*sizeof(float));
    free(transpose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
movl %edx, %eax
imull %esi, %eax
movslq %eax, %r14
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x3250
movq %rax, %r15
movslq %r12d, %rax
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
movslq %ebp, %rsi
testl %eax, %eax
movl $0x0, %edi
cmovgl %eax, %edi
shlq $0x2, %rsi
shlq $0x2, %rax
movq %r15, %r8
movq %rbx, %r9
cmpq %rdi, %rcx
je 0x28b73
movq %r8, %r10
xorl %r11d, %r11d
cmpq %r11, %rdx
je 0x28b67
movss (%r9,%r11,4), %xmm0
movss %xmm0, (%r10)
incq %r11
addq %rax, %r10
jmp 0x28b4f
incq %rcx
addq %rsi, %r9
addq $0x4, %r8
jmp 0x28b44
shlq $0x2, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x32b0
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/parser.c
// Function: load_connected_weights
void load_connected_weights(layer l, FILE *fp, int transpose)
{
    fread(l.biases, sizeof(float), l.outputs, fp);
    fread(l.weights, sizeof(float), l.outputs*l.inputs, fp);
    if(transpose){
        transpose_matrix(l.weights, l.inputs, l.outputs);
    }
    //printf("Biases: %f mean %f variance\n", mean_array(l.biases, l.outputs), variance_array(l.biases, l.outputs));
    //printf("Weights: %f mean %f variance\n", mean_array(l.weights, l.outputs*l.inputs), variance_array(l.weights, l.outputs*l.inputs));
    if (l.batch_normalize && (!l.dontloadscales)){
        fread(l.scales, sizeof(float), l.outputs, fp);
        fread(l.rolling_mean, sizeof(float), l.outputs, fp);
        fread(l.rolling_variance, sizeof(float), l.outputs, fp);
        //printf("Scales: %f mean %f variance\n", mean_array(l.scales, l.outputs), variance_array(l.scales, l.outputs));
        //printf("rolling_mean: %f mean %f variance\n", mean_array(l.rolling_mean, l.outputs), variance_array(l.rolling_mean, l.outputs));
        //printf("rolling_variance: %f mean %f variance\n", mean_array(l.rolling_variance, l.outputs), variance_array(l.rolling_variance, l.outputs));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x40(%rsp), %r13
movq 0x230(%r13), %rdi
movslq 0x58(%r13), %r14
pushq $0x4
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x30d0
movq 0x250(%r13), %r15
movslq 0x54(%r13), %r12
movq %r12, %rdx
imulq %r14, %rdx
movq %r15, %rdi
pushq $0x4
popq %rsi
movq %rbx, %rcx
callq 0x30d0
testl %ebp, %ebp
je 0x28bf5
movq %r15, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x28af4
cmpl $0x0, 0x40(%r13)
je 0x28c57
cmpl $0x0, 0x184(%r13)
jne 0x28c57
movq 0x240(%r13), %rdi
pushq $0x4
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x30d0
movq 0x2b0(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x30d0
movq 0x2b8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30d0
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/parser.c
// Function: load_convolutional_weights_binary
void load_convolutional_weights_binary(layer l, FILE *fp)
{
    fread(l.biases, sizeof(float), l.n, fp);
    if (l.batch_normalize && (!l.dontloadscales)){
        fread(l.scales, sizeof(float), l.n, fp);
        fread(l.rolling_mean, sizeof(float), l.n, fp);
        fread(l.rolling_variance, sizeof(float), l.n, fp);
    }
    int size = l.c*l.size*l.size;
    int i, j, k;
    for(i = 0; i < l.n; ++i){
        float mean = 0;
        fread(&mean, sizeof(float), 1, fp);
        for(j = 0; j < size/8; ++j){
            int index = i*size + j*8;
            unsigned char c = 0;
            fread(&c, sizeof(char), 1, fp);
            for(k = 0; k < 8; ++k){
                if (j*8 + k >= size) break;
                l.weights[index + k] = (c & 1<<k) ? mean : -mean;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rcx
leaq 0x90(%rsp), %r14
movq 0x230(%r14), %rdi
movslq 0x84(%r14), %rdx
pushq $0x4
popq %rsi
movq %rdx, %r13
movq %rcx, 0x8(%rsp)
callq 0x30d0
cmpl $0x0, 0x40(%r14)
je 0x28d51
cmpl $0x0, 0x214(%rsp)
jne 0x28d51
movq 0x240(%r14), %rdi
pushq $0x4
popq %r15
movq %r15, %rsi
movq %r13, %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
callq 0x30d0
movq 0x2b0(%r14), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x30d0
movq 0x2b8(%r14), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x30d0
movl 0x90(%r14), %eax
movl 0x74(%r14), %ecx
imull %eax, %ecx
imull %eax, %ecx
pushq $0x8
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %r15d
movq 0x250(%r14), %r12
movslq %ecx, %r14
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
testl %r13d, %r13d
cmovlel %eax, %r13d
movq %r13, 0x18(%rsp)
leaq (,%r14,4), %rcx
movq %rcx, 0x10(%rsp)
pushq $0x1
popq %rbp
cmpq 0x18(%rsp), %rax
je 0x28e63
movq %rax, 0x20(%rsp)
andl $0x0, 0x4(%rsp)
leaq 0x4(%rsp), %rdi
pushq $0x4
popq %rsi
movq %rbp, %rdx
movq 0x8(%rsp), %rcx
callq 0x30d0
movss 0x4(%rsp), %xmm1
movaps %xmm1, %xmm2
xorps 0x2337a(%rip), %xmm2    # 0x4c150
xorl %r13d, %r13d
movq %r12, 0x28(%rsp)
xorl %ebx, %ebx
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x30(%rsp)
cmpq %r15, %rbx
je 0x28e4c
movb $0x0, 0x3(%rsp)
leaq 0x3(%rsp), %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq 0x8(%rsp), %rcx
callq 0x30d0
movaps 0x30(%rsp), %xmm2
movaps 0x40(%rsp), %xmm1
movzbl 0x3(%rsp), %eax
xorl %ecx, %ecx
cmpq $0x7, %rcx
ja 0x28e3f
leaq (%rcx,%r13), %rdx
cmpq %r14, %rdx
jge 0x28e3f
btl %ecx, %eax
movaps %xmm2, %xmm0
jae 0x28e34
movaps %xmm1, %xmm0
movss %xmm0, (%r12,%rcx,4)
incq %rcx
jmp 0x28e1a
incq %rbx
addq $0x20, %r12
addq $0x8, %r13
jmp 0x28dea
movq 0x20(%rsp), %rax
incq %rax
movq 0x28(%rsp), %r12
addq 0x10(%rsp), %r12
jmp 0x28d9c
addq $0x58, %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/parser.c
// Function: load_convolutional_weights
void load_convolutional_weights(layer l, FILE *fp)
{
    if(l.binary){
        //load_convolutional_weights_binary(l, fp);
        //return;
    }
    if(l.numload) l.n = l.numload;
    int num = l.c/l.groups*l.n*l.size*l.size;
    fread(l.biases, sizeof(float), l.n, fp);
    if (l.batch_normalize && (!l.dontloadscales)){
        fread(l.scales, sizeof(float), l.n, fp);
        fread(l.rolling_mean, sizeof(float), l.n, fp);
        fread(l.rolling_variance, sizeof(float), l.n, fp);
        if(0){
            int i;
            for(i = 0; i < l.n; ++i){
                printf("%g, ", l.rolling_mean[i]);
            }
            printf("\n");
            for(i = 0; i < l.n; ++i){
                printf("%g, ", l.rolling_variance[i]);
            }
            printf("\n");
        }
        if(0){
            fill_cpu(l.n, 0, l.rolling_mean, 1);
            fill_cpu(l.n, 0, l.rolling_variance, 1);
        }
        if(0){
            int i;
            for(i = 0; i < l.n; ++i){
                printf("%g, ", l.rolling_mean[i]);
            }
            printf("\n");
            for(i = 0; i < l.n; ++i){
                printf("%g, ", l.rolling_variance[i]);
            }
            printf("\n");
        }
    }
    fread(l.weights, sizeof(float), num, fp);
    //if(l.c == 3) scal_cpu(num, 1./256, l.weights, 1);
    if (l.flipped) {
        transpose_matrix(l.weights, l.c*l.size*l.size, l.n);
    }
    //if (l.binary) binarize_weights(l.weights, l.n, l.c*l.size*l.size, l.weights);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x1c8(%rsp), %ebx
testl %ebx, %ebx
jne 0x28e92
movl 0xc4(%rsp), %ebx
leaq 0x40(%rsp), %r13
movl 0x74(%r13), %eax
movl 0x90(%r13), %r15d
movl %eax, 0x4(%rsp)
cltd
idivl 0x8c(%r13)
imull %r15d, %r15d
movl %r15d, %ebp
imull %ebx, %ebp
imull %eax, %ebp
movq 0x230(%r13), %rdi
movslq %ebx, %r12
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x30d0
cmpl $0x0, 0x40(%r13)
je 0x28f23
cmpl $0x0, 0x1c4(%rsp)
jne 0x28f23
movq 0x240(%r13), %rdi
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x30d0
movq 0x2b0(%r13), %rdi
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x30d0
movq 0x2b8(%r13), %rdi
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x30d0
movq 0x250(%r13), %r12
movslq %ebp, %rdx
pushq $0x4
popq %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x30d0
cmpl $0x0, 0x50(%r13)
je 0x28f63
imull 0x4(%rsp), %r15d
movq %r12, %rdi
movl %r15d, %esi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x28af4
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/option_list.c
// Function: read_data_cfg
list *read_data_cfg(char *filename)
{
    FILE *file = fopen(filename, "r");
    if(file == 0) file_error(filename);
    char *line;
    int nu = 0;
    list *options = make_list();
    while((line=fgetl(file)) != 0){
        ++ nu;
        strip(line);
        switch(line[0]){
            case '\0':
            case '#':
            case ';':
                free(line);
                break;
            default:
                if(!read_option(line, options)){
                    fprintf(stderr, "Config file error line %d, could parse: %s\n", nu, line);
                    free(line);
                }
                break;
        }
    }
    fclose(file);
    return options;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x2873c(%rip), %rsi     # 0x51ce9
callq 0x3390
movq %rax, %rbx
testq %rax, %rax
jne 0x295c2
movq %r14, %rdi
callq 0x3d0f
xorl %eax, %eax
callq 0x7220
movq %rax, %r14
pushq $0x1
popq %rbp
leaq 0x270ff(%rip), %r15     # 0x506d5
movabsq $0x800000800000001, %r13 # imm = 0x800000800000001
movq %rbx, %rdi
callq 0x3d32
testq %rax, %rax
je 0x29641
movq %rax, %r12
movq %rax, %rdi
callq 0x44f1
movzbl (%r12), %eax
cmpq $0x3b, %rax
ja 0x29613
btq %rax, %r13
jae 0x29613
movq %r12, %rdi
callq 0x3040
jmp 0x29622
movq %r12, %rdi
movq %r14, %rsi
callq 0x2965b
testl %eax, %eax
je 0x29626
incl %ebp
jmp 0x295e0
movq 0x3a9cb(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3270
jmp 0x29609
movq %rbx, %rdi
callq 0x3130
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/option_list.c
// Function: read_option
int read_option(char *s, list *options)
{
    size_t i;
    size_t len = strlen(s);
    char *val = 0;
    for(i = 0; i < len; ++i){
        if(s[i] == '='){
            s[i] = '\0';
            val = s+i+1;
            break;
        }
    }
    if(i == len-1) return 0;
    char *key = s;
    option_insert(options, key, val);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3140
leaq 0x1(%rbx), %rdx
movq %rax, %rcx
subq $0x1, %rcx
jb 0x29685
cmpb $0x3d, -0x1(%rdx)
je 0x29689
incq %rdx
movq %rcx, %rax
jmp 0x29671
xorl %edx, %edx
jmp 0x29695
movb $0x0, -0x1(%rdx)
xorl %ecx, %ecx
cmpq $0x1, %rax
je 0x296a3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x297c6
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/option_list.c
// Function: get_metadata
metadata get_metadata(char *file)
{
    metadata m = {0};
    list *options = read_data_cfg(file);

    char *name_list = option_find_str(options, "names", 0);
    if(!name_list) name_list = option_find_str(options, "labels", 0);
    if(!name_list) {
        fprintf(stderr, "No names or labels found\n");
    } else {
        m.names = get_labels(name_list);
    }
    m.classes = option_find_int(options, "classes", 2);
    free_list(options);
    return m;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x29598
movq %rax, %rbx
leaq 0x27079(%rip), %rsi     # 0x50739
movq %rax, %rdi
xorl %edx, %edx
callq 0x29737
testq %rax, %rax
jne 0x296e5
leaq 0x262d0(%rip), %rsi     # 0x4f9a6
movq %rbx, %rdi
xorl %edx, %edx
callq 0x29737
testq %rax, %rax
je 0x29716
movq %rax, %rdi
callq 0x1e673
movq %rax, %r14
leaq 0x26af4(%rip), %rsi     # 0x501eb
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x2977d
movl %eax, %ebp
movq %rbx, %rdi
callq 0x72c6
movl %ebp, %eax
movq %r14, %rdx
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3a8db(%rip), %rax     # 0x63ff8
movq (%rax), %rcx
leaq 0x27018(%rip), %rdi     # 0x5073f
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x3440
xorl %r14d, %r14d
jmp 0x296f0
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/option_list.c
// Function: option_find_str
char *option_find_str(list *l, char *key, char *def)
{
    char *v = option_find(l, key);
    if(v) return v;
    if(def) fprintf(stderr, "%s: Using default '%s'\n", key, def);
    return def;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
callq 0x2983b
testq %rax, %rax
jne 0x29752
testq %rbx, %rbx
jne 0x2975a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3a897(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
leaq 0x27007(%rip), %rsi     # 0x50772
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3270
movq %rbx, %rax
jmp 0x29752
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/option_list.c
// Function: option_insert
void option_insert(list *l, char *key, char *val)
{
    kvp *p = malloc(sizeof(kvp));
    p->key = key;
    p->val = val;
    p->used = 0;
    list_insert(l, p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x3300
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
andl $0x0, 0x10(%rax)
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x7271
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/option_list.c
// Function: option_unused
void option_unused(list *l)
{
    node *n = l->front;
    while(n){
        kvp *p = (kvp *)n->val;
        if(!p->used){
            fprintf(stderr, "Unused field: '%s = %s'\n", p->key, p->val);
        }
        n = n->next;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x3a7f2(%rip), %r15     # 0x63ff8
leaq 0x26f4c(%rip), %r14     # 0x50759
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x29835
movq (%rbx), %rax
cmpl $0x0, 0x10(%rax)
jne 0x2980d
movq (%r15), %rdi
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq %r14, %rsi
xorl %eax, %eax
callq 0x3270
jmp 0x2980d
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/option_list.c
// Function: option_find
char *option_find(list *l, char *key)
{
    node *n = l->front;
    while(n){
        kvp *p = (kvp *)n->val;
        if(strcmp(p->key, key) == 0){
            p->used = 1;
            return p->val;
        }
        n = n->next;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
movq 0x8(%r15), %r15
testq %r15, %r15
je 0x29875
movq (%r15), %r12
movq (%r12), %rdi
movq %r14, %rsi
callq 0x3260
testl %eax, %eax
jne 0x2984b
movl $0x1, 0x10(%r12)
movq 0x8(%r12), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/detection_layer.c
// Function: make_detection_layer
detection_layer make_detection_layer(int batch, int inputs, int n, int side, int classes, int coords, int rescore)
{
    detection_layer l = {0};
    l.type = DETECTION;

    l.n = n;
    l.batch = batch;
    l.inputs = inputs;
    l.classes = classes;
    l.coords = coords;
    l.rescore = rescore;
    l.side = side;
    l.w = side;
    l.h = side;
    assert(side*side*((1 + l.coords)*l.n + l.classes) == inputs);
    l.cost = calloc(1, sizeof(float));
    l.outputs = l.inputs;
    l.truths = l.side*l.side*(1+l.coords+l.classes);
    l.output = calloc(batch*l.outputs, sizeof(float));
    l.delta = calloc(batch*l.outputs, sizeof(float));

    l.forward = forward_detection_layer;
    l.backward = backward_detection_layer;

    fprintf(stderr, "Detection Layer\n");
    srand(0);

    return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movl %r8d, %r15d
movl %ecx, %r13d
movl %edx, 0x14(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movl 0x50(%rsp), %r12d
movl $0x4a0, %edx            # imm = 0x4A0
xorl %esi, %esi
callq 0x31c0
movl $0x5, (%rbx)
movl %r13d, 0x84(%rbx)
movl %ebp, 0xc(%rsp)
movl %ebp, 0x48(%rbx)
movl 0x14(%rsp), %ebp
movl %ebp, 0x54(%rbx)
movl %r14d, 0xfc(%rbx)
movl %r12d, 0x100(%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x108(%rbx)
movl %r15d, 0x94(%rbx)
movl %r15d, 0x70(%rbx)
movl %r15d, 0x6c(%rbx)
imull %r15d, %r15d
incl %r12d
imull %r12d, %r13d
movl %r14d, 0x10(%rsp)
addl %r14d, %r13d
imull %r15d, %r13d
cmpl %ebp, %r13d
jne 0x29a4a
pushq $0x1
popq %rdi
pushq $0x4
popq %r13
movq %r13, %rsi
callq 0x3250
movq %rax, 0x1d8(%rbx)
movl %ebp, 0x58(%rbx)
addl 0x10(%rsp), %r12d
imull %r15d, %r12d
movl %r12d, 0x68(%rbx)
movl 0xc(%rsp), %eax
imull %ebp, %eax
movslq %eax, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x3250
movq %rax, 0x268(%rbx)
movq %r14, %rdi
movq %r13, %rsi
callq 0x3250
movq %rax, 0x260(%rbx)
leaq 0x61(%rip), %rax        # 0x29a67
movq %rax, 0x10(%rbx)
leaq 0xbf3(%rip), %rax       # 0x2a604
movq %rax, 0x18(%rbx)
movq 0x3a5dc(%rip), %rax     # 0x63ff8
movq (%rax), %rcx
leaq 0x26e41(%rip), %rdi     # 0x50867
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x3440
xorl %edi, %edi
callq 0x3220
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26d87(%rip), %rdi     # 0x507d8
leaq 0x26db5(%rip), %rsi     # 0x5080d
leaq 0x26dc0(%rip), %rcx     # 0x5081f
pushq $0x1c
popq %rdx
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/route_layer.c
// Function: make_route_layer
route_layer make_route_layer(int batch, int n, int *input_layers, int *input_sizes)
{
    fprintf(stderr,"route ");
    route_layer l = {0};
    l.type = ROUTE;
    l.batch = batch;
    l.n = n;
    l.input_layers = input_layers;
    l.input_sizes = input_sizes;
    int i;
    int outputs = 0;
    for(i = 0; i < n; ++i){
        fprintf(stderr," %d", input_layers[i]);
        outputs += input_sizes[i];
    }
    fprintf(stderr, "\n");
    l.outputs = outputs;
    l.inputs = outputs;
    l.delta =  calloc(outputs*batch, sizeof(float));
    l.output = calloc(outputs*batch, sizeof(float));;

    l.forward = forward_route_layer;
    l.backward = backward_route_layer;
    return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r13
movq %rcx, %r15
movl %edx, %r12d
movl %esi, %r14d
movq %rdi, %rbx
movq 0x39750(%rip), %rbp     # 0x63ff8
movq (%rbp), %rcx
leaq 0x2601b(%rip), %rdi     # 0x508ce
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
callq 0x3440
movl $0x4a0, %edx            # imm = 0x4A0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31c0
movl $0x8, (%rbx)
movl %r14d, 0xc(%rsp)
movl %r14d, 0x48(%rbx)
movl %r12d, 0x84(%rbx)
movq %r15, 0x10(%rsp)
movq %r15, 0x1a8(%rbx)
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
movq %r13, %r15
movq %r13, 0x1b0(%rbx)
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%rbp), %rsi
cmpq %r14, %r12
je 0x2a937
movq 0x10(%rsp), %rax
movl (%rax,%r14,4), %edx
movq %rsi, %rdi
leaq 0x26f5f(%rip), %rsi     # 0x51886
xorl %eax, %eax
callq 0x3270
addl (%r15,%r14,4), %r13d
incq %r14
jmp 0x2a90b
pushq $0xa
popq %rdi
callq 0x31f0
movl %r13d, 0x58(%rbx)
movl %r13d, 0x54(%rbx)
movl 0xc(%rsp), %eax
imull %r13d, %eax
movslq %eax, %r14
pushq $0x4
popq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3250
movq %rax, 0x260(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3250
movq %rax, 0x268(%rbx)
leaq 0x21(%rip), %rax        # 0x2a9a2
movq %rax, 0x10(%rbx)
leaq 0x11e(%rip), %rax       # 0x2aaaa
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x18, %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/route_layer.c
// Function: forward_route_layer
void forward_route_layer(const route_layer l, network net)
{
    int i, j;
    int offset = 0;
    for(i = 0; i < l.n; ++i){
        int index = l.input_layers[i];
        float *input = net.layers[index].output;
        int input_size = l.input_sizes[i];
        for(j = 0; j < l.batch; ++j){
            copy_cpu(input_size, input + j*input_size, 1, l.output + offset + j*l.outputs, 1);
        }
        offset += input_size;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movslq 0x104(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x540(%rsp), %rax
movq %rax, 0x10(%rsp)
movslq 0xc8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x2e8(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq 0xd8(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x38(%rsp)
xorl %edx, %edx
pushq $0x1
popq %rbx
xorl %esi, %esi
cmpq 0x28(%rsp), %rdx
jge 0x2aa9b
movq 0x20(%rsp), %rax
movslq (%rax,%rdx,4), %rax
imulq $0x4a0, %rax, %rax      # imm = 0x4A0
movq 0x10(%rsp), %rcx
movq 0x268(%rcx,%rax), %r15
movq 0x18(%rsp), %rax
movq %rdx, 0x30(%rsp)
movslq (%rax,%rdx,4), %rbp
movl %esi, 0x4(%rsp)
movslq %esi, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %rbp, %r14
shlq $0x2, %r14
xorl %r13d, %r13d
cmpq 0x40(%rsp), %r13
jge 0x2aa88
movl %ebp, %edi
movq %r15, %rsi
movl %ebx, %edx
movq %r12, %rcx
movl %ebx, %r8d
callq 0x1b5a3
incq %r13
addq %r14, %r15
addq 0x38(%rsp), %r12
jmp 0x2aa62
movl 0x4(%rsp), %esi
addl %ebp, %esi
movq 0x30(%rsp), %rdx
incq %rdx
jmp 0x2aa16
addq $0x48, %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/route_layer.c
// Function: backward_route_layer
void backward_route_layer(const route_layer l, network net)
{
    int i, j;
    int offset = 0;
    for(i = 0; i < l.n; ++i){
        int index = l.input_layers[i];
        float *delta = net.layers[index].delta;
        int input_size = l.input_sizes[i];
        for(j = 0; j < l.batch; ++j){
            axpy_cpu(input_size, 1, l.delta + offset + j*l.outputs, 1, delta + j*input_size, 1);
        }
        offset += input_size;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movslq 0x104(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x540(%rsp), %rax
movq %rax, 0x10(%rsp)
movslq 0xc8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x2e0(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq 0xd8(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x38(%rsp)
xorl %edx, %edx
pushq $0x1
popq %rbx
xorl %esi, %esi
cmpq 0x28(%rsp), %rdx
jge 0x2abaf
movq 0x20(%rsp), %rax
movslq (%rax,%rdx,4), %rax
imulq $0x4a0, %rax, %rax      # imm = 0x4A0
movq 0x10(%rsp), %rcx
movq 0x260(%rcx,%rax), %r15
movq 0x18(%rsp), %rax
movq %rdx, 0x30(%rsp)
movslq (%rax,%rdx,4), %rbp
movl %esi, 0x4(%rsp)
movslq %esi, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %rbp, %r14
shlq $0x2, %r14
xorl %r13d, %r13d
cmpq 0x40(%rsp), %r13
jge 0x2ab9c
movl %ebp, %edi
movss 0x21489(%rip), %xmm0    # 0x4c008
movq %r12, %rsi
movl %ebx, %edx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x1b3ed
incq %r13
addq 0x38(%rsp), %r12
addq %r14, %r15
jmp 0x2ab6e
movl 0x4(%rsp), %esi
addl %ebp, %esi
movq 0x30(%rsp), %rdx
incq %rdx
jmp 0x2ab1e
addq $0x48, %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/route_layer.c
// Function: resize_route_layer
void resize_route_layer(route_layer *l, network *net)
{
    int i;
    layer first = net->layers[l->input_layers[0]];
    l->out_w = first.out_w;
    l->out_h = first.out_h;
    l->out_c = first.out_c;
    l->outputs = first.outputs;
    l->input_sizes[0] = first.outputs;
    for(i = 1; i < l->n; ++i){
        int index = l->input_layers[i];
        layer next = net->layers[index];
        l->outputs += next.outputs;
        l->input_sizes[i] = next.outputs;
        if(next.out_w == first.out_w && next.out_h == first.out_h){
            l->out_c += next.out_c;
        }else{
            printf("%d %d, %d %d\n", next.out_w, next.out_h, first.out_w, first.out_h);
            l->out_h = l->out_w = l->out_c = 0;
        }
    }
    l->inputs = l->outputs;
    l->delta =  realloc(l->delta, l->outputs*l->batch*sizeof(float));
    l->output = realloc(l->output, l->outputs*l->batch*sizeof(float));

    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rsi), %rax
movq 0x1a8(%rdi), %rcx
movq 0x1b0(%rdi), %rdx
movslq (%rcx), %rcx
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
movl 0x58(%rax,%rcx), %esi
movl 0x78(%rax,%rcx), %ebp
movq 0x7c(%rax,%rcx), %r15
movl %ebp, 0x78(%rdi)
movq %r15, 0x7c(%rdi)
movl %esi, 0x58(%rdi)
movl %esi, (%rdx)
pushq $0x1
popq %r13
movslq 0x84(%rbx), %rax
cmpq %rax, %r13
jge 0x2ac88
movq 0x1a8(%rbx), %rax
movq 0x1b0(%rbx), %rcx
movslq (%rax,%r13,4), %rax
movq 0x20(%r14), %rdi
imulq $0x4a0, %rax, %rax      # imm = 0x4A0
movl 0x58(%rdi,%rax), %r8d
movl 0x78(%rdi,%rax), %edx
movl 0x7c(%rdi,%rax), %esi
movl 0x80(%rdi,%rax), %r12d
addl %r8d, 0x58(%rbx)
movl %r8d, (%rcx,%r13,4)
cmpl %r15d, %esi
jne 0x2ac60
cmpl %ebp, %edx
jne 0x2ac60
addl 0x80(%rbx), %r12d
jmp 0x2ac7c
xorl %r12d, %r12d
leaq 0x25c6b(%rip), %rdi     # 0x508d5
movl %r15d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3160
andq $0x0, 0x78(%rbx)
movl %r12d, 0x80(%rbx)
incq %r13
jmp 0x2ac08
movslq 0x58(%rbx), %rax
movl %eax, 0x54(%rbx)
movq 0x260(%rbx), %rdi
movslq 0x48(%rbx), %rsi
imulq %rax, %rsi
shlq $0x2, %rsi
callq 0x3350
movq %rax, 0x260(%rbx)
movq 0x268(%rbx), %rdi
movslq 0x58(%rbx), %rax
movslq 0x48(%rbx), %rsi
imulq %rax, %rsi
shlq $0x2, %rsi
callq 0x3350
movq %rax, 0x268(%rbx)
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/upsample_layer.c
// Function: make_upsample_layer
layer make_upsample_layer(int batch, int w, int h, int c, int stride)
{
    layer l = {0};
    l.type = UPSAMPLE;
    l.batch = batch;
    l.w = w;
    l.h = h;
    l.c = c;
    l.out_w = w*stride;
    l.out_h = h*stride;
    l.out_c = c;
    if(stride < 0){
        stride = -stride;
        l.reverse=1;
        l.out_w = w/stride;
        l.out_h = h/stride;
    }
    l.stride = stride;
    l.outputs = l.out_w*l.out_h*l.out_c;
    l.inputs = l.w*l.h*l.c;
    l.delta =  calloc(l.outputs*batch, sizeof(float));
    l.output = calloc(l.outputs*batch, sizeof(float));;

    l.forward = forward_upsample_layer;
    l.backward = backward_upsample_layer;
    if(l.reverse) fprintf(stderr, "downsample         %2dx  %4d x%4d x%4d   ->  %4d x%4d x%4d\n", stride, w, h, c, l.out_w, l.out_h, l.out_c);
    else fprintf(stderr, "upsample           %2dx  %4d x%4d x%4d   ->  %4d x%4d x%4d\n", stride, w, h, c, l.out_w, l.out_h, l.out_c);
    return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r15d
movl %r8d, %r14d
movl %ecx, %r12d
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %rbx
movl $0x4a0, %edx            # imm = 0x4A0
xorl %esi, %esi
callq 0x31c0
movl %r13d, %edi
movl %ebp, %r8d
movl $0x1a, (%rbx)
movl %r13d, 0x48(%rbx)
movl %ebp, 0x70(%rbx)
movl %r12d, 0x6c(%rbx)
movl %r14d, 0x74(%rbx)
movl %r15d, %r13d
imull %ebp, %r13d
movl %r13d, 0x7c(%rbx)
movl %r15d, %ebp
imull %r12d, %ebp
movl %ebp, 0x78(%rbx)
movl %r14d, 0x80(%rbx)
testl %r15d, %r15d
js 0x2ad50
leaq 0x25bd1(%rip), %rax     # 0x5091f
jmp 0x2ad7d
negl %r15d
movl $0x1, 0x9c(%rbx)
movl %r8d, %eax
cltd
idivl %r15d
movl %eax, %r13d
movl %eax, 0x7c(%rbx)
movl %r12d, %eax
cltd
idivl %r15d
movl %eax, %ebp
movl %eax, 0x78(%rbx)
leaq 0x25b66(%rip), %rax     # 0x508e3
movq %rax, 0x10(%rsp)
movl %r15d, 0x98(%rbx)
movl %r13d, %eax
imull %r14d, %eax
imull %ebp, %eax
movl %eax, 0x58(%rbx)
movl %r12d, %ecx
imull %r8d, %ecx
imull %r14d, %ecx
movl %ecx, 0x54(%rbx)
imull %edi, %eax
movl %r12d, 0xc(%rsp)
movslq %eax, %r12
pushq $0x4
popq %rsi
movq %r12, %rdi
movl %r8d, 0x8(%rsp)
callq 0x3250
movq %rax, 0x260(%rbx)
movq %r12, %rdi
pushq $0x4
popq %rsi
callq 0x3250
movq %rax, 0x268(%rbx)
leaq 0x53(%rip), %rax        # 0x2ae32
movq %rax, 0x10(%rbx)
leaq 0xfd(%rip), %rax        # 0x2aee7
movq %rax, 0x18(%rbx)
movq 0x39203(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movl %r15d, %edx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl %r14d, %r9d
xorl %eax, %eax
pushq %r14
pushq %rbp
pushq %r13
callq 0x3270
addq $0x20, %rsp
movq %rbx, %rax
addq $0x18, %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/upsample_layer.c
// Function: forward_upsample_layer
void forward_upsample_layer(const layer l, network net)
{
    fill_cpu(l.outputs*l.batch, 0, l.output, 1);
    if(l.reverse){
        upsample_cpu(l.output, l.out_w, l.out_h, l.c, l.batch, l.stride, 0, l.scale, net.input);
    }else{
        upsample_cpu(net.input, l.w, l.h, l.c, l.batch, l.stride, 1, l.scale, l.output);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4d0(%rsp), %r15
leaq 0x30(%rsp), %r12
movl 0x48(%r12), %ebx
movl 0x58(%r12), %edi
imull %ebx, %edi
movq 0x268(%r12), %r14
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
movq %r14, %rsi
callq 0x1b449
cmpl $0x0, 0x9c(%r12)
je 0x2aea7
movl 0x7c(%r12), %esi
movl 0x74(%r12), %ecx
movl 0x78(%r12), %edx
movl 0x98(%r12), %r9d
movss 0x194(%r12), %xmm0
movq %r14, %rdi
movl %ebx, %r8d
pushq 0xd8(%r15)
pushq $0x0
jmp 0x2aed6
movq 0xd8(%r15), %rdi
movl 0x6c(%r12), %edx
movl 0x70(%r12), %esi
movl 0x74(%r12), %ecx
movl 0x98(%r12), %r9d
movss 0x194(%r12), %xmm0
movl %ebx, %r8d
pushq %r14
pushq $0x1
callq 0x1b9fe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/upsample_layer.c
// Function: backward_upsample_layer
void backward_upsample_layer(const layer l, network net)
{
    if(l.reverse){
        upsample_cpu(l.delta, l.out_w, l.out_h, l.c, l.batch, l.stride, 1, l.scale, net.delta);
    }else{
        upsample_cpu(net.delta, l.w, l.h, l.c, l.batch, l.stride, 0, l.scale, l.delta);
    }
}

// Assembly:
pushq %rax
leaq 0x4b0(%rsp), %r10
leaq 0x10(%rsp), %rax
cmpl $0x0, 0x9c(%rax)
movl 0x48(%rax), %r8d
movl 0x74(%rax), %ecx
movl 0x98(%rax), %r9d
movss 0x194(%rax), %xmm0
je 0x2af2c
movq 0x260(%rax), %rdi
movl 0x78(%rax), %edx
movl 0x7c(%rax), %esi
pushq 0xe8(%r10)
pushq $0x1
jmp 0x2af41
movq 0xe8(%r10), %rdi
movl 0x6c(%rax), %edx
movl 0x70(%rax), %esi
pushq 0x260(%rax)
pushq $0x0
callq 0x1b9fe
popq %rax
popq %rcx
popq %rax
retq