; LLVM IR from tangjz/acm-icpc :: 51nod (1156)

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

@head = external dso_local global ptr, align 8
@cycle = external dso_local global ptr, align 8
@tail = external dso_local global ptr, align 8
@n = external dso_local global i32, align 4
@f = external dso_local global [12 x i32], align 16
@str = external dso_local global [10001 x i8], align 16
@tmp = external dso_local global [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 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 i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n)
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 12
  br i1 %20, label %21, label %170

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

22:                                               ; preds = %147, %21
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = shl i32 1, %24
  %26 = icmp slt i32 %23, %25
  br i1 %26, label %28, label %27

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

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

29:                                               ; preds = %45, %28
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = ashr i32 %35, %36
  %38 = and i32 %37, 1
  %39 = add nsw i32 97, %38
  %40 = trunc i32 %39 to i8
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [13 x i8], ptr @tmp, i64 0, i64 %43
  store i8 %40, ptr %44, align 1, !tbaa !9
  br label %45

45:                                               ; preds = %34
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !5
  br label %29, !llvm.loop !10

48:                                               ; preds = %33
  store i32 0, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %130, %48
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %49
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %56
  store i32 12, ptr %57, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %126, %54
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

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

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

64:                                               ; preds = %93, %63
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = sub nsw i32 %69, %70
  %72 = icmp slt i32 %68, %71
  br i1 %72, label %73, label %90

73:                                               ; preds = %64
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = add nsw i32 %75, %76
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [13 x i8], ptr @tmp, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = sext i8 %80 to i32
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sub nsw i32 %82, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [13 x i8], ptr @tmp, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %81, %88
  br label %90

90:                                               ; preds = %73, %64
  %91 = phi i1 [ false, %64 ], [ %89, %73 ]
  br i1 %91, label %92, label %96

92:                                               ; preds = %90
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !5
  br label %64, !llvm.loop !12

96:                                               ; preds = %90
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = add nsw i32 %98, %99
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sub nsw i32 %101, %102
  %104 = icmp sge i32 %100, %103
  br i1 %104, label %105, label %125

105:                                              ; preds = %96
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = icmp sgt i32 %109, %114
  br i1 %115, label %116, label %125

116:                                              ; preds = %105
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %116, %105, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %8, align 4, !tbaa !5
  br label %58, !llvm.loop !13

129:                                              ; preds = %62
  br label %130

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

133:                                              ; preds = %53
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp slt i32 %134, %138
  br i1 %139, label %140, label %146

140:                                              ; preds = %133
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  store i32 %144, ptr %2, align 4, !tbaa !5
  %145 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %145, ptr %3, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %140, %133
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %4, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !15

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

151:                                              ; preds = %166, %150
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %169

156:                                              ; preds = %151
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = ashr i32 %157, %158
  %160 = and i32 %159, 1
  %161 = add nsw i32 97, %160
  %162 = trunc i32 %161 to i8
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %164
  store i8 %162, ptr %165, align 1, !tbaa !9
  br label %166

166:                                              ; preds = %156
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %10, align 4, !tbaa !5
  br label %151, !llvm.loop !16

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

170:                                              ; preds = %0
  %171 = load i32, ptr @n, align 4, !tbaa !5
  %172 = srem i32 %171, 6
  %173 = icmp eq i32 %172, 2
  br i1 %173, label %174, label %239

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

175:                                              ; preds = %188, %174
  %176 = load i32, ptr %11, align 4, !tbaa !5
  %177 = icmp slt i32 %176, 5
  br i1 %177, label %179, label %178

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

179:                                              ; preds = %175
  %180 = load ptr, ptr @head, align 8, !tbaa !17
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i8, ptr %180, i64 %182
  %184 = load i8, ptr %183, align 1, !tbaa !9
  %185 = load i32, ptr %11, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %186
  store i8 %184, ptr %187, align 1, !tbaa !9
  br label %188

188:                                              ; preds = %179
  %189 = load i32, ptr %11, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %11, align 4, !tbaa !5
  br label %175, !llvm.loop !19

191:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 5, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %216, %191
  %193 = load i32, ptr %12, align 4, !tbaa !5
  %194 = add nsw i32 %193, 9
  %195 = load i32, ptr @n, align 4, !tbaa !5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %192
  store i32 23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %218

198:                                              ; preds = %192
  %199 = load ptr, ptr @cycle, align 8, !tbaa !17
  %200 = load i32, ptr %13, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i8, ptr %199, i64 %201
  %203 = load i8, ptr %202, align 1, !tbaa !9
  %204 = load i32, ptr %12, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %205
  store i8 %203, ptr %206, align 1, !tbaa !9
  br label %207

207:                                              ; preds = %198
  %208 = load i32, ptr %12, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %12, align 4, !tbaa !5
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = icmp slt i32 %210, 5
  br i1 %211, label %212, label %215

212:                                              ; preds = %207
  %213 = load i32, ptr %13, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %13, align 4, !tbaa !5
  br label %216

215:                                              ; preds = %207
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %215, %212
  %217 = phi ptr [ %13, %212 ], [ %13, %215 ]
  br label %192, !llvm.loop !20

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

219:                                              ; preds = %235, %218
  %220 = load i32, ptr %14, align 4, !tbaa !5
  %221 = icmp slt i32 %220, 9
  br i1 %221, label %223, label %222

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

223:                                              ; preds = %219
  %224 = load ptr, ptr @tail, align 8, !tbaa !17
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i8, ptr %224, i64 %226
  %228 = load i8, ptr %227, align 1, !tbaa !9
  %229 = load i32, ptr @n, align 4, !tbaa !5
  %230 = sub nsw i32 %229, 9
  %231 = load i32, ptr %14, align 4, !tbaa !5
  %232 = add nsw i32 %230, %231
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %233
  store i8 %228, ptr %234, align 1, !tbaa !9
  br label %235

235:                                              ; preds = %223
  %236 = load i32, ptr %14, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %14, align 4, !tbaa !5
  br label %219, !llvm.loop !21

238:                                              ; preds = %222
  br label %283

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

240:                                              ; preds = %253, %239
  %241 = load i32, ptr %15, align 4, !tbaa !5
  %242 = icmp slt i32 %241, 5
  br i1 %242, label %244, label %243

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

244:                                              ; preds = %240
  %245 = load ptr, ptr @head, align 8, !tbaa !17
  %246 = load i32, ptr %15, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds i8, ptr %245, i64 %247
  %249 = load i8, ptr %248, align 1, !tbaa !9
  %250 = load i32, ptr %15, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %251
  store i8 %249, ptr %252, align 1, !tbaa !9
  br label %253

253:                                              ; preds = %244
  %254 = load i32, ptr %15, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %15, align 4, !tbaa !5
  br label %240, !llvm.loop !22

256:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 5, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %280, %256
  %258 = load i32, ptr %16, align 4, !tbaa !5
  %259 = load i32, ptr @n, align 4, !tbaa !5
  %260 = icmp slt i32 %258, %259
  br i1 %260, label %262, label %261

261:                                              ; preds = %257
  store i32 32, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %282

262:                                              ; preds = %257
  %263 = load ptr, ptr @cycle, align 8, !tbaa !17
  %264 = load i32, ptr %17, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds i8, ptr %263, i64 %265
  %267 = load i8, ptr %266, align 1, !tbaa !9
  %268 = load i32, ptr %16, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %269
  store i8 %267, ptr %270, align 1, !tbaa !9
  br label %271

271:                                              ; preds = %262
  %272 = load i32, ptr %16, align 4, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %16, align 4, !tbaa !5
  %274 = load i32, ptr %17, align 4, !tbaa !5
  %275 = icmp slt i32 %274, 5
  br i1 %275, label %276, label %279

276:                                              ; preds = %271
  %277 = load i32, ptr %17, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %17, align 4, !tbaa !5
  br label %280

279:                                              ; preds = %271
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %280

280:                                              ; preds = %279, %276
  %281 = phi ptr [ %17, %276 ], [ %17, %279 ]
  br label %257, !llvm.loop !23

282:                                              ; preds = %261
  br label %283

283:                                              ; preds = %282, %238
  br label %284

284:                                              ; preds = %283, %169
  %285 = load i32, ptr @n, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %286
  store i8 0, ptr %287, align 1, !tbaa !9
  %288 = call i32 @puts(ptr noundef @str)
  ret i32 0
}

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

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

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

declare i32 @puts(ptr noundef) #1

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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!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 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !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"

@head = external dso_local local_unnamed_addr global ptr, align 8
@cycle = external dso_local local_unnamed_addr global ptr, align 8
@tail = external dso_local local_unnamed_addr global ptr, align 8
@n = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [12 x i32], align 16
@str = external dso_local global [10001 x i8], align 16
@tmp = external dso_local local_unnamed_addr global [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 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.3, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp slt i32 %2, 12
  br i1 %3, label %.preheader87.lr.ph, label %172

.preheader87.lr.ph:                               ; preds = %0
  %4 = shl nuw nsw i32 1, %2
  %5 = icmp sgt i32 %2, 0
  %.not110 = icmp slt i32 %2, 1
  %6 = sext i32 %2 to i64
  %7 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %6
  %8 = add nsw i32 %2, 1
  %wide.trip.count140 = zext i32 %2 to i64
  %wide.trip.count153 = zext i32 %8 to i64
  %n.rnd.up = add nuw nsw i64 %wide.trip.count140, 1
  %n.vec = and i64 %n.rnd.up, 4294967294
  %trip.count.minus.1 = add nsw i64 %wide.trip.count140, -1
  %broadcast.splatinsert163 = insertelement <2 x i64> poison, i64 %trip.count.minus.1, i64 0
  %broadcast.splat164 = shufflevector <2 x i64> %broadcast.splatinsert163, <2 x i64> poison, <2 x i32> zeroinitializer
  %9 = icmp uge <2 x i64> %broadcast.splat164, <i64 0, i64 1>
  %10 = extractelement <2 x i1> %9, i64 0
  %11 = extractelement <2 x i1> %9, i64 1
  %12 = icmp eq i64 %n.vec, 2
  %13 = icmp ugt <2 x i64> %broadcast.splat164, <i64 1, i64 2>
  %14 = extractelement <2 x i1> %13, i64 0
  %15 = extractelement <2 x i1> %13, i64 1
  %16 = icmp eq i64 %n.vec, 4
  %17 = icmp ugt <2 x i64> %broadcast.splat164, <i64 3, i64 4>
  %18 = extractelement <2 x i1> %17, i64 0
  %19 = extractelement <2 x i1> %17, i64 1
  %20 = icmp eq i64 %n.vec, 6
  %21 = icmp ugt <2 x i64> %broadcast.splat164, <i64 5, i64 6>
  %22 = extractelement <2 x i1> %21, i64 0
  %23 = extractelement <2 x i1> %21, i64 1
  %24 = icmp eq i64 %n.vec, 8
  %25 = icmp ugt <2 x i64> %broadcast.splat164, <i64 7, i64 8>
  %26 = extractelement <2 x i1> %25, i64 0
  %27 = extractelement <2 x i1> %25, i64 1
  %28 = icmp eq i64 %n.vec, 10
  %29 = icmp ugt <2 x i64> %broadcast.splat164, <i64 9, i64 10>
  %30 = extractelement <2 x i1> %29, i64 0
  %31 = extractelement <2 x i1> %29, i64 1
  br label %.preheader87

.preheader87:                                     ; preds = %.preheader87.lr.ph, %._crit_edge114
  %.073117 = phi i32 [ 0, %.preheader87.lr.ph ], [ %150, %._crit_edge114 ]
  %.074116 = phi i32 [ -1, %.preheader87.lr.ph ], [ %spec.select85, %._crit_edge114 ]
  %.076115 = phi i32 [ 0, %.preheader87.lr.ph ], [ %spec.select, %._crit_edge114 ]
  br i1 %5, label %vector.body, label %._crit_edge.thread

vector.body:                                      ; preds = %.preheader87
  br i1 %10, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %32 = trunc i32 %.073117 to i8
  %33 = and i8 %32, 1
  %34 = add nuw nsw i8 %33, 97
  store i8 %34, ptr getelementptr inbounds (i8, ptr @tmp, i64 1), align 1, !tbaa !9
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  br i1 %11, label %pred.store.if165, label %pred.store.continue166

pred.store.if165:                                 ; preds = %pred.store.continue
  %35 = trunc i32 %.073117 to i8
  %36 = lshr i8 %35, 1
  %37 = and i8 %36, 1
  %38 = add nuw nsw i8 %37, 97
  store i8 %38, ptr getelementptr inbounds (i8, ptr @tmp, i64 2), align 1, !tbaa !9
  br label %pred.store.continue166

pred.store.continue166:                           ; preds = %pred.store.if165, %pred.store.continue
  br i1 %12, label %._crit_edge, label %vector.body.1, !llvm.loop !10

vector.body.1:                                    ; preds = %pred.store.continue166
  br i1 %14, label %pred.store.if.1, label %pred.store.continue.1

pred.store.if.1:                                  ; preds = %vector.body.1
  %39 = trunc i32 %.073117 to i8
  %40 = lshr i8 %39, 2
  %41 = and i8 %40, 1
  %42 = add nuw nsw i8 %41, 97
  store i8 %42, ptr getelementptr inbounds (i8, ptr @tmp, i64 3), align 1, !tbaa !9
  br label %pred.store.continue.1

pred.store.continue.1:                            ; preds = %pred.store.if.1, %vector.body.1
  br i1 %15, label %pred.store.if165.1, label %pred.store.continue166.1

pred.store.if165.1:                               ; preds = %pred.store.continue.1
  %43 = trunc i32 %.073117 to i8
  %44 = lshr i8 %43, 3
  %45 = and i8 %44, 1
  %46 = add nuw nsw i8 %45, 97
  store i8 %46, ptr getelementptr inbounds (i8, ptr @tmp, i64 4), align 1, !tbaa !9
  br label %pred.store.continue166.1

pred.store.continue166.1:                         ; preds = %pred.store.if165.1, %pred.store.continue.1
  br i1 %16, label %._crit_edge, label %vector.body.2, !llvm.loop !10

vector.body.2:                                    ; preds = %pred.store.continue166.1
  br i1 %18, label %pred.store.if.2, label %pred.store.continue.2

pred.store.if.2:                                  ; preds = %vector.body.2
  %47 = trunc i32 %.073117 to i8
  %48 = lshr i8 %47, 4
  %49 = and i8 %48, 1
  %50 = add nuw nsw i8 %49, 97
  store i8 %50, ptr getelementptr inbounds (i8, ptr @tmp, i64 5), align 1, !tbaa !9
  br label %pred.store.continue.2

pred.store.continue.2:                            ; preds = %pred.store.if.2, %vector.body.2
  br i1 %19, label %pred.store.if165.2, label %pred.store.continue166.2

pred.store.if165.2:                               ; preds = %pred.store.continue.2
  %51 = trunc i32 %.073117 to i8
  %52 = lshr i8 %51, 5
  %53 = and i8 %52, 1
  %54 = add nuw nsw i8 %53, 97
  store i8 %54, ptr getelementptr inbounds (i8, ptr @tmp, i64 6), align 1, !tbaa !9
  br label %pred.store.continue166.2

pred.store.continue166.2:                         ; preds = %pred.store.if165.2, %pred.store.continue.2
  br i1 %20, label %._crit_edge, label %vector.body.3, !llvm.loop !10

vector.body.3:                                    ; preds = %pred.store.continue166.2
  br i1 %22, label %pred.store.if.3, label %pred.store.continue.3

pred.store.if.3:                                  ; preds = %vector.body.3
  %55 = trunc i32 %.073117 to i8
  %56 = lshr i8 %55, 6
  %57 = and i8 %56, 1
  %58 = add nuw nsw i8 %57, 97
  store i8 %58, ptr getelementptr inbounds (i8, ptr @tmp, i64 7), align 1, !tbaa !9
  br label %pred.store.continue.3

pred.store.continue.3:                            ; preds = %pred.store.if.3, %vector.body.3
  br i1 %23, label %pred.store.if165.3, label %pred.store.continue166.3

pred.store.if165.3:                               ; preds = %pred.store.continue.3
  %59 = trunc i32 %.073117 to i8
  %60 = lshr i8 %59, 7
  %61 = add nuw nsw i8 %60, 97
  store i8 %61, ptr getelementptr inbounds (i8, ptr @tmp, i64 8), align 1, !tbaa !9
  br label %pred.store.continue166.3

pred.store.continue166.3:                         ; preds = %pred.store.if165.3, %pred.store.continue.3
  br i1 %24, label %._crit_edge, label %vector.body.4, !llvm.loop !10

vector.body.4:                                    ; preds = %pred.store.continue166.3
  br i1 %26, label %pred.store.if.4, label %pred.store.continue.4

pred.store.if.4:                                  ; preds = %vector.body.4
  %62 = lshr i32 %.073117, 8
  %63 = trunc i32 %62 to i8
  %64 = and i8 %63, 1
  %65 = add nuw nsw i8 %64, 97
  store i8 %65, ptr getelementptr inbounds (i8, ptr @tmp, i64 9), align 1, !tbaa !9
  br label %pred.store.continue.4

pred.store.continue.4:                            ; preds = %pred.store.if.4, %vector.body.4
  br i1 %27, label %pred.store.if165.4, label %pred.store.continue166.4

pred.store.if165.4:                               ; preds = %pred.store.continue.4
  %66 = lshr i32 %.073117, 9
  %67 = trunc i32 %66 to i8
  %68 = and i8 %67, 1
  %69 = add nuw nsw i8 %68, 97
  store i8 %69, ptr getelementptr inbounds (i8, ptr @tmp, i64 10), align 1, !tbaa !9
  br label %pred.store.continue166.4

pred.store.continue166.4:                         ; preds = %pred.store.if165.4, %pred.store.continue.4
  br i1 %28, label %._crit_edge, label %vector.body.5, !llvm.loop !10

vector.body.5:                                    ; preds = %pred.store.continue166.4
  br i1 %30, label %pred.store.if.5, label %pred.store.continue.5

pred.store.if.5:                                  ; preds = %vector.body.5
  %70 = lshr i32 %.073117, 10
  %71 = trunc i32 %70 to i8
  %72 = and i8 %71, 1
  %73 = add nuw nsw i8 %72, 97
  store i8 %73, ptr getelementptr inbounds (i8, ptr @tmp, i64 11), align 1, !tbaa !9
  br label %pred.store.continue.5

pred.store.continue.5:                            ; preds = %pred.store.if.5, %vector.body.5
  br i1 %31, label %pred.store.if165.5, label %._crit_edge

pred.store.if165.5:                               ; preds = %pred.store.continue.5
  %74 = lshr i32 %.073117, 11
  %75 = trunc i32 %74 to i8
  %76 = and i8 %75, 1
  %77 = add nuw nsw i8 %76, 97
  store i8 %77, ptr getelementptr inbounds (i8, ptr @tmp, i64 12), align 1, !tbaa !9
  br label %._crit_edge

._crit_edge.thread:                               ; preds = %.preheader87
  store i32 0, ptr @f, align 16, !tbaa !5
  br label %._crit_edge114

.preheader:                                       ; preds = %._crit_edge114
  %78 = icmp sgt i32 %2, 0
  br i1 %78, label %vector.ph169, label %.loopexit

vector.ph169:                                     ; preds = %.preheader
  %n.rnd.up170 = add nuw nsw i64 %wide.trip.count140, 1
  %n.vec172 = and i64 %n.rnd.up170, 4294967294
  %trip.count.minus.1174 = add nsw i64 %wide.trip.count140, -1
  %broadcast.splatinsert177 = insertelement <2 x i64> poison, i64 %trip.count.minus.1174, i64 0
  %broadcast.splat178 = shufflevector <2 x i64> %broadcast.splatinsert177, <2 x i64> poison, <2 x i32> zeroinitializer
  %79 = icmp uge <2 x i64> %broadcast.splat178, <i64 0, i64 1>
  %80 = extractelement <2 x i1> %79, i64 0
  br i1 %80, label %pred.store.if179, label %pred.store.continue180

pred.store.if179:                                 ; preds = %vector.ph169
  %81 = trunc i32 %spec.select85 to i8
  %82 = and i8 %81, 1
  %83 = add nuw nsw i8 %82, 97
  store i8 %83, ptr @str, align 16, !tbaa !9
  br label %pred.store.continue180

pred.store.continue180:                           ; preds = %pred.store.if179, %vector.ph169
  %84 = extractelement <2 x i1> %79, i64 1
  br i1 %84, label %pred.store.if181, label %pred.store.continue182

pred.store.if181:                                 ; preds = %pred.store.continue180
  %85 = trunc i32 %spec.select85 to i8
  %86 = lshr i8 %85, 1
  %87 = and i8 %86, 1
  %88 = add nuw nsw i8 %87, 97
  store i8 %88, ptr getelementptr inbounds (i8, ptr @str, i64 1), align 1, !tbaa !9
  br label %pred.store.continue182

pred.store.continue182:                           ; preds = %pred.store.if181, %pred.store.continue180
  %89 = icmp eq i64 %n.vec172, 2
  br i1 %89, label %.loopexit, label %vector.body175.1, !llvm.loop !14

vector.body175.1:                                 ; preds = %pred.store.continue182
  %90 = icmp ugt <2 x i64> %broadcast.splat178, <i64 1, i64 2>
  %91 = extractelement <2 x i1> %90, i64 0
  br i1 %91, label %pred.store.if179.1, label %pred.store.continue180.1

pred.store.if179.1:                               ; preds = %vector.body175.1
  %92 = trunc i32 %spec.select85 to i8
  %93 = lshr i8 %92, 2
  %94 = and i8 %93, 1
  %95 = add nuw nsw i8 %94, 97
  store i8 %95, ptr getelementptr inbounds (i8, ptr @str, i64 2), align 2, !tbaa !9
  br label %pred.store.continue180.1

pred.store.continue180.1:                         ; preds = %pred.store.if179.1, %vector.body175.1
  %96 = extractelement <2 x i1> %90, i64 1
  br i1 %96, label %pred.store.if181.1, label %pred.store.continue182.1

pred.store.if181.1:                               ; preds = %pred.store.continue180.1
  %97 = trunc i32 %spec.select85 to i8
  %98 = lshr i8 %97, 3
  %99 = and i8 %98, 1
  %100 = add nuw nsw i8 %99, 97
  store i8 %100, ptr getelementptr inbounds (i8, ptr @str, i64 3), align 1, !tbaa !9
  br label %pred.store.continue182.1

pred.store.continue182.1:                         ; preds = %pred.store.if181.1, %pred.store.continue180.1
  %101 = icmp eq i64 %n.vec172, 4
  br i1 %101, label %.loopexit, label %vector.body175.2, !llvm.loop !14

vector.body175.2:                                 ; preds = %pred.store.continue182.1
  %102 = icmp ugt <2 x i64> %broadcast.splat178, <i64 3, i64 4>
  %103 = extractelement <2 x i1> %102, i64 0
  br i1 %103, label %pred.store.if179.2, label %pred.store.continue180.2

pred.store.if179.2:                               ; preds = %vector.body175.2
  %104 = trunc i32 %spec.select85 to i8
  %105 = lshr i8 %104, 4
  %106 = and i8 %105, 1
  %107 = add nuw nsw i8 %106, 97
  store i8 %107, ptr getelementptr inbounds (i8, ptr @str, i64 4), align 4, !tbaa !9
  br label %pred.store.continue180.2

pred.store.continue180.2:                         ; preds = %pred.store.if179.2, %vector.body175.2
  %108 = extractelement <2 x i1> %102, i64 1
  br i1 %108, label %pred.store.if181.2, label %pred.store.continue182.2

pred.store.if181.2:                               ; preds = %pred.store.continue180.2
  %109 = trunc i32 %spec.select85 to i8
  %110 = lshr i8 %109, 5
  %111 = and i8 %110, 1
  %112 = add nuw nsw i8 %111, 97
  store i8 %112, ptr getelementptr inbounds (i8, ptr @str, i64 5), align 1, !tbaa !9
  br label %pred.store.continue182.2

pred.store.continue182.2:                         ; preds = %pred.store.if181.2, %pred.store.continue180.2
  %113 = icmp eq i64 %n.vec172, 6
  br i1 %113, label %.loopexit, label %vector.body175.3, !llvm.loop !14

vector.body175.3:                                 ; preds = %pred.store.continue182.2
  %114 = icmp ugt <2 x i64> %broadcast.splat178, <i64 5, i64 6>
  %115 = extractelement <2 x i1> %114, i64 0
  br i1 %115, label %pred.store.if179.3, label %pred.store.continue180.3

pred.store.if179.3:                               ; preds = %vector.body175.3
  %116 = trunc i32 %spec.select85 to i8
  %117 = lshr i8 %116, 6
  %118 = and i8 %117, 1
  %119 = add nuw nsw i8 %118, 97
  store i8 %119, ptr getelementptr inbounds (i8, ptr @str, i64 6), align 2, !tbaa !9
  br label %pred.store.continue180.3

pred.store.continue180.3:                         ; preds = %pred.store.if179.3, %vector.body175.3
  %120 = extractelement <2 x i1> %114, i64 1
  br i1 %120, label %pred.store.if181.3, label %pred.store.continue182.3

pred.store.if181.3:                               ; preds = %pred.store.continue180.3
  %121 = trunc i32 %spec.select85 to i8
  %122 = lshr i8 %121, 7
  %123 = add nuw nsw i8 %122, 97
  store i8 %123, ptr getelementptr inbounds (i8, ptr @str, i64 7), align 1, !tbaa !9
  br label %pred.store.continue182.3

pred.store.continue182.3:                         ; preds = %pred.store.if181.3, %pred.store.continue180.3
  %124 = icmp eq i64 %n.vec172, 8
  br i1 %124, label %.loopexit, label %vector.body175.4, !llvm.loop !14

vector.body175.4:                                 ; preds = %pred.store.continue182.3
  %125 = icmp ugt <2 x i64> %broadcast.splat178, <i64 7, i64 8>
  %126 = extractelement <2 x i1> %125, i64 0
  br i1 %126, label %pred.store.if179.4, label %pred.store.continue180.4

pred.store.if179.4:                               ; preds = %vector.body175.4
  %127 = lshr i32 %spec.select85, 8
  %128 = trunc i32 %127 to i8
  %129 = and i8 %128, 1
  %130 = add nuw nsw i8 %129, 97
  store i8 %130, ptr getelementptr inbounds (i8, ptr @str, i64 8), align 8, !tbaa !9
  br label %pred.store.continue180.4

pred.store.continue180.4:                         ; preds = %pred.store.if179.4, %vector.body175.4
  %131 = extractelement <2 x i1> %125, i64 1
  br i1 %131, label %pred.store.if181.4, label %pred.store.continue182.4

pred.store.if181.4:                               ; preds = %pred.store.continue180.4
  %132 = lshr i32 %spec.select85, 9
  %133 = trunc i32 %132 to i8
  %134 = and i8 %133, 1
  %135 = add nuw nsw i8 %134, 97
  store i8 %135, ptr getelementptr inbounds (i8, ptr @str, i64 9), align 1, !tbaa !9
  br label %pred.store.continue182.4

pred.store.continue182.4:                         ; preds = %pred.store.if181.4, %pred.store.continue180.4
  %136 = icmp eq i64 %n.vec172, 10
  br i1 %136, label %.loopexit, label %vector.body175.5, !llvm.loop !14

vector.body175.5:                                 ; preds = %pred.store.continue182.4
  %137 = icmp ugt <2 x i64> %broadcast.splat178, <i64 9, i64 10>
  %138 = extractelement <2 x i1> %137, i64 0
  br i1 %138, label %pred.store.if179.5, label %pred.store.continue180.5

pred.store.if179.5:                               ; preds = %vector.body175.5
  %139 = lshr i32 %spec.select85, 10
  %140 = trunc i32 %139 to i8
  %141 = and i8 %140, 1
  %142 = add nuw nsw i8 %141, 97
  store i8 %142, ptr getelementptr inbounds (i8, ptr @str, i64 10), align 2, !tbaa !9
  br label %pred.store.continue180.5

pred.store.continue180.5:                         ; preds = %pred.store.if179.5, %vector.body175.5
  %143 = extractelement <2 x i1> %137, i64 1
  br i1 %143, label %pred.store.if181.5, label %.loopexit

pred.store.if181.5:                               ; preds = %pred.store.continue180.5
  %144 = lshr i32 %spec.select85, 11
  %145 = trunc i32 %144 to i8
  %146 = and i8 %145, 1
  %147 = add nuw nsw i8 %146, 97
  store i8 %147, ptr getelementptr inbounds (i8, ptr @str, i64 11), align 1, !tbaa !9
  br label %.loopexit

._crit_edge:                                      ; preds = %pred.store.continue.5, %pred.store.if165.5, %pred.store.continue166.4, %pred.store.continue166.3, %pred.store.continue166.2, %pred.store.continue166.1, %pred.store.continue166
  store i32 0, ptr @f, align 16, !tbaa !5
  br i1 %.not110, label %._crit_edge114, label %.lr.ph113

._crit_edge114:                                   ; preds = %154, %._crit_edge.thread, %._crit_edge
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = icmp slt i32 %.076115, %148
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.076115, i32 %148)
  %spec.select85 = select i1 %149, i32 %.073117, i32 %.074116
  %150 = add nuw nsw i32 %.073117, 1
  %exitcond155.not = icmp eq i32 %150, %4
  br i1 %exitcond155.not, label %.preheader, label %.preheader87, !llvm.loop !15

.lr.ph113:                                        ; preds = %._crit_edge, %154
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %154 ], [ 1, %._crit_edge ]
  %151 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %indvars.iv150
  store i32 12, ptr %151, align 4, !tbaa !5
  br label %.preheader86

.preheader86:                                     ; preds = %.lr.ph113, %.critedge.thread
  %152 = phi i32 [ 12, %.lr.ph113 ], [ %171, %.critedge.thread ]
  %indvars.iv145 = phi i64 [ 0, %.lr.ph113 ], [ %indvars.iv.next146, %.critedge.thread ]
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %153 = icmp ult i64 %indvars.iv.next146, %indvars.iv150
  br i1 %153, label %.lr.ph108, label %.critedge

154:                                              ; preds = %.critedge.thread
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %._crit_edge114, label %.lr.ph113, !llvm.loop !16

155:                                              ; preds = %.lr.ph108
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %156 = add nuw nsw i64 %indvars.iv.next143, %indvars.iv.next146
  %157 = sub nuw nsw i64 %indvars.iv150, %indvars.iv.next143
  %158 = icmp ult i64 %156, %157
  br i1 %158, label %.lr.ph108, label %.critedge, !llvm.loop !17

.lr.ph108:                                        ; preds = %.preheader86, %155
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %155 ], [ 0, %.preheader86 ]
  %.in = phi i64 [ %157, %155 ], [ %indvars.iv150, %.preheader86 ]
  %159 = add nuw nsw i64 %indvars.iv142, %indvars.iv.next146
  %160 = getelementptr inbounds [13 x i8], ptr @tmp, i64 0, i64 %159
  %161 = load i8, ptr %160, align 1, !tbaa !9
  %sext = shl i64 %.in, 32
  %162 = ashr exact i64 %sext, 32
  %163 = getelementptr inbounds [13 x i8], ptr @tmp, i64 0, i64 %162
  %164 = load i8, ptr %163, align 1, !tbaa !9
  %165 = icmp eq i8 %161, %164
  br i1 %165, label %155, label %.critedge.thread

.critedge:                                        ; preds = %155, %.preheader86
  %166 = getelementptr inbounds [12 x i32], ptr @f, i64 0, i64 %indvars.iv145
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  %169 = icmp sgt i32 %152, %168
  br i1 %169, label %170, label %.critedge.thread

170:                                              ; preds = %.critedge
  store i32 %168, ptr %151, align 4, !tbaa !5
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.lr.ph108, %170, %.critedge
  %171 = phi i32 [ %168, %170 ], [ %152, %.critedge ], [ %152, %.lr.ph108 ]
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %indvars.iv150
  br i1 %exitcond149.not, label %154, label %.preheader86, !llvm.loop !18

172:                                              ; preds = %0
  %173 = urem i32 %2, 6
  %174 = icmp eq i32 %173, 2
  %175 = load ptr, ptr @head, align 8, !tbaa !19
  %176 = load <4 x i8>, ptr %175, align 1, !tbaa !9
  store <4 x i8> %176, ptr @str, align 16, !tbaa !9
  %177 = getelementptr inbounds i8, ptr %175, i64 4
  %178 = load i8, ptr %177, align 1, !tbaa !9
  store i8 %178, ptr getelementptr inbounds (i8, ptr @str, i64 4), align 4, !tbaa !9
  br i1 %174, label %.preheader92, label %.lr.ph

.preheader92:                                     ; preds = %172
  %179 = icmp ugt i32 %2, 14
  br i1 %179, label %.lr.ph103, label %.preheader92..preheader89_crit_edge

.preheader92..preheader89_crit_edge:              ; preds = %.preheader92
  %.pre = add nsw i32 %2, -9
  br label %.preheader89

.lr.ph103:                                        ; preds = %.preheader92
  %180 = load ptr, ptr @cycle, align 8, !tbaa !19
  %181 = add nsw i32 %2, -9
  %182 = zext nneg i32 %2 to i64
  %xtraiter186 = and i64 %182, 1
  %183 = icmp eq i32 %181, 6
  br i1 %183, label %.preheader89.loopexit.unr-lcssa, label %.lr.ph103.new

.lr.ph103.new:                                    ; preds = %.lr.ph103
  %184 = and i64 %182, 2147483646
  %185 = add nsw i64 %184, -16
  br label %226

.preheader89.loopexit.unr-lcssa.loopexit:         ; preds = %226
  %186 = sext i32 %.165.1 to i64
  br label %.preheader89.loopexit.unr-lcssa

.preheader89.loopexit.unr-lcssa:                  ; preds = %.preheader89.loopexit.unr-lcssa.loopexit, %.lr.ph103
  %indvars.iv128.unr = phi i64 [ 5, %.lr.ph103 ], [ %indvars.iv.next129.1, %.preheader89.loopexit.unr-lcssa.loopexit ]
  %.064102.unr = phi i64 [ 0, %.lr.ph103 ], [ %186, %.preheader89.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod187.not = icmp eq i64 %xtraiter186, 0
  br i1 %lcmp.mod187.not, label %.preheader89, label %.preheader89.loopexit.epilog-lcssa

.preheader89.loopexit.epilog-lcssa:               ; preds = %.preheader89.loopexit.unr-lcssa
  %187 = getelementptr inbounds i8, ptr %180, i64 %.064102.unr
  %188 = load i8, ptr %187, align 1, !tbaa !9
  %189 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv128.unr
  store i8 %188, ptr %189, align 1, !tbaa !9
  br label %.preheader89

.preheader89:                                     ; preds = %.preheader89.loopexit.epilog-lcssa, %.preheader89.loopexit.unr-lcssa, %.preheader92..preheader89_crit_edge
  %.pre-phi = phi i32 [ %.pre, %.preheader92..preheader89_crit_edge ], [ %181, %.preheader89.loopexit.unr-lcssa ], [ %181, %.preheader89.loopexit.epilog-lcssa ]
  %190 = load ptr, ptr @tail, align 8, !tbaa !19
  %191 = sext i32 %.pre-phi to i64
  %192 = load i8, ptr %190, align 1, !tbaa !9
  %193 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %191
  store i8 %192, ptr %193, align 1, !tbaa !9
  %194 = getelementptr inbounds i8, ptr %190, i64 1
  %195 = load i8, ptr %194, align 1, !tbaa !9
  %196 = add nsw i64 %191, 1
  %197 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %196
  store i8 %195, ptr %197, align 1, !tbaa !9
  %198 = getelementptr inbounds i8, ptr %190, i64 2
  %199 = load i8, ptr %198, align 1, !tbaa !9
  %200 = add nsw i64 %191, 2
  %201 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %200
  store i8 %199, ptr %201, align 1, !tbaa !9
  %202 = getelementptr inbounds i8, ptr %190, i64 3
  %203 = load i8, ptr %202, align 1, !tbaa !9
  %204 = add nsw i64 %191, 3
  %205 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %204
  store i8 %203, ptr %205, align 1, !tbaa !9
  %206 = getelementptr inbounds i8, ptr %190, i64 4
  %207 = load i8, ptr %206, align 1, !tbaa !9
  %208 = add nsw i64 %191, 4
  %209 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %208
  store i8 %207, ptr %209, align 1, !tbaa !9
  %210 = getelementptr inbounds i8, ptr %190, i64 5
  %211 = load i8, ptr %210, align 1, !tbaa !9
  %212 = add nsw i64 %191, 5
  %213 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %212
  store i8 %211, ptr %213, align 1, !tbaa !9
  %214 = getelementptr inbounds i8, ptr %190, i64 6
  %215 = load i8, ptr %214, align 1, !tbaa !9
  %216 = add nsw i64 %191, 6
  %217 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %216
  store i8 %215, ptr %217, align 1, !tbaa !9
  %218 = getelementptr inbounds i8, ptr %190, i64 7
  %219 = load i8, ptr %218, align 1, !tbaa !9
  %220 = add nsw i64 %191, 7
  %221 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %220
  store i8 %219, ptr %221, align 1, !tbaa !9
  %222 = getelementptr inbounds i8, ptr %190, i64 8
  %223 = load i8, ptr %222, align 1, !tbaa !9
  %224 = add nsw i64 %191, 8
  %225 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %224
  store i8 %223, ptr %225, align 1, !tbaa !9
  br label %.loopexit

226:                                              ; preds = %226, %.lr.ph103.new
  %indvars.iv128 = phi i64 [ 5, %.lr.ph103.new ], [ %indvars.iv.next129.1, %226 ]
  %.064102 = phi i32 [ 0, %.lr.ph103.new ], [ %.165.1, %226 ]
  %niter189 = phi i64 [ 0, %.lr.ph103.new ], [ %niter189.next.1, %226 ]
  %227 = sext i32 %.064102 to i64
  %228 = getelementptr inbounds i8, ptr %180, i64 %227
  %229 = load i8, ptr %228, align 1, !tbaa !9
  %230 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv128
  store i8 %229, ptr %230, align 1, !tbaa !9
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %231 = icmp slt i32 %.064102, 5
  %232 = add nsw i32 %.064102, 1
  %.165 = select i1 %231, i32 %232, i32 0
  %233 = sext i32 %.165 to i64
  %234 = getelementptr inbounds i8, ptr %180, i64 %233
  %235 = load i8, ptr %234, align 1, !tbaa !9
  %236 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.next129
  store i8 %235, ptr %236, align 1, !tbaa !9
  %indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
  %237 = icmp slt i32 %.165, 5
  %238 = add nsw i32 %.165, 1
  %.165.1 = select i1 %237, i32 %238, i32 0
  %niter189.next.1 = add i64 %niter189, 2
  %niter189.ncmp.1 = icmp eq i64 %niter189, %185
  br i1 %niter189.ncmp.1, label %.preheader89.loopexit.unr-lcssa.loopexit, label %226, !llvm.loop !21

.lr.ph:                                           ; preds = %172
  %239 = load ptr, ptr @cycle, align 8, !tbaa !19
  %wide.trip.count = zext nneg i32 %2 to i64
  %240 = add nsw i64 %wide.trip.count, -5
  %xtraiter = and i64 %240, 1
  %unroll_iter = and i64 %240, -2
  br label %241

241:                                              ; preds = %241, %.lr.ph
  %indvars.iv = phi i64 [ 5, %.lr.ph ], [ %indvars.iv.next.1, %241 ]
  %.099 = phi i32 [ 0, %.lr.ph ], [ %.1.1, %241 ]
  %niter = phi i64 [ 0, %.lr.ph ], [ %niter.next.1, %241 ]
  %242 = sext i32 %.099 to i64
  %243 = getelementptr inbounds i8, ptr %239, i64 %242
  %244 = load i8, ptr %243, align 1, !tbaa !9
  %245 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv
  store i8 %244, ptr %245, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %246 = icmp slt i32 %.099, 5
  %247 = add nsw i32 %.099, 1
  %.1 = select i1 %246, i32 %247, i32 0
  %248 = sext i32 %.1 to i64
  %249 = getelementptr inbounds i8, ptr %239, i64 %248
  %250 = load i8, ptr %249, align 1, !tbaa !9
  %251 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.next
  store i8 %250, ptr %251, align 1, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %252 = icmp slt i32 %.1, 5
  %253 = add nsw i32 %.1, 1
  %.1.1 = select i1 %252, i32 %253, i32 0
  %niter.next.1 = add nuw nsw i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit184.unr-lcssa.loopexit, label %241, !llvm.loop !22

.loopexit.loopexit184.unr-lcssa.loopexit:         ; preds = %241
  %254 = sext i32 %.1.1 to i64
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.loopexit.loopexit184.epilog-lcssa

.loopexit.loopexit184.epilog-lcssa:               ; preds = %.loopexit.loopexit184.unr-lcssa.loopexit
  %255 = getelementptr inbounds i8, ptr %239, i64 %254
  %256 = load i8, ptr %255, align 1, !tbaa !9
  %257 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.next.1
  store i8 %256, ptr %257, align 1, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit184.epilog-lcssa, %.loopexit.loopexit184.unr-lcssa.loopexit, %pred.store.continue182, %pred.store.continue182.1, %pred.store.continue182.2, %pred.store.continue182.3, %pred.store.continue182.4, %pred.store.if181.5, %pred.store.continue180.5, %.preheader89, %.preheader
  %258 = sext i32 %2 to i64
  %259 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %258
  store i8 0, ptr %259, align 1, !tbaa !9
  %260 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @str)
  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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}


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