#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 square(double);
double SDoo(double a, double b, double c, double d) {
  return square((a * d) - (b * c)) / ((a + b) * (a + c) * (c + d) * (b + d));
}


x86 assembly (clang, -O0):
<SDoo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <square@plt>
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDoo>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm0
subsd  %xmm4,%xmm0
call   1030 <square@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm1
movsd  0x10(%rsp),%xmm4
addsd  %xmm4,%xmm1
movsd  0x18(%rsp),%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm1
movsd  0x20(%rsp),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @SDoo(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
%16 = call double @square(double %15)
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fadd double %17, %18
%20 = load double, double* %5
%21 = load double, double* %7
%22 = fadd double %20, %21
%23 = fmul double %19, %22
%24 = load double, double* %7
%25 = load double, double* %8
%26 = fadd double %24, %25
%27 = fmul double %23, %26
%28 = load double, double* %6
%29 = load double, double* %8
%30 = fadd double %28, %29
%31 = fmul double %27, %30
%32 = fdiv double %16, %31
ret double %32
}

LLVM IR (-O2):
define double @SDoo(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
%8 = tail call double @square(double %7)
%9 = fadd double %0, %1
%10 = fadd double %0, %2
%11 = fmul double %9, %10
%12 = fadd double %2, %3
%13 = fmul double %11, %12
%14 = fadd double %1, %3
%15 = fmul double %14, %13
%16 = fdiv double %8, %15
ret double %16
}