// File: /workspace/github_c_makefile_star2_O2/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, 0x18(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1a23f(%rip), %rdi     # 0x50efc
callq 0x1e673
movq %rax, %r14
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22658
movq %rax, %r15
leaq 0x1a2d0(%rip), %rdi     # 0x50faf
callq 0x1c8c8
movq %rax, %rbx
movq %rax, %rdi
callq 0x72f5
movq %rax, 0x20(%rsp)
movl (%rbx), %ebx
movl 0x84(%r15), %ebp
pushq $0x1
popq %rsi
movq %r15, 0x28(%rsp)
movq %r15, %rdi
callq 0x22f00
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3220
testl %ebp, %ebp
cmovlel %r12d, %ebp
testl %ebx, %ebx
cmovlel %r12d, %ebx
movq %rbx, 0x30(%rsp)
xorl %r13d, %r13d
cmpq 0x30(%rsp), %r13
je 0x36e7a
movl %r13d, %eax
xorl %edx, %edx
pushq $0x64
popq %rcx
divl %ecx
testl %edx, %edx
je 0x36e3f
movq 0x20(%rsp), %r15
movq (%r15,%r13,8), %rsi
movq 0x28(%rsp), %rbx
movl 0x90(%rbx), %ecx
movl 0x94(%rbx), %edx
leaq 0x40(%rsp), %rdi
callq 0xbf36
movq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x233e2
movq %rax, %r12
movq %r13, 0x38(%rsp)
movq (%r15,%r13,8), %r15
xorl %r13d, %r13d
pushq $-0x1
popq %rbx
cmpq $0xd, %r13
je 0x36da9
movq (%r14,%r13,8), %rsi
movq %r15, %rdi
callq 0x34b0
testq %rax, %rax
cmovnel %r13d, %ebx
incq %r13
jmp 0x36d8b
cmpl $-0x1, %ebx
je 0x36e5f
leaq 0x1a21c(%rip), %rdi     # 0x50fd5
movl %ebx, %esi
xorl %eax, %eax
callq 0x3160
xorl %ebx, %ebx
leaq 0x18c61(%rip), %r15     # 0x4fa2c
leaq 0x1a205(%rip), %r13     # 0x50fd7
cmpq %rbx, %rbp
je 0x36dfb
testq %rbx, %rbx
je 0x36de6
movq %r13, %rdi
xorl %eax, %eax
callq 0x3160
cvtss2sd (%r12,%rbx,4), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x3160
incq %rbx
jmp 0x36dd2
pushq $0xa
popq %rdi
callq 0x3060
movq 0x2d1c6(%rip), %rax     # 0x63fd0
movq (%rax), %rdi
callq 0x3310
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
cmpq $0x0, 0x18(%rsp)
jne 0x36e7a
movq 0x38(%rsp), %r13
incq %r13
jmp 0x36d2b
movq 0x2d1b2(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
leaq 0x1a601(%rip), %rsi     # 0x51451
movl %r13d, %edx
xorl %eax, %eax
callq 0x3270
jmp 0x36d48
movq 0x2d192(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
leaq 0x1a15c(%rip), %rsi     # 0x50fcc
movq %r15, %rdx
xorl %eax, %eax
callq 0x3270
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq