#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 w_bar(double);
double w_bar_1(double);
double delta_x2(double x1, double x2, double x3, double x4, double r) {
  double p = x1 + x2;
  double q = 1 - p;
  double num;
  num = x2 * (w_bar_1(p) - w_bar(p)) +
        r * (1 - (0.5) * (0.1)) * (x1 * x4 - x2 * x3);
  return num / w_bar(p);
}


x86 assembly (clang, -O0):
<delta_x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb0(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <w_bar_1@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <w_bar@plt>
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm2
movsd  0xe62(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm5
movsd  -0x10(%rbp),%xmm4
mulsd  -0x18(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <w_bar@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_x2>:
sub    $0x38,%rsp
movsd  %xmm4,0x28(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <w_bar_1@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <w_bar@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm2
mulsd  0xe88(%rip),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x30(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <w_bar@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @delta_x2(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fadd double %14, %15
store double %16, double* %11
%17 = load double, double* %11
%18 = fsub double 1.000000e+00, %17
store double %18, double* %12
%19 = load double, double* %7
%20 = load double, double* %11
%21 = call double @w_bar_1(double %20)
%22 = load double, double* %11
%23 = call double @w_bar(double %22)
%24 = fsub double %21, %23
%25 = load double, double* %10
%26 = fmul double %25, 0x3FEE666666666666
%27 = load double, double* %6
%28 = load double, double* %9
%29 = load double, double* %7
%30 = load double, double* %8
%31 = fmul double %29, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %27, double %28, double %32)
%34 = fmul double %26, %33
%35 = call double @llvm.fmuladd.f64(double %19, double %24, double %34)
store double %35, double* %13
%36 = load double, double* %13
%37 = load double, double* %11
%38 = call double @w_bar(double %37)
%39 = fdiv double %36, %38
ret double %39
}

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