; LLVM IR from priyankchheda/algorithms :: _other_languages/cpp/Stack (infixToPostfix)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.Stack::Stack" = type { ptr, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14infixToPostfixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.Stack::Stack", align 8
  %6 = alloca i1, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  call void @_ZN5Stack5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 10)
  store i1 false, ptr %6, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %11 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #3
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %144, %2
  %14 = load i32, ptr %8, align 4, !tbaa !9
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %147

18:                                               ; preds = %13
  %19 = load i32, ptr %8, 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) %1, i64 noundef %20)
          to label %22 unwind label %58

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

26:                                               ; preds = %22
  %27 = load i32, ptr %8, 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) %1, i64 noundef %28)
          to label %30 unwind label %58

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

34:                                               ; preds = %30, %22
  %35 = load i32, ptr %8, 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) %1, i64 noundef %36)
          to label %38 unwind label %58

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

42:                                               ; preds = %38
  %43 = load i32, ptr %8, 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) %1, i64 noundef %44)
          to label %46 unwind label %58

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

50:                                               ; preds = %46, %30
  %51 = load i32, ptr %8, 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) %1, i64 noundef %52)
          to label %54 unwind label %58

54:                                               ; preds = %50
  %55 = load i8, ptr %53, align 1, !tbaa !11
  %56 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %55)
          to label %57 unwind label %58

57:                                               ; preds = %54
  br label %143

58:                                               ; preds = %137, %133, %130, %128, %119, %115, %112, %107, %102, %99, %97, %90, %87, %78, %74, %70, %62, %54, %50, %42, %34, %26, %18
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %163

62:                                               ; preds = %46, %38
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %64)
          to label %66 unwind label %58

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

70:                                               ; preds = %66
  %71 = load i32, ptr %8, 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) %1, i64 noundef %72)
          to label %74 unwind label %58

74:                                               ; preds = %70
  %75 = load i8, ptr %73, align 1, !tbaa !11
  %76 = invoke noundef i32 @_ZN5Stack5StackIcE4pushEc(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 noundef signext %75)
          to label %77 unwind label %58

77:                                               ; preds = %74
  br label %142

78:                                               ; preds = %66
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %80)
          to label %82 unwind label %58

82:                                               ; preds = %78
  %83 = load i8, ptr %81, align 1, !tbaa !11
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 41
  br i1 %85, label %86, label %111

86:                                               ; preds = %82
  br label %87

87:                                               ; preds = %101, %86
  %88 = invoke noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %89 unwind label %58

89:                                               ; preds = %87
  br i1 %88, label %95, label %90

90:                                               ; preds = %89
  %91 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %92 unwind label %58

92:                                               ; preds = %90
  %93 = sext i8 %91 to i32
  %94 = icmp ne i32 %93, 40
  br label %95

95:                                               ; preds = %92, %89
  %96 = phi i1 [ false, %89 ], [ %94, %92 ]
  br i1 %96, label %97, label %102

97:                                               ; preds = %95
  %98 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %99 unwind label %58

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %98)
          to label %101 unwind label %58

101:                                              ; preds = %99
  br label %87, !llvm.loop !12

102:                                              ; preds = %95
  %103 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %104 unwind label %58

104:                                              ; preds = %102
  %105 = sext i8 %103 to i32
  %106 = icmp eq i32 %105, 40
  br i1 %106, label %107, label %110

107:                                              ; preds = %104
  %108 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %109 unwind label %58

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %104
  br label %141

111:                                              ; preds = %82
  br label %112

112:                                              ; preds = %132, %111
  %113 = invoke noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %114 unwind label %58

114:                                              ; preds = %112
  br i1 %113, label %126, label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %8, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %117)
          to label %119 unwind label %58

119:                                              ; preds = %115
  %120 = load i8, ptr %118, align 1, !tbaa !11
  %121 = call noundef i32 @_Z10precedencec(i8 noundef signext %120)
  %122 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %123 unwind label %58

123:                                              ; preds = %119
  %124 = call noundef i32 @_Z10precedencec(i8 noundef signext %122)
  %125 = icmp sle i32 %121, %124
  br label %126

126:                                              ; preds = %123, %114
  %127 = phi i1 [ false, %114 ], [ %125, %123 ]
  br i1 %127, label %128, label %133

128:                                              ; preds = %126
  %129 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %130 unwind label %58

130:                                              ; preds = %128
  %131 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %129)
          to label %132 unwind label %58

132:                                              ; preds = %130
  br label %112, !llvm.loop !14

133:                                              ; preds = %126
  %134 = load i32, ptr %8, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %135)
          to label %137 unwind label %58

137:                                              ; preds = %133
  %138 = load i8, ptr %136, align 1, !tbaa !11
  %139 = invoke noundef i32 @_ZN5Stack5StackIcE4pushEc(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 noundef signext %138)
          to label %140 unwind label %58

140:                                              ; preds = %137
  br label %141

141:                                              ; preds = %140, %110
  br label %142

142:                                              ; preds = %141, %77
  br label %143

143:                                              ; preds = %142, %57
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %8, align 4, !tbaa !9
  br label %13, !llvm.loop !15

147:                                              ; preds = %17
  br label %148

148:                                              ; preds = %156, %147
  %149 = invoke noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %150 unwind label %157

150:                                              ; preds = %148
  %151 = xor i1 %149, true
  br i1 %151, label %152, label %161

152:                                              ; preds = %150
  %153 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %154 unwind label %157

154:                                              ; preds = %152
  %155 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %153)
          to label %156 unwind label %157

156:                                              ; preds = %154
  br label %148, !llvm.loop !16

157:                                              ; preds = %154, %152, %148
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %9, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %10, align 4
  br label %163

161:                                              ; preds = %150
  store i1 true, ptr %6, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %162 = load i1, ptr %6, align 1
  br i1 %162, label %165, label %164

163:                                              ; preds = %157, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @_ZN5Stack5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  br label %166

164:                                              ; preds = %161
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %165

165:                                              ; preds = %164, %161
  call void @_ZN5Stack5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  ret void

166:                                              ; preds = %163
  %167 = load ptr, ptr %9, align 8
  %168 = load i32, ptr %10, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10precedencec(i8 noundef signext) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5Stack5StackIcE4pushEc(ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.Stack::Stack" = type { ptr, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14infixToPostfixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.Stack::Stack", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @_ZN5Stack5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef 10)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %4 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #3
  %5 = trunc i64 %4 to i32
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %.preheader.preheader

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = and i64 %4, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %63
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %63 ]
  %7 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = icmp sgt i8 %8, 96
  br i1 %9, label %10, label %14

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

14:                                               ; preds = %10, %.lr.ph
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = icmp sgt i8 %16, 64
  br i1 %17, label %18, label %26

18:                                               ; preds = %14
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = icmp slt i8 %20, 91
  br i1 %21, label %22, label %26

22:                                               ; preds = %18, %10
  %23 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %24)
          to label %63 unwind label %.loopexit.split-lp.loopexit.split-lp

.loopexit:                                        ; preds = %35, %38, %40
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %57, %55, %48
  %lpad.loopexit23 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %.critedge2.invoke, %45, %.critedge, %22
  %lpad.loopexit.split-lp24 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

26:                                               ; preds = %18, %14
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %28 = load i8, ptr %27, align 1, !tbaa !5
  %29 = icmp eq i8 %28, 40
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %31 = load i8, ptr %30, align 1, !tbaa !5
  br i1 %29, label %.critedge2.invoke, label %32

32:                                               ; preds = %26
  %33 = icmp eq i8 %31, 41
  br i1 %33, label %.preheader21, label %.preheader22

.preheader21:                                     ; preds = %32, %40
  %34 = call noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  br i1 %34, label %.critedge, label %35

35:                                               ; preds = %.preheader21
  %36 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %37 unwind label %.loopexit

37:                                               ; preds = %35
  %.not19 = icmp eq i8 %36, 40
  br i1 %.not19, label %.critedge, label %38

38:                                               ; preds = %37
  %39 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %40 unwind label %.loopexit

40:                                               ; preds = %38
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %39)
          to label %.preheader21 unwind label %.loopexit, !llvm.loop !8

.critedge:                                        ; preds = %.preheader21, %37
  %42 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %43 unwind label %.loopexit.split-lp.loopexit.split-lp

43:                                               ; preds = %.critedge
  %44 = icmp eq i8 %42, 40
  br i1 %44, label %45, label %63

45:                                               ; preds = %43
  %46 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %63 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader22:                                     ; preds = %32, %57
  %47 = call noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  br i1 %47, label %.critedge2, label %48

48:                                               ; preds = %.preheader22
  %49 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = call noundef i32 @_Z10precedencec(i8 noundef signext %50)
  %52 = invoke noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %53 unwind label %.loopexit.split-lp.loopexit

53:                                               ; preds = %48
  %54 = call noundef i32 @_Z10precedencec(i8 noundef signext %52)
  %.not = icmp sgt i32 %51, %54
  br i1 %.not, label %.critedge2, label %55

55:                                               ; preds = %53
  %56 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %57 unwind label %.loopexit.split-lp.loopexit

57:                                               ; preds = %55
  %58 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %56)
          to label %.preheader22 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !10

.critedge2:                                       ; preds = %.preheader22, %53
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %60 = load i8, ptr %59, align 1, !tbaa !5
  br label %.critedge2.invoke

.critedge2.invoke:                                ; preds = %26, %.critedge2
  %61 = phi i8 [ %60, %.critedge2 ], [ %31, %26 ]
  %62 = invoke noundef i32 @_ZN5Stack5StackIcE4pushEc(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 noundef signext %61)
          to label %63 unwind label %.loopexit.split-lp.loopexit.split-lp

63:                                               ; preds = %.critedge2.invoke, %22, %45, %43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader.preheader, label %.lr.ph, !llvm.loop !11

.preheader.preheader:                             ; preds = %63, %2
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %67
  %64 = call noundef zeroext i1 @_ZN5Stack5StackIcE7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  br i1 %64, label %71, label %65

65:                                               ; preds = %.preheader
  %66 = invoke noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %67 unwind label %69

67:                                               ; preds = %65
  %68 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %66)
          to label %.preheader unwind label %69, !llvm.loop !12

69:                                               ; preds = %67, %65
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %69
  %.pn = phi { ptr, i32 } [ %70, %69 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit23, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp24, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @_ZN5Stack5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  resume { ptr, i32 } %.pn

71:                                               ; preds = %.preheader
  call void @_ZN5Stack5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10precedencec(i8 noundef signext) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5Stack5StackIcE4pushEc(ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN5Stack5StackIcE4peekEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN5Stack5StackIcE3popEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


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