; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-17 (E - Navigation - lzy)

; 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
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@v1 = external dso_local global i32, align 4
@v2 = external dso_local global i32, align 4
@a = external dso_local global [29 x i32], align 16
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@x = external dso_local global [1609 x i32], align 16
@y = external dso_local global [1609 x i32], align 16
@p = external dso_local global [1609 x i32], align 16
@r = external dso_local global [1609 x [1609 x double]], align 16
@use = external dso_local global [1609 x i8], align 16
@s = external dso_local global [1609 x double], align 16
@ans = external dso_local global double, align 8
@ptr = external dso_local global i32, align 4
@stk = external dso_local global [2560009 x i32], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3disii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k, ptr noundef @v1, ptr noundef @v2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %24, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %27

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds i32, ptr @x, i64 %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr @y, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %19, ptr noundef %22)
  br label %24

24:                                               ; preds = %16
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

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

28:                                               ; preds = %64, %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %60, %33
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %63

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = call noundef double @_Z3disii(i32 noundef %42, i32 noundef %43)
  %45 = load i32, ptr @v2, align 4, !tbaa !5
  %46 = sitofp i32 %45 to double
  %47 = fdiv double %44, %46
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %49
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1609 x double], ptr %50, i64 0, i64 %52
  store double %47, ptr %53, align 8, !tbaa !11
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1609 x double], ptr %56, i64 0, i64 %58
  store double %47, ptr %59, align 8, !tbaa !11
  br label %60

60:                                               ; preds = %41
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !13

63:                                               ; preds = %40
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !14

67:                                               ; preds = %32
  br label %68

68:                                               ; preds = %72, %67
  %69 = load i32, ptr @m, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @m, align 4, !tbaa !5
  %71 = icmp ne i32 %69, 0
  br i1 %71, label %72, label %92

72:                                               ; preds = %68
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @u, ptr noundef @v)
  %74 = load i32, ptr @u, align 4, !tbaa !5
  %75 = load i32, ptr @v, align 4, !tbaa !5
  %76 = call noundef double @_Z3disii(i32 noundef %74, i32 noundef %75)
  %77 = load i32, ptr @v1, align 4, !tbaa !5
  %78 = sitofp i32 %77 to double
  %79 = fdiv double %76, %78
  %80 = load i32, ptr @v, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %81
  %83 = load i32, ptr @u, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1609 x double], ptr %82, i64 0, i64 %84
  store double %79, ptr %85, align 8, !tbaa !11
  %86 = load i32, ptr @u, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %87
  %89 = load i32, ptr @v, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1609 x double], ptr %88, i64 0, i64 %90
  store double %79, ptr %91, align 8, !tbaa !11
  br label %68, !llvm.loop !15

92:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %103, %92
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = load i32, ptr @k, align 4, !tbaa !5
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %106

98:                                               ; preds = %93
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr @a, i64 %100
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %101)
  br label %103

103:                                              ; preds = %98
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %6, align 4, !tbaa !5
  br label %93, !llvm.loop !16

106:                                              ; preds = %97
  store i32 1, ptr @a, align 16, !tbaa !5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = load i32, ptr @k, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %110
  store i32 %107, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %260, %106
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = load i32, ptr @k, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %263

117:                                              ; preds = %112
  store i32 0, ptr @u, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %129, %117
  %119 = load i32, ptr @u, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %122, label %132

122:                                              ; preds = %118
  %123 = load i32, ptr @u, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %124
  store i8 0, ptr %125, align 1, !tbaa !17
  %126 = load i32, ptr @u, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %127
  store double 1.000000e+16, ptr %128, align 8, !tbaa !11
  br label %129

129:                                              ; preds = %122
  %130 = load i32, ptr @u, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr @u, align 4, !tbaa !5
  br label %118, !llvm.loop !19

132:                                              ; preds = %118
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %138
  store double 0.000000e+00, ptr %139, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %223, %132
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %226

145:                                              ; preds = %140
  store i32 0, ptr @u, align 4, !tbaa !5
  store i32 1, ptr @v, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %169, %145
  %147 = load i32, ptr @v, align 4, !tbaa !5
  %148 = load i32, ptr @n, align 4, !tbaa !5
  %149 = icmp sle i32 %147, %148
  br i1 %149, label %150, label %172

150:                                              ; preds = %146
  %151 = load i32, ptr @v, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !17, !range !20, !noundef !21
  %155 = trunc i8 %154 to i1
  br i1 %155, label %168, label %156

156:                                              ; preds = %150
  %157 = load i32, ptr @u, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %158
  %160 = load double, ptr %159, align 8, !tbaa !11
  %161 = load i32, ptr @v, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !11
  %165 = fcmp ogt double %160, %164
  br i1 %165, label %166, label %168

166:                                              ; preds = %156
  %167 = load i32, ptr @v, align 4, !tbaa !5
  store i32 %167, ptr @u, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %166, %156, %150
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr @v, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr @v, align 4, !tbaa !5
  br label %146, !llvm.loop !22

172:                                              ; preds = %146
  %173 = load i32, ptr @u, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %174
  store i8 1, ptr %175, align 1, !tbaa !17
  store i32 1, ptr @v, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %219, %172
  %177 = load i32, ptr @v, align 4, !tbaa !5
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %180, label %222

180:                                              ; preds = %176
  %181 = load i32, ptr @v, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = load i32, ptr @u, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = load i32, ptr @u, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %190
  %192 = load i32, ptr @v, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1609 x double], ptr %191, i64 0, i64 %193
  %195 = load double, ptr %194, align 8, !tbaa !11
  %196 = fadd double %188, %195
  %197 = fcmp ogt double %184, %196
  br i1 %197, label %198, label %218

198:                                              ; preds = %180
  %199 = load i32, ptr @u, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %200
  %202 = load double, ptr %201, align 8, !tbaa !11
  %203 = load i32, ptr @u, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %204
  %206 = load i32, ptr @v, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1609 x double], ptr %205, i64 0, i64 %207
  %209 = load double, ptr %208, align 8, !tbaa !11
  %210 = fadd double %202, %209
  %211 = load i32, ptr @v, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %212
  store double %210, ptr %213, align 8, !tbaa !11
  %214 = load i32, ptr @u, align 4, !tbaa !5
  %215 = load i32, ptr @v, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %216
  store i32 %214, ptr %217, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %198, %180
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr @v, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @v, align 4, !tbaa !5
  br label %176, !llvm.loop !23

222:                                              ; preds = %176
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %8, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %8, align 4, !tbaa !5
  br label %140, !llvm.loop !24

226:                                              ; preds = %144
  %227 = load i32, ptr %7, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  store i32 %230, ptr @u, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %245, %226
  %232 = load i32, ptr @u, align 4, !tbaa !5
  %233 = load i32, ptr %7, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = icmp ne i32 %232, %237
  br i1 %238, label %239, label %250

239:                                              ; preds = %231
  %240 = load i32, ptr @u, align 4, !tbaa !5
  %241 = load i32, ptr @ptr, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr @ptr, align 4, !tbaa !5
  %243 = sext i32 %241 to i64
  %244 = getelementptr inbounds [2560009 x i32], ptr @stk, i64 0, i64 %243
  store i32 %240, ptr %244, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %239
  %246 = load i32, ptr @u, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  store i32 %249, ptr @u, align 4, !tbaa !5
  br label %231, !llvm.loop !25

250:                                              ; preds = %231
  %251 = load i32, ptr %7, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %255
  %257 = load double, ptr %256, align 8, !tbaa !11
  %258 = load double, ptr @ans, align 8, !tbaa !11
  %259 = fadd double %258, %257
  store double %259, ptr @ans, align 8, !tbaa !11
  br label %260

260:                                              ; preds = %250
  %261 = load i32, ptr %7, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %7, align 4, !tbaa !5
  br label %112, !llvm.loop !26

263:                                              ; preds = %116
  %264 = load double, ptr @ans, align 8, !tbaa !11
  %265 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %264)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %277, %263
  %267 = load i32, ptr %9, align 4, !tbaa !5
  %268 = load i32, ptr @ptr, align 4, !tbaa !5
  %269 = icmp slt i32 %267, %268
  br i1 %269, label %271, label %270

270:                                              ; preds = %266
  store i32 34, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %280

271:                                              ; preds = %266
  %272 = load i32, ptr %9, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [2560009 x i32], ptr @stk, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %275)
  br label %277

277:                                              ; preds = %271
  %278 = load i32, ptr %9, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %9, align 4, !tbaa !5
  br label %266, !llvm.loop !27

280:                                              ; preds = %270
  %281 = load i32, ptr @n, align 4, !tbaa !5
  %282 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %281)
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress 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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@v1 = external dso_local global i32, align 4
@v2 = external dso_local global i32, align 4
@a = external dso_local global [29 x i32], align 16
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@x = external dso_local global [1609 x i32], align 16
@y = external dso_local global [1609 x i32], align 16
@p = external dso_local local_unnamed_addr global [1609 x i32], align 16
@r = external dso_local local_unnamed_addr global [1609 x [1609 x double]], align 16
@use = external dso_local local_unnamed_addr global [1609 x i8], align 16
@s = external dso_local local_unnamed_addr global [1609 x double], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@ptr = external dso_local local_unnamed_addr global i32, align 4
@stk = external dso_local local_unnamed_addr global [2560009 x i32], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3disii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k, ptr noundef nonnull @v1, ptr noundef nonnull @v2)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not56 = icmp slt i32 %2, 1
  br i1 %.not56, label %.preheader54, label %.lr.ph

.preheader55:                                     ; preds = %.lr.ph
  %.not4061 = icmp slt i32 %6, 1
  br i1 %.not4061, label %.preheader54, label %.lr.ph63

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %3 = getelementptr inbounds i32, ptr @x, i64 %indvars.iv
  %4 = getelementptr inbounds i32, ptr @y, i64 %indvars.iv
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %.not.not = icmp slt i64 %indvars.iv, %7
  br i1 %.not.not, label %.lr.ph, label %.preheader55, !llvm.loop !9

.loopexit.loopexit:                               ; preds = %14
  %.pre160 = sext i32 %22 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph63
  %.pre-phi = phi i64 [ %.pre160, %.loopexit.loopexit ], [ %12, %.lr.ph63 ]
  %8 = phi i32 [ %22, %.loopexit.loopexit ], [ %11, %.lr.ph63 ]
  %.not40.not = icmp slt i64 %indvars.iv129, %.pre-phi
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  br i1 %.not40.not, label %.lr.ph63, label %.preheader54, !llvm.loop !11

.preheader54:                                     ; preds = %.loopexit, %0, %.preheader55
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @m, align 4, !tbaa !5
  %.not4164 = icmp eq i32 %9, 0
  br i1 %.not4164, label %.preheader53, label %.lr.ph65

.lr.ph63:                                         ; preds = %.preheader55, %.loopexit
  %11 = phi i32 [ %8, %.loopexit ], [ %6, %.preheader55 ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %.loopexit ], [ 1, %.preheader55 ]
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %.loopexit ], [ 2, %.preheader55 ]
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %12 = sext i32 %11 to i64
  %.not5258.not = icmp slt i64 %indvars.iv129, %12
  br i1 %.not5258.not, label %.lr.ph60, label %.loopexit

.lr.ph60:                                         ; preds = %.lr.ph63
  %13 = trunc nuw nsw i64 %indvars.iv129 to i32
  br label %14

14:                                               ; preds = %.lr.ph60, %14
  %indvars.iv126 = phi i64 [ %indvars.iv124, %.lr.ph60 ], [ %indvars.iv.next127, %14 ]
  %15 = trunc nuw i64 %indvars.iv126 to i32
  %16 = tail call noundef double @_Z3disii(i32 noundef %13, i32 noundef %15)
  %17 = load i32, ptr @v2, align 4, !tbaa !5
  %18 = sitofp i32 %17 to double
  %19 = fdiv double %16, %18
  %20 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %indvars.iv126, i64 %indvars.iv129
  store double %19, ptr %20, align 8, !tbaa !12
  %21 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %indvars.iv129, i64 %indvars.iv126
  store double %19, ptr %21, align 8, !tbaa !12
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %.not52.not = icmp sgt i32 %22, %15
  br i1 %.not52.not, label %14, label %.loopexit.loopexit, !llvm.loop !14

.preheader53:                                     ; preds = %.lr.ph65, %.preheader54
  %23 = load i32, ptr @k, align 4, !tbaa !5
  %.not4266 = icmp slt i32 %23, 1
  br i1 %.not4266, label %._crit_edge, label %.lr.ph68

.lr.ph65:                                         ; preds = %.preheader54, %.lr.ph65
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @u, ptr noundef nonnull @v)
  %25 = load i32, ptr @u, align 4, !tbaa !5
  %26 = load i32, ptr @v, align 4, !tbaa !5
  %27 = tail call noundef double @_Z3disii(i32 noundef %25, i32 noundef %26)
  %28 = load i32, ptr @v1, align 4, !tbaa !5
  %29 = sitofp i32 %28 to double
  %30 = fdiv double %27, %29
  %31 = load i32, ptr @v, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = load i32, ptr @u, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %32, i64 %34
  store double %30, ptr %35, align 8, !tbaa !12
  %36 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %34, i64 %32
  store double %30, ptr %36, align 8, !tbaa !12
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr @m, align 4, !tbaa !5
  %.not41 = icmp eq i32 %37, 0
  br i1 %.not41, label %.preheader53, label %.lr.ph65, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph68, %.preheader53
  %.lcssa = phi i32 [ %23, %.preheader53 ], [ %51, %.lr.ph68 ]
  store i32 1, ptr @a, align 16, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add i32 %.lcssa, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !5
  %.not43109 = icmp slt i32 %.lcssa, 0
  %.pre = load double, ptr @ans, align 8, !tbaa !12
  br i1 %.not43109, label %._crit_edge._crit_edge, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %ptr.promoted106 = load i32, ptr @ptr, align 4, !tbaa !5
  %.not4469 = icmp slt i32 %39, 0
  %.not4591 = icmp slt i32 %39, 1
  %43 = add i32 %39, 1
  %44 = zext i32 %43 to i64
  %wide.trip.count155 = zext i32 %40 to i64
  %45 = add nsw i64 %44, -1
  %46 = add nsw i64 %44, -2
  %min.iters.check = icmp ult i32 %43, 4
  %n.vec = and i64 %44, 4294967292
  %cmp.n = icmp eq i64 %n.vec, %44
  %xtraiter = and i64 %45, 1
  %47 = icmp eq i64 %46, 0
  %unroll_iter = and i64 %45, -2
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter182 = and i64 %45, 1
  %48 = icmp eq i64 %46, 0
  %unroll_iter184 = and i64 %45, -2
  %lcmp.mod183.not = icmp eq i64 %xtraiter182, 0
  br label %.preheader

.lr.ph68:                                         ; preds = %.preheader53, %.lr.ph68
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %.lr.ph68 ], [ 1, %.preheader53 ]
  %49 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv132
  %50 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %49)
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %51 = load i32, ptr @k, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %.not42.not = icmp slt i64 %indvars.iv132, %52
  br i1 %.not42.not, label %.lr.ph68, label %._crit_edge, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %149
  %indvars.iv152 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next153163, %149 ]
  %.lcssa105108110 = phi i32 [ %ptr.promoted106, %.preheader.lr.ph ], [ %.lcssa105107, %149 ]
  %53 = phi double [ %.pre, %.preheader.lr.ph ], [ %153, %149 ]
  br i1 %.not4469, label %._crit_edge72.thread, label %.lr.ph71.preheader

._crit_edge72.thread:                             ; preds = %.preheader
  %indvars.iv.next153162 = add nuw nsw i64 %indvars.iv152, 1
  %54 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %indvars.iv.next153162
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %56
  store double 0.000000e+00, ptr %57, align 8, !tbaa !12
  br label %70

.lr.ph71.preheader:                               ; preds = %.preheader
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @use, i8 0, i64 %44, i1 false), !tbaa !17
  br i1 %min.iters.check, label %.lr.ph71.preheader174, label %vector.body

.lr.ph71.preheader174:                            ; preds = %middle.block, %.lr.ph71.preheader
  %indvars.iv135.ph = phi i64 [ 0, %.lr.ph71.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph71

vector.body:                                      ; preds = %.lr.ph71.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph71.preheader ]
  %58 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <2 x double> <double 1.000000e+16, double 1.000000e+16>, ptr %58, align 16, !tbaa !12
  store <2 x double> <double 1.000000e+16, double 1.000000e+16>, ptr %59, align 16, !tbaa !12
  %index.next = add nuw i64 %index, 4
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge72, label %.lr.ph71.preheader174

._crit_edge112:                                   ; preds = %149
  store i32 %71, ptr @u, align 4, !tbaa !5
  store double %153, ptr @ans, align 8, !tbaa !12
  br label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge, %._crit_edge112
  %61 = phi double [ %153, %._crit_edge112 ], [ %.pre, %._crit_edge ]
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %61)
  %63 = load i32, ptr @ptr, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph116, label %._crit_edge117

.lr.ph71:                                         ; preds = %.lr.ph71.preheader174, %.lr.ph71
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.lr.ph71 ], [ %indvars.iv135.ph, %.lr.ph71.preheader174 ]
  %65 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv135
  store double 1.000000e+16, ptr %65, align 8, !tbaa !12
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next136, %44
  br i1 %exitcond.not, label %._crit_edge72, label %.lr.ph71, !llvm.loop !22

._crit_edge72:                                    ; preds = %.lr.ph71, %middle.block
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %66 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %indvars.iv.next153
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %68
  store double 0.000000e+00, ptr %69, align 8, !tbaa !12
  br i1 %.not4591, label %70, label %.lr.ph94

._crit_edge95:                                    ; preds = %._crit_edge87
  store i32 %43, ptr @v, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %._crit_edge72.thread, %._crit_edge95, %._crit_edge72
  %71 = phi i32 [ %55, %._crit_edge72.thread ], [ %67, %._crit_edge95 ], [ %67, %._crit_edge72 ]
  %indvars.iv.next153163 = phi i64 [ %indvars.iv.next153162, %._crit_edge72.thread ], [ %indvars.iv.next153, %._crit_edge95 ], [ %indvars.iv.next153, %._crit_edge72 ]
  %72 = getelementptr inbounds [29 x i32], ptr @a, i64 0, i64 %indvars.iv152
  %storemerge4698 = load i32, ptr %72, align 4, !tbaa !5
  %.not4799 = icmp eq i32 %storemerge4698, %71
  br i1 %.not4799, label %149, label %.lr.ph102.preheader

.lr.ph102.preheader:                              ; preds = %70
  %73 = sext i32 %.lcssa105108110 to i64
  br label %.lr.ph102

.lr.ph94:                                         ; preds = %._crit_edge72, %._crit_edge87
  %.02992 = phi i32 [ %144, %._crit_edge87 ], [ 1, %._crit_edge72 ]
  br i1 %47, label %._crit_edge81.unr-lcssa, label %.lr.ph94.new

.lr.ph94.new:                                     ; preds = %.lr.ph94, %99
  %indvars.iv138 = phi i64 [ %indvars.iv.next139.1, %99 ], [ 1, %.lr.ph94 ]
  %storemerge487577 = phi i32 [ %storemerge4874.1, %99 ], [ 0, %.lr.ph94 ]
  %niter = phi i64 [ %niter.next.1, %99 ], [ 0, %.lr.ph94 ]
  %74 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %indvars.iv138
  %75 = load i8, ptr %74, align 1, !tbaa !17, !range !23, !noundef !24
  %76 = trunc nuw i8 %75 to i1
  br i1 %76, label %86, label %77

77:                                               ; preds = %.lr.ph94.new
  %78 = sext i32 %storemerge487577 to i64
  %79 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !12
  %81 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv138
  %82 = load double, ptr %81, align 8, !tbaa !12
  %83 = fcmp ogt double %80, %82
  br i1 %83, label %84, label %86

84:                                               ; preds = %77
  %85 = trunc nuw nsw i64 %indvars.iv138 to i32
  br label %86

86:                                               ; preds = %.lr.ph94.new, %77, %84
  %storemerge4874 = phi i32 [ %storemerge487577, %.lr.ph94.new ], [ %storemerge487577, %77 ], [ %85, %84 ]
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %87 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %indvars.iv.next139
  %88 = load i8, ptr %87, align 1, !tbaa !17, !range !23, !noundef !24
  %89 = trunc nuw i8 %88 to i1
  br i1 %89, label %99, label %90

90:                                               ; preds = %86
  %91 = sext i32 %storemerge4874 to i64
  %92 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !12
  %94 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv.next139
  %95 = load double, ptr %94, align 8, !tbaa !12
  %96 = fcmp ogt double %93, %95
  br i1 %96, label %97, label %99

97:                                               ; preds = %90
  %98 = trunc nuw nsw i64 %indvars.iv.next139 to i32
  br label %99

99:                                               ; preds = %97, %90, %86
  %storemerge4874.1 = phi i32 [ %storemerge4874, %86 ], [ %storemerge4874, %90 ], [ %98, %97 ]
  %indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138, 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 %._crit_edge81.unr-lcssa, label %.lr.ph94.new, !llvm.loop !25

._crit_edge81.unr-lcssa:                          ; preds = %99, %.lr.ph94
  %storemerge4874.lcssa.ph = phi i32 [ poison, %.lr.ph94 ], [ %storemerge4874.1, %99 ]
  %indvars.iv138.unr = phi i64 [ 1, %.lr.ph94 ], [ %indvars.iv.next139.1, %99 ]
  %storemerge487577.unr = phi i32 [ 0, %.lr.ph94 ], [ %storemerge4874.1, %99 ]
  br i1 %lcmp.mod.not, label %._crit_edge81, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge81.unr-lcssa
  %100 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %indvars.iv138.unr
  %101 = load i8, ptr %100, align 1, !tbaa !17, !range !23, !noundef !24
  %102 = trunc nuw i8 %101 to i1
  br i1 %102, label %._crit_edge81, label %103

103:                                              ; preds = %.epil.preheader
  %104 = sext i32 %storemerge487577.unr to i64
  %105 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !12
  %107 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv138.unr
  %108 = load double, ptr %107, align 8, !tbaa !12
  %109 = fcmp ogt double %106, %108
  br i1 %109, label %110, label %._crit_edge81

110:                                              ; preds = %103
  %111 = trunc nuw nsw i64 %indvars.iv138.unr to i32
  br label %._crit_edge81

._crit_edge81:                                    ; preds = %.epil.preheader, %103, %110, %._crit_edge81.unr-lcssa
  %storemerge4874.lcssa = phi i32 [ %storemerge4874.lcssa.ph, %._crit_edge81.unr-lcssa ], [ %storemerge487577.unr, %.epil.preheader ], [ %storemerge487577.unr, %103 ], [ %111, %110 ]
  %112 = sext i32 %storemerge4874.lcssa to i64
  %113 = getelementptr inbounds [1609 x i8], ptr @use, i64 0, i64 %112
  store i8 1, ptr %113, align 1, !tbaa !17
  %114 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %112
  br i1 %48, label %._crit_edge87.unr-lcssa, label %._crit_edge81.new

._crit_edge81.new:                                ; preds = %._crit_edge81, %134
  %indvars.iv143 = phi i64 [ %indvars.iv.next144.1, %134 ], [ 1, %._crit_edge81 ]
  %niter185 = phi i64 [ %niter185.next.1, %134 ], [ 0, %._crit_edge81 ]
  %115 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv143
  %116 = load double, ptr %115, align 8, !tbaa !12
  %117 = load double, ptr %114, align 8, !tbaa !12
  %118 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %112, i64 %indvars.iv143
  %119 = load double, ptr %118, align 8, !tbaa !12
  %120 = fadd double %117, %119
  %121 = fcmp ogt double %116, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %._crit_edge81.new
  store double %120, ptr %115, align 8, !tbaa !12
  %123 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %indvars.iv143
  store i32 %storemerge4874.lcssa, ptr %123, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %._crit_edge81.new, %122
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %125 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv.next144
  %126 = load double, ptr %125, align 8, !tbaa !12
  %127 = load double, ptr %114, align 8, !tbaa !12
  %128 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %112, i64 %indvars.iv.next144
  %129 = load double, ptr %128, align 8, !tbaa !12
  %130 = fadd double %127, %129
  %131 = fcmp ogt double %126, %130
  br i1 %131, label %132, label %134

132:                                              ; preds = %124
  store double %130, ptr %125, align 8, !tbaa !12
  %133 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %indvars.iv.next144
  store i32 %storemerge4874.lcssa, ptr %133, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %132, %124
  %indvars.iv.next144.1 = add nuw nsw i64 %indvars.iv143, 2
  %niter185.next.1 = add i64 %niter185, 2
  %niter185.ncmp.1 = icmp eq i64 %niter185.next.1, %unroll_iter184
  br i1 %niter185.ncmp.1, label %._crit_edge87.unr-lcssa, label %._crit_edge81.new, !llvm.loop !26

._crit_edge87.unr-lcssa:                          ; preds = %134, %._crit_edge81
  %indvars.iv143.unr = phi i64 [ 1, %._crit_edge81 ], [ %indvars.iv.next144.1, %134 ]
  br i1 %lcmp.mod183.not, label %._crit_edge87, label %.epil.preheader181

.epil.preheader181:                               ; preds = %._crit_edge87.unr-lcssa
  %135 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %indvars.iv143.unr
  %136 = load double, ptr %135, align 8, !tbaa !12
  %137 = load double, ptr %114, align 8, !tbaa !12
  %138 = getelementptr inbounds [1609 x [1609 x double]], ptr @r, i64 0, i64 %112, i64 %indvars.iv143.unr
  %139 = load double, ptr %138, align 8, !tbaa !12
  %140 = fadd double %137, %139
  %141 = fcmp ogt double %136, %140
  br i1 %141, label %142, label %._crit_edge87

142:                                              ; preds = %.epil.preheader181
  store double %140, ptr %135, align 8, !tbaa !12
  %143 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %indvars.iv143.unr
  store i32 %storemerge4874.lcssa, ptr %143, align 4, !tbaa !5
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %.epil.preheader181, %142, %._crit_edge87.unr-lcssa
  %144 = add nuw i32 %.02992, 1
  %exitcond148.not = icmp eq i32 %.02992, %39
  br i1 %exitcond148.not, label %._crit_edge95, label %.lr.ph94, !llvm.loop !27

.lr.ph102:                                        ; preds = %.lr.ph102.preheader, %.lr.ph102
  %indvars.iv149 = phi i64 [ %73, %.lr.ph102.preheader ], [ %indvars.iv.next150, %.lr.ph102 ]
  %storemerge46100 = phi i32 [ %storemerge4698, %.lr.ph102.preheader ], [ %storemerge46, %.lr.ph102 ]
  %indvars.iv.next150 = add nsw i64 %indvars.iv149, 1
  %145 = getelementptr inbounds [2560009 x i32], ptr @stk, i64 0, i64 %indvars.iv149
  store i32 %storemerge46100, ptr %145, align 4, !tbaa !5
  %146 = sext i32 %storemerge46100 to i64
  %147 = getelementptr inbounds [1609 x i32], ptr @p, i64 0, i64 %146
  %storemerge46 = load i32, ptr %147, align 4, !tbaa !5
  %.not47 = icmp eq i32 %storemerge46, %71
  br i1 %.not47, label %._crit_edge103, label %.lr.ph102, !llvm.loop !28

._crit_edge103:                                   ; preds = %.lr.ph102
  %148 = trunc nsw i64 %indvars.iv.next150 to i32
  store i32 %148, ptr @ptr, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %._crit_edge103, %70
  %.lcssa105107 = phi i32 [ %148, %._crit_edge103 ], [ %.lcssa105108110, %70 ]
  %150 = sext i32 %storemerge4698 to i64
  %151 = getelementptr inbounds [1609 x double], ptr @s, i64 0, i64 %150
  %152 = load double, ptr %151, align 8, !tbaa !12
  %153 = fadd double %152, %53
  %exitcond156.not = icmp eq i64 %indvars.iv.next153163, %wide.trip.count155
  br i1 %exitcond156.not, label %._crit_edge112, label %.preheader, !llvm.loop !29

._crit_edge117:                                   ; preds = %.lr.ph116, %._crit_edge._crit_edge
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %154)
  ret i32 0

.lr.ph116:                                        ; preds = %._crit_edge._crit_edge, %.lr.ph116
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %.lr.ph116 ], [ 0, %._crit_edge._crit_edge ]
  %156 = getelementptr inbounds [2560009 x i32], ptr @stk, i64 0, i64 %indvars.iv157
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %157)
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %159 = load i32, ptr @ptr, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = icmp slt i64 %indvars.iv.next158, %160
  br i1 %161, label %.lr.ph116, label %._crit_edge117, !llvm.loop !30
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress 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 = { mustprogress 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10, !21, !20}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}


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