#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 perpCommonEdgeRects1(double w, double h, double l) {
  double H, W, H2, W2, H2pW2, H2pW2p1, H2p1, W2p1, rootH2pW2;
  if (w * l * h <= 0.0)
    return 0.0;
  H = h / l;
  W = w / l;
  H2 = H * H;
  W2 = W * W;
  H2pW2 = H2 + W2;
  H2pW2p1 = H2pW2 + 1;
  H2p1 = H2 + 1;
  W2p1 = W2 + 1;
  rootH2pW2 = sqrt(H2pW2);
  return l * l *
         (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;
}


x86 assembly (clang, -O0):
<perpCommonEdgeRects1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1183 <perpCommonEdgeRects1+0x43>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    139e <perpCommonEdgeRects1+0x25e>
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe32(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe20(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe0e(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdd1(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xdaa(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xd5c(%rip),%xmm0
divsd  -0x68(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x98(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  0xc7e(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2c53(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perpCommonEdgeRects1>:
movapd %xmm0,%xmm4
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jae    1337 <perpCommonEdgeRects1+0x1f7>
sub    $0xa8,%rsp
unpcklpd %xmm4,%xmm1
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
movapd %xmm0,0x90(%rsp)
addsd  %xmm3,%xmm0
movsd  0xe66(%rip),%xmm4
addsd  %xmm0,%xmm4
movapd %xmm4,0x60(%rsp)
movapd 0xe64(%rip),%xmm4
movapd %xmm3,0x70(%rsp)
addpd  %xmm3,%xmm4
movapd %xmm4,0x40(%rsp)
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movapd %xmm0,0x50(%rsp)
movapd %xmm1,0x10(%rsp)
jb     11d8 <perpCommonEdgeRects1+0x98>
sqrtsd %xmm0,%xmm0
jmp    11ef <perpCommonEdgeRects1+0xaf>
movapd %xmm2,0x30(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
movapd 0x30(%rsp),%xmm2
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm2,%xmm2
movapd %xmm2,0x30(%rsp)
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movapd %xmm2,0x80(%rsp)
movsd  0xde8(%rip),%xmm0
divsd  %xmm2,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xdd1(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
call   1030 <atan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x80(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xd9f(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
call   1030 <atan@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0x40(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd 0x60(%rsp),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,0x10(%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 0x90(%rsp),%xmm1
call   1050 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%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  0x10(%rsp),%xmm0
call   1040 <log@plt>
mulsd  0xcef(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
mov    0x2cbc(%rip),%rax
divsd  (%rax),%xmm0
add    $0xa8,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @perpCommonEdgeRects1(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
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%17 = load double, double* %5
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = load double, double* %6
%21 = fmul double %19, %20
%22 = fcmp ole double %21, 0.000000e+00
br i1 %22, label %23, label %24
23: ; preds = %3
store double 0.000000e+00, double* %4
br label %97
24: ; preds = %3
%25 = load double, double* %6
%26 = load double, double* %7
%27 = fdiv double %25, %26
store double %27, double* %8
%28 = load double, double* %5
%29 = load double, double* %7
%30 = fdiv double %28, %29
store double %30, double* %9
%31 = load double, double* %8
%32 = load double, double* %8
%33 = fmul double %31, %32
store double %33, double* %10
%34 = load double, double* %9
%35 = load double, double* %9
%36 = fmul double %34, %35
store double %36, double* %11
%37 = load double, double* %10
%38 = load double, double* %11
%39 = fadd double %37, %38
store double %39, double* %12
%40 = load double, double* %12
%41 = fadd double %40, 1.000000e+00
store double %41, double* %13
%42 = load double, double* %10
%43 = fadd double %42, 1.000000e+00
store double %43, double* %14
%44 = load double, double* %11
%45 = fadd double %44, 1.000000e+00
store double %45, double* %15
%46 = load double, double* %12
%47 = call double @sqrt(double %46)
store double %47, double* %16
%48 = load double, double* %7
%49 = load double, double* %7
%50 = fmul double %48, %49
%51 = load double, double* %9
%52 = load double, double* %9
%53 = fdiv double 1.000000e+00, %52
%54 = call double @atan(double %53)
%55 = load double, double* %8
%56 = load double, double* %8
%57 = fdiv double 1.000000e+00, %56
%58 = call double @atan(double %57)
%59 = fmul double %55, %58
%60 = call double @llvm.fmuladd.f64(double %51, double %54, double %59)
%61 = load double, double* %16
%62 = load double, double* %16
%63 = fdiv double 1.000000e+00, %62
%64 = call double @atan(double %63)
%65 = fneg double %61
%66 = call double @llvm.fmuladd.f64(double %65, double %64, double %60)
%67 = load double, double* %15
%68 = load double, double* %14
%69 = fmul double %67, %68
%70 = load double, double* %13
%71 = fdiv double %69, %70
%72 = load double, double* %11
%73 = load double, double* %13
%74 = fmul double %72, %73
%75 = load double, double* %15
%76 = load double, double* %12
%77 = fmul double %75, %76
%78 = fdiv double %74, %77
%79 = load double, double* %11
%80 = call double @pow(double %78, double %79)
%81 = fmul double %71, %80
%82 = load double, double* %10
%83 = load double, double* %13
%84 = fmul double %82, %83
%85 = load double, double* %14
%86 = load double, double* %12
%87 = fmul double %85, %86
%88 = fdiv double %84, %87
%89 = load double, double* %10
%90 = call double @pow(double %88, double %89)
%91 = fmul double %81, %90
%92 = call double @log(double %91)
%93 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %92, double %66)
%94 = fmul double %50, %93
%95 = load double, double* @M_PI
%96 = fdiv double %94, %95
store double %96, double* %4
br label %97
97: ; preds = %24, %23
%98 = load double, double* %4
ret double %98
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @perpCommonEdgeRects1(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fmul double %4, %1
%6 = fcmp ugt double %5, 0.000000e+00
br i1 %6, label %7, label %56
7: ; preds = %3
%8 = insertelement <2 x double> poison, double %1, i64 0
%9 = insertelement <2 x double> %8, double %0, i64 1
%10 = insertelement <2 x double> poison, double %2, i64 0
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%12 = fdiv <2 x double> %9, %11
%13 = fmul <2 x double> %12, %12
%14 = extractelement <2 x double> %13, i64 0
%15 = extractelement <2 x double> %13, i64 1
%16 = fadd double %14, %15
%17 = fadd double %16, 1.000000e+00
%18 = fadd <2 x double> %13, <double 1.000000e+00, double 1.000000e+00>
%19 = tail call double @sqrt(double %16)
%20 = fmul double %2, %2
%21 = extractelement <2 x double> %12, i64 1
%22 = fdiv double 1.000000e+00, %21
%23 = tail call double @atan(double %22)
%24 = extractelement <2 x double> %12, i64 0
%25 = fdiv double 1.000000e+00, %24
%26 = tail call double @atan(double %25)
%27 = fmul double %24, %26
%28 = tail call double @llvm.fmuladd.f64(double %21, double %23, double %27)
%29 = fdiv double 1.000000e+00, %19
%30 = tail call double @atan(double %29)
%31 = fneg double %19
%32 = tail call double @llvm.fmuladd.f64(double %31, double %30, double %28)
%33 = extractelement <2 x double> %18, i64 0
%34 = extractelement <2 x double> %18, i64 1
%35 = fmul double %34, %33
%36 = fdiv double %35, %17
%37 = shufflevector <2 x double> %13, <2 x double> %18, <2 x i32> <i32 1, i32 3>
%38 = insertelement <2 x double> poison, double %17, i64 0
%39 = insertelement <2 x double> %38, double %16, i64 1
%40 = fmul <2 x double> %37, %39
%41 = extractelement <2 x double> %40, i64 0
%42 = extractelement <2 x double> %40, i64 1
%43 = fdiv double %41, %42
%44 = tail call double @pow(double %43, double %15)
%45 = fmul double %36, %44
%46 = fmul double %14, %17
%47 = fmul double %33, %16
%48 = fdiv double %46, %47
%49 = tail call double @pow(double %48, double %14)
%50 = fmul double %45, %49
%51 = tail call double @log(double %50)
%52 = tail call double @llvm.fmuladd.f64(double %51, double 2.500000e-01, double %32)
%53 = fmul double %20, %52
%54 = load double, double* @M_PI
%55 = fdiv double %53, %54
br label %56
56: ; preds = %3, %7
%57 = phi double [ %55, %7 ], [ 0.000000e+00, %3 ]
ret double %57
}