#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 M_PI;
double atan(double);
double sqrt(double);
double diffPlaneToFiniteCyl1(double r, double l, double h) {
  double L = l / r;
  double H = h / r;
  double Hm1 = H - 1.0;
  double Hp1 = H + 1.0;
  double X = Hp1 * Hp1 + L * L;
  double Y = Hm1 * Hm1 + L * L;
  return (atan(L / sqrt(Hp1 * Hm1)) / H +
          L * ((X - 2.0 * H) * atan(sqrt(X * Hm1 / (Y * Hp1))) /
                   (H * sqrt(X * Y)) -
               atan(sqrt(Hm1 / Hp1)) / H)) /
         M_PI;
}


x86 assembly (clang, -O0):
<diffPlaneToFiniteCyl1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8a(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
call   1040 <sqrt@plt>
call   1030 <atan@plt>
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2d2d(%rip),%rax
divsd  (%rax),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffPlaneToFiniteCyl1>:
sub    $0x78,%rsp
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm2
movapd %xmm2,0x40(%rsp)
unpcklpd %xmm2,%xmm2
addpd  0xec2(%rip),%xmm2
movsd  %xmm1,0x38(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
unpcklpd %xmm0,%xmm0
movapd %xmm2,%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
movapd %xmm2,0x50(%rsp)
movapd %xmm2,%xmm0
movapd %xmm1,0x60(%rsp)
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118d <diffPlaneToFiniteCyl1+0x6d>
sqrtsd %xmm0,%xmm0
jmp    1192 <diffPlaneToFiniteCyl1+0x72>
call   1040 <sqrt@plt>
movsd  0x38(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x18(%rsp)
movapd 0x40(%rsp),%xmm2
addsd  %xmm2,%xmm2
movapd 0x50(%rsp),%xmm0
shufpd $0x1,%xmm0,%xmm0
mulpd  (%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ucomisd 0xe37(%rip),%xmm0
jb     11e1 <diffPlaneToFiniteCyl1+0xc1>
sqrtsd %xmm0,%xmm0
jmp    11f2 <diffPlaneToFiniteCyl1+0xd2>
movapd %xmm2,0x20(%rsp)
call   1040 <sqrt@plt>
movapd 0x20(%rsp),%xmm2
movapd (%rsp),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
call   1030 <atan@plt>
movapd %xmm0,%xmm3
movapd (%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
jb     122b <diffPlaneToFiniteCyl1+0x10b>
sqrtsd %xmm0,%xmm0
jmp    123e <diffPlaneToFiniteCyl1+0x11e>
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm4,%xmm4
movsd  (%rsp),%xmm3
movapd 0x40(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rsp)
movapd 0x20(%rsp),%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm1,0x20(%rsp)
mulsd  %xmm2,%xmm0
movapd %xmm0,(%rsp)
movapd 0x60(%rsp),%xmm0
divsd  0x50(%rsp),%xmm0
ucomisd %xmm4,%xmm0
jb     1285 <diffPlaneToFiniteCyl1+0x165>
sqrtsd %xmm0,%xmm0
jmp    128a <diffPlaneToFiniteCyl1+0x16a>
call   1040 <sqrt@plt>
call   1030 <atan@plt>
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd (%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x18(%rsp),%xmm0
mov    0x2d1d(%rip),%rax
divsd  (%rax),%xmm0
add    $0x78,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @diffPlaneToFiniteCyl1(double %0, double %1, double %2) {
%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
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%13 = load double, double* %5
%14 = load double, double* %4
%15 = fdiv double %13, %14
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %4
%18 = fdiv double %16, %17
store double %18, double* %8
%19 = load double, double* %8
%20 = fsub double %19, 1.000000e+00
store double %20, double* %9
%21 = load double, double* %8
%22 = fadd double %21, 1.000000e+00
store double %22, double* %10
%23 = load double, double* %10
%24 = load double, double* %10
%25 = load double, double* %7
%26 = load double, double* %7
%27 = fmul double %25, %26
%28 = call double @llvm.fmuladd.f64(double %23, double %24, double %27)
store double %28, double* %11
%29 = load double, double* %9
%30 = load double, double* %9
%31 = load double, double* %7
%32 = load double, double* %7
%33 = fmul double %31, %32
%34 = call double @llvm.fmuladd.f64(double %29, double %30, double %33)
store double %34, double* %12
%35 = load double, double* %7
%36 = load double, double* %10
%37 = load double, double* %9
%38 = fmul double %36, %37
%39 = call double @sqrt(double %38)
%40 = fdiv double %35, %39
%41 = call double @atan(double %40)
%42 = load double, double* %8
%43 = fdiv double %41, %42
%44 = load double, double* %7
%45 = load double, double* %11
%46 = load double, double* %8
%47 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %46, double %45)
%48 = load double, double* %11
%49 = load double, double* %9
%50 = fmul double %48, %49
%51 = load double, double* %12
%52 = load double, double* %10
%53 = fmul double %51, %52
%54 = fdiv double %50, %53
%55 = call double @sqrt(double %54)
%56 = call double @atan(double %55)
%57 = fmul double %47, %56
%58 = load double, double* %8
%59 = load double, double* %11
%60 = load double, double* %12
%61 = fmul double %59, %60
%62 = call double @sqrt(double %61)
%63 = fmul double %58, %62
%64 = fdiv double %57, %63
%65 = load double, double* %9
%66 = load double, double* %10
%67 = fdiv double %65, %66
%68 = call double @sqrt(double %67)
%69 = call double @atan(double %68)
%70 = load double, double* %8
%71 = fdiv double %69, %70
%72 = fsub double %64, %71
%73 = call double @llvm.fmuladd.f64(double %44, double %72, double %43)
%74 = load double, double* @M_PI
%75 = fdiv double %73, %74
ret double %75
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @diffPlaneToFiniteCyl1(double %0, double %1, double %2) {
%4 = fdiv double %1, %0
%5 = fdiv double %2, %0
%6 = insertelement <2 x double> poison, double %5, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = fadd <2 x double> %7, <double 1.000000e+00, double -1.000000e+00>
%9 = fmul double %4, %4
%10 = insertelement <2 x double> poison, double %9, i64 0
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%12 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> %8, <2 x double> %11)
%13 = extractelement <2 x double> %8, i64 0
%14 = extractelement <2 x double> %8, i64 1
%15 = fmul double %13, %14
%16 = tail call double @sqrt(double %15)
%17 = fdiv double %4, %16
%18 = tail call double @atan(double %17)
%19 = fdiv double %18, %5
%20 = extractelement <2 x double> %12, i64 0
%21 = tail call double @llvm.fmuladd.f64(double %5, double -2.000000e+00, double %20)
%22 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%23 = fmul <2 x double> %22, %12
%24 = extractelement <2 x double> %23, i64 0
%25 = extractelement <2 x double> %23, i64 1
%26 = fdiv double %24, %25
%27 = tail call double @sqrt(double %26)
%28 = tail call double @atan(double %27)
%29 = fmul double %21, %28
%30 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%31 = fmul <2 x double> %12, %30
%32 = extractelement <2 x double> %31, i64 0
%33 = tail call double @sqrt(double %32)
%34 = fmul double %5, %33
%35 = fdiv double %14, %13
%36 = tail call double @sqrt(double %35)
%37 = tail call double @atan(double %36)
%38 = insertelement <2 x double> poison, double %29, i64 0
%39 = insertelement <2 x double> %38, double %37, i64 1
%40 = insertelement <2 x double> poison, double %34, i64 0
%41 = insertelement <2 x double> %40, double %5, i64 1
%42 = fdiv <2 x double> %39, %41
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%44 = fsub <2 x double> %42, %43
%45 = extractelement <2 x double> %44, i64 0
%46 = tail call double @llvm.fmuladd.f64(double %4, double %45, double %19)
%47 = load double, double* @M_PI
%48 = fdiv double %46, %47
ret double %48
}