#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(double);
double c_xi_func(double umu1, double umu2, double tau) {
  double exp1, x1;
  x1 = (umu2 - umu1) / (umu2 * umu1);
  exp1 = exp(-tau / umu1);
  if (x1 != 0.) {
    return ((tau * x1 - 1.) * exp(-tau / umu2) + exp1) /
           (x1 * x1 * umu1 * umu2);
  } else {
    return tau * tau * exp1 / (2. * umu1 * umu2);
  }
}


x86 assembly (clang, -O0):
<c_xi_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118c <c_xi_func+0x7c>
jp     118c <c_xi_func+0x7c>
jmp    1208 <c_xi_func+0xf8>
movsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe66(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1232 <c_xi_func+0x122>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xde1(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_xi_func>:
sub    $0x48,%rsp
movapd %xmm0,%xmm3
movapd %xmm1,%xmm4
subsd  %xmm0,%xmm4
movsd  %xmm1,0x18(%rsp)
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm4
movsd  %xmm4,0x10(%rsp)
movapd 0xec4(%rip),%xmm0
movapd %xmm2,0x20(%rsp)
xorpd  %xmm2,%xmm0
movapd %xmm0,0x30(%rsp)
movsd  %xmm3,0x8(%rsp)
divsd  %xmm3,%xmm0
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1171 <c_xi_func+0x61>
jnp    11be <c_xi_func+0xae>
movapd 0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe8d(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movapd 0x30(%rsp),%xmm0
divsd  0x18(%rsp),%xmm0
movsd  %xmm2,0x30(%rsp)
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
mulsd  %xmm1,%xmm1
mulsd  0x8(%rsp),%xmm1
jmp    11d6 <c_xi_func+0xc6>
movapd 0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  0x18(%rsp),%xmm1
divsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @c_xi_func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %6
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fdiv double %12, %15
store double %16, double* %9
%17 = load double, double* %7
%18 = fneg double %17
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = call double @exp(double %20)
store double %21, double* %8
%22 = load double, double* %9
%23 = fcmp une double %22, 0.000000e+00
br i1 %23, label %24, label %43
24: ; preds = %3
%25 = load double, double* %7
%26 = load double, double* %9
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double -1.000000e+00)
%28 = load double, double* %7
%29 = fneg double %28
%30 = load double, double* %6
%31 = fdiv double %29, %30
%32 = call double @exp(double %31)
%33 = load double, double* %8
%34 = call double @llvm.fmuladd.f64(double %27, double %32, double %33)
%35 = load double, double* %9
%36 = load double, double* %9
%37 = fmul double %35, %36
%38 = load double, double* %5
%39 = fmul double %37, %38
%40 = load double, double* %6
%41 = fmul double %39, %40
%42 = fdiv double %34, %41
store double %42, double* %4
br label %54
43: ; preds = %3
%44 = load double, double* %7
%45 = load double, double* %7
%46 = fmul double %44, %45
%47 = load double, double* %8
%48 = fmul double %46, %47
%49 = load double, double* %5
%50 = fmul double 2.000000e+00, %49
%51 = load double, double* %6
%52 = fmul double %50, %51
%53 = fdiv double %48, %52
store double %53, double* %4
br label %54
54: ; preds = %43, %24
%55 = load double, double* %4
ret double %55
}

LLVM IR (-O2):
define double @c_xi_func(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fmul double %0, %1
%6 = fdiv double %4, %5
%7 = fneg double %2
%8 = fdiv double %7, %0
%9 = tail call double @exp(double %8)
%10 = fcmp une double %6, 0.000000e+00
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = tail call double @llvm.fmuladd.f64(double %2, double %6, double -1.000000e+00)
%13 = fdiv double %7, %1
%14 = tail call double @exp(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %9)
%16 = fmul double %6, %6
%17 = fmul double %16, %0
br label %22
18: ; preds = %3
%19 = fmul double %2, %2
%20 = fmul double %19, %9
%21 = fmul double %0, 2.000000e+00
br label %22
22: ; preds = %18, %11
%23 = phi double [ %21, %18 ], [ %17, %11 ]
%24 = phi double [ %20, %18 ], [ %15, %11 ]
%25 = fmul double %23, %1
%26 = fdiv double %24, %25
ret double %26
}