#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 NAN;
double atan(double);
double cos(double);
double log(double);
double pow(double, int);
double random_exponential();
double random_uniform();
double sin(double);
double tan(double);
double random_stable(double alpha, double beta) {
  double U = (random_uniform() - 0.5) * 3.14159265358979323846264338328;
  double W = random_exponential();
  double z = -beta * tan(3.14159265358979323846264338328 * alpha / 2);
  double x =
      alpha == 1 ? 3.14159265358979323846264338328 / 2 : atan(-z) / alpha;
  double r = NAN;
  if (alpha == 1) {
    double a = (3.14159265358979323846264338328 / 2 + beta * U) * tan(U);
    double b = log(((3.14159265358979323846264338328 / 2) * W * cos(U)) /
                   ((3.14159265358979323846264338328 / 2) + beta * U));
    r = (a - beta * b) / x;
  } else {
    double a = pow(1 + z * z, 1 / (2 * alpha));
    double b = sin(alpha * (U + x)) / pow(cos(U), 1 / alpha);
    double c = pow(cos(U - alpha * (U + x)) / W, (1 - alpha) / alpha);
    r = a * b * c;
  }
  return r;
}


x86 assembly (clang, -O0):
<random_stable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random_uniform@plt>
movsd  0xe74(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <random_exponential@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe22(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xdde(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1244 <random_stable+0xc4>
jp     1244 <random_stable+0xc4>
movsd  0xde6(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    126f <random_stable+0xef>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <atan@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2d78(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xd6a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    136d <random_stable+0x1ed>
jp     136d <random_stable+0x1ed>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd64(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd38(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd02(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1090 <log@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1473 <random_stable+0x2f3>
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc7d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xc79(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xc64(%rip),%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1080 <cos@plt>
movsd  0xc20(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <cos@plt>
divsd  -0x20(%rbp),%xmm0
movsd  0xbb9(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_stable>:
sub    $0x48,%rsp
movaps %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <random_uniform@plt>
addsd  0xe62(%rip),%xmm0
mulsd  0xe62(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1040 <random_exponential@plt>
movsd  %xmm0,0x28(%rsp)
movaps 0xe70(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
movsd  0xe36(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xe30(%rip),%xmm0
call   1070 <tan@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe25(%rip),%xmm1
jne    126f <random_stable+0xef>
jp     126f <random_stable+0xef>
movsd  0x20(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe11(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
call   1070 <tan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0xdec(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x20(%rsp),%xmm0
call   1080 <cos@plt>
mulsd  0x28(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1090 <log@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0xdb6(%rip),%xmm0
add    $0x48,%rsp
ret
mulsd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm1
movapd %xmm0,0x10(%rsp)
movapd 0xda9(%rip),%xmm0
xorpd  %xmm1,%xmm0
call   1060 <atan@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0xd62(%rip),%xmm1
addsd  %xmm1,%xmm2
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movapd %xmm2,%xmm0
call   10a0 <pow@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1080 <cos@plt>
movsd  0xd0d(%rip),%xmm1
divsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
call   1080 <cos@plt>
divsd  0x28(%rsp),%xmm0
movsd  0xccf(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
@NAN = global double 0.000000e+00
define double @random_stable(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %3
store double %1, double* %4
%15 = call double (...) @random_uniform()
%16 = fsub double %15, 5.000000e-01
%17 = fmul double %16, 0x400921FB54442D18
store double %17, double* %5
%18 = call double (...) @random_exponential()
store double %18, double* %6
%19 = load double, double* %4
%20 = fneg double %19
%21 = load double, double* %3
%22 = fmul double 0x400921FB54442D18, %21
%23 = fdiv double %22, 2.000000e+00
%24 = call double @tan(double %23)
%25 = fmul double %20, %24
store double %25, double* %7
%26 = load double, double* %3
%27 = fcmp oeq double %26, 1.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %2
br label %35
29: ; preds = %2
%30 = load double, double* %7
%31 = fneg double %30
%32 = call double @atan(double %31)
%33 = load double, double* %3
%34 = fdiv double %32, %33
br label %35
35: ; preds = %29, %28
%36 = phi double [ 0x3FF921FB54442D18, %28 ], [ %34, %29 ]
store double %36, double* %8
%37 = load double, double* @NAN
store double %37, double* %9
%38 = load double, double* %3
%39 = fcmp oeq double %38, 1.000000e+00
br i1 %39, label %40, label %64
40: ; preds = %35
%41 = load double, double* %4
%42 = load double, double* %5
%43 = call double @llvm.fmuladd.f64(double %41, double %42, double 0x3FF921FB54442D18)
%44 = load double, double* %5
%45 = call double @tan(double %44)
%46 = fmul double %43, %45
store double %46, double* %10
%47 = load double, double* %6
%48 = fmul double 0x3FF921FB54442D18, %47
%49 = load double, double* %5
%50 = call double @cos(double %49)
%51 = fmul double %48, %50
%52 = load double, double* %4
%53 = load double, double* %5
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double 0x3FF921FB54442D18)
%55 = fdiv double %51, %54
%56 = call double @log(double %55)
store double %56, double* %11
%57 = load double, double* %10
%58 = load double, double* %4
%59 = load double, double* %11
%60 = fneg double %58
%61 = call double @llvm.fmuladd.f64(double %60, double %59, double %57)
%62 = load double, double* %8
%63 = fdiv double %61, %62
store double %63, double* %9
br label %107
64: ; preds = %35
%65 = load double, double* %7
%66 = load double, double* %7
%67 = call double @llvm.fmuladd.f64(double %65, double %66, double 1.000000e+00)
%68 = load double, double* %3
%69 = fmul double 2.000000e+00, %68
%70 = fdiv double 1.000000e+00, %69
%71 = fptosi double %70 to i32
%72 = call double @pow(double %67, i32 %71)
store double %72, double* %12
%73 = load double, double* %3
%74 = load double, double* %5
%75 = load double, double* %8
%76 = fadd double %74, %75
%77 = fmul double %73, %76
%78 = call double @sin(double %77)
%79 = load double, double* %5
%80 = call double @cos(double %79)
%81 = load double, double* %3
%82 = fdiv double 1.000000e+00, %81
%83 = fptosi double %82 to i32
%84 = call double @pow(double %80, i32 %83)
%85 = fdiv double %78, %84
store double %85, double* %13
%86 = load double, double* %5
%87 = load double, double* %3
%88 = load double, double* %5
%89 = load double, double* %8
%90 = fadd double %88, %89
%91 = fneg double %87
%92 = call double @llvm.fmuladd.f64(double %91, double %90, double %86)
%93 = call double @cos(double %92)
%94 = load double, double* %6
%95 = fdiv double %93, %94
%96 = load double, double* %3
%97 = fsub double 1.000000e+00, %96
%98 = load double, double* %3
%99 = fdiv double %97, %98
%100 = fptosi double %99 to i32
%101 = call double @pow(double %95, i32 %100)
store double %101, double* %14
%102 = load double, double* %12
%103 = load double, double* %13
%104 = fmul double %102, %103
%105 = load double, double* %14
%106 = fmul double %104, %105
store double %106, double* %9
br label %107
107: ; preds = %64, %40
%108 = load double, double* %9
ret double %108
}

LLVM IR (-O2):
@NAN = global double 0.000000e+00
define double @random_stable(double %0, double %1) {
%3 = tail call double (...) @random_uniform()
%4 = fadd double %3, -5.000000e-01
%5 = fmul double %4, 0x400921FB54442D18
%6 = tail call double (...) @random_exponential()
%7 = fneg double %1
%8 = fmul double %0, 0x400921FB54442D18
%9 = fmul double %8, 5.000000e-01
%10 = tail call double @tan(double %9)
%11 = fmul double %10, %7
%12 = fcmp oeq double %0, 1.000000e+00
br i1 %12, label %13, label %24
13: ; preds = %2
%14 = tail call double @llvm.fmuladd.f64(double %1, double %5, double 0x3FF921FB54442D18)
%15 = tail call double @tan(double %5)
%16 = fmul double %14, %15
%17 = fmul double %6, 0x3FF921FB54442D18
%18 = tail call double @cos(double %5)
%19 = fmul double %17, %18
%20 = fdiv double %19, %14
%21 = tail call double @log(double %20)
%22 = tail call double @llvm.fmuladd.f64(double %7, double %21, double %16)
%23 = fdiv double %22, 0x3FF921FB54442D18
br label %51
24: ; preds = %2
%25 = fneg double %11
%26 = tail call double @atan(double %25)
%27 = fdiv double %26, %0
%28 = tail call double @llvm.fmuladd.f64(double %11, double %11, double 1.000000e+00)
%29 = fmul double %0, 2.000000e+00
%30 = fdiv double 1.000000e+00, %29
%31 = fptosi double %30 to i32
%32 = tail call double @pow(double %28, i32 %31)
%33 = fadd double %5, %27
%34 = fmul double %33, %0
%35 = tail call double @sin(double %34)
%36 = tail call double @cos(double %5)
%37 = fdiv double 1.000000e+00, %0
%38 = fptosi double %37 to i32
%39 = tail call double @pow(double %36, i32 %38)
%40 = fdiv double %35, %39
%41 = fneg double %0
%42 = tail call double @llvm.fmuladd.f64(double %41, double %33, double %5)
%43 = tail call double @cos(double %42)
%44 = fdiv double %43, %6
%45 = fsub double 1.000000e+00, %0
%46 = fdiv double %45, %0
%47 = fptosi double %46 to i32
%48 = tail call double @pow(double %44, i32 %47)
%49 = fmul double %32, %40
%50 = fmul double %49, %48
br label %51
51: ; preds = %24, %13
%52 = phi double [ %23, %13 ], [ %50, %24 ]
ret double %52
}