#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 pow(double, double);
double sqrt(double);
double perpCommonEdgeRects(double H, double W) {
  double H2 = H * H;
  double W2 = W * W;
  double H2pW2 = H2 + W2;
  double H2pW2p1 = H2pW2 + 1;
  double H2p1 = H2 + 1;
  double W2p1 = W2 + 1;
  double rootH2pW2 = sqrt(H2pW2);
  return (W * atan(1.0 / W) + H * atan(1.0 / H) -
          rootH2pW2 * atan(1.0 / rootH2pW2) +
          0.25 * log((W2p1 * H2p1 / H2pW2p1) *
                     pow(W2 * H2pW2p1 / (W2p1 * H2pW2), W2) *
                     pow(H2 * H2pW2p1 / (H2p1 * H2pW2), H2))) /
         (M_PI * W);
}


x86 assembly (clang, -O0):
<perpCommonEdgeRects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%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  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe7e(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe6c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe5a(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe2f(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe0b(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x80(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdc9(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x50(%rbp),%xmm1
movsd  0xcff(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2cd8(%rip),%rax
movsd  (%rax),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perpCommonEdgeRects>:
sub    $0x98,%rsp
movapd %xmm0,0x10(%rsp)
movapd %xmm0,%xmm2
movapd %xmm1,0x20(%rsp)
unpcklpd %xmm1,%xmm2
mulpd  %xmm2,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
movapd %xmm0,0x80(%rsp)
addsd  %xmm2,%xmm0
movsd  0xe84(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x60(%rsp)
movapd 0xe82(%rip),%xmm1
movapd %xmm2,0x70(%rsp)
addpd  %xmm2,%xmm1
movapd %xmm1,0x40(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm0,0x50(%rsp)
jb     11b4 <perpCommonEdgeRects+0x74>
sqrtsd %xmm0,%xmm0
jmp    11b9 <perpCommonEdgeRects+0x79>
call   1060 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0xe3a(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0xe21(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
call   1030 <atan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xdf2(%rip),%xmm0
divsd  (%rsp),%xmm0
call   1030 <atan@plt>
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd 0x60(%rsp),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,(%rsp)
movapd 0x70(%rsp),%xmm1
unpckhpd %xmm0,%xmm1
movapd %xmm2,%xmm0
unpcklpd 0x50(%rsp),%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
movaps 0x80(%rsp),%xmm1
call   1050 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x70(%rsp),%xmm1
movapd 0x60(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movapd 0x40(%rsp),%xmm2
mulsd  0x50(%rsp),%xmm2
divsd  %xmm2,%xmm0
call   1050 <pow@plt>
mulsd  (%rsp),%xmm0
call   1040 <log@plt>
mulsd  0xd48(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
mov    0x2d1b(%rip),%rax
movapd 0x20(%rsp),%xmm1
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x98,%rsp
ret

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

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