#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 gammln(float);
float log(float);
float sqrt(double);
float tan(double);
float poidev(float xm, int *idum) {
  static float sq, alxm, g, oldm = (-1.0);
  float em, t, y;
  float ran1(int *), gammln(float);
  if (xm < 12.0) {
    if (xm != oldm) {
      oldm = xm;
      g = exp(-xm);
    }
    em = -1;
    t = 1.0;
    do {
      em += 1.0;
      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    124b <poidev+0xdb>
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  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%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 0x2e28(%rip),%xmm0
ja     1203 <poidev+0x93>
jmp    1435 <poidev+0x2c5>
movss  -0x4(%rbp),%xmm0
ucomiss 0x2e01(%rip),%xmm0
jne    1268 <poidev+0xf8>
jp     1268 <poidev+0xf8>
jmp    1308 <poidev+0x198>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,0x2de3(%rip)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,0x2dc9(%rip)
movss  -0x4(%rbp),%xmm0
call   1060 <log@plt>
movss  %xmm0,0x2dbb(%rip)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0x2da9(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd37(%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,0x2d60(%rip)
jmp    130d <poidev+0x19d>
jmp    1312 <poidev+0x1a2>
mov    -0x10(%rbp),%rdi
call   1050 <ran1@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xcf1(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <tan@plt>
movss  %xmm0,-0x1c(%rbp)
movss  0x2d23(%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     1312 <poidev+0x1a2>
movss  -0x14(%rbp),%xmm0
call   1090 <floor@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc79(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xc85(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  0x2cae(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc3c(%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  0x2c65(%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     130d <poidev+0x19d>
jmp    1435 <poidev+0x2c5>
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, i32* %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store i32* %1, i32** %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 %36
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 = %31, %21
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = fadd double %24, 1.000000e+00
%26 = fptrunc double %25 to float
store float %26, float* %5
%27 = load i32*, i32** %4
%28 = call float @ran1(i32* %27)
%29 = load float, float* %6
%30 = fmul float %29, %28
store float %30, float* %6
br label %31
31: ; preds = %22
%32 = load float, float* %6
%33 = load float, float* @poidev.g
%34 = fcmp ogt float %32, %33
br i1 %34, label %22, label %35
35: ; preds = %31
br label %102
36: ; preds = %2
%37 = load float, float* %3
%38 = load float, float* @poidev.oldm
%39 = fcmp une float %37, %38
br i1 %39, label %40, label %57
40: ; preds = %36
%41 = load float, float* %3
store float %41, float* @poidev.oldm
%42 = load float, float* %3
%43 = fpext float %42 to double
%44 = fmul double 2.000000e+00, %43
%45 = call float @sqrt(double %44)
store float %45, float* @poidev.sq
%46 = load float, float* %3
%47 = call float @log(float %46)
store float %47, float* @poidev.alxm
%48 = load float, float* %3
%49 = load float, float* @poidev.alxm
%50 = load float, float* %3
%51 = fpext float %50 to double
%52 = fadd double %51, 1.000000e+00
%53 = fptrunc double %52 to float
%54 = call float @gammln(float %53)
%55 = fneg float %54
%56 = call float @llvm.fmuladd.f32(float %48, float %49, float %55)
store float %56, float* @poidev.g
br label %57
57: ; preds = %40, %36
br label %58
58: ; preds = %96, %57
br label %59
59: ; preds = %69, %58
%60 = load i32*, i32** %4
%61 = call float @ran1(i32* %60)
%62 = fpext float %61 to double
%63 = fmul double 0x400921FB54524550, %62
%64 = call float @tan(double %63)
store float %64, float* %7
%65 = load float, float* @poidev.sq
%66 = load float, float* %7
%67 = load float, float* %3
%68 = call float @llvm.fmuladd.f32(float %65, float %66, float %67)
store float %68, float* %5
br label %69
69: ; preds = %59
%70 = load float, float* %5
%71 = fpext float %70 to double
%72 = fcmp olt double %71, 0.000000e+00
br i1 %72, label %59, label %73
73: ; preds = %69
%74 = load float, float* %5
%75 = call float @floor(float %74)
store float %75, float* %5
%76 = load float, float* %7
%77 = load float, float* %7
%78 = fmul float %76, %77
%79 = fpext float %78 to double
%80 = fadd double 1.000000e+00, %79
%81 = fmul double 9.000000e-01, %80
%82 = load float, float* %5
%83 = load float, float* @poidev.alxm
%84 = load float, float* %5
%85 = fpext float %84 to double
%86 = fadd double %85, 1.000000e+00
%87 = fptrunc double %86 to float
%88 = call float @gammln(float %87)
%89 = fneg float %88
%90 = call float @llvm.fmuladd.f32(float %82, float %83, float %89)
%91 = load float, float* @poidev.g
%92 = fsub float %90, %91
%93 = call double @exp(float %92)
%94 = fmul double %81, %93
%95 = fptrunc double %94 to float
store float %95, float* %6
br label %96
96: ; preds = %73
%97 = load i32*, i32** %4
%98 = call float @ran1(i32* %97)
%99 = load float, float* %6
%100 = fcmp ogt float %98, %99
br i1 %100, label %58, label %101
101: ; preds = %96
br label %102
102: ; preds = %101, %35
%103 = load float, float* %5
ret float %103
}

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, i32* %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(i32* %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(i32* %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(i32* %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
}