#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 exp(float);
float floor(float);
float log(float);
float sqrt(double);
float tan(double);
float poidev(float xm, long *idum) {
  float gammln(float xx);
  float ran1(long *idum);
  static float sq, alxm, g, oldm = (-1.0);
  float em, t, y;
  if (xm < 12.0) {
    if (xm != oldm) {
      oldm = xm;
      g = exp(-xm);
    }
    em = -1;
    t = 1.0;
    do {
      ++em;
      t *= ran1(idum);
    } while (t > g);
  } else {
    if (xm != oldm) {
      oldm = xm;
      sq = sqrt(2.0 * xm);
      alxm = log(xm);
      g = xm * alxm - gammln(xm + 1.0);
    }
    do {
      do {
        y = tan(3.141592654 * ran1(idum));
        em = sq * y + xm;
      } while (em < 0.0);
      em = floor(em);
      t = 0.9 * (1.0 + y * y) * exp(em * alxm - gammln(em + 1.0) - g);
    } while (ran1(idum) > t);
  }
  return em;
}


x86 assembly (clang, -O0):
<poidev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    123f <poidev+0xcf>
movss  -0x4(%rbp),%xmm0
ucomiss 0x2eb0(%rip),%xmm0
jne    11b9 <poidev+0x49>
jp     11b9 <poidev+0x49>
jmp    11e9 <poidev+0x79>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,0x2e92(%rip)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2e7f(%rip)
movss  0xe3b(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe2a(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe1d(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ran1@plt>
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
ucomiss 0x2e34(%rip),%xmm0
ja     1203 <poidev+0x93>
jmp    1429 <poidev+0x2b9>
movss  -0x4(%rbp),%xmm0
ucomiss 0x2e0d(%rip),%xmm0
jne    125c <poidev+0xec>
jp     125c <poidev+0xec>
jmp    12fc <poidev+0x18c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,0x2def(%rip)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd96(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,0x2dd5(%rip)
movss  -0x4(%rbp),%xmm0
call   1060 <log@plt>
movss  %xmm0,0x2dc7(%rip)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0x2db5(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd43(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <gammln@plt>
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x2d6c(%rip)
jmp    1301 <poidev+0x191>
jmp    1306 <poidev+0x196>
mov    -0x10(%rbp),%rdi
call   1050 <ran1@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xcfd(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <tan@plt>
movss  %xmm0,-0x1c(%rbp)
movss  0x2d2f(%rip),%xmm0
movss  -0x1c(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1306 <poidev+0x196>
movss  -0x14(%rbp),%xmm0
call   1090 <floor@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc85(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xc91(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  0x2cba(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc48(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <gammln@plt>
movss  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
subss  0x2c71(%rip),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ran1@plt>
ucomiss -0x18(%rbp),%xmm0
ja     1301 <poidev+0x191>
jmp    1429 <poidev+0x2b9>
movss  -0x14(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poidev>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movaps %xmm0,%xmm1
movss  0xe7d(%rip),%xmm0
ucomiss %xmm1,%xmm0
movss  0x2eca(%rip),%xmm0
jbe    120a <poidev+0x9a>
ucomiss %xmm1,%xmm0
jne    1197 <poidev+0x27>
jnp    11ba <poidev+0x4a>
movss  %xmm1,0x2eb9(%rip)
xorps  0xe8a(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <exp@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2eae(%rip)
movss  0xe46(%rip),%xmm0
movss  0xe3a(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movss  %xmm1,0x20(%rsp)
addss  0xe26(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1060 <ran1@plt>
movss  0x20(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
ucomiss 0x2e65(%rip),%xmm1
ja     11d0 <poidev+0x60>
jmp    1354 <poidev+0x1e4>
ucomiss %xmm1,%xmm0
movaps %xmm1,0x20(%rsp)
jne    1216 <poidev+0xa6>
jnp    1280 <poidev+0x110>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movss  %xmm1,0x2e33(%rip)
addsd  %xmm0,%xmm0
call   1080 <sqrt@plt>
movss  %xmm0,0x2e2a(%rip)
movaps 0x20(%rsp),%xmm0
call   1070 <log@plt>
movss  %xmm0,0xc(%rsp)
movss  %xmm0,0x2e16(%rip)
movss  0xdae(%rip),%xmm0
addss  0x20(%rsp),%xmm0
call   1090 <gammln@plt>
movss  0xc(%rsp),%xmm1
mulss  0x20(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x2def(%rip)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <ran1@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xd7c(%rip),%xmm0
call   1050 <tan@plt>
movapd %xmm0,%xmm2
movss  0x2dbb(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  0x20(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1280 <poidev+0x110>
movss  %xmm2,0xc(%rsp)
call   1030 <floorf@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xd3d(%rip),%xmm0
mulsd  0xd3d(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
addss  0xd10(%rip),%xmm0
movss  0x2d68(%rip),%xmm2
movss  %xmm1,0xc(%rsp)
mulss  %xmm1,%xmm2
movss  %xmm2,0x1c(%rsp)
call   1090 <gammln@plt>
movss  0x1c(%rsp),%xmm1
subss  %xmm0,%xmm1
subss  0x2d45(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
call   1060 <ran1@plt>
ucomiss 0x10(%rsp),%xmm0
ja     1280 <poidev+0x110>
movss  0xc(%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@poidev.sq = internal global float 0.000000e+00
@poidev.alxm = internal global float 0.000000e+00
@poidev.g = internal global float 0.000000e+00
@poidev.oldm = internal global float -1.000000e+00
define float @poidev(float %0, i64* %1) {
%3 = alloca float
%4 = alloca i64*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store i64* %1, i64** %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 1.200000e+01
br i1 %10, label %11, label %34
11: ; preds = %2
%12 = load float, float* %3
%13 = load float, float* @poidev.oldm
%14 = fcmp une float %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load float, float* %3
store float %16, float* @poidev.oldm
%17 = load float, float* %3
%18 = fneg float %17
%19 = call double @exp(float %18)
%20 = fptrunc double %19 to float
store float %20, float* @poidev.g
br label %21
21: ; preds = %15, %11
store float -1.000000e+00, float* %5
store float 1.000000e+00, float* %6
br label %22
22: ; preds = %29, %21
%23 = load float, float* %5
%24 = fadd float %23, 1.000000e+00
store float %24, float* %5
%25 = load i64*, i64** %4
%26 = call float @ran1(i64* %25)
%27 = load float, float* %6
%28 = fmul float %27, %26
store float %28, float* %6
br label %29
29: ; preds = %22
%30 = load float, float* %6
%31 = load float, float* @poidev.g
%32 = fcmp ogt float %30, %31
br i1 %32, label %22, label %33
33: ; preds = %29
br label %100
34: ; preds = %2
%35 = load float, float* %3
%36 = load float, float* @poidev.oldm
%37 = fcmp une float %35, %36
br i1 %37, label %38, label %55
38: ; preds = %34
%39 = load float, float* %3
store float %39, float* @poidev.oldm
%40 = load float, float* %3
%41 = fpext float %40 to double
%42 = fmul double 2.000000e+00, %41
%43 = call float @sqrt(double %42)
store float %43, float* @poidev.sq
%44 = load float, float* %3
%45 = call float @log(float %44)
store float %45, float* @poidev.alxm
%46 = load float, float* %3
%47 = load float, float* @poidev.alxm
%48 = load float, float* %3
%49 = fpext float %48 to double
%50 = fadd double %49, 1.000000e+00
%51 = fptrunc double %50 to float
%52 = call float @gammln(float %51)
%53 = fneg float %52
%54 = call float @llvm.fmuladd.f32(float %46, float %47, float %53)
store float %54, float* @poidev.g
br label %55
55: ; preds = %38, %34
br label %56
56: ; preds = %94, %55
br label %57
57: ; preds = %67, %56
%58 = load i64*, i64** %4
%59 = call float @ran1(i64* %58)
%60 = fpext float %59 to double
%61 = fmul double 0x400921FB54524550, %60
%62 = call float @tan(double %61)
store float %62, float* %7
%63 = load float, float* @poidev.sq
%64 = load float, float* %7
%65 = load float, float* %3
%66 = call float @llvm.fmuladd.f32(float %63, float %64, float %65)
store float %66, float* %5
br label %67
67: ; preds = %57
%68 = load float, float* %5
%69 = fpext float %68 to double
%70 = fcmp olt double %69, 0.000000e+00
br i1 %70, label %57, label %71
71: ; preds = %67
%72 = load float, float* %5
%73 = call float @floor(float %72)
store float %73, float* %5
%74 = load float, float* %7
%75 = load float, float* %7
%76 = fmul float %74, %75
%77 = fpext float %76 to double
%78 = fadd double 1.000000e+00, %77
%79 = fmul double 9.000000e-01, %78
%80 = load float, float* %5
%81 = load float, float* @poidev.alxm
%82 = load float, float* %5
%83 = fpext float %82 to double
%84 = fadd double %83, 1.000000e+00
%85 = fptrunc double %84 to float
%86 = call float @gammln(float %85)
%87 = fneg float %86
%88 = call float @llvm.fmuladd.f32(float %80, float %81, float %87)
%89 = load float, float* @poidev.g
%90 = fsub float %88, %89
%91 = call double @exp(float %90)
%92 = fmul double %79, %91
%93 = fptrunc double %92 to float
store float %93, float* %6
br label %94
94: ; preds = %71
%95 = load i64*, i64** %4
%96 = call float @ran1(i64* %95)
%97 = load float, float* %6
%98 = fcmp ogt float %96, %97
br i1 %98, label %56, label %99
99: ; preds = %94
br label %100
100: ; preds = %99, %33
%101 = load float, float* %5
ret float %101
}

LLVM IR (-O2):
@poidev.sq = internal unnamed_addr global float 0.000000e+00
@poidev.alxm = internal unnamed_addr global float 0.000000e+00
@poidev.g = internal unnamed_addr global float 0.000000e+00
@poidev.oldm = internal unnamed_addr global float -1.000000e+00
define float @poidev(float %0, i64* %1) {
%3 = fpext float %0 to double
%4 = fcmp olt float %0, 1.200000e+01
%5 = load float, float* @poidev.oldm
%6 = fcmp une float %5, %0
br i1 %4, label %7, label %21
7: ; preds = %2
br i1 %6, label %8, label %12
8: ; preds = %7
store float %0, float* @poidev.oldm
%9 = fneg float %0
%10 = tail call double @exp(float %9)
%11 = fptrunc double %10 to float
store float %11, float* @poidev.g
br label %12
12: ; preds = %8, %7
br label %13
13: ; preds = %12, %13
%14 = phi float [ %18, %13 ], [ 1.000000e+00, %12 ]
%15 = phi float [ %16, %13 ], [ -1.000000e+00, %12 ]
%16 = fadd float %15, 1.000000e+00
%17 = tail call float @ran1(i64* %1)
%18 = fmul float %14, %17
%19 = load float, float* @poidev.g
%20 = fcmp ogt float %18, %19
br i1 %20, label %13, label %58
21: ; preds = %2
br i1 %6, label %22, label %30
22: ; preds = %21
store float %0, float* @poidev.oldm
%23 = fmul double %3, 2.000000e+00
%24 = tail call float @sqrt(double %23)
store float %24, float* @poidev.sq
%25 = tail call float @log(float %0)
store float %25, float* @poidev.alxm
%26 = fadd float %0, 1.000000e+00
%27 = tail call float @gammln(float %26)
%28 = fneg float %27
%29 = tail call float @llvm.fmuladd.f32(float %0, float %25, float %28)
store float %29, float* @poidev.g
br label %30
30: ; preds = %21, %22
br label %31
31: ; preds = %39, %30
%32 = tail call float @ran1(i64* %1)
%33 = fpext float %32 to double
%34 = fmul double %33, 0x400921FB54524550
%35 = tail call float @tan(double %34)
%36 = load float, float* @poidev.sq
%37 = tail call float @llvm.fmuladd.f32(float %36, float %35, float %0)
%38 = fcmp olt float %37, 0.000000e+00
br i1 %38, label %39, label %40
39: ; preds = %31, %40
br label %31
40: ; preds = %31
%41 = tail call float @llvm.floor.f32(float %37)
%42 = fmul float %35, %35
%43 = fpext float %42 to double
%44 = fadd double %43, 1.000000e+00
%45 = fmul double %44, 9.000000e-01
%46 = load float, float* @poidev.alxm
%47 = fadd float %41, 1.000000e+00
%48 = tail call float @gammln(float %47)
%49 = fneg float %48
%50 = tail call float @llvm.fmuladd.f32(float %41, float %46, float %49)
%51 = load float, float* @poidev.g
%52 = fsub float %50, %51
%53 = tail call double @exp(float %52)
%54 = fmul double %45, %53
%55 = fptrunc double %54 to float
%56 = tail call float @ran1(i64* %1)
%57 = fcmp ogt float %56, %55
br i1 %57, label %39, label %58
58: ; preds = %40, %13
%59 = phi float [ %16, %13 ], [ %41, %40 ]
ret float %59
}