; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/stack (string_expression_evaluation_bodmas)

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

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

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

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 nounwind uwtable
declare dso_local noundef i32 @_Z10precedencec(i8 noundef signext) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9calculateiic(i32 noundef, i32 noundef, i8 noundef signext) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8evaluateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca %"class.std::stack.3", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #5
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %23 unwind label %68

23:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %24 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %250, %23
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %253

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

34:                                               ; preds = %30
  %35 = load i8, ptr %33, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = call i32 @isdigit(i32 noundef %36) #6
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %84

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

40:                                               ; preds = %61, %39
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %53

44:                                               ; preds = %40
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %46)
          to label %48 unwind label %76

48:                                               ; preds = %44
  %49 = load i8, ptr %47, align 1, !tbaa !11
  %50 = sext i8 %49 to i32
  %51 = call i32 @isdigit(i32 noundef %50) #6
  %52 = icmp ne i32 %51, 0
  br label %53

53:                                               ; preds = %48, %40
  %54 = phi i1 [ false, %40 ], [ %52, %48 ]
  br i1 %54, label %55, label %80

55:                                               ; preds = %53
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = mul nsw i32 %56, 10
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %59)
          to label %61 unwind label %76

61:                                               ; preds = %55
  %62 = load i8, ptr %60, align 1, !tbaa !11
  %63 = sext i8 %62 to i32
  %64 = sub nsw i32 %63, 48
  %65 = add nsw i32 %57, %64
  store i32 %65, ptr %9, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !9
  br label %40, !llvm.loop !12

68:                                               ; preds = %1
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  br label %300

72:                                               ; preds = %295, %254, %243, %239, %192, %188, %185, %182, %178, %170, %166, %164, %160, %157, %155, %110, %107, %98, %84, %30
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %5, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %6, align 4
  br label %299

76:                                               ; preds = %80, %55, %44
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %5, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %299

80:                                               ; preds = %53
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %81 unwind label %76

81:                                               ; preds = %80
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %249

84:                                               ; preds = %34
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %86)
          to label %88 unwind label %72

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

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 40, ptr %10, align 1, !tbaa !11
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushEOc(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %93 unwind label %94

93:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %248

94:                                               ; preds = %92
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %5, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %299

98:                                               ; preds = %88
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %100)
          to label %102 unwind label %72

102:                                              ; preds = %98
  %103 = load i8, ptr %101, align 1, !tbaa !11
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 41
  br i1 %105, label %106, label %157

106:                                              ; preds = %102
  br label %107

107:                                              ; preds = %135, %106
  %108 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %109 unwind label %72

109:                                              ; preds = %107
  br i1 %108, label %116, label %110

110:                                              ; preds = %109
  %111 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %112 unwind label %72

112:                                              ; preds = %110
  %113 = load i8, ptr %111, align 1, !tbaa !11
  %114 = sext i8 %113 to i32
  %115 = icmp ne i32 %114, 40
  br label %116

116:                                              ; preds = %112, %109
  %117 = phi i1 [ false, %109 ], [ %115, %112 ]
  br i1 %117, label %118, label %155

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %119 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %120 unwind label %136

120:                                              ; preds = %118
  %121 = load i32, ptr %119, align 4, !tbaa !9
  store i32 %121, ptr %11, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %122 unwind label %136

122:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %123 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %124 unwind label %140

124:                                              ; preds = %122
  %125 = load i32, ptr %123, align 4, !tbaa !9
  store i32 %125, ptr %12, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %126 unwind label %140

126:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %127 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %128 unwind label %144

128:                                              ; preds = %126
  %129 = load i8, ptr %127, align 1, !tbaa !11
  store i8 %129, ptr %13, align 1, !tbaa !11
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %130 unwind label %144

130:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = load i32, ptr %11, align 4, !tbaa !9
  %133 = load i8, ptr %13, align 1, !tbaa !11
  %134 = call noundef i32 @_Z9calculateiic(i32 noundef %131, i32 noundef %132, i8 noundef signext %133)
  store i32 %134, ptr %14, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %135 unwind label %148

135:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %107, !llvm.loop !14

136:                                              ; preds = %120, %118
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %5, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %6, align 4
  br label %154

140:                                              ; preds = %124, %122
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %5, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %6, align 4
  br label %153

144:                                              ; preds = %128, %126
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %5, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %6, align 4
  br label %152

148:                                              ; preds = %130
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %5, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %152

152:                                              ; preds = %148, %144
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  br label %153

153:                                              ; preds = %152, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %154

154:                                              ; preds = %153, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %299

155:                                              ; preds = %116
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %156 unwind label %72

156:                                              ; preds = %155
  br label %247

157:                                              ; preds = %102
  %158 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %159 unwind label %72

159:                                              ; preds = %157
  br i1 %158, label %160, label %166

160:                                              ; preds = %159
  %161 = load i32, ptr %7, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %162)
          to label %164 unwind label %72

164:                                              ; preds = %160
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 1 dereferenceable(1) %163)
          to label %165 unwind label %72

165:                                              ; preds = %164
  br label %246

166:                                              ; preds = %159
  %167 = load i32, ptr %7, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %168)
          to label %170 unwind label %72

170:                                              ; preds = %166
  %171 = load i8, ptr %169, align 1, !tbaa !11
  %172 = call noundef i32 @_Z10precedencec(i8 noundef signext %171)
  %173 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %174 unwind label %72

174:                                              ; preds = %170
  %175 = load i8, ptr %173, align 1, !tbaa !11
  %176 = call noundef i32 @_Z10precedencec(i8 noundef signext %175)
  %177 = icmp sgt i32 %172, %176
  br i1 %177, label %178, label %184

178:                                              ; preds = %174
  %179 = load i32, ptr %7, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %180)
          to label %182 unwind label %72

182:                                              ; preds = %178
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 1 dereferenceable(1) %181)
          to label %183 unwind label %72

183:                                              ; preds = %182
  br label %245

184:                                              ; preds = %174
  br label %185

185:                                              ; preds = %219, %184
  %186 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %187 unwind label %72

187:                                              ; preds = %185
  br i1 %186, label %200, label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %7, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %190)
          to label %192 unwind label %72

192:                                              ; preds = %188
  %193 = load i8, ptr %191, align 1, !tbaa !11
  %194 = call noundef i32 @_Z10precedencec(i8 noundef signext %193)
  %195 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %196 unwind label %72

196:                                              ; preds = %192
  %197 = load i8, ptr %195, align 1, !tbaa !11
  %198 = call noundef i32 @_Z10precedencec(i8 noundef signext %197)
  %199 = icmp sle i32 %194, %198
  br label %200

200:                                              ; preds = %196, %187
  %201 = phi i1 [ false, %187 ], [ %199, %196 ]
  br i1 %201, label %202, label %239

202:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %203 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %204 unwind label %220

204:                                              ; preds = %202
  %205 = load i32, ptr %203, align 4, !tbaa !9
  store i32 %205, ptr %15, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %206 unwind label %220

206:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %207 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %208 unwind label %224

208:                                              ; preds = %206
  %209 = load i32, ptr %207, align 4, !tbaa !9
  store i32 %209, ptr %16, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %210 unwind label %224

210:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %211 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %212 unwind label %228

212:                                              ; preds = %210
  %213 = load i8, ptr %211, align 1, !tbaa !11
  store i8 %213, ptr %17, align 1, !tbaa !11
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %214 unwind label %228

214:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %215 = load i32, ptr %16, align 4, !tbaa !9
  %216 = load i32, ptr %15, align 4, !tbaa !9
  %217 = load i8, ptr %17, align 1, !tbaa !11
  %218 = call noundef i32 @_Z9calculateiic(i32 noundef %215, i32 noundef %216, i8 noundef signext %217)
  store i32 %218, ptr %18, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %219 unwind label %232

219:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %185, !llvm.loop !15

220:                                              ; preds = %204, %202
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %5, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %6, align 4
  br label %238

224:                                              ; preds = %208, %206
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %5, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %6, align 4
  br label %237

228:                                              ; preds = %212, %210
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %5, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %6, align 4
  br label %236

232:                                              ; preds = %214
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %5, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %236

236:                                              ; preds = %232, %228
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %237

237:                                              ; preds = %236, %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %238

238:                                              ; preds = %237, %220
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %299

239:                                              ; preds = %200
  %240 = load i32, ptr %7, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %241)
          to label %243 unwind label %72

243:                                              ; preds = %239
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 1 dereferenceable(1) %242)
          to label %244 unwind label %72

244:                                              ; preds = %243
  br label %245

245:                                              ; preds = %244, %183
  br label %246

246:                                              ; preds = %245, %165
  br label %247

247:                                              ; preds = %246, %156
  br label %248

248:                                              ; preds = %247, %93
  br label %249

249:                                              ; preds = %248, %81
  br label %250

250:                                              ; preds = %249
  %251 = load i32, ptr %7, align 4, !tbaa !9
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !16

253:                                              ; preds = %26
  br label %254

254:                                              ; preds = %275, %253
  %255 = invoke noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %256 unwind label %72

256:                                              ; preds = %254
  %257 = xor i1 %255, true
  br i1 %257, label %258, label %295

258:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %259 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %260 unwind label %276

260:                                              ; preds = %258
  %261 = load i32, ptr %259, align 4, !tbaa !9
  store i32 %261, ptr %19, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %262 unwind label %276

262:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %263 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %264 unwind label %280

264:                                              ; preds = %262
  %265 = load i32, ptr %263, align 4, !tbaa !9
  store i32 %265, ptr %20, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %266 unwind label %280

266:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #5
  %267 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %268 unwind label %284

268:                                              ; preds = %266
  %269 = load i8, ptr %267, align 1, !tbaa !11
  store i8 %269, ptr %21, align 1, !tbaa !11
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %270 unwind label %284

270:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %271 = load i32, ptr %20, align 4, !tbaa !9
  %272 = load i32, ptr %19, align 4, !tbaa !9
  %273 = load i8, ptr %21, align 1, !tbaa !11
  %274 = call noundef i32 @_Z9calculateiic(i32 noundef %271, i32 noundef %272, i8 noundef signext %273)
  store i32 %274, ptr %22, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %275 unwind label %288

275:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %254, !llvm.loop !17

276:                                              ; preds = %260, %258
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %5, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %6, align 4
  br label %294

280:                                              ; preds = %264, %262
  %281 = landingpad { ptr, i32 }
          cleanup
  %282 = extractvalue { ptr, i32 } %281, 0
  store ptr %282, ptr %5, align 8
  %283 = extractvalue { ptr, i32 } %281, 1
  store i32 %283, ptr %6, align 4
  br label %293

284:                                              ; preds = %268, %266
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %5, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %6, align 4
  br label %292

288:                                              ; preds = %270
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %5, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %292

292:                                              ; preds = %288, %284
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  br label %293

293:                                              ; preds = %292, %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %294

294:                                              ; preds = %293, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %299

295:                                              ; preds = %256
  %296 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %297 unwind label %72

297:                                              ; preds = %295
  %298 = load i32, ptr %296, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  ret i32 %298

299:                                              ; preds = %294, %238, %154, %94, %76, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #5
  br label %300

300:                                              ; preds = %299, %68
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  br label %301

301:                                              ; preds = %300
  %302 = load ptr, ptr %5, align 8
  %303 = load i32, ptr %6, align 4
  %304 = insertvalue { ptr, i32 } poison, ptr %302, 0
  %305 = insertvalue { ptr, i32 } %304, i32 %303, 1
  resume { ptr, i32 } %305
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isdigit(i32 noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 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)) #1 align 2

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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}
!17 = distinct !{!17, !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<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::stack.3" = type { %"class.std::deque.4" }
%"class.std::deque.4" = type { %"class.std::_Deque_base.5" }
%"class.std::_Deque_base.5" = 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.6", %"struct.std::_Deque_iterator.6" }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }

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

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

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 nounwind uwtable
declare dso_local noundef i32 @_Z10precedencec(i8 noundef signext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9calculateiic(i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8evaluateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  %3 = alloca %"class.std::stack.3", align 8
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #4
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %9 unwind label %32

9:                                                ; preds = %1
  %10 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %11 = trunc i64 %10 to i32
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph51.preheader, label %.preheader

.lr.ph51.preheader:                               ; preds = %9
  %13 = and i64 %10, 2147483647
  br label %.lr.ph51

.preheader:                                       ; preds = %98, %9
  %14 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %14, label %._crit_edge, label %.lr.ph52

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %98
  %.03350 = phi i32 [ %99, %98 ], [ 0, %.lr.ph51.preheader ]
  %15 = sext i32 %.03350 to i64
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = sext i8 %17 to i32
  %isdigittmp = add nsw i32 %18, -48
  %isdigit = icmp ult i32 %isdigittmp, 10
  br i1 %isdigit, label %19, label %41

19:                                               ; preds = %.lr.ph51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !8
  %20 = icmp slt i32 %.03350, %11
  br i1 %20, label %.lr.ph47, label %.critedge

.lr.ph47:                                         ; preds = %19, %24
  %indvars.iv = phi i64 [ %indvars.iv.next, %24 ], [ %15, %19 ]
  %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 = sext i8 %22 to i32
  %isdigittmp37 = add nsw i32 %23, -48
  %isdigit38 = icmp ult i32 %isdigittmp37, 10
  br i1 %isdigit38, label %24, label %.critedge.loopexit.split.loop.exit54

24:                                               ; preds = %.lr.ph47
  %25 = load i32, ptr %4, align 4, !tbaa !8
  %26 = mul nsw i32 %25, 10
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %28 = load i8, ptr %27, align 1, !tbaa !5
  %29 = sext i8 %28 to i32
  %30 = add i32 %26, -48
  %31 = add i32 %30, %29
  store i32 %31, ptr %4, align 4, !tbaa !8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %13
  br i1 %exitcond.not, label %.critedge, label %.lr.ph47, !llvm.loop !10

32:                                               ; preds = %1
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %115

34:                                               ; preds = %.critedge4.invoke
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %114

36:                                               ; preds = %.critedge
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %114

.critedge.loopexit.split.loop.exit54:             ; preds = %.lr.ph47
  %38 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %24, %.critedge.loopexit.split.loop.exit54, %19
  %.134.lcssa = phi i32 [ %.03350, %19 ], [ %38, %.critedge.loopexit.split.loop.exit54 ], [ %11, %24 ]
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %39 unwind label %36

39:                                               ; preds = %.critedge
  %40 = add nsw i32 %.134.lcssa, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %98

41:                                               ; preds = %.lr.ph51
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  %43 = load i8, ptr %42, align 1, !tbaa !5
  %44 = icmp eq i8 %43, 40
  br i1 %44, label %45, label %49

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #4
  store i8 40, ptr %5, align 1, !tbaa !5
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushEOc(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %46 unwind label %47

46:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #4
  br label %98

47:                                               ; preds = %45
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #4
  br label %114

49:                                               ; preds = %41
  %50 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  %51 = load i8, ptr %50, align 1, !tbaa !5
  %52 = icmp eq i8 %51, 41
  %53 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %52, label %.preheader41, label %68

.preheader41:                                     ; preds = %49
  br i1 %53, label %.critedge2, label %.lr.ph44

.lr.ph44:                                         ; preds = %.preheader41, %64
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %.not36 = icmp eq i8 %55, 40
  br i1 %.not36, label %.critedge2, label %56

56:                                               ; preds = %.lr.ph44
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %58 = load i32, ptr %57, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %60 = load i32, ptr %59, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %62 = load i8, ptr %61, align 1, !tbaa !5
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %63 = call noundef i32 @_Z9calculateiic(i32 noundef %60, i32 noundef %58, i8 noundef signext %62)
  store i32 %63, ptr %6, align 4, !tbaa !8
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %64 unwind label %66

64:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %65 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %65, label %.critedge2, label %.lr.ph44, !llvm.loop !12

66:                                               ; preds = %56
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %114

.critedge2:                                       ; preds = %.lr.ph44, %64, %.preheader41
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br label %98

68:                                               ; preds = %49
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  br i1 %53, label %.critedge4.invoke, label %70

70:                                               ; preds = %68
  %71 = load i8, ptr %69, align 1, !tbaa !5
  %72 = call noundef i32 @_Z10precedencec(i8 noundef signext %71)
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %74 = load i8, ptr %73, align 1, !tbaa !5
  %75 = call noundef i32 @_Z10precedencec(i8 noundef signext %74)
  %76 = icmp sgt i32 %72, %75
  br i1 %76, label %.critedge4.invoke.sink.split, label %.preheader42

.preheader42:                                     ; preds = %70
  %77 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %77, label %.critedge4.invoke.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader42, %92
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  %79 = load i8, ptr %78, align 1, !tbaa !5
  %80 = call noundef i32 @_Z10precedencec(i8 noundef signext %79)
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = call noundef i32 @_Z10precedencec(i8 noundef signext %82)
  %.not = icmp sgt i32 %80, %83
  br i1 %.not, label %.critedge4.invoke.sink.split, label %84

84:                                               ; preds = %.lr.ph
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %86 = load i32, ptr %85, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %88 = load i32, ptr %87, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %89 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %90 = load i8, ptr %89, align 1, !tbaa !5
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %91 = call noundef i32 @_Z9calculateiic(i32 noundef %88, i32 noundef %86, i8 noundef signext %90)
  store i32 %91, ptr %7, align 4, !tbaa !8
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %92 unwind label %94

92:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %93 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %93, label %.critedge4.invoke.sink.split, label %.lr.ph, !llvm.loop !13

94:                                               ; preds = %84
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %114

.critedge4.invoke.sink.split:                     ; preds = %92, %.lr.ph, %.preheader42, %70
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15)
  br label %.critedge4.invoke

.critedge4.invoke:                                ; preds = %.critedge4.invoke.sink.split, %68
  %97 = phi ptr [ %69, %68 ], [ %96, %.critedge4.invoke.sink.split ]
  invoke void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushERKc(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 1 dereferenceable(1) %97)
          to label %98 unwind label %34

98:                                               ; preds = %.critedge4.invoke, %39, %.critedge2, %46
  %.2 = phi i32 [ %40, %39 ], [ %.03350, %46 ], [ %.03350, %.critedge2 ], [ %.03350, %.critedge4.invoke ]
  %99 = add nsw i32 %.2, 1
  %100 = icmp slt i32 %99, %11
  br i1 %100, label %.lr.ph51, label %.preheader, !llvm.loop !14

.lr.ph52:                                         ; preds = %.preheader, %108
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %102 = load i32, ptr %101, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %104 = load i32, ptr %103, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5stackIcSt5dequeIcSaIcEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %106 = load i8, ptr %105, align 1, !tbaa !5
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %107 = call noundef i32 @_Z9calculateiic(i32 noundef %104, i32 noundef %102, i8 noundef signext %106)
  store i32 %107, ptr %8, align 4, !tbaa !8
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %108 unwind label %110

108:                                              ; preds = %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %109 = call noundef zeroext i1 @_ZNKSt5stackIcSt5dequeIcSaIcEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %109, label %._crit_edge, label %.lr.ph52, !llvm.loop !15

110:                                              ; preds = %.lr.ph52
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %114

._crit_edge:                                      ; preds = %108, %.preheader
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %113 = load i32, ptr %112, align 4, !tbaa !8
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  ret i32 %113

114:                                              ; preds = %110, %94, %66, %47, %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %48, %47 ], [ %67, %66 ], [ %35, %34 ], [ %95, %94 ], [ %111, %110 ]
  call void @_ZNSt5stackIcSt5dequeIcSaIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #4
  br label %115

115:                                              ; preds = %114, %32
  %.pn.pn = phi { ptr, i32 } [ %.pn, %114 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIcSt5dequeIcSaIcEEE4pushEOc(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 1 dereferenceable(1)) 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 #1 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 #1 align 2

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

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

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

; 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 #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


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