; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Data-Structures/Stack (balanced_brackets)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl" }
%"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl" = type { %"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl_data" }
%"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z10isBalancedNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %117, %1
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = sext i32 %10 to i64
  %12 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %11)
          to label %13 unwind label %47

13:                                               ; preds = %9
  %14 = load i8, ptr %12, align 1, !tbaa !11
  %15 = sext i8 %14 to i32
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %120

17:                                               ; preds = %13
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %19)
          to label %21 unwind label %47

21:                                               ; preds = %17
  %22 = load i8, ptr %20, align 1, !tbaa !11
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 40
  br i1 %24, label %41, label %25

25:                                               ; preds = %21
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %27)
          to label %29 unwind label %47

29:                                               ; preds = %25
  %30 = load i8, ptr %28, align 1, !tbaa !11
  %31 = sext i8 %30 to i32
  %32 = icmp eq i32 %31, 123
  br i1 %32, label %41, label %33

33:                                               ; preds = %29
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %35)
          to label %37 unwind label %47

37:                                               ; preds = %33
  %38 = load i8, ptr %36, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 91
  br i1 %40, label %41, label %51

41:                                               ; preds = %37, %29, %21
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %43)
          to label %45 unwind label %47

45:                                               ; preds = %41
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 1 dereferenceable(1) %44)
          to label %46 unwind label %47

46:                                               ; preds = %45
  br label %117

47:                                               ; preds = %112, %105, %101, %93, %91, %84, %80, %72, %70, %63, %59, %51, %45, %41, %33, %25, %17, %9
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  br label %123

51:                                               ; preds = %37
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %53)
          to label %55 unwind label %47

55:                                               ; preds = %51
  %56 = load i8, ptr %54, align 1, !tbaa !11
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 41
  br i1 %58, label %59, label %72

59:                                               ; preds = %55
  %60 = invoke noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %61 unwind label %47

61:                                               ; preds = %59
  %62 = icmp eq i64 %60, 0
  br i1 %62, label %69, label %63

63:                                               ; preds = %61
  %64 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %65 unwind label %47

65:                                               ; preds = %63
  %66 = load i8, ptr %64, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = icmp ne i32 %67, 40
  br i1 %68, label %69, label %70

69:                                               ; preds = %65, %61
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %121

70:                                               ; preds = %65
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %71 unwind label %47

71:                                               ; preds = %70
  br label %116

72:                                               ; preds = %55
  %73 = load i32, ptr %5, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %74)
          to label %76 unwind label %47

76:                                               ; preds = %72
  %77 = load i8, ptr %75, align 1, !tbaa !11
  %78 = sext i8 %77 to i32
  %79 = icmp eq i32 %78, 93
  br i1 %79, label %80, label %93

80:                                               ; preds = %76
  %81 = invoke noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %82 unwind label %47

82:                                               ; preds = %80
  %83 = icmp eq i64 %81, 0
  br i1 %83, label %90, label %84

84:                                               ; preds = %82
  %85 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %86 unwind label %47

86:                                               ; preds = %84
  %87 = load i8, ptr %85, align 1, !tbaa !11
  %88 = sext i8 %87 to i32
  %89 = icmp ne i32 %88, 91
  br i1 %89, label %90, label %91

90:                                               ; preds = %86, %82
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %121

91:                                               ; preds = %86
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %92 unwind label %47

92:                                               ; preds = %91
  br label %115

93:                                               ; preds = %76
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %95)
          to label %97 unwind label %47

97:                                               ; preds = %93
  %98 = load i8, ptr %96, align 1, !tbaa !11
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 125
  br i1 %100, label %101, label %114

101:                                              ; preds = %97
  %102 = invoke noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %103 unwind label %47

103:                                              ; preds = %101
  %104 = icmp eq i64 %102, 0
  br i1 %104, label %111, label %105

105:                                              ; preds = %103
  %106 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %107 unwind label %47

107:                                              ; preds = %105
  %108 = load i8, ptr %106, align 1, !tbaa !11
  %109 = sext i8 %108 to i32
  %110 = icmp ne i32 %109, 123
  br i1 %110, label %111, label %112

111:                                              ; preds = %107, %103
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %121

112:                                              ; preds = %107
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %113 unwind label %47

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113, %97
  br label %115

115:                                              ; preds = %114, %92
  br label %116

116:                                              ; preds = %115, %71
  br label %117

117:                                              ; preds = %116, %46
  %118 = load i32, ptr %5, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %5, align 4, !tbaa !9
  br label %9, !llvm.loop !12

120:                                              ; preds = %13
  store i1 true, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %121

121:                                              ; preds = %120, %111, %90, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  %122 = load i1, ptr %2, align 1
  ret i1 %122

123:                                              ; preds = %47
  %124 = load ptr, ptr %6, align 8
  %125 = load i32, ptr %7, align 4
  %126 = insertvalue { ptr, i32 } poison, ptr %124, 0
  %127 = insertvalue { ptr, i32 } %126, i32 %125, 1
  resume { ptr, i32 } %127
}

; 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 @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl" }
%"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl" = type { %"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl_data" }
%"struct.std::_Deque_base<char, std::allocator<char>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z10isBalancedNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %3 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef 0)
  %4 = load i8, ptr %3, align 1, !tbaa !5
  %.not16 = icmp eq i8 %4, 0
  br i1 %.not16, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1, %50
  %indvars.iv = phi i64 [ %indvars.iv.next, %50 ], [ 0, %1 ]
  %5 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = icmp eq i8 %6, 40
  br i1 %7, label %16, label %8

8:                                                ; preds = %.lr.ph
  %9 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %11 = icmp eq i8 %10, 123
  br i1 %11, label %16, label %12

12:                                               ; preds = %8
  %13 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = icmp eq i8 %14, 91
  br i1 %15, label %16, label %20

16:                                               ; preds = %12, %8, %.lr.ph
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %50 unwind label %18

18:                                               ; preds = %16
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  resume { ptr, i32 } %19

20:                                               ; preds = %12
  %21 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = icmp eq i8 %22, 41
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  %25 = call noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %._crit_edge, label %27

27:                                               ; preds = %24
  %28 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %.not14 = icmp eq i8 %29, 40
  br i1 %.not14, label %.sink.split, label %._crit_edge

30:                                               ; preds = %20
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = icmp eq i8 %32, 93
  br i1 %33, label %34, label %40

34:                                               ; preds = %30
  %35 = call noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %36 = icmp eq i64 %35, 0
  br i1 %36, label %._crit_edge, label %37

37:                                               ; preds = %34
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %.not13 = icmp eq i8 %39, 91
  br i1 %.not13, label %.sink.split, label %._crit_edge

40:                                               ; preds = %30
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = icmp eq i8 %42, 125
  br i1 %43, label %44, label %50

44:                                               ; preds = %40
  %45 = call noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %._crit_edge, label %47

47:                                               ; preds = %44
  %48 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %49 = load i8, ptr %48, align 1, !tbaa !5
  %.not12 = icmp eq i8 %49, 123
  br i1 %.not12, label %.sink.split, label %._crit_edge

.sink.split:                                      ; preds = %47, %37, %27
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br label %50

50:                                               ; preds = %.sink.split, %40, %16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv.next)
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %.not = icmp eq i8 %52, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %27, %24, %37, %34, %47, %44, %50, %1
  %.not.lcssa = phi i1 [ true, %1 ], [ true, %50 ], [ false, %44 ], [ false, %47 ], [ false, %34 ], [ false, %37 ], [ false, %24 ], [ false, %27 ]
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  ret i1 %.not.lcssa
}

; 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 @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5stackIcSt5dequeIcSaIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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


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