; LLVM IR from amritansh22/Data-Structures-and-Algorithms-in-cpp :: Check Balanced Paranthesis/Z13checkBalancedNSt7/cxx1112basic_stringIcSt11char_tr_f06dd0cc/Z13checkBalancedNSt7 (traitsIcESaIcEEE)

; 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 @_Z13checkBalancedNSt7__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 i32, align 4
  %7 = alloca ptr, align 8
  %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 = %116, %1
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = sext i32 %10 to i64
  %12 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %13 = icmp ult i64 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  store i32 2, ptr %6, align 4
  br label %119

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

19:                                               ; preds = %15
  %20 = load i8, ptr %18, align 1, !tbaa !11
  %21 = sext i8 %20 to i32
  %22 = icmp eq i32 %21, 40
  br i1 %22, label %39, label %23

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

27:                                               ; preds = %23
  %28 = load i8, ptr %26, align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = icmp eq i32 %29, 91
  br i1 %30, label %39, label %31

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

35:                                               ; preds = %31
  %36 = load i8, ptr %34, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 123
  br i1 %38, label %39, label %49

39:                                               ; preds = %35, %27, %19
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %41)
          to label %43 unwind label %45

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

44:                                               ; preds = %43
  br label %115

45:                                               ; preds = %109, %102, %99, %91, %88, %81, %78, %70, %67, %60, %57, %49, %43, %39, %31, %23, %15
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %132

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

53:                                               ; preds = %49
  %54 = load i8, ptr %52, align 1, !tbaa !11
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 41
  br i1 %56, label %57, label %70

57:                                               ; preds = %53
  %58 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %59 unwind label %45

59:                                               ; preds = %57
  br i1 %58, label %66, label %60

60:                                               ; preds = %59
  %61 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %62 unwind label %45

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

66:                                               ; preds = %62, %59
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %119

67:                                               ; preds = %62
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %68 unwind label %45

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  br label %114

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

74:                                               ; preds = %70
  %75 = load i8, ptr %73, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %76, 125
  br i1 %77, label %78, label %91

78:                                               ; preds = %74
  %79 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %80 unwind label %45

80:                                               ; preds = %78
  br i1 %79, label %87, label %81

81:                                               ; preds = %80
  %82 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %83 unwind label %45

83:                                               ; preds = %81
  %84 = load i8, ptr %82, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp ne i32 %85, 123
  br i1 %86, label %87, label %88

87:                                               ; preds = %83, %80
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %119

88:                                               ; preds = %83
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %89 unwind label %45

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  br label %113

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

95:                                               ; preds = %91
  %96 = load i8, ptr %94, align 1, !tbaa !11
  %97 = sext i8 %96 to i32
  %98 = icmp eq i32 %97, 93
  br i1 %98, label %99, label %112

99:                                               ; preds = %95
  %100 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %101 unwind label %45

101:                                              ; preds = %99
  br i1 %100, label %108, label %102

102:                                              ; preds = %101
  %103 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %104 unwind label %45

104:                                              ; preds = %102
  %105 = load i8, ptr %103, align 1, !tbaa !11
  %106 = sext i8 %105 to i32
  %107 = icmp ne i32 %106, 91
  br i1 %107, label %108, label %109

108:                                              ; preds = %104, %101
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %119

109:                                              ; preds = %104
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %110 unwind label %45

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111, %95
  br label %113

113:                                              ; preds = %112, %90
  br label %114

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

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

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

119:                                              ; preds = %108, %87, %66, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %120 = load i32, ptr %6, align 4
  switch i32 %120, label %130 [
    i32 2, label %121
  ]

121:                                              ; preds = %119
  %122 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %123 unwind label %125

123:                                              ; preds = %121
  br i1 %122, label %129, label %124

124:                                              ; preds = %123
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %130

125:                                              ; preds = %121
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %7, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %8, align 4
  br label %132

129:                                              ; preds = %123
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %130

130:                                              ; preds = %129, %124, %119
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  %131 = load i1, ptr %2, align 1
  ret i1 %131

132:                                              ; preds = %125, %45
  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 %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %7, align 8
  %135 = load i32, ptr %8, align 4
  %136 = insertvalue { ptr, i32 } poison, ptr %134, 0
  %137 = insertvalue { ptr, i32 } %136, i32 %135, 1
  resume { ptr, i32 } %137
}

; 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 i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 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 zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(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 @_Z13checkBalancedNSt7__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 i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %.not1617.not = icmp eq i64 %3, 0
  br i1 %.not1617.not, label %.critedge, label %.lr.ph

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

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

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

15:                                               ; preds = %11, %7, %.lr.ph
  %16 = 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) %16)
          to label %46 unwind label %17

17:                                               ; preds = %15
  %18 = 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 } %18

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

23:                                               ; preds = %19
  %24 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %24, label %.loopexit, label %25

25:                                               ; preds = %23
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %.not15 = icmp eq i8 %27, 40
  br i1 %.not15, label %.sink.split, label %.loopexit

28:                                               ; preds = %19
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = icmp eq i8 %30, 125
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %33, label %.loopexit, label %34

34:                                               ; preds = %32
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %.not14 = icmp eq i8 %36, 123
  br i1 %.not14, label %.sink.split, label %.loopexit

37:                                               ; preds = %28
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = icmp eq i8 %39, 93
  br i1 %40, label %41, label %46

41:                                               ; preds = %37
  %42 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %42, label %.loopexit, label %43

43:                                               ; preds = %41
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %.not = icmp eq i8 %45, 91
  br i1 %.not, label %.sink.split, label %.loopexit

.sink.split:                                      ; preds = %43, %34, %25
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br label %46

46:                                               ; preds = %.sink.split, %15, %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %.not16 = icmp ugt i64 %47, %indvars.iv.next
  br i1 %.not16, label %.lr.ph, label %.critedge, !llvm.loop !8

.critedge:                                        ; preds = %46, %1
  %48 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br label %.loopexit

.loopexit:                                        ; preds = %25, %23, %34, %32, %43, %41, %.critedge
  %.1 = phi i1 [ %48, %.critedge ], [ false, %41 ], [ false, %43 ], [ false, %32 ], [ false, %34 ], [ false, %23 ], [ false, %25 ]
  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 %.1
}

; 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 i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 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 zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(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,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass