// File: hanhwi[P]SimPoint/analysiscode/Utilities.cpp
// Function: Random::randFloat()
float Random::randFloat() {
    int j;
    long k;
    float temp;

    if (state <= 0) {
        if (-(state) < 1) state=1;
        else state = -(state);
        idum2=(state);
        for (j=NTAB+7;j>=0;j--) {
            k=(state)/IQ1;
            state=IA1*(state-k*IQ1)-k*IR1;
            if (state < 0) state += IM1;
            if (j < NTAB) iv[j] = state;
        }
        iy=iv[0];
    }
    k=(state)/IQ1;
    state=IA1*(state-k*IQ1)-k*IR1;
    if (state < 0) state += 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] = state;
    if (iy < 1) iy += IMM1;
    if ((temp=AM*iy) > RNMX) return RNMX;
    else return temp;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x30(%rsp)
cmpq $0x0, (%rax)
jg 0x30597
movq -0x30(%rsp), %rcx
xorl %eax, %eax
subq (%rcx), %rax
cmpq $0x1, %rax
jge 0x304d7
movq -0x30(%rsp), %rax
movq $0x1, (%rax)
jmp 0x304e4
movq -0x30(%rsp), %rax
xorl %ecx, %ecx
subq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rax)
movl $0x27, -0x14(%rsp)
cmpl $0x0, -0x14(%rsp)
jl 0x3058a
movq -0x30(%rsp), %rax
movq (%rax), %rax
movl $0xd1a4, %ecx           # imm = 0xD1A4
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rsp), %rax
movq %rcx, -0x20(%rsp)
movq (%rax), %rcx
imulq $0xd1a4, -0x20(%rsp), %rdx # imm = 0xD1A4
subq %rdx, %rcx
imulq $0x9c4e, %rcx, %rcx     # imm = 0x9C4E
imulq $0x2fb3, -0x20(%rsp), %rdx # imm = 0x2FB3
subq %rdx, %rcx
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jge 0x3055f
movq -0x30(%rsp), %rax
movq (%rax), %rcx
addq $0x7fffffab, %rcx       # imm = 0x7FFFFFAB
movq %rcx, (%rax)
cmpl $0x20, -0x14(%rsp)
jge 0x30578
movq -0x30(%rsp), %rax
movq (%rax), %rdx
movslq -0x14(%rsp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
jmp 0x3057a
movl -0x14(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x304f8
movq -0x30(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rsp), %rax
movq (%rax), %rax
movl $0xd1a4, %ecx           # imm = 0xD1A4
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rsp), %rax
movq %rcx, -0x20(%rsp)
movq (%rax), %rcx
imulq $0xd1a4, -0x20(%rsp), %rdx # imm = 0xD1A4
subq %rdx, %rcx
imulq $0x9c4e, %rcx, %rcx     # imm = 0x9C4E
imulq $0x2fb3, -0x20(%rsp), %rdx # imm = 0x2FB3
subq %rdx, %rcx
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jge 0x305f3
movq -0x30(%rsp), %rax
movq (%rax), %rcx
addq $0x7fffffab, %rcx       # imm = 0x7FFFFFAB
movq %rcx, (%rax)
movq -0x30(%rsp), %rax
movq 0x8(%rax), %rax
movl $0xce26, %ecx           # imm = 0xCE26
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rsp), %rax
movq %rcx, -0x20(%rsp)
movq 0x8(%rax), %rcx
imulq $0xce26, -0x20(%rsp), %rdx # imm = 0xCE26
subq %rdx, %rcx
imulq $0x9ef4, %rcx, %rcx     # imm = 0x9EF4
imulq $0xecf, -0x20(%rsp), %rdx # imm = 0xECF
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
jge 0x30655
movq -0x30(%rsp), %rax
movq 0x8(%rax), %rcx
addq $0x7fffff07, %rcx       # imm = 0x7FFFFF07
movq %rcx, 0x8(%rax)
movq -0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl $0x3fffffe, %ecx        # imm = 0x3FFFFFE
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rsp), %rax
movl %ecx, -0x14(%rsp)
movslq -0x14(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rcx
subq 0x8(%rax), %rcx
movq %rcx, 0x10(%rax)
movq (%rax), %rdx
movslq -0x14(%rsp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
cmpq $0x1, 0x10(%rax)
jge 0x306ae
movq -0x30(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x7fffffaa, %rcx       # imm = 0x7FFFFFAA
movq %rcx, 0x10(%rax)
movq -0x30(%rsp), %rax
cvtsi2sdq 0x10(%rax), %xmm1
movsd 0x5f57(%rip), %xmm0     # 0x36618
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rsp)
cvtss2sd %xmm0, %xmm0
movsd 0x5f35(%rip), %xmm1     # 0x36610
ucomisd %xmm1, %xmm0
jbe 0x306f1
movss 0x5f37(%rip), %xmm0     # 0x36620
movss %xmm0, -0x4(%rsp)
jmp 0x306fd
movss -0x24(%rsp), %xmm0
movss %xmm0, -0x4(%rsp)
movss -0x4(%rsp), %xmm0
retq
nopw %cs:(%rax,%rax)