; LLVM IR from nragland37/cpp-projects :: data_structures-I/07-Stack (main)

; 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.Stack = type { ptr, i32, i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 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.Stack, align 8
  %3 = alloca i16, align 2
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #6
  call void @_ZN5StackIsEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 10)
  call void @llvm.lifetime.start.p0(i64 2, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  invoke void @_Z10checkStateR5StackIsE(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %9 unwind label %14

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

10:                                               ; preds = %44, %9
  %11 = load i32, ptr %7, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 10
  br i1 %12, label %18, label %13

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

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  %16 = extractvalue { ptr, i32 } %15, 0
  store ptr %16, ptr %5, align 8
  %17 = extractvalue { ptr, i32 } %15, 1
  store i32 %17, ptr %6, align 4
  br label %79

18:                                               ; preds = %10
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  %21 = mul nsw i32 10, %20
  %22 = trunc i32 %21 to i16
  store i16 %22, ptr %3, align 2, !tbaa !9
  %23 = invoke noundef zeroext i1 @_ZN5StackIsE4pushERKs(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 2 dereferenceable(2) %3)
          to label %24 unwind label %36

24:                                               ; preds = %18
  %25 = zext i1 %23 to i8
  store i8 %25, ptr %4, align 1, !tbaa !11
  %26 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %40

28:                                               ; preds = %24
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %30 unwind label %36

30:                                               ; preds = %28
  %31 = load i16, ptr %3, align 2, !tbaa !9
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %29, i16 noundef signext %31)
          to label %33 unwind label %36

33:                                               ; preds = %30
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %35 unwind label %36

35:                                               ; preds = %33
  br label %40

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

40:                                               ; preds = %35, %24
  %41 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %42 = trunc i8 %41 to i1
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %42, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %43 unwind label %36

43:                                               ; preds = %40
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %10, !llvm.loop !15

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

48:                                               ; preds = %74, %47
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = icmp slt i32 %49, 10
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %48
  %53 = invoke noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 2 dereferenceable(2) %3)
          to label %54 unwind label %66

54:                                               ; preds = %52
  %55 = zext i1 %53 to i8
  store i8 %55, ptr %4, align 1, !tbaa !11
  %56 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %57 = trunc i8 %56 to i1
  br i1 %57, label %58, label %70

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

60:                                               ; preds = %58
  %61 = load i16, ptr %3, align 2, !tbaa !9
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %59, i16 noundef signext %61)
          to label %63 unwind label %66

63:                                               ; preds = %60
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %65 unwind label %66

65:                                               ; preds = %63
  br label %70

66:                                               ; preds = %70, %63, %60, %58, %52
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %79

70:                                               ; preds = %65, %54
  %71 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %72 = trunc i8 %71 to i1
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %72, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %73 unwind label %66

73:                                               ; preds = %70
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %48, !llvm.loop !17

77:                                               ; preds = %51
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #6
  call void @_ZN5StackIsED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  %78 = load i32, ptr %1, align 4
  ret i32 %78

79:                                               ; preds = %66, %36, %14
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #6
  call void @_ZN5StackIsED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  br label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %5, align 8
  %82 = load i32, ptr %6, align 4
  %83 = insertvalue { ptr, i32 } poison, ptr %81, 0
  %84 = insertvalue { ptr, i32 } %83, i32 %82, 1
  resume { ptr, i32 } %84
}

; 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 @_ZN5StackIsEC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5StackIsE4pushERKs(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 2 dereferenceable(2)) #3 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) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef signext) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12displayStackbR5StackIsE(i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(16)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5StackIsED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 = { 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 = { 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 #5 = { "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 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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.Stack = type { ptr, i32, i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 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.Stack, align 8
  %2 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  call void @_ZN5StackIsEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 10)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2) #6
  invoke void @_Z10checkStateR5StackIsE(ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader15 unwind label %4

.preheader15:                                     ; preds = %0, %20
  %.011 = phi i32 [ %7, %20 ], [ 0, %0 ]
  %exitcond.not = icmp eq i32 %.011, 10
  br i1 %exitcond.not, label %.preheader.preheader, label %6

.preheader.preheader:                             ; preds = %.preheader15
  %3 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %3, label %21, label %30

4:                                                ; preds = %0
  %5 = landingpad { ptr, i32 }
          cleanup
  br label %113

6:                                                ; preds = %.preheader15
  %7 = add nuw nsw i32 %.011, 1
  %8 = trunc nuw i32 %7 to i16
  %9 = mul nuw nsw i16 %8, 10
  store i16 %9, ptr %2, align 2, !tbaa !5
  %10 = call noundef zeroext i1 @_ZN5StackIsE4pushERKs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %10, label %11, label %20

11:                                               ; preds = %6
  %12 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %13 unwind label %18

13:                                               ; preds = %11
  %14 = load i16, ptr %2, align 2, !tbaa !5
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %12, i16 noundef signext %14)
          to label %16 unwind label %18

16:                                               ; preds = %13
  %17 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %20 unwind label %18

18:                                               ; preds = %20, %16, %13, %11
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %113

20:                                               ; preds = %16, %6
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %10, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader15 unwind label %18, !llvm.loop !9

21:                                               ; preds = %.preheader.preheader
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %23 unwind label %28

23:                                               ; preds = %21
  %24 = load i16, ptr %2, align 2, !tbaa !5
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %22, i16 noundef signext %24)
          to label %26 unwind label %28

26:                                               ; preds = %23
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %30 unwind label %28

28:                                               ; preds = %111, %109, %106, %104, %102, %100, %97, %95, %93, %91, %88, %86, %84, %82, %79, %77, %75, %73, %70, %68, %66, %64, %61, %59, %57, %55, %52, %50, %48, %46, %43, %41, %39, %37, %34, %32, %30, %26, %23, %21
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %113

30:                                               ; preds = %26, %.preheader.preheader
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %3, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.1 unwind label %28

.preheader.1:                                     ; preds = %30
  %31 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %31, label %32, label %39

32:                                               ; preds = %.preheader.1
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %34 unwind label %28

34:                                               ; preds = %32
  %35 = load i16, ptr %2, align 2, !tbaa !5
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %33, i16 noundef signext %35)
          to label %37 unwind label %28

37:                                               ; preds = %34
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %39 unwind label %28

39:                                               ; preds = %37, %.preheader.1
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %31, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.2 unwind label %28

.preheader.2:                                     ; preds = %39
  %40 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %40, label %41, label %48

41:                                               ; preds = %.preheader.2
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %43 unwind label %28

43:                                               ; preds = %41
  %44 = load i16, ptr %2, align 2, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %42, i16 noundef signext %44)
          to label %46 unwind label %28

46:                                               ; preds = %43
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %48 unwind label %28

48:                                               ; preds = %46, %.preheader.2
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %40, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.3 unwind label %28

.preheader.3:                                     ; preds = %48
  %49 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %49, label %50, label %57

50:                                               ; preds = %.preheader.3
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %52 unwind label %28

52:                                               ; preds = %50
  %53 = load i16, ptr %2, align 2, !tbaa !5
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %51, i16 noundef signext %53)
          to label %55 unwind label %28

55:                                               ; preds = %52
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %57 unwind label %28

57:                                               ; preds = %55, %.preheader.3
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %49, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.4 unwind label %28

.preheader.4:                                     ; preds = %57
  %58 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %58, label %59, label %66

59:                                               ; preds = %.preheader.4
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %61 unwind label %28

61:                                               ; preds = %59
  %62 = load i16, ptr %2, align 2, !tbaa !5
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %60, i16 noundef signext %62)
          to label %64 unwind label %28

64:                                               ; preds = %61
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %66 unwind label %28

66:                                               ; preds = %64, %.preheader.4
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %58, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.5 unwind label %28

.preheader.5:                                     ; preds = %66
  %67 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %67, label %68, label %75

68:                                               ; preds = %.preheader.5
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %70 unwind label %28

70:                                               ; preds = %68
  %71 = load i16, ptr %2, align 2, !tbaa !5
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %69, i16 noundef signext %71)
          to label %73 unwind label %28

73:                                               ; preds = %70
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %75 unwind label %28

75:                                               ; preds = %73, %.preheader.5
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %67, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.6 unwind label %28

.preheader.6:                                     ; preds = %75
  %76 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %76, label %77, label %84

77:                                               ; preds = %.preheader.6
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %79 unwind label %28

79:                                               ; preds = %77
  %80 = load i16, ptr %2, align 2, !tbaa !5
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %78, i16 noundef signext %80)
          to label %82 unwind label %28

82:                                               ; preds = %79
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %84 unwind label %28

84:                                               ; preds = %82, %.preheader.6
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %76, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.7 unwind label %28

.preheader.7:                                     ; preds = %84
  %85 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %85, label %86, label %93

86:                                               ; preds = %.preheader.7
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %88 unwind label %28

88:                                               ; preds = %86
  %89 = load i16, ptr %2, align 2, !tbaa !5
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %87, i16 noundef signext %89)
          to label %91 unwind label %28

91:                                               ; preds = %88
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %93 unwind label %28

93:                                               ; preds = %91, %.preheader.7
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %85, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.8 unwind label %28

.preheader.8:                                     ; preds = %93
  %94 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %94, label %95, label %102

95:                                               ; preds = %.preheader.8
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %97 unwind label %28

97:                                               ; preds = %95
  %98 = load i16, ptr %2, align 2, !tbaa !5
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %96, i16 noundef signext %98)
          to label %100 unwind label %28

100:                                              ; preds = %97
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %102 unwind label %28

102:                                              ; preds = %100, %.preheader.8
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %94, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader.9 unwind label %28

.preheader.9:                                     ; preds = %102
  %103 = call noundef zeroext i1 @_ZN5StackIsE3popERs(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %103, label %104, label %111

104:                                              ; preds = %.preheader.9
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %106 unwind label %28

106:                                              ; preds = %104
  %107 = load i16, ptr %2, align 2, !tbaa !5
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %105, i16 noundef signext %107)
          to label %109 unwind label %28

109:                                              ; preds = %106
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %111 unwind label %28

111:                                              ; preds = %109, %.preheader.9
  invoke void @_Z12displayStackbR5StackIsE(i1 noundef zeroext %103, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %112 unwind label %28

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

113:                                              ; preds = %28, %18, %4
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %29, %28 ], [ %5, %4 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #6
  call void @_ZN5StackIsED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  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 @_ZN5StackIsEC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5StackIsE4pushERKs(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #3 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 #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef signext) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12displayStackbR5StackIsE(i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5StackIsED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 = { 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 = { 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 #5 = { "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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass