; LLVM IR from walidbosso/C_TSPBBO :: TSPBBO (main)

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

@initialized = external dso_local global [1000 x [1000 x i32]], align 16
@num_cities = external dso_local global i32, align 4
@distance = external dso_local global [1000 x [1000 x double]], align 16
@population = external dso_local global [1000 x [1000 x i32]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@best_cost = external dso_local global double, align 8
@worst_cost = external dso_local global double, align 8
@best_path = external dso_local global [1000 x i32], align 16
@worst_path = external dso_local global [1000 x i32], align 16
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @calculate_cost(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @migration(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @mutation(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @init_population() #0

; Function Attrs: nounwind uwtable
define dso_local 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 double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 @system(ptr noundef @.str)
  store i32 1, ptr @num_cities, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %310, %0
  %15 = load i32, ptr @num_cities, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %17, label %316

17:                                               ; preds = %14
  %18 = call i64 @time(ptr noundef null) #4
  %19 = trunc i64 %18 to i32
  call void @srand(i32 noundef %19) #4
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @num_cities)
  %23 = load i32, ptr @num_cities, align 4, !tbaa !5
  %24 = icmp sle i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %17
  br label %316

26:                                               ; preds = %17
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %145, %26
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @num_cities, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %148

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

36:                                               ; preds = %140, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @num_cities, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %62

45:                                               ; preds = %41
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %47
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1000 x double], ptr %48, i64 0, i64 %50
  store double 0.000000e+00, ptr %51, align 8, !tbaa !9
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1000 x double], ptr %56, i64 0, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %52, i32 noundef %53, double noundef %60)
  br label %140

62:                                               ; preds = %41
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1000 x [1000 x i32]], ptr @initialized, i64 0, i64 %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1000 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 1
  br i1 %70, label %71, label %95

71:                                               ; preds = %62
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %73
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1000 x double], ptr %74, i64 0, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %80
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1000 x double], ptr %81, i64 0, i64 %83
  store double %78, ptr %84, align 8, !tbaa !9
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %88
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1000 x double], ptr %89, i64 0, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %85, i32 noundef %86, double noundef %93)
  br label %140

95:                                               ; preds = %62
  br label %96

96:                                               ; preds = %118, %95
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %97, i32 noundef %98)
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %101
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1000 x double], ptr %102, i64 0, i64 %104
  %106 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.9, ptr noundef %105)
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %108
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1000 x double], ptr %109, i64 0, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !9
  %114 = fcmp olt double %113, 0.000000e+00
  br i1 %114, label %115, label %117

115:                                              ; preds = %96
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %117

117:                                              ; preds = %115, %96
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %120
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1000 x double], ptr %121, i64 0, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = fcmp olt double %125, 0.000000e+00
  br i1 %126, label %96, label %127, !llvm.loop !11

127:                                              ; preds = %118
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1000 x [1000 x i32]], ptr @initialized, i64 0, i64 %129
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1000 x i32], ptr %130, i64 0, i64 %132
  store i32 1, ptr %133, align 4, !tbaa !5
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1000 x [1000 x i32]], ptr @initialized, i64 0, i64 %135
  %137 = load i32, ptr %2, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1000 x i32], ptr %136, i64 0, i64 %138
  store i32 1, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %127, %71, %45
  %141 = load i32, ptr %4, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !13

143:                                              ; preds = %40
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %145

145:                                              ; preds = %143
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %2, align 4, !tbaa !5
  br label %30, !llvm.loop !14

148:                                              ; preds = %34
  call void @init_population()
  %149 = call double @calculate_cost(ptr noundef @population)
  store double %149, ptr @best_cost, align 8, !tbaa !9
  %150 = call double @calculate_cost(ptr noundef @population)
  store double %150, ptr @worst_cost, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %171, %148
  %152 = load i32, ptr %5, align 4, !tbaa !5
  %153 = load i32, ptr @num_cities, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

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

156:                                              ; preds = %151
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1000 x i32], ptr @population, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %5, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1000 x i32], ptr @best_path, i64 0, i64 %162
  store i32 %160, ptr %163, align 4, !tbaa !5
  %164 = load i32, ptr %5, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000 x i32], ptr @population, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = load i32, ptr %5, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [1000 x i32], ptr @worst_path, i64 0, i64 %169
  store i32 %167, ptr %170, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %156
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %5, align 4, !tbaa !5
  br label %151, !llvm.loop !15

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

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

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

179:                                              ; preds = %175
  call void @migration(ptr noundef @population)
  call void @mutation(ptr noundef @population)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %243, %179
  %181 = load i32, ptr %7, align 4, !tbaa !5
  %182 = load i32, ptr @num_cities, align 4, !tbaa !5
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 18, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %246

185:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %186 = load i32, ptr %7, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1000 x [1000 x i32]], ptr @population, i64 0, i64 %187
  %189 = getelementptr inbounds [1000 x i32], ptr %188, i64 0, i64 0
  %190 = call double @calculate_cost(ptr noundef %189)
  store double %190, ptr %8, align 8, !tbaa !9
  %191 = load double, ptr %8, align 8, !tbaa !9
  %192 = load double, ptr @worst_cost, align 8, !tbaa !9
  %193 = fcmp ogt double %191, %192
  br i1 %193, label %194, label %216

194:                                              ; preds = %185
  %195 = load double, ptr %8, align 8, !tbaa !9
  store double %195, ptr @worst_cost, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %212, %194
  %197 = load i32, ptr %9, align 4, !tbaa !5
  %198 = load i32, ptr @num_cities, align 4, !tbaa !5
  %199 = icmp slt i32 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %215

201:                                              ; preds = %196
  %202 = load i32, ptr %7, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [1000 x [1000 x i32]], ptr @population, i64 0, i64 %203
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [1000 x i32], ptr %204, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = load i32, ptr %9, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [1000 x i32], ptr @worst_path, i64 0, i64 %210
  store i32 %208, ptr %211, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %201
  %213 = load i32, ptr %9, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %9, align 4, !tbaa !5
  br label %196, !llvm.loop !16

215:                                              ; preds = %200
  br label %216

216:                                              ; preds = %215, %185
  %217 = load double, ptr %8, align 8, !tbaa !9
  %218 = load double, ptr @best_cost, align 8, !tbaa !9
  %219 = fcmp olt double %217, %218
  br i1 %219, label %220, label %242

220:                                              ; preds = %216
  %221 = load double, ptr %8, align 8, !tbaa !9
  store double %221, ptr @best_cost, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %238, %220
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = load i32, ptr @num_cities, align 4, !tbaa !5
  %225 = icmp slt i32 %223, %224
  br i1 %225, label %227, label %226

226:                                              ; preds = %222
  store i32 24, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %241

227:                                              ; preds = %222
  %228 = load i32, ptr %7, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [1000 x [1000 x i32]], ptr @population, i64 0, i64 %229
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [1000 x i32], ptr %230, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = load i32, ptr %10, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [1000 x i32], ptr @best_path, i64 0, i64 %236
  store i32 %234, ptr %237, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %227
  %239 = load i32, ptr %10, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  store i32 %240, ptr %10, align 4, !tbaa !5
  br label %222, !llvm.loop !17

241:                                              ; preds = %226
  br label %242

242:                                              ; preds = %241, %216
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %7, align 4, !tbaa !5
  br label %180, !llvm.loop !18

246:                                              ; preds = %184
  br label %247

247:                                              ; preds = %246
  %248 = load i32, ptr %6, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %6, align 4, !tbaa !5
  br label %175, !llvm.loop !19

250:                                              ; preds = %178
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %252 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %276, %250
  %254 = load i32, ptr %11, align 4, !tbaa !5
  %255 = load i32, ptr @num_cities, align 4, !tbaa !5
  %256 = icmp slt i32 %254, %255
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  store i32 27, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %279

258:                                              ; preds = %253
  %259 = load i32, ptr %11, align 4, !tbaa !5
  %260 = load i32, ptr @num_cities, align 4, !tbaa !5
  %261 = sub nsw i32 %260, 1
  %262 = icmp eq i32 %259, %261
  br i1 %262, label %263, label %270

263:                                              ; preds = %258
  %264 = load i32, ptr %11, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [1000 x i32], ptr @worst_path, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = load i32, ptr @worst_path, align 16, !tbaa !5
  %269 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %267, i32 noundef %268)
  br label %276

270:                                              ; preds = %258
  %271 = load i32, ptr %11, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [1000 x i32], ptr @worst_path, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %274)
  br label %276

276:                                              ; preds = %270, %263
  %277 = load i32, ptr %11, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %11, align 4, !tbaa !5
  br label %253, !llvm.loop !20

279:                                              ; preds = %257
  %280 = load double, ptr @worst_cost, align 8, !tbaa !9
  %281 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef %280)
  %282 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %283 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %307, %279
  %285 = load i32, ptr %12, align 4, !tbaa !5
  %286 = load i32, ptr @num_cities, align 4, !tbaa !5
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %289, label %288

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

289:                                              ; preds = %284
  %290 = load i32, ptr %12, align 4, !tbaa !5
  %291 = load i32, ptr @num_cities, align 4, !tbaa !5
  %292 = sub nsw i32 %291, 1
  %293 = icmp eq i32 %290, %292
  br i1 %293, label %294, label %301

294:                                              ; preds = %289
  %295 = load i32, ptr %12, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1000 x i32], ptr @best_path, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = load i32, ptr @best_path, align 16, !tbaa !5
  %300 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %298, i32 noundef %299)
  br label %307

301:                                              ; preds = %289
  %302 = load i32, ptr %12, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [1000 x i32], ptr @best_path, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !5
  %306 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %305)
  br label %307

307:                                              ; preds = %301, %294
  %308 = load i32, ptr %12, align 4, !tbaa !5
  %309 = add nsw i32 %308, 1
  store i32 %309, ptr %12, align 4, !tbaa !5
  br label %284, !llvm.loop !21

310:                                              ; preds = %288
  %311 = load double, ptr @best_cost, align 8, !tbaa !9
  %312 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, double noundef %311)
  %313 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %314 = call i32 @system(ptr noundef @.str.20)
  %315 = call i32 @system(ptr noundef @.str.21)
  br label %14, !llvm.loop !22

316:                                              ; preds = %25, %14
  ret i32 0
}

declare i32 @system(ptr noundef) #2

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

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

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

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

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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

@initialized = external dso_local local_unnamed_addr global [1000 x [1000 x i32]], align 16
@num_cities = external dso_local global i32, align 4
@distance = external dso_local global [1000 x [1000 x double]], align 16
@population = external dso_local global [1000 x [1000 x i32]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@best_cost = external dso_local local_unnamed_addr global double, align 8
@worst_cost = external dso_local local_unnamed_addr global double, align 8
@best_path = external dso_local local_unnamed_addr global [1000 x i32], align 16
@worst_path = external dso_local local_unnamed_addr global [1000 x i32], align 16
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @calculate_cost(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @migration(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @mutation(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @init_population() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 @system(ptr noundef nonnull @.str) #5
  store i32 1, ptr @num_cities, align 4, !tbaa !5
  br label %2

2:                                                ; preds = %0, %._crit_edge107
  %3 = tail call i64 @time(ptr noundef null) #5
  %4 = trunc i64 %3 to i32
  tail call void @srand(i32 noundef %4) #5
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @num_cities)
  %8 = load i32, ptr @num_cities, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 1
  br i1 %9, label %131, label %10

10:                                               ; preds = %2
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %14 = load i32, ptr @num_cities, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader81, label %._crit_edge85

.preheader81:                                     ; preds = %10, %._crit_edge
  %16 = phi i32 [ %29, %._crit_edge ], [ %14, %10 ]
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %._crit_edge ], [ 0, %10 ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader81
  %18 = trunc nuw nsw i64 %indvars.iv109 to i32
  %19 = trunc nuw nsw i64 %indvars.iv109 to i32
  %20 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %indvars.iv109, i64 %indvars.iv109
  %21 = trunc nuw nsw i64 %indvars.iv109 to i32
  br label %32

._crit_edge85:                                    ; preds = %._crit_edge, %10
  tail call void @init_population()
  %22 = tail call double @calculate_cost(ptr noundef nonnull @population)
  store double %22, ptr @best_cost, align 8, !tbaa !9
  %23 = tail call double @calculate_cost(ptr noundef nonnull @population)
  store double %23, ptr @worst_cost, align 8, !tbaa !9
  %24 = load i32, ptr @num_cities, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph88.preheader, label %.preheader82.preheader

.preheader82.preheader:                           ; preds = %.lr.ph88.preheader, %._crit_edge85
  br label %.preheader82

.lr.ph88.preheader:                               ; preds = %._crit_edge85
  %26 = zext nneg i32 %24 to i64
  %27 = shl nuw nsw i64 %26, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @best_path, ptr nonnull align 16 @population, i64 %27, i1 false), !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @worst_path, ptr nonnull align 16 @population, i64 %27, i1 false), !tbaa !5
  br label %.preheader82.preheader

._crit_edge:                                      ; preds = %60, %.preheader81
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %29 = load i32, ptr @num_cities, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next110, %30
  br i1 %31, label %.preheader81, label %._crit_edge85, !llvm.loop !11

32:                                               ; preds = %.lr.ph, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %60 ]
  %33 = icmp eq i64 %indvars.iv109, %indvars.iv
  br i1 %33, label %34, label %36

34:                                               ; preds = %32
  store double 0.000000e+00, ptr %20, align 8, !tbaa !9
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %21, i32 noundef %21, double noundef 0.000000e+00)
  br label %60

36:                                               ; preds = %32
  %37 = getelementptr inbounds [1000 x [1000 x i32]], ptr @initialized, i64 0, i64 %indvars.iv109, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %42, label %.preheader

.preheader:                                       ; preds = %36
  %40 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %indvars.iv109, i64 %indvars.iv
  %41 = trunc nuw nsw i64 %indvars.iv to i32
  br label %48

42:                                               ; preds = %36
  %43 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %indvars.iv, i64 %indvars.iv109
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds [1000 x [1000 x double]], ptr @distance, i64 0, i64 %indvars.iv109, i64 %indvars.iv
  store double %44, ptr %45, align 8, !tbaa !9
  %46 = trunc nuw nsw i64 %indvars.iv to i32
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %19, i32 noundef %46, double noundef %44)
  br label %60

48:                                               ; preds = %.preheader, %55
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %18, i32 noundef %41)
  %50 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %40)
  %51 = load double, ptr %40, align 8, !tbaa !9
  %52 = fcmp olt double %51, 0.000000e+00
  br i1 %52, label %53, label %55

53:                                               ; preds = %48
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %.pr79 = load double, ptr %40, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %48, %53
  %56 = phi double [ %51, %48 ], [ %.pr79, %53 ]
  %57 = fcmp olt double %56, 0.000000e+00
  br i1 %57, label %48, label %58, !llvm.loop !13

58:                                               ; preds = %55
  store i32 1, ptr %37, align 4, !tbaa !5
  %59 = getelementptr inbounds [1000 x [1000 x i32]], ptr @initialized, i64 0, i64 %indvars.iv, i64 %indvars.iv109
  store i32 1, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %58, %42, %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %61 = load i32, ptr @num_cities, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next, %62
  br i1 %63, label %32, label %._crit_edge, !llvm.loop !14

64:                                               ; preds = %._crit_edge98
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %67 = load i32, ptr @num_cities, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph102, label %._crit_edge103

.preheader82:                                     ; preds = %.preheader82.preheader, %._crit_edge98
  %.07399 = phi i32 [ %71, %._crit_edge98 ], [ 0, %.preheader82.preheader ]
  tail call void @migration(ptr noundef nonnull @population)
  tail call void @mutation(ptr noundef nonnull @population)
  %69 = load i32, ptr @num_cities, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph97, label %._crit_edge98

._crit_edge98:                                    ; preds = %.loopexit, %.preheader82
  %71 = add nuw nsw i32 %.07399, 1
  %exitcond.not = icmp eq i32 %71, 5000
  br i1 %exitcond.not, label %64, label %.preheader82, !llvm.loop !15

.lr.ph97:                                         ; preds = %.preheader82, %.loopexit
  %indvar = phi i64 [ %indvar.next, %.loopexit ], [ 0, %.preheader82 ]
  %72 = mul nuw nsw i64 %indvar, 4000
  %scevgep118 = getelementptr i8, ptr @population, i64 %72
  %73 = getelementptr inbounds [1000 x [1000 x i32]], ptr @population, i64 0, i64 %indvar
  %74 = tail call double @calculate_cost(ptr noundef nonnull %73)
  %75 = load double, ptr @worst_cost, align 8, !tbaa !9
  %76 = fcmp ogt double %74, %75
  %.pre.pre = load i32, ptr @num_cities, align 4, !tbaa !5
  br i1 %76, label %77, label %.loopexit80

77:                                               ; preds = %.lr.ph97
  store double %74, ptr @worst_cost, align 8, !tbaa !9
  %78 = icmp sgt i32 %.pre.pre, 0
  br i1 %78, label %.lr.ph91.preheader, label %.loopexit80

.lr.ph91.preheader:                               ; preds = %77
  %79 = zext nneg i32 %.pre.pre to i64
  %80 = shl nuw nsw i64 %79, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @worst_path, ptr align 16 %scevgep118, i64 %80, i1 false), !tbaa !5
  br label %.loopexit80

.loopexit80:                                      ; preds = %.lr.ph91.preheader, %77, %.lr.ph97
  %81 = load double, ptr @best_cost, align 8, !tbaa !9
  %82 = fcmp olt double %74, %81
  br i1 %82, label %83, label %.loopexit

83:                                               ; preds = %.loopexit80
  store double %74, ptr @best_cost, align 8, !tbaa !9
  %84 = icmp sgt i32 %.pre.pre, 0
  br i1 %84, label %.lr.ph94.preheader, label %.loopexit

.lr.ph94.preheader:                               ; preds = %83
  %85 = zext nneg i32 %.pre.pre to i64
  %86 = shl nuw nsw i64 %85, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @best_path, ptr align 16 %scevgep118, i64 %86, i1 false), !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph94.preheader, %83, %.loopexit80
  %indvar.next = add nuw nsw i64 %indvar, 1
  %87 = sext i32 %.pre.pre to i64
  %88 = icmp slt i64 %indvar.next, %87
  br i1 %88, label %.lr.ph97, label %._crit_edge98, !llvm.loop !16

._crit_edge103:                                   ; preds = %106, %64
  %89 = load double, ptr @worst_cost, align 8, !tbaa !9
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef %89)
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %93 = load i32, ptr @num_cities, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.lr.ph106, label %._crit_edge107

.lr.ph102:                                        ; preds = %64, %106
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %106 ], [ 0, %64 ]
  %95 = phi i32 [ %107, %106 ], [ %67, %64 ]
  %96 = add nsw i32 %95, -1
  %97 = zext i32 %96 to i64
  %98 = icmp eq i64 %indvars.iv123, %97
  %99 = getelementptr inbounds [1000 x i32], ptr @worst_path, i64 0, i64 %indvars.iv123
  %100 = load i32, ptr %99, align 4, !tbaa !5
  br i1 %98, label %101, label %104

101:                                              ; preds = %.lr.ph102
  %102 = load i32, ptr @worst_path, align 16, !tbaa !5
  %103 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %100, i32 noundef %102)
  br label %106

104:                                              ; preds = %.lr.ph102
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %100)
  br label %106

106:                                              ; preds = %104, %101
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %107 = load i32, ptr @num_cities, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = icmp slt i64 %indvars.iv.next124, %108
  br i1 %109, label %.lr.ph102, label %._crit_edge103, !llvm.loop !17

._crit_edge107:                                   ; preds = %127, %._crit_edge103
  %110 = load double, ptr @best_cost, align 8, !tbaa !9
  %111 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, double noundef %110)
  %112 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %113 = tail call i32 @system(ptr noundef nonnull @.str.20) #5
  %114 = tail call i32 @system(ptr noundef nonnull @.str.21) #5
  %.pr = load i32, ptr @num_cities, align 4, !tbaa !5
  %115 = icmp sgt i32 %.pr, 0
  br i1 %115, label %2, label %131, !llvm.loop !18

.lr.ph106:                                        ; preds = %._crit_edge103, %127
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %127 ], [ 0, %._crit_edge103 ]
  %116 = phi i32 [ %128, %127 ], [ %93, %._crit_edge103 ]
  %117 = add nsw i32 %116, -1
  %118 = zext i32 %117 to i64
  %119 = icmp eq i64 %indvars.iv126, %118
  %120 = getelementptr inbounds [1000 x i32], ptr @best_path, i64 0, i64 %indvars.iv126
  %121 = load i32, ptr %120, align 4, !tbaa !5
  br i1 %119, label %122, label %125

122:                                              ; preds = %.lr.ph106
  %123 = load i32, ptr @best_path, align 16, !tbaa !5
  %124 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %121, i32 noundef %123)
  br label %127

125:                                              ; preds = %.lr.ph106
  %126 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %121)
  br label %127

127:                                              ; preds = %125, %122
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %128 = load i32, ptr @num_cities, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = icmp slt i64 %indvars.iv.next127, %129
  br i1 %130, label %.lr.ph106, label %._crit_edge107, !llvm.loop !19

131:                                              ; preds = %2, %._crit_edge107
  ret i32 0
}

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass