// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
callq 0xe717
movq 0x5f563(%rip), %rcx     # 0x69ff8
movq (%rcx), %rdi
leaq 0x4bf0b(%rip), %rsi     # 0x569aa
movq %rax, %rdx
xorl %eax, %eax
callq 0x3280
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %r14
movslq 0x80(%rax), %r15
movq %r13, %rdi
callq 0x3150
movq %rax, 0x8(%rsp)
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x3260
movq %rax, %r12
movq 0x5f4f6(%rip), %rax     # 0x69fd8
movq (%rax), %rdi
callq 0xe165
testq %rax, %rax
je 0xac28
movq %rax, %rcx
movq 0x8(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x2fa3b
cmpl $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rbp
jle 0xab4d
xorl %ebx, %ebx
movsbq (%r13,%rbx), %r15
movl $0x3f800000, (%r12,%r15,4) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x307ea
andl $0x0, (%r12,%r15,4)
incq %rbx
cmpq %rbx, %rbp
jne 0xab27
movq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xea74
movq %r13, %rdi
callq 0x3150
movq %rax, %r15
testl %r15d, %r15d
jle 0xab99
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movsbq (%r13,%rbx), %rbp
movl $0x3f800000, (%r12,%rbp,4) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x307ea
andl $0x0, (%r12,%rbp,4)
incq %rbx
cmpq %rbx, %r15
jne 0xab73
movl $0x3f800000, 0x80(%r12) # imm = 0x3F800000
movq %r14, %rdi
movq %r12, %rsi
callq 0x307ea
andl $0x0, 0x80(%r12)
movq 0x20(%r14), %rax
movslq 0x58(%rax), %r15
movq 0x268(%rax), %rbx
leaq 0x4bdac(%rip), %rdi     # 0x5697b
movq %r13, %rsi
xorl %eax, %eax
callq 0x3170
testq %r15, %r15
leaq 0x4de66(%rip), %rbp     # 0x58a49
jle 0xac00
xorl %r13d, %r13d
cvtss2sd (%rbx,%r13,4), %xmm0
movq %rbp, %rdi
movb $0x1, %al
callq 0x3170
incq %r13
cmpq %r13, %r15
jne 0xabe8
pushq $0xa
popq %rdi
callq 0x3060
movq 0x5f3c9(%rip), %rax     # 0x69fd8
movq (%rax), %rdi
callq 0xe165
movq %rax, %rcx
testq %rax, %rax
movq 0x18(%rsp), %r13
jne 0xab0a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq