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

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

@TraceLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@KDTree = external hidden global ptr, align 8
@DimensionSaved = external dso_local global i32, align 4
@XMin = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.CreateQuadrantCandidateSet = external hidden unnamed_addr constant [37 x i8], align 1
@XMax = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [64 x i8], align 1
@YMin = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1
@YMax = external hidden global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [64 x i8], align 1
@CoordType = external dso_local global i32, align 4
@ZMin = external hidden global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [64 x i8], align 1
@ZMax = external hidden global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [64 x i8], align 1
@Dimension = external dso_local global i32, align 4
@Contains = external hidden global ptr, align 8
@BoxOverlaps = external hidden global ptr, align 8
@CandidateSet = external hidden global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [65 x i8], align 1
@FirstNode = external dso_local global ptr, align 8
@Candidates = external hidden global i32, align 4
@D = external dso_local global ptr, align 8
@Level = external hidden global i32, align 4
@WeightType = external dso_local global i32, align 4
@.str.9 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@CandidateSetSymmetric = external dso_local global i32, align 4

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

17:                                               ; preds = %1
  store i32 1, ptr %12, align 4
  br label %466

18:                                               ; preds = %1
  %19 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %20 = icmp sge i32 %19, 2
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  call void (ptr, ...) @printff(ptr noundef @.str)
  br label %22

22:                                               ; preds = %21, %18
  %23 = call ptr @BuildKDTree(i32 noundef 1)
  store ptr %23, ptr @KDTree, align 8, !tbaa !9
  %24 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %25 = add nsw i32 1, %24
  %26 = sext i32 %25 to i64
  %27 = mul i64 %26, 8
  %28 = call noalias ptr @malloc(i64 noundef %27) #7
  store ptr %28, ptr @XMin, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %22
  br label %32

31:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 50, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

32:                                               ; preds = %30
  %33 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %34 = add nsw i32 1, %33
  %35 = sext i32 %34 to i64
  %36 = mul i64 %35, 8
  %37 = call noalias ptr @malloc(i64 noundef %36) #7
  store ptr %37, ptr @XMax, align 8, !tbaa !9
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  br label %41

40:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 52, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

41:                                               ; preds = %39
  %42 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %43 = add nsw i32 1, %42
  %44 = sext i32 %43 to i64
  %45 = mul i64 %44, 8
  %46 = call noalias ptr @malloc(i64 noundef %45) #7
  store ptr %46, ptr @YMin, align 8, !tbaa !9
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %49

48:                                               ; preds = %41
  br label %50

49:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 54, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

50:                                               ; preds = %48
  %51 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %52 = add nsw i32 1, %51
  %53 = sext i32 %52 to i64
  %54 = mul i64 %53, 8
  %55 = call noalias ptr @malloc(i64 noundef %54) #7
  store ptr %55, ptr @YMax, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %58

57:                                               ; preds = %50
  br label %59

58:                                               ; preds = %50
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 56, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

59:                                               ; preds = %57
  %60 = load i32, ptr @CoordType, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %81

62:                                               ; preds = %59
  %63 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %64 = add nsw i32 1, %63
  %65 = sext i32 %64 to i64
  %66 = mul i64 %65, 8
  %67 = call noalias ptr @malloc(i64 noundef %66) #7
  store ptr %67, ptr @ZMin, align 8, !tbaa !9
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  br label %71

70:                                               ; preds = %62
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 59, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

71:                                               ; preds = %69
  %72 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %73 = add nsw i32 1, %72
  %74 = sext i32 %73 to i64
  %75 = mul i64 %74, 8
  %76 = call noalias ptr @malloc(i64 noundef %75) #7
  store ptr %76, ptr @ZMax, align 8, !tbaa !9
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %79

78:                                               ; preds = %71
  br label %80

79:                                               ; preds = %71
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 61, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80, %59
  %82 = load i32, ptr @Dimension, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  call void @ComputeBounds(i32 noundef 0, i32 noundef %83)
  %84 = load i32, ptr @CoordType, align 4, !tbaa !5
  %85 = icmp eq i32 %84, 1
  %86 = zext i1 %85 to i64
  %87 = select i1 %85, ptr @Contains3D, ptr @Contains2D
  store ptr %87, ptr @Contains, align 8, !tbaa !9
  %88 = load i32, ptr @CoordType, align 4, !tbaa !5
  %89 = icmp eq i32 %88, 1
  %90 = zext i1 %89 to i64
  %91 = select i1 %89, ptr @BoxOverlaps3D, ptr @BoxOverlaps2D
  store ptr %91, ptr @BoxOverlaps, align 8, !tbaa !9
  %92 = load i32, ptr @CoordType, align 4, !tbaa !5
  %93 = icmp eq i32 %92, 1
  %94 = zext i1 %93 to i64
  %95 = select i1 %93, i32 8, i32 4
  store i32 %95, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sdiv i32 %96, %97
  store i32 %98, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = mul i64 %101, 16
  %103 = call noalias ptr @malloc(i64 noundef %102) #7
  store ptr %103, ptr @CandidateSet, align 8, !tbaa !9
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %106

105:                                              ; preds = %81
  br label %107

106:                                              ; preds = %81
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 70, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

107:                                              ; preds = %105
  %108 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %108, ptr %3, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %230, %107
  store i32 0, ptr %10, align 4, !tbaa !5
  %110 = load ptr, ptr %3, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.Node, ptr %110, i32 0, i32 43
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  store ptr %112, ptr %5, align 8, !tbaa !9
  br label %113

113:                                              ; preds = %152, %109
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %121

116:                                              ; preds = %113
  %117 = load ptr, ptr %5, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.Candidate, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !14
  %120 = icmp ne ptr %119, null
  br label %121

121:                                              ; preds = %116, %113
  %122 = phi i1 [ false, %113 ], [ %120, %116 ]
  br i1 %122, label %123, label %155

123:                                              ; preds = %121
  %124 = load ptr, ptr %3, align 8, !tbaa !9
  %125 = getelementptr inbounds %struct.Node, ptr %124, i32 0, i32 26
  %126 = load ptr, ptr %125, align 8, !tbaa !16
  %127 = load ptr, ptr %5, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.Candidate, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !14
  %130 = icmp eq ptr %126, %129
  br i1 %130, label %146, label %131

131:                                              ; preds = %123
  %132 = load ptr, ptr %3, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.Node, ptr %132, i32 0, i32 27
  %134 = load ptr, ptr %133, align 8, !tbaa !17
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.Candidate, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !14
  %138 = icmp eq ptr %134, %137
  br i1 %138, label %146, label %139

139:                                              ; preds = %131
  %140 = load ptr, ptr %3, align 8, !tbaa !9
  %141 = load ptr, ptr %5, align 8, !tbaa !9
  %142 = getelementptr inbounds %struct.Candidate, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !14
  %144 = call i32 @IsCommonEdge(ptr noundef %140, ptr noundef %143)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %151

146:                                              ; preds = %139, %131, %123
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %10, align 4, !tbaa !5
  %149 = icmp eq i32 %148, 2
  br i1 %149, label %150, label %151

150:                                              ; preds = %146
  br label %155

151:                                              ; preds = %146, %139
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %5, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.Candidate, ptr %153, i32 1
  store ptr %154, ptr %5, align 8, !tbaa !9
  br label %113, !llvm.loop !18

155:                                              ; preds = %150, %121
  %156 = load i32, ptr %10, align 4, !tbaa !5
  %157 = icmp eq i32 %156, 2
  br i1 %157, label %158, label %159

158:                                              ; preds = %155
  br label %230

159:                                              ; preds = %155
  store i32 0, ptr %9, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %195, %159
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = load i32, ptr %6, align 4, !tbaa !5
  %163 = icmp sle i32 %161, %162
  br i1 %163, label %164, label %198

164:                                              ; preds = %160
  %165 = load ptr, ptr %3, align 8, !tbaa !9
  %166 = load i32, ptr %7, align 4, !tbaa !5
  %167 = load i32, ptr %8, align 4, !tbaa !5
  call void @NearestQuadrantNeighbors(ptr noundef %165, i32 noundef %166, i32 noundef %167)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %191, %164
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = load i32, ptr @Candidates, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %172, label %194

172:                                              ; preds = %168
  %173 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  %174 = load i32, ptr %11, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.Candidate, ptr %173, i64 %175
  %177 = getelementptr inbounds %struct.Candidate, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !14
  store ptr %178, ptr %4, align 8, !tbaa !9
  %179 = load ptr, ptr %3, align 8, !tbaa !9
  %180 = load ptr, ptr %4, align 8, !tbaa !9
  %181 = load ptr, ptr @D, align 8, !tbaa !9
  %182 = load ptr, ptr %3, align 8, !tbaa !9
  %183 = load ptr, ptr %4, align 8, !tbaa !9
  %184 = call i32 %181(ptr noundef %182, ptr noundef %183)
  %185 = call i32 @AddCandidate(ptr noundef %179, ptr noundef %180, i32 noundef %184, i32 noundef 1)
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %190

187:                                              ; preds = %172
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %9, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %187, %172
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %11, align 4, !tbaa !5
  br label %168, !llvm.loop !20

194:                                              ; preds = %168
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %7, align 4, !tbaa !5
  br label %160, !llvm.loop !21

198:                                              ; preds = %160
  %199 = load i32, ptr %2, align 4, !tbaa !5
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = icmp sgt i32 %199, %200
  br i1 %201, label %202, label %229

202:                                              ; preds = %198
  %203 = load ptr, ptr %3, align 8, !tbaa !9
  %204 = load i32, ptr %2, align 4, !tbaa !5
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sub nsw i32 %204, %205
  call void @NearestQuadrantNeighbors(ptr noundef %203, i32 noundef 0, i32 noundef %206)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %225, %202
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = load i32, ptr @Candidates, align 4, !tbaa !5
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %211, label %228

211:                                              ; preds = %207
  %212 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  %213 = load i32, ptr %11, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds %struct.Candidate, ptr %212, i64 %214
  %216 = getelementptr inbounds %struct.Candidate, ptr %215, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !14
  store ptr %217, ptr %4, align 8, !tbaa !9
  %218 = load ptr, ptr %3, align 8, !tbaa !9
  %219 = load ptr, ptr %4, align 8, !tbaa !9
  %220 = load ptr, ptr @D, align 8, !tbaa !9
  %221 = load ptr, ptr %3, align 8, !tbaa !9
  %222 = load ptr, ptr %4, align 8, !tbaa !9
  %223 = call i32 %220(ptr noundef %221, ptr noundef %222)
  %224 = call i32 @AddCandidate(ptr noundef %218, ptr noundef %219, i32 noundef %223, i32 noundef 2)
  br label %225

225:                                              ; preds = %211
  %226 = load i32, ptr %11, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %11, align 4, !tbaa !5
  br label %207, !llvm.loop !22

228:                                              ; preds = %207
  br label %229

229:                                              ; preds = %228, %198
  br label %230

230:                                              ; preds = %229, %158
  %231 = load ptr, ptr %3, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.Node, ptr %231, i32 0, i32 16
  %233 = load ptr, ptr %232, align 8, !tbaa !23
  store ptr %233, ptr %3, align 8, !tbaa !9
  %234 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %235 = icmp ne ptr %233, %234
  br i1 %235, label %109, label %236, !llvm.loop !24

236:                                              ; preds = %230
  %237 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  call void @free(ptr noundef %237) #6
  %238 = load ptr, ptr @KDTree, align 8, !tbaa !9
  call void @free(ptr noundef %238) #6
  %239 = load ptr, ptr @XMin, align 8, !tbaa !9
  call void @free(ptr noundef %239) #6
  %240 = load ptr, ptr @XMax, align 8, !tbaa !9
  call void @free(ptr noundef %240) #6
  %241 = load ptr, ptr @YMin, align 8, !tbaa !9
  call void @free(ptr noundef %241) #6
  %242 = load ptr, ptr @YMax, align 8, !tbaa !9
  call void @free(ptr noundef %242) #6
  %243 = load i32, ptr @CoordType, align 4, !tbaa !5
  %244 = icmp eq i32 %243, 1
  br i1 %244, label %245, label %248

245:                                              ; preds = %236
  %246 = load ptr, ptr @ZMin, align 8, !tbaa !9
  call void @free(ptr noundef %246) #6
  %247 = load ptr, ptr @ZMax, align 8, !tbaa !9
  call void @free(ptr noundef %247) #6
  br label %248

248:                                              ; preds = %245, %236
  %249 = load i32, ptr @Level, align 4, !tbaa !5
  %250 = icmp eq i32 %249, 0
  br i1 %250, label %251, label %453

251:                                              ; preds = %248
  %252 = load i32, ptr @WeightType, align 4, !tbaa !5
  %253 = icmp eq i32 %252, 9
  br i1 %253, label %263, label %254

254:                                              ; preds = %251
  %255 = load i32, ptr @WeightType, align 4, !tbaa !5
  %256 = icmp eq i32 %255, 10
  br i1 %256, label %263, label %257

257:                                              ; preds = %254
  %258 = load i32, ptr @WeightType, align 4, !tbaa !5
  %259 = icmp eq i32 %258, 11
  br i1 %259, label %263, label %260

260:                                              ; preds = %257
  %261 = load i32, ptr @WeightType, align 4, !tbaa !5
  %262 = icmp eq i32 %261, 12
  br i1 %262, label %263, label %453

263:                                              ; preds = %260, %257, %254, %251
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %264 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %265 = add nsw i32 1, %264
  %266 = sext i32 %265 to i64
  %267 = mul i64 %266, 8
  %268 = call noalias ptr @malloc(i64 noundef %267) #7
  store ptr %268, ptr %13, align 8, !tbaa !9
  %269 = icmp ne ptr %268, null
  br i1 %269, label %270, label %271

270:                                              ; preds = %263
  br label %272

271:                                              ; preds = %263
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.2, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #8
  unreachable

272:                                              ; preds = %270
  %273 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %274 = icmp sge i32 %273, 2
  br i1 %274, label %275, label %276

275:                                              ; preds = %272
  call void (ptr, ...) @printff(ptr noundef @.str.10)
  br label %276

276:                                              ; preds = %275, %272
  %277 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %277, ptr %3, align 8, !tbaa !9
  br label %278

278:                                              ; preds = %297, %276
  %279 = load ptr, ptr %3, align 8, !tbaa !9
  %280 = getelementptr inbounds %struct.Node, ptr %279, i32 0, i32 16
  %281 = load ptr, ptr %280, align 8, !tbaa !23
  store ptr %281, ptr %3, align 8, !tbaa !9
  %282 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %283 = icmp ne ptr %281, %282
  br i1 %283, label %284, label %298

284:                                              ; preds = %278
  %285 = load ptr, ptr %3, align 8, !tbaa !9
  %286 = getelementptr inbounds %struct.Node, ptr %285, i32 0, i32 47
  %287 = load double, ptr %286, align 8, !tbaa !25
  %288 = fcmp ogt double %287, 0.000000e+00
  %289 = zext i1 %288 to i32
  %290 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %291 = getelementptr inbounds %struct.Node, ptr %290, i32 0, i32 47
  %292 = load double, ptr %291, align 8, !tbaa !25
  %293 = fcmp ogt double %292, 0.000000e+00
  %294 = zext i1 %293 to i32
  %295 = icmp ne i32 %289, %294
  br i1 %295, label %296, label %297

296:                                              ; preds = %284
  br label %298

297:                                              ; preds = %284
  br label %278, !llvm.loop !26

298:                                              ; preds = %296, %278
  %299 = load ptr, ptr %3, align 8, !tbaa !9
  %300 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %301 = icmp ne ptr %299, %300
  br i1 %301, label %302, label %452

302:                                              ; preds = %298
  %303 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %303, ptr %3, align 8, !tbaa !9
  br label %304

304:                                              ; preds = %384, %302
  %305 = load ptr, ptr %3, align 8, !tbaa !9
  %306 = getelementptr inbounds %struct.Node, ptr %305, i32 0, i32 43
  %307 = load ptr, ptr %306, align 8, !tbaa !11
  %308 = load ptr, ptr %13, align 8, !tbaa !9
  %309 = load ptr, ptr %3, align 8, !tbaa !9
  %310 = getelementptr inbounds %struct.Node, ptr %309, i32 0, i32 0
  %311 = load i32, ptr %310, align 8, !tbaa !27
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds ptr, ptr %308, i64 %312
  store ptr %307, ptr %313, align 8, !tbaa !9
  %314 = load ptr, ptr %3, align 8, !tbaa !9
  %315 = getelementptr inbounds %struct.Node, ptr %314, i32 0, i32 43
  store ptr null, ptr %315, align 8, !tbaa !11
  %316 = load ptr, ptr %3, align 8, !tbaa !9
  %317 = getelementptr inbounds %struct.Node, ptr %316, i32 0, i32 47
  %318 = load double, ptr %317, align 8, !tbaa !25
  %319 = load ptr, ptr %3, align 8, !tbaa !9
  %320 = getelementptr inbounds %struct.Node, ptr %319, i32 0, i32 51
  store double %318, ptr %320, align 8, !tbaa !28
  %321 = load i32, ptr @WeightType, align 4, !tbaa !5
  %322 = icmp eq i32 %321, 9
  br i1 %322, label %326, label %323

323:                                              ; preds = %304
  %324 = load i32, ptr @WeightType, align 4, !tbaa !5
  %325 = icmp eq i32 %324, 11
  br i1 %325, label %326, label %346

326:                                              ; preds = %323, %304
  %327 = load ptr, ptr %3, align 8, !tbaa !9
  %328 = getelementptr inbounds %struct.Node, ptr %327, i32 0, i32 47
  %329 = load double, ptr %328, align 8, !tbaa !25
  %330 = fptosi double %329 to i32
  %331 = sitofp i32 %330 to double
  %332 = load ptr, ptr %3, align 8, !tbaa !9
  %333 = getelementptr inbounds %struct.Node, ptr %332, i32 0, i32 47
  %334 = load double, ptr %333, align 8, !tbaa !25
  %335 = load ptr, ptr %3, align 8, !tbaa !9
  %336 = getelementptr inbounds %struct.Node, ptr %335, i32 0, i32 47
  %337 = load double, ptr %336, align 8, !tbaa !25
  %338 = fptosi double %337 to i32
  %339 = sitofp i32 %338 to double
  %340 = fsub double %334, %339
  %341 = fmul double 5.000000e+00, %340
  %342 = fdiv double %341, 3.000000e+00
  %343 = fadd double %331, %342
  %344 = load ptr, ptr %3, align 8, !tbaa !9
  %345 = getelementptr inbounds %struct.Node, ptr %344, i32 0, i32 47
  store double %343, ptr %345, align 8, !tbaa !25
  br label %346

346:                                              ; preds = %326, %323
  %347 = load ptr, ptr %3, align 8, !tbaa !9
  %348 = getelementptr inbounds %struct.Node, ptr %347, i32 0, i32 47
  %349 = load double, ptr %348, align 8, !tbaa !25
  %350 = fcmp ogt double %349, 0.000000e+00
  %351 = zext i1 %350 to i64
  %352 = select i1 %350, i32 -180, i32 180
  %353 = sitofp i32 %352 to double
  %354 = load ptr, ptr %3, align 8, !tbaa !9
  %355 = getelementptr inbounds %struct.Node, ptr %354, i32 0, i32 47
  %356 = load double, ptr %355, align 8, !tbaa !25
  %357 = fadd double %356, %353
  store double %357, ptr %355, align 8, !tbaa !25
  %358 = load i32, ptr @WeightType, align 4, !tbaa !5
  %359 = icmp eq i32 %358, 9
  br i1 %359, label %363, label %360

360:                                              ; preds = %346
  %361 = load i32, ptr @WeightType, align 4, !tbaa !5
  %362 = icmp eq i32 %361, 11
  br i1 %362, label %363, label %383

363:                                              ; preds = %360, %346
  %364 = load ptr, ptr %3, align 8, !tbaa !9
  %365 = getelementptr inbounds %struct.Node, ptr %364, i32 0, i32 47
  %366 = load double, ptr %365, align 8, !tbaa !25
  %367 = fptosi double %366 to i32
  %368 = sitofp i32 %367 to double
  %369 = load ptr, ptr %3, align 8, !tbaa !9
  %370 = getelementptr inbounds %struct.Node, ptr %369, i32 0, i32 47
  %371 = load double, ptr %370, align 8, !tbaa !25
  %372 = load ptr, ptr %3, align 8, !tbaa !9
  %373 = getelementptr inbounds %struct.Node, ptr %372, i32 0, i32 47
  %374 = load double, ptr %373, align 8, !tbaa !25
  %375 = fptosi double %374 to i32
  %376 = sitofp i32 %375 to double
  %377 = fsub double %371, %376
  %378 = fmul double 3.000000e+00, %377
  %379 = fdiv double %378, 5.000000e+00
  %380 = fadd double %368, %379
  %381 = load ptr, ptr %3, align 8, !tbaa !9
  %382 = getelementptr inbounds %struct.Node, ptr %381, i32 0, i32 47
  store double %380, ptr %382, align 8, !tbaa !25
  br label %383

383:                                              ; preds = %363, %360
  br label %384

384:                                              ; preds = %383
  %385 = load ptr, ptr %3, align 8, !tbaa !9
  %386 = getelementptr inbounds %struct.Node, ptr %385, i32 0, i32 16
  %387 = load ptr, ptr %386, align 8, !tbaa !23
  store ptr %387, ptr %3, align 8, !tbaa !9
  %388 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %389 = icmp ne ptr %387, %388
  br i1 %389, label %304, label %390, !llvm.loop !29

390:                                              ; preds = %384
  %391 = load i32, ptr @Level, align 4, !tbaa !5
  %392 = add nsw i32 %391, 1
  store i32 %392, ptr @Level, align 4, !tbaa !5
  %393 = load i32, ptr %2, align 4, !tbaa !5
  call void @CreateQuadrantCandidateSet(i32 noundef %393)
  %394 = load i32, ptr @Level, align 4, !tbaa !5
  %395 = add nsw i32 %394, -1
  store i32 %395, ptr @Level, align 4, !tbaa !5
  %396 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %396, ptr %3, align 8, !tbaa !9
  br label %397

397:                                              ; preds = %403, %390
  %398 = load ptr, ptr %3, align 8, !tbaa !9
  %399 = getelementptr inbounds %struct.Node, ptr %398, i32 0, i32 51
  %400 = load double, ptr %399, align 8, !tbaa !28
  %401 = load ptr, ptr %3, align 8, !tbaa !9
  %402 = getelementptr inbounds %struct.Node, ptr %401, i32 0, i32 47
  store double %400, ptr %402, align 8, !tbaa !25
  br label %403

403:                                              ; preds = %397
  %404 = load ptr, ptr %3, align 8, !tbaa !9
  %405 = getelementptr inbounds %struct.Node, ptr %404, i32 0, i32 16
  %406 = load ptr, ptr %405, align 8, !tbaa !23
  store ptr %406, ptr %3, align 8, !tbaa !9
  %407 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %408 = icmp ne ptr %406, %407
  br i1 %408, label %397, label %409, !llvm.loop !30

409:                                              ; preds = %403
  br label %410

410:                                              ; preds = %444, %409
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %411 = load ptr, ptr %3, align 8, !tbaa !9
  %412 = getelementptr inbounds %struct.Node, ptr %411, i32 0, i32 43
  %413 = load ptr, ptr %412, align 8, !tbaa !11
  store ptr %413, ptr %14, align 8, !tbaa !9
  %414 = load ptr, ptr %13, align 8, !tbaa !9
  %415 = load ptr, ptr %3, align 8, !tbaa !9
  %416 = getelementptr inbounds %struct.Node, ptr %415, i32 0, i32 0
  %417 = load i32, ptr %416, align 8, !tbaa !27
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds ptr, ptr %414, i64 %418
  %420 = load ptr, ptr %419, align 8, !tbaa !9
  %421 = load ptr, ptr %3, align 8, !tbaa !9
  %422 = getelementptr inbounds %struct.Node, ptr %421, i32 0, i32 43
  store ptr %420, ptr %422, align 8, !tbaa !11
  %423 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %423, ptr %5, align 8, !tbaa !9
  br label %424

424:                                              ; preds = %439, %410
  %425 = load ptr, ptr %5, align 8, !tbaa !9
  %426 = getelementptr inbounds %struct.Candidate, ptr %425, i32 0, i32 0
  %427 = load ptr, ptr %426, align 8, !tbaa !14
  store ptr %427, ptr %4, align 8, !tbaa !9
  %428 = icmp ne ptr %427, null
  br i1 %428, label %429, label %442

429:                                              ; preds = %424
  %430 = load ptr, ptr %3, align 8, !tbaa !9
  %431 = load ptr, ptr %4, align 8, !tbaa !9
  %432 = load ptr, ptr %5, align 8, !tbaa !9
  %433 = getelementptr inbounds %struct.Candidate, ptr %432, i32 0, i32 1
  %434 = load i32, ptr %433, align 8, !tbaa !31
  %435 = load ptr, ptr %5, align 8, !tbaa !9
  %436 = getelementptr inbounds %struct.Candidate, ptr %435, i32 0, i32 2
  %437 = load i32, ptr %436, align 4, !tbaa !32
  %438 = call i32 @AddCandidate(ptr noundef %430, ptr noundef %431, i32 noundef %434, i32 noundef %437)
  br label %439

439:                                              ; preds = %429
  %440 = load ptr, ptr %5, align 8, !tbaa !9
  %441 = getelementptr inbounds %struct.Candidate, ptr %440, i32 1
  store ptr %441, ptr %5, align 8, !tbaa !9
  br label %424, !llvm.loop !33

442:                                              ; preds = %424
  %443 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %443) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %444

444:                                              ; preds = %442
  %445 = load ptr, ptr %3, align 8, !tbaa !9
  %446 = getelementptr inbounds %struct.Node, ptr %445, i32 0, i32 16
  %447 = load ptr, ptr %446, align 8, !tbaa !23
  store ptr %447, ptr %3, align 8, !tbaa !9
  %448 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %449 = icmp ne ptr %447, %448
  br i1 %449, label %410, label %450, !llvm.loop !34

450:                                              ; preds = %444
  %451 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %451) #6
  br label %452

452:                                              ; preds = %450, %298
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %453

453:                                              ; preds = %452, %260, %248
  %454 = load i32, ptr @Level, align 4, !tbaa !5
  %455 = icmp eq i32 %454, 0
  br i1 %455, label %456, label %465

456:                                              ; preds = %453
  call void @ResetCandidateSet()
  call void @AddTourCandidates()
  %457 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %458 = icmp ne i32 %457, 0
  br i1 %458, label %459, label %460

459:                                              ; preds = %456
  call void @SymmetrizeCandidateSet()
  br label %460

460:                                              ; preds = %459, %456
  %461 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %462 = icmp sge i32 %461, 2
  br i1 %462, label %463, label %464

463:                                              ; preds = %460
  call void (ptr, ...) @printff(ptr noundef @.str.10)
  br label %464

464:                                              ; preds = %463, %460
  br label %465

465:                                              ; preds = %464, %453
  store i32 0, ptr %12, align 4
  br label %466

466:                                              ; preds = %465, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %467 = load i32, ptr %12, align 4
  switch i32 %467, label %469 [
    i32 0, label %468
    i32 1, label %468
  ]

468:                                              ; preds = %466, %466
  ret void

469:                                              ; preds = %466
  unreachable
}

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

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

declare ptr @BuildKDTree(i32 noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @ComputeBounds(i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @Contains3D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @Contains2D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @BoxOverlaps3D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @BoxOverlaps2D(ptr noundef, i32 noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @NearestQuadrantNeighbors(ptr noundef, i32 noundef, i32 noundef) #0

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

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

declare void @ResetCandidateSet() #2

declare void @AddTourCandidates() #2

declare void @SymmetrizeCandidateSet() #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 288}
!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 = !{!15, !10, i64 0}
!15 = !{!"Candidate", !10, i64 0, !6, i64 8, !6, i64 12}
!16 = !{!12, !10, i64 152}
!17 = !{!12, !10, i64 160}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = !{!12, !10, i64 72}
!24 = distinct !{!24, !19}
!25 = !{!12, !13, i64 320}
!26 = distinct !{!26, !19}
!27 = !{!12, !6, i64 0}
!28 = !{!12, !13, i64 352}
!29 = distinct !{!29, !19}
!30 = distinct !{!30, !19}
!31 = !{!15, !6, i64 8}
!32 = !{!15, !6, i64 12}
!33 = distinct !{!33, !19}
!34 = distinct !{!34, !19}


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

@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@KDTree = external hidden local_unnamed_addr global ptr, align 8
@DimensionSaved = external dso_local local_unnamed_addr global i32, align 4
@XMin = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.CreateQuadrantCandidateSet = external hidden unnamed_addr constant [37 x i8], align 1
@XMax = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [64 x i8], align 1
@YMin = external hidden local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1
@YMax = external hidden local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [64 x i8], align 1
@CoordType = external dso_local local_unnamed_addr global i32, align 4
@ZMin = external hidden local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [64 x i8], align 1
@ZMax = external hidden local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [64 x i8], align 1
@Dimension = external dso_local local_unnamed_addr global i32, align 4
@Contains = external hidden local_unnamed_addr global ptr, align 8
@BoxOverlaps = external hidden local_unnamed_addr global ptr, align 8
@CandidateSet = external hidden local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [65 x i8], align 1
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@Candidates = external hidden local_unnamed_addr global i32, align 4
@D = external dso_local local_unnamed_addr global ptr, align 8
@Level = external hidden local_unnamed_addr global i32, align 4
@WeightType = external dso_local local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@CandidateSetSymmetric = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @CreateQuadrantCandidateSet(i32 noundef %0) local_unnamed_addr #0 {
  %2 = icmp slt i32 %0, 1
  br i1 %2, label %.thread136, label %3

3:                                                ; preds = %1
  %4 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 1
  br i1 %5, label %6, label %7

6:                                                ; preds = %3
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #5
  br label %7

7:                                                ; preds = %6, %3
  %8 = tail call ptr @BuildKDTree(i32 noundef 1) #5
  store ptr %8, ptr @KDTree, align 8, !tbaa !9
  %9 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %10 = add nsw i32 %9, 1
  %11 = sext i32 %10 to i64
  %12 = shl nsw i64 %11, 3
  %13 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %13, ptr @XMin, align 8, !tbaa !9
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %14, label %15

14:                                               ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 50, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

15:                                               ; preds = %7
  %16 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %16, ptr @XMax, align 8, !tbaa !9
  %.not113 = icmp eq ptr %16, null
  br i1 %.not113, label %17, label %18

17:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 52, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

18:                                               ; preds = %15
  %19 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %19, ptr @YMin, align 8, !tbaa !9
  %.not114 = icmp eq ptr %19, null
  br i1 %.not114, label %20, label %21

20:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 54, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

21:                                               ; preds = %18
  %22 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %22, ptr @YMax, align 8, !tbaa !9
  %.not115 = icmp eq ptr %22, null
  br i1 %.not115, label %23, label %24

23:                                               ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 56, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

24:                                               ; preds = %21
  %25 = load i32, ptr @CoordType, align 4, !tbaa !5
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  %28 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %28, ptr @ZMin, align 8, !tbaa !9
  %.not116 = icmp eq ptr %28, null
  br i1 %.not116, label %29, label %30

29:                                               ; preds = %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 59, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

30:                                               ; preds = %27
  %31 = tail call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %31, ptr @ZMax, align 8, !tbaa !9
  %.not117 = icmp eq ptr %31, null
  br i1 %.not117, label %32, label %33

32:                                               ; preds = %30
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 61, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

33:                                               ; preds = %30, %24
  %34 = load i32, ptr @Dimension, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  tail call void @ComputeBounds(i32 noundef 0, i32 noundef %35)
  %36 = load i32, ptr @CoordType, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 1
  %38 = select i1 %37, ptr @Contains3D, ptr @Contains2D
  store ptr %38, ptr @Contains, align 8, !tbaa !9
  %39 = select i1 %37, ptr @BoxOverlaps3D, ptr @BoxOverlaps2D
  store ptr %39, ptr @BoxOverlaps, align 8, !tbaa !9
  %40 = select i1 %37, i32 3, i32 2
  %41 = lshr i32 %0, %40
  %42 = add nuw nsw i32 %0, 1
  %43 = zext nneg i32 %42 to i64
  %44 = shl nuw nsw i64 %43, 4
  %45 = tail call noalias ptr @malloc(i64 noundef %44) #6
  store ptr %45, ptr @CandidateSet, align 8, !tbaa !9
  %.not118 = icmp eq ptr %45, null
  br i1 %.not118, label %46, label %47

46:                                               ; preds = %33
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 70, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

47:                                               ; preds = %33
  %48 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %49 = select i1 %37, i32 9, i32 5
  br label %50

50:                                               ; preds = %.critedge.thread, %47
  %.0 = phi ptr [ %48, %47 ], [ %98, %.critedge.thread ]
  %51 = getelementptr inbounds i8, ptr %.0, i64 288
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %.not119141 = icmp eq ptr %52, null
  br i1 %.not119141, label %.preheader138.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %50
  %53 = getelementptr inbounds i8, ptr %.0, i64 152
  %54 = getelementptr inbounds i8, ptr %.0, i64 160
  %55 = load ptr, ptr %52, align 8, !tbaa !14
  %.not120171 = icmp eq ptr %55, null
  br i1 %.not120171, label %.preheader138.preheader, label %.lr.ph174

.lr.ph174:                                        ; preds = %.lr.ph, %66
  %56 = phi ptr [ %68, %66 ], [ %55, %.lr.ph ]
  %.097142173 = phi ptr [ %67, %66 ], [ %52, %.lr.ph ]
  %.091143172 = phi i32 [ %.192, %66 ], [ 0, %.lr.ph ]
  %57 = load ptr, ptr %53, align 8, !tbaa !16
  %58 = icmp eq ptr %57, %56
  br i1 %58, label %64, label %59

59:                                               ; preds = %.lr.ph174
  %60 = load ptr, ptr %54, align 8, !tbaa !17
  %61 = icmp eq ptr %60, %56
  br i1 %61, label %64, label %62

62:                                               ; preds = %59
  %63 = tail call i32 @IsCommonEdge(ptr noundef nonnull %.0, ptr noundef nonnull %56) #5
  %.not121 = icmp eq i32 %63, 0
  br i1 %.not121, label %66, label %64

64:                                               ; preds = %62, %59, %.lr.ph174
  %65 = icmp eq i32 %.091143172, 1
  br i1 %65, label %.critedge.thread, label %66

66:                                               ; preds = %62, %64
  %.192 = phi i32 [ 1, %64 ], [ %.091143172, %62 ]
  %67 = getelementptr inbounds i8, ptr %.097142173, i64 16
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %.not120 = icmp eq ptr %68, null
  br i1 %.not120, label %.preheader138.preheader, label %.lr.ph174, !llvm.loop !18

.preheader138.preheader:                          ; preds = %66, %.lr.ph, %50
  br label %.preheader138

.preheader138:                                    ; preds = %.preheader138.preheader, %._crit_edge
  %.094151 = phi i32 [ %.195.lcssa, %._crit_edge ], [ 0, %.preheader138.preheader ]
  %.099150 = phi i32 [ %81, %._crit_edge ], [ 1, %.preheader138.preheader ]
  tail call void @NearestQuadrantNeighbors(ptr noundef %.0, i32 noundef %.099150, i32 noundef %41)
  %69 = load i32, ptr @Candidates, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph148, label %._crit_edge

.lr.ph148:                                        ; preds = %.preheader138, %.lr.ph148
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph148 ], [ 0, %.preheader138 ]
  %.195146 = phi i32 [ %spec.select, %.lr.ph148 ], [ %.094151, %.preheader138 ]
  %71 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.Candidate, ptr %71, i64 %indvars.iv
  %73 = load ptr, ptr %72, align 8, !tbaa !14
  %74 = load ptr, ptr @D, align 8, !tbaa !9
  %75 = tail call i32 %74(ptr noundef %.0, ptr noundef %73) #5
  %76 = tail call i32 @AddCandidate(ptr noundef %.0, ptr noundef %73, i32 noundef %75, i32 noundef 1) #5
  %.not123 = icmp ne i32 %76, 0
  %77 = zext i1 %.not123 to i32
  %spec.select = add nsw i32 %.195146, %77
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %78 = load i32, ptr @Candidates, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next, %79
  br i1 %80, label %.lr.ph148, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph148, %.preheader138
  %.195.lcssa = phi i32 [ %.094151, %.preheader138 ], [ %spec.select, %.lr.ph148 ]
  %81 = add nuw nsw i32 %.099150, 1
  %exitcond.not = icmp eq i32 %81, %49
  br i1 %exitcond.not, label %82, label %.preheader138, !llvm.loop !21

82:                                               ; preds = %._crit_edge
  %83 = icmp slt i32 %.195.lcssa, %0
  br i1 %83, label %84, label %.critedge.thread

84:                                               ; preds = %82
  %85 = sub nsw i32 %0, %.195.lcssa
  tail call void @NearestQuadrantNeighbors(ptr noundef %.0, i32 noundef 0, i32 noundef %85)
  %86 = load i32, ptr @Candidates, align 4, !tbaa !5
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph154, label %.critedge.thread

.lr.ph154:                                        ; preds = %84, %.lr.ph154
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %.lr.ph154 ], [ 0, %84 ]
  %88 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.Candidate, ptr %88, i64 %indvars.iv164
  %90 = load ptr, ptr %89, align 8, !tbaa !14
  %91 = load ptr, ptr @D, align 8, !tbaa !9
  %92 = tail call i32 %91(ptr noundef %.0, ptr noundef %90) #5
  %93 = tail call i32 @AddCandidate(ptr noundef %.0, ptr noundef %90, i32 noundef %92, i32 noundef 2) #5
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %94 = load i32, ptr @Candidates, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next165, %95
  br i1 %96, label %.lr.ph154, label %.critedge.thread, !llvm.loop !22

.critedge.thread:                                 ; preds = %64, %.lr.ph154, %84, %82
  %97 = getelementptr inbounds i8, ptr %.0, i64 72
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  %99 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %.not124 = icmp eq ptr %98, %99
  br i1 %.not124, label %100, label %50, !llvm.loop !24

100:                                              ; preds = %.critedge.thread
  %101 = load ptr, ptr @CandidateSet, align 8, !tbaa !9
  tail call void @free(ptr noundef %101) #5
  %102 = load ptr, ptr @KDTree, align 8, !tbaa !9
  tail call void @free(ptr noundef %102) #5
  %103 = load ptr, ptr @XMin, align 8, !tbaa !9
  tail call void @free(ptr noundef %103) #5
  %104 = load ptr, ptr @XMax, align 8, !tbaa !9
  tail call void @free(ptr noundef %104) #5
  %105 = load ptr, ptr @YMin, align 8, !tbaa !9
  tail call void @free(ptr noundef %105) #5
  %106 = load ptr, ptr @YMax, align 8, !tbaa !9
  tail call void @free(ptr noundef %106) #5
  %107 = load i32, ptr @CoordType, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %112

109:                                              ; preds = %100
  %110 = load ptr, ptr @ZMin, align 8, !tbaa !9
  tail call void @free(ptr noundef %110) #5
  %111 = load ptr, ptr @ZMax, align 8, !tbaa !9
  tail call void @free(ptr noundef %111) #5
  br label %112

112:                                              ; preds = %109, %100
  %113 = load i32, ptr @Level, align 4, !tbaa !5
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %.thread136

115:                                              ; preds = %112
  %116 = load i32, ptr @WeightType, align 4
  %117 = add i32 %116, -9
  %or.cond5 = icmp ult i32 %117, 4
  br i1 %or.cond5, label %118, label %.thread

118:                                              ; preds = %115
  %119 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = shl nsw i64 %121, 3
  %123 = tail call noalias ptr @malloc(i64 noundef %122) #6
  %.not125 = icmp eq ptr %123, null
  br i1 %.not125, label %124, label %125

124:                                              ; preds = %118
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.2, i32 noundef 114, ptr noundef nonnull @__PRETTY_FUNCTION__.CreateQuadrantCandidateSet) #7
  unreachable

125:                                              ; preds = %118
  %126 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %127 = icmp sgt i32 %126, 1
  br i1 %127, label %128, label %129

128:                                              ; preds = %125
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.10) #5
  br label %129

129:                                              ; preds = %128, %125
  %130 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %131 = getelementptr inbounds i8, ptr %130, i64 320
  br label %132

132:                                              ; preds = %135, %129
  %.1 = phi ptr [ %130, %129 ], [ %134, %135 ]
  %133 = getelementptr inbounds i8, ptr %.1, i64 72
  %134 = load ptr, ptr %133, align 8, !tbaa !23
  %.not126 = icmp eq ptr %134, %130
  br i1 %.not126, label %.thread, label %135

135:                                              ; preds = %132
  %136 = getelementptr inbounds i8, ptr %134, i64 320
  %137 = load double, ptr %136, align 8, !tbaa !25
  %138 = fcmp ogt double %137, 0.000000e+00
  %139 = load double, ptr %131, align 8, !tbaa !25
  %140 = fcmp ule double %139, 0.000000e+00
  %.not127 = xor i1 %138, %140
  br i1 %.not127, label %132, label %.preheader137, !llvm.loop !26

.preheader137:                                    ; preds = %135
  %141 = load i32, ptr @WeightType, align 4
  %142 = and i32 %141, -3
  %or.cond7 = icmp eq i32 %142, 9
  br i1 %or.cond7, label %.preheader137.split.us, label %.preheader137.split

.preheader137.split.us:                           ; preds = %.preheader137, %.preheader137.split.us
  %.2.us = phi ptr [ %167, %.preheader137.split.us ], [ %130, %.preheader137 ]
  %143 = getelementptr inbounds i8, ptr %.2.us, i64 288
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  %145 = load i32, ptr %.2.us, align 8, !tbaa !27
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %123, i64 %146
  store ptr %144, ptr %147, align 8, !tbaa !9
  store ptr null, ptr %143, align 8, !tbaa !11
  %148 = getelementptr inbounds i8, ptr %.2.us, i64 320
  %149 = load double, ptr %148, align 8, !tbaa !25
  %150 = getelementptr inbounds i8, ptr %.2.us, i64 352
  store double %149, ptr %150, align 8, !tbaa !28
  %151 = fptosi double %149 to i32
  %152 = sitofp i32 %151 to double
  %153 = fsub double %149, %152
  %154 = fmul double %153, 5.000000e+00
  %155 = fdiv double %154, 3.000000e+00
  %156 = fadd double %155, %152
  %157 = fcmp ogt double %156, 0.000000e+00
  %158 = select i1 %157, double -1.800000e+02, double 1.800000e+02
  %159 = fadd double %156, %158
  %160 = fptosi double %159 to i32
  %161 = sitofp i32 %160 to double
  %162 = fsub double %159, %161
  %163 = fmul double %162, 3.000000e+00
  %164 = fdiv double %163, 5.000000e+00
  %165 = fadd double %164, %161
  store double %165, ptr %148, align 8, !tbaa !25
  %166 = getelementptr inbounds i8, ptr %.2.us, i64 72
  %167 = load ptr, ptr %166, align 8, !tbaa !23
  %.not129.us = icmp eq ptr %167, %130
  br i1 %.not129.us, label %.split.us, label %.preheader137.split.us, !llvm.loop !29

.preheader137.split:                              ; preds = %.preheader137, %.preheader137.split
  %.2 = phi ptr [ %180, %.preheader137.split ], [ %130, %.preheader137 ]
  %168 = getelementptr inbounds i8, ptr %.2, i64 288
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = load i32, ptr %.2, align 8, !tbaa !27
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds ptr, ptr %123, i64 %171
  store ptr %169, ptr %172, align 8, !tbaa !9
  store ptr null, ptr %168, align 8, !tbaa !11
  %173 = getelementptr inbounds i8, ptr %.2, i64 320
  %174 = load double, ptr %173, align 8, !tbaa !25
  %175 = getelementptr inbounds i8, ptr %.2, i64 352
  store double %174, ptr %175, align 8, !tbaa !28
  %176 = fcmp ogt double %174, 0.000000e+00
  %177 = select i1 %176, double -1.800000e+02, double 1.800000e+02
  %178 = fadd double %174, %177
  store double %178, ptr %173, align 8, !tbaa !25
  %179 = getelementptr inbounds i8, ptr %.2, i64 72
  %180 = load ptr, ptr %179, align 8, !tbaa !23
  %.not129 = icmp eq ptr %180, %130
  br i1 %.not129, label %.split.us, label %.preheader137.split, !llvm.loop !29

.split.us:                                        ; preds = %.preheader137.split, %.preheader137.split.us
  %181 = load i32, ptr @Level, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr @Level, align 4, !tbaa !5
  tail call void @CreateQuadrantCandidateSet(i32 noundef %0)
  %183 = load i32, ptr @Level, align 4, !tbaa !5
  %184 = add nsw i32 %183, -1
  store i32 %184, ptr @Level, align 4, !tbaa !5
  %185 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %186

186:                                              ; preds = %186, %.split.us
  %.3 = phi ptr [ %185, %.split.us ], [ %191, %186 ]
  %187 = getelementptr inbounds i8, ptr %.3, i64 352
  %188 = load double, ptr %187, align 8, !tbaa !28
  %189 = getelementptr inbounds i8, ptr %.3, i64 320
  store double %188, ptr %189, align 8, !tbaa !25
  %190 = getelementptr inbounds i8, ptr %.3, i64 72
  %191 = load ptr, ptr %190, align 8, !tbaa !23
  %.not130 = icmp eq ptr %191, %185
  br i1 %.not130, label %.preheader, label %186, !llvm.loop !30

.preheader:                                       ; preds = %186, %._crit_edge159
  %.4 = phi ptr [ %208, %._crit_edge159 ], [ %191, %186 ]
  %192 = getelementptr inbounds i8, ptr %.4, i64 288
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = load i32, ptr %.4, align 8, !tbaa !27
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds ptr, ptr %123, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !9
  store ptr %197, ptr %192, align 8, !tbaa !11
  %198 = load ptr, ptr %193, align 8, !tbaa !14
  %.not131155 = icmp eq ptr %198, null
  br i1 %.not131155, label %._crit_edge159, label %.lr.ph158

.lr.ph158:                                        ; preds = %.preheader, %.lr.ph158
  %199 = phi ptr [ %206, %.lr.ph158 ], [ %198, %.preheader ]
  %.198156 = phi ptr [ %205, %.lr.ph158 ], [ %193, %.preheader ]
  %200 = getelementptr inbounds i8, ptr %.198156, i64 8
  %201 = load i32, ptr %200, align 8, !tbaa !31
  %202 = getelementptr inbounds i8, ptr %.198156, i64 12
  %203 = load i32, ptr %202, align 4, !tbaa !32
  %204 = tail call i32 @AddCandidate(ptr noundef nonnull %.4, ptr noundef nonnull %199, i32 noundef %201, i32 noundef %203) #5
  %205 = getelementptr inbounds i8, ptr %.198156, i64 16
  %206 = load ptr, ptr %205, align 8, !tbaa !14
  %.not131 = icmp eq ptr %206, null
  br i1 %.not131, label %._crit_edge159, label %.lr.ph158, !llvm.loop !33

._crit_edge159:                                   ; preds = %.lr.ph158, %.preheader
  tail call void @free(ptr noundef %193) #5
  %207 = getelementptr inbounds i8, ptr %.4, i64 72
  %208 = load ptr, ptr %207, align 8, !tbaa !23
  %209 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %.not132 = icmp eq ptr %208, %209
  br i1 %.not132, label %210, label %.preheader, !llvm.loop !34

210:                                              ; preds = %._crit_edge159
  tail call void @free(ptr noundef %123) #5
  br label %.thread

.thread:                                          ; preds = %132, %210, %115
  %.pr = load i32, ptr @Level, align 4, !tbaa !5
  %211 = icmp eq i32 %.pr, 0
  br i1 %211, label %212, label %.thread136

212:                                              ; preds = %.thread
  tail call void @ResetCandidateSet() #5
  tail call void @AddTourCandidates() #5
  %213 = load i32, ptr @CandidateSetSymmetric, align 4, !tbaa !5
  %.not133 = icmp eq i32 %213, 0
  br i1 %.not133, label %215, label %214

214:                                              ; preds = %212
  tail call void @SymmetrizeCandidateSet() #5
  br label %215

215:                                              ; preds = %214, %212
  %216 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %217 = icmp sgt i32 %216, 1
  br i1 %217, label %218, label %.thread136

218:                                              ; preds = %215
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.10) #5
  br label %.thread136

.thread136:                                       ; preds = %112, %.thread, %218, %215, %1
  ret void
}

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

declare ptr @BuildKDTree(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden void @ComputeBounds(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @Contains3D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @Contains2D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @BoxOverlaps3D(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @BoxOverlaps2D(ptr noundef, i32 noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @NearestQuadrantNeighbors(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

declare void @ResetCandidateSet() local_unnamed_addr #1

declare void @AddTourCandidates() local_unnamed_addr #1

declare void @SymmetrizeCandidateSet() 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 288}
!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 = !{!15, !10, i64 0}
!15 = !{!"Candidate", !10, i64 0, !6, i64 8, !6, i64 12}
!16 = !{!12, !10, i64 152}
!17 = !{!12, !10, i64 160}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = !{!12, !10, i64 72}
!24 = distinct !{!24, !19}
!25 = !{!12, !13, i64 320}
!26 = distinct !{!26, !19}
!27 = !{!12, !6, i64 0}
!28 = !{!12, !13, i64 352}
!29 = distinct !{!29, !19}
!30 = distinct !{!30, !19}
!31 = !{!15, !6, i64 8}
!32 = !{!15, !6, i64 12}
!33 = distinct !{!33, !19}
!34 = distinct !{!34, !19}


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