#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, int);
double CE_pHP_M(double pH, double P, double K1, double K2, double Kw,
                double f) {
  double H3O, t0;
  H3O = pow(10, (3 - pH)) / f;
  K1 = K1 / pow(f, 2);
  K2 = K2 / pow(f, 4);
  Kw = Kw / pow(f, 2);
  t0 = -(2.0 * P * H3O * K1 * K2 - Kw * K1 * K2 + K1 * K2 * H3O * H3O +
         H3O * H3O * K1 * P - Kw * K1 * H3O + H3O * H3O * H3O * K1 -
         H3O * H3O * Kw + H3O * H3O * H3O * H3O) /
       (-K1 * K2 + H3O * H3O) / H3O;
  return t0;
}


x86 assembly (clang, -O0):
<CE_pHP_M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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  0xed2(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xeb9(%rip),%xmm0
call   1030 <pow@plt>
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe1c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm2
mulsd  -0x38(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CE_pHP_M>:
sub    $0x68,%rsp
movaps %xmm5,0x20(%rsp)
movaps %xmm4,0x50(%rsp)
movsd  %xmm3,0x8(%rsp)
movaps %xmm2,0x40(%rsp)
movsd  %xmm1,0x38(%rsp)
movsd  0xec9(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movsd  0xec1(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,0x10(%rsp)
movapd 0x20(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movapd 0x10(%rsp),%xmm3
unpcklpd 0x40(%rsp),%xmm3
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm3
movapd %xmm3,0x10(%rsp)
movapd %xmm2,%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0x20(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movapd 0x50(%rsp),%xmm4
divsd  %xmm0,%xmm4
movsd  0x38(%rsp),%xmm6
movapd %xmm6,%xmm0
addsd  %xmm6,%xmm0
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movapd 0xe26(%rip),%xmm8
movapd %xmm4,%xmm3
movapd %xmm4,%xmm7
xorpd  %xmm8,%xmm3
mulsd  %xmm1,%xmm3
movsd  0x8(%rsp),%xmm5
movapd %xmm5,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm5
movapd %xmm2,%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm5,%xmm9
mulsd  %xmm2,%xmm4
addsd  %xmm0,%xmm4
movapd %xmm2,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm2,%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm5,%xmm7
subsd  %xmm7,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm8,%xmm0
subsd  %xmm9,%xmm5
divsd  %xmm5,%xmm0
divsd  %xmm2,%xmm0
add    $0x68,%rsp
ret

LLVM IR (-O0):
define double @CE_pHP_M(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
%14 = 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
%15 = load double, double* %7
%16 = fsub double 3.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = call double @pow(double 1.000000e+01, i32 %17)
%19 = load double, double* %12
%20 = fdiv double %18, %19
store double %20, double* %13
%21 = load double, double* %9
%22 = load double, double* %12
%23 = call double @pow(double %22, i32 2)
%24 = fdiv double %21, %23
store double %24, double* %9
%25 = load double, double* %10
%26 = load double, double* %12
%27 = call double @pow(double %26, i32 4)
%28 = fdiv double %25, %27
store double %28, double* %10
%29 = load double, double* %11
%30 = load double, double* %12
%31 = call double @pow(double %30, i32 2)
%32 = fdiv double %29, %31
store double %32, double* %11
%33 = load double, double* %8
%34 = fmul double 2.000000e+00, %33
%35 = load double, double* %13
%36 = fmul double %34, %35
%37 = load double, double* %9
%38 = fmul double %36, %37
%39 = load double, double* %10
%40 = load double, double* %11
%41 = load double, double* %9
%42 = fmul double %40, %41
%43 = load double, double* %10
%44 = fmul double %42, %43
%45 = fneg double %44
%46 = call double @llvm.fmuladd.f64(double %38, double %39, double %45)
%47 = load double, double* %9
%48 = load double, double* %10
%49 = fmul double %47, %48
%50 = load double, double* %13
%51 = fmul double %49, %50
%52 = load double, double* %13
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double %46)
%54 = load double, double* %13
%55 = load double, double* %13
%56 = fmul double %54, %55
%57 = load double, double* %9
%58 = fmul double %56, %57
%59 = load double, double* %8
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double %53)
%61 = load double, double* %11
%62 = load double, double* %9
%63 = fmul double %61, %62
%64 = load double, double* %13
%65 = fneg double %63
%66 = call double @llvm.fmuladd.f64(double %65, double %64, double %60)
%67 = load double, double* %13
%68 = load double, double* %13
%69 = fmul double %67, %68
%70 = load double, double* %13
%71 = fmul double %69, %70
%72 = load double, double* %9
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double %66)
%74 = load double, double* %13
%75 = load double, double* %13
%76 = fmul double %74, %75
%77 = load double, double* %11
%78 = fneg double %76
%79 = call double @llvm.fmuladd.f64(double %78, double %77, double %73)
%80 = load double, double* %13
%81 = load double, double* %13
%82 = fmul double %80, %81
%83 = load double, double* %13
%84 = fmul double %82, %83
%85 = load double, double* %13
%86 = call double @llvm.fmuladd.f64(double %84, double %85, double %79)
%87 = fneg double %86
%88 = load double, double* %9
%89 = fneg double %88
%90 = load double, double* %10
%91 = load double, double* %13
%92 = load double, double* %13
%93 = fmul double %91, %92
%94 = call double @llvm.fmuladd.f64(double %89, double %90, double %93)
%95 = fdiv double %87, %94
%96 = load double, double* %13
%97 = fdiv double %95, %96
store double %97, double* %14
%98 = load double, double* %14
ret double %98
}

LLVM IR (-O2):
define double @CE_pHP_M(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double 3.000000e+00, %0
%8 = fptosi double %7 to i32
%9 = tail call double @pow(double 1.000000e+01, i32 %8)
%10 = tail call double @pow(double %5, i32 2)
%11 = insertelement <2 x double> poison, double %2, i64 1
%12 = insertelement <2 x double> %11, double %9, i64 0
%13 = insertelement <2 x double> poison, double %5, i64 0
%14 = insertelement <2 x double> %13, double %10, i64 1
%15 = fdiv <2 x double> %12, %14
%16 = tail call double @pow(double %5, i32 4)
%17 = fdiv double %3, %16
%18 = tail call double @pow(double %5, i32 2)
%19 = fdiv double %4, %18
%20 = fmul double %1, 2.000000e+00
%21 = extractelement <2 x double> %15, i64 0
%22 = fmul double %20, %21
%23 = extractelement <2 x double> %15, i64 1
%24 = fmul double %22, %23
%25 = fneg double %19
%26 = fmul double %23, %25
%27 = fmul double %17, %26
%28 = tail call double @llvm.fmuladd.f64(double %24, double %17, double %27)
%29 = fmul double %23, %17
%30 = fmul double %21, %29
%31 = tail call double @llvm.fmuladd.f64(double %30, double %21, double %28)
%32 = fmul <2 x double> %15, %15
%33 = extractelement <2 x double> %32, i64 0
%34 = fmul double %33, %23
%35 = tail call double @llvm.fmuladd.f64(double %34, double %1, double %31)
%36 = tail call double @llvm.fmuladd.f64(double %26, double %21, double %35)
%37 = fmul <2 x double> %15, %32
%38 = extractelement <2 x double> %37, i64 0
%39 = tail call double @llvm.fmuladd.f64(double %38, double %23, double %36)
%40 = fneg double %33
%41 = tail call double @llvm.fmuladd.f64(double %40, double %19, double %39)
%42 = tail call double @llvm.fmuladd.f64(double %38, double %21, double %41)
%43 = fneg double %42
%44 = fneg double %23
%45 = tail call double @llvm.fmuladd.f64(double %44, double %17, double %33)
%46 = fdiv double %43, %45
%47 = fdiv double %46, %21
ret double %47
}