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

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

@Dimension = external dso_local global i32, align 4
@SubproblemSize = external dso_local global i32, align 4
@NodeSet = external dso_local global ptr, align 8
@FirstNode = external dso_local global ptr, align 8
@Distance = external dso_local global ptr, align 8
@TraceLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@SubproblemsCompressed = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = 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 @SolveTourSegmentSubproblems() #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 double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %10 = call double @GetTime()
  store double %10, ptr %9, align 8, !tbaa !5
  call void @AllocateStructures()
  %11 = load i32, ptr @Dimension, align 4, !tbaa !9
  %12 = sitofp i32 %11 to double
  %13 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %14 = sitofp i32 %13 to double
  %15 = fdiv double %12, %14
  %16 = call double @llvm.ceil.f64(double %15)
  %17 = fptosi double %16 to i32
  store i32 %17, ptr %4, align 4, !tbaa !9
  %18 = call i32 @ReadPenalties()
  %19 = load ptr, ptr @NodeSet, align 8, !tbaa !11
  %20 = call i32 @Random()
  %21 = load i32, ptr @Dimension, align 4, !tbaa !9
  %22 = urem i32 %20, %21
  %23 = add i32 %22, 1
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds %struct.Node, ptr %19, i64 %24
  store ptr %25, ptr @FirstNode, align 8, !tbaa !11
  store i64 0, ptr %7, align 8, !tbaa !13
  %26 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %26, ptr %1, align 8, !tbaa !11
  store ptr %26, ptr %2, align 8, !tbaa !11
  br label %27

27:                                               ; preds = %56, %0
  %28 = load ptr, ptr %2, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.Node, ptr %28, i32 0, i32 26
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load ptr, ptr %2, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct.Node, ptr %31, i32 0, i32 35
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = icmp eq ptr %30, %33
  br i1 %34, label %53, label %35

35:                                               ; preds = %27
  %36 = load ptr, ptr %2, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.Node, ptr %36, i32 0, i32 27
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = load ptr, ptr %2, align 8, !tbaa !11
  %40 = getelementptr inbounds %struct.Node, ptr %39, i32 0, i32 35
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = icmp eq ptr %38, %41
  br i1 %42, label %53, label %43

43:                                               ; preds = %35
  %44 = load ptr, ptr @Distance, align 8, !tbaa !11
  %45 = load ptr, ptr %2, align 8, !tbaa !11
  %46 = load ptr, ptr %2, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.Node, ptr %46, i32 0, i32 35
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = call i32 %44(ptr noundef %45, ptr noundef %48)
  %50 = sext i32 %49 to i64
  %51 = load i64, ptr %7, align 8, !tbaa !13
  %52 = add nsw i64 %51, %50
  store i64 %52, ptr %7, align 8, !tbaa !13
  br label %53

53:                                               ; preds = %43, %35, %27
  %54 = load ptr, ptr %2, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.Node, ptr %54, i32 0, i32 12
  store i32 0, ptr %55, align 8, !tbaa !19
  br label %56

56:                                               ; preds = %53
  %57 = load ptr, ptr %2, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct.Node, ptr %57, i32 0, i32 35
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  store ptr %59, ptr %2, align 8, !tbaa !11
  %60 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %61 = icmp ne ptr %59, %60
  br i1 %61, label %27, label %62, !llvm.loop !20

62:                                               ; preds = %56
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %172, %62
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = icmp sle i32 %64, 2
  br i1 %65, label %66, label %175

66:                                               ; preds = %63
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = icmp eq i32 %67, 2
  br i1 %68, label %69, label %73

69:                                               ; preds = %66
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  br label %175

73:                                               ; preds = %69, %66
  %74 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %75 = icmp sge i32 %74, 1
  br i1 %75, label %76, label %90

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

79:                                               ; preds = %76
  %80 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %81 = icmp sge i32 %80, 2
  br i1 %81, label %82, label %83

82:                                               ; preds = %79, %76
  call void (ptr, ...) @printff(ptr noundef @.str)
  br label %83

83:                                               ; preds = %82, %79
  %84 = load i32, ptr %5, align 4, !tbaa !9
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = icmp sgt i32 %85, 1
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 2, i32 1
  %89 = load i64, ptr %7, align 8, !tbaa !13
  call void (ptr, ...) @printff(ptr noundef @.str.1, i32 noundef %84, i32 noundef %88, i64 noundef %89)
  br label %90

90:                                               ; preds = %83, %73
  %91 = load ptr, ptr %1, align 8, !tbaa !11
  store ptr %91, ptr @FirstNode, align 8, !tbaa !11
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = icmp eq i32 %92, 2
  br i1 %93, label %94, label %108

94:                                               ; preds = %90
  %95 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %96 = sdiv i32 %95, 2
  store i32 %96, ptr %6, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %104, %94
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %100, label %107

100:                                              ; preds = %97
  %101 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %102 = getelementptr inbounds %struct.Node, ptr %101, i32 0, i32 35
  %103 = load ptr, ptr %102, align 8, !tbaa !17
  store ptr %103, ptr @FirstNode, align 8, !tbaa !11
  br label %104

104:                                              ; preds = %100
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %6, align 4, !tbaa !9
  br label %97, !llvm.loop !22

107:                                              ; preds = %97
  br label %108

108:                                              ; preds = %107, %90
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %168, %108
  %110 = load i32, ptr %3, align 4, !tbaa !9
  %111 = load i32, ptr %4, align 4, !tbaa !9
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %113, label %171

113:                                              ; preds = %109
  store i32 0, ptr %6, align 4, !tbaa !9
  %114 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %114, ptr %2, align 8, !tbaa !11
  br label %115

115:                                              ; preds = %136, %113
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = load i32, ptr @SubproblemSize, align 4, !tbaa !9
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %119, label %142

119:                                              ; preds = %115
  %120 = load i32, ptr %5, align 4, !tbaa !9
  %121 = sub nsw i32 %120, 1
  %122 = load i32, ptr %4, align 4, !tbaa !9
  %123 = mul nsw i32 %121, %122
  %124 = load i32, ptr %3, align 4, !tbaa !9
  %125 = add nsw i32 %123, %124
  %126 = load ptr, ptr %2, align 8, !tbaa !11
  %127 = getelementptr inbounds %struct.Node, ptr %126, i32 0, i32 12
  store i32 %125, ptr %127, align 8, !tbaa !19
  %128 = load ptr, ptr %2, align 8, !tbaa !11
  %129 = getelementptr inbounds %struct.Node, ptr %128, i32 0, i32 29
  store ptr null, ptr %129, align 8, !tbaa !23
  %130 = load ptr, ptr %2, align 8, !tbaa !11
  %131 = getelementptr inbounds %struct.Node, ptr %130, i32 0, i32 28
  store ptr null, ptr %131, align 8, !tbaa !24
  %132 = load ptr, ptr %2, align 8, !tbaa !11
  %133 = getelementptr inbounds %struct.Node, ptr %132, i32 0, i32 37
  store ptr null, ptr %133, align 8, !tbaa !25
  %134 = load ptr, ptr %2, align 8, !tbaa !11
  %135 = getelementptr inbounds %struct.Node, ptr %134, i32 0, i32 36
  store ptr null, ptr %135, align 8, !tbaa !26
  br label %136

136:                                              ; preds = %119
  %137 = load i32, ptr %6, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %6, align 4, !tbaa !9
  %139 = load ptr, ptr %2, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct.Node, ptr %139, i32 0, i32 35
  %141 = load ptr, ptr %140, align 8, !tbaa !17
  store ptr %141, ptr %2, align 8, !tbaa !11
  br label %115, !llvm.loop !27

142:                                              ; preds = %115
  %143 = load i64, ptr %7, align 8, !tbaa !13
  store i64 %143, ptr %8, align 8, !tbaa !13
  %144 = load i32, ptr %5, align 4, !tbaa !9
  %145 = sub nsw i32 %144, 1
  %146 = load i32, ptr %4, align 4, !tbaa !9
  %147 = mul nsw i32 %145, %146
  %148 = load i32, ptr %3, align 4, !tbaa !9
  %149 = add nsw i32 %147, %148
  %150 = load i32, ptr %4, align 4, !tbaa !9
  %151 = call i32 @SolveSubproblem(i32 noundef %149, i32 noundef %150, ptr noundef %7)
  %152 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !9
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %166

154:                                              ; preds = %142
  %155 = load i64, ptr %7, align 8, !tbaa !13
  %156 = load i64, ptr %8, align 8, !tbaa !13
  %157 = icmp eq i64 %155, %156
  br i1 %157, label %158, label %166

158:                                              ; preds = %154
  %159 = load i32, ptr %5, align 4, !tbaa !9
  %160 = sub nsw i32 %159, 1
  %161 = load i32, ptr %4, align 4, !tbaa !9
  %162 = mul nsw i32 %160, %161
  %163 = load i32, ptr %3, align 4, !tbaa !9
  %164 = add nsw i32 %162, %163
  %165 = load i32, ptr %4, align 4, !tbaa !9
  call void @SolveCompressedSubproblem(i32 noundef %164, i32 noundef %165, ptr noundef %7)
  br label %166

166:                                              ; preds = %158, %154, %142
  %167 = load ptr, ptr %2, align 8, !tbaa !11
  store ptr %167, ptr @FirstNode, align 8, !tbaa !11
  br label %168

168:                                              ; preds = %166
  %169 = load i32, ptr %3, align 4, !tbaa !9
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %3, align 4, !tbaa !9
  br label %109, !llvm.loop !28

171:                                              ; preds = %109
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %5, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %5, align 4, !tbaa !9
  br label %63, !llvm.loop !29

175:                                              ; preds = %72, %63
  %176 = load i64, ptr %7, align 8, !tbaa !13
  call void (ptr, ...) @printff(ptr noundef @.str.2, i64 noundef %176)
  %177 = load i64, ptr @Optimum, align 8, !tbaa !13
  %178 = icmp ne i64 %177, -9223372036854775808
  br i1 %178, label %179, label %191

179:                                              ; preds = %175
  %180 = load i64, ptr @Optimum, align 8, !tbaa !13
  %181 = icmp ne i64 %180, 0
  br i1 %181, label %182, label %191

182:                                              ; preds = %179
  %183 = load i64, ptr %7, align 8, !tbaa !13
  %184 = load i64, ptr @Optimum, align 8, !tbaa !13
  %185 = sub nsw i64 %183, %184
  %186 = sitofp i64 %185 to double
  %187 = fmul double 1.000000e+02, %186
  %188 = load i64, ptr @Optimum, align 8, !tbaa !13
  %189 = sitofp i64 %188 to double
  %190 = fdiv double %187, %189
  call void (ptr, ...) @printff(ptr noundef @.str.3, double noundef %190)
  br label %191

191:                                              ; preds = %182, %179, %175
  %192 = call double @GetTime()
  %193 = load double, ptr %9, align 8, !tbaa !5
  %194 = fsub double %192, %193
  %195 = call double @llvm.fabs.f64(double %194)
  %196 = load i64, ptr %7, align 8, !tbaa !13
  %197 = load i64, ptr @Optimum, align 8, !tbaa !13
  %198 = icmp slt i64 %196, %197
  br i1 %198, label %199, label %200

199:                                              ; preds = %191
  br label %206

200:                                              ; preds = %191
  %201 = load i64, ptr %7, align 8, !tbaa !13
  %202 = load i64, ptr @Optimum, align 8, !tbaa !13
  %203 = icmp eq i64 %201, %202
  %204 = zext i1 %203 to i64
  %205 = select i1 %203, ptr @.str.6, ptr @.str.7
  br label %206

206:                                              ; preds = %200, %199
  %207 = phi ptr [ @.str.5, %199 ], [ %205, %200 ]
  call void (ptr, ...) @printff(ptr noundef @.str.4, double noundef %195, ptr noundef %207)
  %208 = load i32, ptr @SubproblemBorders, align 4, !tbaa !9
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %215

210:                                              ; preds = %206
  %211 = load i32, ptr %4, align 4, !tbaa !9
  %212 = icmp sgt i32 %211, 1
  br i1 %212, label %213, label %215

213:                                              ; preds = %210
  %214 = load i32, ptr %4, align 4, !tbaa !9
  call void @SolveSubproblemBorderProblems(i32 noundef %214, ptr noundef %7)
  br label %215

215:                                              ; preds = %213, %210, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

declare double @GetTime() #2

declare void @AllocateStructures() #2

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

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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !12, i64 152}
!16 = !{!"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}
!17 = !{!16, !12, i64 224}
!18 = !{!16, !12, i64 160}
!19 = !{!16, !10, i64 48}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!16, !12, i64 176}
!24 = !{!16, !12, i64 168}
!25 = !{!16, !12, i64 240}
!26 = !{!16, !12, i64 232}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !21}


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

@Dimension = external dso_local local_unnamed_addr global i32, align 4
@SubproblemSize = external dso_local local_unnamed_addr global i32, align 4
@NodeSet = external dso_local local_unnamed_addr global ptr, align 8
@FirstNode = 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 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@SubproblemsCompressed = external dso_local local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = 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 @SolveTourSegmentSubproblems() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %2 = tail call double @GetTime() #5
  tail call void @AllocateStructures() #5
  %3 = load i32, ptr @Dimension, align 4, !tbaa !5
  %4 = sitofp i32 %3 to double
  %5 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %6 = sitofp i32 %5 to double
  %7 = fdiv double %4, %6
  %8 = tail call double @llvm.ceil.f64(double %7)
  %9 = fptosi double %8 to i32
  %10 = tail call i32 @ReadPenalties() #5
  %11 = load ptr, ptr @NodeSet, align 8, !tbaa !9
  %12 = tail call i32 @Random() #5
  %13 = load i32, ptr @Dimension, align 4, !tbaa !5
  %14 = urem i32 %12, %13
  %15 = add nuw i32 %14, 1
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds %struct.Node, ptr %11, i64 %16
  store ptr %17, ptr @FirstNode, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %35, %0
  %19 = phi ptr [ %17, %0 ], [ %36, %35 ]
  %20 = phi i64 [ 0, %0 ], [ %38, %35 ]
  %.0 = phi ptr [ %17, %0 ], [ %37, %35 ]
  %21 = getelementptr inbounds i8, ptr %.0, i64 152
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %.0, i64 224
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = icmp eq ptr %22, %24
  br i1 %25, label %35, label %26

26:                                               ; preds = %18
  %27 = getelementptr inbounds i8, ptr %.0, i64 160
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = icmp eq ptr %28, %24
  br i1 %29, label %35, label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr @Distance, align 8, !tbaa !9
  %32 = tail call i32 %31(ptr noundef nonnull %.0, ptr noundef %24) #5
  %33 = sext i32 %32 to i64
  %34 = add nsw i64 %20, %33
  %.pre = load ptr, ptr %23, align 8, !tbaa !14
  %.pre89 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %30, %26, %18
  %36 = phi ptr [ %.pre89, %30 ], [ %19, %26 ], [ %19, %18 ]
  %37 = phi ptr [ %.pre, %30 ], [ %24, %26 ], [ %24, %18 ]
  %38 = phi i64 [ %34, %30 ], [ %20, %26 ], [ %20, %18 ]
  %39 = getelementptr inbounds i8, ptr %.0, i64 48
  store i32 0, ptr %39, align 8, !tbaa !16
  %.not = icmp eq ptr %37, %36
  br i1 %.not, label %.preheader68, label %18, !llvm.loop !17

.preheader68:                                     ; preds = %35
  %.fr79 = freeze i32 %9
  store i64 %38, ptr %1, align 8, !tbaa !19
  %40 = icmp eq i32 %.fr79, 1
  %41 = icmp sgt i32 %.fr79, 1
  %42 = select i1 %41, i32 2, i32 1
  %.not6475 = icmp slt i32 %.fr79, 1
  %43 = load i32, ptr @TraceLevel, align 4
  %44 = icmp sgt i32 %43, 0
  br i1 %.not6475, label %.preheader68.split.us.split.us.preheader, label %.preheader68.split.preheader

.preheader68.split.us.split.us.preheader:         ; preds = %.preheader68
  br i1 %44, label %45, label %.loopexit.us.us.thread

45:                                               ; preds = %.preheader68.split.us.split.us.preheader
  %.not100 = icmp eq i32 %43, 1
  br i1 %.not100, label %.loopexit.us.us, label %46

46:                                               ; preds = %45
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #5
  %.pre95 = load i64, ptr %1, align 8, !tbaa !19
  br label %.loopexit.us.us

.loopexit.us.us:                                  ; preds = %45, %46
  %47 = phi i64 [ %.pre95, %46 ], [ %38, %45 ]
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, i32 noundef 1, i32 noundef 1, i64 noundef %47) #5
  %.pr = load i32, ptr @TraceLevel, align 4
  store ptr %17, ptr @FirstNode, align 8, !tbaa !9
  %48 = icmp sgt i32 %.pr, 0
  br i1 %48, label %49, label %.loopexit.us.us.thread

49:                                               ; preds = %.loopexit.us.us
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #5
  %50 = load i64, ptr %1, align 8, !tbaa !19
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, i32 noundef 2, i32 noundef 1, i64 noundef %50) #5
  br label %.loopexit.us.us.thread

.loopexit.us.us.thread:                           ; preds = %.preheader68.split.us.split.us.preheader, %.loopexit.us.us, %49
  store ptr %17, ptr @FirstNode, align 8, !tbaa !9
  %51 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 1
  br i1 %52, label %.lr.ph.us.us.preheader.1, label %.split.us

.lr.ph.us.us.preheader.1:                         ; preds = %.loopexit.us.us.thread
  %53 = lshr i32 %51, 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
  %.05369.us.us.1 = phi i32 [ %57, %.lr.ph.us.us.1 ], [ %53, %.lr.ph.us.us.preheader.1 ]
  %54 = phi ptr [ %56, %.lr.ph.us.us.1 ], [ %17, %.lr.ph.us.us.preheader.1 ]
  %55 = getelementptr inbounds i8, ptr %54, i64 224
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = add nsw i32 %.05369.us.us.1, -1
  %58 = icmp ugt i32 %.05369.us.us.1, 1
  br i1 %58, label %.lr.ph.us.us.1, label %..loopexit_crit_edge.us.us.1, !llvm.loop !21

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

.preheader68.split.preheader:                     ; preds = %.preheader68
  br i1 %44, label %59, label %.preheader.lr.ph

59:                                               ; preds = %.preheader68.split.preheader
  %.not99 = icmp eq i32 %43, 1
  br i1 %.not99, label %61, label %60

60:                                               ; preds = %59
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #5
  %.pre90 = load i64, ptr %1, align 8, !tbaa !19
  br label %61

61:                                               ; preds = %59, %60
  %62 = phi i64 [ %38, %59 ], [ %.pre90, %60 ]
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, i32 noundef 1, i32 noundef %42, i64 noundef %62) #5
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader68.split.preheader, %61
  store ptr %17, ptr @FirstNode, align 8, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %92
  %.171 = phi ptr [ %17, %.preheader.lr.ph ], [ %.1.lcssa, %92 ]
  %.05276 = phi i32 [ 1, %.preheader.lr.ph ], [ %93, %92 ]
  %63 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph74.preheader, label %._crit_edge

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

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

.lr.ph74:                                         ; preds = %.lr.ph74, %.lr.ph74.preheader.new
  %.173 = phi ptr [ %.171, %.lr.ph74.preheader.new ], [ %.1.3, %.lr.ph74 ]
  %niter = phi i32 [ 0, %.lr.ph74.preheader.new ], [ %niter.next.3, %.lr.ph74 ]
  %66 = getelementptr inbounds i8, ptr %.173, i64 48
  store i32 %.05276, ptr %66, align 8, !tbaa !16
  %67 = getelementptr inbounds i8, ptr %.173, i64 168
  %68 = getelementptr inbounds i8, ptr %.173, i64 232
  %69 = getelementptr inbounds i8, ptr %.173, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %67, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %68, i8 0, i64 16, i1 false)
  %.1 = load ptr, ptr %69, align 8, !tbaa !9
  %70 = getelementptr inbounds i8, ptr %.1, i64 48
  store i32 %.05276, ptr %70, align 8, !tbaa !16
  %71 = getelementptr inbounds i8, ptr %.1, i64 168
  %72 = getelementptr inbounds i8, ptr %.1, i64 232
  %73 = getelementptr inbounds i8, ptr %.1, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %71, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %72, i8 0, i64 16, i1 false)
  %.1.1114 = load ptr, ptr %73, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %.1.1114, i64 48
  store i32 %.05276, ptr %74, align 8, !tbaa !16
  %75 = getelementptr inbounds i8, ptr %.1.1114, i64 168
  %76 = getelementptr inbounds i8, ptr %.1.1114, i64 232
  %77 = getelementptr inbounds i8, ptr %.1.1114, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %75, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %76, i8 0, i64 16, i1 false)
  %.1.2 = load ptr, ptr %77, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %.1.2, i64 48
  store i32 %.05276, ptr %78, align 8, !tbaa !16
  %79 = getelementptr inbounds i8, ptr %.1.2, i64 168
  %80 = getelementptr inbounds i8, ptr %.1.2, i64 232
  %81 = getelementptr inbounds i8, ptr %.1.2, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %79, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %80, i8 0, i64 16, i1 false)
  %.1.3 = load ptr, ptr %81, 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.ph74, !llvm.loop !22

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph74, %.lr.ph74.preheader
  %.1.lcssa109.ph = phi ptr [ poison, %.lr.ph74.preheader ], [ %.1.3, %.lr.ph74 ]
  %.173.unr = phi ptr [ %.171, %.lr.ph74.preheader ], [ %.1.3, %.lr.ph74 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph74.epil

.lr.ph74.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph74.epil
  %.173.epil = phi ptr [ %.1.epil, %.lr.ph74.epil ], [ %.173.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph74.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %82 = getelementptr inbounds i8, ptr %.173.epil, i64 48
  store i32 %.05276, ptr %82, align 8, !tbaa !16
  %83 = getelementptr inbounds i8, ptr %.173.epil, i64 168
  %84 = getelementptr inbounds i8, ptr %.173.epil, i64 232
  %85 = getelementptr inbounds i8, ptr %.173.epil, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %83, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %84, i8 0, i64 16, i1 false)
  %.1.epil = load ptr, ptr %85, 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.ph74.epil, !llvm.loop !23

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph74.epil, %.preheader
  %.1.lcssa = phi ptr [ %.171, %.preheader ], [ %.1.lcssa109.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.1.epil, %.lr.ph74.epil ]
  %86 = load i64, ptr %1, align 8, !tbaa !19
  %87 = call i32 @SolveSubproblem(i32 noundef %.05276, i32 noundef %.fr79, ptr noundef nonnull %1) #5
  %88 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not65 = icmp ne i32 %88, 0
  %89 = load i64, ptr %1, align 8
  %90 = icmp eq i64 %89, %86
  %or.cond67 = select i1 %.not65, i1 %90, i1 false
  br i1 %or.cond67, label %91, label %92

91:                                               ; preds = %._crit_edge
  call void @SolveCompressedSubproblem(i32 noundef %.05276, i32 noundef %.fr79, ptr noundef nonnull %1) #5
  br label %92

92:                                               ; preds = %91, %._crit_edge
  store ptr %.1.lcssa, ptr @FirstNode, align 8, !tbaa !9
  %93 = add nuw i32 %.05276, 1
  %exitcond86.not = icmp eq i32 %.05276, %.fr79
  br i1 %exitcond86.not, label %._crit_edge77, label %.preheader, !llvm.loop !25

._crit_edge77:                                    ; preds = %92
  br i1 %40, label %.split.us, label %94

94:                                               ; preds = %._crit_edge77
  %95 = load i32, ptr @TraceLevel, align 4
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %97, label %99

97:                                               ; preds = %94
  call void (ptr, ...) @printff(ptr noundef nonnull @.str) #5
  %98 = load i64, ptr %1, align 8, !tbaa !19
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, i32 noundef 2, i32 noundef %42, i64 noundef %98) #5
  br label %99

99:                                               ; preds = %94, %97
  store ptr %17, ptr @FirstNode, align 8, !tbaa !9
  %100 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, 1
  br i1 %101, label %.lr.ph.preheader.1, label %.preheader.1.preheader

.lr.ph.preheader.1:                               ; preds = %99
  %102 = lshr i32 %100, 1
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %.05369.1 = phi i32 [ %106, %.lr.ph.1 ], [ %102, %.lr.ph.preheader.1 ]
  %103 = phi ptr [ %105, %.lr.ph.1 ], [ %17, %.lr.ph.preheader.1 ]
  %104 = getelementptr inbounds i8, ptr %103, i64 224
  %105 = load ptr, ptr %104, align 8, !tbaa !14
  %106 = add nsw i32 %.05369.1, -1
  %107 = icmp ugt i32 %.05369.1, 1
  br i1 %107, label %.lr.ph.1, label %..loopexit_crit_edge.1, !llvm.loop !21

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

.preheader.1.preheader:                           ; preds = %..loopexit_crit_edge.1, %99
  %.171.1.ph = phi ptr [ %17, %99 ], [ %105, %..loopexit_crit_edge.1 ]
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.1.preheader, %138
  %.171.1 = phi ptr [ %.1.lcssa.1, %138 ], [ %.171.1.ph, %.preheader.1.preheader ]
  %.05276.1 = phi i32 [ %139, %138 ], [ 1, %.preheader.1.preheader ]
  %108 = load i32, ptr @SubproblemSize, align 4, !tbaa !5
  %109 = icmp sgt i32 %108, 0
  %110 = add nsw i32 %.05276.1, %.fr79
  br i1 %109, label %.lr.ph74.1.preheader, label %._crit_edge.1

.lr.ph74.1.preheader:                             ; preds = %.preheader.1
  %xtraiter116 = and i32 %108, 3
  %111 = icmp ult i32 %108, 4
  br i1 %111, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph74.1.preheader.new

.lr.ph74.1.preheader.new:                         ; preds = %.lr.ph74.1.preheader
  %unroll_iter120 = and i32 %108, 2147483644
  br label %.lr.ph74.1

.lr.ph74.1:                                       ; preds = %.lr.ph74.1, %.lr.ph74.1.preheader.new
  %.173.1 = phi ptr [ %.171.1, %.lr.ph74.1.preheader.new ], [ %.1.1.3, %.lr.ph74.1 ]
  %niter121 = phi i32 [ 0, %.lr.ph74.1.preheader.new ], [ %niter121.next.3, %.lr.ph74.1 ]
  %112 = getelementptr inbounds i8, ptr %.173.1, i64 48
  store i32 %110, ptr %112, align 8, !tbaa !16
  %113 = getelementptr inbounds i8, ptr %.173.1, i64 168
  %114 = getelementptr inbounds i8, ptr %.173.1, i64 232
  %115 = getelementptr inbounds i8, ptr %.173.1, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %113, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %114, i8 0, i64 16, i1 false)
  %.1.1 = load ptr, ptr %115, align 8, !tbaa !9
  %116 = getelementptr inbounds i8, ptr %.1.1, i64 48
  store i32 %110, ptr %116, align 8, !tbaa !16
  %117 = getelementptr inbounds i8, ptr %.1.1, i64 168
  %118 = getelementptr inbounds i8, ptr %.1.1, i64 232
  %119 = getelementptr inbounds i8, ptr %.1.1, i64 224
  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)
  %.1.1.1 = load ptr, ptr %119, align 8, !tbaa !9
  %120 = getelementptr inbounds i8, ptr %.1.1.1, i64 48
  store i32 %110, ptr %120, align 8, !tbaa !16
  %121 = getelementptr inbounds i8, ptr %.1.1.1, i64 168
  %122 = getelementptr inbounds i8, ptr %.1.1.1, i64 232
  %123 = getelementptr inbounds i8, ptr %.1.1.1, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %121, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %122, i8 0, i64 16, i1 false)
  %.1.1.2 = load ptr, ptr %123, align 8, !tbaa !9
  %124 = getelementptr inbounds i8, ptr %.1.1.2, i64 48
  store i32 %110, ptr %124, align 8, !tbaa !16
  %125 = getelementptr inbounds i8, ptr %.1.1.2, i64 168
  %126 = getelementptr inbounds i8, ptr %.1.1.2, i64 232
  %127 = getelementptr inbounds i8, ptr %.1.1.2, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %125, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %126, i8 0, i64 16, i1 false)
  %.1.1.3 = load ptr, ptr %127, align 8, !tbaa !9
  %niter121.next.3 = add i32 %niter121, 4
  %niter121.ncmp.3 = icmp eq i32 %niter121.next.3, %unroll_iter120
  br i1 %niter121.ncmp.3, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph74.1, !llvm.loop !22

._crit_edge.1.loopexit.unr-lcssa:                 ; preds = %.lr.ph74.1, %.lr.ph74.1.preheader
  %.1.1.lcssa.ph = phi ptr [ poison, %.lr.ph74.1.preheader ], [ %.1.1.3, %.lr.ph74.1 ]
  %.173.1.unr = phi ptr [ %.171.1, %.lr.ph74.1.preheader ], [ %.1.1.3, %.lr.ph74.1 ]
  %lcmp.mod118.not = icmp eq i32 %xtraiter116, 0
  br i1 %lcmp.mod118.not, label %._crit_edge.1, label %.lr.ph74.1.epil

.lr.ph74.1.epil:                                  ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.lr.ph74.1.epil
  %.173.1.epil = phi ptr [ %.1.1.epil, %.lr.ph74.1.epil ], [ %.173.1.unr, %._crit_edge.1.loopexit.unr-lcssa ]
  %epil.iter117 = phi i32 [ %epil.iter117.next, %.lr.ph74.1.epil ], [ 0, %._crit_edge.1.loopexit.unr-lcssa ]
  %128 = getelementptr inbounds i8, ptr %.173.1.epil, i64 48
  store i32 %110, ptr %128, align 8, !tbaa !16
  %129 = getelementptr inbounds i8, ptr %.173.1.epil, i64 168
  %130 = getelementptr inbounds i8, ptr %.173.1.epil, i64 232
  %131 = getelementptr inbounds i8, ptr %.173.1.epil, i64 224
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %129, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %130, i8 0, i64 16, i1 false)
  %.1.1.epil = load ptr, ptr %131, align 8, !tbaa !9
  %epil.iter117.next = add i32 %epil.iter117, 1
  %epil.iter117.cmp.not = icmp eq i32 %epil.iter117.next, %xtraiter116
  br i1 %epil.iter117.cmp.not, label %._crit_edge.1, label %.lr.ph74.1.epil, !llvm.loop !26

._crit_edge.1:                                    ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.lr.ph74.1.epil, %.preheader.1
  %.1.lcssa.1 = phi ptr [ %.171.1, %.preheader.1 ], [ %.1.1.lcssa.ph, %._crit_edge.1.loopexit.unr-lcssa ], [ %.1.1.epil, %.lr.ph74.1.epil ]
  %132 = load i64, ptr %1, align 8, !tbaa !19
  %133 = call i32 @SolveSubproblem(i32 noundef %110, i32 noundef %.fr79, ptr noundef nonnull %1) #5
  %134 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not65.1 = icmp ne i32 %134, 0
  %135 = load i64, ptr %1, align 8
  %136 = icmp eq i64 %135, %132
  %or.cond67.1 = select i1 %.not65.1, i1 %136, i1 false
  br i1 %or.cond67.1, label %137, label %138

137:                                              ; preds = %._crit_edge.1
  call void @SolveCompressedSubproblem(i32 noundef %110, i32 noundef %.fr79, ptr noundef nonnull %1) #5
  br label %138

138:                                              ; preds = %137, %._crit_edge.1
  store ptr %.1.lcssa.1, ptr @FirstNode, align 8, !tbaa !9
  %139 = add nuw i32 %.05276.1, 1
  %exitcond86.1.not = icmp eq i32 %.05276.1, %.fr79
  br i1 %exitcond86.1.not, label %.split.us, label %.preheader.1, !llvm.loop !25

.split.us:                                        ; preds = %138, %._crit_edge77, %.loopexit.us.us.thread, %..loopexit_crit_edge.us.us.1
  %140 = load i64, ptr %1, align 8, !tbaa !19
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.2, i64 noundef %140) #5
  %141 = load i64, ptr @Optimum, align 8
  %142 = and i64 %141, 9223372036854775807
  %or.cond5.not = icmp eq i64 %142, 0
  br i1 %or.cond5.not, label %150, label %143

143:                                              ; preds = %.split.us
  %144 = load i64, ptr %1, align 8, !tbaa !19
  %145 = sub nsw i64 %144, %141
  %146 = sitofp i64 %145 to double
  %147 = fmul double %146, 1.000000e+02
  %148 = sitofp i64 %141 to double
  %149 = fdiv double %147, %148
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, double noundef %149) #5
  br label %150

150:                                              ; preds = %143, %.split.us
  %151 = call double @GetTime() #5
  %152 = fsub double %151, %2
  %153 = call double @llvm.fabs.f64(double %152)
  %154 = load i64, ptr %1, align 8, !tbaa !19
  %155 = load i64, ptr @Optimum, align 8, !tbaa !19
  %156 = icmp slt i64 %154, %155
  %157 = icmp eq i64 %154, %155
  %158 = select i1 %157, ptr @.str.6, ptr @.str.7
  %159 = select i1 %156, ptr @.str.5, ptr %158
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, double noundef %153, ptr noundef nonnull %159) #5
  %160 = load i32, ptr @SubproblemBorders, align 4, !tbaa !5
  %161 = icmp ne i32 %160, 0
  %or.cond7 = and i1 %161, %41
  br i1 %or.cond7, label %162, label %163

162:                                              ; preds = %150
  call void @SolveSubproblemBorderProblems(i32 noundef %.fr79, ptr noundef nonnull %1) #5
  br label %163

163:                                              ; preds = %162, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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 void @AllocateStructures() local_unnamed_addr #2

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

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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

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) #4

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


; 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