// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4850
movq %rax, -0x20(%rbp)
movq 0x2376d(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x14b04(%rip), %rsi     # 0x7439d
movb $0x0, %al
callq 0x3240
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x80(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3110
movl %eax, -0x34(%rbp)
movslq -0x2c(%rbp), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x40(%rbp)
movq 0x236f3(%rip), %rax     # 0x82fd8
movq (%rax), %rdi
callq 0x4140
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x5fa87
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x39b10
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x5f961
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movss 0x116d8(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3b160
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5f90d
movq -0x50(%rbp), %rdi
callq 0x4df0
movq -0x50(%rbp), %rdi
callq 0x3110
movl %eax, -0x54(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x5f9d1
movq -0x50(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movss 0x11668(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3b160
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5f97d
movl $0x20, -0x30(%rbp)
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movss 0x11624(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3b160
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x4f8(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x50(%rbp), %rsi
leaq 0x1493d(%rip), %rdi     # 0x7436b
movb $0x0, %al
callq 0x3130
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4a0(%rbp), %eax
jge 0x5fa74
movq -0x290(%rbp), %rax
movslq -0x44(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1687f(%rip), %rdi     # 0x762e1
movb $0x1, %al
callq 0x3130
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5fa3c
leaq 0x16333(%rip), %rdi     # 0x75dae
movb $0x0, %al
callq 0x3130
jmp 0x5f8de
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq