; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: Data Structures/Stacks (redundant_braces)

; 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 i32 @_Z15redundantBracesNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %11 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %113, %1
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i32 2, ptr %7, align 4
  br label %116

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

22:                                               ; preds = %18
  %23 = load i8, ptr %21, align 1, !tbaa !11
  %24 = sext i8 %23 to i32
  %25 = icmp eq i32 %24, 43
  br i1 %25, label %58, label %26

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

30:                                               ; preds = %26
  %31 = load i8, ptr %29, align 1, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 45
  br i1 %33, label %58, label %34

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

38:                                               ; preds = %34
  %39 = load i8, ptr %37, align 1, !tbaa !11
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 47
  br i1 %41, label %58, label %42

42:                                               ; preds = %38
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %44)
          to label %46 unwind label %64

46:                                               ; preds = %42
  %47 = load i8, ptr %45, align 1, !tbaa !11
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 42
  br i1 %49, label %58, label %50

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

54:                                               ; preds = %50
  %55 = load i8, ptr %53, align 1, !tbaa !11
  %56 = sext i8 %55 to i32
  %57 = icmp eq i32 %56, 40
  br i1 %57, label %58, label %68

58:                                               ; preds = %54, %46, %38, %30, %22
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60)
          to label %62 unwind label %64

62:                                               ; preds = %58
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 1 dereferenceable(1) %61)
          to label %63 unwind label %64

63:                                               ; preds = %62
  br label %68

64:                                               ; preds = %76, %68, %62, %58, %50, %42, %34, %26, %18
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %8, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %9, align 4
  br label %118

68:                                               ; preds = %63, %54
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %70)
          to label %72 unwind label %64

72:                                               ; preds = %68
  %73 = load i8, ptr %71, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 41
  br i1 %75, label %76, label %112

76:                                               ; preds = %72
  %77 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %78 unwind label %64

78:                                               ; preds = %76
  %79 = load i8, ptr %77, align 1, !tbaa !11
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 40
  br i1 %81, label %82, label %83

82:                                               ; preds = %78
  store i32 1, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %116

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

84:                                               ; preds = %96, %83
  %85 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %86 unwind label %99

86:                                               ; preds = %84
  br i1 %85, label %93, label %87

87:                                               ; preds = %86
  %88 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %89 unwind label %99

89:                                               ; preds = %87
  %90 = load i8, ptr %88, align 1, !tbaa !11
  %91 = sext i8 %90 to i32
  %92 = icmp ne i32 %91, 40
  br label %93

93:                                               ; preds = %89, %86
  %94 = phi i1 [ false, %86 ], [ %92, %89 ]
  br i1 %94, label %95, label %103

95:                                               ; preds = %93
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %96 unwind label %99

96:                                               ; preds = %95
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %10, align 4, !tbaa !9
  br label %84, !llvm.loop !12

99:                                               ; preds = %107, %95, %87, %84
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %8, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %118

103:                                              ; preds = %93
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %103
  store i32 1, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %109

107:                                              ; preds = %103
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %108 unwind label %99

108:                                              ; preds = %107
  store i32 0, ptr %7, align 4
  br label %109

109:                                              ; preds = %108, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %110 = load i32, ptr %7, align 4
  switch i32 %110, label %116 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %112

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

113:                                              ; preds = %112
  %114 = load i32, ptr %6, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %6, align 4, !tbaa !9
  br label %13, !llvm.loop !14

116:                                              ; preds = %109, %82, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %117 = load i32, ptr %7, align 4
  switch i32 %117, label %120 [
    i32 2, label %119
  ]

118:                                              ; preds = %99, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %122

119:                                              ; preds = %116
  store i32 0, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %120

120:                                              ; preds = %119, %116
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %121 = load i32, ptr %2, align 4
  ret i32 %121

122:                                              ; preds = %118
  %123 = load ptr, ptr %8, align 8
  %124 = load i32, ptr %9, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126
}

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

; 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 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 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 noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(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"}
!14 = distinct !{!14, !13}


; 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 i32 @_Z15redundantBracesNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  %3 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %4 = trunc i64 %3 to i32
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not2229 = icmp sgt i32 %4, 0
  br i1 %.not2229, label %.lr.ph32.preheader, label %.critedge24

.lr.ph32.preheader:                               ; preds = %1
  %5 = and i64 %3, 2147483647
  %wide.trip.count = and i64 %3, 2147483647
  br label %.lr.ph32

.lr.ph32:                                         ; preds = %.lr.ph32.preheader, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph32.preheader ], [ %indvars.iv.next, %43 ]
  %.not2231 = phi i1 [ true, %.lr.ph32.preheader ], [ %.not22, %43 ]
  %6 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = icmp eq i8 %7, 43
  br i1 %8, label %25, label %9

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

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

17:                                               ; preds = %13
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = icmp eq i8 %19, 42
  br i1 %20, label %25, label %21

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

25:                                               ; preds = %21, %17, %13, %9, %.lr.ph32
  %26 = 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) %26)
          to label %29 unwind label %27

27:                                               ; preds = %25
  %28 = 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 } %28

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

33:                                               ; preds = %29
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %35 = load i8, ptr %34, align 1, !tbaa !5
  %36 = icmp eq i8 %35, 40
  br i1 %36, label %.critedge24.loopexit, label %.preheader

.preheader:                                       ; preds = %33
  %37 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %37, label %.critedge24.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %40
  %.026 = phi i32 [ %41, %40 ], [ 0, %.preheader ]
  %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
  %.not = icmp eq i8 %39, 40
  br i1 %.not, label %.critedge, label %40

40:                                               ; preds = %.lr.ph
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %41 = add nuw nsw i32 %.026, 1
  %42 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %42, label %.critedge.thread39, label %.lr.ph, !llvm.loop !8

.critedge:                                        ; preds = %.lr.ph
  %.not21 = icmp eq i32 %.026, 0
  br i1 %.not21, label %.critedge24.loopexit, label %.critedge.thread39

.critedge.thread39:                               ; preds = %40, %.critedge
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br label %43

43:                                               ; preds = %.critedge.thread39, %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not22 = icmp ult i64 %indvars.iv.next, %5
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge24.loopexit, label %.lr.ph32, !llvm.loop !10

.critedge24.loopexit:                             ; preds = %.preheader, %.critedge, %33, %43
  %.not22.lcssa.ph = phi i1 [ %.not22, %43 ], [ %.not2231, %33 ], [ %.not2231, %.critedge ], [ %.not2231, %.preheader ]
  %44 = zext i1 %.not22.lcssa.ph to i32
  br label %.critedge24

.critedge24:                                      ; preds = %.critedge24.loopexit, %1
  %.not22.lcssa = phi i32 [ 0, %1 ], [ %44, %.critedge24.loopexit ]
  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 i32 %.not22.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 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 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 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 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 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"}
!10 = distinct !{!10, !9}


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