// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/rnn.c
// Function: test_tactic_rnn
void test_tactic_rnn(char *cfgfile, char *weightfile, int num, float temp, int rseed, char *token_file)
{
    char **tokens = 0;
    if(token_file){
        size_t n;
        tokens = read_tokens(token_file, &n);
    }

    srand(rseed);
    char *base = basecfg(cfgfile);
    fprintf(stderr, "%s\n", base);

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

    int i, j;
    for(i = 0; i < net->n; ++i) net->layers[i].temperature = temp;
    int c = 0;
    float *input = calloc(inputs, sizeof(float));
    float *out = 0;

    while((c = getc(stdin)) != EOF){
        input[c] = 1;
        out = network_predict(net, input);
        input[c] = 0;
    }
    for(i = 0; i < num; ++i){
        for(j = 0; j < inputs; ++j){
            if (out[j] < .0001) out[j] = 0;
        }
        int next = sample_array(out, inputs);
        if(c == '.' && next == '\n') break;
        c = next;
        print_symbol(c, tokens);

        input[c] = 1;
        out = network_predict(net, input);
        input[c] = 0;
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebp
movss %xmm0, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq %rsi, %r15
movq %rdi, %r12
testq %r8, %r8
jne 0xa4c7
movq $0x0, 0x10(%rsp)
jmp 0xa4d9
leaq 0x30(%rsp), %rsi
movq %r8, %rdi
callq 0x47183
movq %rax, 0x10(%rsp)
movl %ebp, %edi
callq 0x3230
movq %r12, %rdi
callq 0xe717
movq 0x5fb09(%rip), %rcx     # 0x69ff8
movq (%rcx), %rdi
leaq 0x4c4b1(%rip), %rsi     # 0x569aa
movq %rax, %rdx
xorl %eax, %eax
callq 0x3280
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %r15
movslq 0x80(%rax), %r13
movslq (%rax), %rcx
testq %rcx, %rcx
movss 0x8(%rsp), %xmm0
jle 0xa54a
movq 0x20(%r15), %rax
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
xorl %edx, %edx
movss %xmm0, 0x18c(%rax,%rdx)
addq $0x4a0, %rdx            # imm = 0x4A0
cmpq %rdx, %rcx
jne 0xa535
pushq $0x4
popq %rsi
movq %r13, %rdi
callq 0x3260
movq %rax, %r12
movq 0x5fa79(%rip), %rbx     # 0x69fd8
movq (%rbx), %rdi
callq 0x34b0
cmpl $-0x1, %eax
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
je 0xa5a3
movslq %eax, %r14
movl $0x3f800000, (%r12,%r14,4) # imm = 0x3F800000
movq %r15, %rdi
movq %r12, %rsi
callq 0x307ea
movq %rax, %rbp
andl $0x0, (%r12,%r14,4)
movq (%rbx), %rdi
callq 0x34b0
cmpl $-0x1, %eax
jne 0xa576
jmp 0xa5a5
xorl %ebp, %ebp
cmpl $0x0, 0x4(%rsp)
jle 0xa66d
movl %r13d, %ebx
pushq $-0x1
popq %r12
xorl %r15d, %r15d
movsd 0x4d3de(%rip), %xmm1    # 0x579a0
movq %r13, 0x28(%rsp)
testl %r13d, %r13d
jle 0xa5e7
xorl %eax, %eax
cvtss2sd (%rbp,%rax,4), %xmm0
ucomisd %xmm0, %xmm1
jbe 0xa5df
andl $0x0, (%rbp,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0xa5ce
movq %rbp, %rdi
movl %r13d, %esi
callq 0xf171
movl %eax, %r14d
xorl $0x2e, %r12d
xorl $0xa, %eax
orl %r12d, %eax
sete %r13b
pushq $0x2e
popq %r12
je 0xa648
movl %r14d, %edi
movq 0x10(%rsp), %rsi
callq 0x47615
movslq %r14d, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %r12
movl $0x3f800000, (%r12,%rax,4) # imm = 0x3F800000
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x307ea
movq %rax, %rbp
movq 0x8(%rsp), %rax
andl $0x0, (%r12,%rax,4)
movl %r14d, %r12d
incl %r15d
cmpl 0x4(%rsp), %r15d
sete %al
orb %al, %r13b
cmpb $0x1, %r13b
movq 0x28(%rsp), %r13
movsd 0x4d339(%rip), %xmm1    # 0x579a0
jne 0xa5c7
pushq $0xa
popq %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3060