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

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

@SierpinskiPartitioning = external dso_local global i32, align 4
@Dimension = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [57 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.SolveSFCSubproblems = external hidden unnamed_addr constant [27 x i8], align 1
@FirstNode = external dso_local global ptr, align 8
@SubproblemSize = external dso_local global i32, align 4
@NodeSet = external dso_local global ptr, align 8
@Distance = external dso_local global ptr, align 8
@TraceLevel = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@SubproblemsCompressed = external dso_local global i32, align 4
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@SubproblemBorders = external dso_local global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @SolveSFCSubproblems() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, 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 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %11 = call double @GetTime()
  store double %11, ptr %10, align 8, !tbaa !5
  %12 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !9
  %13 = icmp ne i32 %12, 0
  %14 = zext i1 %13 to i64
  %15 = select i1 %13, i32 5, i32 2
  %16 = call i64 @SFCTour(i32 noundef %15)
  %17 = load i32, ptr @Dimension, align 4, !tbaa !9
  %18 = add nsw i32 1, %17
  %19 = sext i32 %18 to i64
  %20 = mul i64 %19, 8
  %21 = call noalias ptr @malloc(i64 noundef %20) #8
  store ptr %21, ptr %9, align 8, !tbaa !11
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %0
  br label %25

24:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 29, ptr noundef @__PRETTY_FUNCTION__.SolveSFCSubproblems) #9
  unreachable

25:                                               ; preds = %23
  %26 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %26, ptr %2, align 8, !tbaa !11
  br label %27

27:                                               ; preds = %37, %25
  %28 = load ptr, ptr %2, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.Node, ptr %28, i32 0, i32 16
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = load ptr, ptr %9, align 8, !tbaa !11
  %32 = load ptr, ptr %2, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %31, i64 %35
  store ptr %30, ptr %36, align 8, !tbaa !11
  br label %37

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

43:                                               ; preds = %37
  call void @AllocateStructures()
  %44 = load i32, ptr @Dimension, align 4, !tbaa !9
  %45 = sitofp i32 %44 to double
  %46 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %47 = sitofp i32 %46 to double
  %48 = fdiv double %45, %47
  %49 = call double @llvm.ceil.f64(double %48)
  %50 = fptosi double %49 to i32
  store i32 %50, ptr %4, align 4, !tbaa !9
  %51 = call i32 @ReadPenalties()
  %52 = load ptr, ptr @NodeSet, align 8, !tbaa !11
  %53 = call i32 @Random()
  %54 = load i32, ptr @Dimension, align 4, !tbaa !9
  %55 = urem i32 %53, %54
  %56 = add i32 %55, 1
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds %struct.Node, ptr %52, i64 %57
  store ptr %58, ptr @FirstNode, align 8, !tbaa !11
  store i64 0, ptr %7, align 8, !tbaa !18
  %59 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %59, ptr %1, align 8, !tbaa !11
  store ptr %59, ptr %2, align 8, !tbaa !11
  br label %60

60:                                               ; preds = %89, %43
  %61 = load ptr, ptr %2, align 8, !tbaa !11
  %62 = getelementptr inbounds %struct.Node, ptr %61, i32 0, i32 26
  %63 = load ptr, ptr %62, align 8, !tbaa !20
  %64 = load ptr, ptr %2, align 8, !tbaa !11
  %65 = getelementptr inbounds %struct.Node, ptr %64, i32 0, i32 35
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = icmp eq ptr %63, %66
  br i1 %67, label %86, label %68

68:                                               ; preds = %60
  %69 = load ptr, ptr %2, align 8, !tbaa !11
  %70 = getelementptr inbounds %struct.Node, ptr %69, i32 0, i32 27
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = load ptr, ptr %2, align 8, !tbaa !11
  %73 = getelementptr inbounds %struct.Node, ptr %72, i32 0, i32 35
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = icmp eq ptr %71, %74
  br i1 %75, label %86, label %76

76:                                               ; preds = %68
  %77 = load ptr, ptr @Distance, align 8, !tbaa !11
  %78 = load ptr, ptr %2, align 8, !tbaa !11
  %79 = load ptr, ptr %2, align 8, !tbaa !11
  %80 = getelementptr inbounds %struct.Node, ptr %79, i32 0, i32 35
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = call i32 %77(ptr noundef %78, ptr noundef %81)
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr %7, align 8, !tbaa !18
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %7, align 8, !tbaa !18
  br label %86

86:                                               ; preds = %76, %68, %60
  %87 = load ptr, ptr %2, align 8, !tbaa !11
  %88 = getelementptr inbounds %struct.Node, ptr %87, i32 0, i32 12
  store i32 0, ptr %88, align 8, !tbaa !23
  br label %89

89:                                               ; preds = %86
  %90 = load ptr, ptr %2, align 8, !tbaa !11
  %91 = getelementptr inbounds %struct.Node, ptr %90, i32 0, i32 35
  %92 = load ptr, ptr %91, align 8, !tbaa !21
  store ptr %92, ptr %2, align 8, !tbaa !11
  %93 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %94 = icmp ne ptr %92, %93
  br i1 %94, label %60, label %95, !llvm.loop !24

95:                                               ; preds = %89
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %217, %95
  %97 = load i32, ptr %5, align 4, !tbaa !9
  %98 = icmp sle i32 %97, 2
  br i1 %98, label %99, label %220

99:                                               ; preds = %96
  %100 = load i32, ptr %5, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 2
  br i1 %101, label %102, label %106

102:                                              ; preds = %99
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 1
  br i1 %104, label %105, label %106

105:                                              ; preds = %102
  br label %220

106:                                              ; preds = %102, %99
  %107 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %108 = icmp sge i32 %107, 1
  br i1 %108, label %109, label %127

109:                                              ; preds = %106
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = icmp eq i32 %110, 2
  br i1 %111, label %115, label %112

112:                                              ; preds = %109
  %113 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %114 = icmp sge i32 %113, 2
  br i1 %114, label %115, label %116

115:                                              ; preds = %112, %109
  call void (ptr, ...) @printff(ptr noundef @.str.2)
  br label %116

116:                                              ; preds = %115, %112
  %117 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !9
  %118 = icmp ne i32 %117, 0
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, ptr @.str.4, ptr @.str.5
  %121 = load i32, ptr %5, align 4, !tbaa !9
  %122 = load i32, ptr %4, align 4, !tbaa !9
  %123 = icmp sgt i32 %122, 1
  %124 = zext i1 %123 to i64
  %125 = select i1 %123, i32 2, i32 1
  %126 = load i64, ptr %7, align 8, !tbaa !18
  call void (ptr, ...) @printff(ptr noundef @.str.3, ptr noundef %120, i32 noundef %121, i32 noundef %125, i64 noundef %126)
  br label %127

127:                                              ; preds = %116, %106
  %128 = load ptr, ptr %1, align 8, !tbaa !11
  store ptr %128, ptr @FirstNode, align 8, !tbaa !11
  %129 = load i32, ptr %5, align 4, !tbaa !9
  %130 = icmp eq i32 %129, 2
  br i1 %130, label %131, label %149

131:                                              ; preds = %127
  %132 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %133 = sdiv i32 %132, 2
  store i32 %133, ptr %6, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %145, %131
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = icmp sgt i32 %135, 0
  br i1 %136, label %137, label %148

137:                                              ; preds = %134
  %138 = load ptr, ptr %9, align 8, !tbaa !11
  %139 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct.Node, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 8, !tbaa !15
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds ptr, ptr %138, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  store ptr %144, ptr @FirstNode, align 8, !tbaa !11
  br label %145

145:                                              ; preds = %137
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = add nsw i32 %146, -1
  store i32 %147, ptr %6, align 4, !tbaa !9
  br label %134, !llvm.loop !25

148:                                              ; preds = %134
  br label %149

149:                                              ; preds = %148, %127
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %213, %149
  %151 = load i32, ptr %3, align 4, !tbaa !9
  %152 = load i32, ptr %4, align 4, !tbaa !9
  %153 = icmp sle i32 %151, %152
  br i1 %153, label %154, label %216

154:                                              ; preds = %150
  store i32 0, ptr %6, align 4, !tbaa !9
  %155 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %155, ptr %2, align 8, !tbaa !11
  br label %156

156:                                              ; preds = %177, %154
  %157 = load i32, ptr %6, align 4, !tbaa !9
  %158 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %187

160:                                              ; preds = %156
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = sub nsw i32 %161, 1
  %163 = load i32, ptr %4, align 4, !tbaa !9
  %164 = mul nsw i32 %162, %163
  %165 = load i32, ptr %3, align 4, !tbaa !9
  %166 = add nsw i32 %164, %165
  %167 = load ptr, ptr %2, align 8, !tbaa !11
  %168 = getelementptr inbounds %struct.Node, ptr %167, i32 0, i32 12
  store i32 %166, ptr %168, align 8, !tbaa !23
  %169 = load ptr, ptr %2, align 8, !tbaa !11
  %170 = getelementptr inbounds %struct.Node, ptr %169, i32 0, i32 29
  store ptr null, ptr %170, align 8, !tbaa !26
  %171 = load ptr, ptr %2, align 8, !tbaa !11
  %172 = getelementptr inbounds %struct.Node, ptr %171, i32 0, i32 28
  store ptr null, ptr %172, align 8, !tbaa !27
  %173 = load ptr, ptr %2, align 8, !tbaa !11
  %174 = getelementptr inbounds %struct.Node, ptr %173, i32 0, i32 37
  store ptr null, ptr %174, align 8, !tbaa !28
  %175 = load ptr, ptr %2, align 8, !tbaa !11
  %176 = getelementptr inbounds %struct.Node, ptr %175, i32 0, i32 36
  store ptr null, ptr %176, align 8, !tbaa !29
  br label %177

177:                                              ; preds = %160
  %178 = load i32, ptr %6, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %6, align 4, !tbaa !9
  %180 = load ptr, ptr %9, align 8, !tbaa !11
  %181 = load ptr, ptr %2, align 8, !tbaa !11
  %182 = getelementptr inbounds %struct.Node, ptr %181, i32 0, i32 0
  %183 = load i32, ptr %182, align 8, !tbaa !15
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %180, i64 %184
  %186 = load ptr, ptr %185, align 8, !tbaa !11
  store ptr %186, ptr %2, align 8, !tbaa !11
  br label %156, !llvm.loop !30

187:                                              ; preds = %156
  %188 = load i64, ptr %7, align 8, !tbaa !18
  store i64 %188, ptr %8, align 8, !tbaa !18
  %189 = load i32, ptr %5, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %4, align 4, !tbaa !9
  %192 = mul nsw i32 %190, %191
  %193 = load i32, ptr %3, align 4, !tbaa !9
  %194 = add nsw i32 %192, %193
  %195 = load i32, ptr %4, align 4, !tbaa !9
  %196 = call i32 @SolveSubproblem(i32 noundef %194, i32 noundef %195, ptr noundef %7)
  %197 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !9
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %199, label %211

199:                                              ; preds = %187
  %200 = load i64, ptr %7, align 8, !tbaa !18
  %201 = load i64, ptr %8, align 8, !tbaa !18
  %202 = icmp eq i64 %200, %201
  br i1 %202, label %203, label %211

203:                                              ; preds = %199
  %204 = load i32, ptr %5, align 4, !tbaa !9
  %205 = sub nsw i32 %204, 1
  %206 = load i32, ptr %4, align 4, !tbaa !9
  %207 = mul nsw i32 %205, %206
  %208 = load i32, ptr %3, align 4, !tbaa !9
  %209 = add nsw i32 %207, %208
  %210 = load i32, ptr %4, align 4, !tbaa !9
  call void @SolveCompressedSubproblem(i32 noundef %209, i32 noundef %210, ptr noundef %7)
  br label %211

211:                                              ; preds = %203, %199, %187
  %212 = load ptr, ptr %2, align 8, !tbaa !11
  store ptr %212, ptr @FirstNode, align 8, !tbaa !11
  br label %213

213:                                              ; preds = %211
  %214 = load i32, ptr %3, align 4, !tbaa !9
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %3, align 4, !tbaa !9
  br label %150, !llvm.loop !31

216:                                              ; preds = %150
  br label %217

217:                                              ; preds = %216
  %218 = load i32, ptr %5, align 4, !tbaa !9
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %5, align 4, !tbaa !9
  br label %96, !llvm.loop !32

220:                                              ; preds = %105, %96
  %221 = load ptr, ptr %9, align 8, !tbaa !11
  call void @free(ptr noundef %221) #7
  %222 = load i64, ptr %7, align 8, !tbaa !18
  call void (ptr, ...) @printff(ptr noundef @.str.6, i64 noundef %222)
  %223 = load i64, ptr @Optimum, align 8, !tbaa !18
  %224 = icmp ne i64 %223, -9223372036854775808
  br i1 %224, label %225, label %237

225:                                              ; preds = %220
  %226 = load i64, ptr @Optimum, align 8, !tbaa !18
  %227 = icmp ne i64 %226, 0
  br i1 %227, label %228, label %237

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

237:                                              ; preds = %228, %225, %220
  %238 = call double @GetTime()
  %239 = load double, ptr %10, align 8, !tbaa !5
  %240 = fsub double %238, %239
  %241 = call double @llvm.fabs.f64(double %240)
  %242 = load i64, ptr %7, align 8, !tbaa !18
  %243 = load i64, ptr @Optimum, align 8, !tbaa !18
  %244 = icmp slt i64 %242, %243
  br i1 %244, label %245, label %246

245:                                              ; preds = %237
  br label %252

246:                                              ; preds = %237
  %247 = load i64, ptr %7, align 8, !tbaa !18
  %248 = load i64, ptr @Optimum, align 8, !tbaa !18
  %249 = icmp eq i64 %247, %248
  %250 = zext i1 %249 to i64
  %251 = select i1 %249, ptr @.str.10, ptr @.str.11
  br label %252

252:                                              ; preds = %246, %245
  %253 = phi ptr [ @.str.9, %245 ], [ %251, %246 ]
  call void (ptr, ...) @printff(ptr noundef @.str.8, double noundef %241, ptr noundef %253)
  %254 = load i32, ptr @SubproblemBorders, align 4, !tbaa !9
  %255 = icmp ne i32 %254, 0
  br i1 %255, label %256, label %261

256:                                              ; preds = %252
  %257 = load i32, ptr %4, align 4, !tbaa !9
  %258 = icmp sgt i32 %257, 1
  br i1 %258, label %259, label %261

259:                                              ; preds = %256
  %260 = load i32, ptr %4, align 4, !tbaa !9
  call void @SolveSubproblemBorderProblems(i32 noundef %260, ptr noundef %7)
  br label %261

261:                                              ; preds = %259, %256, %252
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  ret void
}

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

declare double @GetTime() #2

declare i64 @SFCTour(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

declare void @AllocateStructures() #2

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

declare i32 @ReadPenalties() #2

declare i32 @Random() #2

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

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

declare void @SolveCompressedSubproblem(i32 noundef, i32 noundef, ptr noundef) #2

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

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

declare void @SolveSubproblemBorderProblems(i32 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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 72}
!14 = !{!"Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !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, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!15 = !{!14, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!14, !12, i64 152}
!21 = !{!14, !12, i64 224}
!22 = !{!14, !12, i64 160}
!23 = !{!14, !10, i64 48}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}
!26 = !{!14, !12, i64 176}
!27 = !{!14, !12, i64 168}
!28 = !{!14, !12, i64 240}
!29 = !{!14, !12, i64 232}
!30 = distinct !{!30, !17}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !17}


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

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

@SierpinskiPartitioning = external dso_local local_unnamed_addr global i32, align 4
@Dimension = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [57 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.SolveSFCSubproblems = external hidden unnamed_addr constant [27 x i8], align 1
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@SubproblemSize = external dso_local local_unnamed_addr global i32, align 4
@NodeSet = external dso_local local_unnamed_addr global ptr, align 8
@Distance = external dso_local local_unnamed_addr global ptr, align 8
@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@SubproblemsCompressed = external dso_local local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@SubproblemBorders = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @SolveSFCSubproblems() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %2 = tail call double @GetTime() #8
  %3 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %.not = icmp eq i32 %3, 0
  %4 = select i1 %.not, i32 2, i32 5
  %5 = tail call i64 @SFCTour(i32 noundef %4) #8
  %6 = load i32, ptr @Dimension, align 4, !tbaa !5
  %7 = add nsw i32 %6, 1
  %8 = sext i32 %7 to i64
  %9 = shl nsw i64 %8, 3
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #9
  %.not72 = icmp eq ptr %10, null
  br i1 %.not72, label %11, label %12

11:                                               ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.SolveSFCSubproblems) #10
  unreachable

12:                                               ; preds = %0
  %13 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %14, %12
  %.0 = phi ptr [ %13, %12 ], [ %16, %14 ]
  %15 = getelementptr inbounds i8, ptr %.0, i64 72
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load i32, ptr %.0, align 8, !tbaa !14
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds ptr, ptr %10, i64 %18
  store ptr %16, ptr %19, align 8, !tbaa !9
  %.not73 = icmp eq ptr %16, %13
  br i1 %.not73, label %20, label %14, !llvm.loop !15

20:                                               ; preds = %14
  tail call void @AllocateStructures() #8
  %21 = load i32, ptr @Dimension, align 4, !tbaa !5
  %22 = sitofp i32 %21 to double
  %23 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %24 = sitofp i32 %23 to double
  %25 = fdiv double %22, %24
  %26 = tail call double @llvm.ceil.f64(double %25)
  %27 = fptosi double %26 to i32
  %28 = tail call i32 @ReadPenalties() #8
  %29 = load ptr, ptr @NodeSet, align 8, !tbaa !9
  %30 = tail call i32 @Random() #8
  %31 = load i32, ptr @Dimension, align 4, !tbaa !5
  %32 = urem i32 %30, %31
  %33 = add nuw i32 %32, 1
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds %struct.Node, ptr %29, i64 %34
  store ptr %35, ptr @FirstNode, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %53, %20
  %37 = phi ptr [ %35, %20 ], [ %54, %53 ]
  %38 = phi i64 [ 0, %20 ], [ %56, %53 ]
  %.1 = phi ptr [ %35, %20 ], [ %55, %53 ]
  %39 = getelementptr inbounds i8, ptr %.1, i64 152
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %.1, i64 224
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = icmp eq ptr %40, %42
  br i1 %43, label %53, label %44

44:                                               ; preds = %36
  %45 = getelementptr inbounds i8, ptr %.1, i64 160
  %46 = load ptr, ptr %45, align 8, !tbaa !19
  %47 = icmp eq ptr %46, %42
  br i1 %47, label %53, label %48

48:                                               ; preds = %44
  %49 = load ptr, ptr @Distance, align 8, !tbaa !9
  %50 = tail call i32 %49(ptr noundef nonnull %.1, ptr noundef %42) #8
  %51 = sext i32 %50 to i64
  %52 = add nsw i64 %38, %51
  %.pre = load ptr, ptr %41, align 8, !tbaa !18
  %.pre101 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %48, %44, %36
  %54 = phi ptr [ %.pre101, %48 ], [ %37, %44 ], [ %37, %36 ]
  %55 = phi ptr [ %.pre, %48 ], [ %42, %44 ], [ %42, %36 ]
  %56 = phi i64 [ %52, %48 ], [ %38, %44 ], [ %38, %36 ]
  %57 = getelementptr inbounds i8, ptr %.1, i64 48
  store i32 0, ptr %57, align 8, !tbaa !20
  %.not74 = icmp eq ptr %55, %54
  br i1 %.not74, label %.preheader80, label %36, !llvm.loop !21

.preheader80:                                     ; preds = %53
  %.fr91 = freeze i32 %27
  store i64 %56, ptr %1, align 8, !tbaa !22
  %58 = icmp eq i32 %.fr91, 1
  %59 = icmp sgt i32 %.fr91, 1
  %60 = select i1 %59, i32 2, i32 1
  %.not7687 = icmp slt i32 %.fr91, 1
  %61 = load i32, ptr @TraceLevel, align 4
  %62 = icmp sgt i32 %61, 0
  br i1 %.not7687, label %.preheader80.split.us.split.us.preheader, label %.preheader80.split.preheader

.preheader80.split.us.split.us.preheader:         ; preds = %.preheader80
  br i1 %62, label %63, label %.loopexit.us.us.thread

63:                                               ; preds = %.preheader80.split.us.split.us.preheader
  %.not112 = icmp eq i32 %61, 1
  br i1 %.not112, label %.loopexit.us.us, label %64

64:                                               ; preds = %63
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #8
  %.pre107 = load i64, ptr %1, align 8, !tbaa !22
  br label %.loopexit.us.us

.loopexit.us.us:                                  ; preds = %63, %64
  %65 = phi i64 [ %.pre107, %64 ], [ %56, %63 ]
  %66 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %.not75.us.us = icmp eq i32 %66, 0
  %67 = select i1 %.not75.us.us, ptr @.str.5, ptr @.str.4
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, ptr noundef nonnull %67, i32 noundef 1, i32 noundef 1, i64 noundef %65) #8
  %.pr = load i32, ptr @TraceLevel, align 4
  store ptr %35, ptr @FirstNode, align 8, !tbaa !9
  %68 = icmp sgt i32 %.pr, 0
  br i1 %68, label %69, label %.loopexit.us.us.thread

69:                                               ; preds = %.loopexit.us.us
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #8
  %70 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %.not75.us.us.1 = icmp eq i32 %70, 0
  %71 = select i1 %.not75.us.us.1, ptr @.str.5, ptr @.str.4
  %72 = load i64, ptr %1, align 8, !tbaa !22
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, ptr noundef nonnull %71, i32 noundef 2, i32 noundef 1, i64 noundef %72) #8
  br label %.loopexit.us.us.thread

.loopexit.us.us.thread:                           ; preds = %.preheader80.split.us.split.us.preheader, %.loopexit.us.us, %69
  store ptr %35, ptr @FirstNode, align 8, !tbaa !9
  %73 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %74 = icmp sgt i32 %73, 1
  br i1 %74, label %.lr.ph.us.us.preheader.1, label %.split.us

.lr.ph.us.us.preheader.1:                         ; preds = %.loopexit.us.us.thread
  %75 = lshr i32 %73, 1
  br label %.lr.ph.us.us.1

.lr.ph.us.us.1:                                   ; preds = %.lr.ph.us.us.1, %.lr.ph.us.us.preheader.1
  %.06181.us.us.1 = phi i32 [ %81, %.lr.ph.us.us.1 ], [ %75, %.lr.ph.us.us.preheader.1 ]
  %76 = phi ptr [ %80, %.lr.ph.us.us.1 ], [ %35, %.lr.ph.us.us.preheader.1 ]
  %77 = load i32, ptr %76, align 8, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %10, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = add nsw i32 %.06181.us.us.1, -1
  %82 = icmp ugt i32 %.06181.us.us.1, 1
  br i1 %82, label %.lr.ph.us.us.1, label %..loopexit_crit_edge.us.us.1, !llvm.loop !24

..loopexit_crit_edge.us.us.1:                     ; preds = %.lr.ph.us.us.1
  store ptr %80, ptr @FirstNode, align 8, !tbaa !9
  br label %.split.us

.preheader80.split.preheader:                     ; preds = %.preheader80
  br i1 %62, label %83, label %.preheader.lr.ph

83:                                               ; preds = %.preheader80.split.preheader
  %.not111 = icmp eq i32 %61, 1
  br i1 %.not111, label %85, label %84

84:                                               ; preds = %83
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #8
  %.pre102 = load i64, ptr %1, align 8, !tbaa !22
  br label %85

85:                                               ; preds = %83, %84
  %86 = phi i64 [ %56, %83 ], [ %.pre102, %84 ]
  %87 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %.not75 = icmp eq i32 %87, 0
  %88 = select i1 %.not75, ptr @.str.5, ptr @.str.4
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, ptr noundef nonnull %88, i32 noundef 1, i32 noundef %60, i64 noundef %86) #8
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader80.split.preheader, %85
  store ptr %35, ptr @FirstNode, align 8, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %128
  %.283 = phi ptr [ %35, %.preheader.lr.ph ], [ %.2.lcssa, %128 ]
  %.05988 = phi i32 [ 1, %.preheader.lr.ph ], [ %129, %128 ]
  %89 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %.lr.ph86.preheader, label %._crit_edge

.lr.ph86.preheader:                               ; preds = %.preheader
  %xtraiter = and i32 %89, 3
  %91 = icmp ult i32 %89, 4
  br i1 %91, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph86.preheader.new

.lr.ph86.preheader.new:                           ; preds = %.lr.ph86.preheader
  %unroll_iter = and i32 %89, 2147483644
  br label %.lr.ph86

.lr.ph86:                                         ; preds = %.lr.ph86, %.lr.ph86.preheader.new
  %.285 = phi ptr [ %.283, %.lr.ph86.preheader.new ], [ %.2.3, %.lr.ph86 ]
  %niter = phi i32 [ 0, %.lr.ph86.preheader.new ], [ %niter.next.3, %.lr.ph86 ]
  %92 = getelementptr inbounds i8, ptr %.285, i64 48
  store i32 %.05988, ptr %92, align 8, !tbaa !20
  %93 = getelementptr inbounds i8, ptr %.285, i64 168
  %94 = getelementptr inbounds i8, ptr %.285, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %93, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %94, i8 0, i64 16, i1 false)
  %95 = load i32, ptr %.285, align 8, !tbaa !14
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds ptr, ptr %10, i64 %96
  %.2 = load ptr, ptr %97, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %.2, i64 48
  store i32 %.05988, ptr %98, align 8, !tbaa !20
  %99 = getelementptr inbounds i8, ptr %.2, i64 168
  %100 = getelementptr inbounds i8, ptr %.2, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %99, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %100, i8 0, i64 16, i1 false)
  %101 = load i32, ptr %.2, align 8, !tbaa !14
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %10, i64 %102
  %.2.1126 = load ptr, ptr %103, align 8, !tbaa !9
  %104 = getelementptr inbounds i8, ptr %.2.1126, i64 48
  store i32 %.05988, ptr %104, align 8, !tbaa !20
  %105 = getelementptr inbounds i8, ptr %.2.1126, i64 168
  %106 = getelementptr inbounds i8, ptr %.2.1126, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %105, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %106, i8 0, i64 16, i1 false)
  %107 = load i32, ptr %.2.1126, align 8, !tbaa !14
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %10, i64 %108
  %.2.2 = load ptr, ptr %109, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %.2.2, i64 48
  store i32 %.05988, ptr %110, align 8, !tbaa !20
  %111 = getelementptr inbounds i8, ptr %.2.2, i64 168
  %112 = getelementptr inbounds i8, ptr %.2.2, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %111, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %112, i8 0, i64 16, i1 false)
  %113 = load i32, ptr %.2.2, align 8, !tbaa !14
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %10, i64 %114
  %.2.3 = load ptr, ptr %115, align 8, !tbaa !9
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph86, !llvm.loop !25

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph86, %.lr.ph86.preheader
  %.2.lcssa121.ph = phi ptr [ poison, %.lr.ph86.preheader ], [ %.2.3, %.lr.ph86 ]
  %.285.unr = phi ptr [ %.283, %.lr.ph86.preheader ], [ %.2.3, %.lr.ph86 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph86.epil

.lr.ph86.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph86.epil
  %.285.epil = phi ptr [ %.2.epil, %.lr.ph86.epil ], [ %.285.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph86.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %116 = getelementptr inbounds i8, ptr %.285.epil, i64 48
  store i32 %.05988, ptr %116, align 8, !tbaa !20
  %117 = getelementptr inbounds i8, ptr %.285.epil, i64 168
  %118 = getelementptr inbounds i8, ptr %.285.epil, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %117, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %118, i8 0, i64 16, i1 false)
  %119 = load i32, ptr %.285.epil, align 8, !tbaa !14
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds ptr, ptr %10, i64 %120
  %.2.epil = load ptr, ptr %121, align 8, !tbaa !9
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph86.epil, !llvm.loop !26

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph86.epil, %.preheader
  %.2.lcssa = phi ptr [ %.283, %.preheader ], [ %.2.lcssa121.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.2.epil, %.lr.ph86.epil ]
  %122 = load i64, ptr %1, align 8, !tbaa !22
  %123 = call i32 @SolveSubproblem(i32 noundef %.05988, i32 noundef %.fr91, ptr noundef nonnull %1) #8
  %124 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not77 = icmp ne i32 %124, 0
  %125 = load i64, ptr %1, align 8
  %126 = icmp eq i64 %125, %122
  %or.cond79 = select i1 %.not77, i1 %126, i1 false
  br i1 %or.cond79, label %127, label %128

127:                                              ; preds = %._crit_edge
  call void @SolveCompressedSubproblem(i32 noundef %.05988, i32 noundef %.fr91, ptr noundef nonnull %1) #8
  br label %128

128:                                              ; preds = %127, %._crit_edge
  store ptr %.2.lcssa, ptr @FirstNode, align 8, !tbaa !9
  %129 = add nuw i32 %.05988, 1
  %exitcond98.not = icmp eq i32 %.05988, %.fr91
  br i1 %exitcond98.not, label %._crit_edge89, label %.preheader, !llvm.loop !28

._crit_edge89:                                    ; preds = %128
  br i1 %58, label %.split.us, label %130

130:                                              ; preds = %._crit_edge89
  %131 = load i32, ptr @TraceLevel, align 4
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %133, label %137

133:                                              ; preds = %130
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.2) #8
  %134 = load i32, ptr @SierpinskiPartitioning, align 4, !tbaa !5
  %.not75.1 = icmp eq i32 %134, 0
  %135 = select i1 %.not75.1, ptr @.str.5, ptr @.str.4
  %136 = load i64, ptr %1, align 8, !tbaa !22
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, ptr noundef nonnull %135, i32 noundef 2, i32 noundef %60, i64 noundef %136) #8
  br label %137

137:                                              ; preds = %130, %133
  store ptr %35, ptr @FirstNode, align 8, !tbaa !9
  %138 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %139 = icmp sgt i32 %138, 1
  br i1 %139, label %.lr.ph.preheader.1, label %.preheader.1.preheader

.lr.ph.preheader.1:                               ; preds = %137
  %140 = lshr i32 %138, 1
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %.06181.1 = phi i32 [ %146, %.lr.ph.1 ], [ %140, %.lr.ph.preheader.1 ]
  %141 = phi ptr [ %145, %.lr.ph.1 ], [ %35, %.lr.ph.preheader.1 ]
  %142 = load i32, ptr %141, align 8, !tbaa !14
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds ptr, ptr %10, i64 %143
  %145 = load ptr, ptr %144, align 8, !tbaa !9
  %146 = add nsw i32 %.06181.1, -1
  %147 = icmp ugt i32 %.06181.1, 1
  br i1 %147, label %.lr.ph.1, label %..loopexit_crit_edge.1, !llvm.loop !24

..loopexit_crit_edge.1:                           ; preds = %.lr.ph.1
  store ptr %145, ptr @FirstNode, align 8, !tbaa !9
  br label %.preheader.1.preheader

.preheader.1.preheader:                           ; preds = %..loopexit_crit_edge.1, %137
  %.283.1.ph = phi ptr [ %35, %137 ], [ %145, %..loopexit_crit_edge.1 ]
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.1.preheader, %188
  %.283.1 = phi ptr [ %.2.lcssa.1, %188 ], [ %.283.1.ph, %.preheader.1.preheader ]
  %.05988.1 = phi i32 [ %189, %188 ], [ 1, %.preheader.1.preheader ]
  %148 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %149 = icmp sgt i32 %148, 0
  %150 = add nsw i32 %.05988.1, %.fr91
  br i1 %149, label %.lr.ph86.1.preheader, label %._crit_edge.1

.lr.ph86.1.preheader:                             ; preds = %.preheader.1
  %xtraiter128 = and i32 %148, 3
  %151 = icmp ult i32 %148, 4
  br i1 %151, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph86.1.preheader.new

.lr.ph86.1.preheader.new:                         ; preds = %.lr.ph86.1.preheader
  %unroll_iter132 = and i32 %148, 2147483644
  br label %.lr.ph86.1

.lr.ph86.1:                                       ; preds = %.lr.ph86.1, %.lr.ph86.1.preheader.new
  %.285.1 = phi ptr [ %.283.1, %.lr.ph86.1.preheader.new ], [ %.2.1.3, %.lr.ph86.1 ]
  %niter133 = phi i32 [ 0, %.lr.ph86.1.preheader.new ], [ %niter133.next.3, %.lr.ph86.1 ]
  %152 = getelementptr inbounds i8, ptr %.285.1, i64 48
  store i32 %150, ptr %152, align 8, !tbaa !20
  %153 = getelementptr inbounds i8, ptr %.285.1, i64 168
  %154 = getelementptr inbounds i8, ptr %.285.1, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %153, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %154, i8 0, i64 16, i1 false)
  %155 = load i32, ptr %.285.1, align 8, !tbaa !14
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %10, i64 %156
  %.2.1 = load ptr, ptr %157, align 8, !tbaa !9
  %158 = getelementptr inbounds i8, ptr %.2.1, i64 48
  store i32 %150, ptr %158, align 8, !tbaa !20
  %159 = getelementptr inbounds i8, ptr %.2.1, i64 168
  %160 = getelementptr inbounds i8, ptr %.2.1, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %159, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %160, i8 0, i64 16, i1 false)
  %161 = load i32, ptr %.2.1, align 8, !tbaa !14
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds ptr, ptr %10, i64 %162
  %.2.1.1 = load ptr, ptr %163, align 8, !tbaa !9
  %164 = getelementptr inbounds i8, ptr %.2.1.1, i64 48
  store i32 %150, ptr %164, align 8, !tbaa !20
  %165 = getelementptr inbounds i8, ptr %.2.1.1, i64 168
  %166 = getelementptr inbounds i8, ptr %.2.1.1, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %165, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %166, i8 0, i64 16, i1 false)
  %167 = load i32, ptr %.2.1.1, align 8, !tbaa !14
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds ptr, ptr %10, i64 %168
  %.2.1.2 = load ptr, ptr %169, align 8, !tbaa !9
  %170 = getelementptr inbounds i8, ptr %.2.1.2, i64 48
  store i32 %150, ptr %170, align 8, !tbaa !20
  %171 = getelementptr inbounds i8, ptr %.2.1.2, i64 168
  %172 = getelementptr inbounds i8, ptr %.2.1.2, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %171, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %172, i8 0, i64 16, i1 false)
  %173 = load i32, ptr %.2.1.2, align 8, !tbaa !14
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %10, i64 %174
  %.2.1.3 = load ptr, ptr %175, align 8, !tbaa !9
  %niter133.next.3 = add i32 %niter133, 4
  %niter133.ncmp.3 = icmp eq i32 %niter133.next.3, %unroll_iter132
  br i1 %niter133.ncmp.3, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph86.1, !llvm.loop !25

._crit_edge.1.loopexit.unr-lcssa:                 ; preds = %.lr.ph86.1, %.lr.ph86.1.preheader
  %.2.1.lcssa.ph = phi ptr [ poison, %.lr.ph86.1.preheader ], [ %.2.1.3, %.lr.ph86.1 ]
  %.285.1.unr = phi ptr [ %.283.1, %.lr.ph86.1.preheader ], [ %.2.1.3, %.lr.ph86.1 ]
  %lcmp.mod130.not = icmp eq i32 %xtraiter128, 0
  br i1 %lcmp.mod130.not, label %._crit_edge.1, label %.lr.ph86.1.epil

.lr.ph86.1.epil:                                  ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.lr.ph86.1.epil
  %.285.1.epil = phi ptr [ %.2.1.epil, %.lr.ph86.1.epil ], [ %.285.1.unr, %._crit_edge.1.loopexit.unr-lcssa ]
  %epil.iter129 = phi i32 [ %epil.iter129.next, %.lr.ph86.1.epil ], [ 0, %._crit_edge.1.loopexit.unr-lcssa ]
  %176 = getelementptr inbounds i8, ptr %.285.1.epil, i64 48
  store i32 %150, ptr %176, align 8, !tbaa !20
  %177 = getelementptr inbounds i8, ptr %.285.1.epil, i64 168
  %178 = getelementptr inbounds i8, ptr %.285.1.epil, i64 232
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %177, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %178, i8 0, i64 16, i1 false)
  %179 = load i32, ptr %.285.1.epil, align 8, !tbaa !14
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds ptr, ptr %10, i64 %180
  %.2.1.epil = load ptr, ptr %181, align 8, !tbaa !9
  %epil.iter129.next = add i32 %epil.iter129, 1
  %epil.iter129.cmp.not = icmp eq i32 %epil.iter129.next, %xtraiter128
  br i1 %epil.iter129.cmp.not, label %._crit_edge.1, label %.lr.ph86.1.epil, !llvm.loop !29

._crit_edge.1:                                    ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.lr.ph86.1.epil, %.preheader.1
  %.2.lcssa.1 = phi ptr [ %.283.1, %.preheader.1 ], [ %.2.1.lcssa.ph, %._crit_edge.1.loopexit.unr-lcssa ], [ %.2.1.epil, %.lr.ph86.1.epil ]
  %182 = load i64, ptr %1, align 8, !tbaa !22
  %183 = call i32 @SolveSubproblem(i32 noundef %150, i32 noundef %.fr91, ptr noundef nonnull %1) #8
  %184 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not77.1 = icmp ne i32 %184, 0
  %185 = load i64, ptr %1, align 8
  %186 = icmp eq i64 %185, %182
  %or.cond79.1 = select i1 %.not77.1, i1 %186, i1 false
  br i1 %or.cond79.1, label %187, label %188

187:                                              ; preds = %._crit_edge.1
  call void @SolveCompressedSubproblem(i32 noundef %150, i32 noundef %.fr91, ptr noundef nonnull %1) #8
  br label %188

188:                                              ; preds = %187, %._crit_edge.1
  store ptr %.2.lcssa.1, ptr @FirstNode, align 8, !tbaa !9
  %189 = add nuw i32 %.05988.1, 1
  %exitcond98.1.not = icmp eq i32 %.05988.1, %.fr91
  br i1 %exitcond98.1.not, label %.split.us, label %.preheader.1, !llvm.loop !28

.split.us:                                        ; preds = %188, %._crit_edge89, %.loopexit.us.us.thread, %..loopexit_crit_edge.us.us.1
  call void @free(ptr noundef %10) #8
  %190 = load i64, ptr %1, align 8, !tbaa !22
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.6, i64 noundef %190) #8
  %191 = load i64, ptr @Optimum, align 8
  %192 = and i64 %191, 9223372036854775807
  %or.cond5.not = icmp eq i64 %192, 0
  br i1 %or.cond5.not, label %200, label %193

193:                                              ; preds = %.split.us
  %194 = load i64, ptr %1, align 8, !tbaa !22
  %195 = sub nsw i64 %194, %191
  %196 = sitofp i64 %195 to double
  %197 = fmul double %196, 1.000000e+02
  %198 = sitofp i64 %191 to double
  %199 = fdiv double %197, %198
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.7, double noundef %199) #8
  br label %200

200:                                              ; preds = %193, %.split.us
  %201 = call double @GetTime() #8
  %202 = fsub double %201, %2
  %203 = call double @llvm.fabs.f64(double %202)
  %204 = load i64, ptr %1, align 8, !tbaa !22
  %205 = load i64, ptr @Optimum, align 8, !tbaa !22
  %206 = icmp slt i64 %204, %205
  %207 = icmp eq i64 %204, %205
  %208 = select i1 %207, ptr @.str.10, ptr @.str.11
  %209 = select i1 %206, ptr @.str.9, ptr %208
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.8, double noundef %203, ptr noundef nonnull %209) #8
  %210 = load i32, ptr @SubproblemBorders, align 4, !tbaa !5
  %211 = icmp ne i32 %210, 0
  %or.cond7 = and i1 %211, %59
  br i1 %or.cond7, label %212, label %213

212:                                              ; preds = %200
  call void @SolveSubproblemBorderProblems(i32 noundef %.fr91, ptr noundef nonnull %1) #8
  br label %213

213:                                              ; preds = %212, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret void
}

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

declare double @GetTime() local_unnamed_addr #2

declare i64 @SFCTour(i32 noundef) local_unnamed_addr #2

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

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

declare void @AllocateStructures() local_unnamed_addr #2

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

declare i32 @ReadPenalties() local_unnamed_addr #2

declare i32 @Random() local_unnamed_addr #2

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

declare i32 @SolveSubproblem(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @SolveCompressedSubproblem(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @SolveSubproblemBorderProblems(i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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 = { mustprogress 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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { 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 72}
!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, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !10, i64 152}
!18 = !{!12, !10, i64 224}
!19 = !{!12, !10, i64 160}
!20 = !{!12, !6, i64 48}
!21 = distinct !{!21, !16}
!22 = !{!23, !23, i64 0}
!23 = !{!"long long", !7, i64 0}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !27}


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