#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 diffPlaneToFiniteCyl(double L, double H) {
  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):
<diffPlaneToFiniteCyl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1040 <sqrt@plt>
call   1030 <atan@plt>
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2d53(%rip),%rax
divsd  (%rax),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffPlaneToFiniteCyl>:
sub    $0x78,%rsp
movapd %xmm1,0x40(%rsp)
unpcklpd %xmm1,%xmm1
addpd  0xeca(%rip),%xmm1
movsd  %xmm0,0x38(%rsp)
mulsd  %xmm0,%xmm0
unpcklpd %xmm0,%xmm0
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
addpd  %xmm0,%xmm2
movapd %xmm2,(%rsp)
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movapd %xmm1,0x50(%rsp)
movapd %xmm1,%xmm0
movapd %xmm2,0x60(%rsp)
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1181 <diffPlaneToFiniteCyl+0x61>
sqrtsd %xmm0,%xmm0
jmp    1186 <diffPlaneToFiniteCyl+0x66>
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 0xe43(%rip),%xmm0
jb     11d5 <diffPlaneToFiniteCyl+0xb5>
sqrtsd %xmm0,%xmm0
jmp    11e6 <diffPlaneToFiniteCyl+0xc6>
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     121f <diffPlaneToFiniteCyl+0xff>
sqrtsd %xmm0,%xmm0
jmp    1232 <diffPlaneToFiniteCyl+0x112>
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     1279 <diffPlaneToFiniteCyl+0x159>
sqrtsd %xmm0,%xmm0
jmp    127e <diffPlaneToFiniteCyl+0x15e>
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    0x2d29(%rip),%rax
divsd  (%rax),%xmm0
add    $0x78,%rsp
ret

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

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