#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 */
int Cg(double);
double Kk(double);
int m0(double);
double pow(int, double);
double Aw(double T, double xw) {
  double x, xx;
  xx = .5 *
       (xw * Cg(T) - 2 * xw - m0(T) * Cg(T) +
        pow(pow(xw, 2) * pow(Cg(T), 2) - 2 * xw * pow(Cg(T), 2) * m0(T) +
                4 * xw * m0(T) * Cg(T) + pow(m0(T), 2) * pow(Cg(T), 2),
            .5)) /
       xw / (Cg(T) - 1) / Kk(T);
  if (xx > 1)
    x = 1;
  else
    x = xx;
  return x;
}


x86 assembly (clang, -O0):
<Aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
movsd  -0x98(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xe90(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1030 <m0@plt>
mov    %eax,-0x84(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
movsd  -0x90(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvttsd2si -0x10(%rbp),%edi
movsd  0xe1d(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xdff(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0xded(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xdcf(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <m0@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd74(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <m0@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <m0@plt>
mov    %eax,%edi
movsd  0xd0d(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xcef(%rip),%xmm0
call   1060 <pow@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xcc1(%rip),%xmm0
call   1060 <pow@plt>
movsd  -0x38(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  0xcab(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Cg@plt>
movsd  -0x30(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <Kk@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xc4e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13ce <Aw+0x28e>
movsd  0xc3c(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13d8 <Aw+0x298>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aw>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <Cg@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe9b(%rip),%xmm2
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <m0@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
cvttsd2si 0x10(%rsp),%edi
movsd  0xe45(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xe25(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xe05(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <m0@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xdc2(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <m0@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <m0@plt>
mov    %eax,%edi
movsd  0xd57(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
mov    %eax,%edi
movsd  0xd37(%rip),%xmm0
call   1060 <pow@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xd2a(%rip),%xmm0
call   1060 <pow@plt>
addsd  0x28(%rsp),%xmm0
mulsd  0xd17(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <Cg@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <Kk@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xcd1(%rip),%xmm0
minsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @Aw(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = load double, double* %3
%9 = call i32 @Cg(double %8)
%10 = sitofp i32 %9 to double
%11 = load double, double* %4
%12 = fmul double 2.000000e+00, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %7, double %10, double %13)
%15 = load double, double* %3
%16 = call i32 @m0(double %15)
%17 = load double, double* %3
%18 = call i32 @Cg(double %17)
%19 = mul nsw i32 %16, %18
%20 = sitofp i32 %19 to double
%21 = fsub double %14, %20
%22 = load double, double* %4
%23 = fptosi double %22 to i32
%24 = call double @pow(i32 %23, double 2.000000e+00)
%25 = load double, double* %3
%26 = call i32 @Cg(double %25)
%27 = call double @pow(i32 %26, double 2.000000e+00)
%28 = load double, double* %4
%29 = fmul double 2.000000e+00, %28
%30 = load double, double* %3
%31 = call i32 @Cg(double %30)
%32 = call double @pow(i32 %31, double 2.000000e+00)
%33 = fmul double %29, %32
%34 = load double, double* %3
%35 = call i32 @m0(double %34)
%36 = sitofp i32 %35 to double
%37 = fmul double %33, %36
%38 = fneg double %37
%39 = call double @llvm.fmuladd.f64(double %24, double %27, double %38)
%40 = load double, double* %4
%41 = fmul double 4.000000e+00, %40
%42 = load double, double* %3
%43 = call i32 @m0(double %42)
%44 = sitofp i32 %43 to double
%45 = fmul double %41, %44
%46 = load double, double* %3
%47 = call i32 @Cg(double %46)
%48 = sitofp i32 %47 to double
%49 = call double @llvm.fmuladd.f64(double %45, double %48, double %39)
%50 = load double, double* %3
%51 = call i32 @m0(double %50)
%52 = call double @pow(i32 %51, double 2.000000e+00)
%53 = load double, double* %3
%54 = call i32 @Cg(double %53)
%55 = call double @pow(i32 %54, double 2.000000e+00)
%56 = call double @llvm.fmuladd.f64(double %52, double %55, double %49)
%57 = fptosi double %56 to i32
%58 = call double @pow(i32 %57, double 5.000000e-01)
%59 = fadd double %21, %58
%60 = fmul double 5.000000e-01, %59
%61 = load double, double* %4
%62 = fdiv double %60, %61
%63 = load double, double* %3
%64 = call i32 @Cg(double %63)
%65 = sub nsw i32 %64, 1
%66 = sitofp i32 %65 to double
%67 = fdiv double %62, %66
%68 = load double, double* %3
%69 = call double @Kk(double %68)
%70 = fdiv double %67, %69
store double %70, double* %6
%71 = load double, double* %6
%72 = fcmp ogt double %71, 1.000000e+00
br i1 %72, label %73, label %74
73: ; preds = %2
store double 1.000000e+00, double* %5
br label %76
74: ; preds = %2
%75 = load double, double* %6
store double %75, double* %5
br label %76
76: ; preds = %74, %73
%77 = load double, double* %5
ret double %77
}

LLVM IR (-O2):
define double @Aw(double %0, double %1) {
%3 = tail call i32 @Cg(double %0)
%4 = sitofp i32 %3 to double
%5 = fmul double %1, -2.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %5)
%7 = tail call i32 @m0(double %0)
%8 = tail call i32 @Cg(double %0)
%9 = mul nsw i32 %8, %7
%10 = sitofp i32 %9 to double
%11 = fsub double %6, %10
%12 = fptosi double %1 to i32
%13 = tail call double @pow(i32 %12, double 2.000000e+00)
%14 = tail call i32 @Cg(double %0)
%15 = tail call double @pow(i32 %14, double 2.000000e+00)
%16 = tail call i32 @Cg(double %0)
%17 = tail call double @pow(i32 %16, double 2.000000e+00)
%18 = tail call i32 @m0(double %0)
%19 = sitofp i32 %18 to double
%20 = fmul double %5, %17
%21 = fmul double %20, %19
%22 = tail call double @llvm.fmuladd.f64(double %13, double %15, double %21)
%23 = fmul double %1, 4.000000e+00
%24 = tail call i32 @m0(double %0)
%25 = sitofp i32 %24 to double
%26 = fmul double %23, %25
%27 = tail call i32 @Cg(double %0)
%28 = sitofp i32 %27 to double
%29 = tail call double @llvm.fmuladd.f64(double %26, double %28, double %22)
%30 = tail call i32 @m0(double %0)
%31 = tail call double @pow(i32 %30, double 2.000000e+00)
%32 = tail call i32 @Cg(double %0)
%33 = tail call double @pow(i32 %32, double 2.000000e+00)
%34 = tail call double @llvm.fmuladd.f64(double %31, double %33, double %29)
%35 = fptosi double %34 to i32
%36 = tail call double @pow(i32 %35, double 5.000000e-01)
%37 = fadd double %11, %36
%38 = fmul double %37, 5.000000e-01
%39 = fdiv double %38, %1
%40 = tail call i32 @Cg(double %0)
%41 = add nsw i32 %40, -1
%42 = sitofp i32 %41 to double
%43 = fdiv double %39, %42
%44 = tail call double @Kk(double %0)
%45 = fdiv double %43, %44
%46 = fcmp ogt double %45, 1.000000e+00
%47 = select i1 %46, double 1.000000e+00, double %45
ret double %47
}