; LLVM IR from gem5/gem5 :: ext/dsent/model/Model.ll (ZN5DSENT5ModelD2Ev)

; 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.DSENT::Model" = type <{ ptr, %"class.LibUtil::String", i8, [7 x i8], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, [5 x i8] }>
%"class.LibUtil::String" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZTVN5DSENT5ModelE = external dso_local unnamed_addr constant { [11 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: nounwind
declare void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5DSENT5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(131) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 72) ({ [11 x ptr] }, ptr @_ZTVN5DSENT5ModelE, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 5
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  call void @_ZNSt6vectorIN7LibUtil6StringESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZdlPvm(ptr noundef %5, i64 noundef 24) #6
  br label %8

8:                                                ; preds = %7, %1
  %9 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 7
  %10 = load ptr, ptr %9, align 8, !tbaa !18
  %11 = icmp eq ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  call void @_ZNSt6vectorIN7LibUtil6StringESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @_ZdlPvm(ptr noundef %10, i64 noundef 24) #6
  br label %13

13:                                               ; preds = %12, %8
  %14 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 4
  %15 = load ptr, ptr %14, align 8, !tbaa !19
  %16 = icmp eq ptr %15, null
  br i1 %16, label %21, label %17

17:                                               ; preds = %13
  %18 = load ptr, ptr %15, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 1
  %20 = load ptr, ptr %19, align 8
  call void %20(ptr noundef nonnull align 8 dereferenceable(56) %15) #5
  br label %21

21:                                               ; preds = %17, %13
  %22 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 4
  store ptr null, ptr %22, align 8, !tbaa !19
  %23 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 6
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %25 = icmp eq ptr %24, null
  br i1 %25, label %30, label %26

26:                                               ; preds = %21
  %27 = load ptr, ptr %24, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 1
  %29 = load ptr, ptr %28, align 8
  call void %29(ptr noundef nonnull align 8 dereferenceable(56) %24) #5
  br label %30

30:                                               ; preds = %26, %21
  %31 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 6
  store ptr null, ptr %31, align 8, !tbaa !20
  %32 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 8
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  %34 = icmp eq ptr %33, null
  br i1 %34, label %39, label %35

35:                                               ; preds = %30
  %36 = load ptr, ptr %33, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 1
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(56) %33) #5
  br label %39

39:                                               ; preds = %35, %30
  %40 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 8
  store ptr null, ptr %40, align 8, !tbaa !21
  %41 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 9
  %42 = load ptr, ptr %41, align 8, !tbaa !22
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT5Model8SubModelEEEvPNS_3MapIPT_EE(ptr noundef %42)
          to label %43 unwind label %58

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 9
  store ptr null, ptr %44, align 8, !tbaa !22
  %45 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 12
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %46)
          to label %47 unwind label %58

47:                                               ; preds = %43
  %48 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 12
  store ptr null, ptr %48, align 8, !tbaa !23
  %49 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 10
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %50)
          to label %51 unwind label %58

51:                                               ; preds = %47
  %52 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 10
  store ptr null, ptr %52, align 8, !tbaa !24
  %53 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 11
  %54 = load ptr, ptr %53, align 8, !tbaa !25
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %54)
          to label %55 unwind label %58

55:                                               ; preds = %51
  %56 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 11
  store ptr null, ptr %56, align 8, !tbaa !25
  %57 = getelementptr inbounds %"class.DSENT::Model", ptr %3, i32 0, i32 1
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %57) #5
  ret void

58:                                               ; preds = %51, %47, %43, %39
  %59 = landingpad { ptr, i32 }
          catch ptr null
  %60 = extractvalue { ptr, i32 } %59, 0
  call void @__clang_call_terminate(ptr %60) #7
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7LibUtil12deletePtrMapIN5DSENT5Model8SubModelEEEvPNS_3MapIPT_EE(ptr noundef) #3

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef) #3

attributes #0 = { nobuiltin 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { noinline noreturn nounwind uwtable "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 }
attributes #6 = { builtin nounwind }
attributes #7 = { noreturn 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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"_ZTSN5DSENT5ModelE", !13, i64 8, !17, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !17, i64 128, !17, i64 129, !17, i64 130}
!13 = !{!"_ZTSN7LibUtil6StringE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !6, i64 72}
!19 = !{!12, !6, i64 48}
!20 = !{!12, !6, i64 64}
!21 = !{!12, !6, i64 80}
!22 = !{!12, !6, i64 88}
!23 = !{!12, !6, i64 112}
!24 = !{!12, !6, i64 96}
!25 = !{!12, !6, i64 104}


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

@_ZTVN5DSENT5ModelE = external dso_local unnamed_addr constant { [11 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5DSENT5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(131) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 72) (i8, ptr @_ZTVN5DSENT5ModelE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 56
  %3 = load ptr, ptr %2, align 8, !tbaa !8
  %4 = icmp eq ptr %3, null
  br i1 %4, label %6, label %5

5:                                                ; preds = %1
  tail call void @_ZNSt6vectorIN7LibUtil6StringESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 24) #6
  br label %6

6:                                                ; preds = %5, %1
  %7 = getelementptr inbounds i8, ptr %0, i64 72
  %8 = load ptr, ptr %7, align 8, !tbaa !17
  %9 = icmp eq ptr %8, null
  br i1 %9, label %11, label %10

10:                                               ; preds = %6
  tail call void @_ZNSt6vectorIN7LibUtil6StringESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 24) #6
  br label %11

11:                                               ; preds = %10, %6
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = load ptr, ptr %12, align 8, !tbaa !18
  %14 = icmp eq ptr %13, null
  br i1 %14, label %19, label %15

15:                                               ; preds = %11
  %16 = load ptr, ptr %13, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(56) %13) #5
  br label %19

19:                                               ; preds = %15, %11
  store ptr null, ptr %12, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  %22 = icmp eq ptr %21, null
  br i1 %22, label %27, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %21, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load ptr, ptr %25, align 8
  tail call void %26(ptr noundef nonnull align 8 dereferenceable(56) %21) #5
  br label %27

27:                                               ; preds = %23, %19
  store ptr null, ptr %20, align 8, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = icmp eq ptr %29, null
  br i1 %30, label %35, label %31

31:                                               ; preds = %27
  %32 = load ptr, ptr %29, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8
  tail call void %34(ptr noundef nonnull align 8 dereferenceable(56) %29) #5
  br label %35

35:                                               ; preds = %31, %27
  store ptr null, ptr %28, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %0, i64 88
  %37 = load ptr, ptr %36, align 8, !tbaa !21
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT5Model8SubModelEEEvPNS_3MapIPT_EE(ptr noundef %37)
          to label %38 unwind label %49

38:                                               ; preds = %35
  store ptr null, ptr %36, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %0, i64 112
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %40)
          to label %41 unwind label %49

41:                                               ; preds = %38
  store ptr null, ptr %39, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %0, i64 96
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %43)
          to label %44 unwind label %49

44:                                               ; preds = %41
  store ptr null, ptr %42, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %0, i64 104
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  invoke void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef %46)
          to label %47 unwind label %49

47:                                               ; preds = %44
  store ptr null, ptr %45, align 8, !tbaa !24
  %48 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %48) #5
  ret void

49:                                               ; preds = %44, %41, %38, %35
  %50 = landingpad { ptr, i32 }
          catch ptr null
  %51 = extractvalue { ptr, i32 } %50, 0
  tail call void @__clang_call_terminate(ptr %51) #7
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7LibUtil12deletePtrMapIN5DSENT5Model8SubModelEEEvPNS_3MapIPT_EE(ptr noundef) local_unnamed_addr #3

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7LibUtil12deletePtrMapIN5DSENT6ResultEEEvPNS_3MapIPT_EE(ptr noundef) local_unnamed_addr #3

attributes #0 = { nobuiltin 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { noinline noreturn nounwind uwtable "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 }
attributes #6 = { builtin nounwind }
attributes #7 = { noreturn 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 56}
!9 = !{!"_ZTSN5DSENT5ModelE", !10, i64 8, !16, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !16, i64 128, !16, i64 129, !16, i64 130}
!10 = !{!"_ZTSN7LibUtil6StringE", !11, i64 0}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !15, i64 8, !14, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"long", !14, i64 0}
!16 = !{!"bool", !14, i64 0}
!17 = !{!9, !13, i64 72}
!18 = !{!9, !13, i64 48}
!19 = !{!9, !13, i64 64}
!20 = !{!9, !13, i64 80}
!21 = !{!9, !13, i64 88}
!22 = !{!9, !13, i64 112}
!23 = !{!9, !13, i64 96}
!24 = !{!9, !13, i64 104}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass