// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/rnn.c
// Function: vec_char_rnn
void vec_char_rnn(char *cfgfile, char *weightfile, char *seed)
{
    char *base = basecfg(cfgfile);
    fprintf(stderr, "%s\n", base);

    network *net = load_network(cfgfile, weightfile, 0);
    int inputs = net->inputs;

    int c;
    int seed_len = strlen(seed);
    float *input = calloc(inputs, sizeof(float));
    int i;
    char *line;
    while((line=fgetl(stdin)) != 0){
        reset_network_state(net, 0);
        for(i = 0; i < seed_len; ++i){
            c = seed[i];
            input[(int)c] = 1;
            network_predict(net, input);
            input[(int)c] = 0;
        }
        strip(line);
        int str_len = strlen(line);
        for(i = 0; i < str_len; ++i){
            c = line[i];
            input[(int)c] = 1;
            network_predict(net, input);
            input[(int)c] = 0;
        }
        c = ' ';
        input[(int)c] = 1;
        network_predict(net, input);
        input[(int)c] = 0;

        layer l = net->layers[0];
        printf("%s", line);
        for(i = 0; i < l.outputs; ++i){
            printf(",%g", l.output[i]);
        }
        printf("\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x41c8
movq 0x258aa(%rip), %rcx     # 0x63ff8
movq (%rcx), %rdi
leaq 0x112a2(%rip), %rsi     # 0x4f9fa
xorl %r13d, %r13d
movq %rax, %rdx
xorl %eax, %eax
callq 0x3270
movq %r15, %rdi
movq %rbx, %r15
movq %r14, %rsi
xorl %edx, %edx
callq 0x22658
movq %rax, %r14
movslq 0x80(%rax), %r12
movq %rbx, %rdi
callq 0x3140
movq %rax, %rbx
pushq $0x4
popq %rsi
movq %r12, %rdi
callq 0x3250
movq %rax, %r12
testl %ebx, %ebx
cmovlel %r13d, %ebx
movq %rbx, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq 0x25829(%rip), %rax     # 0x63fd8
movq (%rax), %rdi
callq 0x3d32
testq %rax, %rax
je 0x3e8be
movq %rax, %rbp
movq %r14, %rdi
xorl %esi, %esi
callq 0x226ac
xorl %ebx, %ebx
cmpq %rbx, 0x10(%rsp)
je 0x3e7f8
movsbq (%r15,%rbx), %r13
movl $0x3f800000, (%r12,%r13,4) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x233e2
andl $0x0, (%r12,%r13,4)
incq %rbx
jmp 0x3e7cf
movq %rbp, %rdi
callq 0x44f1
movq %rbp, %rdi
callq 0x3140
movq %rax, %r13
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
xorl %ebx, %ebx
cmpq %rbx, %r13
je 0x3e841
movsbq (%rbp,%rbx), %r15
movl $0x3f800000, (%r12,%r15,4) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x233e2
andl $0x0, (%r12,%r15,4)
incq %rbx
jmp 0x3e819
movl $0x3f800000, 0x80(%r12) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x233e2
andl $0x0, 0x80(%r12)
movq 0x20(%r14), %rax
movl 0x58(%rax), %r13d
movq 0x268(%rax), %rbx
leaq 0x11154(%rip), %rdi     # 0x4f9cb
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3160
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
xorl %ebp, %ebp
movq 0x8(%rsp), %r15
cmpq %rbp, %r13
je 0x3e8b1
cvtss2sd (%rbx,%rbp,4), %xmm0
leaq 0x131b4(%rip), %rdi     # 0x51a59
movb $0x1, %al
callq 0x3160
incq %rbp
jmp 0x3e894
pushq $0xa
popq %rdi
callq 0x3060
jmp 0x3e7a8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq