#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 log(double);
double sqrt(double);
double identicalAlignedParallelRects(double X, double Y) {
  double X2, Y2, sqrt1pX2, sqrt1pY2;
  X2 = X * X;
  Y2 = Y * Y;
  sqrt1pX2 = sqrt(1.0 + X2);
  sqrt1pY2 = sqrt(1.0 + Y2);
  return 2.0 *
         (0.5 * log((1.0 + X2) * (1.0 + Y2) / (1 + X2 + Y2)) +
          X * sqrt1pY2 * atan(X / sqrt1pY2) +
          Y * sqrt1pX2 * atan(Y / sqrt1pX2) - X * atan(X) - Y * atan(Y)) /
         (M_PI * X * Y);
}


x86 assembly (clang, -O0):
<identicalAlignedParallelRects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe91(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe7a(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe6d(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5c(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe05(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd2b(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2d08(%rip),%rax
movsd  (%rax),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identicalAlignedParallelRects>:
sub    $0x68,%rsp
movapd %xmm0,0x10(%rsp)
movapd %xmm1,0x30(%rsp)
unpcklpd %xmm1,%xmm0
mulpd  %xmm0,%xmm0
movapd 0xeb0(%rip),%xmm2
movapd %xmm0,0x20(%rsp)
addpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
movapd %xmm2,0x40(%rsp)
jb     1173 <identicalAlignedParallelRects+0x43>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1186 <identicalAlignedParallelRects+0x56>
movapd %xmm2,%xmm0
call   1050 <sqrt@plt>
xorpd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm2
movsd  %xmm0,(%rsp)
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
ucomisd %xmm1,%xmm3
jb     11a2 <identicalAlignedParallelRects+0x72>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    11bd <identicalAlignedParallelRects+0x8d>
movapd %xmm3,%xmm0
movapd %xmm3,0x50(%rsp)
call   1050 <sqrt@plt>
movapd 0x50(%rsp),%xmm3
movapd 0x40(%rsp),%xmm2
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm3,%xmm0
movapd 0x20(%rsp),%xmm1
unpckhpd %xmm1,%xmm1
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
call   1040 <log@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
call   1030 <atan@plt>
movsd  0x20(%rsp),%xmm1
mulsd  0xdf7(%rip),%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x30(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  (%rsp),%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <atan@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <atan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd 0x30(%rsp),%xmm0
call   1030 <atan@plt>
movapd 0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  (%rsp),%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm2,%xmm2
mov    0x2d46(%rip),%rax
movapd 0x10(%rsp),%xmm0
mulsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x68,%rsp
ret

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

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