; LLVM IR from tangjz/acm-icpc :: lydsy (1087)

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

@n = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local global [10 x [82 x [512 x i64]]], align 16
@cnt = external dso_local global [512 x i64], align 16
@ans = external dso_local global i64, align 8
@check1 = external dso_local global [512 x i8], align 16
@check2 = external dso_local global [512 x [512 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @K)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = shl i32 1, %7
  %9 = sub nsw i32 %8, 1
  store i32 %9, ptr @m, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %42, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %14, label %45

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = ashr i32 %16, 1
  %18 = and i32 %15, %17
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %41, label %20

20:                                               ; preds = %14
  %21 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %21, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %34, %20
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %37

25:                                               ; preds = %22
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = and i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = add nsw i64 %32, %28
  store i64 %33, ptr %31, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %25
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = ashr i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !11

37:                                               ; preds = %22
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %39
  store i8 1, ptr %40, align 1, !tbaa !13
  br label %41

41:                                               ; preds = %37, %14
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !15

45:                                               ; preds = %10
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %98, %45
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %50, label %101

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !13, !range !16, !noundef !17
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %97

56:                                               ; preds = %50
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %93, %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %61, label %96

61:                                               ; preds = %57
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %63
  %65 = getelementptr inbounds [512 x i8], ptr %64, i64 0, i64 0
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %92

67:                                               ; preds = %61
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = and i32 %68, %69
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %91

72:                                               ; preds = %67
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = ashr i32 %74, 1
  %76 = and i32 %73, %75
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %91

78:                                               ; preds = %72
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = ashr i32 %80, 1
  %82 = and i32 %79, %81
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %91

84:                                               ; preds = %78
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %86
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [512 x i8], ptr %87, i64 0, i64 %89
  store i8 1, ptr %90, align 1, !tbaa !13
  br label %91

91:                                               ; preds = %84, %78, %72, %67
  br label %92

92:                                               ; preds = %91, %61
  br label %93

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

96:                                               ; preds = %57
  br label %97

97:                                               ; preds = %96, %50
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %2, align 4, !tbaa !5
  br label %46, !llvm.loop !19

101:                                              ; preds = %46
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %122, %101
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = load i32, ptr @m, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %106, label %125

106:                                              ; preds = %102
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !13, !range !16, !noundef !17
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %121

112:                                              ; preds = %106
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds [82 x [512 x i64]], ptr getelementptr inbounds ([10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 1), i64 0, i64 %116
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [512 x i64], ptr %117, i64 0, i64 %119
  store i64 1, ptr %120, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %112, %106
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %2, align 4, !tbaa !5
  br label %102, !llvm.loop !20

125:                                              ; preds = %102
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %221, %125
  %127 = load i32, ptr %2, align 4, !tbaa !5
  %128 = load i32, ptr @n, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %130, label %224

130:                                              ; preds = %126
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %217, %130
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = load i32, ptr @m, align 4, !tbaa !5
  %134 = icmp sle i32 %132, %133
  br i1 %134, label %135, label %220

135:                                              ; preds = %131
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !13, !range !16, !noundef !17
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %216

141:                                              ; preds = %135
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %212, %141
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = load i32, ptr @m, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %146, label %215

146:                                              ; preds = %142
  %147 = load i32, ptr %4, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !13, !range !16, !noundef !17
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %211

152:                                              ; preds = %146
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %154
  %156 = load i32, ptr %4, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [512 x i8], ptr %155, i64 0, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !13, !range !16, !noundef !17
  %160 = trunc i8 %159 to i1
  br i1 %160, label %161, label %210

161:                                              ; preds = %152
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !9
  %166 = trunc i64 %165 to i32
  store i32 %166, ptr %5, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %206, %161
  %168 = load i32, ptr %5, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = load i32, ptr %4, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !9
  %174 = add nsw i64 %169, %173
  %175 = load i32, ptr @K, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = icmp sle i64 %174, %176
  br i1 %177, label %178, label %209

178:                                              ; preds = %167
  %179 = load i32, ptr %2, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %180
  %182 = load i32, ptr %5, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [82 x [512 x i64]], ptr %181, i64 0, i64 %183
  %185 = load i32, ptr %3, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [512 x i64], ptr %184, i64 0, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !9
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %191
  %193 = load i32, ptr %5, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = load i32, ptr %4, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !9
  %199 = add nsw i64 %194, %198
  %200 = getelementptr inbounds [82 x [512 x i64]], ptr %192, i64 0, i64 %199
  %201 = load i32, ptr %4, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [512 x i64], ptr %200, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !9
  %205 = add nsw i64 %204, %188
  store i64 %205, ptr %203, align 8, !tbaa !9
  br label %206

206:                                              ; preds = %178
  %207 = load i32, ptr %5, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %5, align 4, !tbaa !5
  br label %167, !llvm.loop !21

209:                                              ; preds = %167
  br label %210

210:                                              ; preds = %209, %152
  br label %211

211:                                              ; preds = %210, %146
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %4, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %4, align 4, !tbaa !5
  br label %142, !llvm.loop !22

215:                                              ; preds = %142
  br label %216

216:                                              ; preds = %215, %135
  br label %217

217:                                              ; preds = %216
  %218 = load i32, ptr %3, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %3, align 4, !tbaa !5
  br label %131, !llvm.loop !23

220:                                              ; preds = %131
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %2, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %2, align 4, !tbaa !5
  br label %126, !llvm.loop !24

224:                                              ; preds = %126
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %242, %224
  %226 = load i32, ptr %2, align 4, !tbaa !5
  %227 = load i32, ptr @m, align 4, !tbaa !5
  %228 = icmp sle i32 %226, %227
  br i1 %228, label %229, label %245

229:                                              ; preds = %225
  %230 = load i32, ptr @n, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %231
  %233 = load i32, ptr @K, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [82 x [512 x i64]], ptr %232, i64 0, i64 %234
  %236 = load i32, ptr %2, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [512 x i64], ptr %235, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !9
  %240 = load i64, ptr @ans, align 8, !tbaa !9
  %241 = add nsw i64 %240, %239
  store i64 %241, ptr @ans, align 8, !tbaa !9
  br label %242

242:                                              ; preds = %229
  %243 = load i32, ptr %2, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %2, align 4, !tbaa !5
  br label %225, !llvm.loop !25

245:                                              ; preds = %225
  %246 = load i64, ptr @ans, align 8, !tbaa !9
  %247 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %246)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  ret i32 0
}

; 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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [10 x [82 x [512 x i64]]], align 16
@cnt = external dso_local local_unnamed_addr global [512 x i64], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@check1 = external dso_local local_unnamed_addr global [512 x i8], align 16
@check2 = external dso_local local_unnamed_addr global [512 x [512 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @K)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %notmask = shl nsw i32 -1, %2
  %3 = xor i32 %notmask, -1
  store i32 %3, ptr @m, align 4, !tbaa !5
  %4 = sub i32 0, %notmask
  %wide.trip.count = zext i32 %4 to i64
  br label %5

5:                                                ; preds = %0, %18
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %18 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = lshr i32 %6, 1
  %8 = and i32 %7, %6
  %.not66 = icmp eq i32 %8, 0
  br i1 %.not66, label %.preheader76, label %18

.preheader76:                                     ; preds = %5
  %.not6777 = icmp eq i64 %indvars.iv, 0
  br i1 %.not6777, label %16, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader76
  %9 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv
  %.promoted = load i64, ptr %9, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %.lr.ph, %10
  %11 = phi i64 [ %.promoted, %.lr.ph ], [ %14, %10 ]
  %.05378 = phi i32 [ %6, %.lr.ph ], [ %15, %10 ]
  %12 = and i32 %.05378, 1
  %13 = zext nneg i32 %12 to i64
  %14 = add nsw i64 %11, %13
  %15 = lshr i32 %.05378, 1
  %.not67 = icmp ult i32 %.05378, 2
  br i1 %.not67, label %._crit_edge, label %10, !llvm.loop !11

._crit_edge:                                      ; preds = %10
  store i64 %14, ptr %9, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %._crit_edge, %.preheader76
  %17 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv
  store i8 1, ptr %17, align 1, !tbaa !13
  br label %18

18:                                               ; preds = %5, %16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader75.preheader, label %5, !llvm.loop !15

.preheader75.preheader:                           ; preds = %18
  %min.iters.check = icmp ult i32 %4, 8
  %min.iters.check136 = icmp ult i32 %4, 16
  %n.vec = and i64 %wide.trip.count, 4294967280
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %n.vec.remaining = and i64 %wide.trip.count, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  %n.vec170 = and i64 %wide.trip.count, 4294967288
  %cmp.n196 = icmp eq i64 %n.vec170, %wide.trip.count
  br label %.preheader75

.preheader75:                                     ; preds = %.preheader75.preheader, %.loopexit74
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.loopexit74 ], [ 0, %.preheader75.preheader ]
  %19 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv100
  %20 = load i8, ptr %19, align 1, !tbaa !13, !range !16, !noundef !17
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %iter.check, label %.loopexit74

iter.check:                                       ; preds = %.preheader75
  %22 = trunc nuw nsw i64 %indvars.iv100 to i32
  %23 = lshr i32 %22, 1
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  br i1 %min.iters.check136, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %broadcast.splatinsert = insertelement <16 x i32> poison, i32 %22, i64 0
  %broadcast.splat = shufflevector <16 x i32> %broadcast.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
  %broadcast.splatinsert137 = insertelement <16 x i32> poison, i32 %23, i64 0
  %broadcast.splat138 = shufflevector <16 x i32> %broadcast.splatinsert137, <16 x i32> poison, <16 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue168, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue168 ]
  %vec.ind = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph ], [ %vec.ind.next, %pred.store.continue168 ]
  %24 = and <16 x i32> %vec.ind, %broadcast.splat
  %25 = icmp eq <16 x i32> %24, zeroinitializer
  %26 = lshr <16 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %27 = and <16 x i32> %26, %broadcast.splat
  %28 = and <16 x i32> %broadcast.splat138, %vec.ind
  %29 = or <16 x i32> %27, %28
  %30 = icmp eq <16 x i32> %29, zeroinitializer
  %31 = select <16 x i1> %25, <16 x i1> %30, <16 x i1> zeroinitializer
  %32 = extractelement <16 x i1> %31, i64 0
  br i1 %32, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %33 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %index
  store i8 1, ptr %33, align 16, !tbaa !13
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %34 = extractelement <16 x i1> %31, i64 1
  br i1 %34, label %pred.store.if139, label %pred.store.continue140

pred.store.if139:                                 ; preds = %pred.store.continue
  %35 = or disjoint i64 %index, 1
  %36 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %35
  store i8 1, ptr %36, align 1, !tbaa !13
  br label %pred.store.continue140

pred.store.continue140:                           ; preds = %pred.store.if139, %pred.store.continue
  %37 = extractelement <16 x i1> %31, i64 2
  br i1 %37, label %pred.store.if141, label %pred.store.continue142

pred.store.if141:                                 ; preds = %pred.store.continue140
  %38 = or disjoint i64 %index, 2
  %39 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %38
  store i8 1, ptr %39, align 2, !tbaa !13
  br label %pred.store.continue142

pred.store.continue142:                           ; preds = %pred.store.if141, %pred.store.continue140
  %40 = extractelement <16 x i1> %31, i64 3
  br i1 %40, label %pred.store.if143, label %pred.store.continue144

pred.store.if143:                                 ; preds = %pred.store.continue142
  %41 = or disjoint i64 %index, 3
  %42 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %41
  store i8 1, ptr %42, align 1, !tbaa !13
  br label %pred.store.continue144

pred.store.continue144:                           ; preds = %pred.store.if143, %pred.store.continue142
  %43 = extractelement <16 x i1> %31, i64 4
  br i1 %43, label %pred.store.if145, label %pred.store.continue146

pred.store.if145:                                 ; preds = %pred.store.continue144
  %44 = or disjoint i64 %index, 4
  %45 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %44
  store i8 1, ptr %45, align 4, !tbaa !13
  br label %pred.store.continue146

pred.store.continue146:                           ; preds = %pred.store.if145, %pred.store.continue144
  %46 = extractelement <16 x i1> %31, i64 5
  br i1 %46, label %pred.store.if147, label %pred.store.continue148

pred.store.if147:                                 ; preds = %pred.store.continue146
  %47 = or disjoint i64 %index, 5
  %48 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %47
  store i8 1, ptr %48, align 1, !tbaa !13
  br label %pred.store.continue148

pred.store.continue148:                           ; preds = %pred.store.if147, %pred.store.continue146
  %49 = extractelement <16 x i1> %31, i64 6
  br i1 %49, label %pred.store.if149, label %pred.store.continue150

pred.store.if149:                                 ; preds = %pred.store.continue148
  %50 = or disjoint i64 %index, 6
  %51 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %50
  store i8 1, ptr %51, align 2, !tbaa !13
  br label %pred.store.continue150

pred.store.continue150:                           ; preds = %pred.store.if149, %pred.store.continue148
  %52 = extractelement <16 x i1> %31, i64 7
  br i1 %52, label %pred.store.if151, label %pred.store.continue152

pred.store.if151:                                 ; preds = %pred.store.continue150
  %53 = or disjoint i64 %index, 7
  %54 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %53
  store i8 1, ptr %54, align 1, !tbaa !13
  br label %pred.store.continue152

pred.store.continue152:                           ; preds = %pred.store.if151, %pred.store.continue150
  %55 = extractelement <16 x i1> %31, i64 8
  br i1 %55, label %pred.store.if153, label %pred.store.continue154

pred.store.if153:                                 ; preds = %pred.store.continue152
  %56 = or disjoint i64 %index, 8
  %57 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %56
  store i8 1, ptr %57, align 8, !tbaa !13
  br label %pred.store.continue154

pred.store.continue154:                           ; preds = %pred.store.if153, %pred.store.continue152
  %58 = extractelement <16 x i1> %31, i64 9
  br i1 %58, label %pred.store.if155, label %pred.store.continue156

pred.store.if155:                                 ; preds = %pred.store.continue154
  %59 = or disjoint i64 %index, 9
  %60 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %59
  store i8 1, ptr %60, align 1, !tbaa !13
  br label %pred.store.continue156

pred.store.continue156:                           ; preds = %pred.store.if155, %pred.store.continue154
  %61 = extractelement <16 x i1> %31, i64 10
  br i1 %61, label %pred.store.if157, label %pred.store.continue158

pred.store.if157:                                 ; preds = %pred.store.continue156
  %62 = or disjoint i64 %index, 10
  %63 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %62
  store i8 1, ptr %63, align 2, !tbaa !13
  br label %pred.store.continue158

pred.store.continue158:                           ; preds = %pred.store.if157, %pred.store.continue156
  %64 = extractelement <16 x i1> %31, i64 11
  br i1 %64, label %pred.store.if159, label %pred.store.continue160

pred.store.if159:                                 ; preds = %pred.store.continue158
  %65 = or disjoint i64 %index, 11
  %66 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %65
  store i8 1, ptr %66, align 1, !tbaa !13
  br label %pred.store.continue160

pred.store.continue160:                           ; preds = %pred.store.if159, %pred.store.continue158
  %67 = extractelement <16 x i1> %31, i64 12
  br i1 %67, label %pred.store.if161, label %pred.store.continue162

pred.store.if161:                                 ; preds = %pred.store.continue160
  %68 = or disjoint i64 %index, 12
  %69 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %68
  store i8 1, ptr %69, align 4, !tbaa !13
  br label %pred.store.continue162

pred.store.continue162:                           ; preds = %pred.store.if161, %pred.store.continue160
  %70 = extractelement <16 x i1> %31, i64 13
  br i1 %70, label %pred.store.if163, label %pred.store.continue164

pred.store.if163:                                 ; preds = %pred.store.continue162
  %71 = or disjoint i64 %index, 13
  %72 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %71
  store i8 1, ptr %72, align 1, !tbaa !13
  br label %pred.store.continue164

pred.store.continue164:                           ; preds = %pred.store.if163, %pred.store.continue162
  %73 = extractelement <16 x i1> %31, i64 14
  br i1 %73, label %pred.store.if165, label %pred.store.continue166

pred.store.if165:                                 ; preds = %pred.store.continue164
  %74 = or disjoint i64 %index, 14
  %75 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %74
  store i8 1, ptr %75, align 2, !tbaa !13
  br label %pred.store.continue166

pred.store.continue166:                           ; preds = %pred.store.if165, %pred.store.continue164
  %76 = extractelement <16 x i1> %31, i64 15
  br i1 %76, label %pred.store.if167, label %pred.store.continue168

pred.store.if167:                                 ; preds = %pred.store.continue166
  %77 = or disjoint i64 %index, 15
  %78 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %77
  store i8 1, ptr %78, align 1, !tbaa !13
  br label %pred.store.continue168

pred.store.continue168:                           ; preds = %pred.store.if167, %pred.store.continue166
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <16 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %79 = icmp eq i64 %index.next, %n.vec
  br i1 %79, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %pred.store.continue168
  br i1 %cmp.n, label %.loopexit74, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  br i1 %min.epilog.iters.check.not.not, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %80 = trunc nuw i64 %vec.epilog.resume.val to i32
  %.splatinsert = insertelement <8 x i32> poison, i32 %80, i64 0
  %.splat = shufflevector <8 x i32> %.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer
  %induction = or disjoint <8 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %broadcast.splatinsert175 = insertelement <8 x i32> poison, i32 %22, i64 0
  %broadcast.splat176 = shufflevector <8 x i32> %broadcast.splatinsert175, <8 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert177 = insertelement <8 x i32> poison, i32 %23, i64 0
  %broadcast.splat178 = shufflevector <8 x i32> %broadcast.splatinsert177, <8 x i32> poison, <8 x i32> zeroinitializer
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %pred.store.continue194, %vec.epilog.ph
  %index172 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next195, %pred.store.continue194 ]
  %vec.ind173 = phi <8 x i32> [ %induction, %vec.epilog.ph ], [ %vec.ind.next174, %pred.store.continue194 ]
  %81 = and <8 x i32> %vec.ind173, %broadcast.splat176
  %82 = icmp eq <8 x i32> %81, zeroinitializer
  %83 = lshr <8 x i32> %vec.ind173, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %84 = and <8 x i32> %83, %broadcast.splat176
  %85 = and <8 x i32> %broadcast.splat178, %vec.ind173
  %86 = or <8 x i32> %84, %85
  %87 = icmp eq <8 x i32> %86, zeroinitializer
  %88 = select <8 x i1> %82, <8 x i1> %87, <8 x i1> zeroinitializer
  %89 = extractelement <8 x i1> %88, i64 0
  br i1 %89, label %pred.store.if179, label %pred.store.continue180

pred.store.if179:                                 ; preds = %vec.epilog.vector.body
  %90 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %index172
  store i8 1, ptr %90, align 8, !tbaa !13
  br label %pred.store.continue180

pred.store.continue180:                           ; preds = %pred.store.if179, %vec.epilog.vector.body
  %91 = extractelement <8 x i1> %88, i64 1
  br i1 %91, label %pred.store.if181, label %pred.store.continue182

pred.store.if181:                                 ; preds = %pred.store.continue180
  %92 = or disjoint i64 %index172, 1
  %93 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %92
  store i8 1, ptr %93, align 1, !tbaa !13
  br label %pred.store.continue182

pred.store.continue182:                           ; preds = %pred.store.if181, %pred.store.continue180
  %94 = extractelement <8 x i1> %88, i64 2
  br i1 %94, label %pred.store.if183, label %pred.store.continue184

pred.store.if183:                                 ; preds = %pred.store.continue182
  %95 = or disjoint i64 %index172, 2
  %96 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %95
  store i8 1, ptr %96, align 2, !tbaa !13
  br label %pred.store.continue184

pred.store.continue184:                           ; preds = %pred.store.if183, %pred.store.continue182
  %97 = extractelement <8 x i1> %88, i64 3
  br i1 %97, label %pred.store.if185, label %pred.store.continue186

pred.store.if185:                                 ; preds = %pred.store.continue184
  %98 = or disjoint i64 %index172, 3
  %99 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %98
  store i8 1, ptr %99, align 1, !tbaa !13
  br label %pred.store.continue186

pred.store.continue186:                           ; preds = %pred.store.if185, %pred.store.continue184
  %100 = extractelement <8 x i1> %88, i64 4
  br i1 %100, label %pred.store.if187, label %pred.store.continue188

pred.store.if187:                                 ; preds = %pred.store.continue186
  %101 = or disjoint i64 %index172, 4
  %102 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %101
  store i8 1, ptr %102, align 4, !tbaa !13
  br label %pred.store.continue188

pred.store.continue188:                           ; preds = %pred.store.if187, %pred.store.continue186
  %103 = extractelement <8 x i1> %88, i64 5
  br i1 %103, label %pred.store.if189, label %pred.store.continue190

pred.store.if189:                                 ; preds = %pred.store.continue188
  %104 = or disjoint i64 %index172, 5
  %105 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %104
  store i8 1, ptr %105, align 1, !tbaa !13
  br label %pred.store.continue190

pred.store.continue190:                           ; preds = %pred.store.if189, %pred.store.continue188
  %106 = extractelement <8 x i1> %88, i64 6
  br i1 %106, label %pred.store.if191, label %pred.store.continue192

pred.store.if191:                                 ; preds = %pred.store.continue190
  %107 = or disjoint i64 %index172, 6
  %108 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %107
  store i8 1, ptr %108, align 2, !tbaa !13
  br label %pred.store.continue192

pred.store.continue192:                           ; preds = %pred.store.if191, %pred.store.continue190
  %109 = extractelement <8 x i1> %88, i64 7
  br i1 %109, label %pred.store.if193, label %pred.store.continue194

pred.store.if193:                                 ; preds = %pred.store.continue192
  %110 = or disjoint i64 %index172, 7
  %111 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %110
  store i8 1, ptr %111, align 1, !tbaa !13
  br label %pred.store.continue194

pred.store.continue194:                           ; preds = %pred.store.if193, %pred.store.continue192
  %index.next195 = add nuw i64 %index172, 8
  %vec.ind.next174 = add <8 x i32> %vec.ind173, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
  %112 = icmp eq i64 %index.next195, %n.vec170
  br i1 %112, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !21

vec.epilog.middle.block:                          ; preds = %pred.store.continue194
  br i1 %cmp.n196, label %.loopexit74, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv95.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec170, %vec.epilog.middle.block ]
  br label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.preheader, %123
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %123 ], [ %indvars.iv95.ph, %vec.epilog.scalar.ph.preheader ]
  %113 = trunc nuw nsw i64 %indvars.iv95 to i32
  %114 = and i32 %113, %22
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %vec.epilog.scalar.ph
  %117 = lshr i32 %113, 1
  %118 = and i32 %117, %22
  %119 = and i32 %23, %113
  %120 = or i32 %118, %119
  %or.cond = icmp eq i32 %120, 0
  br i1 %or.cond, label %121, label %123

121:                                              ; preds = %116
  %122 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv100, i64 %indvars.iv95
  store i8 1, ptr %122, align 1, !tbaa !13
  br label %123

123:                                              ; preds = %121, %116, %vec.epilog.scalar.ph
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count
  br i1 %exitcond99.not, label %.loopexit74, label %vec.epilog.scalar.ph, !llvm.loop !22

.loopexit74:                                      ; preds = %123, %middle.block, %vec.epilog.middle.block, %.preheader75
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count
  br i1 %exitcond104.not, label %.preheader72.preheader, label %.preheader75, !llvm.loop !23

.preheader72.preheader:                           ; preds = %.loopexit74
  %xtraiter = and i64 %wide.trip.count, 1
  %124 = icmp eq i32 %2, 0
  br i1 %124, label %.preheader71.unr-lcssa, label %.preheader72.preheader.new

.preheader72.preheader.new:                       ; preds = %.preheader72.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %.preheader72

.preheader71.unr-lcssa:                           ; preds = %148, %.preheader72.preheader
  %indvars.iv105.unr = phi i64 [ 0, %.preheader72.preheader ], [ %indvars.iv.next106.1, %148 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader71, label %.preheader72.epil

.preheader72.epil:                                ; preds = %.preheader71.unr-lcssa
  %125 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv105.unr
  %126 = load i8, ptr %125, align 1, !tbaa !13, !range !16, !noundef !17
  %127 = trunc nuw i8 %126 to i1
  br i1 %127, label %128, label %.preheader71

128:                                              ; preds = %.preheader72.epil
  %129 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv105.unr
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds [82 x [512 x i64]], ptr getelementptr inbounds (i8, ptr @f, i64 335872), i64 0, i64 %130, i64 %indvars.iv105.unr
  store i64 1, ptr %131, align 8, !tbaa !9
  br label %.preheader71

.preheader71:                                     ; preds = %.preheader72.epil, %128, %.preheader71.unr-lcssa
  %132 = icmp sgt i32 %2, 1
  %.pre = load i32, ptr @K, align 4
  %133 = sext i32 %.pre to i64
  br i1 %132, label %.preheader70.lr.ph, label %.preheader

.preheader70.lr.ph:                               ; preds = %.preheader71
  %wide.trip.count126 = zext nneg i32 %2 to i64
  br label %.preheader70

.preheader72:                                     ; preds = %148, %.preheader72.preheader.new
  %indvars.iv105 = phi i64 [ 0, %.preheader72.preheader.new ], [ %indvars.iv.next106.1, %148 ]
  %niter = phi i64 [ 0, %.preheader72.preheader.new ], [ %niter.next.1, %148 ]
  %134 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv105
  %135 = load i8, ptr %134, align 2, !tbaa !13, !range !16, !noundef !17
  %136 = trunc nuw i8 %135 to i1
  br i1 %136, label %137, label %.preheader72.1

137:                                              ; preds = %.preheader72
  %138 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv105
  %139 = load i64, ptr %138, align 16, !tbaa !9
  %140 = getelementptr inbounds [82 x [512 x i64]], ptr getelementptr inbounds (i8, ptr @f, i64 335872), i64 0, i64 %139, i64 %indvars.iv105
  store i64 1, ptr %140, align 16, !tbaa !9
  br label %.preheader72.1

.preheader72.1:                                   ; preds = %.preheader72, %137
  %indvars.iv.next106 = or disjoint i64 %indvars.iv105, 1
  %141 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv.next106
  %142 = load i8, ptr %141, align 1, !tbaa !13, !range !16, !noundef !17
  %143 = trunc nuw i8 %142 to i1
  br i1 %143, label %144, label %148

144:                                              ; preds = %.preheader72.1
  %145 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv.next106
  %146 = load i64, ptr %145, align 8, !tbaa !9
  %147 = getelementptr inbounds [82 x [512 x i64]], ptr getelementptr inbounds (i8, ptr @f, i64 335872), i64 0, i64 %146, i64 %indvars.iv.next106
  store i64 1, ptr %147, align 8, !tbaa !9
  br label %148

148:                                              ; preds = %144, %.preheader72.1
  %indvars.iv.next106.1 = add nuw nsw i64 %indvars.iv105, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader71.unr-lcssa, label %.preheader72, !llvm.loop !24

.preheader70:                                     ; preds = %.preheader70.lr.ph, %183
  %indvars.iv123 = phi i64 [ 1, %.preheader70.lr.ph ], [ %indvars.iv.next124, %183 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  br label %157

.preheader:                                       ; preds = %183, %.preheader71
  %149 = sext i32 %2 to i64
  %ans.promoted = load i64, ptr @ans, align 8, !tbaa !9
  %min.iters.check198 = icmp ult i32 %4, 4
  br i1 %min.iters.check198, label %scalar.ph.preheader, label %vector.ph199

scalar.ph.preheader:                              ; preds = %middle.block197, %.preheader
  %indvars.iv128.ph = phi i64 [ 0, %.preheader ], [ %n.vec201, %middle.block197 ]
  %.ph = phi i64 [ %ans.promoted, %.preheader ], [ %156, %middle.block197 ]
  br label %scalar.ph

vector.ph199:                                     ; preds = %.preheader
  %n.vec201 = and i64 %wide.trip.count, 4294967292
  %150 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %ans.promoted, i64 0
  br label %vector.body203

vector.body203:                                   ; preds = %vector.body203, %vector.ph199
  %index204 = phi i64 [ 0, %vector.ph199 ], [ %index.next207, %vector.body203 ]
  %vec.phi = phi <2 x i64> [ %150, %vector.ph199 ], [ %153, %vector.body203 ]
  %vec.phi205 = phi <2 x i64> [ zeroinitializer, %vector.ph199 ], [ %154, %vector.body203 ]
  %151 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %149, i64 %133, i64 %index204
  %152 = getelementptr inbounds i8, ptr %151, i64 16
  %wide.load = load <2 x i64>, ptr %151, align 16, !tbaa !9
  %wide.load206 = load <2 x i64>, ptr %152, align 16, !tbaa !9
  %153 = add <2 x i64> %vec.phi, %wide.load
  %154 = add <2 x i64> %vec.phi205, %wide.load206
  %index.next207 = add nuw i64 %index204, 4
  %155 = icmp eq i64 %index.next207, %n.vec201
  br i1 %155, label %middle.block197, label %vector.body203, !llvm.loop !25

middle.block197:                                  ; preds = %vector.body203
  %bin.rdx = add <2 x i64> %154, %153
  %156 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n208 = icmp eq i64 %n.vec201, %wide.trip.count
  br i1 %cmp.n208, label %.loopexit209, label %scalar.ph.preheader

157:                                              ; preds = %.preheader70, %.loopexit69
  %indvars.iv118 = phi i64 [ 0, %.preheader70 ], [ %indvars.iv.next119, %.loopexit69 ]
  %158 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv118
  %159 = load i8, ptr %158, align 1, !tbaa !13, !range !16, !noundef !17
  %160 = trunc nuw i8 %159 to i1
  br i1 %160, label %.preheader68, label %.loopexit69

.preheader68:                                     ; preds = %157
  %161 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv118
  br label %162

162:                                              ; preds = %.preheader68, %.loopexit
  %indvars.iv113 = phi i64 [ 0, %.preheader68 ], [ %indvars.iv.next114, %.loopexit ]
  %163 = getelementptr inbounds [512 x i8], ptr @check1, i64 0, i64 %indvars.iv113
  %164 = load i8, ptr %163, align 1, !tbaa !13, !range !16, !noundef !17
  %165 = trunc nuw i8 %164 to i1
  br i1 %165, label %166, label %.loopexit

166:                                              ; preds = %162
  %167 = getelementptr inbounds [512 x [512 x i8]], ptr @check2, i64 0, i64 %indvars.iv118, i64 %indvars.iv113
  %168 = load i8, ptr %167, align 1, !tbaa !13, !range !16, !noundef !17
  %169 = trunc nuw i8 %168 to i1
  br i1 %169, label %170, label %.loopexit

170:                                              ; preds = %166
  %171 = load i64, ptr %161, align 8, !tbaa !9
  %172 = getelementptr inbounds [512 x i64], ptr @cnt, i64 0, i64 %indvars.iv113
  %173 = load i64, ptr %172, align 8, !tbaa !9
  %sext = shl i64 %171, 32
  %174 = ashr exact i64 %sext, 32
  %175 = add nsw i64 %173, %174
  %.not6483 = icmp sgt i64 %175, %133
  br i1 %.not6483, label %.loopexit, label %.lr.ph86

.lr.ph86:                                         ; preds = %170, %.lr.ph86
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %.lr.ph86 ], [ %174, %170 ]
  %176 = phi i64 [ %182, %.lr.ph86 ], [ %175, %170 ]
  %177 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %indvars.iv123, i64 %indvars.iv110, i64 %indvars.iv118
  %178 = load i64, ptr %177, align 8, !tbaa !9
  %179 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %indvars.iv.next124, i64 %176, i64 %indvars.iv113
  %180 = load i64, ptr %179, align 8, !tbaa !9
  %181 = add nsw i64 %180, %178
  store i64 %181, ptr %179, align 8, !tbaa !9
  %indvars.iv.next111 = add nsw i64 %indvars.iv110, 1
  %182 = add nsw i64 %173, %indvars.iv.next111
  %.not64 = icmp sgt i64 %182, %133
  br i1 %.not64, label %.loopexit, label %.lr.ph86, !llvm.loop !26

.loopexit:                                        ; preds = %.lr.ph86, %170, %162, %166
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count
  br i1 %exitcond117.not, label %.loopexit69, label %162, !llvm.loop !27

.loopexit69:                                      ; preds = %.loopexit, %157
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count
  br i1 %exitcond122.not, label %183, label %157, !llvm.loop !28

183:                                              ; preds = %.loopexit69
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %.preheader, label %.preheader70, !llvm.loop !29

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %scalar.ph ], [ %indvars.iv128.ph, %scalar.ph.preheader ]
  %184 = phi i64 [ %187, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %185 = getelementptr inbounds [10 x [82 x [512 x i64]]], ptr @f, i64 0, i64 %149, i64 %133, i64 %indvars.iv128
  %186 = load i64, ptr %185, align 8, !tbaa !9
  %187 = add nsw i64 %184, %186
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count
  br i1 %exitcond132.not, label %.loopexit209, label %scalar.ph, !llvm.loop !30

.loopexit209:                                     ; preds = %scalar.ph, %middle.block197
  %.lcssa = phi i64 [ %156, %middle.block197 ], [ %187, %scalar.ph ]
  store i64 %.lcssa, ptr @ans, align 8, !tbaa !9
  %188 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.lcssa)
  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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !12, !19, !20}
!22 = distinct !{!22, !12, !20, !19}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !19, !20}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12, !20, !19}


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