; LLVM IR from tangjz/acm-icpc :: codeforces/complete (3C)

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

@cnt = external dso_local global [2 x i32], align 4
@win = external dso_local global [2 x i8], align 1
@s = external dso_local global [5 x [5 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %17, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 3
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %7
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %13
  %15 = getelementptr inbounds [5 x i8], ptr %14, i64 0, i64 0
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %15)
  br label %17

17:                                               ; preds = %11
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !9

20:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %62, %20
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 3
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %65

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

26:                                               ; preds = %58, %25
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 3
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %61

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %32
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [5 x i8], ptr %33, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = icmp eq i32 %38, 88
  br i1 %39, label %40, label %43

40:                                               ; preds = %30
  %41 = load i32, ptr @cnt, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @cnt, align 4, !tbaa !5
  br label %57

43:                                               ; preds = %30
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [5 x i8], ptr %46, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 48
  br i1 %52, label %53, label %56

53:                                               ; preds = %43
  %54 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  br label %56

56:                                               ; preds = %53, %43
  br label %57

57:                                               ; preds = %56, %40
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !12

61:                                               ; preds = %29
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !5
  br label %21, !llvm.loop !13

65:                                               ; preds = %24
  %66 = load i32, ptr @cnt, align 4, !tbaa !5
  %67 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %74, label %69

69:                                               ; preds = %65
  %70 = load i32, ptr @cnt, align 4, !tbaa !5
  %71 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = icmp sgt i32 %70, %72
  br i1 %73, label %74, label %76

74:                                               ; preds = %69, %65
  %75 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %277

76:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %176, %76
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = icmp slt i32 %78, 3
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %179

81:                                               ; preds = %77
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %83
  %85 = getelementptr inbounds [5 x i8], ptr %84, i64 0, i64 0
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = sext i8 %86 to i32
  %88 = icmp eq i32 %87, 88
  br i1 %88, label %89, label %106

89:                                               ; preds = %81
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %91
  %93 = getelementptr inbounds [5 x i8], ptr %92, i64 0, i64 1
  %94 = load i8, ptr %93, align 1, !tbaa !11
  %95 = sext i8 %94 to i32
  %96 = icmp eq i32 %95, 88
  br i1 %96, label %97, label %106

97:                                               ; preds = %89
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %99
  %101 = getelementptr inbounds [5 x i8], ptr %100, i64 0, i64 2
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %103 = sext i8 %102 to i32
  %104 = icmp eq i32 %103, 88
  br i1 %104, label %105, label %106

105:                                              ; preds = %97
  store i8 1, ptr @win, align 1, !tbaa !14
  br label %106

106:                                              ; preds = %105, %97, %89, %81
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %108
  %110 = getelementptr inbounds [5 x i8], ptr %109, i64 0, i64 0
  %111 = load i8, ptr %110, align 1, !tbaa !11
  %112 = sext i8 %111 to i32
  %113 = icmp eq i32 %112, 48
  br i1 %113, label %114, label %131

114:                                              ; preds = %106
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %116
  %118 = getelementptr inbounds [5 x i8], ptr %117, i64 0, i64 1
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %120, 48
  br i1 %121, label %122, label %131

122:                                              ; preds = %114
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [5 x [5 x i8]], ptr @s, i64 0, i64 %124
  %126 = getelementptr inbounds [5 x i8], ptr %125, i64 0, i64 2
  %127 = load i8, ptr %126, align 1, !tbaa !11
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 48
  br i1 %129, label %130, label %131

130:                                              ; preds = %122
  store i8 1, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14
  br label %131

131:                                              ; preds = %130, %122, %114, %106
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [5 x i8], ptr @s, i64 0, i64 %133
  %135 = load i8, ptr %134, align 1, !tbaa !11
  %136 = sext i8 %135 to i32
  %137 = icmp eq i32 %136, 88
  br i1 %137, label %138, label %153

138:                                              ; preds = %131
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !11
  %143 = sext i8 %142 to i32
  %144 = icmp eq i32 %143, 88
  br i1 %144, label %145, label %153

145:                                              ; preds = %138
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), i64 0, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !11
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %150, 88
  br i1 %151, label %152, label %153

152:                                              ; preds = %145
  store i8 1, ptr @win, align 1, !tbaa !14
  br label %153

153:                                              ; preds = %152, %145, %138, %131
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [5 x i8], ptr @s, i64 0, i64 %155
  %157 = load i8, ptr %156, align 1, !tbaa !11
  %158 = sext i8 %157 to i32
  %159 = icmp eq i32 %158, 48
  br i1 %159, label %160, label %175

160:                                              ; preds = %153
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 %162
  %164 = load i8, ptr %163, align 1, !tbaa !11
  %165 = sext i8 %164 to i32
  %166 = icmp eq i32 %165, 48
  br i1 %166, label %167, label %175

167:                                              ; preds = %160
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), i64 0, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !11
  %172 = sext i8 %171 to i32
  %173 = icmp eq i32 %172, 48
  br i1 %173, label %174, label %175

174:                                              ; preds = %167
  store i8 1, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14
  br label %175

175:                                              ; preds = %174, %167, %160, %153
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %6, align 4, !tbaa !5
  br label %77, !llvm.loop !16

179:                                              ; preds = %80
  %180 = load i8, ptr @s, align 16, !tbaa !11
  %181 = sext i8 %180 to i32
  %182 = icmp eq i32 %181, 88
  br i1 %182, label %183, label %192

183:                                              ; preds = %179
  %184 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 1), align 1, !tbaa !11
  %185 = sext i8 %184 to i32
  %186 = icmp eq i32 %185, 88
  br i1 %186, label %187, label %192

187:                                              ; preds = %183
  %188 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), i64 0, i64 2), align 2, !tbaa !11
  %189 = sext i8 %188 to i32
  %190 = icmp eq i32 %189, 88
  br i1 %190, label %191, label %192

191:                                              ; preds = %187
  store i8 1, ptr @win, align 1, !tbaa !14
  br label %192

192:                                              ; preds = %191, %187, %183, %179
  %193 = load i8, ptr @s, align 16, !tbaa !11
  %194 = sext i8 %193 to i32
  %195 = icmp eq i32 %194, 48
  br i1 %195, label %196, label %205

196:                                              ; preds = %192
  %197 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 1), align 1, !tbaa !11
  %198 = sext i8 %197 to i32
  %199 = icmp eq i32 %198, 48
  br i1 %199, label %200, label %205

200:                                              ; preds = %196
  %201 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), i64 0, i64 2), align 2, !tbaa !11
  %202 = sext i8 %201 to i32
  %203 = icmp eq i32 %202, 48
  br i1 %203, label %204, label %205

204:                                              ; preds = %200
  store i8 1, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14
  br label %205

205:                                              ; preds = %204, %200, %196, %192
  %206 = load i8, ptr getelementptr inbounds ([5 x i8], ptr @s, i64 0, i64 2), align 2, !tbaa !11
  %207 = sext i8 %206 to i32
  %208 = icmp eq i32 %207, 88
  br i1 %208, label %209, label %218

209:                                              ; preds = %205
  %210 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 1), align 1, !tbaa !11
  %211 = sext i8 %210 to i32
  %212 = icmp eq i32 %211, 88
  br i1 %212, label %213, label %218

213:                                              ; preds = %209
  %214 = load i8, ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), align 2, !tbaa !11
  %215 = sext i8 %214 to i32
  %216 = icmp eq i32 %215, 88
  br i1 %216, label %217, label %218

217:                                              ; preds = %213
  store i8 1, ptr @win, align 1, !tbaa !14
  br label %218

218:                                              ; preds = %217, %213, %209, %205
  %219 = load i8, ptr getelementptr inbounds ([5 x i8], ptr @s, i64 0, i64 2), align 2, !tbaa !11
  %220 = sext i8 %219 to i32
  %221 = icmp eq i32 %220, 48
  br i1 %221, label %222, label %231

222:                                              ; preds = %218
  %223 = load i8, ptr getelementptr inbounds ([5 x i8], ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 1), i64 0, i64 1), align 1, !tbaa !11
  %224 = sext i8 %223 to i32
  %225 = icmp eq i32 %224, 48
  br i1 %225, label %226, label %231

226:                                              ; preds = %222
  %227 = load i8, ptr getelementptr inbounds ([5 x [5 x i8]], ptr @s, i64 0, i64 2), align 2, !tbaa !11
  %228 = sext i8 %227 to i32
  %229 = icmp eq i32 %228, 48
  br i1 %229, label %230, label %231

230:                                              ; preds = %226
  store i8 1, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14
  br label %231

231:                                              ; preds = %230, %226, %222, %218
  %232 = load i8, ptr @win, align 1, !tbaa !14, !range !17, !noundef !18
  %233 = trunc i8 %232 to i1
  br i1 %233, label %234, label %237

234:                                              ; preds = %231
  %235 = load i8, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14, !range !17, !noundef !18
  %236 = trunc i8 %235 to i1
  br i1 %236, label %251, label %237

237:                                              ; preds = %234, %231
  %238 = load i8, ptr @win, align 1, !tbaa !14, !range !17, !noundef !18
  %239 = trunc i8 %238 to i1
  br i1 %239, label %240, label %244

240:                                              ; preds = %237
  %241 = load i32, ptr @cnt, align 4, !tbaa !5
  %242 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %243 = icmp eq i32 %241, %242
  br i1 %243, label %251, label %244

244:                                              ; preds = %240, %237
  %245 = load i8, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14, !range !17, !noundef !18
  %246 = trunc i8 %245 to i1
  br i1 %246, label %247, label %253

247:                                              ; preds = %244
  %248 = load i32, ptr @cnt, align 4, !tbaa !5
  %249 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %250 = icmp sgt i32 %248, %249
  br i1 %250, label %251, label %253

251:                                              ; preds = %247, %240, %234
  %252 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %277

253:                                              ; preds = %247, %244
  %254 = load i8, ptr @win, align 1, !tbaa !14, !range !17, !noundef !18
  %255 = trunc i8 %254 to i1
  br i1 %255, label %256, label %258

256:                                              ; preds = %253
  %257 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %277

258:                                              ; preds = %253
  %259 = load i8, ptr getelementptr inbounds ([2 x i8], ptr @win, i64 0, i64 1), align 1, !tbaa !14, !range !17, !noundef !18
  %260 = trunc i8 %259 to i1
  br i1 %260, label %261, label %263

261:                                              ; preds = %258
  %262 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %277

263:                                              ; preds = %258
  %264 = load i32, ptr @cnt, align 4, !tbaa !5
  %265 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %266 = add nsw i32 %264, %265
  %267 = icmp eq i32 %266, 9
  br i1 %267, label %268, label %270

268:                                              ; preds = %263
  %269 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  br label %277

270:                                              ; preds = %263
  %271 = load i32, ptr @cnt, align 4, !tbaa !5
  %272 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @cnt, i64 0, i64 1), align 4, !tbaa !5
  %273 = icmp eq i32 %271, %272
  %274 = zext i1 %273 to i64
  %275 = select i1 %273, ptr @.str.5, ptr @.str.6
  %276 = call i32 @puts(ptr noundef %275)
  store i32 0, ptr %1, align 4
  br label %277

277:                                              ; preds = %270, %268, %261, %256, %251, %74
  %278 = load i32, ptr %1, align 4
  ret i32 %278
}

; 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

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 }

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

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


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

@cnt = external dso_local local_unnamed_addr global [2 x i32], align 4
@win = external dso_local local_unnamed_addr global [2 x i8], align 1
@s = external dso_local global [5 x [5 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader77:
  %0 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 5))
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 10))
  %.promoted80 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %cnt.promoted84 = load i32, ptr @cnt, align 4, !tbaa !5
  %3 = load i8, ptr @s, align 16, !tbaa !9
  switch i8 %3, label %8 [
    i8 88, label %4
    i8 48, label %6
  ]

.preheader.preheader:                             ; preds = %58
  switch i8 %3, label %.thread59 [
    i8 88, label %64
    i8 48, label %68
  ]

4:                                                ; preds = %.preheader77
  %5 = add nsw i32 %cnt.promoted84, 1
  store i32 %5, ptr @cnt, align 4, !tbaa !5
  br label %8

6:                                                ; preds = %.preheader77
  %7 = add nsw i32 %.promoted80, 1
  store i32 %7, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %8

8:                                                ; preds = %.preheader77, %4, %6
  %cnt.promoted85 = phi i32 [ %cnt.promoted84, %.preheader77 ], [ %5, %4 ], [ %cnt.promoted84, %6 ]
  %.promoted81 = phi i32 [ %.promoted80, %.preheader77 ], [ %.promoted80, %4 ], [ %7, %6 ]
  %9 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 1), align 1, !tbaa !9
  switch i8 %9, label %14 [
    i8 88, label %12
    i8 48, label %10
  ]

10:                                               ; preds = %8
  %11 = add nsw i32 %.promoted81, 1
  store i32 %11, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %14

12:                                               ; preds = %8
  %13 = add nsw i32 %cnt.promoted85, 1
  store i32 %13, ptr @cnt, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %12, %10, %8
  %cnt.promoted85.1 = phi i32 [ %cnt.promoted85, %8 ], [ %13, %12 ], [ %cnt.promoted85, %10 ]
  %.promoted81.1 = phi i32 [ %.promoted81, %8 ], [ %.promoted81, %12 ], [ %11, %10 ]
  %15 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 2), align 2, !tbaa !9
  switch i8 %15, label %.preheader76.1 [
    i8 88, label %18
    i8 48, label %16
  ]

16:                                               ; preds = %14
  %17 = add nsw i32 %.promoted81.1, 1
  store i32 %17, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %.preheader76.1

18:                                               ; preds = %14
  %19 = add nsw i32 %cnt.promoted85.1, 1
  store i32 %19, ptr @cnt, align 4, !tbaa !5
  br label %.preheader76.1

.preheader76.1:                                   ; preds = %18, %16, %14
  %cnt.promoted85.2 = phi i32 [ %cnt.promoted85.1, %14 ], [ %19, %18 ], [ %cnt.promoted85.1, %16 ]
  %.promoted81.2 = phi i32 [ %.promoted81.1, %14 ], [ %.promoted81.1, %18 ], [ %17, %16 ]
  %20 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 5), align 1, !tbaa !9
  switch i8 %20, label %25 [
    i8 88, label %23
    i8 48, label %21
  ]

21:                                               ; preds = %.preheader76.1
  %22 = add nsw i32 %.promoted81.2, 1
  store i32 %22, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %25

23:                                               ; preds = %.preheader76.1
  %24 = add nsw i32 %cnt.promoted85.2, 1
  store i32 %24, ptr @cnt, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %23, %21, %.preheader76.1
  %cnt.promoted85.195 = phi i32 [ %cnt.promoted85.2, %.preheader76.1 ], [ %24, %23 ], [ %cnt.promoted85.2, %21 ]
  %.promoted81.196 = phi i32 [ %.promoted81.2, %.preheader76.1 ], [ %.promoted81.2, %23 ], [ %22, %21 ]
  %26 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 6), align 2
  switch i8 %26, label %31 [
    i8 88, label %29
    i8 48, label %27
  ]

27:                                               ; preds = %25
  %28 = add nsw i32 %.promoted81.196, 1
  store i32 %28, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %31

29:                                               ; preds = %25
  %30 = add nsw i32 %cnt.promoted85.195, 1
  store i32 %30, ptr @cnt, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %29, %27, %25
  %cnt.promoted85.1.1 = phi i32 [ %cnt.promoted85.195, %25 ], [ %30, %29 ], [ %cnt.promoted85.195, %27 ]
  %.promoted81.1.1 = phi i32 [ %.promoted81.196, %25 ], [ %.promoted81.196, %29 ], [ %28, %27 ]
  %32 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 7), align 1, !tbaa !9
  switch i8 %32, label %.preheader76.2 [
    i8 88, label %35
    i8 48, label %33
  ]

33:                                               ; preds = %31
  %34 = add nsw i32 %.promoted81.1.1, 1
  store i32 %34, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %.preheader76.2

35:                                               ; preds = %31
  %36 = add nsw i32 %cnt.promoted85.1.1, 1
  store i32 %36, ptr @cnt, align 4, !tbaa !5
  br label %.preheader76.2

.preheader76.2:                                   ; preds = %35, %33, %31
  %cnt.promoted85.2.1 = phi i32 [ %cnt.promoted85.1.1, %31 ], [ %36, %35 ], [ %cnt.promoted85.1.1, %33 ]
  %.promoted81.2.1 = phi i32 [ %.promoted81.1.1, %31 ], [ %.promoted81.1.1, %35 ], [ %34, %33 ]
  %37 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 10), align 2
  switch i8 %37, label %42 [
    i8 88, label %40
    i8 48, label %38
  ]

38:                                               ; preds = %.preheader76.2
  %39 = add nsw i32 %.promoted81.2.1, 1
  store i32 %39, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %42

40:                                               ; preds = %.preheader76.2
  %41 = add nsw i32 %cnt.promoted85.2.1, 1
  store i32 %41, ptr @cnt, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %40, %38, %.preheader76.2
  %43 = phi i32 [ %cnt.promoted85.2.1, %.preheader76.2 ], [ %41, %40 ], [ %cnt.promoted85.2.1, %38 ]
  %44 = phi i32 [ %.promoted81.2.1, %.preheader76.2 ], [ %.promoted81.2.1, %40 ], [ %39, %38 ]
  %45 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 11), align 1, !tbaa !9
  switch i8 %45, label %50 [
    i8 88, label %48
    i8 48, label %46
  ]

46:                                               ; preds = %42
  %47 = add nsw i32 %44, 1
  store i32 %47, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %50

48:                                               ; preds = %42
  %49 = add nsw i32 %43, 1
  store i32 %49, ptr @cnt, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %48, %46, %42
  %51 = phi i32 [ %43, %42 ], [ %49, %48 ], [ %43, %46 ]
  %52 = phi i32 [ %44, %42 ], [ %44, %48 ], [ %47, %46 ]
  %53 = load i8, ptr getelementptr inbounds (i8, ptr @s, i64 12), align 4
  switch i8 %53, label %58 [
    i8 88, label %56
    i8 48, label %54
  ]

54:                                               ; preds = %50
  %55 = add nsw i32 %52, 1
  store i32 %55, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  br label %58

56:                                               ; preds = %50
  %57 = add nsw i32 %51, 1
  store i32 %57, ptr @cnt, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %56, %54, %50
  %59 = phi i32 [ %52, %56 ], [ %55, %54 ], [ %52, %50 ]
  %60 = phi i32 [ %57, %56 ], [ %51, %54 ], [ %51, %50 ]
  %61 = icmp slt i32 %60, %59
  %62 = add nsw i32 %59, 1
  %63 = icmp sgt i32 %60, %62
  %or.cond57 = select i1 %61, i1 true, i1 %63
  br i1 %or.cond57, label %.thread70, label %.preheader.preheader

64:                                               ; preds = %.preheader.preheader
  %65 = icmp eq i8 %9, 88
  %66 = icmp eq i8 %15, 88
  %or.cond = and i1 %65, %66
  br i1 %or.cond, label %67, label %.thread.thread

67:                                               ; preds = %64
  store i8 1, ptr @win, align 1, !tbaa !10
  br label %.thread.thread

68:                                               ; preds = %.preheader.preheader
  %69 = icmp eq i8 %9, 48
  %70 = icmp eq i8 %15, 48
  %or.cond106 = and i1 %69, %70
  br i1 %or.cond106, label %71, label %.thread.thread102

71:                                               ; preds = %68
  store i8 1, ptr getelementptr inbounds (i8, ptr @win, i64 1), align 1, !tbaa !10
  br label %.thread.thread102

.thread.thread:                                   ; preds = %67, %64
  switch i8 %20, label %.thread.1 [
    i8 88, label %72
    i8 48, label %.thread59.thread104
  ]

72:                                               ; preds = %.thread.thread
  %73 = icmp eq i8 %37, 88
  br i1 %73, label %74, label %.thread59.thread

74:                                               ; preds = %72
  store i8 1, ptr @win, align 1, !tbaa !10
  br label %.thread59.thread

.thread.thread102:                                ; preds = %68, %71
  switch i8 %20, label %.thread.1 [
    i8 48, label %75
    i8 88, label %.thread59.thread
  ]

75:                                               ; preds = %.thread.thread102
  %76 = icmp eq i8 %37, 48
  br i1 %76, label %77, label %.thread59.thread104

77:                                               ; preds = %75
  store i8 1, ptr getelementptr inbounds (i8, ptr @win, i64 1), align 1, !tbaa !10
  br label %.thread59.thread104

.thread59:                                        ; preds = %.preheader.preheader
  switch i8 %20, label %.thread.1 [
    i8 88, label %.thread59.thread
    i8 48, label %.thread59.thread104
  ]

.thread59.thread104:                              ; preds = %.thread.thread, %77, %75, %.thread59
  %78 = icmp eq i8 %26, 48
  %79 = icmp eq i8 %32, 48
  %or.cond107 = and i1 %78, %79
  br i1 %or.cond107, label %.thread.1.sink.split, label %.thread.1

.thread59.thread:                                 ; preds = %.thread.thread102, %74, %72, %.thread59
  %80 = icmp eq i8 %26, 88
  %81 = icmp eq i8 %32, 88
  %or.cond108 = and i1 %80, %81
  br i1 %or.cond108, label %.thread.1.sink.split, label %.thread.1

.thread.1.sink.split:                             ; preds = %.thread59.thread, %.thread59.thread104
  %win.sink = phi ptr [ getelementptr inbounds (i8, ptr @win, i64 1), %.thread59.thread104 ], [ @win, %.thread59.thread ]
  store i8 1, ptr %win.sink, align 1, !tbaa !10
  br label %.thread.1

.thread.1:                                        ; preds = %.thread.1.sink.split, %.thread.thread, %.thread.thread102, %.thread59.thread, %.thread59.thread104, %.thread59
  switch i8 %9, label %.thread59.1 [
    i8 88, label %85
    i8 48, label %82
  ]

82:                                               ; preds = %.thread.1
  %83 = icmp eq i8 %26, 48
  %84 = icmp eq i8 %45, 48
  %or.cond109 = and i1 %83, %84
  br i1 %or.cond109, label %.thread59.1.sink.split, label %.thread59.1

85:                                               ; preds = %.thread.1
  %86 = icmp eq i8 %26, 88
  %87 = icmp eq i8 %45, 88
  %or.cond110 = and i1 %86, %87
  br i1 %or.cond110, label %.thread59.1.sink.split, label %.thread59.1

.thread59.1.sink.split:                           ; preds = %85, %82
  %win.sink111 = phi ptr [ getelementptr inbounds (i8, ptr @win, i64 1), %82 ], [ @win, %85 ]
  store i8 1, ptr %win.sink111, align 1, !tbaa !10
  br label %.thread59.1

.thread59.1:                                      ; preds = %.thread59.1.sink.split, %85, %82, %.thread.1
  switch i8 %37, label %.thread.2 [
    i8 88, label %91
    i8 48, label %88
  ]

88:                                               ; preds = %.thread59.1
  %89 = icmp eq i8 %45, 48
  %90 = icmp eq i8 %53, 48
  %or.cond112 = and i1 %89, %90
  br i1 %or.cond112, label %.thread.2.sink.split, label %.thread.2

91:                                               ; preds = %.thread59.1
  %92 = icmp eq i8 %45, 88
  %93 = icmp eq i8 %53, 88
  %or.cond113 = and i1 %92, %93
  br i1 %or.cond113, label %.thread.2.sink.split, label %.thread.2

.thread.2.sink.split:                             ; preds = %91, %88
  %win.sink114 = phi ptr [ getelementptr inbounds (i8, ptr @win, i64 1), %88 ], [ @win, %91 ]
  store i8 1, ptr %win.sink114, align 1, !tbaa !10
  br label %.thread.2

.thread.2:                                        ; preds = %.thread.2.sink.split, %91, %88, %.thread59.1
  switch i8 %15, label %.thread59.2 [
    i8 88, label %98
    i8 48, label %94
  ]

94:                                               ; preds = %.thread.2
  %95 = icmp eq i8 %32, 48
  %96 = icmp eq i8 %53, 48
  %or.cond115 = and i1 %95, %96
  br i1 %or.cond115, label %97, label %.thread59.2

97:                                               ; preds = %94
  store i8 1, ptr getelementptr inbounds (i8, ptr @win, i64 1), align 1, !tbaa !10
  br label %.thread59.2.thread

98:                                               ; preds = %.thread.2
  %99 = icmp eq i8 %32, 88
  br i1 %99, label %100, label %.thread59.2

100:                                              ; preds = %98
  %101 = icmp eq i8 %53, 88
  br i1 %101, label %102, label %.thread59.2.thread

102:                                              ; preds = %100
  store i8 1, ptr @win, align 1, !tbaa !10
  br label %.thread59.2

.thread59.2.thread:                               ; preds = %100, %97
  %103 = icmp eq i8 %26, 88
  br label %108

.thread59.2:                                      ; preds = %102, %98, %94, %.thread.2
  %104 = icmp eq i8 %3, 88
  %105 = icmp eq i8 %26, 88
  %106 = icmp eq i8 %53, 88
  %107 = and i1 %104, %106
  %or.cond5 = and i1 %107, %105
  br i1 %or.cond5, label %.thread60, label %108

.thread60:                                        ; preds = %.thread59.2
  store i8 1, ptr @win, align 1, !tbaa !10
  br label %114

108:                                              ; preds = %.thread59.2.thread, %.thread59.2
  %109 = phi i1 [ %103, %.thread59.2.thread ], [ %105, %.thread59.2 ]
  %110 = icmp eq i8 %3, 48
  %111 = icmp eq i8 %26, 48
  %112 = icmp eq i8 %53, 48
  %113 = and i1 %110, %112
  %or.cond11 = and i1 %113, %111
  br i1 %or.cond11, label %.thread63, label %114

.thread63:                                        ; preds = %108
  store i8 1, ptr getelementptr inbounds (i8, ptr @win, i64 1), align 1, !tbaa !10
  br label %120

114:                                              ; preds = %.thread60, %108
  %115 = phi i1 [ %105, %.thread60 ], [ %109, %108 ]
  %116 = phi i1 [ false, %.thread60 ], [ %111, %108 ]
  %117 = icmp eq i8 %15, 88
  %118 = icmp eq i8 %37, 88
  %119 = and i1 %117, %118
  %or.cond17 = and i1 %119, %115
  br i1 %or.cond17, label %.sink.split, label %120

120:                                              ; preds = %.thread63, %114
  %121 = phi i1 [ true, %.thread63 ], [ %116, %114 ]
  %122 = icmp eq i8 %15, 48
  %or.cond20 = and i1 %122, %121
  %123 = icmp eq i8 %37, 48
  %or.cond23 = and i1 %or.cond20, %123
  br i1 %or.cond23, label %.sink.split, label %124

.sink.split:                                      ; preds = %120, %114
  %win.sink116 = phi ptr [ @win, %114 ], [ getelementptr inbounds (i8, ptr @win, i64 1), %120 ]
  store i8 1, ptr %win.sink116, align 1, !tbaa !10
  br label %124

124:                                              ; preds = %.sink.split, %120
  %125 = load i8, ptr @win, align 1, !tbaa !10, !range !12, !noundef !13
  %126 = trunc nuw i8 %125 to i1
  %127 = load i8, ptr getelementptr inbounds (i8, ptr @win, i64 1), align 1, !tbaa !10, !range !12, !noundef !13
  %128 = trunc nuw i8 %127 to i1
  br i1 %126, label %129, label %.thread72

129:                                              ; preds = %124
  %130 = icmp eq i32 %60, %59
  %or.cond75 = or i1 %130, %128
  %spec.select = select i1 %or.cond75, ptr @.str.1, ptr @.str.2
  br label %.thread70

.thread72:                                        ; preds = %124
  br i1 %128, label %.thread73, label %.thread70.thread

.thread73:                                        ; preds = %.thread72
  %131 = icmp sgt i32 %60, %59
  %spec.select117 = select i1 %131, ptr @.str.1, ptr @.str.3
  br label %.thread70

.thread70.thread:                                 ; preds = %.thread72
  %132 = add nsw i32 %59, %60
  %133 = icmp eq i32 %132, 9
  br i1 %133, label %.thread70, label %134

134:                                              ; preds = %.thread70.thread
  %135 = icmp eq i32 %60, %59
  %136 = select i1 %135, ptr @.str.5, ptr @.str.6
  br label %.thread70

.thread70:                                        ; preds = %.thread73, %129, %.thread70.thread, %58, %134
  %.sink = phi ptr [ %136, %134 ], [ @.str.1, %58 ], [ @.str.4, %.thread70.thread ], [ %spec.select, %129 ], [ %spec.select117, %.thread73 ]
  %137 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.sink)
  ret i32 0
}

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

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

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

!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 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}


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