// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::ran2(int*)
double ran2(int * idum) {
        // ******************************************************
        // Long period (> 2 x 10^18) random number generator of L'Ecuyer
        // with Bays-Durham shuffle and added safeguards.
        // Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values).
        // Call with idum a negative integer to initialize; thereafter,
        // do not alter idum between successive deviates in a sequence.
        // RNMX should approximate the largest floating value that is less than 1.
        // ******************************************************
        static const int IM1=2147483563, IM2=2147483399, IMM1=IM1-1, IA1=40014, IA2=40692, IQ1=53668,
                        IQ2=52774, IR1=12211, IR2=3791, NTAB=32, NDIV=1+IMM1/NTAB;
        static const double AM=1.0/IM1, RNMX=1.0-1.2e-7;
        static int idum2 = 123456789;
        static int iy = 0;
        static int iv[NTAB];
        int j, k;
        if (*idum <= 0) {
            *idum = std::max(-*idum, 1);
            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;
        double ret = std::min(AM*iy, RNMX);
        return ret;
    }

// Assembly:
movl (%rsi), %ecx
testl %ecx, %ecx
jg 0x9c3e
negl %ecx
pushq $0x1
popq %rax
cmovbl %ecx, %eax
movl %eax, (%rsi)
movl %eax, 0x76ae(%rip)      # 0x11290
pushq $0x27
popq %rdi
movl $0xd1a4, %r8d           # imm = 0xD1A4
leaq 0x76be(%rip), %r9       # 0x112b0
testl %edi, %edi
js 0x9c30
movl (%rsi), %ecx
movl %ecx, %eax
cltd
idivl %r8d
imull $0xffff2e5c, %eax, %edx # imm = 0xFFFF2E5C
addl %ecx, %edx
imull $0x9c4e, %edx, %ecx     # imm = 0x9C4E
imull $0xffffd04d, %eax, %edx # imm = 0xFFFFD04D
leal (%rcx,%rdx), %eax
addl $0x7fffffab, %eax       # imm = 0x7FFFFFAB
addl %edx, %ecx
cmovnsl %ecx, %eax
movl %eax, (%rsi)
cmpl $0x1f, %edi
ja 0x9c2c
movl %edi, %ecx
movl %eax, (%r9,%rcx,4)
decl %edi
jmp 0x9bf2
movl 0x767a(%rip), %eax      # 0x112b0
movl %eax, 0x7668(%rip)      # 0x112a4
movl (%rsi), %ecx
movl $0xd1a4, %edi           # imm = 0xD1A4
movl %ecx, %eax
cltd
idivl %edi
imull $0xffff2e5c, %eax, %edx # imm = 0xFFFF2E5C
addl %ecx, %edx
imull $0x9c4e, %edx, %ecx     # imm = 0x9C4E
imull $0xffffd04d, %eax, %eax # imm = 0xFFFFD04D
leal (%rcx,%rax), %edx
addl $0x7fffffab, %edx       # imm = 0x7FFFFFAB
addl %eax, %ecx
cmovnsl %ecx, %edx
movl %edx, (%rsi)
movl 0x761e(%rip), %ecx      # 0x11290
movl $0xce26, %edi           # imm = 0xCE26
movl %ecx, %eax
cltd
idivl %edi
imull $0xffff31da, %eax, %edx # imm = 0xFFFF31DA
addl %ecx, %edx
imull $0x9ef4, %edx, %ecx     # imm = 0x9EF4
imull $0xfffff131, %eax, %eax # imm = 0xFFFFF131
leal (%rcx,%rax), %edi
addl $0x7fffff07, %edi       # imm = 0x7FFFFF07
addl %eax, %ecx
cmovnsl %ecx, %edi
movl %edi, 0x75ec(%rip)      # 0x11290
movl 0x75fa(%rip), %eax      # 0x112a4
movl $0x3fffffe, %ecx        # imm = 0x3FFFFFE
cltd
idivl %ecx
movslq %eax, %rcx
leaq 0x75f4(%rip), %rdx      # 0x112b0
movl (%rdx,%rcx,4), %eax
subl %edi, %eax
movl %eax, 0x75dd(%rip)      # 0x112a4
movl (%rsi), %esi
movl %esi, (%rdx,%rcx,4)
jg 0x9cd9
addl $0x7fffffaa, %eax       # imm = 0x7FFFFFAA
movl %eax, 0x75cb(%rip)      # 0x112a4
cvtsi2sd %eax, %xmm1
mulsd 0x23db(%rip), %xmm1     # 0xc0c0
movsd 0x23db(%rip), %xmm0     # 0xc0c8
minsd %xmm1, %xmm0
retq