; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C/Algorithms/Sorting-Algorithms/Bucket Sort (BucketSort)

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

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @BucketSort(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  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 8, ptr %5) #4
  %9 = call noalias ptr @malloc(i64 noundef 48) #5
  store ptr %9, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %18, %1
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 6
  br i1 %12, label %13, label %21

13:                                               ; preds = %10
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds ptr, ptr %14, i64 %16
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %3, align 4, !tbaa !9
  br label %10, !llvm.loop !11

21:                                               ; preds = %10
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %52, %21
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 7
  br i1 %24, label %25, label %55

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = call i32 @getBucketIndex(i32 noundef %30)
  store i32 %31, ptr %7, align 4, !tbaa !9
  %32 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %32, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %33, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Node, ptr %38, i32 0, i32 0
  store i32 %37, ptr %39, align 8, !tbaa !13
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Node, ptr %45, i32 0, i32 1
  store ptr %44, ptr %46, align 8, !tbaa !15
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  store ptr %47, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %52

52:                                               ; preds = %25
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !9
  br label %22, !llvm.loop !16

55:                                               ; preds = %22
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %68, %55
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 6
  br i1 %58, label %59, label %71

59:                                               ; preds = %56
  %60 = load i32, ptr %3, align 4, !tbaa !9
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %60)
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  call void @printBuckets(ptr noundef %66)
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %68

68:                                               ; preds = %59
  %69 = load i32, ptr %3, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !9
  br label %56, !llvm.loop !17

71:                                               ; preds = %56
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %86, %71
  %73 = load i32, ptr %3, align 4, !tbaa !9
  %74 = icmp slt i32 %73, 6
  br i1 %74, label %75, label %89

75:                                               ; preds = %72
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load i32, ptr %3, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = call ptr @InsertionSort(ptr noundef %80)
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load i32, ptr %3, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %82, i64 %84
  store ptr %81, ptr %85, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %75
  %87 = load i32, ptr %3, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %3, align 4, !tbaa !9
  br label %72, !llvm.loop !18

89:                                               ; preds = %72
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %104, %89
  %93 = load i32, ptr %3, align 4, !tbaa !9
  %94 = icmp slt i32 %93, 6
  br i1 %94, label %95, label %107

95:                                               ; preds = %92
  %96 = load i32, ptr %3, align 4, !tbaa !9
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %96)
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds ptr, ptr %98, i64 %100
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  call void @printBuckets(ptr noundef %102)
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %104

104:                                              ; preds = %95
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %3, align 4, !tbaa !9
  br label %92, !llvm.loop !19

107:                                              ; preds = %92
  store i32 0, ptr %4, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %133, %107
  %109 = load i32, ptr %3, align 4, !tbaa !9
  %110 = icmp slt i32 %109, 6
  br i1 %110, label %111, label %136

111:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load i32, ptr %3, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  store ptr %116, ptr %8, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %120, %111
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %132

120:                                              ; preds = %117
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.Node, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !13
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = load i32, ptr %4, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %4, align 4, !tbaa !9
  %127 = sext i32 %125 to i64
  %128 = getelementptr inbounds i32, ptr %124, i64 %127
  store i32 %123, ptr %128, align 4, !tbaa !9
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.Node, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  store ptr %131, ptr %8, align 8, !tbaa !5
  br label %117, !llvm.loop !20

132:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %3, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %3, align 4, !tbaa !9
  br label %108, !llvm.loop !21

136:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 8, 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
  ret void
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @getBucketIndex(i32 noundef) #0

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare dso_local void @printBuckets(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @InsertionSort(ptr noundef) #0

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 = { 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 #3 = { "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 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"Node", !10, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @BucketSort(ptr nocapture noundef %0) local_unnamed_addr #0 {
.preheader46.preheader:
  %calloc = tail call dereferenceable_or_null(48) ptr @calloc(i64 1, i64 48)
  %1 = load i32, ptr %0, align 4, !tbaa !5
  %2 = tail call i32 @getBucketIndex(i32 noundef %1)
  %3 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %4 = load i32, ptr %0, align 4, !tbaa !5
  store i32 %4, ptr %3, align 8, !tbaa !9
  %5 = sext i32 %2 to i64
  %6 = getelementptr inbounds ptr, ptr %calloc, i64 %5
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %7, ptr %8, align 8, !tbaa !13
  store ptr %3, ptr %6, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %0, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = tail call i32 @getBucketIndex(i32 noundef %10)
  %12 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %13 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %13, ptr %12, align 8, !tbaa !9
  %14 = sext i32 %11 to i64
  %15 = getelementptr inbounds ptr, ptr %calloc, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  %17 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr %16, ptr %17, align 8, !tbaa !13
  store ptr %12, ptr %15, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = tail call i32 @getBucketIndex(i32 noundef %19)
  %21 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %22 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %22, ptr %21, align 8, !tbaa !9
  %23 = sext i32 %20 to i64
  %24 = getelementptr inbounds ptr, ptr %calloc, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %25, ptr %26, align 8, !tbaa !13
  store ptr %21, ptr %24, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %0, i64 12
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = tail call i32 @getBucketIndex(i32 noundef %28)
  %30 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %31 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %31, ptr %30, align 8, !tbaa !9
  %32 = sext i32 %29 to i64
  %33 = getelementptr inbounds ptr, ptr %calloc, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  %35 = getelementptr inbounds i8, ptr %30, i64 8
  store ptr %34, ptr %35, align 8, !tbaa !13
  store ptr %30, ptr %33, align 8, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = tail call i32 @getBucketIndex(i32 noundef %37)
  %39 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %40 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %40, ptr %39, align 8, !tbaa !9
  %41 = sext i32 %38 to i64
  %42 = getelementptr inbounds ptr, ptr %calloc, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = getelementptr inbounds i8, ptr %39, i64 8
  store ptr %43, ptr %44, align 8, !tbaa !13
  store ptr %39, ptr %42, align 8, !tbaa !12
  %45 = getelementptr inbounds i8, ptr %0, i64 20
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = tail call i32 @getBucketIndex(i32 noundef %46)
  %48 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %49 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %49, ptr %48, align 8, !tbaa !9
  %50 = sext i32 %47 to i64
  %51 = getelementptr inbounds ptr, ptr %calloc, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  %53 = getelementptr inbounds i8, ptr %48, i64 8
  store ptr %52, ptr %53, align 8, !tbaa !13
  store ptr %48, ptr %51, align 8, !tbaa !12
  %54 = getelementptr inbounds i8, ptr %0, i64 24
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = tail call i32 @getBucketIndex(i32 noundef %55)
  %57 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %58 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %58, ptr %57, align 8, !tbaa !9
  %59 = sext i32 %56 to i64
  %60 = getelementptr inbounds ptr, ptr %calloc, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !12
  %62 = getelementptr inbounds i8, ptr %57, i64 8
  store ptr %61, ptr %62, align 8, !tbaa !13
  store ptr %57, ptr %60, align 8, !tbaa !12
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0)
  %64 = load ptr, ptr %calloc, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %64)
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
  %67 = getelementptr inbounds i8, ptr %calloc, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %68)
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
  %71 = getelementptr inbounds i8, ptr %calloc, i64 16
  %72 = load ptr, ptr %71, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %72)
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %74 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
  %75 = getelementptr inbounds i8, ptr %calloc, i64 24
  %76 = load ptr, ptr %75, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %76)
  %77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
  %79 = getelementptr inbounds i8, ptr %calloc, i64 32
  %80 = load ptr, ptr %79, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %80)
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
  %83 = getelementptr inbounds i8, ptr %calloc, i64 40
  %84 = load ptr, ptr %83, align 8, !tbaa !12
  tail call void @printBuckets(ptr noundef %84)
  %85 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %86 = tail call ptr @InsertionSort(ptr noundef %64)
  %87 = tail call ptr @InsertionSort(ptr noundef %68)
  %88 = tail call ptr @InsertionSort(ptr noundef %72)
  %89 = tail call ptr @InsertionSort(ptr noundef %76)
  %90 = tail call ptr @InsertionSort(ptr noundef %80)
  %91 = tail call ptr @InsertionSort(ptr noundef %84)
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %94 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0)
  tail call void @printBuckets(ptr noundef %86)
  %95 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
  tail call void @printBuckets(ptr noundef %87)
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
  tail call void @printBuckets(ptr noundef %88)
  %99 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
  tail call void @printBuckets(ptr noundef %89)
  %101 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %102 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
  tail call void @printBuckets(ptr noundef %90)
  %103 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %104 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
  tail call void @printBuckets(ptr noundef %91)
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %.not53 = icmp eq ptr %86, null
  br i1 %.not53, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader46.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader46.preheader ]
  %.055 = phi ptr [ %.0, %.lr.ph ], [ %86, %.preheader46.preheader ]
  %106 = load i32, ptr %.055, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %107 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  store i32 %106, ptr %107, align 4, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %.055, i64 8
  %.0 = load ptr, ptr %108, align 8, !tbaa !12
  %.not = icmp eq ptr %.0, null
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %109 = trunc nsw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader46.preheader
  %.143.lcssa = phi i32 [ 0, %.preheader46.preheader ], [ %109, %._crit_edge.loopexit ]
  %.not53.1 = icmp eq ptr %87, null
  br i1 %.not53.1, label %._crit_edge.1, label %.lr.ph.preheader.1

.lr.ph.preheader.1:                               ; preds = %._crit_edge
  %110 = sext i32 %.143.lcssa to i64
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %indvars.iv.1 = phi i64 [ %110, %.lr.ph.preheader.1 ], [ %indvars.iv.next.1, %.lr.ph.1 ]
  %.055.1 = phi ptr [ %87, %.lr.ph.preheader.1 ], [ %.0.1, %.lr.ph.1 ]
  %111 = load i32, ptr %.055.1, align 8, !tbaa !9
  %indvars.iv.next.1 = add nsw i64 %indvars.iv.1, 1
  %112 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.1
  store i32 %111, ptr %112, align 4, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %.055.1, i64 8
  %.0.1 = load ptr, ptr %113, align 8, !tbaa !12
  %.not.1 = icmp eq ptr %.0.1, null
  br i1 %.not.1, label %._crit_edge.loopexit.1, label %.lr.ph.1, !llvm.loop !14

._crit_edge.loopexit.1:                           ; preds = %.lr.ph.1
  %114 = trunc nsw i64 %indvars.iv.next.1 to i32
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %._crit_edge.loopexit.1, %._crit_edge
  %.143.lcssa.1 = phi i32 [ %.143.lcssa, %._crit_edge ], [ %114, %._crit_edge.loopexit.1 ]
  %.not53.2 = icmp eq ptr %88, null
  br i1 %.not53.2, label %._crit_edge.2, label %.lr.ph.preheader.2

.lr.ph.preheader.2:                               ; preds = %._crit_edge.1
  %115 = sext i32 %.143.lcssa.1 to i64
  br label %.lr.ph.2

.lr.ph.2:                                         ; preds = %.lr.ph.2, %.lr.ph.preheader.2
  %indvars.iv.2 = phi i64 [ %115, %.lr.ph.preheader.2 ], [ %indvars.iv.next.2, %.lr.ph.2 ]
  %.055.2 = phi ptr [ %88, %.lr.ph.preheader.2 ], [ %.0.2, %.lr.ph.2 ]
  %116 = load i32, ptr %.055.2, align 8, !tbaa !9
  %indvars.iv.next.2 = add nsw i64 %indvars.iv.2, 1
  %117 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.2
  store i32 %116, ptr %117, align 4, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %.055.2, i64 8
  %.0.2 = load ptr, ptr %118, align 8, !tbaa !12
  %.not.2 = icmp eq ptr %.0.2, null
  br i1 %.not.2, label %._crit_edge.loopexit.2, label %.lr.ph.2, !llvm.loop !14

._crit_edge.loopexit.2:                           ; preds = %.lr.ph.2
  %119 = trunc nsw i64 %indvars.iv.next.2 to i32
  br label %._crit_edge.2

._crit_edge.2:                                    ; preds = %._crit_edge.loopexit.2, %._crit_edge.1
  %.143.lcssa.2 = phi i32 [ %.143.lcssa.1, %._crit_edge.1 ], [ %119, %._crit_edge.loopexit.2 ]
  %.not53.3 = icmp eq ptr %89, null
  br i1 %.not53.3, label %._crit_edge.3, label %.lr.ph.preheader.3

.lr.ph.preheader.3:                               ; preds = %._crit_edge.2
  %120 = sext i32 %.143.lcssa.2 to i64
  br label %.lr.ph.3

.lr.ph.3:                                         ; preds = %.lr.ph.3, %.lr.ph.preheader.3
  %indvars.iv.3 = phi i64 [ %120, %.lr.ph.preheader.3 ], [ %indvars.iv.next.3, %.lr.ph.3 ]
  %.055.3 = phi ptr [ %89, %.lr.ph.preheader.3 ], [ %.0.3, %.lr.ph.3 ]
  %121 = load i32, ptr %.055.3, align 8, !tbaa !9
  %indvars.iv.next.3 = add nsw i64 %indvars.iv.3, 1
  %122 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.3
  store i32 %121, ptr %122, align 4, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %.055.3, i64 8
  %.0.3 = load ptr, ptr %123, align 8, !tbaa !12
  %.not.3 = icmp eq ptr %.0.3, null
  br i1 %.not.3, label %._crit_edge.loopexit.3, label %.lr.ph.3, !llvm.loop !14

._crit_edge.loopexit.3:                           ; preds = %.lr.ph.3
  %124 = trunc nsw i64 %indvars.iv.next.3 to i32
  br label %._crit_edge.3

._crit_edge.3:                                    ; preds = %._crit_edge.loopexit.3, %._crit_edge.2
  %.143.lcssa.3 = phi i32 [ %.143.lcssa.2, %._crit_edge.2 ], [ %124, %._crit_edge.loopexit.3 ]
  %.not53.4 = icmp eq ptr %90, null
  br i1 %.not53.4, label %._crit_edge.4, label %.lr.ph.preheader.4

.lr.ph.preheader.4:                               ; preds = %._crit_edge.3
  %125 = sext i32 %.143.lcssa.3 to i64
  br label %.lr.ph.4

.lr.ph.4:                                         ; preds = %.lr.ph.4, %.lr.ph.preheader.4
  %indvars.iv.4 = phi i64 [ %125, %.lr.ph.preheader.4 ], [ %indvars.iv.next.4, %.lr.ph.4 ]
  %.055.4 = phi ptr [ %90, %.lr.ph.preheader.4 ], [ %.0.4, %.lr.ph.4 ]
  %126 = load i32, ptr %.055.4, align 8, !tbaa !9
  %indvars.iv.next.4 = add nsw i64 %indvars.iv.4, 1
  %127 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.4
  store i32 %126, ptr %127, align 4, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %.055.4, i64 8
  %.0.4 = load ptr, ptr %128, align 8, !tbaa !12
  %.not.4 = icmp eq ptr %.0.4, null
  br i1 %.not.4, label %._crit_edge.loopexit.4, label %.lr.ph.4, !llvm.loop !14

._crit_edge.loopexit.4:                           ; preds = %.lr.ph.4
  %129 = trunc nsw i64 %indvars.iv.next.4 to i32
  br label %._crit_edge.4

._crit_edge.4:                                    ; preds = %._crit_edge.loopexit.4, %._crit_edge.3
  %.143.lcssa.4 = phi i32 [ %.143.lcssa.3, %._crit_edge.3 ], [ %129, %._crit_edge.loopexit.4 ]
  %.not53.5 = icmp eq ptr %91, null
  br i1 %.not53.5, label %._crit_edge.5, label %.lr.ph.preheader.5

.lr.ph.preheader.5:                               ; preds = %._crit_edge.4
  %130 = sext i32 %.143.lcssa.4 to i64
  br label %.lr.ph.5

.lr.ph.5:                                         ; preds = %.lr.ph.5, %.lr.ph.preheader.5
  %indvars.iv.5 = phi i64 [ %130, %.lr.ph.preheader.5 ], [ %indvars.iv.next.5, %.lr.ph.5 ]
  %.055.5 = phi ptr [ %91, %.lr.ph.preheader.5 ], [ %.0.5, %.lr.ph.5 ]
  %131 = load i32, ptr %.055.5, align 8, !tbaa !9
  %indvars.iv.next.5 = add nsw i64 %indvars.iv.5, 1
  %132 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.5
  store i32 %131, ptr %132, align 4, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %.055.5, i64 8
  %.0.5 = load ptr, ptr %133, align 8, !tbaa !12
  %.not.5 = icmp eq ptr %.0.5, null
  br i1 %.not.5, label %._crit_edge.5, label %.lr.ph.5, !llvm.loop !14

._crit_edge.5:                                    ; preds = %.lr.ph.5, %._crit_edge.4
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @getBucketIndex(i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @printBuckets(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @InsertionSort(ptr noundef) local_unnamed_addr #0

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

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 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 #2 = { nofree 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 #3 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #4 = { nounwind allocsize(0) }

!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, !6, i64 0}
!10 = !{!"Node", !6, i64 0, !11, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass