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

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z19shortcircuit_simpleddddddddddd(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) #2 {
  %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
  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 %30, 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 %31, align 8, !tbaa !5
  %41 = load double, ptr %15, align 8, !tbaa !5
  %42 = load double, ptr %14, align 8, !tbaa !5
  %43 = fdiv double %41, %42
  store double %43, ptr %32, align 8, !tbaa !5
  %44 = load double, ptr %19, align 8, !tbaa !5
  %45 = load double, ptr %18, align 8, !tbaa !5
  %46 = fdiv double %44, %45
  store double %46, ptr %33, align 8, !tbaa !5
  %47 = load double, ptr %12, align 8, !tbaa !5
  %48 = load double, ptr %22, align 8, !tbaa !5
  %49 = fdiv double %47, %48
  store double %49, ptr %34, align 8, !tbaa !5
  %50 = load double, ptr %22, align 8, !tbaa !5
  %51 = load double, ptr %12, align 8, !tbaa !5
  %52 = fsub double %50, %51
  %53 = load double, ptr %34, align 8, !tbaa !5
  %54 = fsub double %52, %53
  %55 = call double @pow(double noundef %54, double noundef 3.000000e+00) #5
  %56 = load double, ptr %13, align 8, !tbaa !5
  %57 = call double @pow(double noundef %56, double noundef 2.000000e+00) #5
  %58 = fdiv double %55, %57
  %59 = load double, ptr %34, align 8, !tbaa !5
  %60 = fmul double 3.000000e+00, %59
  %61 = load double, ptr %34, align 8, !tbaa !5
  %62 = fmul double %60, %61
  %63 = call double @pow(double noundef 2.000000e+00, double noundef %62) #5
  %64 = fdiv double %58, %63
  %65 = fmul double 3.000000e+00, %64
  %66 = load double, ptr %14, align 8, !tbaa !5
  %67 = fmul double %65, %66
  %68 = load double, ptr %22, align 8, !tbaa !5
  %69 = fmul double %67, %68
  %70 = load double, ptr %22, align 8, !tbaa !5
  %71 = fmul double %69, %70
  %72 = load double, ptr %31, align 8, !tbaa !5
  %73 = fmul double %71, %72
  %74 = load double, ptr %31, align 8, !tbaa !5
  %75 = fmul double %73, %74
  %76 = load double, ptr %32, align 8, !tbaa !5
  %77 = fdiv double %75, %76
  %78 = load double, ptr %33, align 8, !tbaa !5
  %79 = fdiv double %77, %78
  store double %79, ptr %26, align 8, !tbaa !5
  %80 = load double, ptr %22, align 8, !tbaa !5
  %81 = load double, ptr %12, align 8, !tbaa !5
  %82 = fsub double %80, %81
  %83 = load double, ptr %34, align 8, !tbaa !5
  %84 = fsub double %82, %83
  %85 = call double @pow(double noundef %84, double noundef 3.000000e+00) #5
  %86 = load double, ptr %13, align 8, !tbaa !5
  %87 = call double @pow(double noundef %86, double noundef 2.000000e+00) #5
  %88 = fdiv double %85, %87
  %89 = load double, ptr %34, align 8, !tbaa !5
  %90 = fmul double 3.000000e+00, %89
  %91 = load double, ptr %34, align 8, !tbaa !5
  %92 = fmul double %90, %91
  %93 = call double @pow(double noundef 2.000000e+00, double noundef %92) #5
  %94 = fdiv double %88, %93
  %95 = fmul double 3.000000e+00, %94
  %96 = load double, ptr %14, align 8, !tbaa !5
  %97 = fmul double %95, %96
  %98 = load double, ptr %22, align 8, !tbaa !5
  %99 = fmul double %97, %98
  %100 = load double, ptr %22, align 8, !tbaa !5
  %101 = fmul double %99, %100
  %102 = load double, ptr %30, align 8, !tbaa !5
  %103 = fmul double %101, %102
  %104 = load double, ptr %30, align 8, !tbaa !5
  %105 = fmul double %103, %104
  %106 = load double, ptr %32, align 8, !tbaa !5
  %107 = fdiv double %105, %106
  %108 = load double, ptr %33, align 8, !tbaa !5
  %109 = fmul double %107, %108
  store double %109, ptr %28, align 8, !tbaa !5
  %110 = load double, ptr %22, align 8, !tbaa !5
  %111 = load double, ptr %12, align 8, !tbaa !5
  %112 = fsub double %110, %111
  %113 = load double, ptr %34, align 8, !tbaa !5
  %114 = fsub double %112, %113
  %115 = call double @pow(double noundef %114, double noundef 1.500000e+00) #5
  %116 = load double, ptr %14, align 8, !tbaa !5
  %117 = fmul double %115, %116
  %118 = load double, ptr %22, align 8, !tbaa !5
  %119 = fmul double %117, %118
  %120 = load double, ptr %22, align 8, !tbaa !5
  %121 = fmul double %119, %120
  %122 = load double, ptr %31, align 8, !tbaa !5
  %123 = fmul double %121, %122
  %124 = fdiv double %123, 1.000000e+01
  %125 = load double, ptr %34, align 8, !tbaa !5
  %126 = load double, ptr %13, align 8, !tbaa !5
  %127 = fmul double 2.000000e+00, %126
  %128 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %125, double %127)
  %129 = 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 %128)
  %130 = fdiv double %124, %129
  store double %130, ptr %27, align 8, !tbaa !5
  %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 %34, align 8, !tbaa !5
  %135 = fsub double %133, %134
  %136 = call double @pow(double noundef %135, double noundef 1.500000e+00) #5
  %137 = load double, ptr %14, align 8, !tbaa !5
  %138 = fmul double %136, %137
  %139 = load double, ptr %22, align 8, !tbaa !5
  %140 = fmul double %138, %139
  %141 = load double, ptr %22, align 8, !tbaa !5
  %142 = fmul double %140, %141
  %143 = load double, ptr %30, align 8, !tbaa !5
  %144 = fmul double %142, %143
  %145 = fdiv double %144, 1.000000e+01
  %146 = load double, ptr %34, align 8, !tbaa !5
  %147 = load double, ptr %13, align 8, !tbaa !5
  %148 = fmul double 2.000000e+00, %147
  %149 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %146, double %148)
  %150 = 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 %149)
  %151 = fdiv double %145, %150
  store double %151, ptr %29, align 8, !tbaa !5
  %152 = load double, ptr %26, align 8, !tbaa !5
  store double %152, ptr %24, align 8, !tbaa !5
  %153 = load double, ptr %28, align 8, !tbaa !5
  store double %153, ptr %25, align 8, !tbaa !5
  %154 = load double, ptr %24, align 8, !tbaa !5
  %155 = load double, ptr %25, align 8, !tbaa !5
  %156 = fadd double %154, %155
  %157 = fdiv double %156, 2.000000e+00
  store double %157, ptr %23, align 8, !tbaa !5
  %158 = 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 %158
}

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

; 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) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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 = { 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 #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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z19shortcircuit_simpleddddddddddd(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 #1 {
  %12 = insertelement <2 x double> poison, double %6, i64 0
  %13 = insertelement <2 x double> %12, double %3, i64 1
  %14 = insertelement <2 x double> poison, double %8, i64 0
  %15 = insertelement <2 x double> %14, double %2, i64 1
  %16 = fdiv <2 x double> %13, %15
  %17 = fdiv double %7, %9
  %18 = fdiv double %0, %10
  %19 = fsub double %10, %0
  %20 = fsub double %19, %18
  %21 = tail call double @pow(double noundef %20, double noundef 3.000000e+00) #4
  %square = fmul double %1, %1
  %22 = fdiv double %21, %square
  %23 = fmul double %18, 3.000000e+00
  %24 = fmul double %18, %23
  %exp2 = tail call double @exp2(double %24)
  %25 = fdiv double %22, %exp2
  %26 = fmul double %25, 3.000000e+00
  %27 = fmul double %26, %2
  %28 = fmul double %27, %10
  %29 = fmul double %28, %10
  %30 = fmul double %17, %29
  %31 = fmul double %17, %30
  %32 = insertelement <2 x double> poison, double %31, i64 0
  %33 = insertelement <2 x double> %32, double %7, i64 1
  %34 = insertelement <2 x double> poison, double %6, i64 1
  %35 = shufflevector <2 x double> %34, <2 x double> %16, <2 x i32> <i32 3, i32 1>
  %36 = fdiv <2 x double> %33, %35
  %37 = extractelement <2 x double> %36, i64 0
  %38 = extractelement <2 x double> %36, i64 1
  %39 = fdiv double %37, %38
  %40 = tail call double @pow(double noundef %20, double noundef 3.000000e+00) #4
  %41 = fdiv double %40, %square
  %exp260 = tail call double @exp2(double %24)
  %42 = fdiv double %41, %exp260
  %43 = fmul double %42, 3.000000e+00
  %44 = fmul double %43, %2
  %45 = fmul double %44, %10
  %46 = fmul double %45, %10
  %47 = extractelement <2 x double> %16, i64 0
  %48 = fmul double %47, %46
  %49 = fmul double %47, %48
  %50 = extractelement <2 x double> %16, i64 1
  %51 = fdiv double %49, %50
  %52 = fmul double %38, %51
  %53 = tail call double @pow(double noundef %20, double noundef 1.500000e+00) #4
  %54 = fmul double %1, 2.000000e+00
  %55 = tail call double @llvm.fmuladd.f64(double %18, double 3.000000e+00, double %54)
  %56 = 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 %55)
  %57 = tail call double @pow(double noundef %20, double noundef 1.500000e+00) #4
  %58 = 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 %55)
  %59 = fadd double %39, %52
  %60 = fmul double %59, 5.000000e-01
  ret double %60
}

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

; 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 #3

declare double @exp2(double) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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 = { 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 = { 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)"}


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