float randf() {
  static float buff[55];
  static int ip = 0, jp = 0, kp;
  int i, seed, get_i_variable();
  static double xva;
  if (ip == 0 && jp == 0) {
    seed = get_i_variable("seed");
    for (ip = 0; ip < 55; ip++) {
      seed = (seed * 2349 + 14867) % 32767;
      buff[ip] = (float)seed / 32767.;
      if (buff[ip] > 1.)
        buff[ip] = buff[ip] - 1.;
      if (buff[ip] < 0.)
        buff[ip] = buff[ip] + 1.;
    }
    ip = 24;
    jp = 55 - ip;
    kp = 0;
  }
  i = kp;
  xva = buff[jp] + buff[ip];
  if (xva > 1.)
    xva = xva - 1.;
  buff[kp] = xva;
  kp = (kp + 1) % 55;
  ip = (ip + 1) % 55;
  jp = (jp + 1) % 55;
  return buff[i];
}


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2ffd(%rip)
jne    129c <randf+0x18c>
cmpl   $0x0,0x2ff4(%rip)
jne    129c <randf+0x18c>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <get_i_variable@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,0x2fcf(%rip)
cmpl   $0x37,0x2fc8(%rip)
jge    1277 <randf+0x167>
imul   $0x92d,-0x8(%rbp),%eax
add    $0x3a13,%eax
mov    $0x7fff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe86(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq 0x2f8b(%rip),%rcx
lea    0x2ea8(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
movslq 0x2f78(%rip),%rcx
lea    0x2e95(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe44(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1200 <randf+0xf0>
movslq 0x2f4f(%rip),%rcx
lea    0x2e6c(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1b(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq 0x2f28(%rip),%rcx
lea    0x2e45(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
movslq 0x2f15(%rip),%rcx
lea    0x2e32(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    125e <randf+0x14e>
movslq 0x2ef1(%rip),%rcx
lea    0x2e0e(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq 0x2eca(%rip),%rcx
lea    0x2de7(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
jmp    1263 <randf+0x153>
mov    0x2eb3(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eaa(%rip)
jmp    114d <randf+0x3d>
movl   $0x18,0x2e9b(%rip)
mov    $0x37,%eax
sub    0x2e90(%rip),%eax
mov    %eax,0x2e8e(%rip)
movl   $0x0,0x2e88(%rip)
mov    0x2e82(%rip),%eax
mov    %eax,-0x4(%rbp)
movslq 0x2e74(%rip),%rcx
lea    0x2d8d(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movslq 0x2e5d(%rip),%rcx
lea    0x2d7a(%rip),%rax
addss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x2e51(%rip)
movsd  0x2e49(%rip),%xmm0
movsd  0xd19(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    130d <randf+0x1fd>
movsd  0x2e2f(%rip),%xmm0
movsd  0xcff(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2e1b(%rip)
movsd  0x2e13(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movslq 0x2e04(%rip),%rcx
lea    0x2d19(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
mov    0x2df2(%rip),%eax
add    $0x1,%eax
mov    $0x37,%ecx
cltd
idiv   %ecx
mov    %edx,0x2de1(%rip)
mov    0x2dd3(%rip),%eax
add    $0x1,%eax
mov    $0x37,%ecx
cltd
idiv   %ecx
mov    %edx,0x2dc2(%rip)
mov    0x2dc0(%rip),%eax
add    $0x1,%eax
mov    $0x37,%ecx
cltd
idiv   %ecx
mov    %edx,0x2daf(%rip)
movslq -0x4(%rbp),%rcx
lea    0x2cc4(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rbx
mov    0x3005(%rip),%ecx
mov    0x3003(%rip),%eax
mov    %ecx,%edx
or     %eax,%edx
jne    1209 <randf+0xf9>
lea    0xede(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_i_variable@plt>
movss  0xec1(%rip),%xmm0
lea    0x2efa(%rip),%rcx
movss  0xeb6(%rip),%xmm1
movss  0xeb2(%rip),%xmm2
xorps  %xmm3,%xmm3
jmp    1176 <randf+0x66>
nopl   0x0(%rax,%rax,1)
movss  %xmm5,(%rbx,%rcx,1)
add    $0x4,%rbx
cmp    $0xdc,%rbx
je     1211 <randf+0x101>
imul   $0x92d,%eax,%eax
mov    %eax,%edx
add    $0x3a13,%edx
movslq %edx,%rdx
imul   $0xffffffff80010003,%rdx,%rdx
shr    $0x20,%rdx
add    %eax,%edx
add    $0x3a13,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0xe,%edx
add    %esi,%edx
mov    %edx,%esi
shl    $0xf,%esi
sub    %esi,%edx
add    %edx,%eax
add    $0x3a13,%eax
xorps  %xmm4,%xmm4
cvtsi2ss %eax,%xmm4
divss  %xmm0,%xmm4
movaps %xmm4,%xmm5
addss  %xmm1,%xmm5
movaps %xmm2,%xmm6
cmpltss %xmm4,%xmm6
andps  %xmm6,%xmm5
andnps %xmm4,%xmm6
orps   %xmm5,%xmm6
ucomiss %xmm6,%xmm3
movaps %xmm6,%xmm7
addss  %xmm2,%xmm7
movaps %xmm6,%xmm5
cmpltss %xmm3,%xmm5
andps  %xmm5,%xmm7
andnps %xmm6,%xmm5
orps   %xmm7,%xmm5
movaps %xmm5,%xmm6
ja     11f8 <randf+0xe8>
movaps %xmm4,%xmm6
ucomiss %xmm2,%xmm4
ja     1160 <randf+0x50>
movaps %xmm6,%xmm5
jmp    1160 <randf+0x50>
mov    0x2f15(%rip),%edx
jmp    121d <randf+0x10d>
xor    %edx,%edx
mov    $0x1f,%eax
mov    $0x18,%ecx
cltq
lea    0x2e1a(%rip),%rsi
movss  (%rsi,%rax,4),%xmm1
movslq %ecx,%rcx
addss  (%rsi,%rcx,4),%xmm1
movss  0xdc9(%rip),%xmm2
addss  %xmm1,%xmm2
movss  0xdc1(%rip),%xmm0
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
movslq %edx,%rdx
movss  %xmm0,(%rsi,%rdx,4)
mov    %edx,%esi
add    $0x1,%esi
movslq %esi,%rsi
imul   $0x94f2095,%rsi,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rsi
add    %edi,%esi
imul   $0x37,%esi,%esi
neg    %esi
add    %esi,%edx
add    $0x1,%edx
mov    %edx,0x2e9b(%rip)
mov    %ecx,%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x94f2095,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
imul   $0x37,%edx,%edx
neg    %edx
add    %edx,%ecx
add    $0x1,%ecx
mov    %ecx,0x2e67(%rip)
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x94f2095,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
imul   $0x37,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2e3f(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@randf.buff = internal global [55 x float] zeroinitializer
@randf.ip = internal global i32 0
@randf.jp = internal global i32 0
@randf.kp = internal global i32 0
@randf.xva = internal global double 0.000000e+00
@.str = [5 x i8] c"seed\00"
define float @randf() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @randf.ip
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %68
5: ; preds = %0
%6 = load i32, i32* @randf.jp
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %68
8: ; preds = %5
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @get_i_variable to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
store i32 0, i32* @randf.ip
br label %10
10: ; preds = %62, %8
%11 = load i32, i32* @randf.ip
%12 = icmp slt i32 %11, 55
br i1 %12, label %13, label %65
13: ; preds = %10
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 2349
%16 = add nsw i32 %15, 14867
%17 = srem i32 %16, 32767
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to float
%20 = fpext float %19 to double
%21 = fdiv double %20, 3.276700e+04
%22 = fptrunc double %21 to float
%23 = load i32, i32* @randf.ip
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %24
store float %22, float* %25
%26 = load i32, i32* @randf.ip
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %27
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = fcmp ogt double %30, 1.000000e+00
br i1 %31, label %32, label %43
32: ; preds = %13
%33 = load i32, i32* @randf.ip
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %34
%36 = load float, float* %35
%37 = fpext float %36 to double
%38 = fsub double %37, 1.000000e+00
%39 = fptrunc double %38 to float
%40 = load i32, i32* @randf.ip
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %41
store float %39, float* %42
br label %43
43: ; preds = %32, %13
%44 = load i32, i32* @randf.ip
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %45
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = fcmp olt double %48, 0.000000e+00
br i1 %49, label %50, label %61
50: ; preds = %43
%51 = load i32, i32* @randf.ip
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %52
%54 = load float, float* %53
%55 = fpext float %54 to double
%56 = fadd double %55, 1.000000e+00
%57 = fptrunc double %56 to float
%58 = load i32, i32* @randf.ip
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %59
store float %57, float* %60
br label %61
61: ; preds = %50, %43
br label %62
62: ; preds = %61
%63 = load i32, i32* @randf.ip
%64 = add nsw i32 %63, 1
store i32 %64, i32* @randf.ip
br label %10
65: ; preds = %10
store i32 24, i32* @randf.ip
%66 = load i32, i32* @randf.ip
%67 = sub nsw i32 55, %66
store i32 %67, i32* @randf.jp
store i32 0, i32* @randf.kp
br label %68
68: ; preds = %65, %5, %0
%69 = load i32, i32* @randf.kp
store i32 %69, i32* %1
%70 = load i32, i32* @randf.jp
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %71
%73 = load float, float* %72
%74 = load i32, i32* @randf.ip
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %75
%77 = load float, float* %76
%78 = fadd float %73, %77
%79 = fpext float %78 to double
store double %79, double* @randf.xva
%80 = load double, double* @randf.xva
%81 = fcmp ogt double %80, 1.000000e+00
br i1 %81, label %82, label %85
82: ; preds = %68
%83 = load double, double* @randf.xva
%84 = fsub double %83, 1.000000e+00
store double %84, double* @randf.xva
br label %85
85: ; preds = %82, %68
%86 = load double, double* @randf.xva
%87 = fptrunc double %86 to float
%88 = load i32, i32* @randf.kp
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %89
store float %87, float* %90
%91 = load i32, i32* @randf.kp
%92 = add nsw i32 %91, 1
%93 = srem i32 %92, 55
store i32 %93, i32* @randf.kp
%94 = load i32, i32* @randf.ip
%95 = add nsw i32 %94, 1
%96 = srem i32 %95, 55
store i32 %96, i32* @randf.ip
%97 = load i32, i32* @randf.jp
%98 = add nsw i32 %97, 1
%99 = srem i32 %98, 55
store i32 %99, i32* @randf.jp
%100 = load i32, i32* %1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %101
%103 = load float, float* %102
ret float %103
}

LLVM IR (-O2):
@randf.buff = internal unnamed_addr global [55 x float] zeroinitializer
@randf.ip = internal unnamed_addr global i32 0
@randf.jp = internal unnamed_addr global i32 0
@randf.kp = internal unnamed_addr global i32 0
@.str = [5 x i8] c"seed\00"
define float @randf() {
%1 = load i32, i32* @randf.ip
%2 = icmp eq i32 %1, 0
%3 = load i32, i32* @randf.jp
%4 = icmp eq i32 %3, 0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = load i32, i32* @randf.kp
br label %29
8: ; preds = %0
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @get_i_variable to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %27, %10 ]
%12 = phi i32 [ %9, %8 ], [ %15, %10 ]
%13 = mul nsw i32 %12, 2349
%14 = add nsw i32 %13, 14867
%15 = srem i32 %14, 32767
%16 = sitofp i32 %15 to float
%17 = fdiv float %16, 3.276700e+04
%18 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %11
%19 = fcmp ogt float %17, 1.000000e+00
%20 = fadd float %17, -1.000000e+00
%21 = select i1 %19, float %20, float %17
%22 = fcmp olt float %21, 0.000000e+00
%23 = or i1 %19, %22
%24 = fadd float %21, 1.000000e+00
%25 = select i1 %22, float %24, float %21
%26 = select i1 %23, float %25, float %17
store float %26, float* %18
%27 = add nuw nsw i64 %11, 1
%28 = icmp eq i64 %27, 55
br i1 %28, label %29, label %10
29: ; preds = %10, %6
%30 = phi i32 [ %1, %6 ], [ 24, %10 ]
%31 = phi i32 [ %3, %6 ], [ 31, %10 ]
%32 = phi i32 [ %7, %6 ], [ 0, %10 ]
%33 = sext i32 %31 to i64
%34 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %33
%35 = load float, float* %34
%36 = sext i32 %30 to i64
%37 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %36
%38 = load float, float* %37
%39 = fadd float %35, %38
%40 = fcmp ogt float %39, 1.000000e+00
%41 = fadd float %39, -1.000000e+00
%42 = select i1 %40, float %41, float %39
%43 = sext i32 %32 to i64
%44 = getelementptr inbounds [55 x float], [55 x float]* @randf.buff, i64 0, i64 %43
store float %42, float* %44
%45 = add nsw i32 %32, 1
%46 = srem i32 %45, 55
store i32 %46, i32* @randf.kp
%47 = add nsw i32 %30, 1
%48 = srem i32 %47, 55
store i32 %48, i32* @randf.ip
%49 = add nsw i32 %31, 1
%50 = srem i32 %49, 55
store i32 %50, i32* @randf.jp
ret float %42
}