; LLVM IR from thekyria/elabtsaot2 :: emulator_hw/hardware_model/node.ll (ZN9elabtsaot4NodeC2Ev)

; 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.elabtsaot::Node" = type { double, double, double, double, i8, i8, i8, i8, double, double, double, double, i8, i8, i8, i8, [4 x i8], %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer", %"class.elabtsaot::Potentiometer" }
%"class.elabtsaot::Potentiometer" = type <{ ptr, double, double, i32, [4 x i8], double, i32, i32, i8, i8, [6 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot4NodeC2Ev(ptr noundef nonnull align 8 dereferenceable(304) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 0
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 1
  store double 1.000000e+00, ptr %7, align 8, !tbaa !15
  %8 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 2
  store double 0.000000e+00, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 3
  store double 1.000000e+00, ptr %9, align 8, !tbaa !17
  %10 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 4
  store i8 0, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 5
  store i8 0, ptr %11, align 1, !tbaa !19
  %12 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 6
  store i8 0, ptr %12, align 2, !tbaa !20
  %13 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 7
  store i8 0, ptr %13, align 1, !tbaa !21
  %14 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 8
  store double 0.000000e+00, ptr %14, align 8, !tbaa !22
  %15 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 9
  store double 1.000000e+00, ptr %15, align 8, !tbaa !23
  %16 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 10
  store double 0.000000e+00, ptr %16, align 8, !tbaa !24
  %17 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 11
  store double 1.000000e+00, ptr %17, align 8, !tbaa !25
  %18 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 12
  store i8 0, ptr %18, align 8, !tbaa !26
  %19 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 13
  store i8 0, ptr %19, align 1, !tbaa !27
  %20 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 14
  store i8 0, ptr %20, align 2, !tbaa !28
  %21 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 15
  store i8 0, ptr %21, align 1, !tbaa !29
  %22 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 17
  call void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %22)
  %23 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 18
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %23)
          to label %24 unwind label %29

24:                                               ; preds = %1
  %25 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 19
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %25)
          to label %26 unwind label %33

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"class.elabtsaot::Node", ptr %5, i32 0, i32 20
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %27)
          to label %28 unwind label %37

28:                                               ; preds = %26
  ret void

29:                                               ; preds = %1
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %3, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %4, align 4
  br label %42

33:                                               ; preds = %24
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %3, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %4, align 4
  br label %41

37:                                               ; preds = %26
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %3, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %4, align 4
  call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %25) #3
  br label %41

41:                                               ; preds = %37, %33
  call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %23) #3
  br label %42

42:                                               ; preds = %41, %29
  call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %22) #3
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %3, align 8
  %45 = load i32, ptr %4, align 4
  %46 = insertvalue { ptr, i32 } poison, ptr %44, 0
  %47 = insertvalue { ptr, i32 } %46, i32 %45, 1
  resume { ptr, i32 } %47
}

declare void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN9elabtsaot4NodeE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !12, i64 33, !12, i64 34, !12, i64 35, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 73, !12, i64 74, !12, i64 75, !13, i64 80, !13, i64 136, !13, i64 192, !13, i64 248}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN9elabtsaot13PotentiometerE", !11, i64 8, !11, i64 16, !14, i64 24, !11, i64 32, !14, i64 40, !14, i64 44, !12, i64 48, !12, i64 49}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !11, i64 24}
!18 = !{!10, !12, i64 32}
!19 = !{!10, !12, i64 33}
!20 = !{!10, !12, i64 34}
!21 = !{!10, !12, i64 35}
!22 = !{!10, !11, i64 40}
!23 = !{!10, !11, i64 48}
!24 = !{!10, !11, i64 56}
!25 = !{!10, !11, i64 64}
!26 = !{!10, !12, i64 72}
!27 = !{!10, !12, i64 73}
!28 = !{!10, !12, i64 74}
!29 = !{!10, !12, i64 75}


; 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 uwtable
define dso_local void @_ZN9elabtsaot4NodeC2Ev(ptr noundef nonnull align 8 dereferenceable(304) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 0, ptr %3, align 8
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 0, ptr %6, align 8
  tail call void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 136
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %8)
          to label %9 unwind label %14

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 192
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %10)
          to label %11 unwind label %16

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 248
  invoke void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50) %12)
          to label %13 unwind label %18

13:                                               ; preds = %11
  ret void

14:                                               ; preds = %1
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %21

16:                                               ; preds = %9
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %20

18:                                               ; preds = %11
  %19 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %10) #3
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  tail call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %8) #3
  br label %21

21:                                               ; preds = %20, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %20 ], [ %15, %14 ]
  tail call void @_ZN9elabtsaot13PotentiometerD2Ev(ptr noundef nonnull align 8 dereferenceable(50) %7) #3
  resume { ptr, i32 } %.pn.pn
}

declare void @_ZN9elabtsaot13PotentiometerC1Ev(ptr noundef nonnull align 8 dereferenceable(50)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass