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

; 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 }
%struct.Candidate = type { ptr, i32, i32 }

@Norm = external dso_local global i32, align 4
@C = external dso_local global ptr, align 8
@FirstNode = external dso_local global ptr, align 8
@Precision = external dso_local global i32, align 4
@Distance = external dso_local global ptr, align 8
@MaxTrials = external dso_local global i32, align 4
@InitialTourAlgorithm = external dso_local global i32, align 4
@MaxCandidates = external dso_local global i32, align 4
@ProblemType = external dso_local global i32, align 4
@TraceLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [25 x i8], align 1
@CandidateSetType = external dso_local global i32, align 4
@CandidateSetSymmetric = external dso_local global i32, align 4
@Subgradient = external dso_local global i32, align 4
@SubproblemSize = external dso_local global i32, align 4
@PiFile = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@LowerBound = external dso_local global double, align 8
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@Excess = external dso_local global double, align 8
@ExtraCandidates = external dso_local global i32, align 4
@ExtraCandidateSetType = external dso_local global i32, align 4
@ExtraCandidateSetSymmetric = external dso_local global i32, align 4
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@NodeSet = external dso_local global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @CreateCandidateSet() #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %8 = call double @GetTime()
  store double %8, ptr %7, align 8, !tbaa !9
  store i32 9999, ptr @Norm, align 4, !tbaa !5
  %9 = load ptr, ptr @C, align 8, !tbaa !11
  %10 = icmp eq ptr %9, @C_EXPLICIT
  br i1 %10, label %11, label %41

11:                                               ; preds = %0
  %12 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %12, ptr %4, align 8, !tbaa !11
  br label %13

13:                                               ; preds = %34, %11
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %30, %13
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct.Node, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !13
  %19 = icmp slt i32 %15, %18
  br i1 %19, label %20, label %33

20:                                               ; preds = %14
  %21 = load i32, ptr @Precision, align 4, !tbaa !5
  %22 = load ptr, ptr %4, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 14
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr %24, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = mul nsw i32 %28, %21
  store i32 %29, ptr %27, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %20
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !5
  br label %14, !llvm.loop !16

33:                                               ; preds = %14
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %4, align 8, !tbaa !11
  %36 = getelementptr inbounds %struct.Node, ptr %35, i32 0, i32 16
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  store ptr %37, ptr %4, align 8, !tbaa !11
  %38 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %39 = icmp ne ptr %37, %38
  br i1 %39, label %13, label %40, !llvm.loop !19

40:                                               ; preds = %34
  br label %41

41:                                               ; preds = %40, %0
  %42 = load ptr, ptr @Distance, align 8, !tbaa !11
  %43 = icmp eq ptr %42, @Distance_1
  br i1 %43, label %58, label %44

44:                                               ; preds = %41
  %45 = load i32, ptr @MaxTrials, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %69

47:                                               ; preds = %44
  %48 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.Node, ptr %48, i32 0, i32 33
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = icmp ne ptr %50, null
  br i1 %51, label %58, label %52

52:                                               ; preds = %47
  %53 = load i32, ptr @InitialTourAlgorithm, align 4, !tbaa !5
  %54 = icmp eq i32 %53, 5
  br i1 %54, label %58, label %55

55:                                               ; preds = %52
  %56 = load i32, ptr @InitialTourAlgorithm, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %69

58:                                               ; preds = %55, %52, %47, %41
  %59 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %60 = call i32 @ReadCandidates(i32 noundef %59)
  call void @AddTourCandidates()
  %61 = load i32, ptr @ProblemType, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 3
  br i1 %62, label %66, label %63

63:                                               ; preds = %58
  %64 = load i32, ptr @ProblemType, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 6
  br i1 %65, label %66, label %68

66:                                               ; preds = %63, %58
  %67 = call i64 @Ascent()
  br label %68

68:                                               ; preds = %66, %63
  br label %278

69:                                               ; preds = %55, %44
  %70 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %71 = icmp sge i32 %70, 2
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  call void (ptr, ...) @printff(ptr noundef @.str)
  br label %73

73:                                               ; preds = %72, %69
  %74 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %76, label %108

76:                                               ; preds = %73
  %77 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 3
  br i1 %78, label %82, label %79

79:                                               ; preds = %76
  %80 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %81 = icmp eq i32 %80, 2
  br i1 %81, label %82, label %108

82:                                               ; preds = %79, %76
  %83 = call i32 @ReadPenalties()
  %84 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %85 = call i32 @ReadCandidates(i32 noundef %84)
  store i32 %85, ptr %5, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %102, label %87

87:                                               ; preds = %82
  %88 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %102

90:                                               ; preds = %87
  %91 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 3
  br i1 %92, label %93, label %95

93:                                               ; preds = %90
  %94 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  call void @CreateQuadrantCandidateSet(i32 noundef %94)
  br label %101

95:                                               ; preds = %90
  %96 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 2
  br i1 %97, label %98, label %100

98:                                               ; preds = %95
  %99 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  call void @CreateNearestNeighborCandidateSet(i32 noundef %99)
  br label %100

100:                                              ; preds = %98, %95
  br label %101

101:                                              ; preds = %100, %93
  br label %107

102:                                              ; preds = %87, %82
  call void @AddTourCandidates()
  %103 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %102
  call void @SymmetrizeCandidateSet()
  br label %106

106:                                              ; preds = %105, %102
  br label %107

107:                                              ; preds = %106, %101
  br label %278

108:                                              ; preds = %79, %73
  %109 = call i32 @ReadPenalties()
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %133, label %111

111:                                              ; preds = %108
  %112 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %112, ptr %4, align 8, !tbaa !11
  br label %113

113:                                              ; preds = %116, %111
  %114 = load ptr, ptr %4, align 8, !tbaa !11
  %115 = getelementptr inbounds %struct.Node, ptr %114, i32 0, i32 9
  store i32 0, ptr %115, align 4, !tbaa !21
  br label %116

116:                                              ; preds = %113
  %117 = load ptr, ptr %4, align 8, !tbaa !11
  %118 = getelementptr inbounds %struct.Node, ptr %117, i32 0, i32 16
  %119 = load ptr, ptr %118, align 8, !tbaa !18
  store ptr %119, ptr %4, align 8, !tbaa !11
  %120 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %121 = icmp ne ptr %119, %120
  br i1 %121, label %113, label %122, !llvm.loop !22

122:                                              ; preds = %116
  %123 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %124 = call i32 @ReadCandidates(i32 noundef %123)
  store i32 %124, ptr %5, align 4, !tbaa !5
  %125 = call i64 @Ascent()
  store i64 %125, ptr %1, align 8, !tbaa !23
  %126 = load i32, ptr @Subgradient, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %132

128:                                              ; preds = %122
  %129 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  call void @WritePenalties()
  store ptr null, ptr @PiFile, align 8, !tbaa !11
  br label %132

132:                                              ; preds = %131, %128, %122
  br label %210

133:                                              ; preds = %108
  %134 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %135 = call i32 @ReadCandidates(i32 noundef %134)
  store i32 %135, ptr %5, align 4, !tbaa !5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %140, label %137

137:                                              ; preds = %133
  %138 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %145

140:                                              ; preds = %137, %133
  call void @AddTourCandidates()
  %141 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %140
  call void @SymmetrizeCandidateSet()
  br label %144

144:                                              ; preds = %143, %140
  br label %278

145:                                              ; preds = %137
  %146 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %147 = icmp ne i32 %146, 1
  br i1 %147, label %148, label %161

148:                                              ; preds = %145
  %149 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %150 = icmp sgt i32 %149, 0
  br i1 %150, label %151, label %161

151:                                              ; preds = %148
  %152 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %153 = icmp sge i32 %152, 2
  br i1 %153, label %154, label %155

154:                                              ; preds = %151
  call void (ptr, ...) @printff(ptr noundef @.str.1)
  br label %155

155:                                              ; preds = %154, %151
  %156 = call i64 @Minimum1TreeCost(i32 noundef 0)
  store i64 %156, ptr %1, align 8, !tbaa !23
  %157 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %158 = icmp sge i32 %157, 2
  br i1 %158, label %159, label %160

159:                                              ; preds = %155
  call void (ptr, ...) @printff(ptr noundef @.str.2)
  br label %160

160:                                              ; preds = %159, %155
  br label %208

161:                                              ; preds = %148, %145
  call void @CreateDelaunayCandidateSet()
  %162 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %162, ptr %4, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %171, %161
  %164 = load ptr, ptr %4, align 8, !tbaa !11
  %165 = getelementptr inbounds %struct.Node, ptr %164, i32 0, i32 9
  %166 = load i32, ptr %165, align 4, !tbaa !21
  %167 = load ptr, ptr %4, align 8, !tbaa !11
  %168 = getelementptr inbounds %struct.Node, ptr %167, i32 0, i32 10
  store i32 %166, ptr %168, align 8, !tbaa !25
  %169 = load ptr, ptr %4, align 8, !tbaa !11
  %170 = getelementptr inbounds %struct.Node, ptr %169, i32 0, i32 9
  store i32 0, ptr %170, align 4, !tbaa !21
  br label %171

171:                                              ; preds = %163
  %172 = load ptr, ptr %4, align 8, !tbaa !11
  %173 = getelementptr inbounds %struct.Node, ptr %172, i32 0, i32 16
  %174 = load ptr, ptr %173, align 8, !tbaa !18
  store ptr %174, ptr %4, align 8, !tbaa !11
  %175 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %176 = icmp ne ptr %174, %175
  br i1 %176, label %163, label %177, !llvm.loop !26

177:                                              ; preds = %171
  %178 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %179 = icmp sge i32 %178, 2
  br i1 %179, label %180, label %181

180:                                              ; preds = %177
  call void (ptr, ...) @printff(ptr noundef @.str.1)
  br label %181

181:                                              ; preds = %180, %177
  %182 = call i64 @Minimum1TreeCost(i32 noundef 1)
  store i64 %182, ptr %1, align 8, !tbaa !23
  %183 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %184 = icmp sge i32 %183, 2
  br i1 %184, label %185, label %186

185:                                              ; preds = %181
  call void (ptr, ...) @printff(ptr noundef @.str.2)
  br label %186

186:                                              ; preds = %185, %181
  %187 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %187, ptr %4, align 8, !tbaa !11
  br label %188

188:                                              ; preds = %201, %186
  %189 = load ptr, ptr %4, align 8, !tbaa !11
  %190 = getelementptr inbounds %struct.Node, ptr %189, i32 0, i32 10
  %191 = load i32, ptr %190, align 8, !tbaa !25
  %192 = load ptr, ptr %4, align 8, !tbaa !11
  %193 = getelementptr inbounds %struct.Node, ptr %192, i32 0, i32 9
  store i32 %191, ptr %193, align 4, !tbaa !21
  %194 = load ptr, ptr %4, align 8, !tbaa !11
  %195 = getelementptr inbounds %struct.Node, ptr %194, i32 0, i32 9
  %196 = load i32, ptr %195, align 4, !tbaa !21
  %197 = mul nsw i32 2, %196
  %198 = sext i32 %197 to i64
  %199 = load i64, ptr %1, align 8, !tbaa !23
  %200 = sub nsw i64 %199, %198
  store i64 %200, ptr %1, align 8, !tbaa !23
  br label %201

201:                                              ; preds = %188
  %202 = load ptr, ptr %4, align 8, !tbaa !11
  %203 = getelementptr inbounds %struct.Node, ptr %202, i32 0, i32 16
  %204 = load ptr, ptr %203, align 8, !tbaa !18
  store ptr %204, ptr %4, align 8, !tbaa !11
  %205 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %206 = icmp ne ptr %204, %205
  br i1 %206, label %188, label %207, !llvm.loop !27

207:                                              ; preds = %201
  br label %208

208:                                              ; preds = %207, %160
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209, %132
  %211 = load i64, ptr %1, align 8, !tbaa !23
  %212 = sitofp i64 %211 to double
  %213 = load i32, ptr @Precision, align 4, !tbaa !5
  %214 = sitofp i32 %213 to double
  %215 = fdiv double %212, %214
  store double %215, ptr @LowerBound, align 8, !tbaa !9
  %216 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %217 = icmp sge i32 %216, 1
  br i1 %217, label %218, label %243

218:                                              ; preds = %210
  %219 = load double, ptr @LowerBound, align 8, !tbaa !9
  call void (ptr, ...) @printff(ptr noundef @.str.3, double noundef %219)
  %220 = load i64, ptr @Optimum, align 8, !tbaa !23
  %221 = icmp ne i64 %220, -9223372036854775808
  br i1 %221, label %222, label %234

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

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

234:                                              ; preds = %225, %222, %218
  %235 = load ptr, ptr @PiFile, align 8, !tbaa !11
  %236 = icmp ne ptr %235, null
  br i1 %236, label %242, label %237

237:                                              ; preds = %234
  %238 = call double @GetTime()
  %239 = load double, ptr %7, align 8, !tbaa !9
  %240 = fsub double %238, %239
  %241 = call double @llvm.fabs.f64(double %240)
  call void (ptr, ...) @printff(ptr noundef @.str.5, double noundef %241)
  br label %242

242:                                              ; preds = %237, %234
  call void (ptr, ...) @printff(ptr noundef @.str.6)
  br label %243

243:                                              ; preds = %242, %210
  %244 = load double, ptr @Excess, align 8, !tbaa !9
  %245 = load i64, ptr %1, align 8, !tbaa !23
  %246 = sitofp i64 %245 to double
  %247 = fmul double %244, %246
  %248 = call double @llvm.fabs.f64(double %247)
  %249 = fptosi double %248 to i64
  store i64 %249, ptr %2, align 8, !tbaa !23
  %250 = load i64, ptr @Optimum, align 8, !tbaa !23
  %251 = load i32, ptr @Precision, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = mul nsw i64 %250, %252
  %254 = load i64, ptr %1, align 8, !tbaa !23
  %255 = sub nsw i64 %253, %254
  store i64 %255, ptr %3, align 8, !tbaa !23
  %256 = icmp sgt i64 %255, 0
  br i1 %256, label %257, label %263

257:                                              ; preds = %243
  %258 = load i64, ptr %3, align 8, !tbaa !23
  %259 = load i64, ptr %2, align 8, !tbaa !23
  %260 = icmp slt i64 %258, %259
  br i1 %260, label %261, label %263

261:                                              ; preds = %257
  %262 = load i64, ptr %3, align 8, !tbaa !23
  store i64 %262, ptr %2, align 8, !tbaa !23
  br label %263

263:                                              ; preds = %261, %257, %243
  %264 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %265 = icmp eq i32 %264, 1
  br i1 %265, label %269, label %266

266:                                              ; preds = %263
  %267 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %268 = icmp eq i32 %267, 0
  br i1 %268, label %269, label %273

269:                                              ; preds = %266, %263
  %270 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %271 = load i64, ptr %2, align 8, !tbaa !23
  %272 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  call void @OrderCandidateSet(i32 noundef %270, i64 noundef %271, i32 noundef %272)
  br label %277

273:                                              ; preds = %266
  %274 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %275 = load i64, ptr %2, align 8, !tbaa !23
  %276 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  call void @GenerateCandidates(i32 noundef %274, i64 noundef %275, i32 noundef %276)
  br label %277

277:                                              ; preds = %273, %269
  br label %278

278:                                              ; preds = %277, %144, %107, %68
  %279 = load i32, ptr @ExtraCandidates, align 4, !tbaa !5
  %280 = icmp sgt i32 %279, 0
  br i1 %280, label %281, label %285

281:                                              ; preds = %278
  %282 = load i32, ptr @ExtraCandidates, align 4, !tbaa !5
  %283 = load i32, ptr @ExtraCandidateSetType, align 4, !tbaa !5
  %284 = load i32, ptr @ExtraCandidateSetSymmetric, align 4, !tbaa !5
  call void @AddExtraCandidates(i32 noundef %282, i32 noundef %283, i32 noundef %284)
  call void @AddTourCandidates()
  br label %285

285:                                              ; preds = %281, %278
  call void @ResetCandidateSet()
  %286 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %286, ptr %4, align 8, !tbaa !11
  br label %287

287:                                              ; preds = %313, %285
  %288 = load ptr, ptr %4, align 8, !tbaa !11
  %289 = getelementptr inbounds %struct.Node, ptr %288, i32 0, i32 43
  %290 = load ptr, ptr %289, align 8, !tbaa !28
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %300

292:                                              ; preds = %287
  %293 = load ptr, ptr %4, align 8, !tbaa !11
  %294 = getelementptr inbounds %struct.Node, ptr %293, i32 0, i32 43
  %295 = load ptr, ptr %294, align 8, !tbaa !28
  %296 = getelementptr inbounds %struct.Candidate, ptr %295, i64 0
  %297 = getelementptr inbounds %struct.Candidate, ptr %296, i32 0, i32 0
  %298 = load ptr, ptr %297, align 8, !tbaa !29
  %299 = icmp ne ptr %298, null
  br i1 %299, label %312, label %300

300:                                              ; preds = %292, %287
  %301 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %302 = icmp eq i32 %301, 0
  br i1 %302, label %303, label %307

303:                                              ; preds = %300
  %304 = load ptr, ptr %4, align 8, !tbaa !11
  %305 = getelementptr inbounds %struct.Node, ptr %304, i32 0, i32 0
  %306 = load i32, ptr %305, align 8, !tbaa !13
  call void (ptr, ...) @eprintf(ptr noundef @.str.7, i32 noundef %306)
  br label %311

307:                                              ; preds = %300
  %308 = load ptr, ptr %4, align 8, !tbaa !11
  %309 = getelementptr inbounds %struct.Node, ptr %308, i32 0, i32 0
  %310 = load i32, ptr %309, align 8, !tbaa !13
  call void (ptr, ...) @eprintf(ptr noundef @.str.8, i32 noundef %310)
  br label %311

311:                                              ; preds = %307, %303
  br label %312

312:                                              ; preds = %311, %292
  br label %313

313:                                              ; preds = %312
  %314 = load ptr, ptr %4, align 8, !tbaa !11
  %315 = getelementptr inbounds %struct.Node, ptr %314, i32 0, i32 16
  %316 = load ptr, ptr %315, align 8, !tbaa !18
  store ptr %316, ptr %4, align 8, !tbaa !11
  %317 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %318 = icmp ne ptr %316, %317
  br i1 %318, label %287, label %319, !llvm.loop !31

319:                                              ; preds = %313
  %320 = load i32, ptr %5, align 4, !tbaa !5
  %321 = icmp ne i32 %320, 0
  br i1 %321, label %326, label %322

322:                                              ; preds = %319
  %323 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %324 = icmp eq i32 %323, 0
  br i1 %324, label %325, label %326

325:                                              ; preds = %322
  call void @WriteCandidates()
  br label %326

326:                                              ; preds = %325, %322, %319
  %327 = load ptr, ptr @C, align 8, !tbaa !11
  %328 = icmp eq ptr %327, @C_EXPLICIT
  br i1 %328, label %329, label %368

329:                                              ; preds = %326
  %330 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %330, ptr %4, align 8, !tbaa !11
  br label %331

331:                                              ; preds = %361, %329
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %332

332:                                              ; preds = %357, %331
  %333 = load i32, ptr %6, align 4, !tbaa !5
  %334 = load ptr, ptr %4, align 8, !tbaa !11
  %335 = getelementptr inbounds %struct.Node, ptr %334, i32 0, i32 0
  %336 = load i32, ptr %335, align 8, !tbaa !13
  %337 = icmp slt i32 %333, %336
  br i1 %337, label %338, label %360

338:                                              ; preds = %332
  %339 = load ptr, ptr %4, align 8, !tbaa !11
  %340 = getelementptr inbounds %struct.Node, ptr %339, i32 0, i32 9
  %341 = load i32, ptr %340, align 4, !tbaa !21
  %342 = load ptr, ptr @NodeSet, align 8, !tbaa !11
  %343 = load i32, ptr %6, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds %struct.Node, ptr %342, i64 %344
  %346 = getelementptr inbounds %struct.Node, ptr %345, i32 0, i32 9
  %347 = load i32, ptr %346, align 4, !tbaa !21
  %348 = add nsw i32 %341, %347
  %349 = load ptr, ptr %4, align 8, !tbaa !11
  %350 = getelementptr inbounds %struct.Node, ptr %349, i32 0, i32 14
  %351 = load ptr, ptr %350, align 8, !tbaa !15
  %352 = load i32, ptr %6, align 4, !tbaa !5
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds i32, ptr %351, i64 %353
  %355 = load i32, ptr %354, align 4, !tbaa !5
  %356 = add nsw i32 %355, %348
  store i32 %356, ptr %354, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %338
  %358 = load i32, ptr %6, align 4, !tbaa !5
  %359 = add nsw i32 %358, 1
  store i32 %359, ptr %6, align 4, !tbaa !5
  br label %332, !llvm.loop !32

360:                                              ; preds = %332
  br label %361

361:                                              ; preds = %360
  %362 = load ptr, ptr %4, align 8, !tbaa !11
  %363 = getelementptr inbounds %struct.Node, ptr %362, i32 0, i32 16
  %364 = load ptr, ptr %363, align 8, !tbaa !18
  store ptr %364, ptr %4, align 8, !tbaa !11
  %365 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %366 = icmp ne ptr %364, %365
  br i1 %366, label %331, label %367, !llvm.loop !33

367:                                              ; preds = %361
  br label %368

368:                                              ; preds = %367, %326
  %369 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %370 = icmp sge i32 %369, 1
  br i1 %370, label %371, label %376

371:                                              ; preds = %368
  call void @CandidateReport()
  %372 = call double @GetTime()
  %373 = load double, ptr %7, align 8, !tbaa !9
  %374 = fsub double %372, %373
  %375 = call double @llvm.fabs.f64(double %374)
  call void (ptr, ...) @printff(ptr noundef @.str.9, double noundef %375)
  br label %376

376:                                              ; preds = %371, %368
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

; 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 i32 @C_EXPLICIT(ptr noundef, ptr noundef) #2

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

declare i32 @ReadCandidates(i32 noundef) #2

declare void @AddTourCandidates() #2

declare i64 @Ascent() #2

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

declare i32 @ReadPenalties() #2

declare void @CreateQuadrantCandidateSet(i32 noundef) #2

declare void @CreateNearestNeighborCandidateSet(i32 noundef) #2

declare void @SymmetrizeCandidateSet() #2

declare void @WritePenalties() #2

declare i64 @Minimum1TreeCost(i32 noundef) #2

declare void @CreateDelaunayCandidateSet() #2

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

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

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

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

declare void @ResetCandidateSet() #2

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

declare void @WriteCandidates() #2

declare void @CandidateReport() #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"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, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!15 = !{!14, !12, i64 56}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !12, i64 72}
!19 = distinct !{!19, !17}
!20 = !{!14, !12, i64 208}
!21 = !{!14, !6, i64 36}
!22 = distinct !{!22, !17}
!23 = !{!24, !24, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = !{!14, !6, i64 40}
!26 = distinct !{!26, !17}
!27 = distinct !{!27, !17}
!28 = !{!14, !12, i64 288}
!29 = !{!30, !12, i64 0}
!30 = !{!"Candidate", !12, i64 0, !6, i64 8, !6, i64 12}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !17}
!33 = distinct !{!33, !17}


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

%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 }

@Norm = external dso_local local_unnamed_addr global i32, align 4
@C = external dso_local local_unnamed_addr global ptr, align 8
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@Precision = external dso_local local_unnamed_addr global i32, align 4
@Distance = external dso_local local_unnamed_addr global ptr, align 8
@MaxTrials = external dso_local local_unnamed_addr global i32, align 4
@InitialTourAlgorithm = external dso_local local_unnamed_addr global i32, align 4
@MaxCandidates = external dso_local local_unnamed_addr global i32, align 4
@ProblemType = 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 [25 x i8], align 1
@CandidateSetType = external dso_local local_unnamed_addr global i32, align 4
@CandidateSetSymmetric = external dso_local local_unnamed_addr global i32, align 4
@Subgradient = external dso_local local_unnamed_addr global i32, align 4
@SubproblemSize = external dso_local local_unnamed_addr global i32, align 4
@PiFile = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@LowerBound = external dso_local local_unnamed_addr global double, align 8
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@Excess = external dso_local local_unnamed_addr global double, align 8
@ExtraCandidates = external dso_local local_unnamed_addr global i32, align 4
@ExtraCandidateSetType = external dso_local local_unnamed_addr global i32, align 4
@ExtraCandidateSetSymmetric = external dso_local local_unnamed_addr global i32, align 4
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@NodeSet = external dso_local local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @CreateCandidateSet() local_unnamed_addr #0 {
  %1 = tail call double @GetTime() #4
  store i32 9999, ptr @Norm, align 4, !tbaa !5
  %2 = load ptr, ptr @C, align 8, !tbaa !9
  %3 = icmp eq ptr %2, @C_EXPLICIT
  br i1 %3, label %4, label %.loopexit95

4:                                                ; preds = %0
  %5 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %6

6:                                                ; preds = %._crit_edge, %4
  %.065 = phi ptr [ %5, %4 ], [ %20, %._crit_edge ]
  %7 = load i32, ptr %.065, align 8, !tbaa !11
  %8 = icmp sgt i32 %7, 1
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %9 = getelementptr inbounds i8, ptr %.065, i64 56
  %10 = load ptr, ptr %9, align 8, !tbaa !14
  br label %11

11:                                               ; preds = %.lr.ph, %11
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %11 ]
  %12 = load i32, ptr @Precision, align 4, !tbaa !5
  %13 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = mul nsw i32 %14, %12
  store i32 %15, ptr %13, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %.065, align 8, !tbaa !11
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %11, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %11, %6
  %19 = getelementptr inbounds i8, ptr %.065, i64 72
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %.not = icmp eq ptr %20, %5
  br i1 %.not, label %.loopexit95, label %6, !llvm.loop !18

.loopexit95:                                      ; preds = %._crit_edge, %0
  %21 = load ptr, ptr @Distance, align 8, !tbaa !9
  %22 = icmp eq ptr %21, @Distance_1
  br i1 %22, label %31, label %23

23:                                               ; preds = %.loopexit95
  %24 = load i32, ptr @MaxTrials, align 4, !tbaa !5
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %37

26:                                               ; preds = %23
  %27 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 208
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %.fr = freeze ptr %29
  %.not93 = icmp eq ptr %.fr, null
  br i1 %.not93, label %switch.early.test, label %31

switch.early.test:                                ; preds = %26
  %30 = load i32, ptr @InitialTourAlgorithm, align 4
  switch i32 %30, label %37 [
    i32 5, label %31
    i32 2, label %31
  ]

31:                                               ; preds = %switch.early.test, %switch.early.test, %26, %.loopexit95
  %32 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %33 = tail call i32 @ReadCandidates(i32 noundef %32) #4
  tail call void @AddTourCandidates() #4
  %34 = load i32, ptr @ProblemType, align 4
  switch i32 %34, label %169 [
    i32 6, label %35
    i32 3, label %35
  ]

35:                                               ; preds = %31, %31
  %36 = tail call i64 @Ascent() #4
  br label %169

37:                                               ; preds = %switch.early.test, %23
  %38 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 1
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #4
  br label %41

41:                                               ; preds = %40, %37
  %42 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %61

44:                                               ; preds = %41
  %45 = load i32, ptr @CandidateSetType, align 4
  %46 = and i32 %45, -2
  %or.cond7 = icmp eq i32 %46, 2
  br i1 %or.cond7, label %47, label %61

47:                                               ; preds = %44
  %48 = tail call i32 @ReadPenalties() #4
  %49 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %50 = tail call i32 @ReadCandidates(i32 noundef %49) #4
  %51 = icmp eq i32 %50, 0
  %52 = load i32, ptr @MaxCandidates, align 4
  %53 = icmp sgt i32 %52, 0
  %or.cond9 = select i1 %51, i1 %53, i1 false
  br i1 %or.cond9, label %54, label %58

54:                                               ; preds = %47
  %55 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  switch i32 %55, label %169 [
    i32 3, label %56
    i32 2, label %57
  ]

56:                                               ; preds = %54
  tail call void @CreateQuadrantCandidateSet(i32 noundef %52) #4
  br label %169

57:                                               ; preds = %54
  tail call void @CreateNearestNeighborCandidateSet(i32 noundef %52) #4
  br label %169

58:                                               ; preds = %47
  tail call void @AddTourCandidates() #4
  %59 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %.not88 = icmp eq i32 %59, 0
  br i1 %.not88, label %169, label %60

60:                                               ; preds = %58
  tail call void @SymmetrizeCandidateSet() #4
  br label %169

61:                                               ; preds = %44, %41
  %62 = tail call i32 @ReadPenalties() #4
  %.not82 = icmp eq i32 %62, 0
  br i1 %.not82, label %63, label %78

63:                                               ; preds = %61
  %64 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %65, %63
  %.166 = phi ptr [ %64, %63 ], [ %68, %65 ]
  %66 = getelementptr inbounds i8, ptr %.166, i64 36
  store i32 0, ptr %66, align 4, !tbaa !20
  %67 = getelementptr inbounds i8, ptr %.166, i64 72
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %.not83 = icmp eq ptr %68, %64
  br i1 %.not83, label %69, label %65, !llvm.loop !21

69:                                               ; preds = %65
  %70 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %71 = tail call i32 @ReadCandidates(i32 noundef %70) #4
  %72 = tail call i64 @Ascent() #4
  %73 = load i32, ptr @Subgradient, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  %75 = load i32, ptr @SubproblemSize, align 4
  %76 = icmp eq i32 %75, 0
  %or.cond11 = select i1 %74, i1 %76, i1 false
  br i1 %or.cond11, label %77, label %.loopexit94

77:                                               ; preds = %69
  tail call void @WritePenalties() #4
  store ptr null, ptr @PiFile, align 8, !tbaa !9
  br label %.loopexit94

78:                                               ; preds = %61
  %79 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %80 = tail call i32 @ReadCandidates(i32 noundef %79) #4
  %81 = icmp ne i32 %80, 0
  %82 = load i32, ptr @MaxCandidates, align 4
  %83 = icmp eq i32 %82, 0
  %or.cond13 = select i1 %81, i1 true, i1 %83
  br i1 %or.cond13, label %84, label %87

84:                                               ; preds = %78
  tail call void @AddTourCandidates() #4
  %85 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %.not87 = icmp eq i32 %85, 0
  br i1 %.not87, label %169, label %86

86:                                               ; preds = %84
  tail call void @SymmetrizeCandidateSet() #4
  br label %169

87:                                               ; preds = %78
  %88 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %89 = icmp ne i32 %88, 1
  %90 = icmp sgt i32 %82, 0
  %or.cond15 = select i1 %89, i1 %90, i1 false
  br i1 %or.cond15, label %91, label %100

91:                                               ; preds = %87
  %92 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %93 = icmp sgt i32 %92, 1
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1) #4
  br label %95

95:                                               ; preds = %94, %91
  %96 = tail call i64 @Minimum1TreeCost(i32 noundef 0) #4
  %97 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %98 = icmp sgt i32 %97, 1
  br i1 %98, label %99, label %.loopexit94

99:                                               ; preds = %95
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #4
  br label %.loopexit94

100:                                              ; preds = %87
  tail call void @CreateDelaunayCandidateSet() #4
  %101 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %102, %100
  %.2 = phi ptr [ %101, %100 ], [ %107, %102 ]
  %103 = getelementptr inbounds i8, ptr %.2, i64 36
  %104 = load i32, ptr %103, align 4, !tbaa !20
  %105 = getelementptr inbounds i8, ptr %.2, i64 40
  store i32 %104, ptr %105, align 8, !tbaa !22
  store i32 0, ptr %103, align 4, !tbaa !20
  %106 = getelementptr inbounds i8, ptr %.2, i64 72
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %.not84 = icmp eq ptr %107, %101
  br i1 %.not84, label %108, label %102, !llvm.loop !23

108:                                              ; preds = %102
  %109 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 1
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1) #4
  br label %112

112:                                              ; preds = %111, %108
  %113 = tail call i64 @Minimum1TreeCost(i32 noundef 1) #4
  %114 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %115 = icmp sgt i32 %114, 1
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #4
  br label %117

117:                                              ; preds = %116, %112
  %118 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %119

119:                                              ; preds = %119, %117
  %.3 = phi ptr [ %118, %117 ], [ %127, %119 ]
  %.0 = phi i64 [ %113, %117 ], [ %125, %119 ]
  %120 = getelementptr inbounds i8, ptr %.3, i64 40
  %121 = load i32, ptr %120, align 8, !tbaa !22
  %122 = getelementptr inbounds i8, ptr %.3, i64 36
  store i32 %121, ptr %122, align 4, !tbaa !20
  %123 = shl nsw i32 %121, 1
  %124 = sext i32 %123 to i64
  %125 = sub nsw i64 %.0, %124
  %126 = getelementptr inbounds i8, ptr %.3, i64 72
  %127 = load ptr, ptr %126, align 8, !tbaa !17
  %.not85 = icmp eq ptr %127, %118
  br i1 %.not85, label %.loopexit94, label %119, !llvm.loop !24

.loopexit94:                                      ; preds = %119, %95, %99, %69, %77
  %.063 = phi i32 [ 0, %99 ], [ 0, %95 ], [ %71, %77 ], [ %71, %69 ], [ 0, %119 ]
  %.1 = phi i64 [ %96, %99 ], [ %96, %95 ], [ %72, %77 ], [ %72, %69 ], [ %125, %119 ]
  %128 = sitofp i64 %.1 to double
  %129 = load i32, ptr @Precision, align 4, !tbaa !5
  %130 = sitofp i32 %129 to double
  %131 = fdiv double %128, %130
  store double %131, ptr @LowerBound, align 8, !tbaa !25
  %132 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %133 = icmp sgt i32 %132, 0
  br i1 %133, label %134, label %150

134:                                              ; preds = %.loopexit94
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, double noundef %131) #4
  %135 = load i64, ptr @Optimum, align 8
  %136 = and i64 %135, 9223372036854775807
  %or.cond17.not = icmp eq i64 %136, 0
  br i1 %or.cond17.not, label %143, label %137

137:                                              ; preds = %134
  %138 = sitofp i64 %135 to double
  %139 = load double, ptr @LowerBound, align 8, !tbaa !25
  %140 = fsub double %138, %139
  %141 = fmul double %140, 1.000000e+02
  %142 = fdiv double %141, %138
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, double noundef %142) #4
  br label %143

143:                                              ; preds = %137, %134
  %144 = load ptr, ptr @PiFile, align 8, !tbaa !9
  %.not86 = icmp eq ptr %144, null
  br i1 %.not86, label %145, label %149

145:                                              ; preds = %143
  %146 = tail call double @GetTime() #4
  %147 = fsub double %146, %1
  %148 = tail call double @llvm.fabs.f64(double %147)
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.5, double noundef %148) #4
  br label %149

149:                                              ; preds = %145, %143
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.6) #4
  %.pre = load i32, ptr @Precision, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %149, %.loopexit94
  %151 = phi i32 [ %.pre, %149 ], [ %129, %.loopexit94 ]
  %152 = load double, ptr @Excess, align 8, !tbaa !25
  %153 = fmul double %152, %128
  %154 = tail call double @llvm.fabs.f64(double %153)
  %155 = fptosi double %154 to i64
  %156 = load i64, ptr @Optimum, align 8, !tbaa !26
  %157 = sext i32 %151 to i64
  %158 = mul nsw i64 %156, %157
  %159 = sub nsw i64 %158, %.1
  %160 = icmp sgt i64 %159, 0
  %161 = tail call i64 @llvm.smin.i64(i64 %159, i64 %155)
  %.067 = select i1 %160, i64 %161, i64 %155
  %162 = load i32, ptr @CandidateSetType, align 4, !tbaa !5
  %163 = icmp eq i32 %162, 1
  %164 = load i32, ptr @MaxCandidates, align 4
  %165 = icmp eq i32 %164, 0
  %or.cond19 = select i1 %163, i1 true, i1 %165
  %166 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  br i1 %or.cond19, label %167, label %168

167:                                              ; preds = %150
  tail call void @OrderCandidateSet(i32 noundef %164, i64 noundef %.067, i32 noundef %166) #4
  br label %169

168:                                              ; preds = %150
  tail call void @GenerateCandidates(i32 noundef %164, i64 noundef %.067, i32 noundef %166) #4
  br label %169

169:                                              ; preds = %54, %31, %167, %168, %84, %86, %57, %56, %60, %58, %35
  %.164 = phi i32 [ 0, %35 ], [ 0, %31 ], [ 0, %56 ], [ 0, %57 ], [ %50, %60 ], [ %50, %58 ], [ %80, %86 ], [ %80, %84 ], [ %.063, %167 ], [ %.063, %168 ], [ 0, %54 ]
  %170 = load i32, ptr @ExtraCandidates, align 4, !tbaa !5
  %171 = icmp sgt i32 %170, 0
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load i32, ptr @ExtraCandidateSetType, align 4, !tbaa !5
  %174 = load i32, ptr @ExtraCandidateSetSymmetric, align 4, !tbaa !5
  tail call void @AddExtraCandidates(i32 noundef %170, i32 noundef %173, i32 noundef %174) #4
  tail call void @AddTourCandidates() #4
  br label %175

175:                                              ; preds = %172, %169
  tail call void @ResetCandidateSet() #4
  %176 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %177

177:                                              ; preds = %185, %175
  %.4 = phi ptr [ %176, %175 ], [ %187, %185 ]
  %178 = getelementptr inbounds i8, ptr %.4, i64 288
  %179 = load ptr, ptr %178, align 8, !tbaa !28
  %.not89 = icmp eq ptr %179, null
  br i1 %.not89, label %.sink.split, label %180

180:                                              ; preds = %177
  %181 = load ptr, ptr %179, align 8, !tbaa !29
  %.not90 = icmp eq ptr %181, null
  br i1 %.not90, label %.sink.split, label %185

.sink.split:                                      ; preds = %180, %177
  %182 = load i32, ptr @MaxCandidates, align 4, !tbaa !5
  %183 = icmp eq i32 %182, 0
  %184 = load i32, ptr %.4, align 8, !tbaa !11
  %.str.7..str.8 = select i1 %183, ptr @.str.7, ptr @.str.8
  tail call void (ptr, ...) @eprintf(ptr noundef nonnull %.str.7..str.8, i32 noundef %184) #4
  br label %185

185:                                              ; preds = %.sink.split, %180
  %186 = getelementptr inbounds i8, ptr %.4, i64 72
  %187 = load ptr, ptr %186, align 8, !tbaa !17
  %188 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %.not91 = icmp eq ptr %187, %188
  br i1 %.not91, label %189, label %177, !llvm.loop !31

189:                                              ; preds = %185
  %190 = icmp eq i32 %.164, 0
  %191 = load i32, ptr @SubproblemSize, align 4
  %192 = icmp eq i32 %191, 0
  %or.cond21 = select i1 %190, i1 %192, i1 false
  br i1 %or.cond21, label %193, label %194

193:                                              ; preds = %189
  tail call void @WriteCandidates() #4
  br label %194

194:                                              ; preds = %193, %189
  %195 = load ptr, ptr @C, align 8, !tbaa !9
  %196 = icmp eq ptr %195, @C_EXPLICIT
  br i1 %196, label %197, label %.loopexit

197:                                              ; preds = %194
  %198 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %199 = load ptr, ptr @NodeSet, align 8
  br label %200

200:                                              ; preds = %._crit_edge100, %197
  %.5 = phi ptr [ %198, %197 ], [ %218, %._crit_edge100 ]
  %201 = load i32, ptr %.5, align 8, !tbaa !11
  %202 = icmp sgt i32 %201, 1
  br i1 %202, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %200
  %203 = getelementptr inbounds i8, ptr %.5, i64 36
  %204 = getelementptr inbounds i8, ptr %.5, i64 56
  %205 = load ptr, ptr %204, align 8, !tbaa !14
  br label %206

206:                                              ; preds = %.lr.ph99, %206
  %indvars.iv102 = phi i64 [ 1, %.lr.ph99 ], [ %indvars.iv.next103, %206 ]
  %207 = load i32, ptr %203, align 4, !tbaa !20
  %208 = getelementptr inbounds %struct.Node, ptr %199, i64 %indvars.iv102, i32 9
  %209 = load i32, ptr %208, align 4, !tbaa !20
  %210 = add nsw i32 %209, %207
  %211 = getelementptr inbounds i32, ptr %205, i64 %indvars.iv102
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = add nsw i32 %210, %212
  store i32 %213, ptr %211, align 4, !tbaa !5
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %214 = load i32, ptr %.5, align 8, !tbaa !11
  %215 = sext i32 %214 to i64
  %216 = icmp slt i64 %indvars.iv.next103, %215
  br i1 %216, label %206, label %._crit_edge100, !llvm.loop !32

._crit_edge100:                                   ; preds = %206, %200
  %217 = getelementptr inbounds i8, ptr %.5, i64 72
  %218 = load ptr, ptr %217, align 8, !tbaa !17
  %.not92 = icmp eq ptr %218, %198
  br i1 %.not92, label %.loopexit, label %200, !llvm.loop !33

.loopexit:                                        ; preds = %._crit_edge100, %194
  %219 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %220 = icmp sgt i32 %219, 0
  br i1 %220, label %221, label %225

221:                                              ; preds = %.loopexit
  tail call void @CandidateReport() #4
  %222 = tail call double @GetTime() #4
  %223 = fsub double %222, %1
  %224 = tail call double @llvm.fabs.f64(double %223)
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.9, double noundef %224) #4
  br label %225

225:                                              ; preds = %221, %.loopexit
  ret void
}

declare double @GetTime() local_unnamed_addr #1

declare i32 @C_EXPLICIT(ptr noundef, ptr noundef) #1

declare i32 @Distance_1(ptr noundef, ptr noundef) #1

declare i32 @ReadCandidates(i32 noundef) local_unnamed_addr #1

declare void @AddTourCandidates() local_unnamed_addr #1

declare i64 @Ascent() local_unnamed_addr #1

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

declare i32 @ReadPenalties() local_unnamed_addr #1

declare void @CreateQuadrantCandidateSet(i32 noundef) local_unnamed_addr #1

declare void @CreateNearestNeighborCandidateSet(i32 noundef) local_unnamed_addr #1

declare void @SymmetrizeCandidateSet() local_unnamed_addr #1

declare void @WritePenalties() local_unnamed_addr #1

declare i64 @Minimum1TreeCost(i32 noundef) local_unnamed_addr #1

declare void @CreateDelaunayCandidateSet() local_unnamed_addr #1

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

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

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

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

declare void @ResetCandidateSet() local_unnamed_addr #1

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

declare void @WriteCandidates() local_unnamed_addr #1

declare void @CandidateReport() local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3

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 = { 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, !6, i64 0}
!12 = !{!"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, !13, i64 312, !13, i64 320, !13, i64 328, !13, i64 336, !13, i64 344, !13, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !10, i64 56}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !10, i64 72}
!18 = distinct !{!18, !16}
!19 = !{!12, !10, i64 208}
!20 = !{!12, !6, i64 36}
!21 = distinct !{!21, !16}
!22 = !{!12, !6, i64 40}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}
!25 = !{!13, !13, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"long long", !7, i64 0}
!28 = !{!12, !10, i64 288}
!29 = !{!30, !10, i64 0}
!30 = !{!"Candidate", !10, i64 0, !6, i64 8, !6, i64 12}
!31 = distinct !{!31, !16}
!32 = distinct !{!32, !16}
!33 = distinct !{!33, !16}


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