// File: /workspace/github_c_makefile_star2_O1/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 0x479e0
movl %edi, %ebx
leaq 0x107c6(%rip), %rdx     # 0x58030
leaq 0x111dc(%rip), %rcx     # 0x58a4d
movq %r12, %rsi
callq 0xe64d
movq %rax, 0x20(%rsp)
leaq 0x111dd(%rip), %rdx     # 0x58a62
leaq 0x10c7c(%rip), %rcx     # 0x58508
movl %ebx, %edi
movq %r12, %rsi
callq 0xe64d
movq %rax, 0x18(%rsp)
leaq 0x111c6(%rip), %rdx     # 0x58a68
movl %ebx, %edi
movq %r12, %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0xe4b3
movl %eax, 0x14(%rsp)
leaq 0x11029(%rip), %rdx     # 0x588e5
movss 0x11070(%rip), %xmm0    # 0x58934
movl %ebx, %edi
movq %r12, %rsi
callq 0xe57a
movss %xmm0, 0x10(%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x32d0
leaq 0x11188(%rip), %rdx     # 0x58a6d
movl %ebx, %edi
movq %r12, %rsi
movl %eax, %ecx
callq 0xe4b3
movl %eax, 0xc(%rsp)
leaq 0x10721(%rip), %rdx     # 0x5801d
movl %ebx, %edi
movq %r12, %rsi
callq 0xe439
movl %eax, %r15d
leaq 0x11164(%rip), %rdx     # 0x58a74
movl %ebx, %edi
movq %r12, %rsi
callq 0xe439
movl %eax, %r13d
leaq 0x1115b(%rip), %rdx     # 0x58a7f
movl %ebx, %edi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xe64d
movq %rax, %rbp
cmpl $0x4, %ebx
je 0x4793d
movq 0x20(%r12), %r14
movq 0x18(%r12), %rbx
movq 0x10(%r12), %r12
leaq 0x1098e(%rip), %rsi     # 0x582dc
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x479ea
leaq 0xe627(%rip), %rsi      # 0x55f8c
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x47a0e
leaq 0x1110b(%rip), %rsi     # 0x58a87
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x47a2c
leaq 0x11100(%rip), %rsi     # 0x58a93
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x47a4a
leaq 0x110ed(%rip), %rsi     # 0x58a97
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x47a68
leaq 0x110df(%rip), %rsi     # 0x58aa0
movq %r12, %rdi
callq 0x3270
testl %eax, %eax
je 0x47a98
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0xac37
jmp 0x479d1
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 0x9e74
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 0xa87f
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 0xa683
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 0xaa72
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 0xa2d8
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 0xa497
nop