; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101385A)

; 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
@bits = external dso_local global [65537 x i32], align 16
@sum = external dso_local global i64, align 8
@c = external dso_local global [51 x [51 x i64]], align 16
@msk = external dso_local global [51 x i64], align 16
@ans = external dso_local global double, align 8
@buf = external dso_local global [51 x i8], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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 i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %69, %0
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 51
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %20
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %26
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [51 x i64], ptr %27, i64 0, i64 %29
  store i64 1, ptr %30, align 8, !tbaa !11
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %32
  %34 = getelementptr inbounds [51 x i64], ptr %33, i64 0, i64 0
  store i64 1, ptr %34, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %65, %24
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %2, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %43
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [51 x i64], ptr %44, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = load i32, ptr %2, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [51 x i64], ptr %53, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = add nsw i64 %49, %57
  %59 = load i32, ptr %2, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %60
  %62 = load i32, ptr %4, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [51 x i64], ptr %61, i64 0, i64 %63
  store i64 %58, ptr %64, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %40
  %66 = load i32, ptr %4, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %4, align 4, !tbaa !9
  br label %35, !llvm.loop !13

68:                                               ; preds = %39
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %2, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %2, align 4, !tbaa !9
  br label %20, !llvm.loop !15

72:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %89, %72
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 65537
  br i1 %75, label %77, label %76

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

77:                                               ; preds = %73
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = ashr i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = and i32 %83, 1
  %85 = add nsw i32 %82, %84
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %77
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !9
  br label %73, !llvm.loop !16

92:                                               ; preds = %76
  %93 = call i64 @time(ptr noundef null) #5
  %94 = trunc i64 %93 to i32
  call void @srand(i32 noundef %94) #5
  %95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n, ptr noundef @k, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %128, %92
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = load i32, ptr @k, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

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

101:                                              ; preds = %96
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %124, %101
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = load i32, ptr @n, align 4, !tbaa !9
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %127

108:                                              ; preds = %103
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [51 x i8], ptr @buf, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !17
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %113, 49
  %115 = zext i1 %114 to i64
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = shl i64 %115, %117
  %119 = load i32, ptr %6, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !11
  %123 = or i64 %122, %118
  store i64 %123, ptr %121, align 8, !tbaa !11
  br label %124

124:                                              ; preds = %108
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %7, align 4, !tbaa !9
  br label %103, !llvm.loop !18

127:                                              ; preds = %107
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %6, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %6, align 4, !tbaa !9
  br label %96, !llvm.loop !19

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

132:                                              ; preds = %147, %131
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = load i32, ptr @m, align 4, !tbaa !9
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

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

137:                                              ; preds = %132
  %138 = load i32, ptr @n, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %139
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [51 x i64], ptr %140, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !11
  %145 = load i64, ptr @sum, align 8, !tbaa !11
  %146 = add nsw i64 %145, %144
  store i64 %146, ptr @sum, align 8, !tbaa !11
  br label %147

147:                                              ; preds = %137
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %8, align 4, !tbaa !9
  br label %132, !llvm.loop !20

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

151:                                              ; preds = %258, %150
  %152 = load i32, ptr %9, align 4, !tbaa !9
  %153 = icmp slt i32 %152, 1000000
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %261

155:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %156 = call i32 @rand() #5
  %157 = load i32, ptr @k, align 4, !tbaa !9
  %158 = srem i32 %156, %157
  store i32 %158, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %159 = call noundef i64 @_Z6randLLv()
  %160 = load i64, ptr @sum, align 8, !tbaa !11
  %161 = srem i64 %159, %160
  store i64 %161, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !11
  store i64 %165, ptr %13, align 8, !tbaa !11
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %177, %155
  %167 = load i64, ptr %12, align 8, !tbaa !11
  %168 = load i32, ptr @n, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %169
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [51 x i64], ptr %170, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = icmp sge i64 %167, %174
  br i1 %175, label %176, label %188

176:                                              ; preds = %166
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr @n, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %179
  %181 = load i32, ptr %11, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %11, align 4, !tbaa !9
  %183 = sext i32 %181 to i64
  %184 = getelementptr inbounds [51 x i64], ptr %180, i64 0, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !11
  %186 = load i64, ptr %12, align 8, !tbaa !11
  %187 = sub nsw i64 %186, %185
  store i64 %187, ptr %12, align 8, !tbaa !11
  br label %166, !llvm.loop !21

188:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %189 = load i32, ptr @n, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  store i32 %190, ptr %14, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %227, %188
  %192 = load i32, ptr %11, align 4, !tbaa !9
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %197

194:                                              ; preds = %191
  %195 = load i32, ptr %14, align 4, !tbaa !9
  %196 = icmp sge i32 %195, 0
  br label %197

197:                                              ; preds = %194, %191
  %198 = phi i1 [ false, %191 ], [ %196, %194 ]
  br i1 %198, label %200, label %199

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

200:                                              ; preds = %197
  %201 = load i64, ptr %12, align 8, !tbaa !11
  %202 = load i32, ptr %14, align 4, !tbaa !9
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %203
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [51 x i64], ptr %204, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !11
  %209 = icmp sge i64 %201, %208
  br i1 %209, label %210, label %226

210:                                              ; preds = %200
  %211 = load i32, ptr %14, align 4, !tbaa !9
  %212 = zext i32 %211 to i64
  %213 = shl i64 1, %212
  %214 = load i64, ptr %13, align 8, !tbaa !11
  %215 = xor i64 %214, %213
  store i64 %215, ptr %13, align 8, !tbaa !11
  %216 = load i32, ptr %14, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %217
  %219 = load i32, ptr %11, align 4, !tbaa !9
  %220 = add nsw i32 %219, -1
  store i32 %220, ptr %11, align 4, !tbaa !9
  %221 = sext i32 %219 to i64
  %222 = getelementptr inbounds [51 x i64], ptr %218, i64 0, i64 %221
  %223 = load i64, ptr %222, align 8, !tbaa !11
  %224 = load i64, ptr %12, align 8, !tbaa !11
  %225 = sub nsw i64 %224, %223
  store i64 %225, ptr %12, align 8, !tbaa !11
  br label %226

226:                                              ; preds = %210, %200
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %14, align 4, !tbaa !9
  %229 = add nsw i32 %228, -1
  store i32 %229, ptr %14, align 4, !tbaa !9
  br label %191, !llvm.loop !22

230:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %231

231:                                              ; preds = %249, %230
  %232 = load i32, ptr %15, align 4, !tbaa !9
  %233 = load i32, ptr @k, align 4, !tbaa !9
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %236, label %235

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

236:                                              ; preds = %231
  %237 = load i32, ptr %15, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %238
  %240 = load i64, ptr %239, align 8, !tbaa !11
  %241 = load i64, ptr %13, align 8, !tbaa !11
  %242 = xor i64 %240, %241
  %243 = call noundef i32 @_Z8popcountx(i64 noundef %242)
  %244 = load i32, ptr @m, align 4, !tbaa !9
  %245 = icmp slt i32 %243, %244
  %246 = zext i1 %245 to i32
  %247 = load i32, ptr %11, align 4, !tbaa !9
  %248 = add nsw i32 %247, %246
  store i32 %248, ptr %11, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %236
  %250 = load i32, ptr %15, align 4, !tbaa !9
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %15, align 4, !tbaa !9
  br label %231, !llvm.loop !23

252:                                              ; preds = %235
  %253 = load i32, ptr %11, align 4, !tbaa !9
  %254 = sitofp i32 %253 to double
  %255 = fdiv double 1.000000e+00, %254
  %256 = load double, ptr @ans, align 8, !tbaa !24
  %257 = fadd double %256, %255
  store double %257, ptr @ans, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %258

258:                                              ; preds = %252
  %259 = load i32, ptr %9, align 4, !tbaa !9
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %9, align 4, !tbaa !9
  br label %151, !llvm.loop !26

261:                                              ; preds = %154
  %262 = load double, ptr @ans, align 8, !tbaa !24
  %263 = fdiv double %262, 1.000000e+06
  %264 = load i64, ptr @sum, align 8, !tbaa !11
  %265 = sitofp i64 %264 to double
  %266 = fmul double %263, %265
  %267 = load i32, ptr @k, align 4, !tbaa !9
  %268 = sitofp i32 %267 to double
  %269 = fmul double %266, %268
  %270 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, double noundef %269)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, 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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @rand() #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z6randLLv() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8popcountx(i64 noundef) #4

declare i32 @printf(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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = distinct !{!26, !14}


; 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 global i32, align 4
@bits = external dso_local local_unnamed_addr global [65537 x i32], align 16
@sum = external dso_local local_unnamed_addr global i64, align 8
@c = external dso_local local_unnamed_addr global [51 x [51 x i64]], align 16
@msk = external dso_local local_unnamed_addr global [51 x i64], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@buf = external dso_local global [51 x i8], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @stdin, align 8, !tbaa !5
  %2 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %1)
  %3 = load ptr, ptr @stdout, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %3)
  br label %5

5:                                                ; preds = %0, %._crit_edge
  %indvars.iv113 = phi i64 [ 0, %0 ], [ %indvars.iv.next114, %._crit_edge ]
  %6 = add nsw i64 %indvars.iv113, -1
  %7 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv113
  %8 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv113, i64 %indvars.iv113
  store i64 1, ptr %8, align 8, !tbaa !9
  store i64 1, ptr %7, align 8, !tbaa !9
  %9 = icmp ugt i64 %indvars.iv113, 1
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %10 = add nsw i64 %indvars.iv113, -1
  %.phi.trans.insert = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %10, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !9
  %min.iters.check = icmp ult i64 %indvars.iv113, 5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %.ph201 = phi i64 [ %.pre, %.lr.ph ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %6, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load157, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %11 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %10, i64 %offset.idx
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %wide.load = load <2 x i64>, ptr %11, align 8, !tbaa !9
  %wide.load157 = load <2 x i64>, ptr %12, align 8, !tbaa !9
  %13 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
  %14 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load157, <2 x i32> <i32 1, i32 2>
  %15 = add nsw <2 x i64> %wide.load, %13
  %16 = add nsw <2 x i64> %wide.load157, %14
  %17 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv113, i64 %offset.idx
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  store <2 x i64> %15, ptr %17, align 8, !tbaa !9
  store <2 x i64> %16, ptr %18, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %19 = icmp eq i64 %index.next, %n.vec
  br i1 %19, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <2 x i64> %wide.load157, i64 1
  %cmp.n = icmp eq i64 %6, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %5
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next114, 51
  br i1 %exitcond116.not, label %.preheader73, label %5, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %20 = phi i64 [ %22, %scalar.ph ], [ %.ph201, %scalar.ph.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %21 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %10, i64 %indvars.iv
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = add nsw i64 %22, %20
  %24 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv113, i64 %indvars.iv
  store i64 %23, ptr %24, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv113
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !16

25:                                               ; preds = %.preheader73
  %26 = tail call i64 @time(ptr noundef null) #6
  %27 = trunc i64 %26 to i32
  tail call void @srand(i32 noundef %27) #6
  %28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @m)
  %29 = load i32, ptr @k, align 4, !tbaa !17
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph84, label %.preheader72

.preheader73:                                     ; preds = %._crit_edge, %.preheader73
  %indvars.iv117 = phi i64 [ %indvars.iv.next118.1, %.preheader73 ], [ 1, %._crit_edge ]
  %31 = lshr i64 %indvars.iv117, 1
  %32 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = add nsw i32 %33, 1
  %35 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %indvars.iv117
  store i32 %34, ptr %35, align 4, !tbaa !17
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %36 = lshr i64 %indvars.iv.next118, 1
  %37 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !17
  %39 = getelementptr inbounds [65537 x i32], ptr @bits, i64 0, i64 %indvars.iv.next118
  store i32 %38, ptr %39, align 4, !tbaa !17
  %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2
  %exitcond120.not.1 = icmp eq i64 %indvars.iv.next118.1, 65537
  br i1 %exitcond120.not.1, label %25, label %.preheader73, !llvm.loop !19

.preheader72:                                     ; preds = %68, %25
  %40 = load i32, ptr @m, align 4, !tbaa !17
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph86, label %.preheader71.preheader

.preheader71.preheader:                           ; preds = %..preheader71_crit_edge, %.preheader72
  br label %.preheader71

.lr.ph86:                                         ; preds = %.preheader72
  %sum.promoted = load i64, ptr @sum, align 8, !tbaa !9
  %42 = load i32, ptr @n, align 4, !tbaa !17
  %43 = sext i32 %42 to i64
  %wide.trip.count131 = zext nneg i32 %40 to i64
  %min.iters.check175 = icmp ult i32 %40, 4
  br i1 %min.iters.check175, label %scalar.ph174.preheader, label %vector.ph176

scalar.ph174.preheader:                           ; preds = %middle.block173, %.lr.ph86
  %indvars.iv128.ph = phi i64 [ 0, %.lr.ph86 ], [ %n.vec178, %middle.block173 ]
  %.ph = phi i64 [ %sum.promoted, %.lr.ph86 ], [ %50, %middle.block173 ]
  br label %scalar.ph174

vector.ph176:                                     ; preds = %.lr.ph86
  %n.vec178 = and i64 %wide.trip.count131, 2147483644
  %44 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %sum.promoted, i64 0
  br label %vector.body180

vector.body180:                                   ; preds = %vector.body180, %vector.ph176
  %index181 = phi i64 [ 0, %vector.ph176 ], [ %index.next186, %vector.body180 ]
  %vec.phi182 = phi <2 x i64> [ %44, %vector.ph176 ], [ %47, %vector.body180 ]
  %vec.phi183 = phi <2 x i64> [ zeroinitializer, %vector.ph176 ], [ %48, %vector.body180 ]
  %45 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %43, i64 %index181
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %wide.load184 = load <2 x i64>, ptr %45, align 8, !tbaa !9
  %wide.load185 = load <2 x i64>, ptr %46, align 8, !tbaa !9
  %47 = add <2 x i64> %vec.phi182, %wide.load184
  %48 = add <2 x i64> %vec.phi183, %wide.load185
  %index.next186 = add nuw i64 %index181, 4
  %49 = icmp eq i64 %index.next186, %n.vec178
  br i1 %49, label %middle.block173, label %vector.body180, !llvm.loop !20

middle.block173:                                  ; preds = %vector.body180
  %bin.rdx187 = add <2 x i64> %48, %47
  %50 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx187)
  %cmp.n188 = icmp eq i64 %n.vec178, %wide.trip.count131
  br i1 %cmp.n188, label %..preheader71_crit_edge, label %scalar.ph174.preheader

.lr.ph84:                                         ; preds = %25, %68
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %68 ], [ 0, %25 ]
  %51 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @buf)
  %52 = load i32, ptr @n, align 4, !tbaa !17
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph79, label %68

.lr.ph79:                                         ; preds = %.lr.ph84
  %54 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %indvars.iv125
  %.promoted = load i64, ptr %54, align 8, !tbaa !9
  %wide.trip.count = zext nneg i32 %52 to i64
  %min.iters.check160 = icmp ult i32 %52, 4
  br i1 %min.iters.check160, label %scalar.ph159.preheader, label %vector.ph161

scalar.ph159.preheader:                           ; preds = %middle.block158, %.lr.ph79
  %indvars.iv121.ph = phi i64 [ 0, %.lr.ph79 ], [ %n.vec163, %middle.block158 ]
  %.ph197 = phi i64 [ %.promoted, %.lr.ph79 ], [ %67, %middle.block158 ]
  br label %scalar.ph159

vector.ph161:                                     ; preds = %.lr.ph79
  %n.vec163 = and i64 %wide.trip.count, 2147483644
  %55 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.promoted, i64 0
  br label %vector.body165

vector.body165:                                   ; preds = %vector.body165, %vector.ph161
  %index166 = phi i64 [ 0, %vector.ph161 ], [ %index.next171, %vector.body165 ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph161 ], [ %vec.ind.next, %vector.body165 ]
  %vec.phi = phi <2 x i64> [ %55, %vector.ph161 ], [ %64, %vector.body165 ]
  %vec.phi168 = phi <2 x i64> [ zeroinitializer, %vector.ph161 ], [ %65, %vector.body165 ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %56 = getelementptr inbounds [51 x i8], ptr @buf, i64 0, i64 %index166
  %57 = getelementptr inbounds i8, ptr %56, i64 2
  %wide.load169 = load <2 x i8>, ptr %56, align 4, !tbaa !21
  %wide.load170 = load <2 x i8>, ptr %57, align 2, !tbaa !21
  %58 = icmp eq <2 x i8> %wide.load169, <i8 49, i8 49>
  %59 = icmp eq <2 x i8> %wide.load170, <i8 49, i8 49>
  %60 = zext <2 x i1> %58 to <2 x i64>
  %61 = zext <2 x i1> %59 to <2 x i64>
  %62 = shl nuw <2 x i64> %60, %vec.ind
  %63 = shl nuw <2 x i64> %61, %step.add
  %64 = or <2 x i64> %62, %vec.phi
  %65 = or <2 x i64> %63, %vec.phi168
  %index.next171 = add nuw i64 %index166, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %66 = icmp eq i64 %index.next171, %n.vec163
  br i1 %66, label %middle.block158, label %vector.body165, !llvm.loop !22

middle.block158:                                  ; preds = %vector.body165
  %bin.rdx = or <2 x i64> %65, %64
  %67 = tail call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> %bin.rdx)
  %cmp.n172 = icmp eq i64 %n.vec163, %wide.trip.count
  br i1 %cmp.n172, label %._crit_edge80, label %scalar.ph159.preheader

._crit_edge80:                                    ; preds = %scalar.ph159, %middle.block158
  %.lcssa156 = phi i64 [ %67, %middle.block158 ], [ %78, %scalar.ph159 ]
  store i64 %.lcssa156, ptr %54, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %._crit_edge80, %.lr.ph84
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %69 = load i32, ptr @k, align 4, !tbaa !17
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next126, %70
  br i1 %71, label %.lr.ph84, label %.preheader72, !llvm.loop !23

scalar.ph159:                                     ; preds = %scalar.ph159.preheader, %scalar.ph159
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %scalar.ph159 ], [ %indvars.iv121.ph, %scalar.ph159.preheader ]
  %72 = phi i64 [ %78, %scalar.ph159 ], [ %.ph197, %scalar.ph159.preheader ]
  %73 = getelementptr inbounds [51 x i8], ptr @buf, i64 0, i64 %indvars.iv121
  %74 = load i8, ptr %73, align 1, !tbaa !21
  %75 = icmp eq i8 %74, 49
  %76 = zext i1 %75 to i64
  %77 = shl nuw i64 %76, %indvars.iv121
  %78 = or i64 %77, %72
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count
  br i1 %exitcond124.not, label %._crit_edge80, label %scalar.ph159, !llvm.loop !24

..preheader71_crit_edge:                          ; preds = %scalar.ph174, %middle.block173
  %.lcssa155 = phi i64 [ %50, %middle.block173 ], [ %82, %scalar.ph174 ]
  store i64 %.lcssa155, ptr @sum, align 8, !tbaa !9
  br label %.preheader71.preheader

scalar.ph174:                                     ; preds = %scalar.ph174.preheader, %scalar.ph174
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %scalar.ph174 ], [ %indvars.iv128.ph, %scalar.ph174.preheader ]
  %79 = phi i64 [ %82, %scalar.ph174 ], [ %.ph, %scalar.ph174.preheader ]
  %80 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %43, i64 %indvars.iv128
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = add nsw i64 %79, %81
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131
  br i1 %exitcond132.not, label %..preheader71_crit_edge, label %scalar.ph174, !llvm.loop !25

83:                                               ; preds = %._crit_edge105
  %84 = fdiv double %127, 1.000000e+06
  %85 = load i64, ptr @sum, align 8, !tbaa !9
  %86 = sitofp i64 %85 to double
  %87 = fmul double %84, %86
  %88 = sitofp i32 %123 to double
  %89 = fmul double %87, %88
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %89)
  ret i32 0

.preheader71:                                     ; preds = %.preheader71.preheader, %._crit_edge105
  %.061107 = phi i32 [ %128, %._crit_edge105 ], [ 0, %.preheader71.preheader ]
  %91 = tail call i32 @rand() #6
  %92 = load i32, ptr @k, align 4, !tbaa !17
  %93 = srem i32 %91, %92
  %94 = tail call noundef i64 @_Z6randLLv()
  %95 = load i64, ptr @sum, align 8, !tbaa !9
  %96 = srem i64 %94, %95
  %97 = sext i32 %93 to i64
  %98 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = load i32, ptr @n, align 4, !tbaa !17
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %101, i64 0
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %.not88 = icmp slt i64 %96, %103
  br i1 %.not88, label %.preheader, label %.lr.ph92

.preheader70:                                     ; preds = %.lr.ph92
  %104 = trunc nuw nsw i64 %indvars.iv.next134 to i32
  %105 = icmp sgt i32 %100, 0
  br i1 %105, label %.lr.ph99.preheader, label %.preheader

.lr.ph99.preheader:                               ; preds = %.preheader70
  %106 = zext nneg i32 %100 to i64
  br label %.lr.ph99

.lr.ph92:                                         ; preds = %.preheader71, %.lr.ph92
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %.lr.ph92 ], [ 0, %.preheader71 ]
  %107 = phi i64 [ %110, %.lr.ph92 ], [ %103, %.preheader71 ]
  %.05590 = phi i64 [ %108, %.lr.ph92 ], [ %96, %.preheader71 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %108 = sub nsw i64 %.05590, %107
  %109 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %101, i64 %indvars.iv.next134
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %.not = icmp slt i64 %108, %110
  br i1 %.not, label %.preheader70, label %.lr.ph92, !llvm.loop !26

.preheader:                                       ; preds = %.lr.ph99, %.preheader71, %.preheader70
  %.158.lcssa = phi i32 [ %104, %.preheader70 ], [ 0, %.preheader71 ], [ %.259, %.lr.ph99 ]
  %.054.lcssa = phi i64 [ %99, %.preheader70 ], [ %99, %.preheader71 ], [ %.1, %.lr.ph99 ]
  %111 = load i32, ptr @k, align 4, !tbaa !17
  %112 = icmp sgt i32 %111, 0
  br i1 %112, label %.lr.ph104, label %._crit_edge105

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %.lr.ph99
  %indvars.iv136 = phi i64 [ %106, %.lr.ph99.preheader ], [ %indvars.iv.next137, %.lr.ph99 ]
  %.05497 = phi i64 [ %99, %.lr.ph99.preheader ], [ %.1, %.lr.ph99 ]
  %.15696 = phi i64 [ %108, %.lr.ph99.preheader ], [ %.2, %.lr.ph99 ]
  %.15895 = phi i32 [ %104, %.lr.ph99.preheader ], [ %.259, %.lr.ph99 ]
  %indvars.iv.next137 = add nsw i64 %indvars.iv136, -1
  %113 = sext i32 %.15895 to i64
  %114 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv.next137, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !9
  %.not69 = icmp sge i64 %.15696, %115
  %116 = shl nuw i64 1, %indvars.iv.next137
  %117 = sext i1 %.not69 to i32
  %.259 = add nsw i32 %.15895, %117
  %118 = select i1 %.not69, i64 %115, i64 0
  %.2 = sub nsw i64 %.15696, %118
  %119 = select i1 %.not69, i64 %116, i64 0
  %.1 = xor i64 %119, %.05497
  %120 = icmp ne i32 %.259, 0
  %121 = icmp ugt i64 %indvars.iv136, 1
  %122 = and i1 %120, %121
  br i1 %122, label %.lr.ph99, label %.preheader, !llvm.loop !27

._crit_edge105:                                   ; preds = %.lr.ph104, %.preheader
  %123 = phi i32 [ %111, %.preheader ], [ %137, %.lr.ph104 ]
  %.3.lcssa = phi i32 [ %.158.lcssa, %.preheader ], [ %136, %.lr.ph104 ]
  %124 = sitofp i32 %.3.lcssa to double
  %125 = fdiv double 1.000000e+00, %124
  %126 = load double, ptr @ans, align 8, !tbaa !28
  %127 = fadd double %125, %126
  store double %127, ptr @ans, align 8, !tbaa !28
  %128 = add nuw nsw i32 %.061107, 1
  %exitcond142.not = icmp eq i32 %128, 1000000
  br i1 %exitcond142.not, label %83, label %.preheader71, !llvm.loop !30

.lr.ph104:                                        ; preds = %.preheader, %.lr.ph104
  %indvars.iv139 = phi i64 [ %indvars.iv.next140, %.lr.ph104 ], [ 0, %.preheader ]
  %.3102 = phi i32 [ %136, %.lr.ph104 ], [ %.158.lcssa, %.preheader ]
  %129 = getelementptr inbounds [51 x i64], ptr @msk, i64 0, i64 %indvars.iv139
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = xor i64 %130, %.054.lcssa
  %132 = tail call noundef i32 @_Z8popcountx(i64 noundef %131)
  %133 = load i32, ptr @m, align 4, !tbaa !17
  %134 = icmp slt i32 %132, %133
  %135 = zext i1 %134 to i32
  %136 = add nsw i32 %.3102, %135
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %137 = load i32, ptr @k, align 4, !tbaa !17
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvars.iv.next140, %138
  br i1 %139, label %.lr.ph104, label %._crit_edge105, !llvm.loop !31
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z6randLLv() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8popcountx(i64 noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.or.v2i64(<2 x i64>) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!"any pointer", !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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !13, !14}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !12, !13, !14}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !14, !13}
!25 = distinct !{!25, !12, !14, !13}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = !{!29, !29, i64 0}
!29 = !{!"double", !7, i64 0}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12}


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