#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 pow(double const, double const);
int exactA(const double r, double *H, double *M) {
  const double L = 750000.0;
  const double M0 = 0.3 / 31556926.0;
  const double g = 9.81;
  const double rho = 910.0;
  const double n = 3.0;
  const double A = 1.0E-16 / 31556926.0;
  const double Gamma = 2 * pow(rho * g, n) * A / (n + 2);
  double m, p, C;
  if (r < L) {
    m = 2.0 * n + 2.0;
    p = 1.0 + 1.0 / n;
    C = pow(pow(2.0, n - 1) * M0 / Gamma, 1.0 / m);
    *H = C * pow(pow(L, p) - pow(r, p), n / m);
  } else {
    *H = 0.0;
  }
  *M = M0;
  return 0;
}


x86 assembly (clang, -O0):
<exactA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xf03(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xea2(%rip),%xmm0
movsd  0xea2(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe82(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe41(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1283 <exactA+0x173>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe2c(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <pow@plt>
movsd  0xe44(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  0xe3b(%rip),%xmm1
divsd  -0x58(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  0xdcd(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdc8(%rip),%xmm1
divsd  -0x58(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    128e <exactA+0x17e>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xda6(%rip),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exactA>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1166 <exactA+0x56>
movsd  0xed0(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
movsd  0xec7(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  0xec3(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mulsd  0xeba(%rip),%xmm0
movsd  %xmm0,(%rbx)
movabs $0x3e446a53246ee1a5,%rax
6a 44 3e
mov    %rax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @exactA(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 7.500000e+05, double* %7
store double 0x3E446A53246EE1A5, double* %8
store double 9.810000e+00, double* %9
store double 9.100000e+02, double* %10
store double 3.000000e+00, double* %11
store double 0x3B0EA5C21302C416, double* %12
%17 = call double @pow(double 8.927100e+03, double 3.000000e+00)
%18 = fmul double 2.000000e+00, %17
%19 = fmul double %18, 0x3B0EA5C21302C416
%20 = fdiv double %19, 5.000000e+00
store double %20, double* %13
%21 = load double, double* %4
%22 = fcmp olt double %21, 7.500000e+05
br i1 %22, label %23, label %43
23: ; preds = %3
store double 8.000000e+00, double* %14
store double 0x3FF5555555555555, double* %15
%24 = call double @pow(double 2.000000e+00, double 2.000000e+00)
%25 = fmul double %24, 0x3E446A53246EE1A5
%26 = load double, double* %13
%27 = fdiv double %25, %26
%28 = load double, double* %14
%29 = fdiv double 1.000000e+00, %28
%30 = call double @pow(double %27, double %29)
store double %30, double* %16
%31 = load double, double* %16
%32 = load double, double* %15
%33 = call double @pow(double 7.500000e+05, double %32)
%34 = load double, double* %4
%35 = load double, double* %15
%36 = call double @pow(double %34, double %35)
%37 = fsub double %33, %36
%38 = load double, double* %14
%39 = fdiv double 3.000000e+00, %38
%40 = call double @pow(double %37, double %39)
%41 = fmul double %31, %40
%42 = load double*, double** %5
store double %41, double* %42
br label %45
43: ; preds = %3
%44 = load double*, double** %5
store double 0.000000e+00, double* %44
br label %45
45: ; preds = %43, %23
%46 = load double*, double** %6
store double 0x3E446A53246EE1A5, double* %46
ret i32 0
}

LLVM IR (-O2):
define i32 @exactA(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = fcmp olt double %0, 7.500000e+05
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = tail call double @pow(double %0, double 0x3FF5555555555555)
%7 = fsub double 0x41903F0F18ECC10C, %6
%8 = tail call double @pow(double %7, double 3.750000e-01)
%9 = fmul double %8, 0x400E48B689D1AB63
br label %10
10: ; preds = %3, %5
%11 = phi double [ %9, %5 ], [ 0.000000e+00, %3 ]
store double %11, double* %1
store double 0x3E446A53246EE1A5, double* %2
ret i32 0
}