; LLVM IR from fcimeson/cbTSP :: cbLKH/SRC (LKHmain)

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

%struct.Node = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double, double, double, double, i8, i8, i8 }

@ParameterFileName = external dso_local global ptr, align 8
@MaxMatrixDimension = external dso_local global i32, align 4
@SubproblemSize = external dso_local global i32, align 4
@DelaunayPartitioning = external dso_local global i32, align 4
@KarpPartitioning = external dso_local global i32, align 4
@KCenterPartitioning = external dso_local global i32, align 4
@KMeansPartitioning = external dso_local global i32, align 4
@RohePartitioning = external dso_local global i32, align 4
@MoorePartitioning = external dso_local global i32, align 4
@SierpinskiPartitioning = external dso_local global i32, align 4
@Norm = external dso_local global i32, align 4
@BestCost = external dso_local global i64, align 8
@LowerBound = external dso_local global double, align 8
@Optimum = external dso_local global i64, align 8
@OutputTourFileName = external dso_local global ptr, align 8
@BestTour = external dso_local global ptr, align 8
@TourFileName = external dso_local global ptr, align 8
@Runs = external dso_local global i32, align 4
@Run = external dso_local global i32, align 4
@MaxPopulationSize = external dso_local global i32, align 4
@PopulationSize = external dso_local global i32, align 4
@TraceLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@Fitness = external dso_local global ptr, align 8
@FirstNode = external dso_local global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@StopAtOptimum = external dso_local global i32, align 4
@StopAtMaxCost = external dso_local global i32, align 4
@MaxCost = external dso_local global i64, align 8
@C = external dso_local global ptr, align 8
@Seed = external dso_local global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %18 = call double @GetTime()
  store double %18, ptr %9, align 8, !tbaa !11
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp sge i32 %19, 2
  br i1 %20, label %21, label %25

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr @ParameterFileName, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %21, %2
  call void @ReadParameters()
  store i32 10000, ptr @MaxMatrixDimension, align 4, !tbaa !5
  call void @ReadProblem()
  %26 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %28, label %62

28:                                               ; preds = %25
  %29 = load i32, ptr @DelaunayPartitioning, align 4, !tbaa !5
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  call void @SolveDelaunaySubproblems()
  br label %61

32:                                               ; preds = %28
  %33 = load i32, ptr @KarpPartitioning, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  call void @SolveKarpSubproblems()
  br label %60

36:                                               ; preds = %32
  %37 = load i32, ptr @KCenterPartitioning, align 4, !tbaa !5
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void @SolveKCenterSubproblems()
  br label %59

40:                                               ; preds = %36
  %41 = load i32, ptr @KMeansPartitioning, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  call void @SolveKMeansSubproblems()
  br label %58

44:                                               ; preds = %40
  %45 = load i32, ptr @RohePartitioning, align 4, !tbaa !5
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  call void @SolveRoheSubproblems()
  br label %57

48:                                               ; preds = %44
  %49 = load i32, ptr @MoorePartitioning, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %54, label %51

51:                                               ; preds = %48
  %52 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %51, %48
  call void @SolveSFCSubproblems()
  br label %56

55:                                               ; preds = %51
  call void @SolveTourSegmentSubproblems()
  br label %56

56:                                               ; preds = %55, %54
  br label %57

57:                                               ; preds = %56, %47
  br label %58

58:                                               ; preds = %57, %43
  br label %59

59:                                               ; preds = %58, %39
  br label %60

60:                                               ; preds = %59, %35
  br label %61

61:                                               ; preds = %60, %31
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %335

62:                                               ; preds = %25
  call void @AllocateStructures()
  call void @CreateCandidateSet()
  call void @InitializeStatistics()
  %63 = load i32, ptr @Norm, align 4, !tbaa !5
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  store i64 9223372036854775807, ptr @BestCost, align 8, !tbaa !13
  br label %79

66:                                               ; preds = %62
  %67 = load double, ptr @LowerBound, align 8, !tbaa !11
  %68 = fptosi double %67 to i64
  store i64 %68, ptr @BestCost, align 8, !tbaa !13
  store i64 %68, ptr @Optimum, align 8, !tbaa !13
  %69 = load i64, ptr @Optimum, align 8, !tbaa !13
  %70 = call double @GetTime()
  %71 = load double, ptr %9, align 8, !tbaa !11
  %72 = fsub double %70, %71
  call void @UpdateStatistics(i64 noundef %69, double noundef %72)
  call void @RecordBetterTour()
  call void @RecordBestTour()
  %73 = load ptr, ptr @OutputTourFileName, align 8, !tbaa !9
  %74 = load ptr, ptr @BestTour, align 8, !tbaa !9
  %75 = load i64, ptr @BestCost, align 8, !tbaa !13
  call void @WriteTour(ptr noundef %73, ptr noundef %74, i64 noundef %75)
  %76 = load ptr, ptr @TourFileName, align 8, !tbaa !9
  %77 = load ptr, ptr @BestTour, align 8, !tbaa !9
  %78 = load i64, ptr @BestCost, align 8, !tbaa !13
  call void @WriteTour(ptr noundef %76, ptr noundef %77, i64 noundef %78)
  store i32 0, ptr @Runs, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %66, %65
  store i32 1, ptr @Run, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %331, %79
  %81 = load i32, ptr @Run, align 4, !tbaa !5
  %82 = load i32, ptr @Runs, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %84, label %334

84:                                               ; preds = %80
  %85 = call double @GetTime()
  store double %85, ptr %9, align 8, !tbaa !11
  %86 = call i64 @FindTour()
  store i64 %86, ptr %6, align 8, !tbaa !13
  %87 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 1
  br i1 %88, label %89, label %162

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

90:                                               ; preds = %124, %89
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %127

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %95 = load i64, ptr %6, align 8, !tbaa !13
  store i64 %95, ptr %12, align 8, !tbaa !13
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = call i64 @MergeTourWithIndividual(i32 noundef %96)
  store i64 %97, ptr %6, align 8, !tbaa !13
  %98 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %99 = icmp sge i32 %98, 1
  br i1 %99, label %100, label %123

100:                                              ; preds = %94
  %101 = load i64, ptr %6, align 8, !tbaa !13
  %102 = load i64, ptr %12, align 8, !tbaa !13
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %104, label %123

104:                                              ; preds = %100
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  %107 = load i64, ptr %6, align 8, !tbaa !13
  call void (ptr, ...) @printff(ptr noundef @.str, i32 noundef %106, i64 noundef %107)
  %108 = load i64, ptr @Optimum, align 8, !tbaa !13
  %109 = icmp ne i64 %108, -9223372036854775808
  br i1 %109, label %110, label %122

110:                                              ; preds = %104
  %111 = load i64, ptr @Optimum, align 8, !tbaa !13
  %112 = icmp ne i64 %111, 0
  br i1 %112, label %113, label %122

113:                                              ; preds = %110
  %114 = load i64, ptr %6, align 8, !tbaa !13
  %115 = load i64, ptr @Optimum, align 8, !tbaa !13
  %116 = sub nsw i64 %114, %115
  %117 = sitofp i64 %116 to double
  %118 = fmul double 1.000000e+02, %117
  %119 = load i64, ptr @Optimum, align 8, !tbaa !13
  %120 = sitofp i64 %119 to double
  %121 = fdiv double %118, %120
  call void (ptr, ...) @printff(ptr noundef @.str.1, double noundef %121)
  br label %122

122:                                              ; preds = %113, %110, %104
  call void (ptr, ...) @printff(ptr noundef @.str.2)
  br label %123

123:                                              ; preds = %122, %100, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %11, align 4, !tbaa !5
  br label %90, !llvm.loop !15

127:                                              ; preds = %90
  %128 = load i64, ptr %6, align 8, !tbaa !13
  %129 = call i32 @HasFitness(i64 noundef %128)
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %161, label %131

131:                                              ; preds = %127
  %132 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %133 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %135, label %141

135:                                              ; preds = %131
  %136 = load i64, ptr %6, align 8, !tbaa !13
  call void @AddToPopulation(i64 noundef %136)
  %137 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %138 = icmp sge i32 %137, 1
  br i1 %138, label %139, label %140

139:                                              ; preds = %135
  call void (...) @PrintPopulation()
  br label %140

140:                                              ; preds = %139, %135
  br label %160

141:                                              ; preds = %131
  %142 = load i64, ptr %6, align 8, !tbaa !13
  %143 = load ptr, ptr @Fitness, align 8, !tbaa !9
  %144 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i64, ptr %143, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !13
  %149 = icmp slt i64 %142, %148
  br i1 %149, label %150, label %159

150:                                              ; preds = %141
  %151 = load i64, ptr %6, align 8, !tbaa !13
  %152 = call i32 @ReplacementIndividual(i64 noundef %151)
  store i32 %152, ptr %11, align 4, !tbaa !5
  %153 = load i32, ptr %11, align 4, !tbaa !5
  %154 = load i64, ptr %6, align 8, !tbaa !13
  call void @ReplaceIndividualWithTour(i32 noundef %153, i64 noundef %154)
  %155 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %156 = icmp sge i32 %155, 1
  br i1 %156, label %157, label %158

157:                                              ; preds = %150
  call void (...) @PrintPopulation()
  br label %158

158:                                              ; preds = %157, %150
  br label %159

159:                                              ; preds = %158, %141
  br label %160

160:                                              ; preds = %159, %140
  br label %161

161:                                              ; preds = %160, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %168

162:                                              ; preds = %84
  %163 = load i32, ptr @Run, align 4, !tbaa !5
  %164 = icmp sgt i32 %163, 1
  br i1 %164, label %165, label %167

165:                                              ; preds = %162
  %166 = call i64 @MergeBetterTourWithBestTour()
  store i64 %166, ptr %6, align 8, !tbaa !13
  br label %167

167:                                              ; preds = %165, %162
  br label %168

168:                                              ; preds = %167, %161
  %169 = load i64, ptr %6, align 8, !tbaa !13
  %170 = load i64, ptr @BestCost, align 8, !tbaa !13
  %171 = icmp slt i64 %169, %170
  br i1 %171, label %172, label %180

172:                                              ; preds = %168
  %173 = load i64, ptr %6, align 8, !tbaa !13
  store i64 %173, ptr @BestCost, align 8, !tbaa !13
  call void @RecordBetterTour()
  call void @RecordBestTour()
  %174 = load ptr, ptr @OutputTourFileName, align 8, !tbaa !9
  %175 = load ptr, ptr @BestTour, align 8, !tbaa !9
  %176 = load i64, ptr @BestCost, align 8, !tbaa !13
  call void @WriteTour(ptr noundef %174, ptr noundef %175, i64 noundef %176)
  %177 = load ptr, ptr @TourFileName, align 8, !tbaa !9
  %178 = load ptr, ptr @BestTour, align 8, !tbaa !9
  %179 = load i64, ptr @BestCost, align 8, !tbaa !13
  call void @WriteTour(ptr noundef %177, ptr noundef %178, i64 noundef %179)
  br label %180

180:                                              ; preds = %172, %168
  %181 = load i64, ptr @Optimum, align 8, !tbaa !13
  store i64 %181, ptr %7, align 8, !tbaa !13
  %182 = load i64, ptr %6, align 8, !tbaa !13
  %183 = load i64, ptr @Optimum, align 8, !tbaa !13
  %184 = icmp slt i64 %182, %183
  br i1 %184, label %185, label %205

185:                                              ; preds = %180
  %186 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct.Node, ptr %186, i32 0, i32 32
  %188 = load ptr, ptr %187, align 8, !tbaa !17
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %202

190:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %191 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %191, ptr %13, align 8, !tbaa !9
  br label %192

192:                                              ; preds = %200, %190
  %193 = load ptr, ptr %13, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct.Node, ptr %193, i32 0, i32 16
  %195 = load ptr, ptr %194, align 8, !tbaa !19
  %196 = load ptr, ptr %13, align 8, !tbaa !9
  %197 = getelementptr inbounds %struct.Node, ptr %196, i32 0, i32 32
  store ptr %195, ptr %197, align 8, !tbaa !17
  store ptr %195, ptr %13, align 8, !tbaa !9
  %198 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %199 = icmp ne ptr %195, %198
  br i1 %199, label %200, label %201

200:                                              ; preds = %192
  br label %192, !llvm.loop !20

201:                                              ; preds = %192
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %202

202:                                              ; preds = %201, %185
  %203 = load i64, ptr %6, align 8, !tbaa !13
  store i64 %203, ptr @Optimum, align 8, !tbaa !13
  %204 = load i64, ptr @Optimum, align 8, !tbaa !13
  call void (ptr, ...) @printff(ptr noundef @.str.3, i64 noundef %204)
  br label %205

205:                                              ; preds = %202, %180
  %206 = call double @GetTime()
  %207 = load double, ptr %9, align 8, !tbaa !11
  %208 = fsub double %206, %207
  %209 = call double @llvm.fabs.f64(double %208)
  store double %209, ptr %8, align 8, !tbaa !11
  %210 = load i64, ptr %6, align 8, !tbaa !13
  %211 = load double, ptr %8, align 8, !tbaa !11
  call void @UpdateStatistics(i64 noundef %210, double noundef %211)
  %212 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %213 = icmp sge i32 %212, 1
  br i1 %213, label %214, label %248

214:                                              ; preds = %205
  %215 = load i64, ptr %6, align 8, !tbaa !13
  %216 = icmp ne i64 %215, 9223372036854775807
  br i1 %216, label %217, label %248

217:                                              ; preds = %214
  %218 = load i32, ptr @Run, align 4, !tbaa !5
  %219 = load i64, ptr %6, align 8, !tbaa !13
  call void (ptr, ...) @printff(ptr noundef @.str.4, i32 noundef %218, i64 noundef %219)
  %220 = load i64, ptr @Optimum, align 8, !tbaa !13
  %221 = icmp ne i64 %220, -9223372036854775808
  br i1 %221, label %222, label %234

222:                                              ; preds = %217
  %223 = load i64, ptr @Optimum, align 8, !tbaa !13
  %224 = icmp ne i64 %223, 0
  br i1 %224, label %225, label %234

225:                                              ; preds = %222
  %226 = load i64, ptr %6, align 8, !tbaa !13
  %227 = load i64, ptr @Optimum, align 8, !tbaa !13
  %228 = sub nsw i64 %226, %227
  %229 = sitofp i64 %228 to double
  %230 = fmul double 1.000000e+02, %229
  %231 = load i64, ptr @Optimum, align 8, !tbaa !13
  %232 = sitofp i64 %231 to double
  %233 = fdiv double %230, %232
  call void (ptr, ...) @printff(ptr noundef @.str.1, double noundef %233)
  br label %234

234:                                              ; preds = %225, %222, %217
  %235 = load double, ptr %8, align 8, !tbaa !11
  %236 = load i64, ptr %6, align 8, !tbaa !13
  %237 = load i64, ptr @Optimum, align 8, !tbaa !13
  %238 = icmp slt i64 %236, %237
  br i1 %238, label %239, label %240

239:                                              ; preds = %234
  br label %246

240:                                              ; preds = %234
  %241 = load i64, ptr %6, align 8, !tbaa !13
  %242 = load i64, ptr @Optimum, align 8, !tbaa !13
  %243 = icmp eq i64 %241, %242
  %244 = zext i1 %243 to i64
  %245 = select i1 %243, ptr @.str.7, ptr @.str.8
  br label %246

246:                                              ; preds = %240, %239
  %247 = phi ptr [ @.str.6, %239 ], [ %245, %240 ]
  call void (ptr, ...) @printff(ptr noundef @.str.5, double noundef %235, ptr noundef %247)
  br label %248

248:                                              ; preds = %246, %214, %205
  %249 = load i32, ptr @StopAtOptimum, align 4, !tbaa !5
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %251, label %260

251:                                              ; preds = %248
  %252 = load i64, ptr %6, align 8, !tbaa !13
  %253 = load i64, ptr %7, align 8, !tbaa !13
  %254 = icmp eq i64 %252, %253
  br i1 %254, label %255, label %260

255:                                              ; preds = %251
  %256 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !5
  %257 = icmp sge i32 %256, 1
  br i1 %257, label %258, label %260

258:                                              ; preds = %255
  %259 = load i32, ptr @Run, align 4, !tbaa !5
  store i32 %259, ptr @Runs, align 4, !tbaa !5
  br label %334

260:                                              ; preds = %255, %251, %248
  %261 = load i32, ptr @StopAtMaxCost, align 4, !tbaa !5
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %269

263:                                              ; preds = %260
  %264 = load i64, ptr %6, align 8, !tbaa !13
  %265 = load i64, ptr @MaxCost, align 8, !tbaa !13
  %266 = icmp sle i64 %264, %265
  br i1 %266, label %267, label %269

267:                                              ; preds = %263
  %268 = load i32, ptr @Run, align 4, !tbaa !5
  store i32 %268, ptr @Runs, align 4, !tbaa !5
  br label %334

269:                                              ; preds = %263, %260
  %270 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %271 = icmp sge i32 %270, 2
  br i1 %271, label %272, label %328

272:                                              ; preds = %269
  %273 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %274 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !5
  %275 = icmp eq i32 %273, %274
  br i1 %275, label %281, label %276

276:                                              ; preds = %272
  %277 = load i32, ptr @Run, align 4, !tbaa !5
  %278 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !5
  %279 = mul nsw i32 2, %278
  %280 = icmp sge i32 %277, %279
  br i1 %280, label %281, label %328

281:                                              ; preds = %276, %272
  %282 = load i32, ptr @Run, align 4, !tbaa !5
  %283 = load i32, ptr @Runs, align 4, !tbaa !5
  %284 = icmp slt i32 %282, %283
  br i1 %284, label %285, label %328

285:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %286 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %287 = call i32 @LinearSelection(i32 noundef %286, double noundef 1.250000e+00)
  store i32 %287, ptr %15, align 4, !tbaa !5
  br label %288

288:                                              ; preds = %291, %285
  %289 = load i32, ptr @PopulationSize, align 4, !tbaa !5
  %290 = call i32 @LinearSelection(i32 noundef %289, double noundef 1.250000e+00)
  store i32 %290, ptr %16, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %288
  %292 = load i32, ptr %16, align 4, !tbaa !5
  %293 = load i32, ptr %15, align 4, !tbaa !5
  %294 = icmp eq i32 %292, %293
  br i1 %294, label %288, label %295, !llvm.loop !21

295:                                              ; preds = %291
  %296 = load i32, ptr %15, align 4, !tbaa !5
  %297 = load i32, ptr %16, align 4, !tbaa !5
  call void @ApplyCrossover(i32 noundef %296, i32 noundef %297)
  %298 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %298, ptr %14, align 8, !tbaa !9
  br label %299

299:                                              ; preds = %323, %295
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %300 = load ptr, ptr @C, align 8, !tbaa !9
  %301 = load ptr, ptr %14, align 8, !tbaa !9
  %302 = load ptr, ptr %14, align 8, !tbaa !9
  %303 = getelementptr inbounds %struct.Node, ptr %302, i32 0, i32 16
  %304 = load ptr, ptr %303, align 8, !tbaa !19
  %305 = call i32 %300(ptr noundef %301, ptr noundef %304)
  store i32 %305, ptr %17, align 4, !tbaa !5
  %306 = load ptr, ptr %14, align 8, !tbaa !9
  %307 = load ptr, ptr %14, align 8, !tbaa !9
  %308 = getelementptr inbounds %struct.Node, ptr %307, i32 0, i32 16
  %309 = load ptr, ptr %308, align 8, !tbaa !19
  %310 = load i32, ptr %17, align 4, !tbaa !5
  %311 = call i32 @AddCandidate(ptr noundef %306, ptr noundef %309, i32 noundef %310, i32 noundef 2147483647)
  %312 = load ptr, ptr %14, align 8, !tbaa !9
  %313 = getelementptr inbounds %struct.Node, ptr %312, i32 0, i32 16
  %314 = load ptr, ptr %313, align 8, !tbaa !19
  %315 = load ptr, ptr %14, align 8, !tbaa !9
  %316 = load i32, ptr %17, align 4, !tbaa !5
  %317 = call i32 @AddCandidate(ptr noundef %314, ptr noundef %315, i32 noundef %316, i32 noundef 2147483647)
  %318 = load ptr, ptr %14, align 8, !tbaa !9
  %319 = getelementptr inbounds %struct.Node, ptr %318, i32 0, i32 16
  %320 = load ptr, ptr %319, align 8, !tbaa !19
  %321 = load ptr, ptr %14, align 8, !tbaa !9
  %322 = getelementptr inbounds %struct.Node, ptr %321, i32 0, i32 33
  store ptr %320, ptr %322, align 8, !tbaa !22
  store ptr %320, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %323

323:                                              ; preds = %299
  %324 = load ptr, ptr %14, align 8, !tbaa !9
  %325 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %326 = icmp ne ptr %324, %325
  br i1 %326, label %299, label %327, !llvm.loop !23

327:                                              ; preds = %323
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %328

328:                                              ; preds = %327, %281, %276, %269
  %329 = load i32, ptr @Seed, align 4, !tbaa !5
  %330 = add i32 %329, 1
  store i32 %330, ptr @Seed, align 4, !tbaa !5
  call void @SRandom(i32 noundef %330)
  br label %331

331:                                              ; preds = %328
  %332 = load i32, ptr @Run, align 4, !tbaa !5
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr @Run, align 4, !tbaa !5
  br label %80, !llvm.loop !24

334:                                              ; preds = %267, %258, %80
  call void @PrintStatistics()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %335

335:                                              ; preds = %334, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %336 = load i32, ptr %3, align 4
  ret i32 %336
}

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

declare double @GetTime() #2

declare void @ReadParameters() #2

declare void @ReadProblem() #2

declare void @SolveDelaunaySubproblems() #2

declare void @SolveKarpSubproblems() #2

declare void @SolveKCenterSubproblems() #2

declare void @SolveKMeansSubproblems() #2

declare void @SolveRoheSubproblems() #2

declare void @SolveSFCSubproblems() #2

declare void @SolveTourSegmentSubproblems() #2

declare void @AllocateStructures() #2

declare void @CreateCandidateSet() #2

declare void @InitializeStatistics() #2

declare void @UpdateStatistics(i64 noundef, double noundef) #2

declare void @RecordBetterTour() #2

declare void @RecordBestTour() #2

declare void @WriteTour(ptr noundef, ptr noundef, i64 noundef) #2

declare i64 @FindTour() #2

declare i64 @MergeTourWithIndividual(i32 noundef) #2

declare void @printff(ptr noundef, ...) #2

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

declare i32 @HasFitness(i64 noundef) #2

declare void @AddToPopulation(i64 noundef) #2

declare void @PrintPopulation(...) #2

declare i32 @ReplacementIndividual(i64 noundef) #2

declare void @ReplaceIndividualWithTour(i32 noundef, i64 noundef) #2

declare i64 @MergeBetterTourWithBestTour() #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

declare i32 @LinearSelection(i32 noundef, double noundef) #2

declare void @ApplyCrossover(i32 noundef, i32 noundef) #2

declare i32 @AddCandidate(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @SRandom(i32 noundef) #2

declare void @PrintStatistics() #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 200}
!18 = !{!"Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!19 = !{!18, !10, i64 72}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = !{!18, !10, i64 208}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}


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

@ParameterFileName = external dso_local local_unnamed_addr global ptr, align 8
@MaxMatrixDimension = external dso_local local_unnamed_addr global i32, align 4
@SubproblemSize = external dso_local local_unnamed_addr global i32, align 4
@DelaunayPartitioning = external dso_local local_unnamed_addr global i32, align 4
@KarpPartitioning = external dso_local local_unnamed_addr global i32, align 4
@KCenterPartitioning = external dso_local local_unnamed_addr global i32, align 4
@KMeansPartitioning = external dso_local local_unnamed_addr global i32, align 4
@RohePartitioning = external dso_local local_unnamed_addr global i32, align 4
@MoorePartitioning = external dso_local local_unnamed_addr global i32, align 4
@SierpinskiPartitioning = external dso_local local_unnamed_addr global i32, align 4
@Norm = external dso_local local_unnamed_addr global i32, align 4
@BestCost = external dso_local local_unnamed_addr global i64, align 8
@LowerBound = external dso_local local_unnamed_addr global double, align 8
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@OutputTourFileName = external dso_local local_unnamed_addr global ptr, align 8
@BestTour = external dso_local local_unnamed_addr global ptr, align 8
@TourFileName = external dso_local local_unnamed_addr global ptr, align 8
@Runs = external dso_local local_unnamed_addr global i32, align 4
@Run = external dso_local local_unnamed_addr global i32, align 4
@MaxPopulationSize = external dso_local local_unnamed_addr global i32, align 4
@PopulationSize = external dso_local local_unnamed_addr global i32, align 4
@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@Fitness = external dso_local local_unnamed_addr global ptr, align 8
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@StopAtOptimum = external dso_local local_unnamed_addr global i32, align 4
@StopAtMaxCost = external dso_local local_unnamed_addr global i32, align 4
@MaxCost = external dso_local local_unnamed_addr global i64, align 8
@C = external dso_local local_unnamed_addr global ptr, align 8
@Seed = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = tail call double @GetTime() #3
  %4 = icmp sgt i32 %0, 1
  br i1 %4, label %5, label %8

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %7, ptr @ParameterFileName, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %5, %2
  tail call void @ReadParameters() #3
  store i32 10000, ptr @MaxMatrixDimension, align 4, !tbaa !9
  tail call void @ReadProblem() #3
  %9 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %11, label %33

11:                                               ; preds = %8
  %12 = load i32, ptr @DelaunayPartitioning, align 4, !tbaa !9
  %.not81 = icmp eq i32 %12, 0
  br i1 %.not81, label %14, label %13

13:                                               ; preds = %11
  tail call void @SolveDelaunaySubproblems() #3
  br label %186

14:                                               ; preds = %11
  %15 = load i32, ptr @KarpPartitioning, align 4, !tbaa !9
  %.not82 = icmp eq i32 %15, 0
  br i1 %.not82, label %17, label %16

16:                                               ; preds = %14
  tail call void @SolveKarpSubproblems() #3
  br label %186

17:                                               ; preds = %14
  %18 = load i32, ptr @KCenterPartitioning, align 4, !tbaa !9
  %.not83 = icmp eq i32 %18, 0
  br i1 %.not83, label %20, label %19

19:                                               ; preds = %17
  tail call void @SolveKCenterSubproblems() #3
  br label %186

20:                                               ; preds = %17
  %21 = load i32, ptr @KMeansPartitioning, align 4, !tbaa !9
  %.not84 = icmp eq i32 %21, 0
  br i1 %.not84, label %23, label %22

22:                                               ; preds = %20
  tail call void @SolveKMeansSubproblems() #3
  br label %186

23:                                               ; preds = %20
  %24 = load i32, ptr @RohePartitioning, align 4, !tbaa !9
  %.not85 = icmp eq i32 %24, 0
  br i1 %.not85, label %26, label %25

25:                                               ; preds = %23
  tail call void @SolveRoheSubproblems() #3
  br label %186

26:                                               ; preds = %23
  %27 = load i32, ptr @MoorePartitioning, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  %29 = load i32, ptr @SierpinskiPartitioning, align 4
  %30 = icmp ne i32 %29, 0
  %or.cond = select i1 %28, i1 true, i1 %30
  br i1 %or.cond, label %31, label %32

31:                                               ; preds = %26
  tail call void @SolveSFCSubproblems() #3
  br label %186

32:                                               ; preds = %26
  tail call void @SolveTourSegmentSubproblems() #3
  br label %186

33:                                               ; preds = %8
  tail call void @AllocateStructures() #3
  tail call void @CreateCandidateSet() #3
  tail call void @InitializeStatistics() #3
  %34 = load i32, ptr @Norm, align 4, !tbaa !9
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %.thread, label %45

.thread:                                          ; preds = %33
  %35 = load double, ptr @LowerBound, align 8, !tbaa !11
  %36 = fptosi double %35 to i64
  store i64 %36, ptr @BestCost, align 8, !tbaa !13
  store i64 %36, ptr @Optimum, align 8, !tbaa !13
  %37 = tail call double @GetTime() #3
  %38 = fsub double %37, %3
  tail call void @UpdateStatistics(i64 noundef %36, double noundef %38) #3
  tail call void @RecordBetterTour() #3
  tail call void @RecordBestTour() #3
  %39 = load ptr, ptr @OutputTourFileName, align 8, !tbaa !5
  %40 = load ptr, ptr @BestTour, align 8, !tbaa !5
  %41 = load i64, ptr @BestCost, align 8, !tbaa !13
  tail call void @WriteTour(ptr noundef %39, ptr noundef %40, i64 noundef %41) #3
  %42 = load ptr, ptr @TourFileName, align 8, !tbaa !5
  %43 = load ptr, ptr @BestTour, align 8, !tbaa !5
  %44 = load i64, ptr @BestCost, align 8, !tbaa !13
  tail call void @WriteTour(ptr noundef %42, ptr noundef %43, i64 noundef %44) #3
  store i32 0, ptr @Runs, align 4, !tbaa !9
  store i32 1, ptr @Run, align 4, !tbaa !9
  br label %.loopexit90

45:                                               ; preds = %33
  store i64 9223372036854775807, ptr @BestCost, align 8, !tbaa !13
  %.pre = load i32, ptr @Runs, align 4, !tbaa !9
  %46 = icmp slt i32 %.pre, 1
  store i32 1, ptr @Run, align 4, !tbaa !9
  br i1 %46, label %.loopexit90, label %.lr.ph95

.lr.ph95:                                         ; preds = %45, %.loopexit
  %47 = tail call double @GetTime() #3
  %48 = tail call i64 @FindTour() #3
  %49 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !9
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %.preheader89, label %91

.preheader89:                                     ; preds = %.lr.ph95
  %51 = load i32, ptr @PopulationSize, align 4, !tbaa !9
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader89, %.lr.ph._crit_edge
  %.06092 = phi i64 [ %53, %.lr.ph._crit_edge ], [ %48, %.preheader89 ]
  %.06391 = phi i32 [ %57, %.lr.ph._crit_edge ], [ 0, %.preheader89 ]
  %53 = tail call i64 @MergeTourWithIndividual(i32 noundef %.06391) #3
  %54 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %55 = icmp sgt i32 %54, 0
  %56 = icmp slt i64 %53, %.06092
  %or.cond86 = select i1 %55, i1 %56, i1 false
  %57 = add nuw nsw i32 %.06391, 1
  br i1 %or.cond86, label %58, label %.lr.ph._crit_edge

58:                                               ; preds = %.lr.ph
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str, i32 noundef %57, i64 noundef %53) #3
  %59 = load i64, ptr @Optimum, align 8
  %60 = and i64 %59, 9223372036854775807
  %or.cond3.not = icmp eq i64 %60, 0
  br i1 %or.cond3.not, label %67, label %61

61:                                               ; preds = %58
  %62 = sub nsw i64 %53, %59
  %63 = sitofp i64 %62 to double
  %64 = fmul double %63, 1.000000e+02
  %65 = sitofp i64 %59 to double
  %66 = fdiv double %64, %65
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, double noundef %66) #3
  br label %67

67:                                               ; preds = %61, %58
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #3
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %67
  %68 = load i32, ptr @PopulationSize, align 4, !tbaa !9
  %69 = icmp slt i32 %57, %68
  br i1 %69, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph._crit_edge, %.preheader89
  %.060.lcssa = phi i64 [ %48, %.preheader89 ], [ %53, %.lr.ph._crit_edge ]
  %70 = tail call i32 @HasFitness(i64 noundef %.060.lcssa) #3
  %.not73 = icmp eq i32 %70, 0
  br i1 %.not73, label %71, label %96

71:                                               ; preds = %._crit_edge
  %72 = load i32, ptr @PopulationSize, align 4, !tbaa !9
  %73 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !9
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %71
  tail call void @AddToPopulation(i64 noundef %.060.lcssa) #3
  %76 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %78, label %96

78:                                               ; preds = %75
  tail call void (...) @PrintPopulation() #3
  br label %96

79:                                               ; preds = %71
  %80 = load ptr, ptr @Fitness, align 8, !tbaa !5
  %81 = sext i32 %72 to i64
  %82 = getelementptr i64, ptr %80, i64 %81
  %83 = getelementptr i8, ptr %82, i64 -8
  %84 = load i64, ptr %83, align 8, !tbaa !13
  %85 = icmp slt i64 %.060.lcssa, %84
  br i1 %85, label %86, label %96

86:                                               ; preds = %79
  %87 = tail call i32 @ReplacementIndividual(i64 noundef %.060.lcssa) #3
  tail call void @ReplaceIndividualWithTour(i32 noundef %87, i64 noundef %.060.lcssa) #3
  %88 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %86
  tail call void (...) @PrintPopulation() #3
  br label %96

91:                                               ; preds = %.lr.ph95
  %92 = load i32, ptr @Run, align 4, !tbaa !9
  %93 = icmp sgt i32 %92, 1
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = tail call i64 @MergeBetterTourWithBestTour() #3
  br label %96

96:                                               ; preds = %._crit_edge, %79, %90, %86, %75, %78, %91, %94
  %.1 = phi i64 [ %95, %94 ], [ %48, %91 ], [ %.060.lcssa, %78 ], [ %.060.lcssa, %75 ], [ %.060.lcssa, %86 ], [ %.060.lcssa, %90 ], [ %.060.lcssa, %79 ], [ %.060.lcssa, %._crit_edge ]
  %97 = load i64, ptr @BestCost, align 8, !tbaa !13
  %98 = icmp slt i64 %.1, %97
  br i1 %98, label %99, label %106

99:                                               ; preds = %96
  store i64 %.1, ptr @BestCost, align 8, !tbaa !13
  tail call void @RecordBetterTour() #3
  tail call void @RecordBestTour() #3
  %100 = load ptr, ptr @OutputTourFileName, align 8, !tbaa !5
  %101 = load ptr, ptr @BestTour, align 8, !tbaa !5
  %102 = load i64, ptr @BestCost, align 8, !tbaa !13
  tail call void @WriteTour(ptr noundef %100, ptr noundef %101, i64 noundef %102) #3
  %103 = load ptr, ptr @TourFileName, align 8, !tbaa !5
  %104 = load ptr, ptr @BestTour, align 8, !tbaa !5
  %105 = load i64, ptr @BestCost, align 8, !tbaa !13
  tail call void @WriteTour(ptr noundef %103, ptr noundef %104, i64 noundef %105) #3
  br label %106

106:                                              ; preds = %99, %96
  %107 = load i64, ptr @Optimum, align 8, !tbaa !13
  %108 = icmp slt i64 %.1, %107
  br i1 %108, label %109, label %116

109:                                              ; preds = %106
  %110 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %110, i64 200
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %.not74 = icmp eq ptr %112, null
  br i1 %.not74, label %.loopexit88, label %.preheader

.preheader:                                       ; preds = %109, %.preheader
  %.062 = phi ptr [ %114, %.preheader ], [ %110, %109 ]
  %113 = getelementptr inbounds i8, ptr %.062, i64 72
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = getelementptr inbounds i8, ptr %.062, i64 200
  store ptr %114, ptr %115, align 8, !tbaa !17
  %.not75 = icmp eq ptr %114, %110
  br i1 %.not75, label %.loopexit88, label %.preheader, !llvm.loop !20

.loopexit88:                                      ; preds = %.preheader, %109
  store i64 %.1, ptr @Optimum, align 8, !tbaa !13
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, i64 noundef %.1) #3
  br label %116

116:                                              ; preds = %.loopexit88, %106
  %117 = tail call double @GetTime() #3
  %118 = fsub double %117, %47
  %119 = tail call double @llvm.fabs.f64(double %118)
  tail call void @UpdateStatistics(i64 noundef %.1, double noundef %119) #3
  %120 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %121 = icmp sgt i32 %120, 0
  %122 = icmp ne i64 %.1, 9223372036854775807
  %or.cond5 = and i1 %122, %121
  br i1 %or.cond5, label %123, label %139

123:                                              ; preds = %116
  %124 = load i32, ptr @Run, align 4, !tbaa !9
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, i32 noundef %124, i64 noundef %.1) #3
  %125 = load i64, ptr @Optimum, align 8
  %126 = and i64 %125, 9223372036854775807
  %or.cond7.not = icmp eq i64 %126, 0
  br i1 %or.cond7.not, label %133, label %127

127:                                              ; preds = %123
  %128 = sub nsw i64 %.1, %125
  %129 = sitofp i64 %128 to double
  %130 = fmul double %129, 1.000000e+02
  %131 = sitofp i64 %125 to double
  %132 = fdiv double %130, %131
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, double noundef %132) #3
  %.pre97 = load i64, ptr @Optimum, align 8, !tbaa !13
  br label %133

133:                                              ; preds = %127, %123
  %134 = phi i64 [ %.pre97, %127 ], [ %125, %123 ]
  %135 = icmp slt i64 %.1, %134
  %136 = icmp eq i64 %.1, %134
  %137 = select i1 %136, ptr @.str.7, ptr @.str.8
  %138 = select i1 %135, ptr @.str.6, ptr %137
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.5, double noundef %119, ptr noundef nonnull %138) #3
  br label %139

139:                                              ; preds = %133, %116
  %140 = load i32, ptr @StopAtOptimum, align 4, !tbaa !9
  %.not76 = icmp eq i32 %140, 0
  br i1 %.not76, label %147, label %141

141:                                              ; preds = %139
  %142 = icmp eq i64 %.1, %107
  %143 = load i32, ptr @MaxPopulationSize, align 4
  %144 = icmp sgt i32 %143, 0
  %or.cond9 = select i1 %142, i1 %144, i1 false
  br i1 %or.cond9, label %145, label %147

145:                                              ; preds = %141
  %146 = load i32, ptr @Run, align 4, !tbaa !9
  store i32 %146, ptr @Runs, align 4, !tbaa !9
  br label %.loopexit90

147:                                              ; preds = %141, %139
  %148 = load i32, ptr @StopAtMaxCost, align 4, !tbaa !9
  %.not77 = icmp eq i32 %148, 0
  %149 = load i64, ptr @MaxCost, align 8
  %.not78 = icmp sgt i64 %.1, %149
  %or.cond87 = select i1 %.not77, i1 true, i1 %.not78
  br i1 %or.cond87, label %152, label %150

150:                                              ; preds = %147
  %151 = load i32, ptr @Run, align 4, !tbaa !9
  store i32 %151, ptr @Runs, align 4, !tbaa !9
  br label %.loopexit90

152:                                              ; preds = %147
  %153 = load i32, ptr @PopulationSize, align 4, !tbaa !9
  %154 = icmp sgt i32 %153, 1
  br i1 %154, label %155, label %.loopexit

155:                                              ; preds = %152
  %156 = load i32, ptr @MaxPopulationSize, align 4, !tbaa !9
  %157 = icmp eq i32 %153, %156
  %.pre98 = load i32, ptr @Run, align 4, !tbaa !9
  %158 = shl nsw i32 %156, 1
  %.not79 = icmp sge i32 %.pre98, %158
  %or.cond102.not106 = select i1 %157, i1 true, i1 %.not79
  %159 = load i32, ptr @Runs, align 4
  %160 = icmp slt i32 %.pre98, %159
  %or.cond104 = select i1 %or.cond102.not106, i1 %160, i1 false
  br i1 %or.cond104, label %161, label %.loopexit

161:                                              ; preds = %155
  %162 = tail call i32 @LinearSelection(i32 noundef %153, double noundef 1.250000e+00) #3
  br label %163

163:                                              ; preds = %163, %161
  %164 = load i32, ptr @PopulationSize, align 4, !tbaa !9
  %165 = tail call i32 @LinearSelection(i32 noundef %164, double noundef 1.250000e+00) #3
  %166 = icmp eq i32 %165, %162
  br i1 %166, label %163, label %167, !llvm.loop !21

167:                                              ; preds = %163
  tail call void @ApplyCrossover(i32 noundef %162, i32 noundef %165) #3
  %168 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %169, %167
  %.061 = phi ptr [ %168, %167 ], [ %178, %169 ]
  %170 = load ptr, ptr @C, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %.061, i64 72
  %172 = load ptr, ptr %171, align 8, !tbaa !19
  %173 = tail call i32 %170(ptr noundef %.061, ptr noundef %172) #3
  %174 = load ptr, ptr %171, align 8, !tbaa !19
  %175 = tail call i32 @AddCandidate(ptr noundef %.061, ptr noundef %174, i32 noundef %173, i32 noundef 2147483647) #3
  %176 = load ptr, ptr %171, align 8, !tbaa !19
  %177 = tail call i32 @AddCandidate(ptr noundef %176, ptr noundef %.061, i32 noundef %173, i32 noundef 2147483647) #3
  %178 = load ptr, ptr %171, align 8, !tbaa !19
  %179 = getelementptr inbounds i8, ptr %.061, i64 208
  store ptr %178, ptr %179, align 8, !tbaa !22
  %180 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  %.not80 = icmp eq ptr %178, %180
  br i1 %.not80, label %.loopexit, label %169, !llvm.loop !23

.loopexit:                                        ; preds = %169, %155, %152
  %181 = load i32, ptr @Seed, align 4, !tbaa !9
  %182 = add i32 %181, 1
  store i32 %182, ptr @Seed, align 4, !tbaa !9
  tail call void @SRandom(i32 noundef %182) #3
  %183 = load i32, ptr @Run, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr @Run, align 4, !tbaa !9
  %185 = load i32, ptr @Runs, align 4, !tbaa !9
  %.not72.not = icmp slt i32 %183, %185
  br i1 %.not72.not, label %.lr.ph95, label %.loopexit90, !llvm.loop !24

.loopexit90:                                      ; preds = %.loopexit, %.thread, %45, %150, %145
  tail call void @PrintStatistics() #3
  br label %186

186:                                              ; preds = %13, %19, %25, %32, %31, %22, %16, %.loopexit90
  ret i32 0
}

declare double @GetTime() local_unnamed_addr #1

declare void @ReadParameters() local_unnamed_addr #1

declare void @ReadProblem() local_unnamed_addr #1

declare void @SolveDelaunaySubproblems() local_unnamed_addr #1

declare void @SolveKarpSubproblems() local_unnamed_addr #1

declare void @SolveKCenterSubproblems() local_unnamed_addr #1

declare void @SolveKMeansSubproblems() local_unnamed_addr #1

declare void @SolveRoheSubproblems() local_unnamed_addr #1

declare void @SolveSFCSubproblems() local_unnamed_addr #1

declare void @SolveTourSegmentSubproblems() local_unnamed_addr #1

declare void @AllocateStructures() local_unnamed_addr #1

declare void @CreateCandidateSet() local_unnamed_addr #1

declare void @InitializeStatistics() local_unnamed_addr #1

declare void @UpdateStatistics(i64 noundef, double noundef) local_unnamed_addr #1

declare void @RecordBetterTour() local_unnamed_addr #1

declare void @RecordBestTour() local_unnamed_addr #1

declare void @WriteTour(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i64 @FindTour() local_unnamed_addr #1

declare i64 @MergeTourWithIndividual(i32 noundef) local_unnamed_addr #1

declare void @printff(ptr noundef, ...) local_unnamed_addr #1

declare i32 @HasFitness(i64 noundef) local_unnamed_addr #1

declare void @AddToPopulation(i64 noundef) local_unnamed_addr #1

declare void @PrintPopulation(...) local_unnamed_addr #1

declare i32 @ReplacementIndividual(i64 noundef) local_unnamed_addr #1

declare void @ReplaceIndividualWithTour(i32 noundef, i64 noundef) local_unnamed_addr #1

declare i64 @MergeBetterTourWithBestTour() local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2

declare i32 @LinearSelection(i32 noundef, double noundef) local_unnamed_addr #1

declare void @ApplyCrossover(i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @AddCandidate(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @SRandom(i32 noundef) local_unnamed_addr #1

declare void @PrintStatistics() local_unnamed_addr #1

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 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 200}
!18 = !{!"Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!19 = !{!18, !6, i64 72}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = !{!18, !6, i64 208}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass