// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/rnn.c
// Function: get_rnn_token_data
float_pair get_rnn_token_data(int *tokens, 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){
            int curr = tokens[(offsets[i])%len];
            int next = tokens[(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 >= characters || curr < 0 || next >= characters || next < 0){
                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 0x5e233
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x5e223
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
movl (%rax,%rdx,4), %eax
movl %eax, -0x54(%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
movl (%rax,%rdx,4), %eax
movl %eax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movl -0x50(%rbp), %ecx
imull -0x34(%rbp), %ecx
addl -0x4c(%rbp), %ecx
imull -0x24(%rbp), %ecx
addl -0x54(%rbp), %ecx
movslq %ecx, %rcx
movss 0x12e6f(%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
addl -0x58(%rbp), %ecx
movslq %ecx, %rcx
movss 0x12e4a(%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)
movl -0x54(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x5e207
cmpl $0x0, -0x54(%rbp)
jl 0x5e207
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x5e207
cmpl $0x0, -0x58(%rbp)
jge 0x5e213
leaq 0x17fd4(%rip), %rdi     # 0x761e2
callq 0x4c50
jmp 0x5e215
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x5e121
jmp 0x5e225
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5e10e
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)