; LLVM IR from AlgoGenesis/C :: String Algorithms/Bucket Sort for Strings (Program)

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @bucketSort(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [256 x ptr], align 16
  %6 = alloca [256 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2048, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %6) #5
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %27, %2
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 256
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %30

19:                                               ; preds = %15
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = mul i64 %21, 8
  %23 = call noalias ptr @malloc(i64 noundef %22) #6
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [256 x ptr], ptr %5, i64 0, i64 %25
  store ptr %23, ptr %26, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %19
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %7, align 4, !tbaa !9
  br label %15, !llvm.loop !11

30:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %65, %30
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %68

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = sext i8 %43 to i32
  store i32 %44, ptr %9, align 4, !tbaa !9
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [256 x ptr], ptr %5, i64 0, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %53, i64 %58
  store ptr %49, ptr %59, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %65

65:                                               ; preds = %36
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %8, align 4, !tbaa !9
  br label %31, !llvm.loop !14

68:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %115, %68
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp slt i32 %70, 256
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %118

73:                                               ; preds = %69
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %79, label %114

79:                                               ; preds = %73
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [256 x ptr], ptr %5, i64 0, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  call void @insertionSort(ptr noundef %83, i32 noundef %87)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %110, %79
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = icmp slt i32 %89, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %88
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %113

96:                                               ; preds = %88
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [256 x ptr], ptr %5, i64 0, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds ptr, ptr %105, i64 %108
  store ptr %104, ptr %109, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %96
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %13, align 4, !tbaa !9
  br label %88, !llvm.loop !15

113:                                              ; preds = %95
  br label %114

114:                                              ; preds = %113, %73
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %11, align 4, !tbaa !9
  br label %69, !llvm.loop !16

118:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %128, %118
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = icmp slt i32 %120, 256
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %131

123:                                              ; preds = %119
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [256 x ptr], ptr %5, i64 0, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  call void @free(ptr noundef %127) #5
  br label %128

128:                                              ; preds = %123
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %14, align 4, !tbaa !9
  br label %119, !llvm.loop !17

131:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr %5) #5
  ret void
}

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 }
attributes #6 = { 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 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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"

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @bucketSort(ptr nocapture noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = ptrtoint ptr %0 to i64
  %4 = alloca [256 x ptr], align 16
  %5 = alloca [256 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %5, i8 0, i64 1024, i1 false)
  %6 = sext i32 %1 to i64
  %7 = shl nsw i64 %6, 3
  br label %10

.preheader35:                                     ; preds = %10
  %8 = icmp sgt i32 %1, 0
  br i1 %8, label %.lr.ph.preheader, label %.preheader34.preheader

.lr.ph.preheader:                                 ; preds = %.preheader35
  %wide.trip.count = zext nneg i32 %1 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %9 = icmp eq i32 %1, 1
  br i1 %9, label %.preheader34.preheader.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

10:                                               ; preds = %2, %10
  %indvars.iv = phi i64 [ 0, %2 ], [ %indvars.iv.next, %10 ]
  %11 = tail call noalias ptr @malloc(i64 noundef %7) #6
  %12 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %indvars.iv
  store ptr %11, ptr %12, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %.preheader35, label %10, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv44 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next45.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %13 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv44
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = load i8, ptr %14, align 1, !tbaa !11
  %16 = sext i8 %15 to i64
  %17 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %16
  %20 = load i32, ptr %19, align 4, !tbaa !12
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds ptr, ptr %18, i64 %21
  store ptr %14, ptr %22, align 8, !tbaa !5
  %23 = add nsw i32 %20, 1
  store i32 %23, ptr %19, align 4, !tbaa !12
  %indvars.iv.next45 = or disjoint i64 %indvars.iv44, 1
  %24 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next45
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = load i8, ptr %25, align 1, !tbaa !11
  %27 = sext i8 %26 to i64
  %28 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %27
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds ptr, ptr %29, i64 %32
  store ptr %25, ptr %33, align 8, !tbaa !5
  %34 = add nsw i32 %31, 1
  store i32 %34, ptr %30, align 4, !tbaa !12
  %indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader34.preheader.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

.preheader34.preheader.loopexit.unr-lcssa:        ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv44.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next45.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader34.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader34.preheader.loopexit.unr-lcssa
  %35 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv44.unr
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i64
  %39 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %38
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds ptr, ptr %40, i64 %43
  store ptr %36, ptr %44, align 8, !tbaa !5
  %45 = add nsw i32 %42, 1
  store i32 %45, ptr %41, align 4, !tbaa !12
  br label %.preheader34.preheader

.preheader34.preheader:                           ; preds = %.lr.ph.epil, %.preheader34.preheader.loopexit.unr-lcssa, %.preheader35
  %invariant.gep72 = getelementptr i8, ptr %0, i64 8
  %invariant.gep76 = getelementptr i8, ptr %0, i64 16
  %invariant.gep80 = getelementptr i8, ptr %0, i64 24
  br label %.preheader34

.preheader34:                                     ; preds = %.preheader34.preheader, %.loopexit
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.loopexit ], [ 0, %.preheader34.preheader ]
  %.03040 = phi i32 [ %.2, %.loopexit ], [ 0, %.preheader34.preheader ]
  %46 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %indvars.iv57
  %47 = load i32, ptr %46, align 4, !tbaa !12
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %.loopexit

49:                                               ; preds = %.preheader34
  %50 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %indvars.iv57
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  tail call void @insertionSort(ptr noundef %51, i32 noundef %47)
  %52 = sext i32 %.03040 to i64
  %wide.trip.count55 = zext nneg i32 %47 to i64
  %min.iters.check = icmp ult i32 %47, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %49
  %53 = ptrtoint ptr %51 to i64
  %54 = shl nsw i64 %52, 3
  %55 = add i64 %54, %3
  %56 = sub i64 %55, %53
  %diff.check = icmp ult i64 %56, 32
  br i1 %diff.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count55, 2147483644
  %ind.end = add nsw i64 %n.vec, %52
  %invariant.gep = getelementptr ptr, ptr %0, i64 %52
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %57 = getelementptr inbounds ptr, ptr %51, i64 %index
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %wide.load = load <2 x ptr>, ptr %57, align 8, !tbaa !5
  %wide.load66 = load <2 x ptr>, ptr %58, align 8, !tbaa !5
  %gep = getelementptr ptr, ptr %invariant.gep, i64 %index
  %59 = getelementptr inbounds i8, ptr %gep, i64 16
  store <2 x ptr> %wide.load, ptr %gep, align 8, !tbaa !5
  store <2 x ptr> %wide.load66, ptr %59, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count55
  br i1 %cmp.n, label %.loopexit.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %49
  %indvars.iv50.ph = phi i64 [ %52, %vector.memcheck ], [ %52, %49 ], [ %ind.end, %middle.block ]
  %indvars.iv48.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %49 ], [ %n.vec, %middle.block ]
  %xtraiter68 = and i64 %wide.trip.count55, 3
  %lcmp.mod69.not = icmp eq i64 %xtraiter68, 0
  br i1 %lcmp.mod69.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv50.prol = phi i64 [ %indvars.iv.next51.prol, %scalar.ph.prol ], [ %indvars.iv50.ph, %scalar.ph.preheader ]
  %indvars.iv48.prol = phi i64 [ %indvars.iv.next49.prol, %scalar.ph.prol ], [ %indvars.iv48.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %61 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv48.prol
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %indvars.iv.next51.prol = add nsw i64 %indvars.iv50.prol, 1
  %63 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv50.prol
  store ptr %62, ptr %63, align 8, !tbaa !5
  %indvars.iv.next49.prol = add nuw nsw i64 %indvars.iv48.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter68
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !18

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.next51.lcssa67.unr = phi i64 [ poison, %scalar.ph.preheader ], [ %indvars.iv.next51.prol, %scalar.ph.prol ]
  %indvars.iv50.unr = phi i64 [ %indvars.iv50.ph, %scalar.ph.preheader ], [ %indvars.iv.next51.prol, %scalar.ph.prol ]
  %indvars.iv48.unr = phi i64 [ %indvars.iv48.ph, %scalar.ph.preheader ], [ %indvars.iv.next49.prol, %scalar.ph.prol ]
  %64 = sub nsw i64 %indvars.iv48.ph, %wide.trip.count55
  %65 = icmp ugt i64 %64, -4
  br i1 %65, label %.loopexit.loopexit, label %scalar.ph.preheader.new

scalar.ph.preheader.new:                          ; preds = %scalar.ph.prol.loopexit
  %invariant.gep70 = getelementptr i8, ptr %51, i64 8
  %invariant.gep74 = getelementptr i8, ptr %51, i64 16
  %invariant.gep78 = getelementptr i8, ptr %51, i64 24
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph, %scalar.ph.preheader.new
  %indvars.iv50 = phi i64 [ %indvars.iv50.unr, %scalar.ph.preheader.new ], [ %indvars.iv.next51.3, %scalar.ph ]
  %indvars.iv48 = phi i64 [ %indvars.iv48.unr, %scalar.ph.preheader.new ], [ %indvars.iv.next49.3, %scalar.ph ]
  %66 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv48
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv50
  store ptr %67, ptr %68, align 8, !tbaa !5
  %gep71 = getelementptr ptr, ptr %invariant.gep70, i64 %indvars.iv48
  %69 = load ptr, ptr %gep71, align 8, !tbaa !5
  %gep73 = getelementptr ptr, ptr %invariant.gep72, i64 %indvars.iv50
  store ptr %69, ptr %gep73, align 8, !tbaa !5
  %gep75 = getelementptr ptr, ptr %invariant.gep74, i64 %indvars.iv48
  %70 = load ptr, ptr %gep75, align 8, !tbaa !5
  %gep77 = getelementptr ptr, ptr %invariant.gep76, i64 %indvars.iv50
  store ptr %70, ptr %gep77, align 8, !tbaa !5
  %gep79 = getelementptr ptr, ptr %invariant.gep78, i64 %indvars.iv48
  %71 = load ptr, ptr %gep79, align 8, !tbaa !5
  %indvars.iv.next51.3 = add nsw i64 %indvars.iv50, 4
  %gep81 = getelementptr ptr, ptr %invariant.gep80, i64 %indvars.iv50
  store ptr %71, ptr %gep81, align 8, !tbaa !5
  %indvars.iv.next49.3 = add nuw nsw i64 %indvars.iv48, 4
  %exitcond56.not.3 = icmp eq i64 %indvars.iv.next49.3, %wide.trip.count55
  br i1 %exitcond56.not.3, label %.loopexit.loopexit, label %scalar.ph, !llvm.loop !20

.loopexit.loopexit:                               ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next51.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next51.lcssa67.unr, %scalar.ph.prol.loopexit ], [ %indvars.iv.next51.3, %scalar.ph ]
  %72 = trunc nsw i64 %indvars.iv.next51.lcssa to i32
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader34
  %.2 = phi i32 [ %.03040, %.preheader34 ], [ %72, %.loopexit.loopexit ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next58, 256
  br i1 %exitcond60.not, label %.preheader, label %.preheader34, !llvm.loop !21

73:                                               ; preds = %.preheader
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %4) #5
  ret void

.preheader:                                       ; preds = %.loopexit, %.preheader
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.preheader ], [ 0, %.loopexit ]
  %74 = getelementptr inbounds [256 x ptr], ptr %4, i64 0, i64 %indvars.iv61
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  tail call void @free(ptr noundef %75) #5
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next62, 256
  br i1 %exitcond64.not, label %73, label %.preheader, !llvm.loop !22
}

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 = { nounwind }
attributes #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10, !16}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass