// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movl %ecx, %ebp
movl %edx, 0x4(%rsp)
movq %rsi, %r15
movq %rdi, %r12
testq %r8, %r8
movd %xmm0, 0x8(%rsp)
jne 0xabb6
movq $0x0, 0x10(%rsp)
jmp 0xabc8
leaq 0x20(%rsp), %rsi
movq %r8, %rdi
callq 0x49493
movq %rax, 0x10(%rsp)
movl %ebp, %edi
callq 0x3220
movq %r12, %rdi
callq 0xef02
movq 0x6141a(%rip), %rcx     # 0x6bff8
movq (%rcx), %rdi
leaq 0x4dec2(%rip), %rsi     # 0x58aaa
movq %rax, %rdx
xorl %eax, %eax
callq 0x3270
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x316bc
movq %rax, %r15
movslq 0x80(%rax), %rdi
movslq (%rax), %rcx
testq %rcx, %rcx
movss 0x8(%rsp), %xmm9
jle 0xad2b
movq 0x20(%r15), %rax
leal 0x3(%rcx), %edx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %edx
imulq $0x1280, %rdx, %rcx     # imm = 0x1280
movdqa 0x4a52e(%rip), %xmm1    # 0x55170
movdqa 0x4a436(%rip), %xmm2    # 0x55080
xorl %edx, %edx
movdqa 0x4a43c(%rip), %xmm3    # 0x55090
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x4a51c(%rip), %xmm5    # 0x55180
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0xaca3
movss %xmm9, 0x18c(%rax,%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0xacbc
movss %xmm9, 0x62c(%rax,%rdx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %esi
testb $0x1, %sil
je 0xacfe
movss %xmm9, 0xacc(%rax,%rdx)
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0xad13
movss %xmm9, 0xf6c(%rax,%rdx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x1280, %rdx           # imm = 0x1280
cmpq %rdx, %rcx
jne 0xac64
pushq $0x4
popq %rsi
movq %rdi, 0x8(%rsp)
callq 0x3250
movq %rax, %r13
movq 0x61296(%rip), %rbx     # 0x6bfd8
movq (%rbx), %rdi
callq 0x34a0
cmpl $-0x1, %eax
movq %r15, 0x18(%rsp)
je 0xad83
movslq %eax, %r14
movl $0x3f800000, (%r13,%r14,4) # imm = 0x3F800000
movq %r15, %rdi
movq %r13, %rsi
callq 0x32690
movq %rax, %rbp
andl $0x0, (%r13,%r14,4)
movq (%rbx), %rdi
callq 0x34a0
cmpl $-0x1, %eax
jne 0xad54
jmp 0xad85
xorl %ebp, %ebp
cmpl $0x0, 0x4(%rsp)
jle 0xae1a
movl 0x8(%rsp), %ebx
pushq $-0x1
popq %r15
xorl %r12d, %r12d
movq 0x8(%rsp), %rsi
testl %esi, %esi
movsd 0x4ecde(%rip), %xmm1    # 0x59a88
jle 0xadc7
xorl %eax, %eax
cvtss2sd (%rbp,%rax,4), %xmm0
ucomisd %xmm0, %xmm1
jbe 0xadbf
andl $0x0, (%rbp,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0xadae
movq %rbp, %rdi
callq 0xf97d
movl %eax, %r14d
xorl $0x2e, %r15d
xorl $0xa, %eax
orl %r15d, %eax
je 0xae1a
movl %r14d, %edi
movq 0x10(%rsp), %rsi
callq 0x49925
movslq %r14d, %r15
movl $0x3f800000, (%r13,%r15,4) # imm = 0x3F800000
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x32690
andl $0x0, (%r13,%r15,4)
movq %rax, %rbp
incl %r12d
movl %r14d, %r15d
cmpl 0x4(%rsp), %r12d
jne 0xad9b
pushq $0xa
popq %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3060