; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/bank.ll (ZN4BankD2Ev)

; 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.Bank = type { %class.Component, ptr, %class.Mat, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32 }
%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.Mat = type { %class.Component, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, %class.powerDef, double, double, double, double, double, double, double, double, double, double, double, double, double, %class.Subarray, %class.powerDef, %class.powerDef, %class.powerDef, double, i32, i32, double, %class.Area, %class.Area, i8, i8, i8, i8, i32, %class.powerDef, double, double, double, double, double, double, %class.powerDef, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32 }
%class.Subarray = type { %class.Component, ptr, i32, i32, i32, i32, %class.Area, %class.Area, i8, double, double, double, double, double, double, double, double }
%class.DynamicParameter = type <{ i8, i8, i8, i8, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], double, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i8], double, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8], %class.Area, %class.Area, i8, [7 x i8] }>

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4BankD2Ev(ptr noundef nonnull align 8 dereferenceable(3416) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 3
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %5) #3
  call void @_ZdlPvm(ptr noundef %5, i64 noundef 544) #4
  br label %8

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

12:                                               ; preds = %8
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %10) #3
  call void @_ZdlPvm(ptr noundef %10, i64 noundef 544) #4
  br label %13

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

17:                                               ; preds = %13
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %15) #3
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 544) #4
  br label %18

18:                                               ; preds = %17, %13
  %19 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds %class.DynamicParameter, ptr %20, i32 0, i32 3
  %22 = load i8, ptr %21, align 1, !tbaa !23, !range !25, !noundef !26
  %23 = trunc i8 %22 to i1
  br i1 %23, label %30, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !22
  %27 = getelementptr inbounds %class.DynamicParameter, ptr %26, i32 0, i32 2
  %28 = load i8, ptr %27, align 2, !tbaa !27, !range !25, !noundef !26
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %41

30:                                               ; preds = %24, %18
  %31 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !28
  %33 = icmp eq ptr %32, null
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %32) #3
  call void @_ZdlPvm(ptr noundef %32, i64 noundef 544) #4
  br label %35

35:                                               ; preds = %34, %30
  %36 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 7
  %37 = load ptr, ptr %36, align 8, !tbaa !29
  %38 = icmp eq ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %37) #3
  call void @_ZdlPvm(ptr noundef %37, i64 noundef 544) #4
  br label %40

40:                                               ; preds = %39, %35
  br label %41

41:                                               ; preds = %40, %24
  %42 = getelementptr inbounds %class.Bank, ptr %3, i32 0, i32 2
  call void @_ZN3MatD1Ev(ptr noundef nonnull align 8 dereferenceable(3064) %42) #3
  call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(280) %3) #3
  ret void
}

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

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 = { nounwind }
attributes #4 = { builtin 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, !6, i64 3352}
!10 = !{!"_ZTS4Bank", !11, i64 0, !6, i64 280, !16, i64 288, !6, i64 3352, !6, i64 3360, !6, i64 3368, !6, i64 3376, !6, i64 3384, !18, i64 3392, !18, i64 3396, !18, i64 3400, !18, i64 3404, !18, i64 3408, !18, i64 3412}
!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 = !{!"_ZTS3Mat", !11, i64 0, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !14, i64 440, !14, i64 560, !14, i64 680, !14, i64 800, !14, i64 920, !14, i64 1040, !14, i64 1160, !14, i64 1280, !14, i64 1400, !14, i64 1520, !14, i64 1640, !13, i64 1760, !13, i64 1768, !13, i64 1776, !13, i64 1784, !13, i64 1792, !13, i64 1800, !13, i64 1808, !13, i64 1816, !13, i64 1824, !13, i64 1832, !13, i64 1840, !13, i64 1848, !13, i64 1856, !17, i64 1864, !14, i64 2288, !14, i64 2408, !14, i64 2528, !13, i64 2648, !18, i64 2656, !18, i64 2660, !13, i64 2664, !12, i64 2672, !12, i64 2696, !19, i64 2720, !19, i64 2721, !19, i64 2722, !19, i64 2723, !18, i64 2724, !14, i64 2728, !13, i64 2848, !13, i64 2856, !13, i64 2864, !13, i64 2872, !13, i64 2880, !13, i64 2888, !14, i64 2896, !18, i64 3016, !18, i64 3020, !18, i64 3024, !18, i64 3028, !13, i64 3032, !18, i64 3040, !18, i64 3044, !18, i64 3048, !18, i64 3052, !18, i64 3056, !18, i64 3060}
!17 = !{!"_ZTS8Subarray", !11, i64 0, !6, i64 280, !18, i64 288, !18, i64 292, !18, i64 296, !18, i64 300, !12, i64 304, !12, i64 328, !19, i64 352, !13, i64 360, !13, i64 368, !13, i64 376, !13, i64 384, !13, i64 392, !13, i64 400, !13, i64 408, !13, i64 416}
!18 = !{!"int", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!10, !6, i64 3368}
!21 = !{!10, !6, i64 3360}
!22 = !{!10, !6, i64 280}
!23 = !{!24, !19, i64 3}
!24 = !{!"_ZTS16DynamicParameter", !19, i64 0, !19, i64 1, !19, i64 2, !19, i64 3, !18, i64 4, !18, i64 8, !18, i64 12, !13, i64 16, !18, i64 24, !18, i64 28, !18, i64 32, !18, i64 36, !18, i64 40, !18, i64 44, !18, i64 48, !18, i64 52, !18, i64 56, !18, i64 60, !18, i64 64, !18, i64 68, !18, i64 72, !18, i64 76, !18, i64 80, !18, i64 84, !18, i64 88, !18, i64 92, !18, i64 96, !18, i64 100, !18, i64 104, !18, i64 108, !18, i64 112, !18, i64 116, !19, i64 120, !13, i64 128, !18, i64 136, !18, i64 140, !18, i64 144, !18, i64 148, !18, i64 152, !18, i64 156, !18, i64 160, !18, i64 164, !18, i64 168, !13, i64 176, !18, i64 184, !18, i64 188, !18, i64 192, !18, i64 196, !18, i64 200, !18, i64 204, !18, i64 208, !19, i64 212, !12, i64 216, !12, i64 240, !19, i64 264}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!24, !19, i64 2}
!28 = !{!10, !6, i64 3376}
!29 = !{!10, !6, i64 3384}


; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4BankD2Ev(ptr noundef nonnull align 8 dereferenceable(3416) %0) unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 3352
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = icmp eq ptr %3, null
  br i1 %4, label %6, label %5

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

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

10:                                               ; preds = %6
  tail call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %8) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 544) #4
  br label %11

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

15:                                               ; preds = %11
  tail call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %13) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 544) #4
  br label %16

16:                                               ; preds = %15, %11
  %17 = getelementptr inbounds i8, ptr %0, i64 280
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  %19 = getelementptr inbounds i8, ptr %18, i64 3
  %20 = load i8, ptr %19, align 1, !tbaa !22, !range !24, !noundef !25
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %26, label %22

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %18, i64 2
  %24 = load i8, ptr %23, align 2, !tbaa !26, !range !24, !noundef !25
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %36

26:                                               ; preds = %22, %16
  %27 = getelementptr inbounds i8, ptr %0, i64 3376
  %28 = load ptr, ptr %27, align 8, !tbaa !27
  %29 = icmp eq ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  tail call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %28) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %28, i64 noundef 544) #4
  br label %31

31:                                               ; preds = %30, %26
  %32 = getelementptr inbounds i8, ptr %0, i64 3384
  %33 = load ptr, ptr %32, align 8, !tbaa !28
  %34 = icmp eq ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  tail call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(544) %33) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %33, i64 noundef 544) #4
  br label %36

36:                                               ; preds = %31, %35, %22
  %37 = getelementptr inbounds i8, ptr %0, i64 288
  tail call void @_ZN3MatD1Ev(ptr noundef nonnull align 8 dereferenceable(3064) %37) #3
  tail call void @_ZN9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(280) %0) #3
  ret void
}

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

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 = { nounwind }
attributes #4 = { builtin 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, !14, i64 3352}
!6 = !{!"_ZTS4Bank", !7, i64 0, !14, i64 280, !15, i64 288, !14, i64 3352, !14, i64 3360, !14, i64 3368, !14, i64 3376, !14, i64 3384, !17, i64 3392, !17, i64 3396, !17, i64 3400, !17, i64 3404, !17, i64 3408, !17, i64 3412}
!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 = !{!"_ZTS3Mat", !7, i64 0, !14, i64 280, !14, i64 288, !14, i64 296, !14, i64 304, !14, i64 312, !14, i64 320, !14, i64 328, !14, i64 336, !14, i64 344, !14, i64 352, !14, i64 360, !14, i64 368, !14, i64 376, !14, i64 384, !14, i64 392, !14, i64 400, !14, i64 408, !14, i64 416, !14, i64 424, !14, i64 432, !12, i64 440, !12, i64 560, !12, i64 680, !12, i64 800, !12, i64 920, !12, i64 1040, !12, i64 1160, !12, i64 1280, !12, i64 1400, !12, i64 1520, !12, i64 1640, !9, i64 1760, !9, i64 1768, !9, i64 1776, !9, i64 1784, !9, i64 1792, !9, i64 1800, !9, i64 1808, !9, i64 1816, !9, i64 1824, !9, i64 1832, !9, i64 1840, !9, i64 1848, !9, i64 1856, !16, i64 1864, !12, i64 2288, !12, i64 2408, !12, i64 2528, !9, i64 2648, !17, i64 2656, !17, i64 2660, !9, i64 2664, !8, i64 2672, !8, i64 2696, !18, i64 2720, !18, i64 2721, !18, i64 2722, !18, i64 2723, !17, i64 2724, !12, i64 2728, !9, i64 2848, !9, i64 2856, !9, i64 2864, !9, i64 2872, !9, i64 2880, !9, i64 2888, !12, i64 2896, !17, i64 3016, !17, i64 3020, !17, i64 3024, !17, i64 3028, !9, i64 3032, !17, i64 3040, !17, i64 3044, !17, i64 3048, !17, i64 3052, !17, i64 3056, !17, i64 3060}
!16 = !{!"_ZTS8Subarray", !7, i64 0, !14, i64 280, !17, i64 288, !17, i64 292, !17, i64 296, !17, i64 300, !8, i64 304, !8, i64 328, !18, i64 352, !9, i64 360, !9, i64 368, !9, i64 376, !9, i64 384, !9, i64 392, !9, i64 400, !9, i64 408, !9, i64 416}
!17 = !{!"int", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!6, !14, i64 3368}
!20 = !{!6, !14, i64 3360}
!21 = !{!6, !14, i64 280}
!22 = !{!23, !18, i64 3}
!23 = !{!"_ZTS16DynamicParameter", !18, i64 0, !18, i64 1, !18, i64 2, !18, i64 3, !17, i64 4, !17, i64 8, !17, i64 12, !9, i64 16, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !17, i64 68, !17, i64 72, !17, i64 76, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !17, i64 96, !17, i64 100, !17, i64 104, !17, i64 108, !17, i64 112, !17, i64 116, !18, i64 120, !9, i64 128, !17, i64 136, !17, i64 140, !17, i64 144, !17, i64 148, !17, i64 152, !17, i64 156, !17, i64 160, !17, i64 164, !17, i64 168, !9, i64 176, !17, i64 184, !17, i64 188, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !18, i64 212, !8, i64 216, !8, i64 240, !18, i64 264}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!23, !18, i64 2}
!27 = !{!6, !14, i64 3376}
!28 = !{!6, !14, i64 3384}


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