#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 pow(int, double);
double poisson(double phi, double v0) {
  double v;
  v = 0.5 - (pow(1 - pow(phi, 2. / 3.), 1.21) *
             (2 * (3 - 5 * phi) * (1 - 2 * v0) + 3 * phi * (1 + v0))) /
                (4 * (3 - 5 * phi) * (1 - phi));
  return v;
}


x86 assembly (clang, -O0):
<poisson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%edi
movsd  0xf09(%rip),%xmm0
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
movsd  0xeed(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xebf(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  0xebb(%rip),%xmm0
addsd  %xmm0,%xmm2
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
addsd  %xmm2,%xmm2
movsd  0xe82(%rip),%xmm3
subsd  %xmm2,%xmm3
movsd  0xe8e(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xe69(%rip),%xmm4
addsd  -0x10(%rbp),%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xe57(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  0xe53(%rip),%xmm0
addsd  %xmm0,%xmm2
movsd  0xe37(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe23(%rip),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe06(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poisson>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
movsd  0xed4(%rip),%xmm0
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
movsd  0xec8(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm8
movsd  0xebe(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm3
movsd  0x10(%rsp),%xmm7
movapd %xmm7,%xmm4
addsd  %xmm7,%xmm4
movsd  0xe9a(%rip),%xmm5
movapd %xmm5,%xmm6
subsd  %xmm4,%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm0,%xmm2
movapd %xmm0,%xmm3
movapd %xmm7,%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm6,%xmm0
mulsd  %xmm8,%xmm0
mulsd  0xe71(%rip),%xmm1
subsd  %xmm3,%xmm5
mulsd  %xmm1,%xmm5
divsd  %xmm5,%xmm0
addsd  0xe65(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @poisson(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fptosi double %6 to i32
%8 = call i32 @pow(i32 %7, double 0x3FE5555555555555)
%9 = sub nsw i32 1, %8
%10 = call i32 @pow(i32 %9, double 1.210000e+00)
%11 = sitofp i32 %10 to double
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double -5.000000e+00, double %12, double 3.000000e+00)
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %4
%16 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %15, double 1.000000e+00)
%17 = load double, double* %3
%18 = fmul double 3.000000e+00, %17
%19 = load double, double* %4
%20 = fadd double 1.000000e+00, %19
%21 = fmul double %18, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %16, double %21)
%23 = fmul double %11, %22
%24 = load double, double* %3
%25 = call double @llvm.fmuladd.f64(double -5.000000e+00, double %24, double 3.000000e+00)
%26 = fmul double 4.000000e+00, %25
%27 = load double, double* %3
%28 = fsub double 1.000000e+00, %27
%29 = fmul double %26, %28
%30 = fdiv double %23, %29
%31 = fsub double 5.000000e-01, %30
store double %31, double* %5
%32 = load double, double* %5
ret double %32
}

LLVM IR (-O2):
define double @poisson(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = tail call i32 @pow(i32 %3, double 0x3FE5555555555555)
%5 = sub nsw i32 1, %4
%6 = tail call i32 @pow(i32 %5, double 1.210000e+00)
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %0, double -5.000000e+00, double 3.000000e+00)
%9 = fmul double %8, 2.000000e+00
%10 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double 1.000000e+00)
%11 = fmul double %0, 3.000000e+00
%12 = fadd double %1, 1.000000e+00
%13 = fmul double %11, %12
%14 = tail call double @llvm.fmuladd.f64(double %9, double %10, double %13)
%15 = fmul double %14, %7
%16 = fmul double %8, 4.000000e+00
%17 = fsub double 1.000000e+00, %0
%18 = fmul double %17, %16
%19 = fdiv double %15, %18
%20 = fsub double 5.000000e-01, %19
ret double %20
}