#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 diffSphereToAlignedRect1(double a, double b, double c) {
  double X = a / c;
  double Y = b / c;
  return 0.25 * atan(X * Y / sqrt(1.0 + X * X + Y * Y)) / M_PI;
}


x86 assembly (clang, -O0):
<diffSphereToAlignedRect1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2e2c(%rip),%rax
divsd  (%rax),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffSphereToAlignedRect1>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
unpcklpd %xmm1,%xmm3
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
movapd %xmm3,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm3
addsd  0xeb0(%rip),%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <diffSphereToAlignedRect1+0x48>
sqrtsd %xmm0,%xmm0
jmp    1177 <diffSphereToAlignedRect1+0x57>
movapd %xmm2,(%rsp)
call   1040 <sqrt@plt>
movapd (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <atan@plt>
mulsd  0xe7c(%rip),%xmm0
mov    0x2e55(%rip),%rax
divsd  (%rax),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @diffSphereToAlignedRect1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %6
%11 = fdiv double %9, %10
store double %11, double* %7
%12 = load double, double* %5
%13 = load double, double* %6
%14 = fdiv double %12, %13
store double %14, double* %8
%15 = load double, double* %7
%16 = load double, double* %8
%17 = fmul double %15, %16
%18 = load double, double* %7
%19 = load double, double* %7
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double 1.000000e+00)
%21 = load double, double* %8
%22 = load double, double* %8
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %20)
%24 = call double @sqrt(double %23)
%25 = fdiv double %17, %24
%26 = call double @atan(double %25)
%27 = fmul double 2.500000e-01, %26
%28 = load double, double* @M_PI
%29 = fdiv double %27, %28
ret double %29
}

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