; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x18-总结与练习/153. 双栈排序 (main)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }

@n = external dso_local global i32, align 4
@a = external dso_local global [1010 x i32], align 16
@f = external dso_local global [1010 x i32], align 16
@color = external dso_local global [1010 x i32], align 16
@g = external dso_local global [1010 x [1010 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::stack", align 8
  %10 = alloca %"class.std::stack", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %29

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %23
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %20
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %34
  store i32 %31, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %36 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %36, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %54, %29
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp sge i32 %38, 1
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %57

41:                                               ; preds = %37
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %44
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %47
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %45, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %52
  store i32 %50, ptr %53, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %41
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !11

57:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %110, %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %113

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %6, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %106, %63
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %109

71:                                               ; preds = %66
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp slt i32 %75, %79
  br i1 %80, label %81, label %105

81:                                               ; preds = %71
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp slt i32 %86, %90
  br i1 %91, label %92, label %105

92:                                               ; preds = %81
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1010 x [1010 x i8]], ptr @g, i64 0, i64 %94
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1010 x i8], ptr %95, i64 0, i64 %97
  store i8 1, ptr %98, align 1, !tbaa !12
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1010 x [1010 x i8]], ptr @g, i64 0, i64 %100
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1010 x i8], ptr %101, i64 0, i64 %103
  store i8 1, ptr %104, align 1, !tbaa !12
  br label %105

105:                                              ; preds = %92, %81, %71
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %6, align 4, !tbaa !5
  br label %66, !llvm.loop !14

109:                                              ; preds = %70
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %4, align 4, !tbaa !5
  br label %58, !llvm.loop !15

113:                                              ; preds = %62
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  store i8 1, ptr %7, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %130, %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 14, ptr %5, align 4
  br label %133

119:                                              ; preds = %114
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1010 x i32], ptr @color, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %129

125:                                              ; preds = %119
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = call noundef zeroext i1 @_Z3dfsii(i32 noundef %126, i32 noundef 1)
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  store i8 0, ptr %7, align 1, !tbaa !12
  store i32 14, ptr %5, align 4
  br label %133

129:                                              ; preds = %125, %119
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %8, align 4, !tbaa !5
  br label %114, !llvm.loop !16

133:                                              ; preds = %128, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %134

134:                                              ; preds = %133
  %135 = load i8, ptr %7, align 1, !tbaa !12, !range !17, !noundef !18
  %136 = trunc i8 %135 to i1
  br i1 %136, label %140, label %137

137:                                              ; preds = %134
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %281

140:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #7
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %141 unwind label %147

141:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %232, %141
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = load i32, ptr @n, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %151, label %146

146:                                              ; preds = %142
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %235

147:                                              ; preds = %140
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %11, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %12, align 4
  br label %280

151:                                              ; preds = %142
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1010 x i32], ptr @color, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = icmp eq i32 %155, 1
  br i1 %156, label %157, label %187

157:                                              ; preds = %151
  br label %158

158:                                              ; preds = %173, %157
  %159 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %160 unwind label %176

160:                                              ; preds = %158
  %161 = icmp ne i64 %159, 0
  br i1 %161, label %162, label %168

162:                                              ; preds = %160
  %163 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %164 unwind label %176

164:                                              ; preds = %162
  %165 = load i32, ptr %163, align 4, !tbaa !5
  %166 = load i32, ptr %13, align 4, !tbaa !5
  %167 = icmp eq i32 %165, %166
  br label %168

168:                                              ; preds = %164, %160
  %169 = phi i1 [ false, %160 ], [ %167, %164 ]
  br i1 %169, label %170, label %180

170:                                              ; preds = %168
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %171 unwind label %176

171:                                              ; preds = %170
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %173 unwind label %176

173:                                              ; preds = %171
  %174 = load i32, ptr %13, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %13, align 4, !tbaa !5
  br label %158, !llvm.loop !19

176:                                              ; preds = %228, %224, %216, %215, %209, %205, %200, %199, %193, %189, %184, %180, %171, %170, %162, %158
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %11, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %279

180:                                              ; preds = %168
  %181 = load i32, ptr %14, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %182
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %183)
          to label %184 unwind label %176

184:                                              ; preds = %180
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %186 unwind label %176

186:                                              ; preds = %184
  br label %231

187:                                              ; preds = %151
  br label %188

188:                                              ; preds = %223, %187
  br label %189

189:                                              ; preds = %188
  %190 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %191 unwind label %176

191:                                              ; preds = %189
  %192 = icmp ne i64 %190, 0
  br i1 %192, label %193, label %205

193:                                              ; preds = %191
  %194 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %195 unwind label %176

195:                                              ; preds = %193
  %196 = load i32, ptr %194, align 4, !tbaa !5
  %197 = load i32, ptr %13, align 4, !tbaa !5
  %198 = icmp eq i32 %196, %197
  br i1 %198, label %199, label %205

199:                                              ; preds = %195
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %200 unwind label %176

200:                                              ; preds = %199
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %202 unwind label %176

202:                                              ; preds = %200
  %203 = load i32, ptr %13, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %13, align 4, !tbaa !5
  br label %223

205:                                              ; preds = %195, %191
  %206 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %207 unwind label %176

207:                                              ; preds = %205
  %208 = icmp ne i64 %206, 0
  br i1 %208, label %209, label %221

209:                                              ; preds = %207
  %210 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %211 unwind label %176

211:                                              ; preds = %209
  %212 = load i32, ptr %210, align 4, !tbaa !5
  %213 = load i32, ptr %13, align 4, !tbaa !5
  %214 = icmp eq i32 %212, %213
  br i1 %214, label %215, label %221

215:                                              ; preds = %211
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %216 unwind label %176

216:                                              ; preds = %215
  %217 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %218 unwind label %176

218:                                              ; preds = %216
  %219 = load i32, ptr %13, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %13, align 4, !tbaa !5
  br label %222

221:                                              ; preds = %211, %207
  br label %224

222:                                              ; preds = %218
  br label %223

223:                                              ; preds = %222, %202
  br label %188, !llvm.loop !20

224:                                              ; preds = %221
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %226
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 4 dereferenceable(4) %227)
          to label %228 unwind label %176

228:                                              ; preds = %224
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %230 unwind label %176

230:                                              ; preds = %228
  br label %231

231:                                              ; preds = %230, %186
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %14, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %14, align 4, !tbaa !5
  br label %142, !llvm.loop !21

235:                                              ; preds = %146
  br label %236

236:                                              ; preds = %275, %235
  br label %237

237:                                              ; preds = %236
  %238 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %239 unwind label %253

239:                                              ; preds = %237
  %240 = icmp ne i64 %238, 0
  br i1 %240, label %241, label %257

241:                                              ; preds = %239
  %242 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %243 unwind label %253

243:                                              ; preds = %241
  %244 = load i32, ptr %242, align 4, !tbaa !5
  %245 = load i32, ptr %13, align 4, !tbaa !5
  %246 = icmp eq i32 %244, %245
  br i1 %246, label %247, label %257

247:                                              ; preds = %243
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %248 unwind label %253

248:                                              ; preds = %247
  %249 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %250 unwind label %253

250:                                              ; preds = %248
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %13, align 4, !tbaa !5
  br label %275

253:                                              ; preds = %276, %268, %267, %261, %257, %248, %247, %241, %237
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %11, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %12, align 4
  br label %279

257:                                              ; preds = %243, %239
  %258 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %259 unwind label %253

259:                                              ; preds = %257
  %260 = icmp ne i64 %258, 0
  br i1 %260, label %261, label %273

261:                                              ; preds = %259
  %262 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %263 unwind label %253

263:                                              ; preds = %261
  %264 = load i32, ptr %262, align 4, !tbaa !5
  %265 = load i32, ptr %13, align 4, !tbaa !5
  %266 = icmp eq i32 %264, %265
  br i1 %266, label %267, label %273

267:                                              ; preds = %263
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %268 unwind label %253

268:                                              ; preds = %267
  %269 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %270 unwind label %253

270:                                              ; preds = %268
  %271 = load i32, ptr %13, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %13, align 4, !tbaa !5
  br label %274

273:                                              ; preds = %263, %259
  br label %276

274:                                              ; preds = %270
  br label %275

275:                                              ; preds = %274, %250
  br label %236, !llvm.loop !22

276:                                              ; preds = %273
  %277 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %278 unwind label %253

278:                                              ; preds = %276
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #7
  br label %281

279:                                              ; preds = %253, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #7
  br label %280

280:                                              ; preds = %279, %147
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %283

281:                                              ; preds = %278, %137
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  %282 = load i32, ptr %1, align 4
  ret i32 %282

283:                                              ; preds = %280
  %284 = load ptr, ptr %11, align 8
  %285 = load i32, ptr %12, align 4
  %286 = insertvalue { ptr, i32 } poison, ptr %284, 0
  %287 = insertvalue { ptr, i32 } %286, i32 %285, 1
  resume { ptr, i32 } %287
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #0 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { "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 = { inlinehint 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 #6 = { 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 #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }

@n = external dso_local global i32, align 4
@a = external dso_local global [1010 x i32], align 16
@f = external dso_local global [1010 x i32], align 16
@color = external dso_local local_unnamed_addr global [1010 x i32], align 16
@g = external dso_local local_unnamed_addr global [1010 x [1010 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::stack", align 8
  %2 = alloca %"class.std::stack", align 8
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not89 = icmp slt i32 %4, 1
  br i1 %.not89, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  %5 = add nsw i32 %4, 1
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %6
  store i32 %5, ptr %7, align 4, !tbaa !5
  br label %.critedge69

._crit_edge:                                      ; preds = %.lr.ph
  %8 = add nsw i32 %15, 1
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %9
  store i32 %8, ptr %10, align 4, !tbaa !5
  %11 = icmp sgt i32 %15, 0
  br i1 %11, label %.lr.ph93.preheader, label %.critedge69

.lr.ph93.preheader:                               ; preds = %._crit_edge
  %12 = zext nneg i32 %15 to i64
  br label %.lr.ph93

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %13 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader83:                                     ; preds = %.lr.ph93
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %.not5798 = icmp slt i32 %.pre, 1
  br i1 %.not5798, label %.critedge69, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %.preheader83
  %17 = add nuw i32 %.pre, 1
  %18 = zext nneg i32 %.pre to i64
  %wide.trip.count = zext i32 %17 to i64
  br label %.lr.ph100

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %.lr.ph93
  %indvars.iv118 = phi i64 [ %12, %.lr.ph93.preheader ], [ %indvars.iv.next119, %.lr.ph93 ]
  %19 = add nuw nsw i64 %indvars.iv118, 1
  %20 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %19
  %21 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv118
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %indvars.iv118
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next119 = add nsw i64 %indvars.iv118, -1
  %25 = icmp ugt i64 %indvars.iv118, 1
  br i1 %25, label %.lr.ph93, label %.preheader83, !llvm.loop !11

.loopexit82:                                      ; preds = %._crit_edge138, %.lr.ph100
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count
  br i1 %exitcond129.not, label %.preheader81, label %.lr.ph100, !llvm.loop !12

.preheader81:                                     ; preds = %.loopexit82
  br i1 %.not5798, label %.critedge69, label %.lr.ph103

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %.loopexit82
  %indvars.iv126 = phi i64 [ 1, %.lr.ph100.preheader ], [ %indvars.iv.next127, %.loopexit82 ]
  %indvars.iv121 = phi i64 [ 2, %.lr.ph100.preheader ], [ %indvars.iv.next122, %.loopexit82 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %.not6794.not = icmp ult i64 %indvars.iv126, %18
  br i1 %.not6794.not, label %.lr.ph97, label %.loopexit82

.lr.ph97:                                         ; preds = %.lr.ph100
  %26 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv126
  %27 = load i32, ptr %26, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %.lr.ph97, %._crit_edge138
  %indvars.iv123 = phi i64 [ %indvars.iv121, %.lr.ph97 ], [ %32, %._crit_edge138 ]
  %29 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv123
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp slt i32 %27, %30
  %32 = add nuw nsw i64 %indvars.iv123, 1
  br i1 %31, label %33, label %._crit_edge138

33:                                               ; preds = %28
  %34 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %32
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp slt i32 %35, %27
  br i1 %36, label %37, label %._crit_edge138

37:                                               ; preds = %33
  %38 = getelementptr inbounds [1010 x [1010 x i8]], ptr @g, i64 0, i64 %indvars.iv123, i64 %indvars.iv126
  store i8 1, ptr %38, align 1, !tbaa !13
  %39 = getelementptr inbounds [1010 x [1010 x i8]], ptr @g, i64 0, i64 %indvars.iv126, i64 %indvars.iv123
  store i8 1, ptr %39, align 1, !tbaa !13
  br label %._crit_edge138

._crit_edge138:                                   ; preds = %28, %33, %37
  %lftr.wideiv = trunc i64 %32 to i32
  %exitcond.not = icmp eq i32 %17, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit82, label %28, !llvm.loop !15

.lr.ph103:                                        ; preds = %.preheader81, %47
  %40 = phi i32 [ %48, %47 ], [ %.pre, %.preheader81 ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %47 ], [ 1, %.preheader81 ]
  %41 = getelementptr inbounds [1010 x i32], ptr @color, i64 0, i64 %indvars.iv130
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %.lr.ph103
  %45 = trunc nuw nsw i64 %indvars.iv130 to i32
  %46 = tail call noundef zeroext i1 @_Z3dfsii(i32 noundef %45, i32 noundef 1)
  br i1 %46, label %._crit_edge136, label %50

._crit_edge136:                                   ; preds = %44
  %.pre137 = load i32, ptr @n, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %._crit_edge136, %.lr.ph103
  %48 = phi i32 [ %.pre137, %._crit_edge136 ], [ %40, %.lr.ph103 ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %49 = sext i32 %48 to i64
  %.not58.not = icmp slt i64 %indvars.iv130, %49
  br i1 %.not58.not, label %.lr.ph103, label %.critedge69, !llvm.loop !16

50:                                               ; preds = %44
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %110

.critedge69:                                      ; preds = %47, %.preheader83, %._crit_edge.thread, %._crit_edge, %.preheader81
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #7
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %.preheader80 unwind label %54

.preheader80:                                     ; preds = %.critedge69
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %.not59110 = icmp slt i32 %53, 1
  br i1 %.not59110, label %.preheader.preheader, label %.lr.ph113

54:                                               ; preds = %.critedge69
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %109

.lr.ph113:                                        ; preds = %.preheader80, %89
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %89 ], [ 1, %.preheader80 ]
  %.043111 = phi i32 [ %.4, %89 ], [ 1, %.preheader80 ]
  %56 = getelementptr inbounds [1010 x i32], ptr @color, i64 0, i64 %indvars.iv133
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %.preheader70, label %.preheader76

.preheader70:                                     ; preds = %.lr.ph113
  %59 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not64104 = icmp eq i64 %59, 0
  br i1 %.not64104, label %.critedge, label %.lr.ph106

.lr.ph106:                                        ; preds = %.preheader70, %65
  %.1105 = phi i32 [ %66, %65 ], [ %.043111, %.preheader70 ]
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, %.1105
  br i1 %62, label %63, label %.critedge

63:                                               ; preds = %.lr.ph106
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %65 unwind label %.loopexit71

65:                                               ; preds = %63
  %66 = add nsw i32 %.1105, 1
  %67 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not64 = icmp eq i64 %67, 0
  br i1 %.not64, label %.critedge, label %.lr.ph106, !llvm.loop !17

.loopexit71:                                      ; preds = %63
  %lpad.loopexit73 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp72

.loopexit.split-lp72.loopexit:                    ; preds = %.invoke
  %lpad.loopexit77 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp72

.loopexit.split-lp72.loopexit.split-lp:           ; preds = %87, %85, %69, %.critedge
  %lpad.loopexit.split-lp78 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp72

.critedge:                                        ; preds = %.lr.ph106, %65, %.preheader70
  %.1.lcssa = phi i32 [ %.043111, %.preheader70 ], [ %66, %65 ], [ %.1105, %.lr.ph106 ]
  %68 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv133
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %68)
          to label %69 unwind label %.loopexit.split-lp72.loopexit.split-lp

69:                                               ; preds = %.critedge
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %89 unwind label %.loopexit.split-lp72.loopexit.split-lp

.preheader76:                                     ; preds = %.lr.ph113, %84
  %.2 = phi i32 [ %.3, %84 ], [ %.043111, %.lr.ph113 ]
  %71 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not62 = icmp eq i64 %71, 0
  br i1 %.not62, label %76, label %72

72:                                               ; preds = %.preheader76
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp eq i32 %74, %.2
  br i1 %75, label %.invoke, label %76

76:                                               ; preds = %72, %.preheader76
  %77 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not63 = icmp eq i64 %77, 0
  br i1 %.not63, label %85, label %78

78:                                               ; preds = %76
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp eq i32 %80, %.2
  br i1 %81, label %.invoke, label %85

.invoke:                                          ; preds = %78, %72
  %.sink = phi ptr [ %1, %72 ], [ %2, %78 ]
  %82 = phi ptr [ @.str, %72 ], [ @.str.2, %78 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.sink)
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %82)
          to label %84 unwind label %.loopexit.split-lp72.loopexit

84:                                               ; preds = %.invoke
  %.3 = add nsw i32 %.2, 1
  br label %.preheader76, !llvm.loop !18

85:                                               ; preds = %76, %78
  %86 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv133
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %86)
          to label %87 unwind label %.loopexit.split-lp72.loopexit.split-lp

87:                                               ; preds = %85
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
          to label %89 unwind label %.loopexit.split-lp72.loopexit.split-lp

89:                                               ; preds = %69, %87
  %.4 = phi i32 [ %.1.lcssa, %69 ], [ %.2, %87 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %.not59.not = icmp slt i64 %indvars.iv133, %91
  br i1 %.not59.not, label %.lr.ph113, label %.preheader.preheader, !llvm.loop !19

.preheader.preheader:                             ; preds = %89, %.preheader80
  %.5.ph = phi i32 [ 1, %.preheader80 ], [ %.4, %89 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %105
  %.5 = phi i32 [ %.6, %105 ], [ %.5.ph, %.preheader.preheader ]
  %92 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not60 = icmp eq i64 %92, 0
  br i1 %.not60, label %99, label %93

93:                                               ; preds = %.preheader
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp eq i32 %95, %.5
  br i1 %96, label %.invoke145, label %99

.invoke145:                                       ; preds = %93, %101
  %.sink146 = phi ptr [ %2, %101 ], [ %1, %93 ]
  %97 = phi ptr [ @.str.2, %101 ], [ @.str, %93 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.sink146)
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %97)
          to label %105 unwind label %.loopexit

.loopexit:                                        ; preds = %.invoke145
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp72

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

99:                                               ; preds = %93, %.preheader
  %100 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not61 = icmp eq i64 %100, 0
  br i1 %.not61, label %106, label %101

101:                                              ; preds = %99
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp eq i32 %103, %.5
  br i1 %104, label %.invoke145, label %106

105:                                              ; preds = %.invoke145
  %.6 = add nsw i32 %.5, 1
  br label %.preheader, !llvm.loop !20

106:                                              ; preds = %99, %101
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %108 unwind label %.loopexit.split-lp

108:                                              ; preds = %106
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  br label %110

.loopexit.split-lp72:                             ; preds = %.loopexit, %.loopexit.split-lp, %.loopexit71, %.loopexit.split-lp72.loopexit.split-lp, %.loopexit.split-lp72.loopexit
  %.pn = phi { ptr, i32 } [ %lpad.loopexit73, %.loopexit71 ], [ %lpad.loopexit77, %.loopexit.split-lp72.loopexit ], [ %lpad.loopexit.split-lp78, %.loopexit.split-lp72.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #7
  br label %109

109:                                              ; preds = %.loopexit.split-lp72, %54
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.loopexit.split-lp72 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn

110:                                              ; preds = %108, %50
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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


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