#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 log(double);
double qacc(double w, double v, double s, double a1, double a2, double a3,
            double alpha, double beta) {
  double r;
  r = s / (s - 1.0);
  return beta * (w - v) + (a1 + 1.0 - alpha) * log(w / v) +
         a3 * log((r + w) / (r + v)) -
         (a1 + a2 + a3 + 2.0) * log((1.0 + w) / (1.0 + v));
}


x86 assembly (clang, -O0):
<qacc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe7d(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xdec(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xdd3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xdc6(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qacc>:
sub    $0x48,%rsp
movsd  %xmm7,(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  %xmm4,0x10(%rsp)
movsd  %xmm3,0x40(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movsd  0xec1(%rip),%xmm4
addsd  %xmm2,%xmm4
divsd  %xmm4,%xmm2
movsd  %xmm2,0x38(%rsp)
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x30(%rsp)
addsd  0xea5(%rip),%xmm3
subsd  %xmm6,%xmm3
movsd  %xmm3,0x28(%rsp)
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  0x18(%rsp),%xmm0
addsd  0x20(%rsp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm2
addsd  0x40(%rsp),%xmm2
addsd  %xmm1,%xmm2
addsd  0xe3f(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0xe18(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @qacc(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%18 = load double, double* %11
%19 = load double, double* %11
%20 = fsub double %19, 1.000000e+00
%21 = fdiv double %18, %20
store double %21, double* %17
%22 = load double, double* %16
%23 = load double, double* %9
%24 = load double, double* %10
%25 = fsub double %23, %24
%26 = load double, double* %12
%27 = fadd double %26, 1.000000e+00
%28 = load double, double* %15
%29 = fsub double %27, %28
%30 = load double, double* %9
%31 = load double, double* %10
%32 = fdiv double %30, %31
%33 = call double @log(double %32)
%34 = fmul double %29, %33
%35 = call double @llvm.fmuladd.f64(double %22, double %25, double %34)
%36 = load double, double* %14
%37 = load double, double* %17
%38 = load double, double* %9
%39 = fadd double %37, %38
%40 = load double, double* %17
%41 = load double, double* %10
%42 = fadd double %40, %41
%43 = fdiv double %39, %42
%44 = call double @log(double %43)
%45 = call double @llvm.fmuladd.f64(double %36, double %44, double %35)
%46 = load double, double* %12
%47 = load double, double* %13
%48 = fadd double %46, %47
%49 = load double, double* %14
%50 = fadd double %48, %49
%51 = fadd double %50, 2.000000e+00
%52 = load double, double* %9
%53 = fadd double 1.000000e+00, %52
%54 = load double, double* %10
%55 = fadd double 1.000000e+00, %54
%56 = fdiv double %53, %55
%57 = call double @log(double %56)
%58 = fneg double %51
%59 = call double @llvm.fmuladd.f64(double %58, double %57, double %45)
ret double %59
}

LLVM IR (-O2):
define double @qacc(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = fadd double %2, -1.000000e+00
%10 = fdiv double %2, %9
%11 = fsub double %0, %1
%12 = fadd double %3, 1.000000e+00
%13 = fsub double %12, %6
%14 = fdiv double %0, %1
%15 = tail call double @log(double %14)
%16 = fmul double %13, %15
%17 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %16)
%18 = fadd double %10, %0
%19 = fadd double %10, %1
%20 = fdiv double %18, %19
%21 = tail call double @log(double %20)
%22 = tail call double @llvm.fmuladd.f64(double %5, double %21, double %17)
%23 = fadd double %3, %4
%24 = fadd double %23, %5
%25 = fadd double %24, 2.000000e+00
%26 = fadd double %0, 1.000000e+00
%27 = fadd double %1, 1.000000e+00
%28 = fdiv double %26, %27
%29 = tail call double @log(double %28)
%30 = fneg double %25
%31 = tail call double @llvm.fmuladd.f64(double %30, double %29, double %22)
ret double %31
}