; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/wire.ll (ZN4Wire16update_fullswingEv)

; 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.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 }
%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }
%class.Wire = type { %class.Component, i32, double, double, i32, double, double, double, double, double, i32, double, double, double, %"class.std::__cxx11::list", %class.Component, %class.Component, %class.Component, double, ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<Component, std::allocator<Component>>::_List_impl" }
%"struct.std::__cxx11::_List_base<Component, std::allocator<Component>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZN4Wire6globalE = external dso_local global %class.Component, align 8
@_ZN4Wire8global_5E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_10E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_20E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_30E = external dso_local global %class.Component, align 8

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Wire16update_fullswingEv(ptr noundef nonnull align 8 dereferenceable(1264) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca [4 x double], align 16
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca %"struct.std::_List_iterator", align 8
  %11 = alloca %"struct.std::_List_iterator", align 8
  %12 = alloca %"struct.std::_List_const_iterator", align 8
  %13 = alloca %"struct.std::_List_iterator", align 8
  %14 = alloca %"struct.std::_List_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @_ZNSt14_List_iteratorI9ComponentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  %16 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %17 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %18 = call double @llvm.fmuladd.f64(double %17, double 3.000000e-01, double %16)
  %19 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 3
  store double %18, ptr %19, align 8, !tbaa !15
  %20 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %21 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %22 = call double @llvm.fmuladd.f64(double %21, double 2.000000e-01, double %20)
  %23 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 2
  store double %22, ptr %23, align 16, !tbaa !15
  %24 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %25 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %26 = call double @llvm.fmuladd.f64(double %25, double 1.000000e-01, double %24)
  %27 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 1
  store double %26, ptr %27, align 8, !tbaa !15
  %28 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %29 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 3), align 8, !tbaa !9
  %30 = call double @llvm.fmuladd.f64(double %29, double 5.000000e-02, double %28)
  %31 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 0
  store double %30, ptr %31, align 16, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 4, ptr %8, align 4, !tbaa !16
  br label %32

32:                                               ; preds = %140, %1
  %33 = load i32, ptr %8, align 4, !tbaa !16
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %35, label %143

35:                                               ; preds = %32
  %36 = load i32, ptr %8, align 4, !tbaa !16
  %37 = sub nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !15
  store double %40, ptr %5, align 8, !tbaa !15
  store double 1.000000e+30, ptr %7, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %41 = getelementptr inbounds %class.Wire, ptr %15, i32 0, i32 14
  %42 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %43 = getelementptr inbounds %"struct.std::_List_iterator", ptr %9, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %44

44:                                               ; preds = %137, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %45 = getelementptr inbounds %class.Wire, ptr %15, i32 0, i32 14
  %46 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %47 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  %48 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI9ComponentES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br i1 %48, label %49, label %140

49:                                               ; preds = %44
  %50 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %51 = getelementptr inbounds %class.Component, ptr %50, i32 0, i32 3
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = load double, ptr %5, align 8, !tbaa !15
  %54 = fcmp ogt double %52, %53
  br i1 %54, label %55, label %63

55:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %56 = getelementptr inbounds %class.Wire, ptr %15, i32 0, i32 14
  call void @_ZNSt20_List_const_iteratorI9ComponentEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %57 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %12, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5eraseESt20_List_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr %58) #6
  %60 = getelementptr inbounds %"struct.std::_List_iterator", ptr %11, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %61 = call ptr @_ZNSt14_List_iteratorI9ComponentEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #6
  %62 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  br label %136

63:                                               ; preds = %49
  %64 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %65 = getelementptr inbounds %class.Component, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %class.powerDef, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %class.powerComponents, ptr %66, i32 0, i32 0
  %68 = load double, ptr %67, align 8, !tbaa !19
  %69 = load double, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 1), align 8, !tbaa !19
  %70 = fdiv double %68, %69
  %71 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %72 = getelementptr inbounds %class.Component, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %class.powerDef, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %class.powerComponents, ptr %73, i32 0, i32 1
  %75 = load double, ptr %74, align 8, !tbaa !20
  %76 = load double, ptr getelementptr inbounds (%class.powerComponents, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire6globalE, i32 0, i32 1), i32 0, i32 1), align 8, !tbaa !20
  %77 = fdiv double %75, %76
  %78 = fadd double %70, %77
  store double %78, ptr %6, align 8, !tbaa !15
  %79 = load double, ptr %6, align 8, !tbaa !15
  %80 = load double, ptr %7, align 8, !tbaa !15
  %81 = fcmp olt double %79, %80
  br i1 %81, label %82, label %135

82:                                               ; preds = %63
  %83 = load double, ptr %6, align 8, !tbaa !15
  store double %83, ptr %7, align 8, !tbaa !15
  %84 = load i32, ptr %8, align 4, !tbaa !16
  %85 = icmp eq i32 %84, 4
  br i1 %85, label %86, label %95

86:                                               ; preds = %82
  %87 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %88 = getelementptr inbounds %class.Component, ptr %87, i32 0, i32 3
  %89 = load double, ptr %88, align 8, !tbaa !9
  store double %89, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_30E, i32 0, i32 3), align 8, !tbaa !9
  %90 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %91 = getelementptr inbounds %class.Component, ptr %90, i32 0, i32 1
  %92 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_30E, i32 0, i32 1), ptr noundef nonnull align 8 dereferenceable(120) %91)
  %93 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %94 = getelementptr inbounds %class.Component, ptr %93, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN4Wire9global_30E, ptr align 8 %94, i64 24, i1 false), !tbaa.struct !21
  br label %134

95:                                               ; preds = %82
  %96 = load i32, ptr %8, align 4, !tbaa !16
  %97 = icmp eq i32 %96, 3
  br i1 %97, label %98, label %107

98:                                               ; preds = %95
  %99 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %100 = getelementptr inbounds %class.Component, ptr %99, i32 0, i32 3
  %101 = load double, ptr %100, align 8, !tbaa !9
  store double %101, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_20E, i32 0, i32 3), align 8, !tbaa !9
  %102 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %103 = getelementptr inbounds %class.Component, ptr %102, i32 0, i32 1
  %104 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_20E, i32 0, i32 1), ptr noundef nonnull align 8 dereferenceable(120) %103)
  %105 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %106 = getelementptr inbounds %class.Component, ptr %105, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN4Wire9global_20E, ptr align 8 %106, i64 24, i1 false), !tbaa.struct !21
  br label %133

107:                                              ; preds = %95
  %108 = load i32, ptr %8, align 4, !tbaa !16
  %109 = icmp eq i32 %108, 2
  br i1 %109, label %110, label %119

110:                                              ; preds = %107
  %111 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %112 = getelementptr inbounds %class.Component, ptr %111, i32 0, i32 3
  %113 = load double, ptr %112, align 8, !tbaa !9
  store double %113, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_10E, i32 0, i32 3), align 8, !tbaa !9
  %114 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %115 = getelementptr inbounds %class.Component, ptr %114, i32 0, i32 1
  %116 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (%class.Component, ptr @_ZN4Wire9global_10E, i32 0, i32 1), ptr noundef nonnull align 8 dereferenceable(120) %115)
  %117 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %118 = getelementptr inbounds %class.Component, ptr %117, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN4Wire9global_10E, ptr align 8 %118, i64 24, i1 false), !tbaa.struct !21
  br label %132

119:                                              ; preds = %107
  %120 = load i32, ptr %8, align 4, !tbaa !16
  %121 = icmp eq i32 %120, 1
  br i1 %121, label %122, label %131

122:                                              ; preds = %119
  %123 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %124 = getelementptr inbounds %class.Component, ptr %123, i32 0, i32 3
  %125 = load double, ptr %124, align 8, !tbaa !9
  store double %125, ptr getelementptr inbounds (%class.Component, ptr @_ZN4Wire8global_5E, i32 0, i32 3), align 8, !tbaa !9
  %126 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %127 = getelementptr inbounds %class.Component, ptr %126, i32 0, i32 1
  %128 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (%class.Component, ptr @_ZN4Wire8global_5E, i32 0, i32 1), ptr noundef nonnull align 8 dereferenceable(120) %127)
  %129 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %130 = getelementptr inbounds %class.Component, ptr %129, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN4Wire8global_5E, ptr align 8 %130, i64 24, i1 false), !tbaa.struct !21
  br label %131

131:                                              ; preds = %122, %119
  br label %132

132:                                              ; preds = %131, %110
  br label %133

133:                                              ; preds = %132, %98
  br label %134

134:                                              ; preds = %133, %86
  br label %135

135:                                              ; preds = %134, %63
  br label %136

136:                                              ; preds = %135, %55
  br label %137

137:                                              ; preds = %136
  %138 = call ptr @_ZNSt14_List_iteratorI9ComponentEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #6
  %139 = getelementptr inbounds %"struct.std::_List_iterator", ptr %14, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  br label %44, !llvm.loop !22

140:                                              ; preds = %44
  %141 = load i32, ptr %8, align 4, !tbaa !16
  %142 = add nsw i32 %141, -1
  store i32 %142, ptr %8, align 4, !tbaa !16
  br label %32, !llvm.loop !24

143:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorI9ComponentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorI9ComponentES3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt20_List_const_iteratorI9ComponentEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { inlinehint 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 = { 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 #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 264}
!10 = !{!"_ZTS9Component", !11, i64 0, !13, i64 24, !13, i64 144, !12, i64 264, !12, i64 272}
!11 = !{!"_ZTS4Area", !12, i64 0, !12, i64 8, !12, i64 16}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTS8powerDef", !14, i64 0, !14, i64 40, !14, i64 80}
!14 = !{!"_ZTS15powerComponents", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{i64 0, i64 8, !5}
!19 = !{!10, !12, i64 24}
!20 = !{!10, !12, i64 32}
!21 = !{i64 0, i64 8, !15, i64 8, i64 8, !15, i64 16, i64 8, !15}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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.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 }
%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }

@_ZN4Wire6globalE = external dso_local local_unnamed_addr global %class.Component, align 8
@_ZN4Wire8global_5E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_10E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_20E = external dso_local global %class.Component, align 8
@_ZN4Wire9global_30E = external dso_local global %class.Component, align 8

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Wire16update_fullswingEv(ptr noundef nonnull align 8 dereferenceable(1264) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %"struct.std::_List_iterator", align 8
  %3 = alloca [4 x double], align 16
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNSt14_List_iteratorI9ComponentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %6 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @_ZN4Wire6globalE, i64 264), align 8
  %7 = getelementptr inbounds i8, ptr %3, i64 16
  %8 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
  %9 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> <double 2.000000e-01, double 3.000000e-01>, <2 x double> %8)
  store <2 x double> %9, ptr %7, align 16, !tbaa !5
  %10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> <double 5.000000e-02, double 1.000000e-01>, <2 x double> %8)
  store <2 x double> %10, ptr %3, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 384
  br label %13

.loopexit:                                        ; preds = %77, %13
  %12 = icmp ugt i64 %indvars.iv, 1
  br i1 %12, label %13, label %81, !llvm.loop !9

13:                                               ; preds = %1, %.loopexit
  %indvars.iv = phi i64 [ 4, %1 ], [ %indvars.iv.next, %.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %14 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 %indvars.iv.next
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  store ptr %16, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %17 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  store ptr %17, ptr %4, align 8
  %18 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI9ComponentES3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %18, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %13
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %77
  %.016 = phi double [ %.1, %77 ], [ 1.000000e+30, %.lr.ph.preheader ]
  %20 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %21 = getelementptr inbounds i8, ptr %20, i64 264
  %22 = load double, ptr %21, align 8, !tbaa !13
  %23 = fcmp ogt double %22, %15
  br i1 %23, label %24, label %28

24:                                               ; preds = %.lr.ph
  call void @_ZNSt20_List_const_iteratorI9ComponentEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %25 = load ptr, ptr %5, align 8
  %26 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5eraseESt20_List_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr %25) #6
  store ptr %26, ptr %2, align 8, !tbaa !11
  %27 = call ptr @_ZNSt14_List_iteratorI9ComponentEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 0) #6
  br label %77

28:                                               ; preds = %.lr.ph
  %29 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %30 = getelementptr inbounds i8, ptr %29, i64 24
  %31 = load double, ptr %30, align 8, !tbaa !18
  %32 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @_ZN4Wire6globalE, i64 24), align 8
  %33 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %34 = getelementptr inbounds i8, ptr %33, i64 32
  %35 = load double, ptr %34, align 8, !tbaa !19
  %36 = load double, ptr getelementptr inbounds (i8, ptr @_ZN4Wire6globalE, i64 32), align 8, !tbaa !19
  %37 = insertelement <2 x double> poison, double %31, i64 0
  %38 = insertelement <2 x double> %37, double %35, i64 1
  %39 = insertelement <2 x double> %32, double %36, i64 1
  %40 = fdiv <2 x double> %38, %39
  %shift = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %41 = fadd <2 x double> %40, %shift
  %42 = extractelement <2 x double> %41, i64 0
  %43 = fcmp olt double %42, %.016
  br i1 %43, label %44, label %77

44:                                               ; preds = %28
  switch i32 %19, label %77 [
    i32 4, label %45
    i32 3, label %53
    i32 2, label %61
    i32 1, label %69
  ]

45:                                               ; preds = %44
  %46 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %47 = getelementptr inbounds i8, ptr %46, i64 264
  %48 = load double, ptr %47, align 8, !tbaa !13
  store double %48, ptr getelementptr inbounds (i8, ptr @_ZN4Wire9global_30E, i64 264), align 8, !tbaa !13
  %49 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  %51 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (i8, ptr @_ZN4Wire9global_30E, i64 24), ptr noundef nonnull align 8 dereferenceable(120) %50)
  %52 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Wire9global_30E, ptr noundef nonnull align 8 dereferenceable(24) %52, i64 24, i1 false), !tbaa.struct !20
  br label %77

53:                                               ; preds = %44
  %54 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %55 = getelementptr inbounds i8, ptr %54, i64 264
  %56 = load double, ptr %55, align 8, !tbaa !13
  store double %56, ptr getelementptr inbounds (i8, ptr @_ZN4Wire9global_20E, i64 264), align 8, !tbaa !13
  %57 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %58 = getelementptr inbounds i8, ptr %57, i64 24
  %59 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (i8, ptr @_ZN4Wire9global_20E, i64 24), ptr noundef nonnull align 8 dereferenceable(120) %58)
  %60 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Wire9global_20E, ptr noundef nonnull align 8 dereferenceable(24) %60, i64 24, i1 false), !tbaa.struct !20
  br label %77

61:                                               ; preds = %44
  %62 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %63 = getelementptr inbounds i8, ptr %62, i64 264
  %64 = load double, ptr %63, align 8, !tbaa !13
  store double %64, ptr getelementptr inbounds (i8, ptr @_ZN4Wire9global_10E, i64 264), align 8, !tbaa !13
  %65 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %66 = getelementptr inbounds i8, ptr %65, i64 24
  %67 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (i8, ptr @_ZN4Wire9global_10E, i64 24), ptr noundef nonnull align 8 dereferenceable(120) %66)
  %68 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Wire9global_10E, ptr noundef nonnull align 8 dereferenceable(24) %68, i64 24, i1 false), !tbaa.struct !20
  br label %77

69:                                               ; preds = %44
  %70 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %71 = getelementptr inbounds i8, ptr %70, i64 264
  %72 = load double, ptr %71, align 8, !tbaa !13
  store double %72, ptr getelementptr inbounds (i8, ptr @_ZN4Wire8global_5E, i64 264), align 8, !tbaa !13
  %73 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %74 = getelementptr inbounds i8, ptr %73, i64 24
  %75 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN8powerDefaSERKS_(ptr noundef nonnull align 8 dereferenceable(120) getelementptr inbounds (i8, ptr @_ZN4Wire8global_5E, i64 24), ptr noundef nonnull align 8 dereferenceable(120) %74)
  %76 = call noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Wire8global_5E, ptr noundef nonnull align 8 dereferenceable(24) %76, i64 24, i1 false), !tbaa.struct !20
  br label %77

77:                                               ; preds = %44, %24, %45, %61, %69, %53, %28
  %.1 = phi double [ %.016, %24 ], [ %42, %45 ], [ %42, %53 ], [ %42, %61 ], [ %42, %69 ], [ %.016, %28 ], [ %42, %44 ]
  %78 = call ptr @_ZNSt14_List_iteratorI9ComponentEppEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %79 = call ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  store ptr %79, ptr %4, align 8
  %80 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI9ComponentES3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %80, label %.lr.ph, label %.loopexit, !llvm.loop !21

81:                                               ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorI9ComponentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorI9ComponentES3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt14_List_iteratorI9ComponentEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listI9ComponentSaIS1_EE5eraseESt20_List_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(24), ptr) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt20_List_const_iteratorI9ComponentEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorI9ComponentEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorI9ComponentEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 264}
!14 = !{!"_ZTS9Component", !15, i64 0, !16, i64 24, !16, i64 144, !6, i64 264, !6, i64 272}
!15 = !{!"_ZTS4Area", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTS8powerDef", !17, i64 0, !17, i64 40, !17, i64 80}
!17 = !{!"_ZTS15powerComponents", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!14, !6, i64 24}
!19 = !{!14, !6, i64 32}
!20 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5}
!21 = distinct !{!21, !10}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass