// File: tanakh[P]icfpc2015/main.cpp
// 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:
subq $0x18, %rsp
cmpl $0x270, 0x45722(%rip)   # imm = 0x270
jl 0x4e36
cmpl $0x271, 0x45712(%rip)   # imm = 0x271
jne 0x4c8a
movl $0x1571, %edi           # imm = 0x1571
callq 0x4950
movl $0x0, 0xc(%rsp)
cmpl $0xe3, 0xc(%rsp)
jge 0x4d34
movslq 0xc(%rsp), %rdx
leaq 0x45734(%rip), %rcx     # 0x4a3e0
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x45715(%rip), %rcx     # 0x4a3e0
movq (%rcx,%rdx,8), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0x18d, %eax            # imm = 0x18D
movslq %eax, %rcx
leaq 0x456ef(%rip), %rax     # 0x4a3e0
movq (%rax,%rcx,8), %rdx
movq 0x10(%rsp), %rax
shrq %rax
xorq %rax, %rdx
movq 0x10(%rsp), %rcx
andq $0x1, %rcx
leaq 0x45690(%rip), %rax     # 0x4a3a0
xorq (%rax,%rcx,8), %rdx
movslq 0xc(%rsp), %rcx
leaq 0x456c0(%rip), %rax     # 0x4a3e0
movq %rdx, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x4c92
jmp 0x4d36
cmpl $0x26f, 0xc(%rsp)       # imm = 0x26F
jge 0x4dd8
movslq 0xc(%rsp), %rdx
leaq 0x45690(%rip), %rcx     # 0x4a3e0
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x45671(%rip), %rcx     # 0x4a3e0
movq (%rcx,%rdx,8), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0xffffff1d, %eax       # imm = 0xFFFFFF1D
movslq %eax, %rcx
leaq 0x4564b(%rip), %rax     # 0x4a3e0
movq (%rax,%rcx,8), %rdx
movq 0x10(%rsp), %rax
shrq %rax
xorq %rax, %rdx
movq 0x10(%rsp), %rcx
andq $0x1, %rcx
leaq 0x455ec(%rip), %rax     # 0x4a3a0
xorq (%rax,%rcx,8), %rdx
movslq 0xc(%rsp), %rcx
leaq 0x4561c(%rip), %rax     # 0x4a3e0
movq %rdx, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x4d36
movabsq $0x80000000, %rax       # imm = 0x80000000
andq 0x4696f(%rip), %rax     # 0x4b758
movq 0x455f0(%rip), %rcx     # 0x4a3e0
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
orq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x4623a(%rip), %rax     # 0x4b040
movq 0x10(%rsp), %rcx
shrq %rcx
xorq %rcx, %rax
movq 0x10(%rsp), %rdx
andq $0x1, %rdx
leaq 0x4557f(%rip), %rcx     # 0x4a3a0
xorq (%rcx,%rdx,8), %rax
movq %rax, 0x4692c(%rip)     # 0x4b758
movl $0x0, 0x4555a(%rip)     # 0x4a390
movl 0x45554(%rip), %eax     # 0x4a390
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x45549(%rip)     # 0x4a390
movslq %eax, %rcx
leaq 0x4558f(%rip), %rax     # 0x4a3e0
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
shrq $0xb, %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
shlq $0x7, %rax
movabsq $0x9d2c5680, %rcx       # imm = 0x9D2C5680
andq %rcx, %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
shlq $0xf, %rax
movabsq $0xefc60000, %rcx       # imm = 0xEFC60000
andq %rcx, %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
shrq $0x12, %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)