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

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

@RestrictedSearch = external dso_local global i32, align 4
@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 [45 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 [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = 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 @SolveKCenterSubproblems() #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
  %7 = 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
  %8 = call double @GetTime()
  store double %8, 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 @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %9 = load i32, ptr @RestrictedSearch, align 4, !tbaa !9
  store i32 %9, ptr %7, align 4, !tbaa !9
  call void @AllocateStructures()
  %10 = call i32 @ReadPenalties()
  store i64 0, ptr %2, align 8, !tbaa !11
  %11 = load ptr, ptr @FirstNode, align 8, !tbaa !13
  store ptr %11, ptr %1, align 8, !tbaa !13
  br label %12

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

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

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

38:                                               ; preds = %28, %20, %12
  %39 = load ptr, ptr %1, align 8, !tbaa !13
  %40 = getelementptr inbounds %struct.Node, ptr %39, i32 0, i32 12
  store i32 0, ptr %40, align 8, !tbaa !19
  br label %41

41:                                               ; preds = %38
  %42 = load ptr, ptr %1, align 8, !tbaa !13
  %43 = getelementptr inbounds %struct.Node, ptr %42, i32 0, i32 35
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  store ptr %44, ptr %1, align 8, !tbaa !13
  %45 = load ptr, ptr @FirstNode, align 8, !tbaa !13
  %46 = icmp ne ptr %44, %45
  br i1 %46, label %12, label %47, !llvm.loop !20

47:                                               ; preds = %41
  %48 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %49 = icmp sge i32 %48, 1
  br i1 %49, label %50, label %56

50:                                               ; preds = %47
  %51 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %52 = icmp sge i32 %51, 2
  br i1 %52, label %53, label %54

53:                                               ; preds = %50
  call void (ptr, ...) @printff(ptr noundef @.str)
  br label %54

54:                                               ; preds = %53, %50
  %55 = load i64, ptr %2, align 8, !tbaa !11
  call void (ptr, ...) @printff(ptr noundef @.str.1, i64 noundef %55)
  br label %56

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

65:                                               ; preds = %91, %56
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %69, label %94

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

76:                                               ; preds = %69
  %77 = load i64, ptr %2, align 8, !tbaa !11
  %78 = load i64, ptr %3, align 8, !tbaa !11
  %79 = icmp eq i64 %77, %78
  br i1 %79, label %80, label %90

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

83:                                               ; preds = %80
  %84 = load i32, ptr %5, align 4, !tbaa !9
  call void (ptr, ...) @printff(ptr noundef @.str.2, i32 noundef %84)
  br label %85

85:                                               ; preds = %83, %80
  store i32 0, ptr @RestrictedSearch, align 4, !tbaa !9
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = call i32 @SolveSubproblem(i32 noundef %86, i32 noundef %87, ptr noundef %2)
  %89 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %89, ptr @RestrictedSearch, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %85, %76, %69
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %5, align 4, !tbaa !9
  br label %65, !llvm.loop !22

94:                                               ; preds = %65
  %95 = load i64, ptr %2, align 8, !tbaa !11
  call void (ptr, ...) @printff(ptr noundef @.str.3, i64 noundef %95)
  %96 = load i64, ptr @Optimum, align 8, !tbaa !11
  %97 = icmp ne i64 %96, -9223372036854775808
  br i1 %97, label %98, label %110

98:                                               ; preds = %94
  %99 = load i64, ptr @Optimum, align 8, !tbaa !11
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %101, label %110

101:                                              ; preds = %98
  %102 = load i64, ptr %2, align 8, !tbaa !11
  %103 = load i64, ptr @Optimum, align 8, !tbaa !11
  %104 = sub nsw i64 %102, %103
  %105 = sitofp i64 %104 to double
  %106 = fmul double 1.000000e+02, %105
  %107 = load i64, ptr @Optimum, align 8, !tbaa !11
  %108 = sitofp i64 %107 to double
  %109 = fdiv double %106, %108
  call void (ptr, ...) @printff(ptr noundef @.str.4, double noundef %109)
  br label %110

110:                                              ; preds = %101, %98, %94
  %111 = call double @GetTime()
  %112 = load double, ptr %4, align 8, !tbaa !5
  %113 = fsub double %111, %112
  %114 = call double @llvm.fabs.f64(double %113)
  %115 = load i64, ptr %2, align 8, !tbaa !11
  %116 = load i64, ptr @Optimum, align 8, !tbaa !11
  %117 = icmp slt i64 %115, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %110
  br label %125

119:                                              ; preds = %110
  %120 = load i64, ptr %2, align 8, !tbaa !11
  %121 = load i64, ptr @Optimum, align 8, !tbaa !11
  %122 = icmp eq i64 %120, %121
  %123 = zext i1 %122 to i64
  %124 = select i1 %122, ptr @.str.7, ptr @.str.8
  br label %125

125:                                              ; preds = %119, %118
  %126 = phi ptr [ @.str.6, %118 ], [ %124, %119 ]
  call void (ptr, ...) @printff(ptr noundef @.str.5, double noundef %114, ptr noundef %126)
  %127 = load i32, ptr @SubproblemBorders, align 4, !tbaa !9
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %134

129:                                              ; preds = %125
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = icmp sgt i32 %130, 1
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = load i32, ptr %6, align 4, !tbaa !9
  call void @SolveSubproblemBorderProblems(i32 noundef %133, ptr noundef %2)
  br label %134

134:                                              ; preds = %132, %129, %125
  call void @llvm.lifetime.end.p0(i64 4, 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 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 @KCenterClustering(i32 noundef) #0

declare i32 @SolveSubproblem(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 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !14, 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, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !14, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272, !14, i64 280, !14, i64 288, !14, i64 296, !14, 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, !14, i64 224}
!18 = !{!16, !14, i64 160}
!19 = !{!16, !10, i64 48}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !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"

@RestrictedSearch = external dso_local local_unnamed_addr global i32, align 4
@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 [45 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 [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@Optimum = external dso_local local_unnamed_addr global i64, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = 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 @SolveKCenterSubproblems() 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
  %3 = load i32, ptr @RestrictedSearch, align 4, !tbaa !5
  tail call void @AllocateStructures() #4
  %4 = tail call i32 @ReadPenalties() #4
  %5 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %6

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

14:                                               ; preds = %6
  %15 = getelementptr inbounds i8, ptr %.0, i64 160
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = icmp eq ptr %16, %12
  br i1 %17, label %23, label %18

18:                                               ; preds = %14
  %19 = load ptr, ptr @Distance, align 8, !tbaa !9
  %20 = tail call i32 %19(ptr noundef nonnull %.0, ptr noundef %12) #4
  %21 = sext i32 %20 to i64
  %22 = add nsw i64 %8, %21
  %.pre = load ptr, ptr %11, align 8, !tbaa !14
  %.pre38 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %18, %14, %6
  %24 = phi ptr [ %.pre38, %18 ], [ %7, %14 ], [ %7, %6 ]
  %25 = phi ptr [ %.pre, %18 ], [ %12, %14 ], [ %12, %6 ]
  %26 = phi i64 [ %22, %18 ], [ %8, %14 ], [ %8, %6 ]
  %27 = getelementptr inbounds i8, ptr %.0, i64 48
  store i32 0, ptr %27, align 8, !tbaa !16
  %.not = icmp eq ptr %25, %24
  br i1 %.not, label %28, label %6, !llvm.loop !17

28:                                               ; preds = %23
  store i64 %26, ptr %1, align 8, !tbaa !19
  %29 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %.not32 = icmp eq i32 %29, 1
  br i1 %.not32, label %33, label %32

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

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

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

.lr.ph:                                           ; preds = %34, %53
  %.02437 = phi i32 [ %54, %53 ], [ 1, %34 ]
  %42 = load i64, ptr %1, align 8, !tbaa !19
  %43 = call i32 @SolveSubproblem(i32 noundef %.02437, i32 noundef %41, ptr noundef nonnull %1) #4
  %44 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not34 = icmp ne i32 %44, 0
  %45 = load i64, ptr %1, align 8
  %46 = icmp eq i64 %45, %42
  %or.cond = select i1 %.not34, i1 %46, i1 false
  br i1 %or.cond, label %47, label %53

47:                                               ; preds = %.lr.ph
  %48 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.2, i32 noundef %.02437) #4
  br label %51

51:                                               ; preds = %50, %47
  store i32 0, ptr @RestrictedSearch, align 4, !tbaa !5
  %52 = call i32 @SolveSubproblem(i32 noundef %.02437, i32 noundef %41, ptr noundef nonnull %1) #4
  store i32 %3, ptr @RestrictedSearch, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %.lr.ph, %51
  %54 = add nuw i32 %.02437, 1
  %exitcond.not = icmp eq i32 %.02437, %41
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %53
  %.pre39 = load i64, ptr %1, align 8, !tbaa !19
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %34
  %55 = phi i64 [ %.pre39, %._crit_edge.loopexit ], [ %26, %34 ]
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, i64 noundef %55) #4
  %56 = load i64, ptr @Optimum, align 8
  %57 = and i64 %56, 9223372036854775807
  %or.cond.not = icmp eq i64 %57, 0
  br i1 %or.cond.not, label %65, label %58

58:                                               ; preds = %._crit_edge
  %59 = load i64, ptr %1, align 8, !tbaa !19
  %60 = sub nsw i64 %59, %56
  %61 = sitofp i64 %60 to double
  %62 = fmul double %61, 1.000000e+02
  %63 = sitofp i64 %56 to double
  %64 = fdiv double %62, %63
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.4, double noundef %64) #4
  br label %65

65:                                               ; preds = %58, %._crit_edge
  %66 = call double @GetTime() #4
  %67 = fsub double %66, %2
  %68 = call double @llvm.fabs.f64(double %67)
  %69 = load i64, ptr %1, align 8, !tbaa !19
  %70 = load i64, ptr @Optimum, align 8, !tbaa !19
  %71 = icmp slt i64 %69, %70
  %72 = icmp eq i64 %69, %70
  %73 = select i1 %72, ptr @.str.7, ptr @.str.8
  %74 = select i1 %71, ptr @.str.6, ptr %73
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.5, double noundef %68, ptr noundef nonnull %74) #4
  %75 = load i32, ptr @SubproblemBorders, align 4, !tbaa !5
  %76 = icmp ne i32 %75, 0
  %77 = icmp sgt i32 %41, 1
  %or.cond3 = and i1 %77, %76
  br i1 %or.cond3, label %78, label %79

78:                                               ; preds = %65
  call void @SolveSubproblemBorderProblems(i32 noundef %41, ptr noundef nonnull %1) #4
  br label %79

79:                                               ; preds = %78, %65
  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 @KCenterClustering(i32 noundef) local_unnamed_addr #0

declare i32 @SolveSubproblem(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 = !{!"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}


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