; LLVM IR from dafer45/TBTK :: doc/examples/Utilities (CArray)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.TBTK::CArray" = type { i32, ptr }

@_ZN4TBTK7Streams3outE = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.TBTK::CArray", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_ZN4TBTK10InitializeEv()
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #6
  call void @_ZN4TBTK6CArrayIjEC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %24, %0
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = invoke noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %12 unwind label %15

12:                                               ; preds = %9
  %13 = icmp ult i32 %10, %11
  br i1 %13, label %19, label %14

14:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %27

15:                                               ; preds = %19, %9
  %16 = landingpad { ptr, i32 }
          cleanup
  %17 = extractvalue { ptr, i32 } %16, 0
  store ptr %17, ptr %4, align 8
  %18 = extractvalue { ptr, i32 } %16, 1
  store i32 %18, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %89

19:                                               ; preds = %12
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TBTK6CArrayIjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %21)
          to label %23 unwind label %15

23:                                               ; preds = %19
  store i32 %20, ptr %22, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %23
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = add i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !5
  br label %9, !llvm.loop !9

27:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %47, %27
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = invoke noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %31 unwind label %34

31:                                               ; preds = %28
  %32 = icmp ult i32 %29, %30
  br i1 %32, label %38, label %33

33:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %50

34:                                               ; preds = %44, %41, %38, %28
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %4, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %89

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TBTK6CArrayIjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %39)
          to label %41 unwind label %34

41:                                               ; preds = %38
  %42 = load i32, ptr %40, align 4, !tbaa !5
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %42)
          to label %44 unwind label %34

44:                                               ; preds = %41
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef @.str.2)
          to label %46 unwind label %34

46:                                               ; preds = %44
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = add i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !11

50:                                               ; preds = %33
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, ptr noundef @.str.3)
          to label %52 unwind label %59

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %53 = invoke noundef ptr @_ZN4TBTK6CArrayIjE7getDataEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %54 unwind label %63

54:                                               ; preds = %52
  store ptr %53, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %77, %54
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = icmp ult i32 %56, 10
  br i1 %57, label %67, label %58

58:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %84

59:                                               ; preds = %50
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %4, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %5, align 4
  br label %89

63:                                               ; preds = %84, %52
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %4, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %5, align 4
  br label %88

67:                                               ; preds = %55
  %68 = load ptr, ptr %7, align 8, !tbaa !12
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %68, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %72)
          to label %74 unwind label %80

74:                                               ; preds = %67
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @.str.2)
          to label %76 unwind label %80

76:                                               ; preds = %74
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = add i32 %78, 1
  store i32 %79, ptr %8, align 4, !tbaa !5
  br label %55, !llvm.loop !14

80:                                               ; preds = %74, %67
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %4, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %88

84:                                               ; preds = %58
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, ptr noundef @.str.3)
          to label %86 unwind label %63

86:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @_ZN4TBTK6CArrayIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  %87 = load i32, ptr %1, align 4
  ret i32 %87

88:                                               ; preds = %80, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %89

89:                                               ; preds = %88, %59, %34, %15
  call void @_ZN4TBTK6CArrayIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %4, align 8
  %92 = load i32, ptr %5, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

declare void @_ZN4TBTK10InitializeEv() #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress norecurse 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 = { "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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.TBTK::CArray" = type { i32, ptr }

@_ZN4TBTK7Streams3outE = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.TBTK::CArray", align 8
  tail call void @_ZN4TBTK10InitializeEv()
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  call void @_ZN4TBTK6CArrayIjEC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 10)
  %2 = call noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %0
  %3 = call noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %.not25 = icmp eq i32 %3, 0
  br i1 %.not25, label %._crit_edge, label %.lr.ph23

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01321 = phi i32 [ %5, %.lr.ph ], [ 0, %0 ]
  %4 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TBTK6CArrayIjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.01321)
  store i32 %.01321, ptr %4, align 4, !tbaa !5
  %5 = add nuw i32 %.01321, 1
  %6 = call noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %7 = icmp ult i32 %5, %6
  br i1 %7, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %16, %.preheader
  %8 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, ptr noundef nonnull @.str.3)
          to label %20 unwind label %24

9:                                                ; preds = %14, %.lr.ph23
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %89

.lr.ph23:                                         ; preds = %.preheader, %16
  %.01422 = phi i32 [ %17, %16 ], [ 0, %.preheader ]
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TBTK6CArrayIjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.01422)
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %12)
          to label %14 unwind label %9

14:                                               ; preds = %.lr.ph23
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.2)
          to label %16 unwind label %9

16:                                               ; preds = %14
  %17 = add nuw i32 %.01422, 1
  %18 = call noundef i32 @_ZNK4TBTK6CArrayIjE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %19 = icmp ult i32 %17, %18
  br i1 %19, label %.lr.ph23, label %._crit_edge, !llvm.loop !11

20:                                               ; preds = %._crit_edge
  %21 = call noundef ptr @_ZN4TBTK6CArrayIjE7getDataEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %22)
          to label %28 unwind label %86

24:                                               ; preds = %._crit_edge
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %89

26:                                               ; preds = %84
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %89

28:                                               ; preds = %20
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.2)
          to label %30 unwind label %86

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %21, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %32)
          to label %34 unwind label %86

34:                                               ; preds = %30
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @.str.2)
          to label %36 unwind label %86

36:                                               ; preds = %34
  %37 = getelementptr inbounds i8, ptr %21, i64 8
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %38)
          to label %40 unwind label %86

40:                                               ; preds = %36
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @.str.2)
          to label %42 unwind label %86

42:                                               ; preds = %40
  %43 = getelementptr inbounds i8, ptr %21, i64 12
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %44)
          to label %46 unwind label %86

46:                                               ; preds = %42
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @.str.2)
          to label %48 unwind label %86

48:                                               ; preds = %46
  %49 = getelementptr inbounds i8, ptr %21, i64 16
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %50)
          to label %52 unwind label %86

52:                                               ; preds = %48
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @.str.2)
          to label %54 unwind label %86

54:                                               ; preds = %52
  %55 = getelementptr inbounds i8, ptr %21, i64 20
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %56)
          to label %58 unwind label %86

58:                                               ; preds = %54
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str.2)
          to label %60 unwind label %86

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %21, i64 24
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %62)
          to label %64 unwind label %86

64:                                               ; preds = %60
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.2)
          to label %66 unwind label %86

66:                                               ; preds = %64
  %67 = getelementptr inbounds i8, ptr %21, i64 28
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %68)
          to label %70 unwind label %86

70:                                               ; preds = %66
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str.2)
          to label %72 unwind label %86

72:                                               ; preds = %70
  %73 = getelementptr inbounds i8, ptr %21, i64 32
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %74)
          to label %76 unwind label %86

76:                                               ; preds = %72
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @.str.2)
          to label %78 unwind label %86

78:                                               ; preds = %76
  %79 = getelementptr inbounds i8, ptr %21, i64 36
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, i32 noundef %80)
          to label %82 unwind label %86

82:                                               ; preds = %78
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str.2)
          to label %84 unwind label %86

84:                                               ; preds = %82
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4TBTK7Streams3outE, ptr noundef nonnull @.str.3)
          to label %88 unwind label %26

86:                                               ; preds = %82, %78, %76, %72, %70, %66, %64, %60, %58, %54, %52, %48, %46, %42, %40, %36, %34, %30, %28, %20
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %89

88:                                               ; preds = %84
  call void @_ZN4TBTK6CArrayIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  ret i32 0

89:                                               ; preds = %26, %86, %24, %9
  %.pn19 = phi { ptr, i32 } [ %10, %9 ], [ %25, %24 ], [ %87, %86 ], [ %27, %26 ]
  call void @_ZN4TBTK6CArrayIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn19
}

declare void @_ZN4TBTK10InitializeEv() local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress norecurse 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 = { "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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass