#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 sre_random();
double Gaussrandom(double mean, double stddev) {
  static double a[32] = {
      0.0,       3.917609E-2, 7.841241E-2, 0.11777,   0.1573107, 0.1970991,
      0.2372021, 0.2776904,   0.3186394,   0.36013,   0.4022501, 0.4450965,
      0.4887764, 0.5334097,   0.5791322,   0.626099,  0.6744898, 0.7245144,
      0.7764218, 0.8305109,   0.8871466,   0.9467818, 1.00999,   1.077516,
      1.150349,  1.229859,    1.318011,    1.417797,  1.534121,  1.67594,
      1.862732,  2.153875};
  static double d[31] = {0.0,       0.0,       0.0,       0.0,       0.0,
                         0.2636843, 0.2425085, 0.2255674, 0.2116342, 0.1999243,
                         0.1899108, 0.1812252, 0.1736014, 0.1668419, 0.1607967,
                         0.1553497, 0.1504094, 0.1459026, 0.14177,   0.1379632,
                         0.1344418, 0.1311722, 0.128126,  0.1252791, 0.1226109,
                         0.1201036, 0.1177417, 0.1155119, 0.1134023, 0.1114027,
                         0.1095039};
  static double t[31] = {7.673828E-4, 2.30687E-3,  3.860618E-3, 5.438454E-3,
                         7.0507E-3,   8.708396E-3, 1.042357E-2, 1.220953E-2,
                         1.408125E-2, 1.605579E-2, 1.81529E-2,  2.039573E-2,
                         2.281177E-2, 2.543407E-2, 2.830296E-2, 3.146822E-2,
                         3.499233E-2, 3.895483E-2, 4.345878E-2, 4.864035E-2,
                         5.468334E-2, 6.184222E-2, 7.047983E-2, 8.113195E-2,
                         9.462444E-2, 0.1123001,   0.136498,    0.1716886,
                         0.2276241,   0.330498,    0.5847031};
  static double h[31] = {3.920617E-2, 3.932705E-2, 3.951E-2,    3.975703E-2,
                         4.007093E-2, 4.045533E-2, 4.091481E-2, 4.145507E-2,
                         4.208311E-2, 4.280748E-2, 4.363863E-2, 4.458932E-2,
                         4.567523E-2, 4.691571E-2, 4.833487E-2, 4.996298E-2,
                         5.183859E-2, 5.401138E-2, 5.654656E-2, 5.95313E-2,
                         6.308489E-2, 6.737503E-2, 7.264544E-2, 7.926471E-2,
                         8.781922E-2, 9.930398E-2, 0.11556,     0.1404344,
                         0.1836142,   0.2790016,   0.7010474};
  static long i;
  static double snorm, u, s, ustar, aa, w, y, tt;
  u = sre_random();
  s = 0.0;
  if (u > 0.5)
    s = 1.0;
  u += (u - s);
  u = 32.0 * u;
  i = (long)(u);
  if (i == 32)
    i = 31;
  if (i == 0)
    goto S100;
  ustar = u - (double)i;
  aa = *(a + i - 1);
S40:
  if (ustar <= *(t + i - 1))
    goto S60;
  w = (ustar - *(t + i - 1)) * *(h + i - 1);
S50:
  y = aa + w;
  snorm = y;
  if (s == 1.0)
    snorm = -y;
  return (stddev * snorm + mean);
S60:
  u = sre_random();
  w = u * (*(a + i) - aa);
  tt = (0.5 * w + aa) * w;
  goto S80;
S70:
  tt = u;
  ustar = sre_random();
S80:
  if (ustar > tt)
    goto S50;
  u = sre_random();
  if (ustar >= u)
    goto S70;
  ustar = sre_random();
  goto S40;
S100:
  i = 6;
  aa = *(a + 31);
  goto S120;
S110:
  aa += *(d + i - 1);
  i += 1;
S120:
  u += u;
  if (u < 1.0)
    goto S110;
  u -= 1.0;
S140:
  w = u * *(d + i - 1);
  tt = (0.5 * w + aa) * w;
  goto S160;
S150:
  tt = u;
S160:
  ustar = sre_random();
  if (ustar > tt)
    goto S50;
  u = sre_random();
  if (ustar >= u)
    goto S150;
  u = sre_random();
  goto S140;
}


x86 assembly (clang, -O0):
<Gaussrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x330f(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x330c(%rip)
movsd  0x32fc(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <Gaussrandom+0x56>
movsd  0xeaa(%rip),%xmm0
movsd  %xmm0,0x32e2(%rip)
movsd  0x32d2(%rip),%xmm0
subsd  0x32d2(%rip),%xmm0
addsd  0x32c2(%rip),%xmm0
movsd  %xmm0,0x32ba(%rip)
movsd  0xe82(%rip),%xmm0
mulsd  0x32aa(%rip),%xmm0
movsd  %xmm0,0x32a2(%rip)
cvttsd2si 0x3299(%rip),%rax
mov    %rax,0x3282(%rip)
cmpq   $0x20,0x327a(%rip)
20
jne    11c7 <Gaussrandom+0xb7>
movq   $0x1f,0x3269(%rip)
cmpq   $0x0,0x3261(%rip)
jne    11da <Gaussrandom+0xca>
jmp    13f0 <Gaussrandom+0x2e0>
movsd  0x325e(%rip),%xmm0
cvtsi2sdq 0x3245(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x3259(%rip)
mov    0x3232(%rip),%rcx
lea    0x2e2b(%rip),%rax
movsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,0x3245(%rip)
movsd  0x3235(%rip),%xmm1
mov    0x320e(%rip),%rcx
lea    0x3007(%rip),%rax
movsd  -0x8(%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     123e <Gaussrandom+0x12e>
jmp    1305 <Gaussrandom+0x1f5>
movsd  0x320a(%rip),%xmm0
mov    0x31e3(%rip),%rcx
lea    0x2fdc(%rip),%rax
subsd  -0x8(%rax,%rcx,8),%xmm0
mov    0x31cf(%rip),%rcx
lea    0x30c8(%rip),%rax
mulsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,0x31ea(%rip)
movsd  0x31da(%rip),%xmm0
addsd  0x31da(%rip),%xmm0
movsd  %xmm0,0x31da(%rip)
movsd  0x31d2(%rip),%xmm0
movsd  %xmm0,0x319a(%rip)
movsd  0x31a2(%rip),%xmm0
movsd  0xd5a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12e5 <Gaussrandom+0x1d5>
jp     12e5 <Gaussrandom+0x1d5>
movsd  0x31a2(%rip),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,0x3153(%rip)
movsd  -0x10(%rbp),%xmm0
movsd  0x3146(%rip),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x312c(%rip)
movsd  0x3124(%rip),%xmm0
mov    0x310d(%rip),%rcx
lea    0x2d06(%rip),%rax
movsd  (%rax,%rcx,8),%xmm1
subsd  0x3121(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x311d(%rip)
movsd  0x3115(%rip),%xmm0
movsd  0x3105(%rip),%xmm1
movsd  0xca5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0x30f5(%rip),%xmm0
movsd  %xmm0,0x30fd(%rip)
jmp    1397 <Gaussrandom+0x287>
movsd  0x30c0(%rip),%xmm0
movsd  %xmm0,0x30e8(%rip)
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x30b9(%rip)
movsd  0x30b1(%rip),%xmm0
ucomisd 0x30c9(%rip),%xmm0
jbe    13b2 <Gaussrandom+0x2a2>
jmp    1276 <Gaussrandom+0x166>
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x307f(%rip)
movsd  0x3087(%rip),%xmm0
ucomisd 0x306f(%rip),%xmm0
jb     13dc <Gaussrandom+0x2cc>
jmp    1378 <Gaussrandom+0x268>
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x3065(%rip)
jmp    1213 <Gaussrandom+0x103>
movq   $0x6,0x3035(%rip)
movsd  0x2d25(%rip),%xmm0
movsd  %xmm0,0x304d(%rip)
jmp    1446 <Gaussrandom+0x336>
mov    0x3019(%rip),%rcx
lea    0x2d12(%rip),%rax
movsd  -0x8(%rax,%rcx,8),%xmm0
addsd  0x302c(%rip),%xmm0
movsd  %xmm0,0x3024(%rip)
mov    0x2ff5(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2fea(%rip)
movsd  0x2ff2(%rip),%xmm0
addsd  0x2fea(%rip),%xmm0
movsd  %xmm0,0x2fe2(%rip)
movsd  0xba2(%rip),%xmm0
ucomisd 0x2fd2(%rip),%xmm0
jbe    1479 <Gaussrandom+0x369>
jmp    1410 <Gaussrandom+0x300>
movsd  0x2fbf(%rip),%xmm0
movsd  0xb7f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2fab(%rip)
movsd  0x2fa3(%rip),%xmm0
mov    0x2f8c(%rip),%rcx
lea    0x2c85(%rip),%rax
mulsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,0x2fa7(%rip)
movsd  0x2f9f(%rip),%xmm0
movsd  0x2f8f(%rip),%xmm1
movsd  0xb2f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0x2f7f(%rip),%xmm0
movsd  %xmm0,0x2f87(%rip)
jmp    14fe <Gaussrandom+0x3ee>
movsd  0x2f4a(%rip),%xmm0
movsd  %xmm0,0x2f72(%rip)
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x2f43(%rip)
movsd  0x2f3b(%rip),%xmm0
ucomisd 0x2f53(%rip),%xmm0
jbe    1528 <Gaussrandom+0x418>
jmp    1276 <Gaussrandom+0x166>
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x2f09(%rip)
movsd  0x2f11(%rip),%xmm0
ucomisd 0x2ef9(%rip),%xmm0
jb     1552 <Gaussrandom+0x442>
jmp    14ee <Gaussrandom+0x3de>
mov    $0x0,%al
call   1030 <sre_random@plt>
movsd  %xmm0,0x2edf(%rip)
jmp    1495 <Gaussrandom+0x385>

x86 assembly (clang, -O2):
<Gaussrandom>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <sre_random@plt>
movapd %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
cmpltsd %xmm1,%xmm0
movsd  0xec5(%rip),%xmm2
andpd  %xmm0,%xmm2
movlpd %xmm2,0x2ee9(%rip)
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xead(%rip),%xmm0
cvttsd2si %xmm0,%rcx
cmp    $0x20,%rcx
mov    $0x1f,%eax
cmovne %rcx,%rax
mov    %rax,0x2eb4(%rip)
test   %rax,%rax
je     127b <Gaussrandom+0x16b>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2ea7(%rip)
lea    0xea0(%rip),%rbx
movsd  -0x8(%rbx,%rax,8),%xmm1
movsd  %xmm1,0x2e9a(%rip)
lea    0x108b(%rip),%r14
movsd  -0x8(%r14,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
jb     12f5 <Gaussrandom+0x1e5>
xor    %eax,%eax
call   1030 <sre_random@plt>
mov    0x2e5c(%rip),%rax
movsd  (%rbx,%rax,8),%xmm1
movsd  0x2e67(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x2e5f(%rip)
movapd %xmm1,%xmm0
mulsd  0xe03(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2e4b(%rip)
movsd  0x2e2b(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     130e <Gaussrandom+0x1fe>
nop
xor    %eax,%eax
call   1030 <sre_random@plt>
movsd  0x2e11(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     1260 <Gaussrandom+0x150>
movsd  %xmm0,0x2e1b(%rip)
xor    %eax,%eax
call   1030 <sre_random@plt>
movsd  %xmm0,0x2df4(%rip)
ucomisd 0x2e04(%rip),%xmm0
jbe    1220 <Gaussrandom+0x110>
jmp    130e <Gaussrandom+0x1fe>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sre_random@plt>
movsd  %xmm0,0x2dd1(%rip)
mov    0x2dba(%rip),%rax
jmp    11b5 <Gaussrandom+0xa5>
movq   $0x6,0x2daa(%rip)
movabs $0x40013b22d0e56042,%rax
3b 01 40
mov    %rax,0x2db1(%rip)
addsd  %xmm0,%xmm0
movsd  0xd65(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1363 <Gaussrandom+0x253>
movsd  0xd63(%rip),%xmm2
mov    $0x6,%eax
lea    0xe7f(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  -0x8(%rcx,%rax,8),%xmm2
add    $0x1,%rax
addsd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
ja     12d0 <Gaussrandom+0x1c0>
movsd  %xmm2,0x2d5c(%rip)
mov    %rax,0x2d3d(%rip)
jmp    1370 <Gaussrandom+0x260>
subsd  %xmm1,%xmm0
lea    0x1040(%rip),%rcx
mulsd  -0x8(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x2d42(%rip)
movsd  0x2d32(%rip),%xmm0
addsd  0x2d32(%rip),%xmm0
movapd 0xd0a(%rip),%xmm1
xorpd  %xmm0,%xmm1
movsd  0xcd6(%rip),%xmm2
cmpeqsd 0x2cfd(%rip),%xmm2
movapd %xmm2,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm1,%xmm2
orpd   %xmm3,%xmm2
movsd  0x10(%rsp),%xmm0
mulsd  %xmm2,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x6,%eax
movsd  0xca8(%rip),%xmm2
addsd  0xca8(%rip),%xmm0
lea    0xdc1(%rip),%rbx
mulsd  -0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x2cc3(%rip)
movapd %xmm0,%xmm1
mulsd  0xc67(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,0x2ca0(%rip)
xor    %eax,%eax
call   1030 <sre_random@plt>
movsd  %xmm0,0x2c79(%rip)
ucomisd 0x2c89(%rip),%xmm0
ja     130e <Gaussrandom+0x1fe>
xor    %eax,%eax
call   1030 <sre_random@plt>
movapd %xmm0,%xmm1
movsd  0x2c58(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    13b0 <Gaussrandom+0x2a0>
xor    %eax,%eax
call   1030 <sre_random@plt>
mov    0x2c34(%rip),%rax
movsd  0x2c44(%rip),%xmm2
jmp    137f <Gaussrandom+0x26f>

LLVM IR (-O0):
@Gaussrandom.a = internal global [32 x double] [double 0.000000e+00, double 0x3FA40EE372AB9920, double 0x3FB412D5F08CF069, double 1.177700e-01, double 0x3FC422C1CBE7CA7F, double 0x3FC93A8B164917A1, double 0x3FCE5CA36F057159, double 0x3FD1C5ADF49A7130, double 0x3FD46496828DE45A, double 3.601300e-01, double 0x3FD9BE77341403C3, double 0x3FDC7C7607C419A0, double 0x3FDF481CCF439F92, double 0x3FE111B1381BD040, double 0x3FE288404061EFDF, double 6.260990e-01, double 0x3FE5956BA20F89E1, double 0x3FE72F38D2AF64DD, double 0x3FE8D87287DCD8B4, double 0x3FEA938B984F16BF, double 0x3FEC638144383E35, double 0x3FEE4C09586E561F, double 1.009990e+00, double 0x3FF13D816ACEAAF3, double 0x3FF267D45A5FC7E7, double 0x3FF3AD80A17B0F6B, double 0x3FF51692B3CC4AC7, double 0x3FF6AF4BE835DEDF, double 0x3FF88BC27631B585, double 1.675940e+00, double 0x3FFDCDC011D3671B, double 0x40013B22D0E56042]
@Gaussrandom.d = internal global [31 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0x3FD0E0341D3DFE68, double 0x3FCF0A84BE40420F, double 0x3FCCDF647F05999D, double 0x3FCB16D457DB8928, double 0x3FC9971E95167D1A, double 0x3FC84EFF41941F06, double 0x3FC73263299B03FD, double 0x3FC6389217C518A3, double 0x3FC55B134C0D1ECC, double 0x3FC494FC7BE7012B, double 0x3FC3E27FBC78C1B3, double 0x3FC3409D7F0167DF, double 0x3FC2ACEFB7B36014, double 1.417700e-01, double 0x3FC1A8C7340697CA, double 0x3FC135638F1B9156, double 0x3FC0CA402A927AC1, double 1.281260e-01, double 0x3FC0092542AFA7F9, double 0x3FBF636D8DA21492, double 0x3FBEBF1C0A21C1F2, double 0x3FBE2451EEE01D0C, double 0x3FBD923018CC7FA0, double 0x3FBD07EEE1CA8AD3, double 0x3FBC84E3292FA432, double 0x3FBC08729548D201]
@Gaussrandom.t = internal global [31 x double] [double 0x3F49254603C71439, double 2.306870e-03, double 0x3F6FA04D81ACD7A9, double 0x3F7646A1E121FF95, double 7.050700e-03, double 0x3F81D5B5202A395C, double 0x3F8558F3E20F7F24, double 0x3F89014F60657072, double 0x3F8CD6A161E4F766, double 0x3F9070EDD3D884BC, double 1.815290e-02, double 0x3F94E29E454FEB50, double 0x3F975BF7F8749B5D, double 0x3F9A0B638B6AACC7, double 0x3F9CFB737E51EA83, double 0x3FA01C9A3F86D399, double 0x3FA1EA83C1EBF32E, double 0x3FA3F1E331BE1321, double 0x3FA6403AADA5EB0C, double 0x3FA8E76351083050, double 0x3FABFF7469DF41C4, double 0x3FAFA9C890D2F688, double 0x3FB20AF754E0ACFE, double 0x3FB4C5103FE9241B, double 0x3FB8394EAB33CADE, double 0x3FBCBFB308D66857, double 1.364980e-01, double 0x3FC5F9E45D0C4A91, double 0x3FCD22C958A40604, double 3.304980e-01, double 0x3FE2B5E3468BD58C]
@Gaussrandom.h = internal global [31 x double] [double 0x3FA412D4C3E7200A, double 0x3FA422ACD332419C, double 3.951000e-02, double 0x3FA45B088F45ADB4, double 0x3FA4842D4BBD98A7, double 0x3FA4B68F9E9907CE, double 0x3FA4F2C935BE7DD5, double 0x3FA5399953CE893A, double 0x3FA58BEADA53F3F3, double 0x3FA5EADCAD3F93BF, double 0x3FA657CD71626DDE, double 0x3FA6D4694E4D3FFA, double 0x3FA762BE662CAFB6, double 0x3FA80556003CBBC8, double 0x3FA8BF591BD0152C, double 0x3FA994BF6A38ADF1, double 0x3FAA8A967171067D, double 0x3FABA7612D6C74C8, double 0x3FACF3ABB3CD776D, double 5.953130e-02, double 0x3FB02654D36BF84C, double 0x3FB13F7D6E6AC1C0, double 0x3FB298E43D00E75C, double 0x3FB44AB1292D4AE7, double 0x3FB67B5205DC37FA, double 0x3FB96BFC52766F73, double 1.155600e-01, double 0x3FC1F9C1219DDF79, double 0x3FC780AB8C0A64DE, double 0x3FD1DB2986E206F1, double 0x3FE66EFAF4FE443E]
@Gaussrandom.i = internal global i64 0
@Gaussrandom.snorm = internal global double 0.000000e+00
@Gaussrandom.u = internal global double 0.000000e+00
@Gaussrandom.s = internal global double 0.000000e+00
@Gaussrandom.ustar = internal global double 0.000000e+00
@Gaussrandom.aa = internal global double 0.000000e+00
@Gaussrandom.w = internal global double 0.000000e+00
@Gaussrandom.y = internal global double 0.000000e+00
@Gaussrandom.tt = internal global double 0.000000e+00
define double @Gaussrandom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @sre_random()
store double %5, double* @Gaussrandom.u
store double 0.000000e+00, double* @Gaussrandom.s
%6 = load double, double* @Gaussrandom.u
%7 = fcmp ogt double %6, 5.000000e-01
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* @Gaussrandom.s
br label %9
9: ; preds = %8, %2
%10 = load double, double* @Gaussrandom.u
%11 = load double, double* @Gaussrandom.s
%12 = fsub double %10, %11
%13 = load double, double* @Gaussrandom.u
%14 = fadd double %13, %12
store double %14, double* @Gaussrandom.u
%15 = load double, double* @Gaussrandom.u
%16 = fmul double 3.200000e+01, %15
store double %16, double* @Gaussrandom.u
%17 = load double, double* @Gaussrandom.u
%18 = fptosi double %17 to i64
store i64 %18, i64* @Gaussrandom.i
%19 = load i64, i64* @Gaussrandom.i
%20 = icmp eq i64 %19, 32
br i1 %20, label %21, label %22
21: ; preds = %9
store i64 31, i64* @Gaussrandom.i
br label %22
22: ; preds = %21, %9
%23 = load i64, i64* @Gaussrandom.i
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
br label %100
26: ; preds = %22
%27 = load double, double* @Gaussrandom.u
%28 = load i64, i64* @Gaussrandom.i
%29 = sitofp i64 %28 to double
%30 = fsub double %27, %29
store double %30, double* @Gaussrandom.ustar
%31 = load i64, i64* @Gaussrandom.i
%32 = getelementptr inbounds double, double* getelementptr inbounds ([32 x double], [32 x double]* @Gaussrandom.a, i64 0, i64 0), i64 %31
%33 = getelementptr inbounds double, double* %32, i64 -1
%34 = load double, double* %33
store double %34, double* @Gaussrandom.aa
br label %35
35: ; preds = %98, %26
%36 = load double, double* @Gaussrandom.ustar
%37 = load i64, i64* @Gaussrandom.i
%38 = getelementptr inbounds double, double* getelementptr inbounds ([31 x double], [31 x double]* @Gaussrandom.t, i64 0, i64 0), i64 %37
%39 = getelementptr inbounds double, double* %38, i64 -1
%40 = load double, double* %39
%41 = fcmp ole double %36, %40
br i1 %41, label %42, label %43
42: ; preds = %35
br label %70
43: ; preds = %35
%44 = load double, double* @Gaussrandom.ustar
%45 = load i64, i64* @Gaussrandom.i
%46 = getelementptr inbounds double, double* getelementptr inbounds ([31 x double], [31 x double]* @Gaussrandom.t, i64 0, i64 0), i64 %45
%47 = getelementptr inbounds double, double* %46, i64 -1
%48 = load double, double* %47
%49 = fsub double %44, %48
%50 = load i64, i64* @Gaussrandom.i
%51 = getelementptr inbounds double, double* getelementptr inbounds ([31 x double], [31 x double]* @Gaussrandom.h, i64 0, i64 0), i64 %50
%52 = getelementptr inbounds double, double* %51, i64 -1
%53 = load double, double* %52
%54 = fmul double %49, %53
store double %54, double* @Gaussrandom.w
br label %55
55: ; preds = %140, %91, %43
%56 = load double, double* @Gaussrandom.aa
%57 = load double, double* @Gaussrandom.w
%58 = fadd double %56, %57
store double %58, double* @Gaussrandom.y
%59 = load double, double* @Gaussrandom.y
store double %59, double* @Gaussrandom.snorm
%60 = load double, double* @Gaussrandom.s
%61 = fcmp oeq double %60, 1.000000e+00
br i1 %61, label %62, label %65
62: ; preds = %55
%63 = load double, double* @Gaussrandom.y
%64 = fneg double %63
store double %64, double* @Gaussrandom.snorm
br label %65
65: ; preds = %62, %55
%66 = load double, double* %4
%67 = load double, double* @Gaussrandom.snorm
%68 = load double, double* %3
%69 = call double @llvm.fmuladd.f64(double %66, double %67, double %68)
ret double %69
70: ; preds = %42
%71 = call double (...) @sre_random()
store double %71, double* @Gaussrandom.u
%72 = load double, double* @Gaussrandom.u
%73 = load i64, i64* @Gaussrandom.i
%74 = getelementptr inbounds double, double* getelementptr inbounds ([32 x double], [32 x double]* @Gaussrandom.a, i64 0, i64 0), i64 %73
%75 = load double, double* %74
%76 = load double, double* @Gaussrandom.aa
%77 = fsub double %75, %76
%78 = fmul double %72, %77
store double %78, double* @Gaussrandom.w
%79 = load double, double* @Gaussrandom.w
%80 = load double, double* @Gaussrandom.aa
%81 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %79, double %80)
%82 = load double, double* @Gaussrandom.w
%83 = fmul double %81, %82
store double %83, double* @Gaussrandom.tt
br label %87
84: ; preds = %97
%85 = load double, double* @Gaussrandom.u
store double %85, double* @Gaussrandom.tt
%86 = call double (...) @sre_random()
store double %86, double* @Gaussrandom.ustar
br label %87
87: ; preds = %84, %70
%88 = load double, double* @Gaussrandom.ustar
%89 = load double, double* @Gaussrandom.tt
%90 = fcmp ogt double %88, %89
br i1 %90, label %91, label %92
91: ; preds = %87
br label %55
92: ; preds = %87
%93 = call double (...) @sre_random()
store double %93, double* @Gaussrandom.u
%94 = load double, double* @Gaussrandom.ustar
%95 = load double, double* @Gaussrandom.u
%96 = fcmp oge double %94, %95
br i1 %96, label %97, label %98
97: ; preds = %92
br label %84
98: ; preds = %92
%99 = call double (...) @sre_random()
store double %99, double* @Gaussrandom.ustar
br label %35
100: ; preds = %25
store i64 6, i64* @Gaussrandom.i
%101 = load double, double* getelementptr inbounds ([32 x double], [32 x double]* @Gaussrandom.a, i64 0, i64 31)
store double %101, double* @Gaussrandom.aa
br label %111
102: ; preds = %117
%103 = load i64, i64* @Gaussrandom.i
%104 = getelementptr inbounds double, double* getelementptr inbounds ([31 x double], [31 x double]* @Gaussrandom.d, i64 0, i64 0), i64 %103
%105 = getelementptr inbounds double, double* %104, i64 -1
%106 = load double, double* %105
%107 = load double, double* @Gaussrandom.aa
%108 = fadd double %107, %106
store double %108, double* @Gaussrandom.aa
%109 = load i64, i64* @Gaussrandom.i
%110 = add nsw i64 %109, 1
store i64 %110, i64* @Gaussrandom.i
br label %111
111: ; preds = %102, %100
%112 = load double, double* @Gaussrandom.u
%113 = load double, double* @Gaussrandom.u
%114 = fadd double %113, %112
store double %114, double* @Gaussrandom.u
%115 = load double, double* @Gaussrandom.u
%116 = fcmp olt double %115, 1.000000e+00
br i1 %116, label %117, label %118
117: ; preds = %111
br label %102
118: ; preds = %111
%119 = load double, double* @Gaussrandom.u
%120 = fsub double %119, 1.000000e+00
store double %120, double* @Gaussrandom.u
br label %121
121: ; preds = %147, %118
%122 = load double, double* @Gaussrandom.u
%123 = load i64, i64* @Gaussrandom.i
%124 = getelementptr inbounds double, double* getelementptr inbounds ([31 x double], [31 x double]* @Gaussrandom.d, i64 0, i64 0), i64 %123
%125 = getelementptr inbounds double, double* %124, i64 -1
%126 = load double, double* %125
%127 = fmul double %122, %126
store double %127, double* @Gaussrandom.w
%128 = load double, double* @Gaussrandom.w
%129 = load double, double* @Gaussrandom.aa
%130 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %128, double %129)
%131 = load double, double* @Gaussrandom.w
%132 = fmul double %130, %131
store double %132, double* @Gaussrandom.tt
br label %135
133: ; preds = %146
%134 = load double, double* @Gaussrandom.u
store double %134, double* @Gaussrandom.tt
br label %135
135: ; preds = %133, %121
%136 = call double (...) @sre_random()
store double %136, double* @Gaussrandom.ustar
%137 = load double, double* @Gaussrandom.ustar
%138 = load double, double* @Gaussrandom.tt
%139 = fcmp ogt double %137, %138
br i1 %139, label %140, label %141
140: ; preds = %135
br label %55
141: ; preds = %135
%142 = call double (...) @sre_random()
store double %142, double* @Gaussrandom.u
%143 = load double, double* @Gaussrandom.ustar
%144 = load double, double* @Gaussrandom.u
%145 = fcmp oge double %143, %144
br i1 %145, label %146, label %147
146: ; preds = %141
br label %133
147: ; preds = %141
%148 = call double (...) @sre_random()
store double %148, double* @Gaussrandom.u
br label %121
}

LLVM IR (-O2):
@Gaussrandom.a = internal unnamed_addr constant [32 x double] [double 0.000000e+00, double 0x3FA40EE372AB9920, double 0x3FB412D5F08CF069, double 1.177700e-01, double 0x3FC422C1CBE7CA7F, double 0x3FC93A8B164917A1, double 0x3FCE5CA36F057159, double 0x3FD1C5ADF49A7130, double 0x3FD46496828DE45A, double 3.601300e-01, double 0x3FD9BE77341403C3, double 0x3FDC7C7607C419A0, double 0x3FDF481CCF439F92, double 0x3FE111B1381BD040, double 0x3FE288404061EFDF, double 6.260990e-01, double 0x3FE5956BA20F89E1, double 0x3FE72F38D2AF64DD, double 0x3FE8D87287DCD8B4, double 0x3FEA938B984F16BF, double 0x3FEC638144383E35, double 0x3FEE4C09586E561F, double 1.009990e+00, double 0x3FF13D816ACEAAF3, double 0x3FF267D45A5FC7E7, double 0x3FF3AD80A17B0F6B, double 0x3FF51692B3CC4AC7, double 0x3FF6AF4BE835DEDF, double 0x3FF88BC27631B585, double 1.675940e+00, double 0x3FFDCDC011D3671B, double 0x40013B22D0E56042]
@Gaussrandom.d = internal unnamed_addr constant [31 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0x3FD0E0341D3DFE68, double 0x3FCF0A84BE40420F, double 0x3FCCDF647F05999D, double 0x3FCB16D457DB8928, double 0x3FC9971E95167D1A, double 0x3FC84EFF41941F06, double 0x3FC73263299B03FD, double 0x3FC6389217C518A3, double 0x3FC55B134C0D1ECC, double 0x3FC494FC7BE7012B, double 0x3FC3E27FBC78C1B3, double 0x3FC3409D7F0167DF, double 0x3FC2ACEFB7B36014, double 1.417700e-01, double 0x3FC1A8C7340697CA, double 0x3FC135638F1B9156, double 0x3FC0CA402A927AC1, double 1.281260e-01, double 0x3FC0092542AFA7F9, double 0x3FBF636D8DA21492, double 0x3FBEBF1C0A21C1F2, double 0x3FBE2451EEE01D0C, double 0x3FBD923018CC7FA0, double 0x3FBD07EEE1CA8AD3, double 0x3FBC84E3292FA432, double 0x3FBC08729548D201]
@Gaussrandom.t = internal unnamed_addr constant [31 x double] [double 0x3F49254603C71439, double 2.306870e-03, double 0x3F6FA04D81ACD7A9, double 0x3F7646A1E121FF95, double 7.050700e-03, double 0x3F81D5B5202A395C, double 0x3F8558F3E20F7F24, double 0x3F89014F60657072, double 0x3F8CD6A161E4F766, double 0x3F9070EDD3D884BC, double 1.815290e-02, double 0x3F94E29E454FEB50, double 0x3F975BF7F8749B5D, double 0x3F9A0B638B6AACC7, double 0x3F9CFB737E51EA83, double 0x3FA01C9A3F86D399, double 0x3FA1EA83C1EBF32E, double 0x3FA3F1E331BE1321, double 0x3FA6403AADA5EB0C, double 0x3FA8E76351083050, double 0x3FABFF7469DF41C4, double 0x3FAFA9C890D2F688, double 0x3FB20AF754E0ACFE, double 0x3FB4C5103FE9241B, double 0x3FB8394EAB33CADE, double 0x3FBCBFB308D66857, double 1.364980e-01, double 0x3FC5F9E45D0C4A91, double 0x3FCD22C958A40604, double 3.304980e-01, double 0x3FE2B5E3468BD58C]
@Gaussrandom.h = internal unnamed_addr constant [31 x double] [double 0x3FA412D4C3E7200A, double 0x3FA422ACD332419C, double 3.951000e-02, double 0x3FA45B088F45ADB4, double 0x3FA4842D4BBD98A7, double 0x3FA4B68F9E9907CE, double 0x3FA4F2C935BE7DD5, double 0x3FA5399953CE893A, double 0x3FA58BEADA53F3F3, double 0x3FA5EADCAD3F93BF, double 0x3FA657CD71626DDE, double 0x3FA6D4694E4D3FFA, double 0x3FA762BE662CAFB6, double 0x3FA80556003CBBC8, double 0x3FA8BF591BD0152C, double 0x3FA994BF6A38ADF1, double 0x3FAA8A967171067D, double 0x3FABA7612D6C74C8, double 0x3FACF3ABB3CD776D, double 5.953130e-02, double 0x3FB02654D36BF84C, double 0x3FB13F7D6E6AC1C0, double 0x3FB298E43D00E75C, double 0x3FB44AB1292D4AE7, double 0x3FB67B5205DC37FA, double 0x3FB96BFC52766F73, double 1.155600e-01, double 0x3FC1F9C1219DDF79, double 0x3FC780AB8C0A64DE, double 0x3FD1DB2986E206F1, double 0x3FE66EFAF4FE443E]
@Gaussrandom.i = internal unnamed_addr global i64 0
@Gaussrandom.s = internal unnamed_addr global double 0.000000e+00
@Gaussrandom.ustar = internal unnamed_addr global double 0.000000e+00
@Gaussrandom.aa = internal unnamed_addr global double 0.000000e+00
@Gaussrandom.w = internal unnamed_addr global double 0.000000e+00
@Gaussrandom.tt = internal unnamed_addr global double 0.000000e+00
define double @Gaussrandom(double %0, double %1) {
%3 = tail call double (...) @sre_random()
%4 = fcmp ogt double %3, 5.000000e-01
%5 = select i1 %4, double 1.000000e+00, double 0.000000e+00
store double %5, double* @Gaussrandom.s
%6 = fsub double %3, %5
%7 = fadd double %3, %6
%8 = fmul double %7, 3.200000e+01
%9 = fptosi double %8 to i64
%10 = icmp eq i64 %9, 32
%11 = select i1 %10, i64 31, i64 %9
store i64 %11, i64* @Gaussrandom.i
%12 = icmp eq i64 %11, 0
br i1 %12, label %68, label %13
13: ; preds = %2
%14 = sitofp i64 %11 to double
%15 = fsub double %8, %14
store double %15, double* @Gaussrandom.ustar
%16 = getelementptr inbounds [32 x double], [32 x double]* @Gaussrandom.a, i64 0, i64 %11
%17 = getelementptr inbounds double, double* %16, i64 -1
%18 = load double, double* %17
store double %18, double* @Gaussrandom.aa
%19 = getelementptr inbounds [31 x double], [31 x double]* @Gaussrandom.t, i64 0, i64 %11
%20 = getelementptr inbounds double, double* %19, i64 -1
%21 = load double, double* %20
%22 = fcmp ugt double %15, %21
br i1 %22, label %23, label %41
23: ; preds = %61, %13
%24 = phi double [ %15, %13 ], [ %62, %61 ]
%25 = phi i64 [ %11, %13 ], [ %63, %61 ]
%26 = phi double [ %21, %13 ], [ %66, %61 ]
%27 = fsub double %24, %26
%28 = getelementptr inbounds [31 x double], [31 x double]* @Gaussrandom.h, i64 0, i64 %25
%29 = getelementptr inbounds double, double* %28, i64 -1
%30 = load double, double* %29
%31 = fmul double %27, %30
store double %31, double* @Gaussrandom.w
br label %32
32: ; preds = %41, %57, %98, %23
%33 = load double, double* @Gaussrandom.aa
%34 = load double, double* @Gaussrandom.w
%35 = fadd double %33, %34
%36 = load double, double* @Gaussrandom.s
%37 = fcmp oeq double %36, 1.000000e+00
%38 = fneg double %35
%39 = select i1 %37, double %38, double %35
%40 = tail call double @llvm.fmuladd.f64(double %1, double %39, double %0)
ret double %40
41: ; preds = %13, %61
%42 = tail call double (...) @sre_random()
%43 = load i64, i64* @Gaussrandom.i
%44 = getelementptr inbounds [32 x double], [32 x double]* @Gaussrandom.a, i64 0, i64 %43
%45 = load double, double* %44
%46 = load double, double* @Gaussrandom.aa
%47 = fsub double %45, %46
%48 = fmul double %42, %47
store double %48, double* @Gaussrandom.w
%49 = tail call double @llvm.fmuladd.f64(double %48, double 5.000000e-01, double %46)
%50 = fmul double %48, %49
store double %50, double* @Gaussrandom.tt
%51 = load double, double* @Gaussrandom.ustar
%52 = fcmp ogt double %51, %50
br i1 %52, label %32, label %53
53: ; preds = %41, %57
%54 = tail call double (...) @sre_random()
%55 = load double, double* @Gaussrandom.ustar
%56 = fcmp ult double %55, %54
br i1 %56, label %61, label %57
57: ; preds = %53
store double %54, double* @Gaussrandom.tt
%58 = tail call double (...) @sre_random()
store double %58, double* @Gaussrandom.ustar
%59 = load double, double* @Gaussrandom.tt
%60 = fcmp ogt double %58, %59
br i1 %60, label %32, label %53
61: ; preds = %53
%62 = tail call double (...) @sre_random()
store double %62, double* @Gaussrandom.ustar
%63 = load i64, i64* @Gaussrandom.i
%64 = getelementptr inbounds [31 x double], [31 x double]* @Gaussrandom.t, i64 0, i64 %63
%65 = getelementptr inbounds double, double* %64, i64 -1
%66 = load double, double* %65
%67 = fcmp ugt double %62, %66
br i1 %67, label %23, label %41
68: ; preds = %2
store i64 6, i64* @Gaussrandom.i
store double 0x40013B22D0E56042, double* @Gaussrandom.aa
%69 = fadd double %8, %8
%70 = fcmp olt double %69, 1.000000e+00
br i1 %70, label %71, label %83
71: ; preds = %68, %71
%72 = phi double [ %80, %71 ], [ %69, %68 ]
%73 = phi i64 [ %79, %71 ], [ 6, %68 ]
%74 = phi double [ %78, %71 ], [ 0x40013B22D0E56042, %68 ]
%75 = getelementptr inbounds [31 x double], [31 x double]* @Gaussrandom.d, i64 0, i64 %73
%76 = getelementptr inbounds double, double* %75, i64 -1
%77 = load double, double* %76
%78 = fadd double %77, %74
%79 = add nuw nsw i64 %73, 1
%80 = fadd double %72, %72
%81 = fcmp olt double %80, 1.000000e+00
br i1 %81, label %71, label %82
82: ; preds = %71
store double %78, double* @Gaussrandom.aa
store i64 %79, i64* @Gaussrandom.i
br label %83
83: ; preds = %82, %68
%84 = phi double [ %78, %82 ], [ 0x40013B22D0E56042, %68 ]
%85 = phi i64 [ %79, %82 ], [ 6, %68 ]
%86 = phi double [ %80, %82 ], [ %69, %68 ]
%87 = fadd double %86, -1.000000e+00
br label %88
88: ; preds = %107, %83
%89 = phi double [ %84, %83 ], [ %110, %107 ]
%90 = phi i64 [ %85, %83 ], [ %109, %107 ]
%91 = phi double [ %87, %83 ], [ %108, %107 ]
%92 = getelementptr inbounds [31 x double], [31 x double]* @Gaussrandom.d, i64 0, i64 %90
%93 = getelementptr inbounds double, double* %92, i64 -1
%94 = load double, double* %93
%95 = fmul double %91, %94
store double %95, double* @Gaussrandom.w
%96 = tail call double @llvm.fmuladd.f64(double %95, double 5.000000e-01, double %89)
%97 = fmul double %95, %96
br label %98
98: ; preds = %103, %88
%99 = phi double [ %97, %88 ], [ %104, %103 ]
store double %99, double* @Gaussrandom.tt
%100 = tail call double (...) @sre_random()
store double %100, double* @Gaussrandom.ustar
%101 = load double, double* @Gaussrandom.tt
%102 = fcmp ogt double %100, %101
br i1 %102, label %32, label %103
103: ; preds = %98
%104 = tail call double (...) @sre_random()
%105 = load double, double* @Gaussrandom.ustar
%106 = fcmp ult double %105, %104
br i1 %106, label %107, label %98
107: ; preds = %103
%108 = tail call double (...) @sre_random()
%109 = load i64, i64* @Gaussrandom.i
%110 = load double, double* @Gaussrandom.aa
br label %88
}