#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 */
int fabs(int);
double fmax(int, int);
double myrand();
int randn();
double FCauchy(double Ftrue, double alpha, double p) {
  double Fval;
  double tmp = randn() / fabs(randn() + 1e-199);
  if (myrand() < p)
    Fval = Ftrue + alpha * fmax(0., 1e3 + tmp);
  else
    Fval = Ftrue + alpha * 1e3;
  Fval += 1.01 * 1e-8;
  if (Ftrue < 1e-8) {
    Fval = Ftrue;
  }
  return Fval;
}


x86 assembly (clang, -O0):
<FCauchy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x0,%al
call   1060 <randn@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1060 <randn@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <myrand@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f6 <FCauchy+0xb6>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe41(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%esi
xor    %edi,%edi
call   1050 <fmax@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1215 <FCauchy+0xd5>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe00(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdfb(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xde1(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1244 <FCauchy+0x104>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCauchy>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1060 <randn@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <randn@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe8b(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <myrand@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    11b1 <FCauchy+0x71>
mov    %ebx,%eax
cltd
idiv   %ebp
lea    0x3e8(%rax),%esi
xor    %edi,%edi
call   1050 <fmax@plt>
movapd 0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
jmp    11bf <FCauchy+0x7f>
movapd 0x10(%rsp),%xmm2
mulsd  0xe49(%rip),%xmm2
movapd 0x20(%rsp),%xmm1
addsd  %xmm1,%xmm2
addsd  0xe3f(%rip),%xmm2
movapd %xmm1,%xmm0
cmpltsd 0xe3a(%rip),%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @FCauchy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = call i32 (...) @randn()
%10 = call i32 (...) @randn()
%11 = sitofp i32 %10 to double
%12 = fadd double %11, 0x169E9E369AA2B597
%13 = fptosi double %12 to i32
%14 = call i32 @fabs(i32 %13)
%15 = sdiv i32 %9, %14
%16 = sitofp i32 %15 to double
store double %16, double* %8
%17 = call double (...) @myrand()
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %28
20: ; preds = %3
%21 = load double, double* %4
%22 = load double, double* %5
%23 = load double, double* %8
%24 = fadd double 1.000000e+03, %23
%25 = fptosi double %24 to i32
%26 = call double @fmax(i32 0, i32 %25)
%27 = call double @llvm.fmuladd.f64(double %22, double %26, double %21)
store double %27, double* %7
br label %32
28: ; preds = %3
%29 = load double, double* %4
%30 = load double, double* %5
%31 = call double @llvm.fmuladd.f64(double %30, double 1.000000e+03, double %29)
store double %31, double* %7
br label %32
32: ; preds = %28, %20
%33 = load double, double* %7
%34 = fadd double %33, 0x3E45B088A1E43BB6
store double %34, double* %7
%35 = load double, double* %4
%36 = fcmp olt double %35, 1.000000e-08
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = load double, double* %4
store double %38, double* %7
br label %39
39: ; preds = %37, %32
%40 = load double, double* %7
ret double %40
}

LLVM IR (-O2):
define double @FCauchy(double %0, double %1, double %2) {
%4 = tail call i32 (...) @randn()
%5 = tail call i32 (...) @randn()
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 0x169E9E369AA2B597
%8 = fptosi double %7 to i32
%9 = tail call i32 @fabs(i32 %8)
%10 = tail call double (...) @myrand()
%11 = fcmp olt double %10, %2
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = sdiv i32 %4, %9
%14 = add i32 %13, 1000
%15 = tail call double @fmax(i32 0, i32 %14)
%16 = tail call double @llvm.fmuladd.f64(double %1, double %15, double %0)
br label %19
17: ; preds = %3
%18 = tail call double @llvm.fmuladd.f64(double %1, double 1.000000e+03, double %0)
br label %19
19: ; preds = %17, %12
%20 = phi double [ %16, %12 ], [ %18, %17 ]
%21 = fadd double %20, 0x3E45B088A1E43BB6
%22 = fcmp olt double %0, 1.000000e-08
%23 = select i1 %22, double %0, double %21
ret double %23
}