#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 sqrt(double);
double maximum_point(double s, double a1, double a2, double a3) {
  double a, b, c, vbar;
  a = a2 + 1.0;
  b = a2 - a1 + (a2 + a3 + 1.0) / (s - 1.0);
  c = (a1 + 1.0) * s / (1.0 - s);
  vbar = (-b + sqrt(b * b - 4.0 * a * c)) / (2.0 * a);
  return vbar;
}


x86 assembly (clang, -O0):
<maximum_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xedc(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xea5(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8c(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe7a(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0xe31(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xde7(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum_point>:
sub    $0x28,%rsp
movapd %xmm2,%xmm5
subsd  %xmm1,%xmm5
addsd  %xmm2,%xmm3
movsd  0xed8(%rip),%xmm6
addsd  %xmm6,%xmm3
movsd  0xed4(%rip),%xmm4
addsd  %xmm0,%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm5,%xmm3
unpcklpd %xmm1,%xmm2
addpd  0xec4(%rip),%xmm2
subsd  %xmm0,%xmm6
movapd 0xec8(%rip),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm4
unpckhpd %xmm1,%xmm4
divsd  %xmm6,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118c <maximum_point+0x7c>
sqrtsd %xmm0,%xmm0
jmp    11a9 <maximum_point+0x99>
movapd %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movapd 0x10(%rsp),%xmm2
subsd  %xmm3,%xmm0
addsd  %xmm2,%xmm2
divsd  %xmm2,%xmm0
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define double @maximum_point(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %1
%6 = fadd double %2, %3
%7 = fadd double %6, 1.000000e+00
%8 = fadd double %0, -1.000000e+00
%9 = fdiv double %7, %8
%10 = fadd double %5, %9
%11 = insertelement <2 x double> poison, double %2, i64 0
%12 = insertelement <2 x double> %11, double %1, i64 1
%13 = fadd <2 x double> %12, <double 1.000000e+00, double 1.000000e+00>
%14 = fsub double 1.000000e+00, %0
%15 = insertelement <2 x double> <double -4.000000e+00, double poison>, double %0, i64 1
%16 = fmul <2 x double> %13, %15
%17 = extractelement <2 x double> %16, i64 1
%18 = fdiv double %17, %14
%19 = extractelement <2 x double> %16, i64 0
%20 = fmul double %19, %18
%21 = tail call double @llvm.fmuladd.f64(double %10, double %10, double %20)
%22 = tail call double @sqrt(double %21)
%23 = fsub double %22, %10
%24 = extractelement <2 x double> %13, i64 0
%25 = fmul double %24, 2.000000e+00
%26 = fdiv double %23, %25
ret double %26
}