// File: /workspace/github_c_makefile_star2_O3/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, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x16f6a(%rip), %rdi     # 0x59ffc
callq 0x2d26c
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x316bc
movq %rax, %r15
leaq 0x16ffe(%rip), %rdi     # 0x5a0af
callq 0x2af38
movq %rax, %rbx
movq %rax, %rdi
callq 0x11928
movq %rax, 0x28(%rsp)
movslq (%rbx), %rbx
movl 0x84(%r15), %ebp
movq %r15, 0x30(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x320a7
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3220
movq %rbx, 0x18(%rsp)
testq %rbx, %rbx
jle 0x43256
xorl %r13d, %r13d
imull $0xc28f5c29, %r13d, %eax # imm = 0xC28F5C29
rorl $0x2, %eax
cmpl $0x28f5c28, %eax        # imm = 0x28F5C28
jbe 0x4321b
movq 0x28(%rsp), %r15
movq (%r15,%r13,8), %rsi
movq 0x30(%rsp), %rbx
movl 0x90(%rbx), %ecx
movl 0x94(%rbx), %edx
leaq 0x40(%rsp), %rdi
callq 0x16ac9
movq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x32690
movq %rax, %r12
movq %r13, 0x38(%rsp)
movq (%r15,%r13,8), %r15
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x34b0
testq %rax, %rax
cmovnel %ebx, %r13d
incq %rbx
cmpq $0xd, %rbx
jne 0x43157
cmpl $-0x1, %r13d
je 0x4323b
leaq 0x16f51(%rip), %rdi     # 0x5a0d5
movl %r13d, %esi
xorl %eax, %eax
callq 0x3160
testl %ebp, %ebp
leaq 0x15945(%rip), %rbx     # 0x58adc
leaq 0x16f39(%rip), %r13     # 0x5a0d7
jle 0x431cd
xorl %r15d, %r15d
testq %r15, %r15
je 0x431b2
movq %r13, %rdi
xorl %eax, %eax
callq 0x3160
xorps %xmm0, %xmm0
cvtss2sd (%r12,%r15,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x3160
incq %r15
cmpq %r15, %rbp
jne 0x431a3
movl $0xa, %edi
callq 0x3060
movq 0x28df2(%rip), %rax     # 0x6bfd0
movq (%rax), %rdi
callq 0x3310
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1657b
cmpq $0x0, 0x20(%rsp)
jne 0x43256
movq 0x38(%rsp), %r13
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x430fd
jmp 0x43256
movq 0x28dd6(%rip), %rax     # 0x6bff8
movq (%rax), %rdi
leaq 0x1736d(%rip), %rsi     # 0x5a599
movl %r13d, %edx
xorl %eax, %eax
callq 0x3270
jmp 0x43112
movq 0x28db6(%rip), %rax     # 0x6bff8
movq (%rax), %rdi
leaq 0x16e80(%rip), %rsi     # 0x5a0cc
movq %r15, %rdx
xorl %eax, %eax
callq 0x3270
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq