// File: /workspace/github_c_makefile_star2_O3/debbiemarkslab[P]plmc/src/lib/twister.c
// Function: genrand_int32
unsigned long genrand_int32(void)
{   
    unsigned long y;
    static unsigned long mag01[2]={0x0UL, MATRIX_A};
    /* mag01[x] = x * MATRIX_A  for x=0,1 */

    if (mti >= N) { /* generate N words at one time */
        int kk;

        if (mti == N+1)   /* if init_genrand() has not been called, */
            init_genrand(5489UL); /* a default initial seed is used */

        for (kk=0;kk<N-M;kk++) {
            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
            mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
        }
        for (;kk<N-1;kk++) {
            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
            mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
        }
        y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
        mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];

        mti = 0;
    }
  
    y = mt[mti++];

    /* Tempering */
    y ^= (y >> 11);
    y ^= (y << 7) & 0x9d2c5680UL;
    y ^= (y << 15) & 0xefc60000UL;
    y ^= (y >> 18);

    return y;
}

// Assembly:
movslq 0xeb1e(%rip), %rax      # 0x11148
cmpq $0x26f, %rax            # imm = 0x26F
jle 0x267c
cmpl $0x271, %eax            # imm = 0x271
jne 0x268e
movq $0x1571, 0xeb3c(%rip) # imm = 0x1571
movl $0x1, %eax
movl $0x1571, %edx           # imm = 0x1571
leaq 0xeb2b(%rip), %rcx      # 0x11180
movl $0x1571, %esi           # imm = 0x1571
movq %rsi, %rdi
shrq $0x1e, %rdi
xorl %esi, %edi
imull $0x6c078965, %edi, %esi # imm = 0x6C078965
addl %eax, %esi
movq %rsi, (%rcx,%rax,8)
incq %rax
cmpq $0x270, %rax            # imm = 0x270
jne 0x265a
jmp 0x2695
leaq 0xeafd(%rip), %rcx      # 0x11180
movq (%rcx,%rax,8), %rcx
incl %eax
jmp 0x2772
movq 0xeaeb(%rip), %rdx      # 0x11180
xorl %esi, %esi
leaq 0xeae2(%rip), %rcx      # 0x11180
leaq 0xa98b(%rip), %rax      # 0xd030
andl $0x80000000, %edx       # imm = 0x80000000
movq 0x8(%rcx,%rsi,8), %rdi
movl %edi, %r8d
andl $0x7ffffffe, %r8d       # imm = 0x7FFFFFFE
orl %edx, %r8d
shrl %r8d
movq %rdi, %rdx
andl $0x1, %edi
movq (%rax,%rdi,8), %rdi
xorq 0xc68(%rcx,%rsi,8), %rdi
xorq %r8, %rdi
movq %rdi, (%rcx,%rsi,8)
leaq 0x1(%rsi), %rdi
movq %rdi, %rsi
cmpq $0xe3, %rdi
jne 0x26a5
movq 0xf1a8(%rip), %rsi      # 0x11898
xorl %edx, %edx
andl $0x80000000, %esi       # imm = 0x80000000
movq 0x720(%rcx,%rdx,8), %rdi
movl %edi, %r8d
andl $0x7ffffffe, %r8d       # imm = 0x7FFFFFFE
orl %esi, %r8d
shrl %r8d
movq %rdi, %rsi
andl $0x1, %edi
movq (%rax,%rdi,8), %rdi
xorq (%rcx,%rdx,8), %rdi
xorq %r8, %rdi
movq %rdi, 0x718(%rcx,%rdx,8)
incq %rdx
cmpq $0x18c, %rdx            # imm = 0x18C
jne 0x26f2
movl $0x80000000, %edx       # imm = 0x80000000
andl 0xfdb8(%rip), %edx      # 0x124f8
movq 0xea39(%rip), %rcx      # 0x11180
movl %ecx, %esi
andl $0x7ffffffe, %esi       # imm = 0x7FFFFFFE
orl %edx, %esi
movl %ecx, %edx
andl $0x1, %edx
movq (%rax,%rdx,8), %rax
xorq 0xf67f(%rip), %rax      # 0x11de0
shrl %esi
xorq %rsi, %rax
movq %rax, 0xfd8b(%rip)      # 0x124f8
movl $0x1, %eax
movl %eax, 0xe9d0(%rip)      # 0x11148
movq %rcx, %rax
shrq $0xb, %rax
xorq %rcx, %rax
movl %eax, %ecx
shll $0x7, %ecx
andl $0x9d2c5680, %ecx       # imm = 0x9D2C5680
xorq %rax, %rcx
movl %ecx, %edx
shll $0xf, %edx
andl $0xefc60000, %edx       # imm = 0xEFC60000
xorq %rcx, %rdx
movq %rdx, %rax
shrq $0x12, %rax
xorq %rdx, %rax
retq