; LLVM IR from xtaci/algorithms :: src (stack_demo)

; 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.alg::Stack" = type { %"class.alg::Stack<int>::StackEmptyException", %"class.alg::Stack<int>::StackIndexOutOfBoundException", i32, i32, ptr }
%"class.alg::Stack<int>::StackEmptyException" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }
%"class.alg::Stack<int>::StackIndexOutOfBoundException" = type { %"class.std::exception" }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.alg::Stack", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #7
  call void @_ZN3alg5StackIiEC2Ej(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 7, ptr %3, align 4, !tbaa !5
  %11 = invoke noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %12 unwind label %33

12:                                               ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 5, ptr %6, align 4, !tbaa !5
  %13 = invoke noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %14 unwind label %37

14:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 -1, ptr %7, align 4, !tbaa !5
  %15 = invoke noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %16 unwind label %41

16:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 9, ptr %8, align 4, !tbaa !5
  %17 = invoke noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %18 unwind label %45

18:                                               ; preds = %16
  %19 = zext i1 %17 to i32
  %20 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %19)
          to label %21 unwind label %45

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 10, ptr %9, align 4, !tbaa !5
  %22 = invoke noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %23 unwind label %49

23:                                               ; preds = %21
  %24 = zext i1 %22 to i32
  %25 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %24)
          to label %26 unwind label %49

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %65, %26
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = invoke noundef i32 @_ZNK3alg5StackIiE5countEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %30 unwind label %53

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

32:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %68

33:                                               ; preds = %0
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %86

37:                                               ; preds = %12
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %86

41:                                               ; preds = %14
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %86

45:                                               ; preds = %18, %16
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %4, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %86

49:                                               ; preds = %23, %21
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %86

53:                                               ; preds = %61, %57, %27
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %4, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %86

57:                                               ; preds = %30
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef %59)
          to label %61 unwind label %53

61:                                               ; preds = %57
  %62 = load i32, ptr %60, align 4, !tbaa !5
  %63 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %58, i32 noundef %62)
          to label %64 unwind label %53

64:                                               ; preds = %61
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = add i32 %66, 1
  store i32 %67, ptr %10, align 4, !tbaa !5
  br label %27, !llvm.loop !9

68:                                               ; preds = %32
  br label %69

69:                                               ; preds = %79, %68
  %70 = invoke noundef zeroext i1 @_ZNK3alg5StackIiE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %71 unwind label %80

71:                                               ; preds = %69
  %72 = xor i1 %70, true
  br i1 %72, label %73, label %84

73:                                               ; preds = %71
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiE3topEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %75 unwind label %80

75:                                               ; preds = %73
  %76 = load i32, ptr %74, align 4, !tbaa !5
  %77 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %76)
          to label %78 unwind label %80

78:                                               ; preds = %75
  invoke void @_ZN3alg5StackIiE3popEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %79 unwind label %80

79:                                               ; preds = %78
  br label %69, !llvm.loop !11

80:                                               ; preds = %78, %75, %73, %69
  %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
  br label %86

84:                                               ; preds = %71
  store i32 0, ptr %1, align 4
  call void @_ZN3alg5StackIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  %85 = load i32, ptr %1, align 4
  ret i32 %85

86:                                               ; preds = %80, %53, %49, %45, %41, %37, %33
  call void @_ZN3alg5StackIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %4, align 8
  %89 = load i32, ptr %5, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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) #1

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3alg5StackIiE5countEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiEixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3alg5StackIiE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiE3topEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 = { "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 = { 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 #7 = { 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}


; 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.alg::Stack" = type { %"class.alg::Stack<int>::StackEmptyException", %"class.alg::Stack<int>::StackIndexOutOfBoundException", i32, i32, ptr }
%"class.alg::Stack<int>::StackEmptyException" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }
%"class.alg::Stack<int>::StackIndexOutOfBoundException" = type { %"class.std::exception" }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.alg::Stack", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZN3alg5StackIiEC2Ej(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 7, ptr %2, align 4, !tbaa !5
  %7 = call noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 5, ptr %3, align 4, !tbaa !5
  %8 = call noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !5
  %9 = call noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 9, ptr %5, align 4, !tbaa !5
  %10 = call noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %11 = zext i1 %10 to i32
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 10, ptr %6, align 4, !tbaa !5
  %13 = call noundef zeroext i1 @_ZN3alg5StackIiE4pushERKi(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %14 = zext i1 %13 to i32
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %16 = call noundef i32 @_ZNK3alg5StackIiE5countEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %21, %0
  %17 = call noundef zeroext i1 @_ZNK3alg5StackIiE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  br i1 %17, label %._crit_edge, label %.lr.ph10

18:                                               ; preds = %.lr.ph
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %34

.lr.ph:                                           ; preds = %0, %21
  %.09 = phi i32 [ %24, %21 ], [ 0, %0 ]
  %20 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiEixEj(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.09)
          to label %21 unwind label %18

21:                                               ; preds = %.lr.ph
  %22 = load i32, ptr %20, align 4, !tbaa !5
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.09, i32 noundef %22)
  %24 = add nuw i32 %.09, 1
  %25 = call noundef i32 @_ZNK3alg5StackIiE5countEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %26 = icmp ult i32 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph10:                                         ; preds = %.preheader, %28
  %27 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiE3topEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %28 unwind label %32

28:                                               ; preds = %.lr.ph10
  %29 = load i32, ptr %27, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29)
  call void @_ZN3alg5StackIiE3popEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %31 = call noundef zeroext i1 @_ZNK3alg5StackIiE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  br i1 %31, label %._crit_edge, label %.lr.ph10, !llvm.loop !11

32:                                               ; preds = %.lr.ph10
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %34

._crit_edge:                                      ; preds = %28, %.preheader
  call void @_ZN3alg5StackIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  ret i32 0

34:                                               ; preds = %32, %18
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %33, %32 ]
  call void @_ZN3alg5StackIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

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

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

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

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) #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiEixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3alg5StackIiE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5StackIiE3topEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 = { nofree 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 #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 = { 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 #7 = { 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,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass