// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/captcha.c
// Function: valid_captcha
void valid_captcha(char *cfgfile, char *weightfile, char *filename)
{
    char **labels = get_labels("/data/captcha/reimgs.labels.list");
    network *net = load_network(cfgfile, weightfile, 0);
    list *plist = get_paths("/data/captcha/reimgs.fg.list");
    char **paths = (char **)list_to_array(plist);
    int N = plist->size;
    int outputs = net->outputs;

    set_batch_network(net, 1);
    srand(2222222);
    int i, j;
    for(i = 0; i < N; ++i){
        if (i%100 == 0) fprintf(stderr, "%d\n", i);
        image im = load_image_color(paths[i], net->w, net->h);
        float *X = im.data;
        float *predictions = network_predict(net, X);
        //printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        int truth = -1;
        for(j = 0; j < 13; ++j){
            if (strstr(paths[i], labels[j])) truth = j;
        }
        if (truth == -1){
            fprintf(stderr, "bad: %s\n", paths[i]);
            return;
        }
        printf("%d, ", truth);
        for(j = 0; j < outputs; ++j){
            if (j != 0) printf(", ");
            printf("%f", predictions[j]);
        }
        printf("\n");
        fflush(stdout);
        free_image(im);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x17024(%rip), %rdi     # 0x57ec4
callq 0x2b6d3
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %r15
leaq 0x170b8(%rip), %rdi     # 0x57f77
callq 0x296f8
movq %rax, %rbx
movq %rax, %rdi
callq 0x10fa0
movq %rax, 0x18(%rsp)
movslq (%rbx), %rbx
movl 0x84(%r15), %ebp
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x302d4
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3230
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
jle 0x4106f
xorl %r13d, %r13d
imull $0xc28f5c29, %r13d, %eax # imm = 0xC28F5C29
rorl $0x2, %eax
cmpl $0x28f5c28, %eax        # imm = 0x28F5C28
jbe 0x41029
movq 0x18(%rsp), %r15
movq (%r15,%r13,8), %rsi
movq 0x38(%rsp), %rbx
movl 0x90(%rbx), %ecx
movl 0x94(%rbx), %edx
leaq 0x40(%rsp), %rdi
callq 0x160b6
movq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x307ea
movq %rax, %r12
movq %r13, 0x20(%rsp)
movq (%r15,%r13,8), %r13
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rsi
movq %r13, %rdi
callq 0x34c0
testq %rax, %rax
cmovnel %ebx, %r15d
incq %rbx
cmpq $0xd, %rbx
jne 0x40f65
cmpl $-0x1, %r15d
leaq 0x15a50(%rip), %rbx     # 0x569dc
je 0x41049
leaq 0x17004(%rip), %rdi     # 0x57f9d
movl %r15d, %esi
xorl %eax, %eax
callq 0x3170
testl %ebp, %ebp
leaq 0x16ff3(%rip), %r13     # 0x57f9f
jle 0x40fdb
xorl %r15d, %r15d
testq %r15, %r15
je 0x40fc0
movq %r13, %rdi
xorl %eax, %eax
callq 0x3170
xorps %xmm0, %xmm0
cvtss2sd (%r12,%r15,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x3170
incq %r15
cmpq %r15, %rbp
jne 0x40fb1
movl $0xa, %edi
callq 0x3060
movq 0x28fe4(%rip), %rax     # 0x69fd0
movq (%rax), %rdi
callq 0x3320
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
cmpq $0x0, 0x30(%rsp)
movq 0x20(%rsp), %r13
jne 0x4106f
incq %r13
cmpq 0x28(%rsp), %r13
jne 0x40f0b
jmp 0x4106f
movq 0x28fc8(%rip), %rax     # 0x69ff8
movq (%rax), %rdi
leaq 0x17407(%rip), %rsi     # 0x58441
movl %r13d, %edx
xorl %eax, %eax
callq 0x3280
jmp 0x40f20
movq 0x28fa8(%rip), %rax     # 0x69ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x16f2c(%rip), %rsi     # 0x57f94
xorl %eax, %eax
callq 0x3280
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq