// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/rnn.c
// Function: get_rnn_data
float_pair get_rnn_data(unsigned char *text, size_t *offsets, int characters, size_t len, int batch, int steps)
{
    float *x = calloc(batch * steps * characters, sizeof(float));
    float *y = calloc(batch * steps * characters, sizeof(float));
    int i,j;
    for(i = 0; i < batch; ++i){
        for(j = 0; j < steps; ++j){
            unsigned char curr = text[(offsets[i])%len];
            unsigned char next = text[(offsets[i] + 1)%len];

            x[(j*batch + i)*characters + curr] = 1;
            y[(j*batch + i)*characters + next] = 1;

            offsets[i] = (offsets[i] + 1) % len;

            if(curr > 255 || curr <= 0 || next > 255 || next <= 0){
                /*text[(index+j+2)%len] = 0;
                printf("%ld %d %d %d %d\n", index, j, len, (int)text[index+j], (int)text[index+j+1]);
                printf("%s", text+index);
                */
                error("Bad char");
            }
        }
    }
    float_pair p;
    p.x = x;
    p.y = y;
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movq %rcx, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movl %r9d, -0x38(%rbp)
movl -0x34(%rbp), %eax
imull -0x38(%rbp), %eax
imull -0x24(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %eax
imull -0x38(%rbp), %eax
imull -0x24(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x5e575
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x5e565
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x30(%rbp)
movq -0x68(%rbp), %rax
movb (%rax,%rdx), %al
movb %al, -0x51(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x30(%rbp)
movq -0x60(%rbp), %rax
movb (%rax,%rdx), %al
movb %al, -0x52(%rbp)
movq -0x40(%rbp), %rax
movl -0x50(%rbp), %ecx
imull -0x34(%rbp), %ecx
addl -0x4c(%rbp), %ecx
imull -0x24(%rbp), %ecx
movzbl -0x51(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss 0x12b3c(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movl -0x50(%rbp), %ecx
imull -0x34(%rbp), %ecx
addl -0x4c(%rbp), %ecx
imull -0x24(%rbp), %ecx
movzbl -0x52(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss 0x12b14(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movzbl -0x51(%rbp), %eax
cmpl $0xff, %eax
jg 0x5e549
movzbl -0x51(%rbp), %eax
cmpl $0x0, %eax
jle 0x5e549
movzbl -0x52(%rbp), %eax
cmpl $0xff, %eax
jg 0x5e549
movzbl -0x52(%rbp), %eax
cmpl $0x0, %eax
jg 0x5e555
leaq 0x17c92(%rip), %rdi     # 0x761e2
callq 0x4c50
jmp 0x5e557
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x5e451
jmp 0x5e567
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5e43e
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)