// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/rnn.c
// Function: run_char_rnn
void run_char_rnn(int argc, char **argv)
{
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }
    char *filename = find_char_arg(argc, argv, "-file", "data/shakespeare.txt");
    char *seed = find_char_arg(argc, argv, "-seed", "\n\n");
    int len = find_int_arg(argc, argv, "-len", 1000);
    float temp = find_float_arg(argc, argv, "-temp", .7);
    int rseed = find_int_arg(argc, argv, "-srand", time(0));
    int clear = find_arg(argc, argv, "-clear");
    int tokenized = find_arg(argc, argv, "-tokenized");
    char *tokens = find_char_arg(argc, argv, "-tokens", 0);

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    if(0==strcmp(argv[2], "train")) train_char_rnn(cfg, weights, filename, clear, tokenized);
    else if(0==strcmp(argv[2], "valid")) valid_char_rnn(cfg, weights, seed);
    else if(0==strcmp(argv[2], "validtactic")) valid_tactic_rnn(cfg, weights, seed);
    else if(0==strcmp(argv[2], "vec")) vec_char_rnn(cfg, weights, seed);
    else if(0==strcmp(argv[2], "generate")) test_char_rnn(cfg, weights, len, seed, temp, rseed, tokens);
    else if(0==strcmp(argv[2], "generatetactic")) test_tactic_rnn(cfg, weights, len, temp, rseed, tokens);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r12
cmpl $0x3, %edi
jle 0x3eae8
movl %edi, %r15d
leaq 0x12777(%rip), %rdx     # 0x51068
leaq 0x13165(%rip), %rcx     # 0x51a5d
movq %r12, %rsi
callq 0x4151
movq %rax, %r13
leaq 0x13168(%rip), %rdx     # 0x51a72
leaq 0x12c07(%rip), %rcx     # 0x51518
movl %r15d, %edi
movq %r12, %rsi
callq 0x4151
movq %rax, 0x18(%rsp)
leaq 0x13150(%rip), %rdx     # 0x51a78
movl %r15d, %edi
movq %r12, %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x4041
movl %eax, 0x14(%rsp)
leaq 0x12fb2(%rip), %rdx     # 0x518f5
movss 0x12ff9(%rip), %xmm0    # 0x51944
movl %r15d, %edi
movq %r12, %rsi
callq 0x40c0
movss %xmm0, 0x10(%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x32c0
leaq 0x13110(%rip), %rdx     # 0x51a7d
movl %r15d, %edi
movq %r12, %rsi
movl %eax, %ecx
callq 0x4041
movl %eax, 0xc(%rsp)
leaq 0x126d0(%rip), %rdx     # 0x51055
movl %r15d, %edi
movq %r12, %rsi
callq 0x3fdd
movl %eax, %ebx
leaq 0x130eb(%rip), %rdx     # 0x51a84
movl %r15d, %edi
movq %r12, %rsi
callq 0x3fdd
movl %eax, %ebp
leaq 0x130e2(%rip), %rdx     # 0x51a8f
movl %r15d, %edi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x4151
movq %rax, 0x20(%rsp)
cmpl $0x4, %r15d
je 0x3e9ca
movq 0x20(%r12), %r14
movq 0x18(%r12), %r15
movq 0x10(%r12), %r12
leaq 0x12939(%rip), %rsi     # 0x51314
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3ea6d
leaq 0x10592(%rip), %rsi     # 0x4ef84
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3ea8e
leaq 0x1308e(%rip), %rsi     # 0x51a97
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3eaac
leaq 0x13083(%rip), %rsi     # 0x51aa3
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3eaca
leaq 0x13070(%rip), %rsi     # 0x51aa7
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3eb17
leaq 0x13062(%rip), %rsi     # 0x51ab0
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x3eb49
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl %ebx, %ecx
movl %ebp, %r8d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d977
movq %r15, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e563
movq %r15, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e36b
movq %r15, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e72b
movq 0x25509(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%r12), %rdx
movq 0x8(%r12), %rcx
leaq 0x124d8(%rip), %rsi     # 0x50fda
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3270
movq %r15, %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
movq 0x18(%rsp), %rcx
movss 0x10(%rsp), %xmm0
movl 0xc(%rsp), %r8d
movq 0x20(%rsp), %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ddf0
movq %r15, %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
movss 0x10(%rsp), %xmm0
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %r8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e1a5
nopl (%rax)