// File: auton1[P]motiflocation/random.cpp
// Function: ran2()
double ran2(void) {
	int j;
	long k;
	extern long *idum;
	static long idum2=123456789;
	static long iy=0;
	static long iv[NTAB];
	double temp;

	if (*idum <= 0) {
		if (-(*idum) < 1) *idum=1;
		else *idum = -(*idum);
		idum2=(*idum);
		for (j=NTAB+7; j>=0; j--) {
			k=(*idum)/IQ1;
			*idum=IA1*(*idum-k*IQ1)-k*IR1;
			if (*idum < 0) *idum += IM1;
			if (j < NTAB) iv[j] = *idum;
			
		}
		iy=iv[0];
	}
	k=(*idum)/IQ1;
	*idum=IA1*(*idum-k*IQ1)-k*IR1;
	if (*idum < 0) *idum += IM1;
	k=idum2/IQ2;
	idum2=IA2*(idum2-k*IQ2)-k*IR2;
	if (idum2 < 0) idum2 += IM2;
	j=iy/NDIV;
	iy=iv[j]-idum2;
	iv[j]=*idum;
	if (iy < 1) iy += IMM1;
	if ((temp=AM*iy) > RNMX) return RNMX;
	else return temp;
}

// Assembly:
leaq 0x8369(%rip), %rax      # 0x17400
movq (%rax), %rax
cmpq $0x0, (%rax)
jg 0xf1cf
leaq 0x8355(%rip), %rax      # 0x17400
movq (%rax), %rcx
xorl %eax, %eax
subq (%rcx), %rax
cmpq $0x1, %rax
jge 0xf0cc
leaq 0x8340(%rip), %rax      # 0x17400
movq (%rax), %rax
movq $0x1, (%rax)
jmp 0xf0e8
leaq 0x832d(%rip), %rax      # 0x17400
movq (%rax), %rax
xorl %ecx, %ecx
subq (%rax), %rcx
leaq 0x831e(%rip), %rax      # 0x17400
movq (%rax), %rax
movq %rcx, (%rax)
leaq 0x8311(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x8294(%rip)      # 0x17390
movl $0x27, -0xc(%rsp)
cmpl $0x0, -0xc(%rsp)
jl 0xf1c1
leaq 0x82ea(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rax
movl $0xd1a4, %ecx           # imm = 0xD1A4
cqto
idivq %rcx
movq %rax, -0x18(%rsp)
leaq 0x82ce(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rax
imulq $0xd1a4, -0x18(%rsp), %rcx # imm = 0xD1A4
subq %rcx, %rax
imulq $0x9c4e, %rax, %rcx     # imm = 0x9C4E
imulq $0x2fb3, -0x18(%rsp), %rax # imm = 0x2FB3
subq %rax, %rcx
leaq 0x82a2(%rip), %rax      # 0x17400
movq (%rax), %rax
movq %rcx, (%rax)
leaq 0x8295(%rip), %rax      # 0x17400
movq (%rax), %rax
cmpq $0x0, (%rax)
jge 0xf18b
leaq 0x8285(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rcx
addq $0x7fffffab, %rcx       # imm = 0x7FFFFFAB
movq %rcx, (%rax)
cmpl $0x20, -0xc(%rsp)
jge 0xf1af
leaq 0x8267(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rdx
movslq -0xc(%rsp), %rcx
leaq 0x8275(%rip), %rax      # 0x17420
movq %rdx, (%rax,%rcx,8)
jmp 0xf1b1
movl -0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0xf104
movq 0x8258(%rip), %rax      # 0x17420
movq %rax, 0x8241(%rip)      # 0x17410
leaq 0x822a(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rax
movl $0xd1a4, %ecx           # imm = 0xD1A4
cqto
idivq %rcx
movq %rax, -0x18(%rsp)
leaq 0x820e(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rax
imulq $0xd1a4, -0x18(%rsp), %rcx # imm = 0xD1A4
subq %rcx, %rax
imulq $0x9c4e, %rax, %rcx     # imm = 0x9C4E
imulq $0x2fb3, -0x18(%rsp), %rax # imm = 0x2FB3
subq %rax, %rcx
leaq 0x81e2(%rip), %rax      # 0x17400
movq (%rax), %rax
movq %rcx, (%rax)
leaq 0x81d5(%rip), %rax      # 0x17400
movq (%rax), %rax
cmpq $0x0, (%rax)
jge 0xf24b
leaq 0x81c5(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rcx
addq $0x7fffffab, %rcx       # imm = 0x7FFFFFAB
movq %rcx, (%rax)
movq 0x813e(%rip), %rax      # 0x17390
movl $0xce26, %ecx           # imm = 0xCE26
cqto
idivq %rcx
movq %rax, -0x18(%rsp)
movq 0x8128(%rip), %rax      # 0x17390
imulq $0xce26, -0x18(%rsp), %rcx # imm = 0xCE26
subq %rcx, %rax
imulq $0x9ef4, %rax, %rax     # imm = 0x9EF4
imulq $0xecf, -0x18(%rsp), %rcx # imm = 0xECF
subq %rcx, %rax
movq %rax, 0x8102(%rip)      # 0x17390
cmpq $0x0, 0x80fa(%rip)      # 0x17390
jge 0xf2ac
movq 0x80f1(%rip), %rax      # 0x17390
addq $0x7fffff07, %rax       # imm = 0x7FFFFF07
movq %rax, 0x80e4(%rip)      # 0x17390
movq 0x815d(%rip), %rax      # 0x17410
movl $0x3fffffe, %ecx        # imm = 0x3FFFFFE
cqto
idivq %rcx
movl %eax, -0xc(%rsp)
movslq -0xc(%rsp), %rcx
leaq 0x8153(%rip), %rax      # 0x17420
movq (%rax,%rcx,8), %rax
subq 0x80b8(%rip), %rax      # 0x17390
movq %rax, 0x8131(%rip)      # 0x17410
leaq 0x811a(%rip), %rax      # 0x17400
movq (%rax), %rax
movq (%rax), %rdx
movslq -0xc(%rsp), %rcx
leaq 0x8128(%rip), %rax      # 0x17420
movq %rdx, (%rax,%rcx,8)
cmpq $0x1, 0x810c(%rip)      # 0x17410
jge 0xf31a
movq 0x8103(%rip), %rax      # 0x17410
addq $0x7fffffaa, %rax       # imm = 0x7FFFFFAA
movq %rax, 0x80f6(%rip)      # 0x17410
cvtsi2sdq 0x80ed(%rip), %xmm1 # 0x17410
movsd 0x25e5(%rip), %xmm0     # 0x11910
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rsp)
movsd 0x25cb(%rip), %xmm1     # 0x11908
ucomisd %xmm1, %xmm0
jbe 0xf353
movsd 0x25bd(%rip), %xmm0     # 0x11908
movsd %xmm0, -0x8(%rsp)
jmp 0xf35f
movsd -0x20(%rsp), %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nopw %cs:(%rax,%rax)