; LLVM IR from tangjz/acm-icpc :: self_training/2015-01-29 (N)

; 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"

%struct.BigInt = type { i32, [2500 x i32] }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@Hash = external dso_local global [200001 x i32], align 16
@str = external dso_local global [101 x i8], align 16
@vis = external dso_local global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i32, align 4
  %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 %struct.BigInt, align 4
  %15 = alloca %struct.BigInt, align 4
  %16 = alloca %struct.BigInt, align 4
  %17 = alloca %struct.BigInt, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i8 1, ptr getelementptr inbounds ([101 x i8], ptr @vis, i64 0, i64 1), align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %46, %0
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = icmp sle i32 %20, 100
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %49

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 2, ptr %4, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %41, %23
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = mul nsw i32 %25, %26
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %24
  store i32 5, ptr %3, align 4
  br label %44

31:                                               ; preds = %24
  %32 = load i32, ptr %2, align 4, !tbaa !9
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = srem i32 %32, %33
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %40

36:                                               ; preds = %31
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %38
  store i8 1, ptr %39, align 1, !tbaa !5
  store i32 5, ptr %3, align 4
  br label %44

40:                                               ; preds = %31
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !9
  br label %24, !llvm.loop !11

44:                                               ; preds = %36, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %2, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !9
  br label %19, !llvm.loop !13

49:                                               ; preds = %22
  br label %50

50:                                               ; preds = %273, %49
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %52 = icmp ne i32 %51, -1
  br i1 %52, label %53, label %274

53:                                               ; preds = %50
  %54 = load i8, ptr getelementptr inbounds ([101 x i8], ptr @str, i64 0, i64 1), align 1, !tbaa !14
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 119
  br i1 %56, label %57, label %69

57:                                               ; preds = %53
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %59 = call i64 @strlen(ptr noundef @str) #9
  %60 = trunc i64 %59 to i32
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !5, !range !15, !noundef !16
  %64 = trunc i8 %63 to i1
  %65 = xor i1 %64, true
  %66 = zext i1 %65 to i64
  %67 = select i1 %65, ptr @.str.1, ptr @.str.2
  %68 = call i32 @puts(ptr noundef %67)
  br label %273

69:                                               ; preds = %53
  %70 = load i8, ptr getelementptr inbounds ([101 x i8], ptr @str, i64 0, i64 1), align 1, !tbaa !14
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 116
  br i1 %72, label %73, label %154

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 @Hash, i8 0, i64 800004, i1 false)
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  br label %75

75:                                               ; preds = %122, %73
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = load i32, ptr @n, align 4, !tbaa !9
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %125

80:                                               ; preds = %75
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !9
  %85 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %9)
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = add nsw i32 %86, %87
  %89 = load i32, ptr @n, align 4, !tbaa !9
  %90 = srem i32 %88, %89
  store i32 %90, ptr %5, align 4, !tbaa !9
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %121

96:                                               ; preds = %80
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %109

99:                                               ; preds = %96
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = sub nsw i32 %100, %104
  %106 = add nsw i32 %105, 1
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %121

109:                                              ; preds = %99, %96
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  store i32 %113, ptr %7, align 4, !tbaa !9
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = load i32, ptr %5, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = sub nsw i32 %114, %118
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %6, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %109, %99, %80
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %8, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !9
  br label %75, !llvm.loop !17

125:                                              ; preds = %79
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %130, label %128

128:                                              ; preds = %125
  %129 = call i32 @puts(ptr noundef @.str.4)
  br label %153

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

131:                                              ; preds = %149, %130
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %152

136:                                              ; preds = %131
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = load i32, ptr %10, align 4, !tbaa !9
  %139 = add nsw i32 %137, %138
  %140 = load i32, ptr %10, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  %142 = load i32, ptr %6, align 4, !tbaa !9
  %143 = icmp eq i32 %141, %142
  %144 = zext i1 %143 to i64
  %145 = getelementptr inbounds [3 x i8], ptr @.str.6, i64 0, i64 %144
  %146 = load i8, ptr %145, align 1, !tbaa !14
  %147 = sext i8 %146 to i32
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %139, i32 noundef %147)
  br label %149

149:                                              ; preds = %136
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %10, align 4, !tbaa !9
  br label %131, !llvm.loop !18

152:                                              ; preds = %135
  br label %153

153:                                              ; preds = %152, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %272

154:                                              ; preds = %69
  %155 = load i8, ptr getelementptr inbounds ([101 x i8], ptr @str, i64 0, i64 2), align 2, !tbaa !14
  %156 = sext i8 %155 to i32
  %157 = icmp eq i32 %156, 97
  br i1 %157, label %158, label %224

158:                                              ; preds = %154
  %159 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef @n, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 2, ptr %13, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %199, %158
  %161 = load i32, ptr %13, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = load i32, ptr %13, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = mul nsw i64 %162, %164
  %166 = load i32, ptr @n, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = icmp sle i64 %165, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %160
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %202

170:                                              ; preds = %160
  %171 = load i32, ptr @n, align 4, !tbaa !9
  %172 = load i32, ptr %13, align 4, !tbaa !9
  %173 = srem i32 %171, %172
  %174 = icmp eq i32 %173, 0
  br i1 %174, label %175, label %198

175:                                              ; preds = %170
  br label %176

176:                                              ; preds = %181, %175
  %177 = load i32, ptr @n, align 4, !tbaa !9
  %178 = load i32, ptr %13, align 4, !tbaa !9
  %179 = srem i32 %177, %178
  %180 = icmp eq i32 %179, 0
  br i1 %180, label %181, label %187

181:                                              ; preds = %176
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %11, align 4, !tbaa !9
  %184 = load i32, ptr %13, align 4, !tbaa !9
  %185 = load i32, ptr @n, align 4, !tbaa !9
  %186 = sdiv i32 %185, %184
  store i32 %186, ptr @n, align 4, !tbaa !9
  br label %176, !llvm.loop !19

187:                                              ; preds = %176
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %197, label %190

190:                                              ; preds = %187
  %191 = load i32, ptr %11, align 4, !tbaa !9
  %192 = load i32, ptr @k, align 4, !tbaa !9
  %193 = icmp sge i32 %191, %192
  br i1 %193, label %194, label %197

194:                                              ; preds = %190
  %195 = load i32, ptr %13, align 4, !tbaa !9
  %196 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %195)
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %194, %190, %187
  br label %198

198:                                              ; preds = %197, %170
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %13, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %13, align 4, !tbaa !9
  br label %160, !llvm.loop !20

202:                                              ; preds = %169
  %203 = load i32, ptr @n, align 4, !tbaa !9
  %204 = icmp sgt i32 %203, 1
  br i1 %204, label %205, label %218

205:                                              ; preds = %202
  %206 = load i32, ptr %11, align 4, !tbaa !9
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %11, align 4, !tbaa !9
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %217, label %210

210:                                              ; preds = %205
  %211 = load i32, ptr %11, align 4, !tbaa !9
  %212 = load i32, ptr @k, align 4, !tbaa !9
  %213 = icmp sge i32 %211, %212
  br i1 %213, label %214, label %217

214:                                              ; preds = %210
  %215 = load i32, ptr @n, align 4, !tbaa !9
  %216 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %215)
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %217

217:                                              ; preds = %214, %210, %205
  br label %218

218:                                              ; preds = %217, %202
  %219 = load i32, ptr %12, align 4, !tbaa !9
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %223, label %221

221:                                              ; preds = %218
  %222 = call i32 @puts(ptr noundef @.str.9)
  br label %223

223:                                              ; preds = %221, %218
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %271

224:                                              ; preds = %154
  %225 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 10004, ptr %14) #8
  call void @llvm.memset.p0.i64(ptr align 4 %14, i8 0, i64 10004, i1 false)
  call void @llvm.lifetime.start.p0(i64 10004, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 4 %15, i8 0, i64 10004, i1 false)
  %226 = getelementptr inbounds %struct.BigInt, ptr %14, i32 0, i32 0
  store i32 1, ptr %226, align 4, !tbaa !21
  %227 = getelementptr inbounds %struct.BigInt, ptr %14, i32 0, i32 1
  %228 = getelementptr inbounds [2500 x i32], ptr %227, i64 0, i64 0
  store i32 2, ptr %228, align 4, !tbaa !9
  %229 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 0
  store i32 1, ptr %229, align 4, !tbaa !21
  %230 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 1
  %231 = getelementptr inbounds [2500 x i32], ptr %230, i64 0, i64 0
  store i32 1, ptr %231, align 4, !tbaa !9
  br label %232

232:                                              ; preds = %240, %224
  %233 = load i32, ptr @n, align 4, !tbaa !9
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %243

235:                                              ; preds = %232
  %236 = load i32, ptr @n, align 4, !tbaa !9
  %237 = and i32 %236, 1
  %238 = icmp ne i32 %237, 0
  br i1 %238, label %239, label %240

239:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 10004, ptr %16) #8
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %16, ptr noundef nonnull align 4 dereferenceable(10004) %15, ptr noundef nonnull align 4 dereferenceable(10004) %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %16, i64 10004, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 10004, ptr %16) #8
  br label %240

240:                                              ; preds = %239, %235
  call void @llvm.lifetime.start.p0(i64 10004, ptr %17) #8
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %17, ptr noundef nonnull align 4 dereferenceable(10004) %14, ptr noundef nonnull align 4 dereferenceable(10004) %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %17, i64 10004, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 10004, ptr %17) #8
  %241 = load i32, ptr @n, align 4, !tbaa !9
  %242 = ashr i32 %241, 1
  store i32 %242, ptr @n, align 4, !tbaa !9
  br label %232, !llvm.loop !24

243:                                              ; preds = %232
  %244 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 1
  %245 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 0
  %246 = load i32, ptr %245, align 4, !tbaa !21
  %247 = sub nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [2500 x i32], ptr %244, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !9
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %250)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %252 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 0
  %253 = load i32, ptr %252, align 4, !tbaa !21
  %254 = sub nsw i32 %253, 2
  store i32 %254, ptr %18, align 4, !tbaa !9
  br label %255

255:                                              ; preds = %266, %243
  %256 = load i32, ptr %18, align 4, !tbaa !9
  %257 = icmp sge i32 %256, 0
  br i1 %257, label %259, label %258

258:                                              ; preds = %255
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %269

259:                                              ; preds = %255
  %260 = getelementptr inbounds %struct.BigInt, ptr %15, i32 0, i32 1
  %261 = load i32, ptr %18, align 4, !tbaa !9
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [2500 x i32], ptr %260, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !9
  %265 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %264)
  br label %266

266:                                              ; preds = %259
  %267 = load i32, ptr %18, align 4, !tbaa !9
  %268 = add nsw i32 %267, -1
  store i32 %268, ptr %18, align 4, !tbaa !9
  br label %255, !llvm.loop !25

269:                                              ; preds = %258
  %270 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.end.p0(i64 10004, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 10004, ptr %14) #8
  br label %271

271:                                              ; preds = %269, %223
  br label %272

272:                                              ; preds = %271, %153
  br label %273

273:                                              ; preds = %272, %57
  br label %50, !llvm.loop !26

274:                                              ; preds = %50
  ret i32 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

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(10004), ptr noundef nonnull align 4 dereferenceable(10004)) #5 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #7

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 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !10, i64 0}
!22 = !{!"_ZTS6BigInt", !10, i64 0, !7, i64 4}
!23 = !{i64 0, i64 4, !9, i64 4, i64 10000, !14}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; 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"

%struct.BigInt = type { i32, [2500 x i32] }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@Hash = external dso_local local_unnamed_addr global [200001 x i32], align 16
@str = external dso_local global [101 x i8], align 16
@vis = external dso_local local_unnamed_addr global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.BigInt, align 4
  %3 = alloca %struct.BigInt, align 4
  %4 = alloca %struct.BigInt, align 4
  %5 = alloca %struct.BigInt, align 4
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 1), align 1, !tbaa !5
  br label %.preheader85

.preheader85:                                     ; preds = %0, %.loopexit
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %.loopexit ]
  %.not7786 = icmp ult i64 %indvars.iv, 4
  br i1 %.not7786, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader85
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph

.preheader84:                                     ; preds = %.loopexit
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %.not122 = icmp eq i32 %7, -1
  br i1 %.not122, label %._crit_edge124, label %.lr.ph123

.lr.ph123:                                        ; preds = %.preheader84
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = getelementptr inbounds i8, ptr %3, i64 4
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  br label %20

12:                                               ; preds = %.lr.ph
  %13 = add nuw nsw i32 %.05987, 1
  %14 = mul nuw nsw i32 %13, %13
  %15 = zext nneg i32 %14 to i64
  %.not77 = icmp ult i64 %indvars.iv, %15
  br i1 %.not77, label %.loopexit, label %.lr.ph, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph.preheader, %12
  %.05987 = phi i32 [ %13, %12 ], [ 2, %.lr.ph.preheader ]
  %16 = urem i32 %6, %.05987
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %12

18:                                               ; preds = %.lr.ph
  %19 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %indvars.iv
  store i8 1, ptr %19, align 1, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %12, %.preheader85, %18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 101
  br i1 %exitcond.not, label %.preheader84, label %.preheader85, !llvm.loop !11

20:                                               ; preds = %.lr.ph123, %.thread
  %21 = load i8, ptr getelementptr inbounds (i8, ptr @str, i64 1), align 1, !tbaa !12
  switch i8 %21, label %58 [
    i8 119, label %22
    i8 116, label %31
  ]

22:                                               ; preds = %20
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #9
  %sext = shl i64 %24, 32
  %25 = ashr exact i64 %sext, 32
  %26 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !5, !range !13, !noundef !14
  %28 = trunc nuw i8 %27 to i1
  %29 = select i1 %28, ptr @.str.2, ptr @.str.1
  %30 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %29)
  br label %.thread

31:                                               ; preds = %20
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @Hash, i8 0, i64 800004, i1 false)
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  %33 = load i32, ptr @n, align 4, !tbaa !15
  %.not7390 = icmp slt i32 %33, 1
  br i1 %.not7390, label %._crit_edge.thread, label %.lr.ph95

._crit_edge.thread:                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  br label %48

._crit_edge:                                      ; preds = %._crit_edge137
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  %.not74 = icmp eq i32 %.157, 0
  br i1 %.not74, label %48, label %.preheader83

.preheader83:                                     ; preds = %._crit_edge
  %34 = icmp sgt i32 %.157, 0
  br i1 %34, label %.lr.ph98, label %.thread

.lr.ph95:                                         ; preds = %31, %._crit_edge137
  %.05394 = phi i32 [ %.pre-phi, %._crit_edge137 ], [ 1, %31 ]
  %.05493 = phi i32 [ %.155, %._crit_edge137 ], [ 0, %31 ]
  %.05692 = phi i32 [ %.157, %._crit_edge137 ], [ 0, %31 ]
  %.05891 = phi i32 [ %41, %._crit_edge137 ], [ 0, %31 ]
  %35 = sext i32 %.05891 to i64
  %36 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %35
  store i32 %.05394, ptr %36, align 4, !tbaa !15
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1)
  %38 = load i32, ptr %1, align 4, !tbaa !15
  %39 = add nsw i32 %38, %.05891
  %40 = load i32, ptr @n, align 4, !tbaa !15
  %41 = srem i32 %39, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200001 x i32], ptr @Hash, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !15
  %.not75 = icmp eq i32 %44, 0
  br i1 %.not75, label %.lr.ph95._crit_edge, label %45

.lr.ph95._crit_edge:                              ; preds = %.lr.ph95
  %.pre138 = add nuw nsw i32 %.05394, 1
  br label %._crit_edge137

45:                                               ; preds = %.lr.ph95
  %.not76 = icmp eq i32 %.05692, 0
  %.pre139 = add nuw i32 %.05394, 1
  %.pre141 = sub i32 %.pre139, %44
  br i1 %.not76, label %._crit_edge137, label %46

46:                                               ; preds = %45
  %47 = icmp slt i32 %.pre141, %.05692
  %spec.select = call i32 @llvm.smin.i32(i32 %.pre141, i32 %.05692)
  %spec.select165 = select i1 %47, i32 %44, i32 %.05493
  br label %._crit_edge137

._crit_edge137:                                   ; preds = %46, %45, %.lr.ph95._crit_edge
  %.pre-phi = phi i32 [ %.pre138, %.lr.ph95._crit_edge ], [ %.pre139, %45 ], [ %.pre139, %46 ]
  %.157 = phi i32 [ %.05692, %.lr.ph95._crit_edge ], [ %.pre141, %45 ], [ %spec.select, %46 ]
  %.155 = phi i32 [ %.05493, %.lr.ph95._crit_edge ], [ %44, %45 ], [ %spec.select165, %46 ]
  %.not73.not = icmp slt i32 %.05394, %40
  br i1 %.not73.not, label %.lr.ph95, label %._crit_edge, !llvm.loop !17

48:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %49 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %.thread

.lr.ph98:                                         ; preds = %.preheader83, %.lr.ph98
  %.05297 = phi i32 [ %51, %.lr.ph98 ], [ 0, %.preheader83 ]
  %50 = add nsw i32 %.05297, %.155
  %51 = add nuw nsw i32 %.05297, 1
  %52 = icmp eq i32 %51, %.157
  %53 = zext i1 %52 to i64
  %54 = getelementptr inbounds [3 x i8], ptr @.str.6, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !12
  %56 = sext i8 %55 to i32
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %50, i32 noundef %56)
  %exitcond129.not = icmp eq i32 %51, %.157
  br i1 %exitcond129.not, label %.thread, label %.lr.ph98, !llvm.loop !18

58:                                               ; preds = %20
  %59 = load i8, ptr getelementptr inbounds (i8, ptr @str, i64 2), align 2, !tbaa !12
  %60 = icmp eq i8 %59, 97
  br i1 %60, label %61, label %91

61:                                               ; preds = %58
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull @n, ptr noundef nonnull @k)
  %63 = load i32, ptr @n, align 4, !tbaa !15
  %.not67112 = icmp slt i32 %63, 4
  br i1 %.not67112, label %._crit_edge118.thread, label %.lr.ph117

._crit_edge118:                                   ; preds = %80
  %64 = icmp sgt i32 %81, 1
  %.not68 = icmp eq i32 %.1, 0
  br i1 %64, label %84, label %89

._crit_edge118.thread:                            ; preds = %61
  %65 = icmp sgt i32 %63, 1
  br i1 %65, label %.thread153, label %.thread80

.lr.ph117:                                        ; preds = %61, %80
  %66 = phi i32 [ %81, %80 ], [ %63, %61 ]
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %80 ], [ 2, %61 ]
  %.048114 = phi i32 [ %.1, %80 ], [ 0, %61 ]
  %.049113 = phi i32 [ %.251, %80 ], [ 0, %61 ]
  %67 = trunc nuw nsw i64 %indvars.iv133 to i32
  %68 = srem i32 %66, %67
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %.lr.ph108, label %80

.lr.ph108:                                        ; preds = %.lr.ph117, %.lr.ph108
  %.150107 = phi i32 [ %71, %.lr.ph108 ], [ %.049113, %.lr.ph117 ]
  %70 = phi i32 [ %72, %.lr.ph108 ], [ %66, %.lr.ph117 ]
  %71 = add nsw i32 %.150107, 1
  %72 = sdiv i32 %70, %67
  %73 = srem i32 %72, %67
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %.lr.ph108, label %75, !llvm.loop !19

75:                                               ; preds = %.lr.ph108
  store i32 %72, ptr @n, align 4, !tbaa !15
  %.not71 = icmp eq i32 %.048114, 0
  br i1 %.not71, label %76, label %80

76:                                               ; preds = %75
  %77 = load i32, ptr @k, align 4, !tbaa !15
  %.not72 = icmp slt i32 %71, %77
  br i1 %.not72, label %80, label %78

78:                                               ; preds = %76
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %67)
  %.pre136 = load i32, ptr @n, align 4, !tbaa !15
  br label %80

80:                                               ; preds = %.lr.ph117, %78, %76, %75
  %81 = phi i32 [ %72, %75 ], [ %.pre136, %78 ], [ %72, %76 ], [ %66, %.lr.ph117 ]
  %.251 = phi i32 [ %71, %75 ], [ %71, %78 ], [ %71, %76 ], [ %.049113, %.lr.ph117 ]
  %.1 = phi i32 [ 1, %75 ], [ 1, %78 ], [ 0, %76 ], [ %.048114, %.lr.ph117 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %82 = mul nuw nsw i64 %indvars.iv.next134, %indvars.iv.next134
  %83 = sext i32 %81 to i64
  %.not67 = icmp sgt i64 %82, %83
  br i1 %.not67, label %._crit_edge118, label %.lr.ph117, !llvm.loop !20

84:                                               ; preds = %._crit_edge118
  br i1 %.not68, label %.thread153, label %.thread

.thread153:                                       ; preds = %._crit_edge118.thread, %84
  %.049.lcssa149159 = phi i32 [ %.251, %84 ], [ 0, %._crit_edge118.thread ]
  %.lcssa152158 = phi i32 [ %81, %84 ], [ %63, %._crit_edge118.thread ]
  %85 = add nsw i32 %.049.lcssa149159, 1
  %86 = load i32, ptr @k, align 4, !tbaa !15
  %.not69 = icmp slt i32 %85, %86
  br i1 %.not69, label %.thread80, label %87

87:                                               ; preds = %.thread153
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.lcssa152158)
  br label %.thread

89:                                               ; preds = %._crit_edge118
  br i1 %.not68, label %.thread80, label %.thread

.thread80:                                        ; preds = %._crit_edge118.thread, %.thread153, %89
  %90 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %.thread

91:                                               ; preds = %58
  %92 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 10004, ptr nonnull %2) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10004) %10, i8 0, i64 9996, i1 false)
  call void @llvm.lifetime.start.p0(i64 10004, ptr nonnull %3) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10004) %11, i8 0, i64 9996, i1 false)
  store i32 1, ptr %2, align 4, !tbaa !21
  store i32 2, ptr %8, align 4, !tbaa !15
  store i32 1, ptr %3, align 4, !tbaa !21
  store i32 1, ptr %9, align 4, !tbaa !15
  %.pr = load i32, ptr @n, align 4, !tbaa !15
  %.not6599 = icmp eq i32 %.pr, 0
  br i1 %.not6599, label %._crit_edge102, label %.lr.ph101

.lr.ph101:                                        ; preds = %91, %96
  %93 = phi i32 [ %98, %96 ], [ %.pr, %91 ]
  %94 = and i32 %93, 1
  %.not66 = icmp eq i32 %94, 0
  br i1 %.not66, label %96, label %95

95:                                               ; preds = %.lr.ph101
  call void @llvm.lifetime.start.p0(i64 10004, ptr nonnull %4) #10
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %4, ptr noundef nonnull align 4 dereferenceable(10004) %3, ptr noundef nonnull align 4 dereferenceable(10004) %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(10004) %3, ptr noundef nonnull align 4 dereferenceable(10004) %4, i64 10004, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 10004, ptr nonnull %4) #10
  br label %96

96:                                               ; preds = %95, %.lr.ph101
  call void @llvm.lifetime.start.p0(i64 10004, ptr nonnull %5) #10
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %5, ptr noundef nonnull align 4 dereferenceable(10004) %2, ptr noundef nonnull align 4 dereferenceable(10004) %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(10004) %2, ptr noundef nonnull align 4 dereferenceable(10004) %5, i64 10004, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 10004, ptr nonnull %5) #10
  %97 = load i32, ptr @n, align 4, !tbaa !15
  %98 = ashr i32 %97, 1
  store i32 %98, ptr @n, align 4, !tbaa !15
  %.not65 = icmp ult i32 %97, 2
  br i1 %.not65, label %._crit_edge102.loopexit, label %.lr.ph101, !llvm.loop !24

._crit_edge102.loopexit:                          ; preds = %96
  %.pre = load i32, ptr %3, align 4, !tbaa !21
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge102.loopexit, %91
  %99 = phi i32 [ %.pre, %._crit_edge102.loopexit ], [ 1, %91 ]
  %100 = add nsw i32 %99, -1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2500 x i32], ptr %9, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !15
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %103)
  %105 = load i32, ptr %3, align 4, !tbaa !21
  %106 = icmp sgt i32 %105, 1
  br i1 %106, label %.lr.ph105.preheader, label %._crit_edge106

.lr.ph105.preheader:                              ; preds = %._crit_edge102
  %107 = add nsw i32 %105, -2
  %108 = zext nneg i32 %107 to i64
  br label %.lr.ph105

._crit_edge106:                                   ; preds = %.lr.ph105, %._crit_edge102
  %109 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.end.p0(i64 10004, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 10004, ptr nonnull %2) #10
  br label %.thread

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %.lr.ph105
  %indvars.iv130 = phi i64 [ %108, %.lr.ph105.preheader ], [ %indvars.iv.next131, %.lr.ph105 ]
  %110 = getelementptr inbounds [2500 x i32], ptr %9, i64 0, i64 %indvars.iv130
  %111 = load i32, ptr %110, align 4, !tbaa !15
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %111)
  %indvars.iv.next131 = add nsw i64 %indvars.iv130, -1
  %.not166 = icmp eq i64 %indvars.iv130, 0
  br i1 %.not166, label %._crit_edge106, label %.lr.ph105, !llvm.loop !25

.thread:                                          ; preds = %.lr.ph98, %.preheader83, %87, %84, %89, %.thread80, %48, %._crit_edge106, %22
  %113 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %.not = icmp eq i32 %113, -1
  br i1 %.not, label %._crit_edge124, label %20, !llvm.loop !26

._crit_edge124:                                   ; preds = %.thread, %.preheader84
  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: 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; 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 @_ZNK6BigIntmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(10004), ptr noundef nonnull align 4 dereferenceable(10004)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8

attributes #0 = { mustprogress norecurse 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 #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 nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { inlinehint mustprogress nofree 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { 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 = !{!"bool", !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 = !{!7, !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!22, !16, i64 0}
!22 = !{!"_ZTS6BigInt", !16, i64 0, !7, i64 4}
!23 = !{i64 0, i64 4, !15, i64 4, i64 10000, !12}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}


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