// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: kr_rand
krint64_t kr_rand(krand_t *kr)
{
	krint64_t x;
	static const krint64_t mag01[2] = { 0, 0xB5026F5AA96619E9ULL };
    if (kr->mti >= KR_NN) {
		int i;
		if (kr->mti == KR_NN + 1) kr_srand0(5489ULL, kr);
        for (i = 0; i < KR_NN - KR_MM; ++i) {
            x = (kr->mt[i] & KR_UM) | (kr->mt[i+1] & KR_LM);
            kr->mt[i] = kr->mt[i + KR_MM] ^ (x>>1) ^ mag01[(int)(x&1)];
        }
        for (; i < KR_NN - 1; ++i) {
            x = (kr->mt[i] & KR_UM) | (kr->mt[i+1] & KR_LM);
            kr->mt[i] = kr->mt[i + (KR_MM - KR_NN)] ^ (x>>1) ^ mag01[(int)(x&1)];
        }
        x = (kr->mt[KR_NN - 1] & KR_UM) | (kr->mt[0] & KR_LM);
        kr->mt[KR_NN - 1] = kr->mt[KR_MM - 1] ^ (x>>1) ^ mag01[(int)(x&1)];
        kr->mti = 0;
    }
    x = kr->mt[kr->mti++];
    x ^= (x >> 29) & 0x5555555555555555ULL;
    x ^= (x << 17) & 0x71D67FFFEDA60000ULL;
    x ^= (x << 37) & 0xFFF7EEE000000000ULL;
    x ^= (x >> 43);
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x138, (%rax)          # imm = 0x138
jl 0x30a6
movq -0x8(%rbp), %rax
cmpl $0x139, (%rax)          # imm = 0x139
jne 0x2f16
movq -0x8(%rbp), %rsi
movl $0x1571, %edi           # imm = 0x1571
callq 0x2e40
movl $0x0, -0x14(%rbp)
cmpl $0x9c, -0x14(%rbp)
jge 0x2fad
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $-0x80000000, %rax      # imm = 0x80000000
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq 0x8(%rcx,%rdx,8), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x9c, %ecx
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
shrq %rax
xorq %rax, %rdx
movq -0x10(%rbp), %rax
andq $0x1, %rax
movslq %eax, %rcx
leaq 0xa2c2(%rip), %rax      # 0xd250
xorq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2f1d
jmp 0x2faf
cmpl $0x137, -0x14(%rbp)     # imm = 0x137
jge 0x303f
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $-0x80000000, %rax      # imm = 0x80000000
movq -0x8(%rbp), %rcx
movl -0x14(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq 0x8(%rcx,%rdx,8), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0xffffff64, %ecx       # imm = 0xFFFFFF64
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
shrq %rax
xorq %rax, %rdx
movq -0x10(%rbp), %rax
andq $0x1, %rax
movslq %eax, %rcx
leaq 0xa230(%rip), %rax      # 0xd250
xorq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2faf
movq -0x8(%rbp), %rax
movq 0x9c0(%rax), %rax
andq $-0x80000000, %rax      # imm = 0x80000000
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x4e0(%rax), %rcx
movq -0x10(%rbp), %rax
shrq %rax
xorq %rax, %rcx
movq -0x10(%rbp), %rax
andq $0x1, %rax
movslq %eax, %rdx
leaq 0xa1c3(%rip), %rax      # 0xd250
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x9c0(%rax)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x1d, %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x11, %rax
movabsq $0x71d67fffeda60000, %rcx # imm = 0x71D67FFFEDA60000
andq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x25, %rax
movabsq $-0x8112000000000, %rcx # imm = 0xFFF7EEE000000000
andq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x2b, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)