// File: JenTus[P]TCEM/src_TCEM/sfmt/SFMT.c
// Function: gen_rand_array(SFMT_T*, W128_T*, int)
inline static void gen_rand_array(sfmt_t * sfmt, w128_t *array, int size) {
    int i, j;
    w128_t *r1, *r2;

    r1 = &sfmt->state[SFMT_N - 2];
    r2 = &sfmt->state[SFMT_N - 1];
    for (i = 0; i < SFMT_N - SFMT_POS1; i++) {
	do_recursion(&array[i], &sfmt->state[i], &sfmt->state[i + SFMT_POS1], r1, r2);
	r1 = r2;
	r2 = &array[i];
    }
    for (; i < SFMT_N; i++) {
	do_recursion(&array[i], &sfmt->state[i],
		     &array[i + SFMT_POS1 - SFMT_N], r1, r2);
	r1 = r2;
	r2 = &array[i];
    }
    for (; i < size - SFMT_N; i++) {
	do_recursion(&array[i], &array[i - SFMT_N],
		     &array[i + SFMT_POS1 - SFMT_N], r1, r2);
	r1 = r2;
	r2 = &array[i];
    }
    for (j = 0; j < 2 * SFMT_N - size; j++) {
	sfmt->state[j] = array[j + size - SFMT_N];
    }
    for (; i < size; i++, j++) {
	do_recursion(&array[i], &array[i - SFMT_N],
		     &array[i + SFMT_POS1 - SFMT_N], r1, r2);
	r1 = r2;
	r2 = &array[i];
	sfmt->state[j] = array[i];
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq 0x30(%rsp), %rax
addq $0x9a0, %rax            # imm = 0x9A0
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
addq $0x9b0, %rax            # imm = 0x9B0
movq %rax, 0x8(%rsp)
movl $0x0, 0x20(%rsp)
cmpl $0x22, 0x20(%rsp)
jge 0x221c4
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x30(%rsp), %rsi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %eax
addl $0x7a, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
callq 0x21f10
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2214a
jmp 0x221c6
cmpl $0x9c, 0x20(%rsp)
jge 0x2224b
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x30(%rsp), %rsi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x28(%rsp), %rdx
movl 0x20(%rsp), %eax
addl $0x7a, %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
callq 0x21f10
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x221c6
jmp 0x2224d
movl 0x20(%rsp), %eax
movl 0x24(%rsp), %ecx
subl $0x9c, %ecx
cmpl %ecx, %eax
jge 0x222e4
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x28(%rsp), %rsi
movl 0x20(%rsp), %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rsi
movq 0x28(%rsp), %rdx
movl 0x20(%rsp), %eax
addl $0x7a, %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
callq 0x21f10
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2224d
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl $0x138, %ecx            # imm = 0x138
subl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jge 0x22344
movq 0x28(%rsp), %rcx
movl 0x1c(%rsp), %eax
addl 0x24(%rsp), %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rcx
movq 0x30(%rsp), %rax
movslq 0x1c(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x222ec
jmp 0x22346
movl 0x20(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x22410
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x28(%rsp), %rsi
movl 0x20(%rsp), %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rsi
movq 0x28(%rsp), %rdx
movl 0x20(%rsp), %eax
addl $0x7a, %eax
subl $0x9c, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
callq 0x21f10
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rcx
movslq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq 0x30(%rsp), %rax
movslq 0x1c(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x22346
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)