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

; 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 [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@FirstNode = external dso_local global ptr, align 8
@Dimension = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 x i8], align 1
@__PRETTY_FUNCTION__.SFCTour = external hidden unnamed_addr constant [22 x i8], align 1
@Distance = external dso_local global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

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

21:                                               ; preds = %20, %17
  store ptr @SierpinskiIndex, ptr %10, align 8, !tbaa !11
  br label %27

22:                                               ; preds = %1
  %23 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %24 = icmp sge i32 %23, 1
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  call void (ptr, ...) @printff(ptr noundef @.str.1)
  br label %26

26:                                               ; preds = %25, %22
  store ptr @MooreIndex, ptr %10, align 8, !tbaa !11
  br label %27

27:                                               ; preds = %26, %21
  %28 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %28, ptr %7, align 8, !tbaa !11
  %29 = load ptr, ptr %7, align 8, !tbaa !11
  %30 = getelementptr inbounds %struct.Node, ptr %29, i32 0, i32 46
  %31 = load double, ptr %30, align 8, !tbaa !13
  store double %31, ptr %4, align 8, !tbaa !9
  store double %31, ptr %3, align 8, !tbaa !9
  %32 = load ptr, ptr %7, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 47
  %34 = load double, ptr %33, align 8, !tbaa !15
  store double %34, ptr %6, align 8, !tbaa !9
  store double %34, ptr %5, align 8, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !11
  %36 = getelementptr inbounds %struct.Node, ptr %35, i32 0, i32 3
  store i32 0, ptr %36, align 4, !tbaa !16
  br label %37

37:                                               ; preds = %85, %27
  %38 = load ptr, ptr %7, align 8, !tbaa !11
  %39 = getelementptr inbounds %struct.Node, ptr %38, i32 0, i32 16
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  store ptr %40, ptr %7, align 8, !tbaa !11
  %41 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %42 = icmp ne ptr %40, %41
  br i1 %42, label %43, label %86

43:                                               ; preds = %37
  %44 = load ptr, ptr %7, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.Node, ptr %44, i32 0, i32 46
  %46 = load double, ptr %45, align 8, !tbaa !13
  %47 = load double, ptr %3, align 8, !tbaa !9
  %48 = fcmp olt double %46, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %43
  %50 = load ptr, ptr %7, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.Node, ptr %50, i32 0, i32 46
  %52 = load double, ptr %51, align 8, !tbaa !13
  store double %52, ptr %3, align 8, !tbaa !9
  br label %64

53:                                               ; preds = %43
  %54 = load ptr, ptr %7, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.Node, ptr %54, i32 0, i32 46
  %56 = load double, ptr %55, align 8, !tbaa !13
  %57 = load double, ptr %4, align 8, !tbaa !9
  %58 = fcmp ogt double %56, %57
  br i1 %58, label %59, label %63

59:                                               ; preds = %53
  %60 = load ptr, ptr %7, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct.Node, ptr %60, i32 0, i32 46
  %62 = load double, ptr %61, align 8, !tbaa !13
  store double %62, ptr %4, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %59, %53
  br label %64

64:                                               ; preds = %63, %49
  %65 = load ptr, ptr %7, align 8, !tbaa !11
  %66 = getelementptr inbounds %struct.Node, ptr %65, i32 0, i32 47
  %67 = load double, ptr %66, align 8, !tbaa !15
  %68 = load double, ptr %5, align 8, !tbaa !9
  %69 = fcmp olt double %67, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %64
  %71 = load ptr, ptr %7, align 8, !tbaa !11
  %72 = getelementptr inbounds %struct.Node, ptr %71, i32 0, i32 47
  %73 = load double, ptr %72, align 8, !tbaa !15
  store double %73, ptr %5, align 8, !tbaa !9
  br label %85

74:                                               ; preds = %64
  %75 = load ptr, ptr %7, align 8, !tbaa !11
  %76 = getelementptr inbounds %struct.Node, ptr %75, i32 0, i32 47
  %77 = load double, ptr %76, align 8, !tbaa !15
  %78 = load double, ptr %6, align 8, !tbaa !9
  %79 = fcmp ogt double %77, %78
  br i1 %79, label %80, label %84

80:                                               ; preds = %74
  %81 = load ptr, ptr %7, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.Node, ptr %81, i32 0, i32 47
  %83 = load double, ptr %82, align 8, !tbaa !15
  store double %83, ptr %6, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %80, %74
  br label %85

85:                                               ; preds = %84, %70
  br label %37, !llvm.loop !18

86:                                               ; preds = %37
  %87 = load double, ptr %4, align 8, !tbaa !9
  %88 = load double, ptr %3, align 8, !tbaa !9
  %89 = fcmp oeq double %87, %88
  br i1 %89, label %90, label %93

90:                                               ; preds = %86
  %91 = load double, ptr %3, align 8, !tbaa !9
  %92 = fadd double %91, 1.000000e+00
  store double %92, ptr %4, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %90, %86
  %94 = load double, ptr %6, align 8, !tbaa !9
  %95 = load double, ptr %5, align 8, !tbaa !9
  %96 = fcmp oeq double %94, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load double, ptr %5, align 8, !tbaa !9
  %99 = fadd double %98, 1.000000e+00
  store double %99, ptr %6, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %97, %93
  %101 = load i32, ptr @Dimension, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = mul i64 %102, 8
  %104 = call noalias ptr @malloc(i64 noundef %103) #8
  store ptr %104, ptr %8, align 8, !tbaa !11
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %107

106:                                              ; preds = %100
  br label %108

107:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 64, ptr noundef @__PRETTY_FUNCTION__.SFCTour) #9
  unreachable

108:                                              ; preds = %106
  store i32 0, ptr %9, align 4, !tbaa !5
  %109 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %109, ptr %7, align 8, !tbaa !11
  br label %110

110:                                              ; preds = %141, %108
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = load i32, ptr @Dimension, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %114, label %147

114:                                              ; preds = %110
  %115 = load ptr, ptr %10, align 8, !tbaa !11
  %116 = load ptr, ptr %7, align 8, !tbaa !11
  %117 = getelementptr inbounds %struct.Node, ptr %116, i32 0, i32 46
  %118 = load double, ptr %117, align 8, !tbaa !13
  %119 = load double, ptr %3, align 8, !tbaa !9
  %120 = fsub double %118, %119
  %121 = load double, ptr %4, align 8, !tbaa !9
  %122 = load double, ptr %3, align 8, !tbaa !9
  %123 = fsub double %121, %122
  %124 = fdiv double %120, %123
  %125 = load ptr, ptr %7, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct.Node, ptr %125, i32 0, i32 47
  %127 = load double, ptr %126, align 8, !tbaa !15
  %128 = load double, ptr %5, align 8, !tbaa !9
  %129 = fsub double %127, %128
  %130 = load double, ptr %6, align 8, !tbaa !9
  %131 = load double, ptr %5, align 8, !tbaa !9
  %132 = fsub double %130, %131
  %133 = fdiv double %129, %132
  %134 = call i32 %115(double noundef %124, double noundef %133)
  %135 = load ptr, ptr %7, align 8, !tbaa !11
  %136 = load ptr, ptr %8, align 8, !tbaa !11
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds ptr, ptr %136, i64 %138
  store ptr %135, ptr %139, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct.Node, ptr %135, i32 0, i32 3
  store i32 %134, ptr %140, align 4, !tbaa !16
  br label %141

141:                                              ; preds = %114
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %9, align 4, !tbaa !5
  %144 = load ptr, ptr %7, align 8, !tbaa !11
  %145 = getelementptr inbounds %struct.Node, ptr %144, i32 0, i32 16
  %146 = load ptr, ptr %145, align 8, !tbaa !17
  store ptr %146, ptr %7, align 8, !tbaa !11
  br label %110, !llvm.loop !20

147:                                              ; preds = %110
  %148 = load ptr, ptr %8, align 8, !tbaa !11
  %149 = load i32, ptr @Dimension, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  call void @qsort(ptr noundef %148, i64 noundef %150, i64 noundef 8, ptr noundef @compare)
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %235, %147
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = load i32, ptr @Dimension, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %155, label %238

155:                                              ; preds = %151
  %156 = load ptr, ptr %8, align 8, !tbaa !11
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds ptr, ptr %156, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !11
  %161 = getelementptr inbounds %struct.Node, ptr %160, i32 0, i32 15
  %162 = load ptr, ptr %161, align 8, !tbaa !21
  %163 = load ptr, ptr %8, align 8, !tbaa !11
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds ptr, ptr %163, i64 %165
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = getelementptr inbounds %struct.Node, ptr %167, i32 0, i32 16
  %169 = load ptr, ptr %168, align 8, !tbaa !17
  %170 = load ptr, ptr %8, align 8, !tbaa !11
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds ptr, ptr %170, i64 %172
  %174 = load ptr, ptr %173, align 8, !tbaa !11
  %175 = getelementptr inbounds %struct.Node, ptr %174, i32 0, i32 15
  %176 = load ptr, ptr %175, align 8, !tbaa !21
  %177 = getelementptr inbounds %struct.Node, ptr %176, i32 0, i32 16
  store ptr %169, ptr %177, align 8, !tbaa !17
  %178 = getelementptr inbounds %struct.Node, ptr %169, i32 0, i32 15
  store ptr %162, ptr %178, align 8, !tbaa !21
  %179 = load ptr, ptr %8, align 8, !tbaa !11
  %180 = load i32, ptr %9, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds ptr, ptr %179, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !11
  %184 = load ptr, ptr %8, align 8, !tbaa !11
  %185 = load i32, ptr %9, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds ptr, ptr %184, i64 %186
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = load ptr, ptr %8, align 8, !tbaa !11
  %190 = load i32, ptr %9, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds ptr, ptr %189, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds %struct.Node, ptr %193, i32 0, i32 16
  store ptr %188, ptr %194, align 8, !tbaa !17
  %195 = getelementptr inbounds %struct.Node, ptr %188, i32 0, i32 15
  store ptr %183, ptr %195, align 8, !tbaa !21
  %196 = load ptr, ptr %8, align 8, !tbaa !11
  %197 = load i32, ptr %9, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds ptr, ptr %196, i64 %198
  %200 = load ptr, ptr %199, align 8, !tbaa !11
  %201 = load ptr, ptr %8, align 8, !tbaa !11
  %202 = load i32, ptr %9, align 4, !tbaa !5
  %203 = sub nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds ptr, ptr %201, i64 %204
  %206 = load ptr, ptr %205, align 8, !tbaa !11
  %207 = getelementptr inbounds %struct.Node, ptr %206, i32 0, i32 16
  %208 = load ptr, ptr %207, align 8, !tbaa !17
  %209 = load ptr, ptr %8, align 8, !tbaa !11
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds ptr, ptr %209, i64 %211
  %213 = load ptr, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds %struct.Node, ptr %213, i32 0, i32 16
  store ptr %208, ptr %214, align 8, !tbaa !17
  %215 = getelementptr inbounds %struct.Node, ptr %208, i32 0, i32 15
  store ptr %200, ptr %215, align 8, !tbaa !21
  %216 = load ptr, ptr %8, align 8, !tbaa !11
  %217 = load i32, ptr %9, align 4, !tbaa !5
  %218 = sub nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds ptr, ptr %216, i64 %219
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  %222 = load ptr, ptr %8, align 8, !tbaa !11
  %223 = load i32, ptr %9, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds ptr, ptr %222, i64 %224
  %226 = load ptr, ptr %225, align 8, !tbaa !11
  %227 = load ptr, ptr %8, align 8, !tbaa !11
  %228 = load i32, ptr %9, align 4, !tbaa !5
  %229 = sub nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds ptr, ptr %227, i64 %230
  %232 = load ptr, ptr %231, align 8, !tbaa !11
  %233 = getelementptr inbounds %struct.Node, ptr %232, i32 0, i32 16
  store ptr %226, ptr %233, align 8, !tbaa !17
  %234 = getelementptr inbounds %struct.Node, ptr %226, i32 0, i32 15
  store ptr %221, ptr %234, align 8, !tbaa !21
  br label %235

235:                                              ; preds = %155
  %236 = load i32, ptr %9, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %9, align 4, !tbaa !5
  br label %151, !llvm.loop !22

238:                                              ; preds = %151
  %239 = load ptr, ptr %8, align 8, !tbaa !11
  call void @free(ptr noundef %239) #7
  %240 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %240, ptr %7, align 8, !tbaa !11
  br label %241

241:                                              ; preds = %363, %238
  %242 = load ptr, ptr %7, align 8, !tbaa !11
  %243 = getelementptr inbounds %struct.Node, ptr %242, i32 0, i32 4
  store i32 1, ptr %243, align 8, !tbaa !23
  %244 = load ptr, ptr %7, align 8, !tbaa !11
  %245 = getelementptr inbounds %struct.Node, ptr %244, i32 0, i32 26
  %246 = load ptr, ptr %245, align 8, !tbaa !24
  %247 = load ptr, ptr %7, align 8, !tbaa !11
  %248 = getelementptr inbounds %struct.Node, ptr %247, i32 0, i32 16
  %249 = load ptr, ptr %248, align 8, !tbaa !17
  %250 = icmp eq ptr %246, %249
  br i1 %250, label %362, label %251

251:                                              ; preds = %241
  %252 = load ptr, ptr %7, align 8, !tbaa !11
  %253 = getelementptr inbounds %struct.Node, ptr %252, i32 0, i32 27
  %254 = load ptr, ptr %253, align 8, !tbaa !25
  %255 = load ptr, ptr %7, align 8, !tbaa !11
  %256 = getelementptr inbounds %struct.Node, ptr %255, i32 0, i32 16
  %257 = load ptr, ptr %256, align 8, !tbaa !17
  %258 = icmp eq ptr %254, %257
  br i1 %258, label %362, label %259

259:                                              ; preds = %251
  %260 = load ptr, ptr %7, align 8, !tbaa !11
  %261 = load ptr, ptr %7, align 8, !tbaa !11
  %262 = getelementptr inbounds %struct.Node, ptr %261, i32 0, i32 16
  %263 = load ptr, ptr %262, align 8, !tbaa !17
  %264 = call i32 @IsCommonEdge(ptr noundef %260, ptr noundef %263)
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %362, label %266

266:                                              ; preds = %259
  %267 = load ptr, ptr %7, align 8, !tbaa !11
  %268 = getelementptr inbounds %struct.Node, ptr %267, i32 0, i32 43
  %269 = load ptr, ptr %268, align 8, !tbaa !26
  %270 = icmp ne ptr %269, null
  br i1 %270, label %271, label %362

271:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %272 = load ptr, ptr %7, align 8, !tbaa !11
  %273 = getelementptr inbounds %struct.Node, ptr %272, i32 0, i32 43
  %274 = load ptr, ptr %273, align 8, !tbaa !26
  store ptr %274, ptr %13, align 8, !tbaa !11
  br label %275

275:                                              ; preds = %358, %271
  %276 = load ptr, ptr %13, align 8, !tbaa !11
  %277 = getelementptr inbounds %struct.Candidate, ptr %276, i32 0, i32 0
  %278 = load ptr, ptr %277, align 8, !tbaa !27
  %279 = icmp ne ptr %278, null
  br i1 %279, label %280, label %361

280:                                              ; preds = %275
  %281 = load ptr, ptr %13, align 8, !tbaa !11
  %282 = getelementptr inbounds %struct.Candidate, ptr %281, i32 0, i32 0
  %283 = load ptr, ptr %282, align 8, !tbaa !27
  %284 = getelementptr inbounds %struct.Node, ptr %283, i32 0, i32 4
  %285 = load i32, ptr %284, align 8, !tbaa !23
  %286 = icmp ne i32 %285, 0
  br i1 %286, label %357, label %287

287:                                              ; preds = %280
  %288 = load ptr, ptr %7, align 8, !tbaa !11
  %289 = getelementptr inbounds %struct.Node, ptr %288, i32 0, i32 26
  %290 = load ptr, ptr %289, align 8, !tbaa !24
  %291 = load ptr, ptr %13, align 8, !tbaa !11
  %292 = getelementptr inbounds %struct.Candidate, ptr %291, i32 0, i32 0
  %293 = load ptr, ptr %292, align 8, !tbaa !27
  %294 = icmp eq ptr %290, %293
  br i1 %294, label %310, label %295

295:                                              ; preds = %287
  %296 = load ptr, ptr %7, align 8, !tbaa !11
  %297 = getelementptr inbounds %struct.Node, ptr %296, i32 0, i32 27
  %298 = load ptr, ptr %297, align 8, !tbaa !25
  %299 = load ptr, ptr %13, align 8, !tbaa !11
  %300 = getelementptr inbounds %struct.Candidate, ptr %299, i32 0, i32 0
  %301 = load ptr, ptr %300, align 8, !tbaa !27
  %302 = icmp eq ptr %298, %301
  br i1 %302, label %310, label %303

303:                                              ; preds = %295
  %304 = load ptr, ptr %7, align 8, !tbaa !11
  %305 = load ptr, ptr %13, align 8, !tbaa !11
  %306 = getelementptr inbounds %struct.Candidate, ptr %305, i32 0, i32 0
  %307 = load ptr, ptr %306, align 8, !tbaa !27
  %308 = call i32 @IsCommonEdge(ptr noundef %304, ptr noundef %307)
  %309 = icmp ne i32 %308, 0
  br i1 %309, label %310, label %357

310:                                              ; preds = %303, %295, %287
  %311 = load ptr, ptr %13, align 8, !tbaa !11
  %312 = getelementptr inbounds %struct.Candidate, ptr %311, i32 0, i32 0
  %313 = load ptr, ptr %312, align 8, !tbaa !27
  %314 = getelementptr inbounds %struct.Node, ptr %313, i32 0, i32 15
  %315 = load ptr, ptr %314, align 8, !tbaa !21
  %316 = load ptr, ptr %13, align 8, !tbaa !11
  %317 = getelementptr inbounds %struct.Candidate, ptr %316, i32 0, i32 0
  %318 = load ptr, ptr %317, align 8, !tbaa !27
  %319 = getelementptr inbounds %struct.Node, ptr %318, i32 0, i32 16
  %320 = load ptr, ptr %319, align 8, !tbaa !17
  %321 = load ptr, ptr %13, align 8, !tbaa !11
  %322 = getelementptr inbounds %struct.Candidate, ptr %321, i32 0, i32 0
  %323 = load ptr, ptr %322, align 8, !tbaa !27
  %324 = getelementptr inbounds %struct.Node, ptr %323, i32 0, i32 15
  %325 = load ptr, ptr %324, align 8, !tbaa !21
  %326 = getelementptr inbounds %struct.Node, ptr %325, i32 0, i32 16
  store ptr %320, ptr %326, align 8, !tbaa !17
  %327 = getelementptr inbounds %struct.Node, ptr %320, i32 0, i32 15
  store ptr %315, ptr %327, align 8, !tbaa !21
  %328 = load ptr, ptr %13, align 8, !tbaa !11
  %329 = getelementptr inbounds %struct.Candidate, ptr %328, i32 0, i32 0
  %330 = load ptr, ptr %329, align 8, !tbaa !27
  %331 = load ptr, ptr %13, align 8, !tbaa !11
  %332 = getelementptr inbounds %struct.Candidate, ptr %331, i32 0, i32 0
  %333 = load ptr, ptr %332, align 8, !tbaa !27
  %334 = load ptr, ptr %13, align 8, !tbaa !11
  %335 = getelementptr inbounds %struct.Candidate, ptr %334, i32 0, i32 0
  %336 = load ptr, ptr %335, align 8, !tbaa !27
  %337 = getelementptr inbounds %struct.Node, ptr %336, i32 0, i32 16
  store ptr %333, ptr %337, align 8, !tbaa !17
  %338 = getelementptr inbounds %struct.Node, ptr %333, i32 0, i32 15
  store ptr %330, ptr %338, align 8, !tbaa !21
  %339 = load ptr, ptr %13, align 8, !tbaa !11
  %340 = getelementptr inbounds %struct.Candidate, ptr %339, i32 0, i32 0
  %341 = load ptr, ptr %340, align 8, !tbaa !27
  %342 = load ptr, ptr %7, align 8, !tbaa !11
  %343 = getelementptr inbounds %struct.Node, ptr %342, i32 0, i32 16
  %344 = load ptr, ptr %343, align 8, !tbaa !17
  %345 = load ptr, ptr %13, align 8, !tbaa !11
  %346 = getelementptr inbounds %struct.Candidate, ptr %345, i32 0, i32 0
  %347 = load ptr, ptr %346, align 8, !tbaa !27
  %348 = getelementptr inbounds %struct.Node, ptr %347, i32 0, i32 16
  store ptr %344, ptr %348, align 8, !tbaa !17
  %349 = getelementptr inbounds %struct.Node, ptr %344, i32 0, i32 15
  store ptr %341, ptr %349, align 8, !tbaa !21
  %350 = load ptr, ptr %7, align 8, !tbaa !11
  %351 = load ptr, ptr %13, align 8, !tbaa !11
  %352 = getelementptr inbounds %struct.Candidate, ptr %351, i32 0, i32 0
  %353 = load ptr, ptr %352, align 8, !tbaa !27
  %354 = load ptr, ptr %7, align 8, !tbaa !11
  %355 = getelementptr inbounds %struct.Node, ptr %354, i32 0, i32 16
  store ptr %353, ptr %355, align 8, !tbaa !17
  %356 = getelementptr inbounds %struct.Node, ptr %353, i32 0, i32 15
  store ptr %350, ptr %356, align 8, !tbaa !21
  br label %361

357:                                              ; preds = %303, %280
  br label %358

358:                                              ; preds = %357
  %359 = load ptr, ptr %13, align 8, !tbaa !11
  %360 = getelementptr inbounds %struct.Candidate, ptr %359, i32 1
  store ptr %360, ptr %13, align 8, !tbaa !11
  br label %275, !llvm.loop !29

361:                                              ; preds = %310, %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %362

362:                                              ; preds = %361, %266, %259, %251, %241
  br label %363

363:                                              ; preds = %362
  %364 = load ptr, ptr %7, align 8, !tbaa !11
  %365 = getelementptr inbounds %struct.Node, ptr %364, i32 0, i32 16
  %366 = load ptr, ptr %365, align 8, !tbaa !17
  store ptr %366, ptr %7, align 8, !tbaa !11
  %367 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %368 = icmp ne ptr %366, %367
  br i1 %368, label %241, label %369, !llvm.loop !30

369:                                              ; preds = %363
  store i64 0, ptr %11, align 8, !tbaa !31
  %370 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %370, ptr %7, align 8, !tbaa !11
  br label %371

371:                                              ; preds = %398, %369
  %372 = load ptr, ptr %7, align 8, !tbaa !11
  %373 = getelementptr inbounds %struct.Node, ptr %372, i32 0, i32 26
  %374 = load ptr, ptr %373, align 8, !tbaa !24
  %375 = load ptr, ptr %7, align 8, !tbaa !11
  %376 = getelementptr inbounds %struct.Node, ptr %375, i32 0, i32 16
  %377 = load ptr, ptr %376, align 8, !tbaa !17
  %378 = icmp eq ptr %374, %377
  br i1 %378, label %397, label %379

379:                                              ; preds = %371
  %380 = load ptr, ptr %7, align 8, !tbaa !11
  %381 = getelementptr inbounds %struct.Node, ptr %380, i32 0, i32 27
  %382 = load ptr, ptr %381, align 8, !tbaa !25
  %383 = load ptr, ptr %7, align 8, !tbaa !11
  %384 = getelementptr inbounds %struct.Node, ptr %383, i32 0, i32 16
  %385 = load ptr, ptr %384, align 8, !tbaa !17
  %386 = icmp eq ptr %382, %385
  br i1 %386, label %397, label %387

387:                                              ; preds = %379
  %388 = load ptr, ptr @Distance, align 8, !tbaa !11
  %389 = load ptr, ptr %7, align 8, !tbaa !11
  %390 = load ptr, ptr %7, align 8, !tbaa !11
  %391 = getelementptr inbounds %struct.Node, ptr %390, i32 0, i32 16
  %392 = load ptr, ptr %391, align 8, !tbaa !17
  %393 = call i32 %388(ptr noundef %389, ptr noundef %392)
  %394 = sext i32 %393 to i64
  %395 = load i64, ptr %11, align 8, !tbaa !31
  %396 = add nsw i64 %395, %394
  store i64 %396, ptr %11, align 8, !tbaa !31
  br label %397

397:                                              ; preds = %387, %379, %371
  br label %398

398:                                              ; preds = %397
  %399 = load ptr, ptr %7, align 8, !tbaa !11
  %400 = getelementptr inbounds %struct.Node, ptr %399, i32 0, i32 16
  %401 = load ptr, ptr %400, align 8, !tbaa !17
  store ptr %401, ptr %7, align 8, !tbaa !11
  %402 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %403 = icmp ne ptr %401, %402
  br i1 %403, label %371, label %404, !llvm.loop !33

404:                                              ; preds = %398
  %405 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %406 = icmp sge i32 %405, 1
  br i1 %406, label %407, label %428

407:                                              ; preds = %404
  %408 = load i64, ptr %11, align 8, !tbaa !31
  call void (ptr, ...) @printff(ptr noundef @.str.4, i64 noundef %408)
  %409 = load i64, ptr @Optimum, align 8, !tbaa !31
  %410 = icmp ne i64 %409, -9223372036854775808
  br i1 %410, label %411, label %423

411:                                              ; preds = %407
  %412 = load i64, ptr @Optimum, align 8, !tbaa !31
  %413 = icmp ne i64 %412, 0
  br i1 %413, label %414, label %423

414:                                              ; preds = %411
  %415 = load i64, ptr %11, align 8, !tbaa !31
  %416 = load i64, ptr @Optimum, align 8, !tbaa !31
  %417 = sub nsw i64 %415, %416
  %418 = sitofp i64 %417 to double
  %419 = fmul double 1.000000e+02, %418
  %420 = load i64, ptr @Optimum, align 8, !tbaa !31
  %421 = sitofp i64 %420 to double
  %422 = fdiv double %419, %421
  call void (ptr, ...) @printff(ptr noundef @.str.5, double noundef %422)
  br label %423

423:                                              ; preds = %414, %411, %407
  %424 = call double @GetTime()
  %425 = load double, ptr %12, align 8, !tbaa !9
  %426 = fsub double %424, %425
  %427 = call double @llvm.fabs.f64(double %426)
  call void (ptr, ...) @printff(ptr noundef @.str.6, double noundef %427)
  br label %428

428:                                              ; preds = %423, %404
  %429 = load i64, ptr %11, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret i64 %429
}

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

declare double @GetTime() #2

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

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

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

; 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

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

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

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

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

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !10, i64 312}
!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, !10, i64 320}
!16 = !{!14, !6, i64 12}
!17 = !{!14, !12, i64 72}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!14, !12, i64 64}
!22 = distinct !{!22, !19}
!23 = !{!14, !6, i64 16}
!24 = !{!14, !12, i64 152}
!25 = !{!14, !12, i64 160}
!26 = !{!14, !12, i64 288}
!27 = !{!28, !12, i64 0}
!28 = !{!"Candidate", !12, i64 0, !6, i64 8, !6, i64 12}
!29 = distinct !{!29, !19}
!30 = distinct !{!30, !19}
!31 = !{!32, !32, i64 0}
!32 = !{!"long long", !7, i64 0}
!33 = distinct !{!33, !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"

@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@Dimension = external dso_local local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 x i8], align 1
@__PRETTY_FUNCTION__.SFCTour = external hidden unnamed_addr constant [22 x i8], align 1
@Distance = external dso_local local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @SFCTour(i32 noundef %0) local_unnamed_addr #0 {
  %2 = tail call double @GetTime() #7
  %3 = icmp eq i32 %0, 5
  %4 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  %SierpinskiIndex.MooreIndex = select i1 %3, ptr @SierpinskiIndex, ptr @MooreIndex
  br i1 %5, label %.sink.split, label %6

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

6:                                                ; preds = %1, %.sink.split
  %7 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %7, i64 312
  %9 = load double, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %7, i64 320
  %11 = load double, ptr %10, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 0, ptr %12, align 4, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %7, i64 72
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %.not152 = icmp eq ptr %14, %7
  br i1 %.not152, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6, %29
  %15 = phi ptr [ %31, %29 ], [ %14, %6 ]
  %.0109156 = phi double [ %.1, %29 ], [ %9, %6 ]
  %.0115155 = phi double [ %.1116, %29 ], [ %9, %6 ]
  %.0120154 = phi double [ %.1121, %29 ], [ %11, %6 ]
  %.0123153 = phi double [ %.1124, %29 ], [ %11, %6 ]
  %16 = getelementptr inbounds i8, ptr %15, i64 312
  %17 = load double, ptr %16, align 8, !tbaa !11
  %18 = fcmp olt double %17, %.0109156
  br i1 %18, label %22, label %19

19:                                               ; preds = %.lr.ph
  %20 = fcmp ogt double %17, %.0115155
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  br label %22

22:                                               ; preds = %.lr.ph, %19, %21
  %.1116 = phi double [ %17, %21 ], [ %.0115155, %19 ], [ %.0115155, %.lr.ph ]
  %.1 = phi double [ %.0109156, %21 ], [ %.0109156, %19 ], [ %17, %.lr.ph ]
  %23 = getelementptr inbounds i8, ptr %15, i64 320
  %24 = load double, ptr %23, align 8, !tbaa !14
  %25 = fcmp olt double %24, %.0123153
  br i1 %25, label %29, label %26

26:                                               ; preds = %22
  %27 = fcmp ogt double %24, %.0120154
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  br label %29

29:                                               ; preds = %22, %26, %28
  %.1124 = phi double [ %.0123153, %28 ], [ %.0123153, %26 ], [ %24, %22 ]
  %.1121 = phi double [ %24, %28 ], [ %.0120154, %26 ], [ %.0120154, %22 ]
  %30 = getelementptr inbounds i8, ptr %15, i64 72
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %.not = icmp eq ptr %31, %7
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %29, %6
  %.0123.lcssa = phi double [ %11, %6 ], [ %.1124, %29 ]
  %.0120.lcssa = phi double [ %11, %6 ], [ %.1121, %29 ]
  %.0115.lcssa = phi double [ %9, %6 ], [ %.1116, %29 ]
  %.0109.lcssa = phi double [ %9, %6 ], [ %.1, %29 ]
  %32 = fcmp oeq double %.0115.lcssa, %.0109.lcssa
  %33 = fadd double %.0109.lcssa, 1.000000e+00
  %.2 = select i1 %32, double %33, double %.0115.lcssa
  %34 = fcmp oeq double %.0120.lcssa, %.0123.lcssa
  %35 = fadd double %.0123.lcssa, 1.000000e+00
  %.2122 = select i1 %34, double %35, double %.0120.lcssa
  %36 = load i32, ptr @Dimension, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = shl nsw i64 %37, 3
  %39 = tail call noalias ptr @malloc(i64 noundef %38) #8
  %.not140 = icmp eq ptr %39, null
  br i1 %.not140, label %43, label %.preheader149

.preheader149:                                    ; preds = %._crit_edge
  %40 = icmp sgt i32 %36, 0
  br i1 %40, label %.lr.ph162, label %._crit_edge163

.lr.ph162:                                        ; preds = %.preheader149
  %41 = fsub double %.2, %.0109.lcssa
  %42 = fsub double %.2122, %.0123.lcssa
  br label %44

43:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 64, ptr noundef nonnull @__PRETTY_FUNCTION__.SFCTour) #9
  unreachable

44:                                               ; preds = %.lr.ph162, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph162 ], [ %indvars.iv.next, %44 ]
  %.1118.in160 = phi ptr [ @FirstNode, %.lr.ph162 ], [ %56, %44 ]
  %.1118 = load ptr, ptr %.1118.in160, align 8, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %.1118, i64 312
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fsub double %46, %.0109.lcssa
  %48 = fdiv double %47, %41
  %49 = getelementptr inbounds i8, ptr %.1118, i64 320
  %50 = load double, ptr %49, align 8, !tbaa !14
  %51 = fsub double %50, %.0123.lcssa
  %52 = fdiv double %51, %42
  %53 = tail call i32 %SierpinskiIndex.MooreIndex(double noundef %48, double noundef %52) #7, !callees !19
  %54 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv
  store ptr %.1118, ptr %54, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %.1118, i64 12
  store i32 %53, ptr %55, align 4, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = getelementptr inbounds i8, ptr %.1118, i64 72
  %57 = load i32, ptr @Dimension, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next, %58
  br i1 %59, label %44, label %._crit_edge163, !llvm.loop !20

._crit_edge163:                                   ; preds = %44, %.preheader149
  %.pre-phi = phi i64 [ %37, %.preheader149 ], [ %58, %44 ]
  tail call void @qsort(ptr noundef nonnull %39, i64 noundef %.pre-phi, i64 noundef 8, ptr noundef nonnull @compare) #7
  %60 = load i32, ptr @Dimension, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 1
  br i1 %61, label %.lr.ph167.preheader, label %._crit_edge168

.lr.ph167.preheader:                              ; preds = %._crit_edge163
  %wide.trip.count = zext nneg i32 %60 to i64
  br label %.lr.ph167

.lr.ph167:                                        ; preds = %.lr.ph167.preheader, %.lr.ph167
  %indvars.iv175 = phi i64 [ 1, %.lr.ph167.preheader ], [ %indvars.iv.next176, %.lr.ph167 ]
  %62 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv175
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 64
  %65 = load ptr, ptr %64, align 8, !tbaa !21
  %66 = getelementptr inbounds i8, ptr %63, i64 72
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  %68 = getelementptr inbounds i8, ptr %65, i64 72
  store ptr %67, ptr %68, align 8, !tbaa !16
  %69 = getelementptr inbounds i8, ptr %67, i64 64
  store ptr %65, ptr %69, align 8, !tbaa !21
  %70 = load ptr, ptr %62, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %70, i64 72
  store ptr %70, ptr %71, align 8, !tbaa !16
  %72 = getelementptr inbounds i8, ptr %70, i64 64
  store ptr %70, ptr %72, align 8, !tbaa !21
  %73 = load ptr, ptr %62, align 8, !tbaa !9
  %74 = getelementptr i8, ptr %62, i64 -8
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 72
  %77 = load ptr, ptr %76, align 8, !tbaa !16
  %78 = getelementptr inbounds i8, ptr %73, i64 72
  store ptr %77, ptr %78, align 8, !tbaa !16
  %79 = getelementptr inbounds i8, ptr %77, i64 64
  store ptr %73, ptr %79, align 8, !tbaa !21
  %80 = load ptr, ptr %74, align 8, !tbaa !9
  %81 = load ptr, ptr %62, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %80, i64 72
  store ptr %81, ptr %82, align 8, !tbaa !16
  %83 = getelementptr inbounds i8, ptr %81, i64 64
  store ptr %80, ptr %83, align 8, !tbaa !21
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge168, label %.lr.ph167, !llvm.loop !22

._crit_edge168:                                   ; preds = %.lr.ph167, %._crit_edge163
  tail call void @free(ptr noundef nonnull %39) #7
  %84 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %.loopexit, %._crit_edge168
  %.2119 = phi ptr [ %84, %._crit_edge168 ], [ %125, %.loopexit ]
  %86 = getelementptr inbounds i8, ptr %.2119, i64 16
  store i32 1, ptr %86, align 8, !tbaa !23
  %87 = getelementptr inbounds i8, ptr %.2119, i64 152
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = getelementptr inbounds i8, ptr %.2119, i64 72
  %90 = load ptr, ptr %89, align 8, !tbaa !16
  %91 = icmp eq ptr %88, %90
  br i1 %91, label %.loopexit, label %92

92:                                               ; preds = %85
  %93 = getelementptr inbounds i8, ptr %.2119, i64 160
  %94 = load ptr, ptr %93, align 8, !tbaa !25
  %95 = icmp eq ptr %94, %90
  br i1 %95, label %.loopexit, label %96

96:                                               ; preds = %92
  %97 = tail call i32 @IsCommonEdge(ptr noundef nonnull %.2119, ptr noundef %90) #7
  %.not141 = icmp eq i32 %97, 0
  br i1 %.not141, label %98, label %.loopexit

98:                                               ; preds = %96
  %99 = getelementptr inbounds i8, ptr %.2119, i64 288
  %100 = load ptr, ptr %99, align 8, !tbaa !26
  %.not142 = icmp eq ptr %100, null
  br i1 %.not142, label %.loopexit, label %.preheader148

.preheader148:                                    ; preds = %98
  %101 = load ptr, ptr %100, align 8, !tbaa !27
  %.not143169 = icmp eq ptr %101, null
  br i1 %.not143169, label %.loopexit, label %.lr.ph171

.lr.ph171:                                        ; preds = %.preheader148, %122
  %102 = phi ptr [ %124, %122 ], [ %101, %.preheader148 ]
  %.0170 = phi ptr [ %123, %122 ], [ %100, %.preheader148 ]
  %103 = getelementptr inbounds i8, ptr %102, i64 16
  %104 = load i32, ptr %103, align 8, !tbaa !23
  %.not144 = icmp eq i32 %104, 0
  br i1 %.not144, label %105, label %122

105:                                              ; preds = %.lr.ph171
  %106 = load ptr, ptr %87, align 8, !tbaa !24
  %107 = icmp eq ptr %106, %102
  br i1 %107, label %split, label %108

108:                                              ; preds = %105
  %109 = load ptr, ptr %93, align 8, !tbaa !25
  %110 = icmp eq ptr %109, %102
  br i1 %110, label %split, label %111

111:                                              ; preds = %108
  %112 = tail call i32 @IsCommonEdge(ptr noundef nonnull %.2119, ptr noundef nonnull %102) #7
  %.not145 = icmp eq i32 %112, 0
  br i1 %.not145, label %122, label %._crit_edge178

._crit_edge178:                                   ; preds = %111
  %.pre = load ptr, ptr %.0170, align 8, !tbaa !27
  br label %split

split:                                            ; preds = %108, %105, %._crit_edge178
  %113 = phi ptr [ %.pre, %._crit_edge178 ], [ %102, %105 ], [ %102, %108 ]
  %114 = getelementptr inbounds i8, ptr %113, i64 64
  %115 = load ptr, ptr %114, align 8, !tbaa !21
  %116 = getelementptr inbounds i8, ptr %113, i64 72
  %117 = load ptr, ptr %116, align 8, !tbaa !16
  %118 = getelementptr inbounds i8, ptr %115, i64 72
  store ptr %117, ptr %118, align 8, !tbaa !16
  %119 = getelementptr inbounds i8, ptr %117, i64 64
  store ptr %115, ptr %119, align 8, !tbaa !21
  store ptr %113, ptr %116, align 8, !tbaa !16
  %120 = load ptr, ptr %89, align 8, !tbaa !16
  store ptr %120, ptr %116, align 8, !tbaa !16
  %121 = getelementptr inbounds i8, ptr %120, i64 64
  store ptr %113, ptr %121, align 8, !tbaa !21
  store ptr %113, ptr %89, align 8, !tbaa !16
  store ptr %.2119, ptr %114, align 8, !tbaa !21
  br label %.loopexit

122:                                              ; preds = %.lr.ph171, %111
  %123 = getelementptr inbounds i8, ptr %.0170, i64 16
  %124 = load ptr, ptr %123, align 8, !tbaa !27
  %.not143 = icmp eq ptr %124, null
  br i1 %.not143, label %.loopexit, label %.lr.ph171, !llvm.loop !29

.loopexit:                                        ; preds = %122, %.preheader148, %split, %85, %92, %96, %98
  %125 = load ptr, ptr %89, align 8, !tbaa !16
  %126 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %.not146 = icmp eq ptr %125, %126
  br i1 %.not146, label %.preheader, label %85, !llvm.loop !30

.preheader:                                       ; preds = %.loopexit, %142
  %127 = phi ptr [ %143, %142 ], [ %125, %.loopexit ]
  %.3 = phi ptr [ %144, %142 ], [ %126, %.loopexit ]
  %.0110 = phi i64 [ %.1111, %142 ], [ 0, %.loopexit ]
  %128 = getelementptr inbounds i8, ptr %.3, i64 152
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = getelementptr inbounds i8, ptr %.3, i64 72
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = icmp eq ptr %129, %131
  br i1 %132, label %142, label %133

133:                                              ; preds = %.preheader
  %134 = getelementptr inbounds i8, ptr %.3, i64 160
  %135 = load ptr, ptr %134, align 8, !tbaa !25
  %136 = icmp eq ptr %135, %131
  br i1 %136, label %142, label %137

137:                                              ; preds = %133
  %138 = load ptr, ptr @Distance, align 8, !tbaa !9
  %139 = tail call i32 %138(ptr noundef nonnull %.3, ptr noundef %131) #7
  %140 = sext i32 %139 to i64
  %141 = add nsw i64 %.0110, %140
  %.pre179 = load ptr, ptr %130, align 8, !tbaa !16
  %.pre180 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %.preheader, %133, %137
  %143 = phi ptr [ %127, %.preheader ], [ %127, %133 ], [ %.pre180, %137 ]
  %144 = phi ptr [ %131, %.preheader ], [ %131, %133 ], [ %.pre179, %137 ]
  %.1111 = phi i64 [ %.0110, %.preheader ], [ %.0110, %133 ], [ %141, %137 ]
  %.not147 = icmp eq ptr %144, %143
  br i1 %.not147, label %145, label %.preheader, !llvm.loop !31

145:                                              ; preds = %142
  %146 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 0
  br i1 %147, label %148, label %161

148:                                              ; preds = %145
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, i64 noundef %.1111) #7
  %149 = load i64, ptr @Optimum, align 8
  %150 = and i64 %149, 9223372036854775807
  %or.cond.not = icmp eq i64 %150, 0
  br i1 %or.cond.not, label %157, label %151

151:                                              ; preds = %148
  %152 = sub nsw i64 %.1111, %149
  %153 = sitofp i64 %152 to double
  %154 = fmul double %153, 1.000000e+02
  %155 = sitofp i64 %149 to double
  %156 = fdiv double %154, %155
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.5, double noundef %156) #7
  br label %157

157:                                              ; preds = %151, %148
  %158 = tail call double @GetTime() #7
  %159 = fsub double %158, %2
  %160 = tail call double @llvm.fabs.f64(double %159)
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.6, double noundef %160) #7
  br label %161

161:                                              ; preds = %157, %145
  ret i64 %.1111
}

declare double @GetTime() local_unnamed_addr #1

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

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

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

; 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: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

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

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

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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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, !13, i64 312}
!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, !13, i64 320}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !10, i64 72}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{ptr @MooreIndex, ptr @SierpinskiIndex}
!20 = distinct !{!20, !18}
!21 = !{!12, !10, i64 64}
!22 = distinct !{!22, !18}
!23 = !{!12, !6, i64 16}
!24 = !{!12, !10, i64 152}
!25 = !{!12, !10, i64 160}
!26 = !{!12, !10, i64 288}
!27 = !{!28, !10, i64 0}
!28 = !{!"Candidate", !10, i64 0, !6, i64 8, !6, i64 12}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}


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