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

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

@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 [44 x i8], align 1
@Dimension = external dso_local global i32, align 4
@SubproblemSize = external dso_local global i32, align 4
@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 @SolveKMeansSubproblems() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %7 = call double @GetTime()
  store double %7, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @AllocateStructures()
  %8 = call i32 @ReadPenalties()
  store i64 0, ptr %2, align 8, !tbaa !9
  %9 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  store ptr %9, ptr %1, align 8, !tbaa !11
  br label %10

10:                                               ; preds = %39, %0
  %11 = load ptr, ptr %1, align 8, !tbaa !11
  %12 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 26
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %1, align 8, !tbaa !11
  %15 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 35
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = icmp eq ptr %13, %16
  br i1 %17, label %36, label %18

18:                                               ; preds = %10
  %19 = load ptr, ptr %1, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct.Node, ptr %19, i32 0, i32 27
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = load ptr, ptr %1, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 35
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp eq ptr %21, %24
  br i1 %25, label %36, label %26

26:                                               ; preds = %18
  %27 = load ptr, ptr @Distance, align 8, !tbaa !11
  %28 = load ptr, ptr %1, align 8, !tbaa !11
  %29 = load ptr, ptr %1, align 8, !tbaa !11
  %30 = getelementptr inbounds %struct.Node, ptr %29, i32 0, i32 35
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = call i32 %27(ptr noundef %28, ptr noundef %31)
  %33 = sext i32 %32 to i64
  %34 = load i64, ptr %2, align 8, !tbaa !9
  %35 = add nsw i64 %34, %33
  store i64 %35, ptr %2, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %26, %18, %10
  %37 = load ptr, ptr %1, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.Node, ptr %37, i32 0, i32 12
  store i32 0, ptr %38, align 8, !tbaa !18
  br label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr %1, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.Node, ptr %40, i32 0, i32 35
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  store ptr %42, ptr %1, align 8, !tbaa !11
  %43 = load ptr, ptr @FirstNode, align 8, !tbaa !11
  %44 = icmp ne ptr %42, %43
  br i1 %44, label %10, label %45, !llvm.loop !19

45:                                               ; preds = %39
  %46 = load i32, ptr @TraceLevel, align 4, !tbaa !21
  %47 = icmp sge i32 %46, 1
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  %49 = load i32, ptr @TraceLevel, align 4, !tbaa !21
  %50 = icmp sge i32 %49, 2
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  call void (ptr, ...) @printff(ptr noundef @.str)
  br label %52

52:                                               ; preds = %51, %48
  %53 = load i64, ptr %2, align 8, !tbaa !9
  call void (ptr, ...) @printff(ptr noundef @.str.1, i64 noundef %53)
  br label %54

54:                                               ; preds = %52, %45
  %55 = load i32, ptr @Dimension, align 4, !tbaa !21
  %56 = sitofp i32 %55 to double
  %57 = load i32, ptr @SubproblemSize, align 4, !tbaa !21
  %58 = sitofp i32 %57 to double
  %59 = fdiv double %56, %58
  %60 = call double @llvm.ceil.f64(double %59)
  %61 = fptosi double %60 to i32
  store i32 %61, ptr %6, align 4, !tbaa !21
  %62 = load i32, ptr %6, align 4, !tbaa !21
  call void @KMeansClustering(i32 noundef %62)
  store i32 1, ptr %5, align 4, !tbaa !21
  br label %63

63:                                               ; preds = %82, %54
  %64 = load i32, ptr %5, align 4, !tbaa !21
  %65 = load i32, ptr %6, align 4, !tbaa !21
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %67, label %85

67:                                               ; preds = %63
  %68 = load i64, ptr %2, align 8, !tbaa !9
  store i64 %68, ptr %3, align 8, !tbaa !9
  %69 = load i32, ptr %5, align 4, !tbaa !21
  %70 = load i32, ptr %6, align 4, !tbaa !21
  %71 = call i32 @SolveSubproblem(i32 noundef %69, i32 noundef %70, ptr noundef %2)
  %72 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !21
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %81

74:                                               ; preds = %67
  %75 = load i64, ptr %2, align 8, !tbaa !9
  %76 = load i64, ptr %3, align 8, !tbaa !9
  %77 = icmp eq i64 %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = load i32, ptr %5, align 4, !tbaa !21
  %80 = load i32, ptr %6, align 4, !tbaa !21
  call void @SolveCompressedSubproblem(i32 noundef %79, i32 noundef %80, ptr noundef %2)
  br label %81

81:                                               ; preds = %78, %74, %67
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %5, align 4, !tbaa !21
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !21
  br label %63, !llvm.loop !22

85:                                               ; preds = %63
  %86 = load i64, ptr %2, align 8, !tbaa !9
  call void (ptr, ...) @printff(ptr noundef @.str.2, i64 noundef %86)
  %87 = load i64, ptr @Optimum, align 8, !tbaa !9
  %88 = icmp ne i64 %87, -9223372036854775808
  br i1 %88, label %89, label %101

89:                                               ; preds = %85
  %90 = load i64, ptr @Optimum, align 8, !tbaa !9
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %92, label %101

92:                                               ; preds = %89
  %93 = load i64, ptr %2, align 8, !tbaa !9
  %94 = load i64, ptr @Optimum, align 8, !tbaa !9
  %95 = sub nsw i64 %93, %94
  %96 = sitofp i64 %95 to double
  %97 = fmul double 1.000000e+02, %96
  %98 = load i64, ptr @Optimum, align 8, !tbaa !9
  %99 = sitofp i64 %98 to double
  %100 = fdiv double %97, %99
  call void (ptr, ...) @printff(ptr noundef @.str.3, double noundef %100)
  br label %101

101:                                              ; preds = %92, %89, %85
  %102 = call double @GetTime()
  %103 = load double, ptr %4, align 8, !tbaa !5
  %104 = fsub double %102, %103
  %105 = call double @llvm.fabs.f64(double %104)
  %106 = load i64, ptr %2, align 8, !tbaa !9
  %107 = load i64, ptr @Optimum, align 8, !tbaa !9
  %108 = icmp slt i64 %106, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %101
  br label %116

110:                                              ; preds = %101
  %111 = load i64, ptr %2, align 8, !tbaa !9
  %112 = load i64, ptr @Optimum, align 8, !tbaa !9
  %113 = icmp eq i64 %111, %112
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, ptr @.str.6, ptr @.str.7
  br label %116

116:                                              ; preds = %110, %109
  %117 = phi ptr [ @.str.5, %109 ], [ %115, %110 ]
  call void (ptr, ...) @printff(ptr noundef @.str.4, double noundef %105, ptr noundef %117)
  %118 = load i32, ptr @SubproblemBorders, align 4, !tbaa !21
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %125

120:                                              ; preds = %116
  %121 = load i32, ptr %6, align 4, !tbaa !21
  %122 = icmp sgt i32 %121, 1
  br i1 %122, label %123, label %125

123:                                              ; preds = %120
  %124 = load i32, ptr %6, align 4, !tbaa !21
  call void @SolveSubproblemBorderProblems(i32 noundef %124, ptr noundef %2)
  br label %125

125:                                              ; preds = %123, %120, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

declare double @GetTime() #2

declare void @AllocateStructures() #2

declare i32 @ReadPenalties() #2

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

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

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

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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 152}
!14 = !{!"Node", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, 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 = !{!"int", !7, i64 0}
!16 = !{!14, !12, i64 224}
!17 = !{!14, !12, i64 160}
!18 = !{!14, !15, i64 48}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!15, !15, i64 0}
!22 = distinct !{!22, !20}


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

@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 [44 x i8], align 1
@Dimension = external dso_local local_unnamed_addr global i32, align 4
@SubproblemSize = external dso_local local_unnamed_addr global i32, align 4
@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 @SolveKMeansSubproblems() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %2 = tail call double @GetTime() #4
  tail call void @AllocateStructures() #4
  %3 = tail call i32 @ReadPenalties() #4
  %4 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  br label %5

5:                                                ; preds = %22, %0
  %6 = phi ptr [ %4, %0 ], [ %23, %22 ]
  %7 = phi i64 [ 0, %0 ], [ %25, %22 ]
  %.0 = phi ptr [ %4, %0 ], [ %24, %22 ]
  %8 = getelementptr inbounds i8, ptr %.0, i64 152
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %.0, i64 224
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = icmp eq ptr %9, %11
  br i1 %12, label %22, label %13

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %.0, i64 160
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = icmp eq ptr %15, %11
  br i1 %16, label %22, label %17

17:                                               ; preds = %13
  %18 = load ptr, ptr @Distance, align 8, !tbaa !5
  %19 = tail call i32 %18(ptr noundef nonnull %.0, ptr noundef %11) #4
  %20 = sext i32 %19 to i64
  %21 = add nsw i64 %7, %20
  %.pre = load ptr, ptr %10, align 8, !tbaa !13
  %.pre36 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %17, %13, %5
  %23 = phi ptr [ %.pre36, %17 ], [ %6, %13 ], [ %6, %5 ]
  %24 = phi ptr [ %.pre, %17 ], [ %11, %13 ], [ %11, %5 ]
  %25 = phi i64 [ %21, %17 ], [ %7, %13 ], [ %7, %5 ]
  %26 = getelementptr inbounds i8, ptr %.0, i64 48
  store i32 0, ptr %26, align 8, !tbaa !15
  %.not = icmp eq ptr %24, %23
  br i1 %.not, label %27, label %5, !llvm.loop !16

27:                                               ; preds = %22
  store i64 %25, ptr %1, align 8, !tbaa !18
  %28 = load i32, ptr @TraceLevel, align 4, !tbaa !20
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %.not30 = icmp eq i32 %28, 1
  br i1 %.not30, label %32, label %31

31:                                               ; preds = %30
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str) #4
  br label %32

32:                                               ; preds = %31, %30
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.1, i64 noundef %25) #4
  br label %33

33:                                               ; preds = %32, %27
  %34 = load i32, ptr @Dimension, align 4, !tbaa !20
  %35 = sitofp i32 %34 to double
  %36 = load i32, ptr @SubproblemSize, align 4, !tbaa !20
  %37 = sitofp i32 %36 to double
  %38 = fdiv double %35, %37
  %39 = tail call double @llvm.ceil.f64(double %38)
  %40 = fptosi double %39 to i32
  tail call void @KMeansClustering(i32 noundef %40)
  %.not3134 = icmp slt i32 %40, 1
  br i1 %.not3134, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %33, %47
  %.02235 = phi i32 [ %48, %47 ], [ 1, %33 ]
  %41 = load i64, ptr %1, align 8, !tbaa !18
  %42 = call i32 @SolveSubproblem(i32 noundef %.02235, i32 noundef %40, ptr noundef nonnull %1) #4
  %43 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !20
  %.not32 = icmp ne i32 %43, 0
  %44 = load i64, ptr %1, align 8
  %45 = icmp eq i64 %44, %41
  %or.cond = select i1 %.not32, i1 %45, i1 false
  br i1 %or.cond, label %46, label %47

46:                                               ; preds = %.lr.ph
  call void @SolveCompressedSubproblem(i32 noundef %.02235, i32 noundef %40, ptr noundef nonnull %1) #4
  br label %47

47:                                               ; preds = %.lr.ph, %46
  %48 = add nuw i32 %.02235, 1
  %exitcond.not = icmp eq i32 %.02235, %40
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %47
  %.pre37 = load i64, ptr %1, align 8, !tbaa !18
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %33
  %49 = phi i64 [ %.pre37, %._crit_edge.loopexit ], [ %25, %33 ]
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.2, i64 noundef %49) #4
  %50 = load i64, ptr @Optimum, align 8
  %51 = and i64 %50, 9223372036854775807
  %or.cond.not = icmp eq i64 %51, 0
  br i1 %or.cond.not, label %59, label %52

52:                                               ; preds = %._crit_edge
  %53 = load i64, ptr %1, align 8, !tbaa !18
  %54 = sub nsw i64 %53, %50
  %55 = sitofp i64 %54 to double
  %56 = fmul double %55, 1.000000e+02
  %57 = sitofp i64 %50 to double
  %58 = fdiv double %56, %57
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, double noundef %58) #4
  br label %59

59:                                               ; preds = %52, %._crit_edge
  %60 = call double @GetTime() #4
  %61 = fsub double %60, %2
  %62 = call double @llvm.fabs.f64(double %61)
  %63 = load i64, ptr %1, align 8, !tbaa !18
  %64 = load i64, ptr @Optimum, align 8, !tbaa !18
  %65 = icmp slt i64 %63, %64
  %66 = icmp eq i64 %63, %64
  %67 = select i1 %66, ptr @.str.6, ptr @.str.7
  %68 = select i1 %65, ptr @.str.5, ptr %67
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, double noundef %62, ptr noundef nonnull %68) #4
  %69 = load i32, ptr @SubproblemBorders, align 4, !tbaa !20
  %70 = icmp ne i32 %69, 0
  %71 = icmp sgt i32 %40, 1
  %or.cond3 = and i1 %71, %70
  br i1 %or.cond3, label %72, label %73

72:                                               ; preds = %59
  call void @SolveSubproblemBorderProblems(i32 noundef %40, ptr noundef nonnull %1) #4
  br label %73

73:                                               ; preds = %72, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  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

declare i32 @ReadPenalties() local_unnamed_addr #2

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

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

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

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

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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 152}
!10 = !{!"Node", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !6, i64 224}
!14 = !{!10, !6, i64 160}
!15 = !{!10, !11, i64 48}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !17}


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