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

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

@tot = external dso_local global i32, align 4
@pr = external dso_local global [32001 x i32], align 16
@d = external dso_local global [32001 x i32], align 16
@n = external dso_local global i32, align 4
@lim = external dso_local global i32, align 4
@g = external dso_local global [151 x [32001 x i32]], align 16
@sz = external dso_local global i32, align 4
@out = external dso_local global [501 x i32], align 16
@f = external dso_local global [151 x [32001 x double]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 1, ptr @lim, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %22, %0
  %16 = load i32, ptr @lim, align 4, !tbaa !5
  %17 = load i32, ptr @lim, align 4, !tbaa !5
  %18 = mul nsw i32 %16, %17
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %21, label %25

21:                                               ; preds = %15
  br label %22

22:                                               ; preds = %21
  %23 = load i32, ptr @lim, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr @lim, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

26:                                               ; preds = %88, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr @lim, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %3, align 4
  br label %91

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %53, label %37

37:                                               ; preds = %31
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr @tot, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @tot, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %44
  store i32 %38, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = srem i32 %46, %47
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %37
  %51 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %51, ptr @lim, align 4, !tbaa !5
  store i32 5, ptr %3, align 4
  br label %91

52:                                               ; preds = %37
  br label %53

53:                                               ; preds = %52, %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  br label %54

54:                                               ; preds = %83, %53
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = mul nsw i32 %55, %59
  store i32 %60, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr @lim, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %54
  store i32 8, ptr %3, align 4
  br label %86

64:                                               ; preds = %54
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %70
  store i32 %68, ptr %71, align 4, !tbaa !5
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %75, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %64
  store i32 8, ptr %3, align 4
  br label %86

82:                                               ; preds = %64
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %4, align 4, !tbaa !5
  br label %54, !llvm.loop !11

86:                                               ; preds = %81, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !12

91:                                               ; preds = %50, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr @lim, align 4, !tbaa !5
  %94 = load i32, ptr @lim, align 4, !tbaa !5
  %95 = mul nsw i32 %93, %94
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %92
  br label %101

99:                                               ; preds = %92
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 31, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

100:                                              ; No predecessors!
  br label %101

101:                                              ; preds = %100, %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = load i32, ptr @lim, align 4, !tbaa !5
  %104 = sdiv i32 %102, %103
  store i32 %104, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr @lim, align 4, !tbaa !5
  %106 = icmp sle i32 %105, 3
  br i1 %106, label %107, label %113

107:                                              ; preds = %101
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %108, i32 noundef %111)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %311

113:                                              ; preds = %101
  %114 = load i32, ptr @tot, align 4, !tbaa !5
  %115 = icmp sge i32 %114, 151
  br i1 %115, label %116, label %117

116:                                              ; preds = %113
  store i32 150, ptr @tot, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %116, %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %229, %117
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = load i32, ptr @tot, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

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

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %225, %123
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = load i32, ptr @lim, align 4, !tbaa !5
  %127 = icmp sle i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %228

129:                                              ; preds = %124
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sub nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %132
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [32001 x double], ptr %133, i64 0, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !13
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %139
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [32001 x double], ptr %140, i64 0, i64 %142
  store double %137, ptr %143, align 8, !tbaa !13
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [32001 x i32], ptr %146, i64 0, i64 %148
  store i32 0, ptr %149, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sitofp i32 %153 to double
  %155 = call double @log(double noundef %154) #6
  store double %155, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %156 = load double, ptr %9, align 8, !tbaa !13
  store double %156, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %157 = load i32, ptr %7, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  store i32 %160, ptr %11, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %214, %129
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = load i32, ptr %8, align 4, !tbaa !5
  %164 = icmp sle i32 %162, %163
  br i1 %164, label %166, label %165

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

166:                                              ; preds = %161
  %167 = load i32, ptr %7, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %168
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [32001 x double], ptr %169, i64 0, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !13
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %176
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = load i32, ptr %11, align 4, !tbaa !5
  %180 = sub nsw i32 %178, %179
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [32001 x double], ptr %177, i64 0, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !13
  %184 = load double, ptr %9, align 8, !tbaa !13
  %185 = fadd double %183, %184
  %186 = fcmp olt double %173, %185
  br i1 %186, label %187, label %213

187:                                              ; preds = %166
  %188 = load i32, ptr %7, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %190
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = load i32, ptr %11, align 4, !tbaa !5
  %194 = sub nsw i32 %192, %193
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [32001 x double], ptr %191, i64 0, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !13
  %198 = load double, ptr %9, align 8, !tbaa !13
  %199 = fadd double %197, %198
  %200 = load i32, ptr %7, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %201
  %203 = load i32, ptr %8, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [32001 x double], ptr %202, i64 0, i64 %204
  store double %199, ptr %205, align 8, !tbaa !13
  %206 = load i32, ptr %11, align 4, !tbaa !5
  %207 = load i32, ptr %7, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %208
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [32001 x i32], ptr %209, i64 0, i64 %211
  store i32 %206, ptr %212, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %187, %166
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %7, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = load i32, ptr %11, align 4, !tbaa !5
  %220 = mul nsw i32 %219, %218
  store i32 %220, ptr %11, align 4, !tbaa !5
  %221 = load double, ptr %10, align 8, !tbaa !13
  %222 = load double, ptr %9, align 8, !tbaa !13
  %223 = fadd double %222, %221
  store double %223, ptr %9, align 8, !tbaa !13
  br label %161, !llvm.loop !15

224:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %8, align 4, !tbaa !5
  br label %124, !llvm.loop !16

228:                                              ; preds = %128
  br label %229

229:                                              ; preds = %228
  %230 = load i32, ptr %7, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %7, align 4, !tbaa !5
  br label %118, !llvm.loop !17

232:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %233 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %233, ptr %12, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %262, %232
  %235 = load i32, ptr %12, align 4, !tbaa !5
  %236 = icmp sgt i32 %235, 0
  br i1 %236, label %238, label %237

237:                                              ; preds = %234
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %273

238:                                              ; preds = %234
  %239 = load i32, ptr %12, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %240
  %242 = load i32, ptr @lim, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [32001 x i32], ptr %241, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = icmp ne i32 %245, 0
  br i1 %246, label %247, label %261

247:                                              ; preds = %238
  %248 = load i32, ptr %6, align 4, !tbaa !5
  %249 = load i32, ptr %12, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %250
  %252 = load i32, ptr @lim, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [32001 x i32], ptr %251, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = mul nsw i32 %248, %255
  %257 = load i32, ptr @sz, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr @sz, align 4, !tbaa !5
  %259 = sext i32 %257 to i64
  %260 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %259
  store i32 %256, ptr %260, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %247, %238
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %12, align 4, !tbaa !5
  %264 = add nsw i32 %263, -1
  store i32 %264, ptr %12, align 4, !tbaa !5
  %265 = sext i32 %263 to i64
  %266 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %265
  %267 = load i32, ptr @lim, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [32001 x i32], ptr %266, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = load i32, ptr @lim, align 4, !tbaa !5
  %272 = sub nsw i32 %271, %270
  store i32 %272, ptr @lim, align 4, !tbaa !5
  br label %234, !llvm.loop !18

273:                                              ; preds = %237
  br label %274

274:                                              ; preds = %278, %273
  %275 = load i32, ptr @lim, align 4, !tbaa !5
  %276 = add nsw i32 %275, -1
  store i32 %276, ptr @lim, align 4, !tbaa !5
  %277 = icmp ne i32 %275, 0
  br i1 %277, label %278, label %284

278:                                              ; preds = %274
  %279 = load i32, ptr %6, align 4, !tbaa !5
  %280 = load i32, ptr @sz, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr @sz, align 4, !tbaa !5
  %282 = sext i32 %280 to i64
  %283 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %282
  store i32 %279, ptr %283, align 4, !tbaa !5
  br label %274, !llvm.loop !19

284:                                              ; preds = %274
  %285 = load i32, ptr @sz, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds i32, ptr @out, i64 %286
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @out, ptr noundef %287)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %288

288:                                              ; preds = %307, %284
  %289 = load i32, ptr %13, align 4, !tbaa !5
  %290 = load i32, ptr @sz, align 4, !tbaa !5
  %291 = icmp slt i32 %289, %290
  br i1 %291, label %293, label %292

292:                                              ; preds = %288
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %310

293:                                              ; preds = %288
  %294 = load i32, ptr %13, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %295
  %297 = load i32, ptr %296, align 4, !tbaa !5
  %298 = load i32, ptr %13, align 4, !tbaa !5
  %299 = load i32, ptr @sz, align 4, !tbaa !5
  %300 = sub nsw i32 %299, 1
  %301 = icmp eq i32 %298, %300
  %302 = zext i1 %301 to i64
  %303 = getelementptr inbounds [3 x i8], ptr @.str.5, i64 0, i64 %302
  %304 = load i8, ptr %303, align 1, !tbaa !20
  %305 = sext i8 %304 to i32
  %306 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %297, i32 noundef %305)
  br label %307

307:                                              ; preds = %293
  %308 = load i32, ptr %13, align 4, !tbaa !5
  %309 = add nsw i32 %308, 1
  store i32 %309, ptr %13, align 4, !tbaa !5
  br label %288, !llvm.loop !21

310:                                              ; preds = %292
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %311

311:                                              ; preds = %310, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %312 = load i32, ptr %1, align 4
  ret i32 %312
}

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare double @log(double noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn 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 = { 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }

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

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


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

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [32001 x i32], align 16
@d = external dso_local local_unnamed_addr global [32001 x i32], align 16
@n = external dso_local global i32, align 4
@lim = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local local_unnamed_addr global [151 x [32001 x i32]], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@out = external dso_local global [501 x i32], align 16
@f = external dso_local local_unnamed_addr global [151 x [32001 x double]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse 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)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  br label %3

3:                                                ; preds = %3, %0
  %.pr = phi i32 [ 1, %0 ], [ %5, %3 ]
  %4 = mul nuw nsw i32 %.pr, %.pr
  %.not = icmp sgt i32 %4, %2
  %5 = add nuw nsw i32 %.pr, 1
  br i1 %.not, label %.preheader83, label %3, !llvm.loop !9

.preheader83:                                     ; preds = %3
  store i32 %.pr, ptr @lim, align 4, !tbaa !5
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %6 = icmp ugt i32 %.pr, 2
  br i1 %6, label %.lr.ph90.preheader, label %thread-pre-split

.lr.ph90.preheader:                               ; preds = %.preheader83
  %wide.trip.count = zext nneg i32 %.pr to i64
  br label %.lr.ph90

.lr.ph90:                                         ; preds = %.lr.ph90.preheader, %._crit_edge
  %indvars.iv124 = phi i64 [ 2, %.lr.ph90.preheader ], [ %indvars.iv.next125, %._crit_edge ]
  %7 = phi i32 [ %tot.promoted, %.lr.ph90.preheader ], [ %18, %._crit_edge ]
  %8 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %indvars.iv124
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %.not74 = icmp eq i32 %9, 0
  %10 = trunc nuw nsw i64 %indvars.iv124 to i32
  br i1 %.not74, label %11, label %.lr.ph90._crit_edge

11:                                               ; preds = %.lr.ph90
  store i32 %10, ptr %8, align 4, !tbaa !5
  %12 = add nsw i32 %7, 1
  store i32 %12, ptr @tot, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %13
  store i32 %10, ptr %14, align 4, !tbaa !5
  %15 = srem i32 %2, %10
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %.lr.ph90._crit_edge

17:                                               ; preds = %11
  store i32 %10, ptr @lim, align 4, !tbaa !5
  %.pre147 = mul nsw i32 %10, %10
  br label %thread-pre-split

.lr.ph90._crit_edge:                              ; preds = %.lr.ph90, %11
  %18 = phi i32 [ %12, %11 ], [ %7, %.lr.ph90 ]
  %19 = load i32, ptr @pr, align 16, !tbaa !5
  %20 = mul nsw i32 %19, %10
  %21 = icmp slt i32 %20, %.pr
  br i1 %21, label %.lr.ph, label %._crit_edge

22:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = mul nsw i32 %24, %10
  %26 = icmp slt i32 %25, %.pr
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph90._crit_edge, %22
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %.lr.ph90._crit_edge ]
  %27 = phi i32 [ %25, %22 ], [ %20, %.lr.ph90._crit_edge ]
  %28 = phi i32 [ %24, %22 ], [ %19, %.lr.ph90._crit_edge ]
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [32001 x i32], ptr @d, i64 0, i64 %29
  store i32 %28, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = icmp eq i32 %31, %28
  br i1 %32, label %._crit_edge, label %22

._crit_edge:                                      ; preds = %22, %.lr.ph, %.lr.ph90._crit_edge
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count
  br i1 %exitcond.not, label %thread-pre-split, label %.lr.ph90, !llvm.loop !12

thread-pre-split:                                 ; preds = %._crit_edge, %.preheader83, %17
  %.pre-phi = phi i32 [ %.pre147, %17 ], [ %4, %.preheader83 ], [ %4, %._crit_edge ]
  %33 = phi i32 [ %12, %17 ], [ %tot.promoted, %.preheader83 ], [ %18, %._crit_edge ]
  %34 = phi i32 [ %10, %17 ], [ %.pr, %.preheader83 ], [ %.pr, %._crit_edge ]
  %.not75 = icmp sgt i32 %.pre-phi, %2
  br i1 %.not75, label %35, label %36

35:                                               ; preds = %thread-pre-split
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 31, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

36:                                               ; preds = %thread-pre-split
  %37 = sdiv i32 %2, %34
  %38 = icmp slt i32 %34, 4
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = sub nsw i32 %2, %37
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %37, i32 noundef %40)
  br label %.loopexit

42:                                               ; preds = %36
  %43 = icmp sgt i32 %33, 150
  br i1 %43, label %.thread, label %44

.thread:                                          ; preds = %42
  store i32 150, ptr @tot, align 4, !tbaa !5
  br label %.preheader82.preheader

.preheader82.preheader:                           ; preds = %44, %.thread
  %.ph = phi i32 [ %33, %44 ], [ 150, %.thread ]
  br label %.preheader82

44:                                               ; preds = %42
  %.not76101 = icmp slt i32 %33, 1
  br i1 %.not76101, label %.preheader.thread, label %.preheader82.preheader

.preheader.thread:                                ; preds = %44
  %sz.promoted153 = load i32, ptr @sz, align 4, !tbaa !5
  br label %.lr.ph110.preheader

.preheader82:                                     ; preds = %.preheader82.preheader, %._crit_edge100
  %45 = phi i32 [ %51, %._crit_edge100 ], [ %.ph, %.preheader82.preheader ]
  %46 = phi i32 [ %52, %._crit_edge100 ], [ %34, %.preheader82.preheader ]
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %._crit_edge100 ], [ 1, %.preheader82.preheader ]
  %.not7997 = icmp slt i32 %46, 0
  br i1 %.not7997, label %._crit_edge100, label %.lr.ph99

.lr.ph99:                                         ; preds = %.preheader82
  %47 = add nsw i64 %indvars.iv131, -1
  %48 = getelementptr inbounds [32001 x i32], ptr @pr, i64 0, i64 %indvars.iv131
  %.pre = load i32, ptr %48, align 4, !tbaa !5
  br label %54

.preheader81:                                     ; preds = %._crit_edge100
  %sz.promoted = load i32, ptr @sz, align 4, !tbaa !5
  %49 = icmp sgt i32 %51, 0
  br i1 %49, label %.lr.ph104.preheader, label %.preheader

.lr.ph104.preheader:                              ; preds = %.preheader81
  %50 = zext nneg i32 %51 to i64
  br label %.lr.ph104

._crit_edge100.loopexit:                          ; preds = %._crit_edge96
  %.pre143 = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %._crit_edge100.loopexit, %.preheader82
  %51 = phi i32 [ %.pre143, %._crit_edge100.loopexit ], [ %45, %.preheader82 ]
  %52 = phi i32 [ %65, %._crit_edge100.loopexit ], [ %46, %.preheader82 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %53 = sext i32 %51 to i64
  %.not76.not = icmp slt i64 %indvars.iv131, %53
  br i1 %.not76.not, label %.preheader82, label %.preheader81, !llvm.loop !13

54:                                               ; preds = %.lr.ph99, %._crit_edge96
  %55 = phi i32 [ %.pre, %.lr.ph99 ], [ %62, %._crit_edge96 ]
  %indvars.iv128 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next129, %._crit_edge96 ]
  %56 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %47, i64 %indvars.iv128
  %57 = load double, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %indvars.iv131, i64 %indvars.iv128
  store double %57, ptr %58, align 8, !tbaa !15
  %59 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %indvars.iv131, i64 %indvars.iv128
  store i32 0, ptr %59, align 4, !tbaa !5
  %60 = sitofp i32 %55 to double
  %61 = tail call double @log(double noundef %60) #6
  %62 = load i32, ptr %48, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %.not8091 = icmp slt i64 %indvars.iv128, %63
  br i1 %.not8091, label %._crit_edge96, label %.lr.ph95

.lr.ph95:                                         ; preds = %54
  %.promoted = load double, ptr %58, align 8, !tbaa !15
  %64 = trunc nuw nsw i64 %indvars.iv128 to i32
  br label %67

._crit_edge96:                                    ; preds = %76, %54
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %65 = load i32, ptr @lim, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %.not79.not = icmp slt i64 %indvars.iv128, %66
  br i1 %.not79.not, label %54, label %._crit_edge100.loopexit, !llvm.loop !17

67:                                               ; preds = %.lr.ph95, %76
  %68 = phi double [ %.promoted, %.lr.ph95 ], [ %77, %76 ]
  %.06193 = phi i32 [ %62, %.lr.ph95 ], [ %78, %76 ]
  %.06392 = phi double [ %61, %.lr.ph95 ], [ %79, %76 ]
  %69 = sub nsw i32 %64, %.06193
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [151 x [32001 x double]], ptr @f, i64 0, i64 %47, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = fadd double %.06392, %72
  %74 = fcmp olt double %68, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %67
  store double %73, ptr %58, align 8, !tbaa !15
  store i32 %.06193, ptr %59, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %67, %75
  %77 = phi double [ %68, %67 ], [ %73, %75 ]
  %78 = mul nsw i32 %.06193, %62
  %79 = fadd double %61, %.06392
  %80 = sext i32 %78 to i64
  %.not80 = icmp slt i64 %indvars.iv128, %80
  br i1 %.not80, label %._crit_edge96, label %67, !llvm.loop !18

.preheader:                                       ; preds = %96, %.preheader81
  %sz.promoted108 = phi i32 [ %sz.promoted, %.preheader81 ], [ %97, %96 ]
  %lim.promoted106 = phi i32 [ %52, %.preheader81 ], [ %98, %96 ]
  %.not77109 = icmp eq i32 %lim.promoted106, 0
  br i1 %.not77109, label %103, label %.lr.ph110.preheader

.lr.ph110.preheader:                              ; preds = %.preheader.thread, %.preheader
  %.in = phi i32 [ %34, %.preheader.thread ], [ %lim.promoted106, %.preheader ]
  %sz.promoted108157 = phi i32 [ %sz.promoted153, %.preheader.thread ], [ %sz.promoted108, %.preheader ]
  %81 = sext i32 %sz.promoted108157 to i64
  %82 = zext i32 %.in to i64
  %min.iters.check = icmp ult i32 %.in, 8
  br i1 %min.iters.check, label %.lr.ph110.preheader178, label %vector.ph

.lr.ph110.preheader178:                           ; preds = %middle.block, %.lr.ph110.preheader
  %indvars.iv137.ph = phi i64 [ %81, %.lr.ph110.preheader ], [ %ind.end, %middle.block ]
  %.in166.ph = phi i32 [ %.in, %.lr.ph110.preheader ], [ %ind.end176, %middle.block ]
  br label %.lr.ph110

vector.ph:                                        ; preds = %.lr.ph110.preheader
  %n.vec = and i64 %82, 4294967288
  %ind.end = add nsw i64 %n.vec, %81
  %.cast = trunc nuw i64 %n.vec to i32
  %ind.end176 = sub i32 %.in, %.cast
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %37, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %81
  %83 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %offset.idx
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  store <4 x i32> %broadcast.splat, ptr %83, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %84, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %85 = icmp eq i64 %index.next, %n.vec
  br i1 %85, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %82
  br i1 %cmp.n, label %._crit_edge111, label %.lr.ph110.preheader178

.lr.ph104:                                        ; preds = %.lr.ph104.preheader, %96
  %indvars.iv134 = phi i64 [ %50, %.lr.ph104.preheader ], [ %indvars.iv.next135, %96 ]
  %86 = phi i32 [ %52, %.lr.ph104.preheader ], [ %98, %96 ]
  %87 = phi i32 [ %sz.promoted, %.lr.ph104.preheader ], [ %97, %96 ]
  %88 = sext i32 %86 to i64
  %89 = getelementptr inbounds [151 x [32001 x i32]], ptr @g, i64 0, i64 %indvars.iv134, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %.not78 = icmp eq i32 %90, 0
  br i1 %.not78, label %96, label %91

91:                                               ; preds = %.lr.ph104
  %92 = mul nsw i32 %90, %37
  %93 = add nsw i32 %87, 1
  store i32 %93, ptr @sz, align 4, !tbaa !5
  %94 = sext i32 %87 to i64
  %95 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %.lr.ph104, %91
  %97 = phi i32 [ %87, %.lr.ph104 ], [ %93, %91 ]
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, -1
  %98 = sub nsw i32 %86, %90
  %99 = icmp sgt i64 %indvars.iv134, 1
  br i1 %99, label %.lr.ph104, label %.preheader, !llvm.loop !22

.lr.ph110:                                        ; preds = %.lr.ph110.preheader178, %.lr.ph110
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.lr.ph110 ], [ %indvars.iv137.ph, %.lr.ph110.preheader178 ]
  %.in166 = phi i32 [ %100, %.lr.ph110 ], [ %.in166.ph, %.lr.ph110.preheader178 ]
  %100 = add nsw i32 %.in166, -1
  %indvars.iv.next138 = add nsw i64 %indvars.iv137, 1
  %101 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %indvars.iv137
  store i32 %37, ptr %101, align 4, !tbaa !5
  %.not77 = icmp eq i32 %100, 0
  br i1 %.not77, label %._crit_edge111, label %.lr.ph110, !llvm.loop !23

._crit_edge111:                                   ; preds = %.lr.ph110, %middle.block
  %indvars.iv.next138.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next138, %.lr.ph110 ]
  %102 = trunc nsw i64 %indvars.iv.next138.lcssa to i32
  store i32 %102, ptr @sz, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %._crit_edge111, %.preheader
  %104 = phi i32 [ %102, %._crit_edge111 ], [ %sz.promoted108, %.preheader ]
  store i32 -1, ptr @lim, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr @out, i64 %105
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @out, ptr noundef nonnull %106)
  %107 = load i32, ptr @sz, align 4, !tbaa !5
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %.lr.ph116, label %.loopexit

.lr.ph116:                                        ; preds = %103, %.lr.ph116
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph116 ], [ 0, %103 ]
  %109 = phi i32 [ %120, %.lr.ph116 ], [ %107, %103 ]
  %110 = getelementptr inbounds [501 x i32], ptr @out, i64 0, i64 %indvars.iv140
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %109, -1
  %113 = zext i32 %112 to i64
  %114 = icmp eq i64 %indvars.iv140, %113
  %115 = zext i1 %114 to i64
  %116 = getelementptr inbounds [3 x i8], ptr @.str.5, i64 0, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !24
  %118 = sext i8 %117 to i32
  %119 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %111, i32 noundef %118)
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %120 = load i32, ptr @sz, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next141, %121
  br i1 %122, label %.lr.ph116, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %.lr.ph116, %103, %39
  ret i32 0
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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 = { 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 = { noreturn 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { noreturn nounwind }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !21, !20}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !10}


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