; LLVM IR from tangjz/acm-icpc :: poj (2264)

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

@slen = external dso_local global i32, align 4
@tlen = external dso_local global i32, align 4
@f = external dso_local global [101 x [101 x i32]], align 16
@pre = external dso_local global [101 x [101 x i32]], align 16
@len = external dso_local global i32, align 4
@pos = external dso_local global [101 x [2 x i32]], align 16
@s = external dso_local global [101 x i8], align 16
@t = external dso_local global [101 x i8], align 16
@.str = 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
  store i32 0, ptr %1, align 4
  br label %12

12:                                               ; preds = %291, %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @s, ptr noundef @t)
  %14 = icmp eq i32 %13, 2
  br i1 %14, label %15, label %293

15:                                               ; preds = %12
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 40804, i1 false)
  %16 = call i64 @strlen(ptr noundef @s) #6
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr @slen, align 4, !tbaa !5
  %18 = call i64 @strlen(ptr noundef @t) #6
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @tlen, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %154, %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @slen, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %157

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

26:                                               ; preds = %150, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr @tlen, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %153

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sub nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = sext i8 %42 to i32
  %44 = icmp eq i32 %37, %43
  br i1 %44, label %45, label %72

45:                                               ; preds = %31
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [101 x i32], ptr %49, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [101 x i32], ptr %58, i64 0, i64 %60
  store i32 %55, ptr %61, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = mul nsw i32 %62, 101
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [101 x i32], ptr %68, i64 0, i64 %70
  store i32 %65, ptr %71, align 4, !tbaa !5
  br label %149

72:                                               ; preds = %31
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [101 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [101 x i32], ptr %83, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp slt i32 %80, %88
  br i1 %89, label %90, label %119

90:                                               ; preds = %72
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [101 x i32], ptr %93, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [101 x i32], ptr %101, i64 0, i64 %103
  store i32 %98, ptr %104, align 4, !tbaa !5
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %106
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i32], ptr %107, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %114
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [101 x i32], ptr %115, i64 0, i64 %117
  store i32 %112, ptr %118, align 4, !tbaa !5
  br label %148

119:                                              ; preds = %72
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %122
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [101 x i32], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %129
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [101 x i32], ptr %130, i64 0, i64 %132
  store i32 %127, ptr %133, align 4, !tbaa !5
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %136
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [101 x i32], ptr %137, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %143
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [101 x i32], ptr %144, i64 0, i64 %146
  store i32 %141, ptr %147, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %119, %90
  br label %149

149:                                              ; preds = %148, %45
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %4, align 4, !tbaa !5
  br label %26, !llvm.loop !10

153:                                              ; preds = %30
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !12

157:                                              ; preds = %24
  %158 = load i32, ptr @slen, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %159
  %161 = load i32, ptr @tlen, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [101 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  store i32 %164, ptr @len, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %165 = load i32, ptr @len, align 4, !tbaa !5
  %166 = sub nsw i32 %165, 1
  store i32 %166, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %167 = load i32, ptr @slen, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %168
  %170 = load i32, ptr @tlen, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [101 x i32], ptr %169, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  store i32 %173, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  br label %174

174:                                              ; preds = %195, %157
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = icmp sge i32 %175, 0
  br i1 %176, label %178, label %177

177:                                              ; preds = %174
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %207

178:                                              ; preds = %174
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = sdiv i32 %179, 101
  store i32 %180, ptr %7, align 4, !tbaa !5
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = srem i32 %181, 101
  store i32 %182, ptr %8, align 4, !tbaa !5
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = sub nsw i32 %183, 1
  %185 = load i32, ptr %5, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %186
  %188 = getelementptr inbounds [2 x i32], ptr %187, i64 0, i64 0
  store i32 %184, ptr %188, align 8, !tbaa !5
  %189 = load i32, ptr %8, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %5, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %192
  %194 = getelementptr inbounds [2 x i32], ptr %193, i64 0, i64 1
  store i32 %190, ptr %194, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %178
  %196 = load i32, ptr %5, align 4, !tbaa !5
  %197 = add nsw i32 %196, -1
  store i32 %197, ptr %5, align 4, !tbaa !5
  %198 = load i32, ptr %7, align 4, !tbaa !5
  %199 = sub nsw i32 %198, 1
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %200
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = sub nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [101 x i32], ptr %201, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  store i32 %206, ptr %6, align 4, !tbaa !5
  br label %174, !llvm.loop !13

207:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %254, %207
  %209 = load i32, ptr %11, align 4, !tbaa !5
  %210 = load i32, ptr @len, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %208
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %261

213:                                              ; preds = %208
  br label %214

214:                                              ; preds = %222, %213
  %215 = load i32, ptr %9, align 4, !tbaa !5
  %216 = load i32, ptr %11, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %217
  %219 = getelementptr inbounds [2 x i32], ptr %218, i64 0, i64 0
  %220 = load i32, ptr %219, align 8, !tbaa !5
  %221 = icmp slt i32 %215, %220
  br i1 %221, label %222, label %230

222:                                              ; preds = %214
  %223 = load i32, ptr %9, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %9, align 4, !tbaa !5
  %225 = sext i32 %223 to i64
  %226 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %225
  %227 = load i8, ptr %226, align 1, !tbaa !9
  %228 = sext i8 %227 to i32
  %229 = call i32 @putchar(i32 noundef %228)
  br label %214, !llvm.loop !14

230:                                              ; preds = %214
  br label %231

231:                                              ; preds = %239, %230
  %232 = load i32, ptr %10, align 4, !tbaa !5
  %233 = load i32, ptr %11, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %234
  %236 = getelementptr inbounds [2 x i32], ptr %235, i64 0, i64 1
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = icmp slt i32 %232, %237
  br i1 %238, label %239, label %247

239:                                              ; preds = %231
  %240 = load i32, ptr %10, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %10, align 4, !tbaa !5
  %242 = sext i32 %240 to i64
  %243 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %242
  %244 = load i8, ptr %243, align 1, !tbaa !9
  %245 = sext i8 %244 to i32
  %246 = call i32 @putchar(i32 noundef %245)
  br label %231, !llvm.loop !15

247:                                              ; preds = %231
  %248 = load i32, ptr %9, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %249
  %251 = load i8, ptr %250, align 1, !tbaa !9
  %252 = sext i8 %251 to i32
  %253 = call i32 @putchar(i32 noundef %252)
  br label %254

254:                                              ; preds = %247
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %11, align 4, !tbaa !5
  %257 = load i32, ptr %9, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %9, align 4, !tbaa !5
  %259 = load i32, ptr %10, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %10, align 4, !tbaa !5
  br label %208, !llvm.loop !16

261:                                              ; preds = %212
  br label %262

262:                                              ; preds = %268, %261
  %263 = load i32, ptr %9, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %264
  %266 = load i8, ptr %265, align 1, !tbaa !9
  %267 = icmp ne i8 %266, 0
  br i1 %267, label %268, label %276

268:                                              ; preds = %262
  %269 = load i32, ptr %9, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %9, align 4, !tbaa !5
  %271 = sext i32 %269 to i64
  %272 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %271
  %273 = load i8, ptr %272, align 1, !tbaa !9
  %274 = sext i8 %273 to i32
  %275 = call i32 @putchar(i32 noundef %274)
  br label %262, !llvm.loop !17

276:                                              ; preds = %262
  br label %277

277:                                              ; preds = %283, %276
  %278 = load i32, ptr %10, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %279
  %281 = load i8, ptr %280, align 1, !tbaa !9
  %282 = icmp ne i8 %281, 0
  br i1 %282, label %283, label %291

283:                                              ; preds = %277
  %284 = load i32, ptr %10, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %10, align 4, !tbaa !5
  %286 = sext i32 %284 to i64
  %287 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %286
  %288 = load i8, ptr %287, align 1, !tbaa !9
  %289 = sext i8 %288 to i32
  %290 = call i32 @putchar(i32 noundef %289)
  br label %277, !llvm.loop !18

291:                                              ; preds = %277
  %292 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %12, !llvm.loop !19

293:                                              ; preds = %12
  ret i32 0
}

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

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

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

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

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

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind willreturn memory(read) }
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 = !{!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 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}


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

@slen = external dso_local local_unnamed_addr global i32, align 4
@tlen = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@pre = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@pos = external dso_local local_unnamed_addr global [101 x [2 x i32]], align 16
@s = external dso_local global [101 x i8], align 16
@t = external dso_local global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %2 = icmp eq i32 %1, 2
  br i1 %2, label %.lr.ph109, label %._crit_edge110

.lr.ph109:                                        ; preds = %0, %._crit_edge107
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @f, i8 0, i64 40804, i1 false)
  %3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #5
  %4 = trunc i64 %3 to i32
  store i32 %4, ptr @slen, align 4, !tbaa !5
  %5 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @t) #5
  %6 = trunc i64 %5 to i32
  store i32 %6, ptr @tlen, align 4, !tbaa !5
  %.not83 = icmp slt i32 %4, 1
  %.not7481 = icmp slt i32 %6, 1
  %or.cond = select i1 %.not83, i1 true, i1 %.not7481
  br i1 %or.cond, label %._crit_edge85, label %.preheader77.preheader

.preheader77.preheader:                           ; preds = %.lr.ph109
  %7 = add nuw nsw i64 %5, 1
  %8 = add nuw nsw i64 %3, 1
  %wide.trip.count119 = and i64 %8, 4294967295
  %wide.trip.count = and i64 %7, 4294967295
  br label %.preheader77

.preheader77:                                     ; preds = %.preheader77.preheader, %._crit_edge
  %indvars.iv116 = phi i64 [ 1, %.preheader77.preheader ], [ %indvars.iv.next117, %._crit_edge ]
  %9 = add nsw i64 %indvars.iv116, -1
  %10 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %9
  %11 = load i8, ptr %10, align 1, !tbaa !9
  %12 = mul nuw nsw i64 %indvars.iv116, 101
  br label %20

._crit_edge85:                                    ; preds = %._crit_edge, %.lr.ph109
  %sext = shl i64 %3, 32
  %13 = ashr exact i64 %sext, 32
  %sext75 = shl i64 %5, 32
  %14 = ashr exact i64 %sext75, 32
  %15 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %13, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr @len, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph.preheader, label %.preheader79

.lr.ph.preheader:                                 ; preds = %._crit_edge85
  %18 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %13, i64 %14
  %19 = zext nneg i32 %16 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %46
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count119
  br i1 %exitcond120.not, label %._crit_edge85, label %.preheader77, !llvm.loop !10

20:                                               ; preds = %.preheader77, %46
  %indvars.iv = phi i64 [ 1, %.preheader77 ], [ %indvars.iv.next, %46 ]
  %21 = add nsw i64 %indvars.iv, -1
  %22 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = icmp eq i8 %11, %23
  %25 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %indvars.iv116, i64 %indvars.iv
  br i1 %24, label %26, label %33

26:                                               ; preds = %20
  %27 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %9, i64 %21
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  %30 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %indvars.iv116, i64 %indvars.iv
  store i32 %29, ptr %30, align 4, !tbaa !5
  %31 = add nuw nsw i64 %indvars.iv, %12
  %32 = trunc nsw i64 %31 to i32
  br label %46

33:                                               ; preds = %20
  %34 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %9, i64 %indvars.iv
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %indvars.iv116, i64 %21
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp slt i32 %35, %37
  %39 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %indvars.iv116, i64 %indvars.iv
  br i1 %38, label %40, label %43

40:                                               ; preds = %33
  store i32 %37, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %indvars.iv116, i64 %21
  %42 = load i32, ptr %41, align 4, !tbaa !5
  br label %46

43:                                               ; preds = %33
  store i32 %35, ptr %39, align 4, !tbaa !5
  %44 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %9, i64 %indvars.iv
  %45 = load i32, ptr %44, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %26, %43, %40
  %.sink = phi i32 [ %32, %26 ], [ %45, %43 ], [ %42, %40 ]
  store i32 %.sink, ptr %25, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %20, !llvm.loop !12

.preheader80:                                     ; preds = %.lr.ph
  br i1 %17, label %.preheader76, label %.preheader79

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv121 = phi i64 [ %19, %.lr.ph.preheader ], [ %indvars.iv.next122, %.lr.ph ]
  %.064.in87 = phi ptr [ %18, %.lr.ph.preheader ], [ %55, %.lr.ph ]
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, -1
  %.064 = load i32, ptr %.064.in87, align 4, !tbaa !5
  %47 = sdiv i32 %.064, 101
  %48 = srem i32 %.064, 101
  %49 = add nsw i32 %47, -1
  %50 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %indvars.iv.next122
  store i32 %49, ptr %50, align 8, !tbaa !5
  %51 = add nsw i32 %48, -1
  %52 = getelementptr inbounds i8, ptr %50, i64 4
  store i32 %51, ptr %52, align 4, !tbaa !5
  %53 = sext i32 %49 to i64
  %54 = sext i32 %51 to i64
  %55 = getelementptr inbounds [101 x [101 x i32]], ptr @pre, i64 0, i64 %53, i64 %54
  %56 = icmp ugt i64 %indvars.iv121, 1
  br i1 %56, label %.lr.ph, label %.preheader80, !llvm.loop !13

.preheader79:                                     ; preds = %._crit_edge95, %._crit_edge85, %.preheader80
  %.060.lcssa = phi i32 [ 0, %.preheader80 ], [ 0, %._crit_edge85 ], [ %88, %._crit_edge95 ]
  %.059.lcssa = phi i32 [ 0, %.preheader80 ], [ 0, %._crit_edge85 ], [ %89, %._crit_edge95 ]
  %57 = sext i32 %.060.lcssa to i64
  %58 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !9
  %.not72101 = icmp eq i8 %59, 0
  br i1 %.not72101, label %.preheader78, label %.lr.ph103

.preheader76:                                     ; preds = %.preheader80, %._crit_edge95
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %._crit_edge95 ], [ 0, %.preheader80 ]
  %.05998 = phi i32 [ %89, %._crit_edge95 ], [ 0, %.preheader80 ]
  %.06097 = phi i32 [ %88, %._crit_edge95 ], [ 0, %.preheader80 ]
  %60 = getelementptr inbounds [101 x [2 x i32]], ptr @pos, i64 0, i64 %indvars.iv130
  %61 = load i32, ptr %60, align 8, !tbaa !5
  %62 = icmp slt i32 %.06097, %61
  br i1 %62, label %.lr.ph91.preheader, label %.preheader

.lr.ph91.preheader:                               ; preds = %.preheader76
  %63 = sext i32 %.06097 to i64
  br label %.lr.ph91

.preheader.loopexit:                              ; preds = %.lr.ph91
  %64 = trunc nsw i64 %indvars.iv.next125 to i32
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader76
  %.161.lcssa = phi i32 [ %.06097, %.preheader76 ], [ %64, %.preheader.loopexit ]
  %gep = getelementptr inbounds [101 x [2 x i32]], ptr getelementptr inbounds (i8, ptr @pos, i64 4), i64 0, i64 %indvars.iv130
  %65 = load i32, ptr %gep, align 4, !tbaa !5
  %66 = icmp slt i32 %.05998, %65
  br i1 %66, label %.lr.ph94.preheader, label %._crit_edge95

.lr.ph94.preheader:                               ; preds = %.preheader
  %67 = sext i32 %.05998 to i64
  br label %.lr.ph94

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %.lr.ph91
  %indvars.iv124 = phi i64 [ %63, %.lr.ph91.preheader ], [ %indvars.iv.next125, %.lr.ph91 ]
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, 1
  %68 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv124
  %69 = load i8, ptr %68, align 1, !tbaa !9
  %70 = sext i8 %69 to i32
  %71 = tail call i32 @putchar(i32 noundef %70)
  %72 = load i32, ptr %60, align 8, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next125, %73
  br i1 %74, label %.lr.ph91, label %.preheader.loopexit, !llvm.loop !14

.lr.ph94:                                         ; preds = %.lr.ph94.preheader, %.lr.ph94
  %indvars.iv127 = phi i64 [ %67, %.lr.ph94.preheader ], [ %indvars.iv.next128, %.lr.ph94 ]
  %indvars.iv.next128 = add nsw i64 %indvars.iv127, 1
  %75 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv127
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = tail call i32 @putchar(i32 noundef %77)
  %79 = load i32, ptr %gep, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next128, %80
  br i1 %81, label %.lr.ph94, label %._crit_edge95.loopexit, !llvm.loop !15

._crit_edge95.loopexit:                           ; preds = %.lr.ph94
  %82 = trunc nsw i64 %indvars.iv.next128 to i32
  br label %._crit_edge95

._crit_edge95:                                    ; preds = %._crit_edge95.loopexit, %.preheader
  %.1.lcssa = phi i32 [ %.05998, %.preheader ], [ %82, %._crit_edge95.loopexit ]
  %83 = sext i32 %.161.lcssa to i64
  %84 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = sext i8 %85 to i32
  %87 = tail call i32 @putchar(i32 noundef %86)
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %88 = add nsw i32 %.161.lcssa, 1
  %89 = add nsw i32 %.1.lcssa, 1
  %90 = load i32, ptr @len, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = icmp slt i64 %indvars.iv.next131, %91
  br i1 %92, label %.preheader76, label %.preheader79, !llvm.loop !16

.preheader78:                                     ; preds = %.lr.ph103, %.preheader79
  %93 = sext i32 %.059.lcssa to i64
  %94 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %.not73104 = icmp eq i8 %95, 0
  br i1 %.not73104, label %._crit_edge107, label %.lr.ph106

.lr.ph103:                                        ; preds = %.preheader79, %.lr.ph103
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %.lr.ph103 ], [ %57, %.preheader79 ]
  %96 = phi i8 [ %100, %.lr.ph103 ], [ %59, %.preheader79 ]
  %indvars.iv.next134 = add nsw i64 %indvars.iv133, 1
  %97 = sext i8 %96 to i32
  %98 = tail call i32 @putchar(i32 noundef %97)
  %99 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next134
  %100 = load i8, ptr %99, align 1, !tbaa !9
  %.not72 = icmp eq i8 %100, 0
  br i1 %.not72, label %.preheader78, label %.lr.ph103, !llvm.loop !17

.lr.ph106:                                        ; preds = %.preheader78, %.lr.ph106
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.lr.ph106 ], [ %93, %.preheader78 ]
  %101 = phi i8 [ %105, %.lr.ph106 ], [ %95, %.preheader78 ]
  %indvars.iv.next136 = add nsw i64 %indvars.iv135, 1
  %102 = sext i8 %101 to i32
  %103 = tail call i32 @putchar(i32 noundef %102)
  %104 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next136
  %105 = load i8, ptr %104, align 1, !tbaa !9
  %.not73 = icmp eq i8 %105, 0
  br i1 %.not73, label %._crit_edge107, label %.lr.ph106, !llvm.loop !18

._crit_edge107:                                   ; preds = %.lr.ph106, %.preheader78
  %106 = tail call i32 @putchar(i32 noundef 10)
  %107 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %108 = icmp eq i32 %107, 2
  br i1 %108, label %.lr.ph109, label %._crit_edge110, !llvm.loop !19

._crit_edge110:                                   ; preds = %._crit_edge107, %0
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress nofree 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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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 = !{!"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 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}


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