#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 log10(double);
double pow(double, int);
double CE_CO2HCO3_pH(double CO2, double HCO3, double K1, double K2, double Kw,
                     double f) {
  double t0;
  K1 = K1 / pow(f, 2);
  K2 = K2 / pow(f, 4);
  Kw = Kw / pow(f, 2);
  t0 = K1 * CO2 / HCO3;
  return 3.0 - log10(t0 * f);
}


x86 assembly (clang, -O0):
<CE_CO2HCO3_pH>:
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  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CE_CO2HCO3_pH>:
sub    $0x28,%rsp
movsd  %xmm5,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movapd %xmm5,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <log10@plt>
movsd  0xe61(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @CE_CO2HCO3_pH(double %0, double %1, double %2, double %3, double %4, double %5) {
%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* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %9
%15 = load double, double* %12
%16 = call double @pow(double %15, i32 2)
%17 = fdiv double %14, %16
store double %17, double* %9
%18 = load double, double* %10
%19 = load double, double* %12
%20 = call double @pow(double %19, i32 4)
%21 = fdiv double %18, %20
store double %21, double* %10
%22 = load double, double* %11
%23 = load double, double* %12
%24 = call double @pow(double %23, i32 2)
%25 = fdiv double %22, %24
store double %25, double* %11
%26 = load double, double* %9
%27 = load double, double* %7
%28 = fmul double %26, %27
%29 = load double, double* %8
%30 = fdiv double %28, %29
store double %30, double* %13
%31 = load double, double* %13
%32 = load double, double* %12
%33 = fmul double %31, %32
%34 = call double @log10(double %33)
%35 = fsub double 3.000000e+00, %34
ret double %35
}

LLVM IR (-O2):
define double @CE_CO2HCO3_pH(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @pow(double %5, i32 2)
%8 = fdiv double %2, %7
%9 = tail call double @pow(double %5, i32 4)
%10 = tail call double @pow(double %5, i32 2)
%11 = fmul double %8, %0
%12 = fdiv double %11, %1
%13 = fmul double %12, %5
%14 = tail call double @log10(double %13)
%15 = fsub double 3.000000e+00, %14
ret double %15
}