; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/router.ll (ZN6Router16get_router_powerEv)

; 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"

%class.TechnologyParameter = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::ScalingFactor", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType" }
%"class.TechnologyParameter::DeviceType" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::InterconnectType" = type { double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::ScalingFactor" = type { double, double, double }
%"class.TechnologyParameter::MemoryType" = type { double, double, double, double, double, double }
%class.Arbiter = type { %class.Component, double, double, double, double, double, double, double, double, double, double, double, ptr, double, double, double, double }
%class.Component = type { %class.Area, %class.powerDef, %class.powerDef, double, double }
%class.Area = type { double, double, double }
%class.powerDef = type { %class.powerComponents, %class.powerComponents, %class.powerComponents }
%class.powerComponents = type { double, double, double, double, double }
%class.Router = type { %class.Component, %class.Component, %class.Component, %class.Component, double, double, double, double, double, ptr, double, i32, i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }

@g_tp = external global %class.TechnologyParameter, align 8
@_ZL8pppm_lkg = external hidden constant [4 x double], align 16

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local void @_ZN6Router12buffer_statsEv(ptr noundef nonnull align 8 dereferenceable(1320)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Router8cb_statsEv(ptr noundef nonnull align 8 dereferenceable(1320)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Router16get_router_powerEv(ptr noundef nonnull align 8 dereferenceable(1320) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.Arbiter, align 8
  %4 = alloca %class.Arbiter, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [4 x double], align 16
  %8 = alloca %class.powerDef, align 8
  %9 = alloca %class.powerDef, align 8
  %10 = alloca %class.powerDef, align 8
  %11 = alloca %class.powerDef, align 8
  %12 = alloca %class.powerDef, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @_ZN6Router12buffer_statsEv(ptr noundef nonnull align 8 dereferenceable(1320) %13)
  call void @_ZN6Router8cb_statsEv(ptr noundef nonnull align 8 dereferenceable(1320) %13)
  call void @llvm.lifetime.start.p0(i64 408, ptr %3) #6
  %14 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 7
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 6
  %17 = load double, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 3
  %19 = getelementptr inbounds %class.Component, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %class.Area, ptr %19, i32 0, i32 0
  %21 = load double, ptr %20, align 8, !tbaa !19
  call void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408) %3, double noundef %15, double noundef %17, double noundef %21, ptr noundef getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 48))
  call void @llvm.lifetime.start.p0(i64 408, ptr %4) #6
  %22 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %23 = load double, ptr %22, align 8, !tbaa !20
  %24 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 6
  %25 = load double, ptr %24, align 8, !tbaa !18
  %26 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 2
  %27 = getelementptr inbounds %class.Component, ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds %class.Area, ptr %27, i32 0, i32 0
  %29 = load double, ptr %28, align 8, !tbaa !21
  invoke void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408) %4, double noundef %23, double noundef %25, double noundef %29, ptr noundef getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 48))
          to label %30 unwind label %153

30:                                               ; preds = %1
  invoke void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408) %3)
          to label %31 unwind label %157

31:                                               ; preds = %30
  invoke void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408) %4)
          to label %32 unwind label %157

32:                                               ; preds = %31
  %33 = getelementptr inbounds %class.Component, ptr %3, i32 0, i32 1
  %34 = getelementptr inbounds %class.powerDef, ptr %33, i32 0, i32 0
  %35 = getelementptr inbounds %class.powerComponents, ptr %34, i32 0, i32 0
  %36 = load double, ptr %35, align 8, !tbaa !22
  %37 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %38 = load double, ptr %37, align 8, !tbaa !20
  %39 = getelementptr inbounds %class.Component, ptr %4, i32 0, i32 1
  %40 = getelementptr inbounds %class.powerDef, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %class.powerComponents, ptr %40, i32 0, i32 0
  %42 = load double, ptr %41, align 8, !tbaa !22
  %43 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 18
  %44 = load double, ptr %43, align 8, !tbaa !23
  %45 = fmul double %42, %44
  %46 = call double @llvm.fmuladd.f64(double %36, double %38, double %45)
  %47 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 1
  %48 = getelementptr inbounds %class.Component, ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds %class.powerDef, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %class.powerComponents, ptr %49, i32 0, i32 0
  store double %46, ptr %50, align 8, !tbaa !24
  %51 = getelementptr inbounds %class.Component, ptr %3, i32 0, i32 1
  %52 = getelementptr inbounds %class.powerDef, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %class.powerComponents, ptr %52, i32 0, i32 1
  %54 = load double, ptr %53, align 8, !tbaa !25
  %55 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %56 = load double, ptr %55, align 8, !tbaa !20
  %57 = getelementptr inbounds %class.Component, ptr %4, i32 0, i32 1
  %58 = getelementptr inbounds %class.powerDef, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds %class.powerComponents, ptr %58, i32 0, i32 1
  %60 = load double, ptr %59, align 8, !tbaa !25
  %61 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 18
  %62 = load double, ptr %61, align 8, !tbaa !23
  %63 = fmul double %60, %62
  %64 = call double @llvm.fmuladd.f64(double %54, double %56, double %63)
  %65 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 1
  %66 = getelementptr inbounds %class.Component, ptr %65, i32 0, i32 1
  %67 = getelementptr inbounds %class.powerDef, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %class.powerComponents, ptr %67, i32 0, i32 1
  store double %64, ptr %68, align 8, !tbaa !26
  %69 = getelementptr inbounds %class.Component, ptr %3, i32 0, i32 1
  %70 = getelementptr inbounds %class.powerDef, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %class.powerComponents, ptr %70, i32 0, i32 2
  %72 = load double, ptr %71, align 8, !tbaa !27
  %73 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %74 = load double, ptr %73, align 8, !tbaa !20
  %75 = getelementptr inbounds %class.Component, ptr %4, i32 0, i32 1
  %76 = getelementptr inbounds %class.powerDef, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds %class.powerComponents, ptr %76, i32 0, i32 2
  %78 = load double, ptr %77, align 8, !tbaa !27
  %79 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 18
  %80 = load double, ptr %79, align 8, !tbaa !23
  %81 = fmul double %78, %80
  %82 = call double @llvm.fmuladd.f64(double %72, double %74, double %81)
  %83 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 1
  %84 = getelementptr inbounds %class.Component, ptr %83, i32 0, i32 1
  %85 = getelementptr inbounds %class.powerDef, ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds %class.powerComponents, ptr %85, i32 0, i32 2
  store double %82, ptr %86, align 8, !tbaa !28
  %87 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 3
  %88 = getelementptr inbounds %class.Component, ptr %87, i32 0, i32 1
  %89 = getelementptr inbounds %class.powerDef, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %class.powerComponents, ptr %89, i32 0, i32 0
  %91 = load double, ptr %90, align 8, !tbaa !29
  %92 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 3
  %93 = getelementptr inbounds %class.Component, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds %class.powerDef, ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds %class.powerComponents, ptr %94, i32 0, i32 0
  %96 = load double, ptr %95, align 8, !tbaa !30
  %97 = fadd double %91, %96
  %98 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 2
  %99 = getelementptr inbounds %class.Component, ptr %98, i32 0, i32 1
  %100 = getelementptr inbounds %class.powerDef, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %class.powerComponents, ptr %100, i32 0, i32 0
  %102 = load double, ptr %101, align 8, !tbaa !31
  %103 = fadd double %97, %102
  %104 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 1
  %105 = getelementptr inbounds %class.Component, ptr %104, i32 0, i32 1
  %106 = getelementptr inbounds %class.powerDef, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %class.powerComponents, ptr %106, i32 0, i32 0
  %108 = load double, ptr %107, align 8, !tbaa !24
  %109 = fadd double %103, %108
  %110 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %111 = load double, ptr %110, align 8, !tbaa !20
  %112 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 18
  %113 = load double, ptr %112, align 8, !tbaa !23
  %114 = fcmp olt double %111, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %32
  %116 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %117 = load double, ptr %116, align 8, !tbaa !20
  br label %121

118:                                              ; preds = %32
  %119 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 18
  %120 = load double, ptr %119, align 8, !tbaa !23
  br label %121

121:                                              ; preds = %118, %115
  %122 = phi double [ %117, %115 ], [ %120, %118 ]
  %123 = fmul double %109, %122
  %124 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 27
  %125 = load double, ptr %124, align 8, !tbaa !32
  %126 = fmul double %123, %125
  %127 = getelementptr inbounds %class.Component, ptr %13, i32 0, i32 1
  %128 = getelementptr inbounds %class.powerDef, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %class.powerComponents, ptr %128, i32 0, i32 0
  store double %126, ptr %129, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  store double 1.000000e+00, ptr %7, align 8, !tbaa !33
  %130 = getelementptr inbounds double, ptr %7, i64 1
  %131 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %132 = load double, ptr %131, align 8, !tbaa !20
  store double %132, ptr %130, align 8, !tbaa !33
  %133 = getelementptr inbounds double, ptr %7, i64 2
  %134 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 17
  %135 = load double, ptr %134, align 8, !tbaa !20
  store double %135, ptr %133, align 8, !tbaa !33
  %136 = getelementptr inbounds double, ptr %7, i64 3
  store double 1.000000e+00, ptr %136, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 120, ptr %8) #6
  %137 = getelementptr inbounds %class.Component, ptr %13, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 120, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %12) #6
  %138 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 3
  %139 = getelementptr inbounds %class.Component, ptr %138, i32 0, i32 1
  %140 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  invoke void @_ZmlRK8powerDefPKd(ptr dead_on_unwind writable sret(%class.powerDef) align 8 %12, ptr noundef nonnull align 8 dereferenceable(120) %139, ptr noundef %140)
          to label %141 unwind label %161

141:                                              ; preds = %121
  %142 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 2
  %143 = getelementptr inbounds %class.Component, ptr %142, i32 0, i32 1
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind writable sret(%class.powerDef) align 8 %11, ptr noundef nonnull align 8 dereferenceable(120) %12, ptr noundef nonnull align 8 dereferenceable(120) %143)
          to label %144 unwind label %161

144:                                              ; preds = %141
  %145 = getelementptr inbounds %class.Router, ptr %13, i32 0, i32 1
  %146 = getelementptr inbounds %class.Component, ptr %145, i32 0, i32 1
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind writable sret(%class.powerDef) align 8 %10, ptr noundef nonnull align 8 dereferenceable(120) %11, ptr noundef nonnull align 8 dereferenceable(120) %146)
          to label %147 unwind label %161

147:                                              ; preds = %144
  invoke void @_ZmlRK8powerDefPKd(ptr dead_on_unwind writable sret(%class.powerDef) align 8 %9, ptr noundef nonnull align 8 dereferenceable(120) %10, ptr noundef @_ZL8pppm_lkg)
          to label %148 unwind label %161

148:                                              ; preds = %147
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind writable sret(%class.powerDef) align 8 %8, ptr noundef nonnull align 8 dereferenceable(120) %137, ptr noundef nonnull align 8 dereferenceable(120) %9)
          to label %149 unwind label %161

149:                                              ; preds = %148
  %150 = getelementptr inbounds %class.Component, ptr %13, i32 0, i32 1
  %151 = invoke noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSEOS_(ptr noundef nonnull align 8 dereferenceable(120) %150, ptr noundef nonnull align 8 dereferenceable(120) %8)
          to label %152 unwind label %161

152:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 120, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %4) #6
  call void @llvm.lifetime.end.p0(i64 408, ptr %4) #6
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %3) #6
  call void @llvm.lifetime.end.p0(i64 408, ptr %3) #6
  ret void

153:                                              ; preds = %1
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %5, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %6, align 4
  br label %166

157:                                              ; preds = %31, %30
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %5, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %6, align 4
  br label %165

161:                                              ; preds = %149, %148, %147, %144, %141, %121
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %5, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  br label %165

165:                                              ; preds = %161, %157
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %4) #6
  br label %166

166:                                              ; preds = %165, %153
  call void @llvm.lifetime.end.p0(i64 408, ptr %4) #6
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %3) #6
  call void @llvm.lifetime.end.p0(i64 408, ptr %3) #6
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %5, align 8
  %169 = load i32, ptr %6, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

declare void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408), double noundef, double noundef, double noundef, ptr noundef) unnamed_addr #3

declare void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408)) #3

declare void @_ZplRK8powerDefS1_(ptr dead_on_unwind writable sret(%class.powerDef) align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) #3

declare void @_ZmlRK8powerDefPKd(ptr dead_on_unwind writable sret(%class.powerDef) align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSEOS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) #4 align 2

; Function Attrs: nounwind
declare void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408)) unnamed_addr #5

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 = { "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 "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 #6 = { 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++ TBAA"}
!9 = !{!10, !13, i64 1144}
!10 = !{!"_ZTS6Router", !11, i64 0, !11, i64 280, !11, i64 560, !11, i64 840, !13, i64 1120, !13, i64 1128, !13, i64 1136, !13, i64 1144, !13, i64 1152, !6, i64 1160, !13, i64 1168, !16, i64 1176, !17, i64 1180, !13, i64 1184, !13, i64 1192, !13, i64 1200, !13, i64 1208, !13, i64 1216, !13, i64 1224, !13, i64 1232, !13, i64 1240, !13, i64 1248, !13, i64 1256, !13, i64 1264, !13, i64 1272, !13, i64 1280, !13, i64 1288, !13, i64 1296, !13, i64 1304, !13, i64 1312}
!11 = !{!"_ZTS9Component", !12, i64 0, !14, i64 24, !14, i64 144, !13, i64 264, !13, i64 272}
!12 = !{!"_ZTS4Area", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS8powerDef", !15, i64 0, !15, i64 40, !15, i64 80}
!15 = !{!"_ZTS15powerComponents", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!16 = !{!"_ZTS9Wire_type", !7, i64 0}
!17 = !{!"_ZTS14Wire_placement", !7, i64 0}
!18 = !{!10, !13, i64 1136}
!19 = !{!10, !13, i64 840}
!20 = !{!10, !13, i64 1216}
!21 = !{!10, !13, i64 560}
!22 = !{!11, !13, i64 24}
!23 = !{!10, !13, i64 1224}
!24 = !{!10, !13, i64 304}
!25 = !{!11, !13, i64 32}
!26 = !{!10, !13, i64 312}
!27 = !{!11, !13, i64 40}
!28 = !{!10, !13, i64 320}
!29 = !{!10, !13, i64 864}
!30 = !{!10, !13, i64 904}
!31 = !{!10, !13, i64 584}
!32 = !{!10, !13, i64 1296}
!33 = !{!13, !13, 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"

%class.TechnologyParameter = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::ScalingFactor", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType" }
%"class.TechnologyParameter::DeviceType" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::InterconnectType" = type { double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::ScalingFactor" = type { double, double, double }
%"class.TechnologyParameter::MemoryType" = type { double, double, double, double, double, double }
%class.Arbiter = type { %class.Component, double, double, double, double, double, double, double, double, double, double, double, ptr, double, double, double, double }
%class.Component = type { %class.Area, %class.powerDef, %class.powerDef, double, double }
%class.Area = type { double, double, double }
%class.powerDef = type { %class.powerComponents, %class.powerComponents, %class.powerComponents }
%class.powerComponents = type { double, double, double, double, double }

@g_tp = external global %class.TechnologyParameter, align 8
@_ZL8pppm_lkg = external hidden constant [4 x double], align 16

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Router12buffer_statsEv(ptr noundef nonnull align 8 dereferenceable(1320)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Router8cb_statsEv(ptr noundef nonnull align 8 dereferenceable(1320)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Router16get_router_powerEv(ptr noundef nonnull align 8 dereferenceable(1320) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.Arbiter, align 8
  %3 = alloca %class.Arbiter, align 8
  %4 = alloca [4 x double], align 16
  %5 = alloca %class.powerDef, align 8
  %6 = alloca %class.powerDef, align 8
  %7 = alloca %class.powerDef, align 8
  %8 = alloca %class.powerDef, align 8
  %9 = alloca %class.powerDef, align 8
  tail call void @_ZN6Router12buffer_statsEv(ptr noundef nonnull align 8 dereferenceable(1320) %0)
  tail call void @_ZN6Router8cb_statsEv(ptr noundef nonnull align 8 dereferenceable(1320) %0)
  call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %2) #7
  %10 = getelementptr inbounds i8, ptr %0, i64 1144
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 1136
  %13 = load double, ptr %12, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %0, i64 840
  %15 = load double, ptr %14, align 8, !tbaa !18
  call void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408) %2, double noundef %11, double noundef %13, double noundef %15, ptr noundef nonnull getelementptr inbounds (i8, ptr @g_tp, i64 864))
  call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %3) #7
  %16 = getelementptr inbounds i8, ptr %0, i64 1216
  %17 = load double, ptr %16, align 8, !tbaa !19
  %18 = load double, ptr %12, align 8, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %0, i64 560
  %20 = load double, ptr %19, align 8, !tbaa !20
  invoke void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408) %3, double noundef %17, double noundef %18, double noundef %20, ptr noundef nonnull getelementptr inbounds (i8, ptr @g_tp, i64 864))
          to label %21 unwind label %68

21:                                               ; preds = %1
  invoke void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408) %2)
          to label %22 unwind label %70

22:                                               ; preds = %21
  invoke void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408) %3)
          to label %23 unwind label %70

23:                                               ; preds = %22
  %24 = getelementptr inbounds i8, ptr %2, i64 24
  %25 = getelementptr inbounds i8, ptr %3, i64 24
  %26 = load <2 x double>, ptr %16, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %0, i64 304
  %28 = load <2 x double>, ptr %24, align 8, !tbaa !21
  %29 = load <2 x double>, ptr %25, align 8, !tbaa !21
  %30 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %31 = fmul <2 x double> %30, %29
  %32 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
  %33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %28, <2 x double> %32, <2 x double> %31)
  store <2 x double> %33, ptr %27, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %2, i64 40
  %35 = load double, ptr %34, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %3, i64 40
  %37 = load double, ptr %36, align 8, !tbaa !22
  %38 = extractelement <2 x double> %26, i64 1
  %39 = fmul double %38, %37
  %40 = extractelement <2 x double> %26, i64 0
  %41 = call double @llvm.fmuladd.f64(double %35, double %40, double %39)
  %42 = getelementptr inbounds i8, ptr %0, i64 320
  store double %41, ptr %42, align 8, !tbaa !23
  %43 = getelementptr inbounds i8, ptr %0, i64 864
  %44 = load double, ptr %43, align 8, !tbaa !24
  %45 = getelementptr inbounds i8, ptr %0, i64 904
  %46 = load double, ptr %45, align 8, !tbaa !25
  %47 = fadd double %44, %46
  %48 = getelementptr inbounds i8, ptr %0, i64 584
  %49 = load double, ptr %48, align 8, !tbaa !26
  %50 = fadd double %47, %49
  %51 = extractelement <2 x double> %33, i64 0
  %52 = fadd double %51, %50
  %53 = fcmp olt double %40, %38
  %. = select i1 %53, double %40, double %38
  %54 = fmul double %., %52
  %55 = getelementptr inbounds i8, ptr %0, i64 1296
  %56 = load double, ptr %55, align 8, !tbaa !27
  %57 = fmul double %56, %54
  %58 = getelementptr inbounds i8, ptr %0, i64 24
  store double %57, ptr %58, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  store double 1.000000e+00, ptr %4, align 16, !tbaa !21
  %59 = getelementptr inbounds i8, ptr %4, i64 8
  store double %40, ptr %59, align 8, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %4, i64 16
  store double %40, ptr %60, align 16, !tbaa !21
  %61 = getelementptr inbounds i8, ptr %4, i64 24
  store double 1.000000e+00, ptr %61, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #7
  invoke void @_ZmlRK8powerDefPKd(ptr dead_on_unwind nonnull writable sret(%class.powerDef) align 8 %9, ptr noundef nonnull align 8 dereferenceable(120) %43, ptr noundef nonnull %4)
          to label %62 unwind label %72

62:                                               ; preds = %23
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind nonnull writable sret(%class.powerDef) align 8 %8, ptr noundef nonnull align 8 dereferenceable(120) %9, ptr noundef nonnull align 8 dereferenceable(120) %48)
          to label %63 unwind label %72

63:                                               ; preds = %62
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind nonnull writable sret(%class.powerDef) align 8 %7, ptr noundef nonnull align 8 dereferenceable(120) %8, ptr noundef nonnull align 8 dereferenceable(120) %27)
          to label %64 unwind label %72

64:                                               ; preds = %63
  invoke void @_ZmlRK8powerDefPKd(ptr dead_on_unwind nonnull writable sret(%class.powerDef) align 8 %6, ptr noundef nonnull align 8 dereferenceable(120) %7, ptr noundef nonnull @_ZL8pppm_lkg)
          to label %65 unwind label %72

65:                                               ; preds = %64
  invoke void @_ZplRK8powerDefS1_(ptr dead_on_unwind nonnull writable sret(%class.powerDef) align 8 %5, ptr noundef nonnull align 8 dereferenceable(120) %58, ptr noundef nonnull align 8 dereferenceable(120) %6)
          to label %66 unwind label %72

66:                                               ; preds = %65
  %67 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSEOS_(ptr noundef nonnull align 8 dereferenceable(120) %58, ptr noundef nonnull align 8 dereferenceable(120) %5)
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %3) #7
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %3) #7
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %2) #7
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %2) #7
  ret void

68:                                               ; preds = %1
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %75

70:                                               ; preds = %22, %21
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %74

72:                                               ; preds = %65, %64, %63, %62, %23
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %74

74:                                               ; preds = %72, %70
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %71, %70 ]
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %3) #7
  br label %75

75:                                               ; preds = %74, %68
  %.pn.pn = phi { ptr, i32 } [ %.pn, %74 ], [ %69, %68 ]
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %3) #7
  call void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408) %2) #7
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn.pn
}

declare void @_ZN7ArbiterC1EdddPN19TechnologyParameter10DeviceTypeE(ptr noundef nonnull align 8 dereferenceable(408), double noundef, double noundef, double noundef, ptr noundef) unnamed_addr #3

declare void @_ZN7Arbiter13compute_powerEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #3

declare void @_ZplRK8powerDefS1_(ptr dead_on_unwind writable sret(%class.powerDef) align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #3

declare void @_ZmlRK8powerDefPKd(ptr dead_on_unwind writable sret(%class.powerDef) align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSEOS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare void @_ZN7ArbiterD1Ev(ptr noundef nonnull align 8 dereferenceable(408)) unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { "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 "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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !9, i64 1144}
!6 = !{!"_ZTS6Router", !7, i64 0, !7, i64 280, !7, i64 560, !7, i64 840, !9, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !14, i64 1160, !9, i64 1168, !15, i64 1176, !16, i64 1180, !9, i64 1184, !9, i64 1192, !9, i64 1200, !9, i64 1208, !9, i64 1216, !9, i64 1224, !9, i64 1232, !9, i64 1240, !9, i64 1248, !9, i64 1256, !9, i64 1264, !9, i64 1272, !9, i64 1280, !9, i64 1288, !9, i64 1296, !9, i64 1304, !9, i64 1312}
!7 = !{!"_ZTS9Component", !8, i64 0, !12, i64 24, !12, i64 144, !9, i64 264, !9, i64 272}
!8 = !{!"_ZTS4Area", !9, i64 0, !9, i64 8, !9, i64 16}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTS8powerDef", !13, i64 0, !13, i64 40, !13, i64 80}
!13 = !{!"_ZTS15powerComponents", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!"_ZTS9Wire_type", !10, i64 0}
!16 = !{!"_ZTS14Wire_placement", !10, i64 0}
!17 = !{!6, !9, i64 1136}
!18 = !{!6, !9, i64 840}
!19 = !{!6, !9, i64 1216}
!20 = !{!6, !9, i64 560}
!21 = !{!9, !9, i64 0}
!22 = !{!7, !9, i64 40}
!23 = !{!6, !9, i64 320}
!24 = !{!6, !9, i64 864}
!25 = !{!6, !9, i64 904}
!26 = !{!6, !9, i64 584}
!27 = !{!6, !9, i64 1296}
!28 = !{!7, !9, i64 24}


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