#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
double log(double);
double sin(double);
double sqrt(double);
double ranorm() {
  static int r1 = 885098780, r2 = 1824280461;
  static int r4 = 1396483093, r5 = 55318673;
  static int iflg = 0;
  static double h1l = 65531.0, h1u = 32767.0, h2l = 65525.0;
  static double r0 = 0.0;
  int isc, i1;
  double ranorm, r3, asc, dir, temp;
  if (iflg == 1) {
    ranorm = r0;
    r0 = 0.0;
    iflg = 0;
    return ranorm;
  }
  isc = 65536;
  asc = (double)isc;
  dir = asc * asc;
  i1 = r1 - (r1 / isc) * isc;
  r3 = h1l * (double)r1 + asc * h1u * (double)i1;
  i1 = r3 / dir;
  r3 -= ((double)i1) * dir;
  dir = 0.5 * dir;
  i1 = r2 / isc;
  isc = r2 - i1 * isc;
  r0 = h1l * (double)r2 + asc * h1u * (double)isc;
  asc = 1.0 / dir;
  isc = r0 * asc;
  r2 = r0 - ((double)isc) * dir;
  r3 += (double)isc + 2.0 * h1u * (double)i1;
  isc = r3 * asc;
  r1 = r3 - ((double)isc) * dir;
  temp = sqrt(-2.0 * log((((double)r1) + ((double)r2) * asc) * asc));
  isc = 65536;
  asc = (double)isc;
  dir = asc * asc;
  i1 = r4 - (r4 / isc) * isc;
  r3 = h2l * (double)r4 + asc * h1u * (double)i1;
  i1 = r3 / dir;
  r3 -= ((double)i1) * dir;
  dir = 0.5 * dir;
  i1 = r5 / isc;
  isc = r5 - i1 * isc;
  r0 = h2l * (double)r5 + asc * h1u * (double)isc;
  asc = 1.0 / dir;
  isc = r0 * asc;
  r5 = r0 - ((double)isc) * dir;
  r3 += (double)isc + 2.0 * h1u * (double)i1;
  isc = r3 * asc;
  r4 = r3 - ((double)isc) * dir;
  r0 = 6.28318530717959 * ((((double)r4) + ((double)r5) * asc) * asc);
  ranorm = temp * sin(r0);
  r0 = temp * cos(r0);
  iflg = 1;
  return ranorm;
}


x86 assembly (clang, -O0):
<ranorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
cmpl   $0x1,0x2f21(%rip)
jne    1186 <ranorm+0x46>
movsd  0x2f1b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2f0b(%rip)
movl   $0x0,0x2ef9(%rip)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    164d <ranorm+0x50d>
movl   $0x10000,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2e94(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    0x2e8b(%rip),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movsd  0x2e81(%rip),%xmm0
cvtsi2sdl 0x2e69(%rip),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  0x2e74(%rip),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdd2(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2dee(%rip),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    0x2de1(%rip),%eax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movsd  0x2dd9(%rip),%xmm0
cvtsi2sdl 0x2dc5(%rip),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  0x2dcc(%rip),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2dd3(%rip)
movsd  0xd63(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x2db9(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movsd  0x2da5(%rip),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x2d3e(%rip)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xcf5(%rip),%xmm0
mulsd  0x2d3d(%rip),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x2cc5(%rip)
cvtsi2sdl 0x2cbd(%rip),%xmm1
cvtsi2sdl 0x2cb9(%rip),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  0xc73(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movl   $0x10000,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2c67(%rip),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2c5e(%rip),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movsd  0x2c5c(%rip),%xmm0
cvtsi2sdl 0x2c3c(%rip),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  0x2c3f(%rip),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xb9d(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2bc1(%rip),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    0x2bb4(%rip),%eax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movsd  0x2bb4(%rip),%xmm0
cvtsi2sdl 0x2b98(%rip),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  0x2b97(%rip),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2b9e(%rip)
movsd  0xb2e(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x2b84(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movsd  0x2b70(%rip),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x2b11(%rip)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xac0(%rip),%xmm0
mulsd  0x2b08(%rip),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x2a98(%rip)
cvtsi2sdl 0x2a90(%rip),%xmm0
cvtsi2sdl 0x2a8c(%rip),%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xa26(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2a92(%rip)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x2a80(%rip),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x2a58(%rip),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2a3f(%rip)
movl   $0x1,0x2a2d(%rip)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranorm>:
push   %rbx
sub    $0x10,%rsp
mov    0x2f0d(%rip),%bl
cmp    $0x1,%bl
jne    1161 <ranorm+0x21>
xorpd  %xmm0,%xmm0
movsd  0x2f04(%rip),%xmm1
jmp    1410 <ranorm+0x2d0>
mov    0x2ed9(%rip),%eax
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
cvtsi2sd %eax,%xmm0
and    $0xffff0000,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe76(%rip),%xmm5
mulsd  %xmm5,%xmm1
movsd  0xe72(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm2
xorpd  0xe86(%rip),%xmm2
mov    0x2e84(%rip),%eax
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
mov    %ecx,%edx
sar    $0x10,%edx
and    $0xffff0000,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
sub    %ecx,%eax
cvtsi2sd %eax,%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm1
addsd  %xmm4,%xmm1
movsd  0xe21(%rip),%xmm4
movapd %xmm1,%xmm3
mulsd  %xmm4,%xmm3
cvttpd2dq %xmm3,%xmm3
cvtdq2pd %xmm3,%xmm3
movsd  0xe11(%rip),%xmm5
unpcklpd %xmm3,%xmm0
mulsd  %xmm5,%xmm3
subsd  %xmm3,%xmm1
cvttsd2si %xmm1,%eax
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
mov    %eax,0x2e18(%rip)
unpcklpd %xmm3,%xmm2
mulpd  0xe18(%rip),%xmm2
addpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm4,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm5,%xmm2
subsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm2
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
mov    %eax,0x2dc6(%rip)
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
call   1050 <log@plt>
mulsd  0xd95(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12a3 <ranorm+0x163>
sqrtsd %xmm0,%xmm0
jmp    12a8 <ranorm+0x168>
call   1060 <sqrt@plt>
movsd  %xmm0,(%rsp)
mov    0x2d95(%rip),%eax
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
and    $0xffff0000,%ecx
sub    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xd24(%rip),%xmm5
mulsd  %xmm5,%xmm1
movsd  0xd48(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd18(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm2
xorpd  0xd34(%rip),%xmm2
mov    0x2d3a(%rip),%eax
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
mov    %ecx,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
and    $0xffff0000,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm1,%xmm3
movsd  0xcce(%rip),%xmm4
mulsd  %xmm4,%xmm3
cvttpd2dq %xmm3,%xmm3
cvtdq2pd %xmm3,%xmm3
sar    $0x10,%edx
unpcklpd %xmm3,%xmm0
movsd  0xcbb(%rip),%xmm5
mulsd  %xmm5,%xmm3
subsd  %xmm3,%xmm1
cvttsd2si %xmm1,%eax
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
unpcklpd %xmm3,%xmm2
mulpd  0xccc(%rip),%xmm2
addpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm4,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm5,%xmm2
subsd  %xmm2,%xmm0
cvttsd2si %xmm0,%ecx
mov    %eax,0x2c96(%rip)
mov    %ecx,0x2c8c(%rip)
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm2
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
mulsd  0xc58(%rip),%xmm0
movsd  %xmm0,0x2c78(%rip)
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x2c60(%rip),%xmm0
call   1040 <cos@plt>
movsd  0x8(%rsp),%xmm1
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x2c48(%rip)
xor    $0x1,%bl
mov    %bl,0x2c37(%rip)
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@ranorm.r1 = internal global i32 885098780
@ranorm.r2 = internal global i32 1824280461
@ranorm.r4 = internal global i32 1396483093
@ranorm.r5 = internal global i32 55318673
@ranorm.iflg = internal global i32 0
@ranorm.h1l = internal global double 6.553100e+04
@ranorm.h1u = internal global double 3.276700e+04
@ranorm.h2l = internal global double 6.552500e+04
@ranorm.r0 = internal global double 0.000000e+00
define double @ranorm() {
%1 = alloca double
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = load i32, i32* @ranorm.iflg
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load double, double* @ranorm.r0
store double %12, double* %4
store double 0.000000e+00, double* @ranorm.r0
store i32 0, i32* @ranorm.iflg
%13 = load double, double* %4
store double %13, double* %1
br label %214
14: ; preds = %0
store i32 65536, i32* %2
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
store double %16, double* %6
%17 = load double, double* %6
%18 = load double, double* %6
%19 = fmul double %17, %18
store double %19, double* %7
%20 = load i32, i32* @ranorm.r1
%21 = load i32, i32* @ranorm.r1
%22 = load i32, i32* %2
%23 = sdiv i32 %21, %22
%24 = load i32, i32* %2
%25 = mul nsw i32 %23, %24
%26 = sub nsw i32 %20, %25
store i32 %26, i32* %3
%27 = load double, double* @ranorm.h1l
%28 = load i32, i32* @ranorm.r1
%29 = sitofp i32 %28 to double
%30 = load double, double* %6
%31 = load double, double* @ranorm.h1u
%32 = fmul double %30, %31
%33 = load i32, i32* %3
%34 = sitofp i32 %33 to double
%35 = fmul double %32, %34
%36 = call double @llvm.fmuladd.f64(double %27, double %29, double %35)
store double %36, double* %5
%37 = load double, double* %5
%38 = load double, double* %7
%39 = fdiv double %37, %38
%40 = fptosi double %39 to i32
store i32 %40, i32* %3
%41 = load i32, i32* %3
%42 = sitofp i32 %41 to double
%43 = load double, double* %7
%44 = load double, double* %5
%45 = fneg double %42
%46 = call double @llvm.fmuladd.f64(double %45, double %43, double %44)
store double %46, double* %5
%47 = load double, double* %7
%48 = fmul double 5.000000e-01, %47
store double %48, double* %7
%49 = load i32, i32* @ranorm.r2
%50 = load i32, i32* %2
%51 = sdiv i32 %49, %50
store i32 %51, i32* %3
%52 = load i32, i32* @ranorm.r2
%53 = load i32, i32* %3
%54 = load i32, i32* %2
%55 = mul nsw i32 %53, %54
%56 = sub nsw i32 %52, %55
store i32 %56, i32* %2
%57 = load double, double* @ranorm.h1l
%58 = load i32, i32* @ranorm.r2
%59 = sitofp i32 %58 to double
%60 = load double, double* %6
%61 = load double, double* @ranorm.h1u
%62 = fmul double %60, %61
%63 = load i32, i32* %2
%64 = sitofp i32 %63 to double
%65 = fmul double %62, %64
%66 = call double @llvm.fmuladd.f64(double %57, double %59, double %65)
store double %66, double* @ranorm.r0
%67 = load double, double* %7
%68 = fdiv double 1.000000e+00, %67
store double %68, double* %6
%69 = load double, double* @ranorm.r0
%70 = load double, double* %6
%71 = fmul double %69, %70
%72 = fptosi double %71 to i32
store i32 %72, i32* %2
%73 = load double, double* @ranorm.r0
%74 = load i32, i32* %2
%75 = sitofp i32 %74 to double
%76 = load double, double* %7
%77 = fneg double %75
%78 = call double @llvm.fmuladd.f64(double %77, double %76, double %73)
%79 = fptosi double %78 to i32
store i32 %79, i32* @ranorm.r2
%80 = load i32, i32* %2
%81 = sitofp i32 %80 to double
%82 = load double, double* @ranorm.h1u
%83 = fmul double 2.000000e+00, %82
%84 = load i32, i32* %3
%85 = sitofp i32 %84 to double
%86 = call double @llvm.fmuladd.f64(double %83, double %85, double %81)
%87 = load double, double* %5
%88 = fadd double %87, %86
store double %88, double* %5
%89 = load double, double* %5
%90 = load double, double* %6
%91 = fmul double %89, %90
%92 = fptosi double %91 to i32
store i32 %92, i32* %2
%93 = load double, double* %5
%94 = load i32, i32* %2
%95 = sitofp i32 %94 to double
%96 = load double, double* %7
%97 = fneg double %95
%98 = call double @llvm.fmuladd.f64(double %97, double %96, double %93)
%99 = fptosi double %98 to i32
store i32 %99, i32* @ranorm.r1
%100 = load i32, i32* @ranorm.r1
%101 = sitofp i32 %100 to double
%102 = load i32, i32* @ranorm.r2
%103 = sitofp i32 %102 to double
%104 = load double, double* %6
%105 = call double @llvm.fmuladd.f64(double %103, double %104, double %101)
%106 = load double, double* %6
%107 = fmul double %105, %106
%108 = call double @log(double %107)
%109 = fmul double -2.000000e+00, %108
%110 = call double @sqrt(double %109)
store double %110, double* %8
store i32 65536, i32* %2
%111 = load i32, i32* %2
%112 = sitofp i32 %111 to double
store double %112, double* %6
%113 = load double, double* %6
%114 = load double, double* %6
%115 = fmul double %113, %114
store double %115, double* %7
%116 = load i32, i32* @ranorm.r4
%117 = load i32, i32* @ranorm.r4
%118 = load i32, i32* %2
%119 = sdiv i32 %117, %118
%120 = load i32, i32* %2
%121 = mul nsw i32 %119, %120
%122 = sub nsw i32 %116, %121
store i32 %122, i32* %3
%123 = load double, double* @ranorm.h2l
%124 = load i32, i32* @ranorm.r4
%125 = sitofp i32 %124 to double
%126 = load double, double* %6
%127 = load double, double* @ranorm.h1u
%128 = fmul double %126, %127
%129 = load i32, i32* %3
%130 = sitofp i32 %129 to double
%131 = fmul double %128, %130
%132 = call double @llvm.fmuladd.f64(double %123, double %125, double %131)
store double %132, double* %5
%133 = load double, double* %5
%134 = load double, double* %7
%135 = fdiv double %133, %134
%136 = fptosi double %135 to i32
store i32 %136, i32* %3
%137 = load i32, i32* %3
%138 = sitofp i32 %137 to double
%139 = load double, double* %7
%140 = load double, double* %5
%141 = fneg double %138
%142 = call double @llvm.fmuladd.f64(double %141, double %139, double %140)
store double %142, double* %5
%143 = load double, double* %7
%144 = fmul double 5.000000e-01, %143
store double %144, double* %7
%145 = load i32, i32* @ranorm.r5
%146 = load i32, i32* %2
%147 = sdiv i32 %145, %146
store i32 %147, i32* %3
%148 = load i32, i32* @ranorm.r5
%149 = load i32, i32* %3
%150 = load i32, i32* %2
%151 = mul nsw i32 %149, %150
%152 = sub nsw i32 %148, %151
store i32 %152, i32* %2
%153 = load double, double* @ranorm.h2l
%154 = load i32, i32* @ranorm.r5
%155 = sitofp i32 %154 to double
%156 = load double, double* %6
%157 = load double, double* @ranorm.h1u
%158 = fmul double %156, %157
%159 = load i32, i32* %2
%160 = sitofp i32 %159 to double
%161 = fmul double %158, %160
%162 = call double @llvm.fmuladd.f64(double %153, double %155, double %161)
store double %162, double* @ranorm.r0
%163 = load double, double* %7
%164 = fdiv double 1.000000e+00, %163
store double %164, double* %6
%165 = load double, double* @ranorm.r0
%166 = load double, double* %6
%167 = fmul double %165, %166
%168 = fptosi double %167 to i32
store i32 %168, i32* %2
%169 = load double, double* @ranorm.r0
%170 = load i32, i32* %2
%171 = sitofp i32 %170 to double
%172 = load double, double* %7
%173 = fneg double %171
%174 = call double @llvm.fmuladd.f64(double %173, double %172, double %169)
%175 = fptosi double %174 to i32
store i32 %175, i32* @ranorm.r5
%176 = load i32, i32* %2
%177 = sitofp i32 %176 to double
%178 = load double, double* @ranorm.h1u
%179 = fmul double 2.000000e+00, %178
%180 = load i32, i32* %3
%181 = sitofp i32 %180 to double
%182 = call double @llvm.fmuladd.f64(double %179, double %181, double %177)
%183 = load double, double* %5
%184 = fadd double %183, %182
store double %184, double* %5
%185 = load double, double* %5
%186 = load double, double* %6
%187 = fmul double %185, %186
%188 = fptosi double %187 to i32
store i32 %188, i32* %2
%189 = load double, double* %5
%190 = load i32, i32* %2
%191 = sitofp i32 %190 to double
%192 = load double, double* %7
%193 = fneg double %191
%194 = call double @llvm.fmuladd.f64(double %193, double %192, double %189)
%195 = fptosi double %194 to i32
store i32 %195, i32* @ranorm.r4
%196 = load i32, i32* @ranorm.r4
%197 = sitofp i32 %196 to double
%198 = load i32, i32* @ranorm.r5
%199 = sitofp i32 %198 to double
%200 = load double, double* %6
%201 = call double @llvm.fmuladd.f64(double %199, double %200, double %197)
%202 = load double, double* %6
%203 = fmul double %201, %202
%204 = fmul double 0x401921FB54442D1C, %203
store double %204, double* @ranorm.r0
%205 = load double, double* %8
%206 = load double, double* @ranorm.r0
%207 = call double @sin(double %206)
%208 = fmul double %205, %207
store double %208, double* %4
%209 = load double, double* %8
%210 = load double, double* @ranorm.r0
%211 = call double @cos(double %210)
%212 = fmul double %209, %211
store double %212, double* @ranorm.r0
store i32 1, i32* @ranorm.iflg
%213 = load double, double* %4
store double %213, double* %1
br label %214
214: ; preds = %14, %11
%215 = load double, double* %1
ret double %215
}

LLVM IR (-O2):
@ranorm.r1 = internal unnamed_addr global i32 885098780
@ranorm.r2 = internal unnamed_addr global i32 1824280461
@ranorm.r4 = internal unnamed_addr global i32 1396483093
@ranorm.r5 = internal unnamed_addr global i32 55318673
@ranorm.iflg = internal unnamed_addr global i1 false
@ranorm.r0 = internal unnamed_addr global double 0.000000e+00
define double @ranorm() {
%1 = load i1, i1* @ranorm.iflg
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = load double, double* @ranorm.r0
br label %100
4: ; preds = %0
%5 = load i32, i32* @ranorm.r1
%6 = srem i32 %5, 65536
%7 = sitofp i32 %5 to double
%8 = sitofp i32 %6 to double
%9 = fmul double %8, 0x41DFFFC000000000
%10 = tail call double @llvm.fmuladd.f64(double %7, double 6.553100e+04, double %9)
%11 = fmul double %10, 0x3DF0000000000000
%12 = fptosi double %11 to i32
%13 = sitofp i32 %12 to double
%14 = fneg double %13
%15 = load i32, i32* @ranorm.r2
%16 = sdiv i32 %15, 65536
%17 = mul i32 %16, -65536
%18 = add i32 %17, %15
%19 = sitofp i32 %15 to double
%20 = sitofp i32 %18 to double
%21 = fmul double %20, 0x41DFFFC000000000
%22 = tail call double @llvm.fmuladd.f64(double %19, double 6.553100e+04, double %21)
%23 = fmul double %22, 0x3E00000000000000
%24 = fptosi double %23 to i32
%25 = sitofp i32 %24 to double
%26 = fneg double %25
%27 = tail call double @llvm.fmuladd.f64(double %26, double 0x41E0000000000000, double %22)
%28 = fptosi double %27 to i32
store i32 %28, i32* @ranorm.r2
%29 = sitofp i32 %16 to double
%30 = insertelement <2 x double> poison, double %14, i64 0
%31 = insertelement <2 x double> %30, double %29, i64 1
%32 = insertelement <2 x double> poison, double %10, i64 0
%33 = insertelement <2 x double> %32, double %25, i64 1
%34 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> <double 0x41F0000000000000, double 6.553400e+04>, <2 x double> %33)
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%36 = fadd <2 x double> %34, %35
%37 = extractelement <2 x double> %36, i64 0
%38 = fmul double %37, 0x3E00000000000000
%39 = fptosi double %38 to i32
%40 = sitofp i32 %39 to double
%41 = fneg double %40
%42 = tail call double @llvm.fmuladd.f64(double %41, double 0x41E0000000000000, double %37)
%43 = fptosi double %42 to i32
store i32 %43, i32* @ranorm.r1
%44 = sitofp i32 %43 to double
%45 = sitofp i32 %28 to double
%46 = tail call double @llvm.fmuladd.f64(double %45, double 0x3E00000000000000, double %44)
%47 = fmul double %46, 0x3E00000000000000
%48 = tail call double @log(double %47)
%49 = fmul double %48, -2.000000e+00
%50 = tail call double @sqrt(double %49)
%51 = load i32, i32* @ranorm.r4
%52 = srem i32 %51, 65536
%53 = sitofp i32 %51 to double
%54 = sitofp i32 %52 to double
%55 = fmul double %54, 0x41DFFFC000000000
%56 = tail call double @llvm.fmuladd.f64(double %53, double 6.552500e+04, double %55)
%57 = fmul double %56, 0x3DF0000000000000
%58 = fptosi double %57 to i32
%59 = sitofp i32 %58 to double
%60 = fneg double %59
%61 = load i32, i32* @ranorm.r5
%62 = sdiv i32 %61, 65536
%63 = mul i32 %62, -65536
%64 = add i32 %63, %61
%65 = sitofp i32 %61 to double
%66 = sitofp i32 %64 to double
%67 = fmul double %66, 0x41DFFFC000000000
%68 = tail call double @llvm.fmuladd.f64(double %65, double 6.552500e+04, double %67)
%69 = fmul double %68, 0x3E00000000000000
%70 = fptosi double %69 to i32
%71 = sitofp i32 %70 to double
%72 = fneg double %71
%73 = tail call double @llvm.fmuladd.f64(double %72, double 0x41E0000000000000, double %68)
%74 = fptosi double %73 to i32
store i32 %74, i32* @ranorm.r5
%75 = sitofp i32 %62 to double
%76 = insertelement <2 x double> poison, double %60, i64 0
%77 = insertelement <2 x double> %76, double %75, i64 1
%78 = insertelement <2 x double> poison, double %56, i64 0
%79 = insertelement <2 x double> %78, double %71, i64 1
%80 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> <double 0x41F0000000000000, double 6.553400e+04>, <2 x double> %79)
%81 = shufflevector <2 x double> %80, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%82 = fadd <2 x double> %80, %81
%83 = extractelement <2 x double> %82, i64 0
%84 = fmul double %83, 0x3E00000000000000
%85 = fptosi double %84 to i32
%86 = sitofp i32 %85 to double
%87 = fneg double %86
%88 = tail call double @llvm.fmuladd.f64(double %87, double 0x41E0000000000000, double %83)
%89 = fptosi double %88 to i32
store i32 %89, i32* @ranorm.r4
%90 = sitofp i32 %89 to double
%91 = sitofp i32 %74 to double
%92 = tail call double @llvm.fmuladd.f64(double %91, double 0x3E00000000000000, double %90)
%93 = fmul double %92, 0x3E00000000000000
%94 = fmul double %93, 0x401921FB54442D1C
store double %94, double* @ranorm.r0
%95 = tail call double @sin(double %94)
%96 = fmul double %50, %95
%97 = load double, double* @ranorm.r0
%98 = tail call double @cos(double %97)
%99 = fmul double %50, %98
br label %100
100: ; preds = %4, %2
%101 = phi double [ 0.000000e+00, %2 ], [ %99, %4 ]
%102 = phi double [ %3, %2 ], [ %96, %4 ]
store double %101, double* @ranorm.r0
%103 = xor i1 %1, true
store i1 %103, i1* @ranorm.iflg
ret double %102
}