// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.cpp
// Function: Utils::CMRRandomGenerator::Advance(long, int)
void CMRRandomGenerator::Advance(int64_t n, int32_t e)
	{
		int64_t B[2][3][3];

		int64_t S[2][3];
		int64_t M[2];

		for (int i = 0; i <= 1; i++) {
			m_ftoi(a[i], B[i], m[i]);
			v_ftoi(s[i], S[i], m[i]);
			M[i] = (int64_t)(m[i]);
		}

		while (e-- != 0) {
			for (int i = 0; i <= 1; i++) {
				mm_mul(B[i], B[i], B[i], M[i]);
			}
		}

		while (n != 0) {
			if ((n & 1) != 0) {
				for (int i = 0; i <= 1; i++) {
					mv_mul(B[i], S[i], S[i], M[i]);
				}
			}
			n >>= 1;
			if (n != 0) {
				for (int i = 0; i <= 1; i++) {
					mm_mul(B[i], B[i], B[i], M[i]);
				}
			}
		}

		for (int i = 0; i <= 1; i++) {
			v_itof(S[i], s[i], M[i]);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x60(%rsp), %rax
leaq 0x2174b(%rip), %rcx     # 0x73bb0
leaq 0x30(%rsp), %rdx
xorl %r8d, %r8d
leaq 0x217cc(%rip), %rsi     # 0x73c40
movsd (%rsi,%r8,8), %xmm0
movq %rcx, %r9
movq %rax, %r10
xorl %r11d, %r11d
xorl %r15d, %r15d
movsd (%r9,%r15,8), %xmm1
movapd %xmm0, %xmm2
addsd %xmm1, %xmm2
xorpd %xmm3, %xmm3
cmpnlesd %xmm1, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm1, %xmm3
orpd %xmm2, %xmm3
cvttsd2si %xmm3, %r12
movq %r12, (%r10,%r15,8)
incq %r15
cmpq $0x3, %r15
jne 0x52486
incq %r11
addq $0x18, %r10
addq $0x18, %r9
cmpq $0x3, %r11
jne 0x52483
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm1
movapd %xmm0, %xmm2
addsd %xmm1, %xmm2
xorpd %xmm3, %xmm3
cmpnlesd %xmm1, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm1, %xmm3
orpd %xmm2, %xmm3
cvttsd2si %xmm3, %r10
movq %r10, (%rdx,%r9,8)
incq %r9
cmpq $0x3, %r9
jne 0x524cf
cvttsd2si %xmm0, %r9
movq %r9, (%rsp,%r8,8)
leaq 0x1(%r8), %r9
addq $0x48, %rax
addq $0x48, %rcx
addq $0x18, %rdx
addq $0x18, %rdi
testq %r8, %r8
movq %r9, %r8
je 0x52474
testl %ebp, %ebp
je 0x5255f
leaq 0x60(%rsp), %r12
movq %r12, %r15
xorl %r13d, %r13d
movq (%rsp,%r13,8), %rcx
movq %r15, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x52772
incq %r13
addq $0x48, %r15
cmpq $0x1, %r13
je 0x5253c
decl %ebp
jne 0x52536
testq %r14, %r14
je 0x52639
leaq 0x60(%rsp), %r12
leaq 0x30(%rsp), %r13
testb $0x1, %r14b
je 0x525fc
movq %r12, %rcx
movq %r13, %rsi
xorl %edi, %edi
leaq (%rdi,%rdi,2), %rax
leaq (%rsp,%rax,8), %r8
addq $0x30, %r8
movq (%rsp,%rdi,8), %r9
movq %rcx, %r10
xorl %r11d, %r11d
movq $0x0, 0x10(%rsp,%r11,8)
xorl %r15d, %r15d
xorl %edx, %edx
movq (%rsi,%r15,8), %rax
imulq (%r10,%r15,8), %rax
addq %rdx, %rax
cqto
idivq %r9
incq %r15
cmpq $0x3, %r15
jne 0x525a8
movq %rdx, 0x10(%rsp,%r11,8)
incq %r11
addq $0x18, %r10
cmpq $0x3, %r11
jne 0x5259a
movq 0x20(%rsp), %rax
movq %rax, 0x10(%r8)
movapd 0x10(%rsp), %xmm0
movupd %xmm0, (%r8)
leaq 0x1(%rdi), %rax
addq $0x18, %rsi
addq $0x48, %rcx
testq %rdi, %rdi
movq %rax, %rdi
je 0x52584
cmpq $0x1, %r14
je 0x52626
movq %r12, %r15
xorl %ebp, %ebp
movq (%rsp,%rbp,8), %rcx
movq %r15, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x52772
incq %rbp
addq $0x48, %r15
cmpq $0x1, %rbp
je 0x52607
movq %r14, %rax
sarq %rax
cmpq $0x2, %r14
movq %rax, %r14
jae 0x52572
leaq 0x30(%rsp), %rax
xorl %ecx, %ecx
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2sdq (%rax,%rdx,8), %xmm0
movsd %xmm0, (%rbx,%rdx,8)
incq %rdx
cmpq $0x3, %rdx
jne 0x52642
leaq 0x1(%rcx), %rdx
addq $0x18, %rbx
addq $0x18, %rax
testq %rcx, %rcx
movq %rdx, %rcx
je 0x52640
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop