#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 diffPlaneToParallelRect1(double a, double b, double c) {
  double A = a / c;
  double B = b / c;
  double rA, rB;
  rA = 1.0 / sqrt(1.0 + A * A);
  rB = 1.0 / sqrt(1.0 + B * B);
  return 0.5 * (A * atan(B * rA) * rA + B * atan(A * rB) * rB) / M_PI;
}


x86 assembly (clang, -O0):
<diffPlaneToParallelRect1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdcd(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2daa(%rip),%rax
divsd  (%rax),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffPlaneToParallelRect1>:
sub    $0x48,%rsp
divsd  %xmm2,%xmm0
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xec6(%rip),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     114a <diffPlaneToParallelRect1+0x2a>
sqrtsd %xmm0,%xmm0
jmp    1168 <diffPlaneToParallelRect1+0x48>
movaps %xmm1,0x10(%rsp)
movapd %xmm2,(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm3,%xmm3
movapd (%rsp),%xmm2
movapd 0x10(%rsp),%xmm1
shufpd $0x2,0xe9f(%rip),%xmm1
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe77(%rip),%xmm0
ucomisd %xmm3,%xmm0
movapd %xmm1,0x10(%rsp)
jb     119b <diffPlaneToParallelRect1+0x7b>
sqrtsd %xmm0,%xmm0
jmp    11a6 <diffPlaneToParallelRect1+0x86>
call   1040 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
movsd  0xe52(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movapd %xmm2,0x30(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
call   1030 <atan@plt>
movapd %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  (%rsp),%xmm0
call   1030 <atan@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xdf5(%rip),%xmm0
mov    0x2dce(%rip),%rax
divsd  (%rax),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @diffPlaneToParallelRect1(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
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fdiv double %11, %12
store double %13, double* %7
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fdiv double %14, %15
store double %16, double* %8
%17 = load double, double* %7
%18 = load double, double* %7
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double 1.000000e+00)
%20 = call double @sqrt(double %19)
%21 = fdiv double 1.000000e+00, %20
store double %21, double* %9
%22 = load double, double* %8
%23 = load double, double* %8
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 1.000000e+00)
%25 = call double @sqrt(double %24)
%26 = fdiv double 1.000000e+00, %25
store double %26, double* %10
%27 = load double, double* %7
%28 = load double, double* %8
%29 = load double, double* %9
%30 = fmul double %28, %29
%31 = call double @atan(double %30)
%32 = fmul double %27, %31
%33 = load double, double* %9
%34 = load double, double* %8
%35 = load double, double* %7
%36 = load double, double* %10
%37 = fmul double %35, %36
%38 = call double @atan(double %37)
%39 = fmul double %34, %38
%40 = load double, double* %10
%41 = fmul double %39, %40
%42 = call double @llvm.fmuladd.f64(double %32, double %33, double %41)
%43 = fmul double 5.000000e-01, %42
%44 = load double, double* @M_PI
%45 = fdiv double %43, %44
ret double %45
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @diffPlaneToParallelRect1(double %0, double %1, double %2) {
%4 = fdiv double %0, %2
%5 = tail call double @llvm.fmuladd.f64(double %4, double %4, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
%7 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %1, i64 0
%8 = insertelement <2 x double> poison, double %2, i64 0
%9 = insertelement <2 x double> %8, double %6, i64 1
%10 = fdiv <2 x double> %7, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double 1.000000e+00)
%13 = tail call double @sqrt(double %12)
%14 = fdiv double 1.000000e+00, %13
%15 = extractelement <2 x double> %10, i64 1
%16 = fmul double %11, %15
%17 = tail call double @atan(double %16)
%18 = fmul double %4, %17
%19 = fmul double %4, %14
%20 = tail call double @atan(double %19)
%21 = fmul double %11, %20
%22 = fmul double %14, %21
%23 = tail call double @llvm.fmuladd.f64(double %18, double %15, double %22)
%24 = fmul double %23, 5.000000e-01
%25 = load double, double* @M_PI
%26 = fdiv double %24, %25
ret double %26
}