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

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

@DimensionSaved = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [69 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.SolveSubproblemBorderProblems = external hidden unnamed_addr constant [52 x i8], align 1
@FirstNode = external dso_local global ptr, align 8
@TraceLevel = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@SubproblemsCompressed = external dso_local global i32, align 4
@.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

; Function Attrs: nounwind uwtable
define dso_local void @SolveSubproblemBorderProblems(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %10 = call double @GetTime()
  store double %10, ptr %9, align 8, !tbaa !11
  %11 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  %13 = sext i32 %12 to i64
  %14 = mul i64 %13, 4
  %15 = call noalias ptr @malloc(i64 noundef %14) #8
  store ptr %15, ptr %8, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  br label %19

18:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 38, ptr noundef @__PRETTY_FUNCTION__.SolveSubproblemBorderProblems) #9
  unreachable

19:                                               ; preds = %17
  %20 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %20, ptr %5, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %61, %19
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 35
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.Node, ptr %25, i32 0, i32 16
  store ptr %24, ptr %26, align 8, !tbaa !15
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.Node, ptr %28, i32 0, i32 16
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = getelementptr inbounds %struct.Node, ptr %30, i32 0, i32 15
  store ptr %27, ptr %31, align 8, !tbaa !16
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 12
  %34 = load i32, ptr %33, align 8, !tbaa !17
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp sgt i32 %34, %35
  br i1 %36, label %37, label %43

37:                                               ; preds = %21
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.Node, ptr %39, i32 0, i32 12
  %41 = load i32, ptr %40, align 8, !tbaa !17
  %42 = sub nsw i32 %41, %38
  store i32 %42, ptr %40, align 8, !tbaa !17
  br label %43

43:                                               ; preds = %37, %21
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.Node, ptr %44, i32 0, i32 12
  %46 = load i32, ptr %45, align 8, !tbaa !17
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.Node, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !18
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %47, i64 %51
  store i32 %46, ptr %52, align 4, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.Node, ptr %53, i32 0, i32 29
  store ptr null, ptr %54, align 8, !tbaa !19
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.Node, ptr %55, i32 0, i32 28
  store ptr null, ptr %56, align 8, !tbaa !20
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.Node, ptr %57, i32 0, i32 37
  store ptr null, ptr %58, align 8, !tbaa !21
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.Node, ptr %59, i32 0, i32 36
  store ptr null, ptr %60, align 8, !tbaa !22
  br label %61

61:                                               ; preds = %43
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.Node, ptr %62, i32 0, i32 35
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  store ptr %64, ptr %5, align 8, !tbaa !9
  %65 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %66 = icmp ne ptr %64, %65
  br i1 %66, label %21, label %67, !llvm.loop !23

67:                                               ; preds = %61
  %68 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %69 = icmp sge i32 %68, 1
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load ptr, ptr %4, align 8, !tbaa !9
  %72 = load i64, ptr %71, align 8, !tbaa !25
  call void (ptr, ...) @printff(ptr noundef @.str.2, i64 noundef %72)
  br label %73

73:                                               ; preds = %70, %67
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %116, %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %78, label %119

78:                                               ; preds = %74
  %79 = load i32, ptr %7, align 4, !tbaa !5
  call void @MarkBorderPoints(i32 noundef %79)
  %80 = load ptr, ptr %4, align 8, !tbaa !9
  %81 = load i64, ptr %80, align 8, !tbaa !25
  store i64 %81, ptr %6, align 8, !tbaa !25
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !9
  %85 = call i32 @SolveSubproblem(i32 noundef %82, i32 noundef %83, ptr noundef %84)
  %86 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %97

88:                                               ; preds = %78
  %89 = load ptr, ptr %4, align 8, !tbaa !9
  %90 = load i64, ptr %89, align 8, !tbaa !25
  %91 = load i64, ptr %6, align 8, !tbaa !25
  %92 = icmp eq i64 %90, %91
  br i1 %92, label %93, label %97

93:                                               ; preds = %88
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = load ptr, ptr %4, align 8, !tbaa !9
  call void @SolveCompressedSubproblem(i32 noundef %94, i32 noundef %95, ptr noundef %96)
  br label %97

97:                                               ; preds = %93, %88, %78
  %98 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %98, ptr %5, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %109, %97
  %100 = load ptr, ptr %8, align 8, !tbaa !9
  %101 = load ptr, ptr %5, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.Node, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 8, !tbaa !18
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %100, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load ptr, ptr %5, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.Node, ptr %107, i32 0, i32 12
  store i32 %106, ptr %108, align 8, !tbaa !17
  br label %109

109:                                              ; preds = %99
  %110 = load ptr, ptr %5, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.Node, ptr %110, i32 0, i32 35
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  store ptr %112, ptr %5, align 8, !tbaa !9
  %113 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %114 = icmp ne ptr %112, %113
  br i1 %114, label %99, label %115, !llvm.loop !27

115:                                              ; preds = %109
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %7, align 4, !tbaa !5
  br label %74, !llvm.loop !28

119:                                              ; preds = %74
  %120 = load ptr, ptr %8, align 8, !tbaa !9
  call void @free(ptr noundef %120) #7
  %121 = load ptr, ptr %4, align 8, !tbaa !9
  %122 = load i64, ptr %121, align 8, !tbaa !25
  call void (ptr, ...) @printff(ptr noundef @.str.3, i64 noundef %122)
  %123 = load i64, ptr @Optimum, align 8, !tbaa !25
  %124 = icmp ne i64 %123, -9223372036854775808
  br i1 %124, label %125, label %138

125:                                              ; preds = %119
  %126 = load i64, ptr @Optimum, align 8, !tbaa !25
  %127 = icmp ne i64 %126, 0
  br i1 %127, label %128, label %138

128:                                              ; preds = %125
  %129 = load ptr, ptr %4, align 8, !tbaa !9
  %130 = load i64, ptr %129, align 8, !tbaa !25
  %131 = load i64, ptr @Optimum, align 8, !tbaa !25
  %132 = sub nsw i64 %130, %131
  %133 = sitofp i64 %132 to double
  %134 = fmul double 1.000000e+02, %133
  %135 = load i64, ptr @Optimum, align 8, !tbaa !25
  %136 = sitofp i64 %135 to double
  %137 = fdiv double %134, %136
  call void (ptr, ...) @printff(ptr noundef @.str.4, double noundef %137)
  br label %138

138:                                              ; preds = %128, %125, %119
  %139 = call double @GetTime()
  %140 = load double, ptr %9, align 8, !tbaa !11
  %141 = fsub double %139, %140
  %142 = call double @llvm.fabs.f64(double %141)
  %143 = load ptr, ptr %4, align 8, !tbaa !9
  %144 = load i64, ptr %143, align 8, !tbaa !25
  %145 = load i64, ptr @Optimum, align 8, !tbaa !25
  %146 = icmp slt i64 %144, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %138
  br label %155

148:                                              ; preds = %138
  %149 = load ptr, ptr %4, align 8, !tbaa !9
  %150 = load i64, ptr %149, align 8, !tbaa !25
  %151 = load i64, ptr @Optimum, align 8, !tbaa !25
  %152 = icmp eq i64 %150, %151
  %153 = zext i1 %152 to i64
  %154 = select i1 %152, ptr @.str.7, ptr @.str.8
  br label %155

155:                                              ; preds = %148, %147
  %156 = phi ptr [ @.str.6, %147 ], [ %154, %148 ]
  call void (ptr, ...) @printff(ptr noundef @.str.5, double noundef %142, ptr noundef %156)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @MarkBorderPoints(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: nounwind
declare void @free(ptr noundef) #5

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 224}
!14 = !{!"Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !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, !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}
!15 = !{!14, !10, i64 72}
!16 = !{!14, !10, i64 64}
!17 = !{!14, !6, i64 48}
!18 = !{!14, !6, i64 0}
!19 = !{!14, !10, i64 176}
!20 = !{!14, !10, i64 168}
!21 = !{!14, !10, i64 240}
!22 = !{!14, !10, i64 232}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !26, i64 0}
!26 = !{!"long long", !7, i64 0}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}


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

@DimensionSaved = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [69 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.SolveSubproblemBorderProblems = external hidden unnamed_addr constant [52 x i8], align 1
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8
@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@SubproblemsCompressed = external dso_local local_unnamed_addr global i32, align 4
@.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

; Function Attrs: nounwind uwtable
define dso_local void @SolveSubproblemBorderProblems(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call double @GetTime() #7
  %4 = load i32, ptr @DimensionSaved, align 4, !tbaa !5
  %5 = add nsw i32 %4, 1
  %6 = sext i32 %5 to i64
  %7 = shl nsw i64 %6, 2
  %8 = tail call noalias ptr @malloc(i64 noundef %7) #8
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 38, ptr noundef nonnull @__PRETTY_FUNCTION__.SolveSubproblemBorderProblems) #9
  unreachable

10:                                               ; preds = %2
  %11 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %12

12:                                               ; preds = %22, %10
  %.0 = phi ptr [ %11, %10 ], [ %14, %22 ]
  %13 = getelementptr inbounds i8, ptr %.0, i64 224
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %.0, i64 72
  store ptr %14, ptr %15, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %14, i64 64
  store ptr %.0, ptr %16, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %.0, i64 48
  %18 = load i32, ptr %17, align 8, !tbaa !16
  %19 = icmp sgt i32 %18, %0
  br i1 %19, label %20, label %22

20:                                               ; preds = %12
  %21 = sub nsw i32 %18, %0
  store i32 %21, ptr %17, align 8, !tbaa !16
  br label %22

22:                                               ; preds = %20, %12
  %23 = phi i32 [ %21, %20 ], [ %18, %12 ]
  %24 = load i32, ptr %.0, align 8, !tbaa !17
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i32, ptr %8, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %.0, i64 168
  %28 = getelementptr inbounds i8, ptr %.0, i64 232
  %.not49 = icmp eq ptr %14, %11
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %27, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %28, i8 0, i64 16, i1 false)
  br i1 %.not49, label %29, label %12, !llvm.loop !18

29:                                               ; preds = %22
  %30 = load i32, ptr @TraceLevel, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = load i64, ptr %1, align 8, !tbaa !20
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.2, i64 noundef %33) #7
  br label %34

34:                                               ; preds = %32, %29
  %.not5053 = icmp slt i32 %0, 1
  br i1 %.not5053, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %34, %52
  %.04054 = phi i32 [ %53, %52 ], [ 1, %34 ]
  tail call void @MarkBorderPoints(i32 noundef %.04054)
  %35 = load i64, ptr %1, align 8, !tbaa !20
  %36 = tail call i32 @SolveSubproblem(i32 noundef %.04054, i32 noundef %0, ptr noundef nonnull %1) #7
  %37 = load i32, ptr @SubproblemsCompressed, align 4, !tbaa !5
  %.not51 = icmp eq i32 %37, 0
  br i1 %.not51, label %42, label %38

38:                                               ; preds = %.lr.ph
  %39 = load i64, ptr %1, align 8, !tbaa !20
  %40 = icmp eq i64 %39, %35
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  tail call void @SolveCompressedSubproblem(i32 noundef %.04054, i32 noundef %0, ptr noundef nonnull %1) #7
  br label %42

42:                                               ; preds = %41, %38, %.lr.ph
  %43 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %44, %42
  %.1 = phi ptr [ %43, %42 ], [ %51, %44 ]
  %45 = load i32, ptr %.1, align 8, !tbaa !17
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %8, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %.1, i64 48
  store i32 %48, ptr %49, align 8, !tbaa !16
  %50 = getelementptr inbounds i8, ptr %.1, i64 224
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %.not52 = icmp eq ptr %51, %43
  br i1 %.not52, label %52, label %44, !llvm.loop !22

52:                                               ; preds = %44
  %53 = add nuw i32 %.04054, 1
  %exitcond.not = icmp eq i32 %.04054, %0
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %52, %34
  tail call void @free(ptr noundef nonnull %8) #7
  %54 = load i64, ptr %1, align 8, !tbaa !20
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.3, i64 noundef %54) #7
  %55 = load i64, ptr @Optimum, align 8
  %56 = and i64 %55, 9223372036854775807
  %or.cond.not = icmp eq i64 %56, 0
  br i1 %or.cond.not, label %64, label %57

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

64:                                               ; preds = %57, %._crit_edge
  %65 = tail call double @GetTime() #7
  %66 = load i64, ptr %1, align 8, !tbaa !20
  %67 = load i64, ptr @Optimum, align 8, !tbaa !20
  %68 = icmp slt i64 %66, %67
  %69 = icmp eq i64 %66, %67
  %70 = select i1 %69, ptr @.str.7, ptr @.str.8
  %71 = select i1 %68, ptr @.str.6, ptr %70
  %72 = fsub double %65, %3
  %73 = tail call double @llvm.fabs.f64(double %72)
  tail call void (ptr, ...) @printff(ptr noundef nonnull @.str.5, double noundef %73, ptr noundef nonnull %71) #7
  ret void
}

declare double @GetTime() local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 224}
!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 72}
!15 = !{!12, !10, i64 64}
!16 = !{!12, !6, i64 48}
!17 = !{!12, !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass