; LLVM IR from zhenrong-wang/co2 :: co2_property_calc (calcfgh_dfgh_tsat)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

declare double @phird(double noundef, double noundef) #2

declare double @phirdd(double noundef, double noundef) #2

declare double @phir(double noundef, double noundef) #2

; Function Attrs: nounwind
declare double @log(double noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @calcfgh_dfgh_tsat(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store double %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !9
  store double %5, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %16 = load double, ptr %12, align 8, !tbaa !9
  %17 = fdiv double 0x4073020D1B71758E, %16
  store double %17, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %18 = load double, ptr %12, align 8, !tbaa !9
  %19 = fmul double 0x40F5914E8BEB5B2E, %18
  store double %19, ptr %15, align 8, !tbaa !9
  %20 = load double, ptr %15, align 8, !tbaa !9
  %21 = fneg double %20
  %22 = load double, ptr %10, align 8, !tbaa !9
  %23 = load double, ptr %10, align 8, !tbaa !9
  %24 = load double, ptr %10, align 8, !tbaa !9
  %25 = fmul double %23, %24
  %26 = load double, ptr %10, align 8, !tbaa !9
  %27 = load double, ptr %14, align 8, !tbaa !9
  %28 = call double @phird(double noundef %26, double noundef %27)
  %29 = call double @llvm.fmuladd.f64(double %25, double %28, double %22)
  %30 = load double, ptr %9, align 8, !tbaa !9
  %31 = call double @llvm.fmuladd.f64(double %21, double %29, double %30)
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds double, ptr %32, i64 0
  store double %31, ptr %33, align 8, !tbaa !9
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds [3 x double], ptr %34, i64 0
  %36 = getelementptr inbounds [3 x double], ptr %35, i64 0, i64 0
  store double -1.000000e+00, ptr %36, align 8, !tbaa !9
  %37 = load double, ptr %15, align 8, !tbaa !9
  %38 = load double, ptr %10, align 8, !tbaa !9
  %39 = fmul double 2.000000e+00, %38
  %40 = load double, ptr %10, align 8, !tbaa !9
  %41 = load double, ptr %14, align 8, !tbaa !9
  %42 = call double @phird(double noundef %40, double noundef %41)
  %43 = call double @llvm.fmuladd.f64(double %39, double %42, double 1.000000e+00)
  %44 = load double, ptr %10, align 8, !tbaa !9
  %45 = load double, ptr %10, align 8, !tbaa !9
  %46 = fmul double %44, %45
  %47 = load double, ptr %10, align 8, !tbaa !9
  %48 = load double, ptr %14, align 8, !tbaa !9
  %49 = call double @phirdd(double noundef %47, double noundef %48)
  %50 = call double @llvm.fmuladd.f64(double %46, double %49, double %43)
  %51 = fmul double %37, %50
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds [3 x double], ptr %52, i64 0
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0, i64 1
  store double %51, ptr %54, align 8, !tbaa !9
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds [3 x double], ptr %55, i64 0
  %57 = getelementptr inbounds [3 x double], ptr %56, i64 0, i64 2
  store double 0.000000e+00, ptr %57, align 8, !tbaa !9
  %58 = load double, ptr %15, align 8, !tbaa !9
  %59 = fneg double %58
  %60 = load double, ptr %11, align 8, !tbaa !9
  %61 = load double, ptr %11, align 8, !tbaa !9
  %62 = load double, ptr %11, align 8, !tbaa !9
  %63 = fmul double %61, %62
  %64 = load double, ptr %11, align 8, !tbaa !9
  %65 = load double, ptr %14, align 8, !tbaa !9
  %66 = call double @phird(double noundef %64, double noundef %65)
  %67 = call double @llvm.fmuladd.f64(double %63, double %66, double %60)
  %68 = load double, ptr %9, align 8, !tbaa !9
  %69 = call double @llvm.fmuladd.f64(double %59, double %67, double %68)
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %70, i64 1
  store double %69, ptr %71, align 8, !tbaa !9
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds [3 x double], ptr %72, i64 1
  %74 = getelementptr inbounds [3 x double], ptr %73, i64 0, i64 0
  store double -1.000000e+00, ptr %74, align 8, !tbaa !9
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds [3 x double], ptr %75, i64 1
  %77 = getelementptr inbounds [3 x double], ptr %76, i64 0, i64 1
  store double 0.000000e+00, ptr %77, align 8, !tbaa !9
  %78 = load double, ptr %15, align 8, !tbaa !9
  %79 = load double, ptr %11, align 8, !tbaa !9
  %80 = fmul double 2.000000e+00, %79
  %81 = load double, ptr %11, align 8, !tbaa !9
  %82 = load double, ptr %14, align 8, !tbaa !9
  %83 = call double @phird(double noundef %81, double noundef %82)
  %84 = call double @llvm.fmuladd.f64(double %80, double %83, double 1.000000e+00)
  %85 = load double, ptr %11, align 8, !tbaa !9
  %86 = load double, ptr %11, align 8, !tbaa !9
  %87 = fmul double %85, %86
  %88 = load double, ptr %11, align 8, !tbaa !9
  %89 = load double, ptr %14, align 8, !tbaa !9
  %90 = call double @phirdd(double noundef %88, double noundef %89)
  %91 = call double @llvm.fmuladd.f64(double %87, double %90, double %84)
  %92 = fmul double %78, %91
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds [3 x double], ptr %93, i64 1
  %95 = getelementptr inbounds [3 x double], ptr %94, i64 0, i64 2
  store double %92, ptr %95, align 8, !tbaa !9
  %96 = load double, ptr %15, align 8, !tbaa !9
  %97 = fneg double %96
  %98 = load double, ptr %10, align 8, !tbaa !9
  %99 = load double, ptr %14, align 8, !tbaa !9
  %100 = call double @phir(double noundef %98, double noundef %99)
  %101 = load double, ptr %11, align 8, !tbaa !9
  %102 = load double, ptr %14, align 8, !tbaa !9
  %103 = call double @phir(double noundef %101, double noundef %102)
  %104 = fsub double %100, %103
  %105 = load double, ptr %9, align 8, !tbaa !9
  %106 = load double, ptr %11, align 8, !tbaa !9
  %107 = fdiv double 1.000000e+00, %106
  %108 = load double, ptr %10, align 8, !tbaa !9
  %109 = fdiv double 1.000000e+00, %108
  %110 = fsub double %107, %109
  %111 = fmul double %105, %110
  %112 = call double @llvm.fmuladd.f64(double %97, double %104, double %111)
  %113 = load double, ptr %15, align 8, !tbaa !9
  %114 = load double, ptr %10, align 8, !tbaa !9
  %115 = load double, ptr %11, align 8, !tbaa !9
  %116 = fdiv double %114, %115
  %117 = call double @log(double noundef %116) #5
  %118 = fneg double %113
  %119 = call double @llvm.fmuladd.f64(double %118, double %117, double %112)
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds double, ptr %120, i64 2
  store double %119, ptr %121, align 8, !tbaa !9
  %122 = load double, ptr %10, align 8, !tbaa !9
  %123 = fdiv double 1.000000e+00, %122
  %124 = load double, ptr %11, align 8, !tbaa !9
  %125 = fdiv double 1.000000e+00, %124
  %126 = fsub double %123, %125
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds [3 x double], ptr %127, i64 2
  %129 = getelementptr inbounds [3 x double], ptr %128, i64 0, i64 0
  store double %126, ptr %129, align 8, !tbaa !9
  %130 = load double, ptr %15, align 8, !tbaa !9
  %131 = load double, ptr %10, align 8, !tbaa !9
  %132 = load double, ptr %14, align 8, !tbaa !9
  %133 = call double @phird(double noundef %131, double noundef %132)
  %134 = load double, ptr %10, align 8, !tbaa !9
  %135 = fdiv double 1.000000e+00, %134
  %136 = fadd double %133, %135
  %137 = load double, ptr %9, align 8, !tbaa !9
  %138 = load double, ptr %10, align 8, !tbaa !9
  %139 = load double, ptr %10, align 8, !tbaa !9
  %140 = fmul double %138, %139
  %141 = fdiv double %137, %140
  %142 = fneg double %141
  %143 = call double @llvm.fmuladd.f64(double %130, double %136, double %142)
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds [3 x double], ptr %144, i64 2
  %146 = getelementptr inbounds [3 x double], ptr %145, i64 0, i64 1
  store double %143, ptr %146, align 8, !tbaa !9
  %147 = load double, ptr %15, align 8, !tbaa !9
  %148 = load double, ptr %11, align 8, !tbaa !9
  %149 = load double, ptr %14, align 8, !tbaa !9
  %150 = call double @phird(double noundef %148, double noundef %149)
  %151 = fneg double %150
  %152 = load double, ptr %11, align 8, !tbaa !9
  %153 = fdiv double 1.000000e+00, %152
  %154 = fsub double %151, %153
  %155 = load double, ptr %9, align 8, !tbaa !9
  %156 = load double, ptr %11, align 8, !tbaa !9
  %157 = load double, ptr %11, align 8, !tbaa !9
  %158 = fmul double %156, %157
  %159 = fdiv double %155, %158
  %160 = call double @llvm.fmuladd.f64(double %147, double %154, double %159)
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds [3 x double], ptr %161, i64 2
  %163 = getelementptr inbounds [3 x double], ptr %162, i64 0, i64 2
  store double %160, ptr %163, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

declare double @phird(double noundef, double noundef) local_unnamed_addr #1

declare double @phirdd(double noundef, double noundef) local_unnamed_addr #1

declare double @phir(double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @calcfgh_dfgh_tsat(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) local_unnamed_addr #3 {
  %7 = fdiv double 0x4073020D1B71758E, %5
  %8 = fmul double %5, 0x40F5914E8BEB5B2E
  %9 = fneg double %8
  %10 = fmul double %3, %3
  %11 = tail call double @phird(double noundef %3, double noundef %7) #4
  %12 = tail call double @llvm.fmuladd.f64(double %10, double %11, double %3)
  %13 = tail call double @llvm.fmuladd.f64(double %9, double %12, double %2)
  store double %13, ptr %1, align 8, !tbaa !5
  store double -1.000000e+00, ptr %0, align 8, !tbaa !5
  %14 = fmul double %3, 2.000000e+00
  %15 = tail call double @phird(double noundef %3, double noundef %7) #4
  %16 = tail call double @llvm.fmuladd.f64(double %14, double %15, double 1.000000e+00)
  %17 = tail call double @phirdd(double noundef %3, double noundef %7) #4
  %18 = tail call double @llvm.fmuladd.f64(double %10, double %17, double %16)
  %19 = fmul double %8, %18
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  store double %19, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  store double 0.000000e+00, ptr %21, align 8, !tbaa !5
  %22 = fmul double %4, %4
  %23 = tail call double @phird(double noundef %4, double noundef %7) #4
  %24 = tail call double @llvm.fmuladd.f64(double %22, double %23, double %4)
  %25 = tail call double @llvm.fmuladd.f64(double %9, double %24, double %2)
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  store double %25, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  store <2 x double> <double -1.000000e+00, double 0.000000e+00>, ptr %27, align 8, !tbaa !5
  %28 = fmul double %4, 2.000000e+00
  %29 = tail call double @phird(double noundef %4, double noundef %7) #4
  %30 = tail call double @llvm.fmuladd.f64(double %28, double %29, double 1.000000e+00)
  %31 = tail call double @phirdd(double noundef %4, double noundef %7) #4
  %32 = tail call double @llvm.fmuladd.f64(double %22, double %31, double %30)
  %33 = fmul double %8, %32
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  store double %33, ptr %34, align 8, !tbaa !5
  %35 = tail call double @phir(double noundef %3, double noundef %7) #4
  %36 = tail call double @phir(double noundef %4, double noundef %7) #4
  %37 = fsub double %35, %36
  %38 = fdiv double 1.000000e+00, %4
  %39 = fdiv double 1.000000e+00, %3
  %40 = fsub double %38, %39
  %41 = fmul double %40, %2
  %42 = tail call double @llvm.fmuladd.f64(double %9, double %37, double %41)
  %43 = fdiv double %3, %4
  %44 = tail call double @log(double noundef %43) #4
  %45 = tail call double @llvm.fmuladd.f64(double %9, double %44, double %42)
  %46 = getelementptr inbounds i8, ptr %1, i64 16
  store double %45, ptr %46, align 8, !tbaa !5
  %47 = fsub double %39, %38
  %48 = getelementptr inbounds i8, ptr %0, i64 48
  store double %47, ptr %48, align 8, !tbaa !5
  %49 = tail call double @phird(double noundef %3, double noundef %7) #4
  %50 = fadd double %39, %49
  %51 = fneg double %2
  %52 = fdiv double %51, %10
  %53 = tail call double @llvm.fmuladd.f64(double %8, double %50, double %52)
  %54 = getelementptr inbounds i8, ptr %0, i64 56
  store double %53, ptr %54, align 8, !tbaa !5
  %55 = tail call double @phird(double noundef %4, double noundef %7) #4
  %56 = fneg double %55
  %57 = fsub double %56, %38
  %58 = fdiv double %2, %22
  %59 = tail call double @llvm.fmuladd.f64(double %8, double %57, double %58)
  %60 = getelementptr inbounds i8, ptr %0, i64 64
  store double %59, ptr %60, align 8, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass