; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1344B)

; 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::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3buf = external hidden global [1001 x [1001 x i8]], align 16
@.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 [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::function", align 8
  %21 = alloca %class.anon, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %240, %0
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %248

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 1, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %101, %32
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %104

39:                                               ; preds = %34
  %40 = load i32, ptr %10, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %41
  %43 = getelementptr inbounds [1001 x i8], ptr %42, i64 0, i64 0
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 -1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %73, %39
  %46 = load i32, ptr %14, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %76

50:                                               ; preds = %45
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %52
  %54 = load i32, ptr %14, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1001 x i8], ptr %53, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !11
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %58, 35
  br i1 %59, label %60, label %72

60:                                               ; preds = %50
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %13, align 4, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %60
  %66 = load i32, ptr %14, align 4, !tbaa !5
  br label %69

67:                                               ; preds = %60
  %68 = load i32, ptr %11, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %67, %65
  %70 = phi i32 [ %66, %65 ], [ %68, %67 ]
  store i32 %70, ptr %11, align 4, !tbaa !5
  %71 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %71, ptr %12, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %69, %50
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %14, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %14, align 4, !tbaa !5
  br label %45, !llvm.loop !12

76:                                               ; preds = %49
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  %79 = xor i1 %78, true
  %80 = zext i1 %79 to i32
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = add nsw i32 %81, %80
  store i32 %82, ptr %8, align 4, !tbaa !5
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %92

85:                                               ; preds = %76
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  %89 = add nsw i32 %88, 1
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = icmp eq i32 %89, %90
  br label %92

92:                                               ; preds = %85, %76
  %93 = phi i1 [ true, %76 ], [ %91, %85 ]
  %94 = zext i1 %93 to i32
  %95 = load i8, ptr %7, align 1, !tbaa !9, !range !14, !noundef !15
  %96 = trunc i8 %95 to i1
  %97 = zext i1 %96 to i32
  %98 = and i32 %97, %94
  %99 = icmp ne i32 %98, 0
  %100 = zext i1 %99 to i8
  store i8 %100, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, 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 %101

101:                                              ; preds = %92
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %34, !llvm.loop !16

104:                                              ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %172, %104
  %106 = load i8, ptr %7, align 1, !tbaa !9, !range !14, !noundef !15
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %112

108:                                              ; preds = %105
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br label %112

112:                                              ; preds = %108, %105
  %113 = phi i1 [ false, %105 ], [ %111, %108 ]
  br i1 %113, label %115, label %114

114:                                              ; preds = %112
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %175

115:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 -1, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 -1, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %144, %115
  %117 = load i32, ptr %19, align 4, !tbaa !5
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %147

121:                                              ; preds = %116
  %122 = load i32, ptr %19, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %123
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1001 x i8], ptr %124, i64 0, i64 %126
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = sext i8 %128 to i32
  %130 = icmp eq i32 %129, 35
  br i1 %130, label %131, label %143

131:                                              ; preds = %121
  %132 = load i32, ptr %18, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %18, align 4, !tbaa !5
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = icmp slt i32 %134, 0
  br i1 %135, label %136, label %138

136:                                              ; preds = %131
  %137 = load i32, ptr %19, align 4, !tbaa !5
  br label %140

138:                                              ; preds = %131
  %139 = load i32, ptr %16, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %138, %136
  %141 = phi i32 [ %137, %136 ], [ %139, %138 ]
  store i32 %141, ptr %16, align 4, !tbaa !5
  %142 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %142, ptr %17, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %140, %121
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %19, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %19, align 4, !tbaa !5
  br label %116, !llvm.loop !17

147:                                              ; preds = %120
  %148 = load i32, ptr %18, align 4, !tbaa !5
  %149 = icmp ne i32 %148, 0
  %150 = xor i1 %149, true
  %151 = zext i1 %150 to i32
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = add nsw i32 %152, %151
  store i32 %153, ptr %9, align 4, !tbaa !5
  %154 = load i32, ptr %18, align 4, !tbaa !5
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %163

156:                                              ; preds = %147
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = sub nsw i32 %157, %158
  %160 = add nsw i32 %159, 1
  %161 = load i32, ptr %18, align 4, !tbaa !5
  %162 = icmp eq i32 %160, %161
  br label %163

163:                                              ; preds = %156, %147
  %164 = phi i1 [ true, %147 ], [ %162, %156 ]
  %165 = zext i1 %164 to i32
  %166 = load i8, ptr %7, align 1, !tbaa !9, !range !14, !noundef !15
  %167 = trunc i8 %166 to i1
  %168 = zext i1 %167 to i32
  %169 = and i32 %168, %165
  %170 = icmp ne i32 %169, 0
  %171 = zext i1 %170 to i8
  store i8 %171, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %172

172:                                              ; preds = %163
  %173 = load i32, ptr %15, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %15, align 4, !tbaa !5
  br label %105, !llvm.loop !18

175:                                              ; preds = %114
  %176 = load i8, ptr %7, align 1, !tbaa !9, !range !14, !noundef !15
  %177 = trunc i8 %176 to i1
  br i1 %177, label %178, label %188

178:                                              ; preds = %175
  %179 = load i32, ptr %8, align 4, !tbaa !5
  %180 = icmp ne i32 %179, 0
  %181 = xor i1 %180, true
  %182 = zext i1 %181 to i32
  %183 = load i32, ptr %9, align 4, !tbaa !5
  %184 = icmp ne i32 %183, 0
  %185 = xor i1 %184, true
  %186 = zext i1 %185 to i32
  %187 = icmp ne i32 %182, %186
  br i1 %187, label %188, label %190

188:                                              ; preds = %178, %175
  %189 = call i32 @puts(ptr noundef @.str.2)
  store i32 4, ptr %4, align 4
  br label %237

190:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  %191 = getelementptr inbounds %class.anon, ptr %21, i32 0, i32 0
  store ptr %5, ptr %191, align 8, !tbaa !19
  %192 = getelementptr inbounds %class.anon, ptr %21, i32 0, i32 1
  store ptr %6, ptr %192, align 8, !tbaa !19
  %193 = getelementptr inbounds %class.anon, ptr %21, i32 0, i32 2
  store ptr %20, ptr %193, align 8, !tbaa !19
  call void @"_ZNSt8functionIFviiEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %230, %190
  %195 = load i32, ptr %23, align 4, !tbaa !5
  %196 = load i32, ptr %5, align 4, !tbaa !5
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %199, label %198

198:                                              ; preds = %194
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %233

199:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %226, %199
  %201 = load i32, ptr %24, align 4, !tbaa !5
  %202 = load i32, ptr %6, align 4, !tbaa !5
  %203 = icmp slt i32 %201, %202
  br i1 %203, label %205, label %204

204:                                              ; preds = %200
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %229

205:                                              ; preds = %200
  %206 = load i32, ptr %23, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %207
  %209 = load i32, ptr %24, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [1001 x i8], ptr %208, i64 0, i64 %210
  %212 = load i8, ptr %211, align 1, !tbaa !11
  %213 = sext i8 %212 to i32
  %214 = icmp eq i32 %213, 35
  br i1 %214, label %215, label %225

215:                                              ; preds = %205
  %216 = load i32, ptr %22, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %22, align 4, !tbaa !5
  %218 = load i32, ptr %23, align 4, !tbaa !5
  %219 = load i32, ptr %24, align 4, !tbaa !5
  invoke void @_ZNKSt8functionIFviiEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %20, i32 noundef %218, i32 noundef %219)
          to label %220 unwind label %221

220:                                              ; preds = %215
  br label %225

221:                                              ; preds = %215
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %25, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %247

225:                                              ; preds = %220, %205
  br label %226

226:                                              ; preds = %225
  %227 = load i32, ptr %24, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %24, align 4, !tbaa !5
  br label %200, !llvm.loop !21

229:                                              ; preds = %204
  br label %230

230:                                              ; preds = %229
  %231 = load i32, ptr %23, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %23, align 4, !tbaa !5
  br label %194, !llvm.loop !22

233:                                              ; preds = %198
  %234 = load i32, ptr %22, align 4, !tbaa !5
  %235 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %234)
          to label %236 unwind label %243

236:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  store i32 0, ptr %4, align 4
  br label %237

237:                                              ; preds = %236, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %238 = load i32, ptr %4, align 4
  switch i32 %238, label %255 [
    i32 0, label %239
    i32 4, label %240
  ]

239:                                              ; preds = %237
  br label %240

240:                                              ; preds = %239, %237
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !23

243:                                              ; preds = %233
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %25, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %26, align 4
  br label %247

247:                                              ; preds = %243, %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %250

248:                                              ; preds = %31
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %249 = load i32, ptr %1, align 4
  ret i32 %249

250:                                              ; preds = %247
  %251 = load ptr, ptr %25, align 8
  %252 = load i32, ptr %26, align 4
  %253 = insertvalue { ptr, i32 } poison, ptr %251, 0
  %254 = insertvalue { ptr, i32 } %253, i32 %252, 1
  resume { ptr, i32 } %254

255:                                              ; preds = %237
  unreachable
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFviiEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFviiEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

declare i32 @printf(ptr noundef, ...) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 }

!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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !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::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3buf = external hidden global [1001 x [1001 x i8]], align 16
@.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 [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
.critedge:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::function", align 8
  %3 = alloca %class.anon, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %5 = load i32, ptr %0, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph97, label %.critedge..preheader84_crit_edge

.critedge..preheader84_crit_edge:                 ; preds = %.critedge
  %.pre = load i32, ptr %1, align 4
  br label %.preheader84

.preheader84.loopexit:                            ; preds = %._crit_edge
  %7 = icmp eq i32 %56, 0
  br label %.preheader84

.preheader84:                                     ; preds = %.critedge..preheader84_crit_edge, %.preheader84.loopexit
  %8 = phi i32 [ %.pre, %.critedge..preheader84_crit_edge ], [ %44, %.preheader84.loopexit ]
  %.077.lcssa = phi i1 [ true, %.critedge..preheader84_crit_edge ], [ %60, %.preheader84.loopexit ]
  %.076.lcssa = phi i1 [ true, %.critedge..preheader84_crit_edge ], [ %7, %.preheader84.loopexit ]
  %.lcssa87 = phi i32 [ %5, %.critedge..preheader84_crit_edge ], [ %61, %.preheader84.loopexit ]
  %9 = icmp sgt i32 %8, 0
  %10 = select i1 %.077.lcssa, i1 %9, i1 false
  br i1 %10, label %.preheader83.lr.ph, label %._crit_edge112

.preheader83.lr.ph:                               ; preds = %.preheader84
  %11 = icmp sgt i32 %.lcssa87, 0
  br i1 %11, label %.preheader83.us.preheader, label %._crit_edge112.thread

._crit_edge112.thread:                            ; preds = %.preheader83.lr.ph
  br i1 %.076.lcssa, label %79, label %81

.preheader83.us.preheader:                        ; preds = %.preheader83.lr.ph
  %12 = zext nneg i32 %8 to i64
  %wide.trip.count140 = zext nneg i32 %.lcssa87 to i64
  %xtraiter183 = and i64 %wide.trip.count140, 1
  %13 = icmp eq i32 %.lcssa87, 1
  %unroll_iter188 = and i64 %wide.trip.count140, 2147483646
  %lcmp.mod184.not = icmp eq i64 %xtraiter183, 0
  br label %.preheader83.us

.preheader83.us:                                  ; preds = %.preheader83.us.preheader, %._crit_edge106.us
  %indvars.iv142 = phi i64 [ 0, %.preheader83.us.preheader ], [ %indvars.iv.next143, %._crit_edge106.us ]
  %.075110.us = phi i32 [ 0, %.preheader83.us.preheader ], [ %36, %._crit_edge106.us ]
  br i1 %13, label %._crit_edge106.us.unr-lcssa, label %.preheader83.us.new

.preheader83.us.new:                              ; preds = %.preheader83.us, %.preheader83.us.new
  %indvars.iv137 = phi i64 [ %indvars.iv.next138.1, %.preheader83.us.new ], [ 0, %.preheader83.us ]
  %.060103.us = phi i32 [ %.161.us.1, %.preheader83.us.new ], [ 0, %.preheader83.us ]
  %.062102.us = phi i32 [ %.163.us.1, %.preheader83.us.new ], [ -1, %.preheader83.us ]
  %.064101.us = phi i32 [ %.165.us.1, %.preheader83.us.new ], [ -1, %.preheader83.us ]
  %niter189 = phi i64 [ %niter189.next.1, %.preheader83.us.new ], [ 0, %.preheader83.us ]
  %14 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv137, i64 %indvars.iv142
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = icmp eq i8 %15, 35
  %17 = icmp slt i32 %.064101.us, 0
  %18 = select i1 %16, i1 %17, i1 false
  %19 = trunc nuw nsw i64 %indvars.iv137 to i32
  %.165.us = select i1 %18, i32 %19, i32 %.064101.us
  %.163.us = select i1 %16, i32 %19, i32 %.062102.us
  %20 = zext i1 %16 to i32
  %.161.us = add nuw nsw i32 %.060103.us, %20
  %indvars.iv.next138 = or disjoint i64 %indvars.iv137, 1
  %21 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv.next138, i64 %indvars.iv142
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %23 = icmp eq i8 %22, 35
  %24 = icmp slt i32 %.165.us, 0
  %25 = select i1 %23, i1 %24, i1 false
  %26 = trunc nuw nsw i64 %indvars.iv.next138 to i32
  %.165.us.1 = select i1 %25, i32 %26, i32 %.165.us
  %.163.us.1 = select i1 %23, i32 %26, i32 %.163.us
  %27 = zext i1 %23 to i32
  %.161.us.1 = add nuw nsw i32 %.161.us, %27
  %indvars.iv.next138.1 = add nuw nsw i64 %indvars.iv137, 2
  %niter189.next.1 = add i64 %niter189, 2
  %niter189.ncmp.1 = icmp eq i64 %niter189.next.1, %unroll_iter188
  br i1 %niter189.ncmp.1, label %._crit_edge106.us.unr-lcssa, label %.preheader83.us.new, !llvm.loop !10

._crit_edge106.us.unr-lcssa:                      ; preds = %.preheader83.us.new, %.preheader83.us
  %.165.us.lcssa.ph = phi i32 [ poison, %.preheader83.us ], [ %.165.us.1, %.preheader83.us.new ]
  %.163.us.lcssa.ph = phi i32 [ poison, %.preheader83.us ], [ %.163.us.1, %.preheader83.us.new ]
  %.161.us.lcssa.ph = phi i32 [ poison, %.preheader83.us ], [ %.161.us.1, %.preheader83.us.new ]
  %indvars.iv137.unr = phi i64 [ 0, %.preheader83.us ], [ %indvars.iv.next138.1, %.preheader83.us.new ]
  %.060103.us.unr = phi i32 [ 0, %.preheader83.us ], [ %.161.us.1, %.preheader83.us.new ]
  %.062102.us.unr = phi i32 [ -1, %.preheader83.us ], [ %.163.us.1, %.preheader83.us.new ]
  %.064101.us.unr = phi i32 [ -1, %.preheader83.us ], [ %.165.us.1, %.preheader83.us.new ]
  br i1 %lcmp.mod184.not, label %._crit_edge106.us, label %._crit_edge106.us.epilog-lcssa

._crit_edge106.us.epilog-lcssa:                   ; preds = %._crit_edge106.us.unr-lcssa
  %28 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv137.unr, i64 %indvars.iv142
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = icmp eq i8 %29, 35
  %31 = icmp slt i32 %.064101.us.unr, 0
  %32 = select i1 %30, i1 %31, i1 false
  %33 = trunc nuw nsw i64 %indvars.iv137.unr to i32
  %.165.us.epil = select i1 %32, i32 %33, i32 %.064101.us.unr
  %.163.us.epil = select i1 %30, i32 %33, i32 %.062102.us.unr
  %34 = zext i1 %30 to i32
  %.161.us.epil = add nuw nsw i32 %.060103.us.unr, %34
  br label %._crit_edge106.us

._crit_edge106.us:                                ; preds = %._crit_edge106.us.unr-lcssa, %._crit_edge106.us.epilog-lcssa
  %.165.us.lcssa = phi i32 [ %.165.us.lcssa.ph, %._crit_edge106.us.unr-lcssa ], [ %.165.us.epil, %._crit_edge106.us.epilog-lcssa ]
  %.163.us.lcssa = phi i32 [ %.163.us.lcssa.ph, %._crit_edge106.us.unr-lcssa ], [ %.163.us.epil, %._crit_edge106.us.epilog-lcssa ]
  %.161.us.lcssa = phi i32 [ %.161.us.lcssa.ph, %._crit_edge106.us.unr-lcssa ], [ %.161.us.epil, %._crit_edge106.us.epilog-lcssa ]
  %.not81.us = icmp eq i32 %.161.us.lcssa, 0
  %35 = zext i1 %.not81.us to i32
  %36 = add nuw nsw i32 %.075110.us, %35
  %reass.sub126 = sub i32 %.163.us.lcssa, %.165.us.lcssa
  %37 = add i32 %reass.sub126, 1
  %38 = icmp eq i32 %37, %.161.us.lcssa
  %39 = select i1 %.not81.us, i1 true, i1 %38
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %40 = icmp ult i64 %indvars.iv.next143, %12
  %41 = select i1 %39, i1 %40, i1 false
  br i1 %41, label %.preheader83.us, label %._crit_edge112.loopexit, !llvm.loop !12

.lr.ph97:                                         ; preds = %.critedge, %._crit_edge
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %._crit_edge ], [ 0, %.critedge ]
  %.07695 = phi i32 [ %56, %._crit_edge ], [ 0, %.critedge ]
  %.07794 = phi i1 [ %60, %._crit_edge ], [ true, %.critedge ]
  %42 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %42)
  %44 = load i32, ptr %1, align 4
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph97
  %wide.trip.count = zext nneg i32 %44 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %46 = icmp eq i32 %44, 1
  br i1 %46, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.173.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %.173.1, %.lr.ph ]
  %.171.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %.171.1, %.lr.ph ]
  %.169.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %.169.1, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.06890.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %.169.1, %.lr.ph ]
  %.07089.unr = phi i32 [ -1, %.lr.ph.preheader ], [ %.171.1, %.lr.ph ]
  %.07288.unr = phi i32 [ -1, %.lr.ph.preheader ], [ %.173.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %47 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135, i64 %indvars.iv.unr
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = icmp eq i8 %48, 35
  %50 = icmp slt i32 %.07288.unr, 0
  %51 = select i1 %49, i1 %50, i1 false
  %52 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %.173.epil = select i1 %51, i32 %52, i32 %.07288.unr
  %.171.epil = select i1 %49, i32 %52, i32 %.07089.unr
  %53 = zext i1 %49 to i32
  %.169.epil = add nuw nsw i32 %.06890.unr, %53
  br label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.173.lcssa = phi i32 [ %.173.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.173.epil, %.lr.ph.epil ]
  %.171.lcssa = phi i32 [ %.171.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.171.epil, %.lr.ph.epil ]
  %.169.lcssa = phi i32 [ %.169.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.169.epil, %.lr.ph.epil ]
  %54 = sub i32 %.171.lcssa, %.173.lcssa
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph97
  %.068.lcssa = phi i32 [ 0, %.lr.ph97 ], [ %.169.lcssa, %._crit_edge.loopexit ]
  %reass.sub = phi i32 [ 0, %.lr.ph97 ], [ %54, %._crit_edge.loopexit ]
  %.not82 = icmp eq i32 %.068.lcssa, 0
  %55 = zext i1 %.not82 to i32
  %56 = add nuw nsw i32 %.07695, %55
  %57 = add i32 %reass.sub, 1
  %58 = icmp eq i32 %57, %.068.lcssa
  %59 = select i1 %.not82, i1 true, i1 %58
  %60 = select i1 %59, i1 %.07794, i1 false
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %61 = load i32, ptr %0, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next136, %62
  br i1 %63, label %.lr.ph97, label %.preheader84.loopexit, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.06890 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %.169.1, %.lr.ph ]
  %.07089 = phi i32 [ -1, %.lr.ph.preheader.new ], [ %.171.1, %.lr.ph ]
  %.07288 = phi i32 [ -1, %.lr.ph.preheader.new ], [ %.173.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %64 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135, i64 %indvars.iv
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = icmp eq i8 %65, 35
  %67 = icmp slt i32 %.07288, 0
  %68 = select i1 %66, i1 %67, i1 false
  %69 = trunc nuw nsw i64 %indvars.iv to i32
  %.173 = select i1 %68, i32 %69, i32 %.07288
  %.171 = select i1 %66, i32 %69, i32 %.07089
  %70 = zext i1 %66 to i32
  %.169 = add nuw nsw i32 %.06890, %70
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %71 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135, i64 %indvars.iv.next
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = icmp eq i8 %72, 35
  %74 = icmp slt i32 %.173, 0
  %75 = select i1 %73, i1 %74, i1 false
  %76 = trunc nuw nsw i64 %indvars.iv.next to i32
  %.173.1 = select i1 %75, i32 %76, i32 %.173
  %.171.1 = select i1 %73, i32 %76, i32 %.171
  %77 = zext i1 %73 to i32
  %.169.1 = add nuw nsw i32 %.169, %77
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

._crit_edge112.loopexit:                          ; preds = %._crit_edge106.us
  %78 = icmp ne i32 %36, 0
  %.not80 = xor i1 %.076.lcssa, %78
  %or.cond165 = select i1 %39, i1 %.not80, i1 false
  br i1 %or.cond165, label %81, label %79

._crit_edge112:                                   ; preds = %.preheader84
  %or.cond = select i1 %.077.lcssa, i1 %.076.lcssa, i1 false
  br i1 %or.cond, label %81, label %79

79:                                               ; preds = %._crit_edge112.thread, %._crit_edge112.loopexit, %._crit_edge112
  %80 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %113

81:                                               ; preds = %._crit_edge112.loopexit, %._crit_edge112, %._crit_edge112.thread
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  store ptr %0, ptr %3, align 8, !tbaa !15
  %82 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %1, ptr %82, align 8, !tbaa !15
  %83 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %2, ptr %83, align 8, !tbaa !15
  call void @"_ZNSt8functionIFviiEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  %84 = load i32, ptr %0, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  %86 = load i32, ptr %1, align 4
  %87 = icmp sgt i32 %86, 0
  %or.cond167 = select i1 %85, i1 %87, i1 false
  br i1 %or.cond167, label %.preheader, label %._crit_edge123

.preheader:                                       ; preds = %81, %._crit_edge119
  %88 = phi i32 [ %94, %._crit_edge119 ], [ %84, %81 ]
  %89 = phi i32 [ %95, %._crit_edge119 ], [ %86, %81 ]
  %90 = phi i32 [ %96, %._crit_edge119 ], [ %86, %81 ]
  %indvars.iv148 = phi i64 [ %indvars.iv.next149, %._crit_edge119 ], [ 0, %81 ]
  %.058121 = phi i32 [ %.1.lcssa, %._crit_edge119 ], [ 0, %81 ]
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.lr.ph118, label %._crit_edge119

.lr.ph118:                                        ; preds = %.preheader
  %92 = trunc nuw nsw i64 %indvars.iv148 to i32
  br label %99

._crit_edge123:                                   ; preds = %._crit_edge119, %81
  %.058.lcssa = phi i32 [ 0, %81 ], [ %.1.lcssa, %._crit_edge119 ]
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.058.lcssa)
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  br label %113

._crit_edge119.loopexit:                          ; preds = %109
  %.pre153 = load i32, ptr %0, align 4, !tbaa !5
  br label %._crit_edge119

._crit_edge119:                                   ; preds = %._crit_edge119.loopexit, %.preheader
  %94 = phi i32 [ %88, %.preheader ], [ %.pre153, %._crit_edge119.loopexit ]
  %95 = phi i32 [ %89, %.preheader ], [ %110, %._crit_edge119.loopexit ]
  %96 = phi i32 [ %90, %.preheader ], [ %110, %._crit_edge119.loopexit ]
  %.1.lcssa = phi i32 [ %.058121, %.preheader ], [ %.2, %._crit_edge119.loopexit ]
  %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
  %97 = sext i32 %94 to i64
  %98 = icmp slt i64 %indvars.iv.next149, %97
  br i1 %98, label %.preheader, label %._crit_edge123, !llvm.loop !17

99:                                               ; preds = %.lr.ph118, %109
  %100 = phi i32 [ %89, %.lr.ph118 ], [ %110, %109 ]
  %indvars.iv145 = phi i64 [ 0, %.lr.ph118 ], [ %indvars.iv.next146, %109 ]
  %.1116 = phi i32 [ %.058121, %.lr.ph118 ], [ %.2, %109 ]
  %101 = getelementptr inbounds [1001 x [1001 x i8]], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv148, i64 %indvars.iv145
  %102 = load i8, ptr %101, align 1, !tbaa !9
  %103 = icmp eq i8 %102, 35
  br i1 %103, label %104, label %109

104:                                              ; preds = %99
  %105 = trunc nuw nsw i64 %indvars.iv145 to i32
  invoke void @_ZNKSt8functionIFviiEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef %92, i32 noundef %105)
          to label %._crit_edge151 unwind label %107

._crit_edge151:                                   ; preds = %104
  %106 = add nsw i32 %.1116, 1
  %.pre152 = load i32, ptr %1, align 4, !tbaa !5
  br label %109

107:                                              ; preds = %104
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #5
  resume { ptr, i32 } %108

109:                                              ; preds = %._crit_edge151, %99
  %110 = phi i32 [ %.pre152, %._crit_edge151 ], [ %100, %99 ]
  %.2 = phi i32 [ %106, %._crit_edge151 ], [ %.1116, %99 ]
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next146, %111
  br i1 %112, label %99, label %._crit_edge119.loopexit, !llvm.loop !19

113:                                              ; preds = %._crit_edge123, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #5
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFviiEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFviiEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "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 = { 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 #4 = { 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 }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !11, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !11}


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