#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 IntGauss1(double);
double g(double);
double sqrt(double);
double SumPoisson20(long k, double u) {
  double s;
  double d1, d2;
  double z;
  s = (double)k + (double)(1.0 / 2.0);
  d1 = (double)k - u + (double)(2.0 / 3.0);
  d2 = d1 + (double)0.02 / (double)(k + 1l);
  z = (1.0 + g(s / u)) / u;
  z = d2 * sqrt(z);
  z = IntGauss1(z);
  return (z);
}


x86 assembly (clang, -O0):
<SumPoisson20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cvtsi2sd %rax,%xmm2
movsd  0xe7a(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <g@plt>
movaps %xmm0,%xmm1
movsd  0xe4b(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <IntGauss1@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SumPoisson20>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
cvtsi2sd %rdi,%xmm1
movsd  0xebb(%rip),%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm1
movapd %xmm2,%xmm4
movsd  %xmm2,0x8(%rsp)
addsd  0xea9(%rip),%xmm1
add    $0x1,%rdi
xorps  %xmm2,%xmm2
cvtsi2sd %rdi,%xmm2
movsd  0xe9d(%rip),%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
divsd  %xmm4,%xmm0
call   1040 <g@plt>
addsd  0xe86(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a8 <SumPoisson20+0x78>
sqrtsd %xmm0,%xmm0
jmp    11ad <SumPoisson20+0x7d>
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <IntGauss1@plt>

LLVM IR (-O0):
define double @SumPoisson20(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%9 = load i64, i64* %3
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 5.000000e-01
store double %11, double* %5
%12 = load i64, i64* %3
%13 = sitofp i64 %12 to double
%14 = load double, double* %4
%15 = fsub double %13, %14
%16 = fadd double %15, 0x3FE5555555555555
store double %16, double* %6
%17 = load double, double* %6
%18 = load i64, i64* %3
%19 = add nsw i64 %18, 1
%20 = sitofp i64 %19 to double
%21 = fdiv double 2.000000e-02, %20
%22 = fadd double %17, %21
store double %22, double* %7
%23 = load double, double* %5
%24 = load double, double* %4
%25 = fdiv double %23, %24
%26 = call double @g(double %25)
%27 = fadd double 1.000000e+00, %26
%28 = load double, double* %4
%29 = fdiv double %27, %28
store double %29, double* %8
%30 = load double, double* %7
%31 = load double, double* %8
%32 = call double @sqrt(double %31)
%33 = fmul double %30, %32
store double %33, double* %8
%34 = load double, double* %8
%35 = call double @IntGauss1(double %34)
store double %35, double* %8
%36 = load double, double* %8
ret double %36
}

LLVM IR (-O2):
define double @SumPoisson20(i64 %0, double %1) {
%3 = sitofp i64 %0 to double
%4 = fadd double %3, 5.000000e-01
%5 = fsub double %3, %1
%6 = fadd double %5, 0x3FE5555555555555
%7 = add nsw i64 %0, 1
%8 = sitofp i64 %7 to double
%9 = fdiv double 2.000000e-02, %8
%10 = fadd double %6, %9
%11 = fdiv double %4, %1
%12 = tail call double @g(double %11)
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double %13, %1
%15 = tail call double @sqrt(double %14)
%16 = fmul double %10, %15
%17 = tail call double @IntGauss1(double %16)
ret double %17
}