// File: /workspace/github_c_makefile_star2_O3/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 0x49db2
movl %edi, %ebx
leaq 0x1052c(%rip), %rdx     # 0x5a168
leaq 0x10f5a(%rip), %rcx     # 0x5ab9d
movq %r12, %rsi
callq 0xee68
movq %rax, 0x20(%rsp)
leaq 0x10f5b(%rip), %rdx     # 0x5abb2
leaq 0x10a02(%rip), %rcx     # 0x5a660
movl %ebx, %edi
movq %r12, %rsi
callq 0xee68
movq %rax, 0x18(%rsp)
leaq 0x10f44(%rip), %rdx     # 0x5abb8
movl %ebx, %edi
movq %r12, %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0xed18
movl %eax, 0x14(%rsp)
leaq 0x10daf(%rip), %rdx     # 0x5aa3d
movss 0x10dee(%rip), %xmm0    # 0x5aa84
movl %ebx, %edi
movq %r12, %rsi
callq 0xedb7
movss %xmm0, 0x10(%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x32c0
leaq 0x10f06(%rip), %rdx     # 0x5abbd
movl %ebx, %edi
movq %r12, %rsi
movl %eax, %ecx
callq 0xed18
movl %eax, 0xc(%rsp)
leaq 0x10487(%rip), %rdx     # 0x5a155
movl %ebx, %edi
movq %r12, %rsi
callq 0xeca2
movl %eax, %r15d
leaq 0x10ee2(%rip), %rdx     # 0x5abc4
movl %ebx, %edi
movq %r12, %rsi
callq 0xeca2
movl %eax, %r13d
leaq 0x10ed9(%rip), %rdx     # 0x5abcf
movl %ebx, %edi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xee68
movq %rax, %rbp
cmpl $0x4, %ebx
je 0x49d0f
movq 0x20(%r12), %r14
movq 0x18(%r12), %rbx
movq 0x10(%r12), %r12
leaq 0x106f4(%rip), %rsi     # 0x5a414
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49dbc
leaq 0xe32d(%rip), %rsi      # 0x58064
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49de0
leaq 0x10e89(%rip), %rsi     # 0x5abd7
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49dfe
leaq 0x10e7e(%rip), %rsi     # 0x5abe3
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49e1c
leaq 0x10e6b(%rip), %rsi     # 0x5abe7
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49e3a
leaq 0x10e5d(%rip), %rsi     # 0x5abf0
movq %r12, %rdi
callq 0x3260
testl %eax, %eax
je 0x49e6a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0xb3df
jmp 0x49da3
movq %rbx, %rdi
movq %r14, %rsi
movq 0x20(%rsp), %rdx
movl %r15d, %ecx
movl %r13d, %r8d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa46e
movq %rbx, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb03d
movq %rbx, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xae30
movq %rbx, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb21a
movq %rbx, %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
movq 0x18(%rsp), %rcx
movss 0x10(%rsp), %xmm0
movl 0xc(%rsp), %r8d
movq %rbp, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa8d2
movq %rbx, %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
movss 0x10(%rsp), %xmm0
movl 0xc(%rsp), %ecx
movq %rbp, %r8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xab86