; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/basic_circuit.ll (Z12shortcircuitddddddddddd)

; 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: nounwind
declare double @log(double noundef) #1

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, double noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { inlinehint mustprogress 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 = { mustprogress 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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 nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z12shortcircuitddddddddddd(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, double noundef %10) local_unnamed_addr #2 {
  %12 = fsub double %10, %0
  %13 = fmul double %12, 1.000000e+01
  %14 = fdiv double %13, 2.718280e+00
  %15 = fcmp ugt double %14, 0.000000e+00
  br i1 %15, label %cdce.end, label %cdce.call, !prof !5

cdce.call:                                        ; preds = %11
  %16 = tail call double @log(double noundef %14) #3
  br label %cdce.end

cdce.end:                                         ; preds = %11, %cdce.call
  %17 = fmul double %1, 5.000000e-01
  %18 = fadd double %1, 1.000000e+00
  %19 = fsub double 1.000000e+00, %1
  %20 = tail call double @pow(double noundef %19, double noundef %1) #3
  %21 = tail call double @pow(double noundef %19, double noundef %17) #3
  %22 = fsub double %19, %1
  %23 = fadd double %17, %1
  %24 = fadd double %23, 2.000000e+00
  %25 = tail call double @pow(double noundef %22, double noundef %24) #3
  %26 = tail call noundef double @_ZSt3powIidEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 2, double noundef %1)
  %27 = tail call double @pow(double noundef %19, double noundef %1) #3
  %28 = tail call double @pow(double noundef %22, double noundef %18) #3
  ret double 0.000000e+00
}

attributes #0 = { 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 #1 = { inlinehint mustprogress 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 #2 = { mustprogress 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 #3 = { 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 = !{!"branch_weights", i32 1048575, i32 1}


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