; LLVM IR from DimitrisJim/leetcode_solutions :: C/Algorithms (821)

; 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
define dso_local ptr @shortestToChar(ptr noundef %0, i8 noundef signext %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %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
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i8 %1, ptr %5, align 1, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call i64 @strlen(ptr noundef %19) #4
  %21 = trunc i64 %20 to i32
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %21, ptr %22, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load i32, ptr %23, align 4, !tbaa !10
  %25 = sext i32 %24 to i64
  %26 = mul i64 %25, 4
  %27 = call noalias ptr @malloc(i64 noundef %26) #6
  store ptr %27, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 -1, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !10
  br label %28

28:                                               ; preds = %107, %3
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = icmp ne i8 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %112

33:                                               ; preds = %28
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  %37 = load i8, ptr %5, align 1, !tbaa !9
  %38 = sext i8 %37 to i32
  %39 = icmp eq i32 %36, %38
  br i1 %39, label %40, label %106

40:                                               ; preds = %33
  %41 = load i32, ptr %8, align 4, !tbaa !10
  %42 = icmp eq i32 %41, -1
  br i1 %42, label %43, label %60

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %44 = load i32, ptr %10, align 4, !tbaa !10
  store i32 %44, ptr %12, align 4, !tbaa !10
  br label %45

45:                                               ; preds = %56, %43
  %46 = load i32, ptr %12, align 4, !tbaa !10
  %47 = icmp sge i32 %46, 0
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %45
  %50 = load i32, ptr %12, align 4, !tbaa !10
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !10
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %9, align 4, !tbaa !10
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds i32, ptr %51, i64 %54
  store i32 %50, ptr %55, align 4, !tbaa !10
  br label %56

56:                                               ; preds = %49
  %57 = load i32, ptr %12, align 4, !tbaa !10
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %12, align 4, !tbaa !10
  br label %45, !llvm.loop !12

59:                                               ; preds = %48
  br label %104

60:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %61 = load i32, ptr %10, align 4, !tbaa !10
  %62 = load i32, ptr %8, align 4, !tbaa !10
  %63 = sub nsw i32 %61, %62
  store i32 %63, ptr %13, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %64 = load i32, ptr %13, align 4, !tbaa !10
  %65 = sdiv i32 %64, 2
  store i32 %65, ptr %14, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !10
  br label %66

66:                                               ; preds = %84, %60
  %67 = load i32, ptr %15, align 4, !tbaa !10
  %68 = load i32, ptr %14, align 4, !tbaa !10
  %69 = load i32, ptr %13, align 4, !tbaa !10
  %70 = srem i32 %69, 2
  %71 = add nsw i32 %68, %70
  %72 = icmp slt i32 %67, %71
  %73 = zext i1 %72 to i64
  %74 = select i1 %72, i32 1, i32 0
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %77, label %76

76:                                               ; preds = %66
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %87

77:                                               ; preds = %66
  %78 = load i32, ptr %15, align 4, !tbaa !10
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load i32, ptr %9, align 4, !tbaa !10
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %9, align 4, !tbaa !10
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds i32, ptr %79, i64 %82
  store i32 %78, ptr %83, align 4, !tbaa !10
  br label %84

84:                                               ; preds = %77
  %85 = load i32, ptr %15, align 4, !tbaa !10
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %15, align 4, !tbaa !10
  br label %66, !llvm.loop !14

87:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %88 = load i32, ptr %14, align 4, !tbaa !10
  store i32 %88, ptr %16, align 4, !tbaa !10
  br label %89

89:                                               ; preds = %100, %87
  %90 = load i32, ptr %16, align 4, !tbaa !10
  %91 = icmp sge i32 %90, 0
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %103

93:                                               ; preds = %89
  %94 = load i32, ptr %16, align 4, !tbaa !10
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !10
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %9, align 4, !tbaa !10
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds i32, ptr %95, i64 %98
  store i32 %94, ptr %99, align 4, !tbaa !10
  br label %100

100:                                              ; preds = %93
  %101 = load i32, ptr %16, align 4, !tbaa !10
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %16, align 4, !tbaa !10
  br label %89, !llvm.loop !15

103:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %104

104:                                              ; preds = %103, %59
  %105 = load i32, ptr %10, align 4, !tbaa !10
  store i32 %105, ptr %8, align 4, !tbaa !10
  br label %106

106:                                              ; preds = %104, %33
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i32 1
  store ptr %109, ptr %4, align 8, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !10
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !10
  br label %28, !llvm.loop !16

112:                                              ; preds = %32
  %113 = load i32, ptr %8, align 4, !tbaa !10
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load i32, ptr %114, align 4, !tbaa !10
  %116 = icmp ne i32 %113, %115
  br i1 %116, label %117, label %138

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load i32, ptr %118, align 4, !tbaa !10
  %120 = load i32, ptr %8, align 4, !tbaa !10
  %121 = sub nsw i32 %119, %120
  store i32 %121, ptr %17, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !10
  br label %122

122:                                              ; preds = %134, %117
  %123 = load i32, ptr %18, align 4, !tbaa !10
  %124 = load i32, ptr %17, align 4, !tbaa !10
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %127, label %126

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

127:                                              ; preds = %122
  %128 = load i32, ptr %18, align 4, !tbaa !10
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !10
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %9, align 4, !tbaa !10
  %132 = sext i32 %130 to i64
  %133 = getelementptr inbounds i32, ptr %129, i64 %132
  store i32 %128, ptr %133, align 4, !tbaa !10
  br label %134

134:                                              ; preds = %127
  %135 = load i32, ptr %18, align 4, !tbaa !10
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %18, align 4, !tbaa !10
  br label %122, !llvm.loop !17

137:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %138

138:                                              ; preds = %137, %112
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret ptr %139
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

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

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

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

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 = { nounwind willreturn memory(read) "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 willreturn memory(read) }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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: nofree nounwind uwtable
define dso_local noalias noundef ptr @shortestToChar(ptr nocapture noundef readonly %0, i8 noundef signext %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  %4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #3
  %5 = trunc i64 %4 to i32
  store i32 %5, ptr %2, align 4, !tbaa !5
  %sext = shl i64 %4, 32
  %6 = ashr exact i64 %sext, 30
  %7 = tail call noalias ptr @malloc(i64 noundef %6) #4
  %8 = load i8, ptr %0, align 1, !tbaa !9
  %.not66 = icmp eq i8 %8, 0
  br i1 %.not66, label %._crit_edge, label %.lr.ph71

._crit_edge.loopexit:                             ; preds = %.loopexit53
  %9 = sext i32 %.5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %3
  %.046.lcssa = phi i64 [ 0, %3 ], [ %9, %._crit_edge.loopexit ]
  %.045.lcssa = phi i32 [ -1, %3 ], [ %.1, %._crit_edge.loopexit ]
  %.not52 = icmp eq i32 %.045.lcssa, %5
  br i1 %.not52, label %.loopexit, label %51

.lr.ph71:                                         ; preds = %3, %.loopexit53
  %indvar = phi i64 [ %indvar.next, %.loopexit53 ], [ 0, %3 ]
  %10 = phi i8 [ %50, %.loopexit53 ], [ %8, %3 ]
  %.04270 = phi ptr [ %48, %.loopexit53 ], [ %0, %3 ]
  %.04569 = phi i32 [ %.1, %.loopexit53 ], [ -1, %3 ]
  %.04668 = phi i32 [ %.5, %.loopexit53 ], [ 0, %3 ]
  %.04967 = phi i32 [ %49, %.loopexit53 ], [ 0, %3 ]
  %11 = add i64 %indvar, 1
  %12 = icmp eq i8 %10, %1
  br i1 %12, label %13, label %.loopexit53

13:                                               ; preds = %.lr.ph71
  %14 = icmp eq i32 %.04569, -1
  br i1 %14, label %.lr.ph64.preheader, label %21

.lr.ph64.preheader:                               ; preds = %13
  %15 = sext i32 %.04668 to i64
  %min.iters.check = icmp ult i64 %11, 8
  br i1 %min.iters.check, label %.lr.ph64.preheader159, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph64.preheader
  %n.vec = and i64 %11, -8
  %ind.end = add i64 %n.vec, %15
  %.cast = trunc i64 %n.vec to i32
  %ind.end92 = sub i32 %.04967, %.cast
  %.splatinsert = insertelement <4 x i32> poison, i32 %.04967, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add nsw <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3>
  %invariant.gep170 = getelementptr i32, ptr %7, i64 %15
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 -4, i32 -4, i32 -4, i32 -4>
  %gep171 = getelementptr i32, ptr %invariant.gep170, i64 %index
  %16 = getelementptr inbounds i8, ptr %gep171, i64 16
  store <4 x i32> %vec.ind, ptr %gep171, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %16, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8>
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %11, %n.vec
  br i1 %cmp.n, label %.loopexit53.loopexit, label %.lr.ph64.preheader159

.lr.ph64.preheader159:                            ; preds = %middle.block, %.lr.ph64.preheader
  %indvars.iv85.ph = phi i64 [ %15, %.lr.ph64.preheader ], [ %ind.end, %middle.block ]
  %.04862.ph = phi i32 [ %.04967, %.lr.ph64.preheader ], [ %ind.end92, %middle.block ]
  br label %.lr.ph64

.lr.ph64:                                         ; preds = %.lr.ph64.preheader159, %.lr.ph64
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph64 ], [ %indvars.iv85.ph, %.lr.ph64.preheader159 ]
  %.04862 = phi i32 [ %19, %.lr.ph64 ], [ %.04862.ph, %.lr.ph64.preheader159 ]
  %indvars.iv.next86 = add nsw i64 %indvars.iv85, 1
  %18 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv85
  store i32 %.04862, ptr %18, align 4, !tbaa !5
  %19 = add nsw i32 %.04862, -1
  %20 = icmp sgt i32 %.04862, 0
  br i1 %20, label %.lr.ph64, label %.loopexit53.loopexit, !llvm.loop !14

21:                                               ; preds = %13
  %22 = sub nsw i32 %.04967, %.04569
  %23 = sdiv i32 %22, 2
  %24 = srem i32 %22, 2
  %25 = add nsw i32 %23, %24
  %26 = icmp sgt i32 %25, 1
  br i1 %26, label %.lr.ph.preheader, label %.preheader54

.lr.ph.preheader:                                 ; preds = %21
  %27 = sext i32 %.04668 to i64
  %28 = add nsw i32 %24, -2
  %29 = add nsw i32 %28, %23
  %30 = zext i32 %29 to i64
  %31 = add nuw nsw i64 %30, 1
  %min.iters.check120 = icmp ult i32 %29, 7
  br i1 %min.iters.check120, label %.lr.ph.preheader161, label %vector.ph121

.lr.ph.preheader161:                              ; preds = %middle.block118, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ %27, %.lr.ph.preheader ], [ %ind.end124, %middle.block118 ]
  %.04457.ph = phi i32 [ 1, %.lr.ph.preheader ], [ %ind.end127, %middle.block118 ]
  br label %.lr.ph

vector.ph121:                                     ; preds = %.lr.ph.preheader
  %n.vec123 = and i64 %31, 8589934584
  %ind.end124 = add nsw i64 %n.vec123, %27
  %.cast126 = trunc i64 %n.vec123 to i32
  %ind.end127 = or disjoint i32 %.cast126, 1
  %invariant.gep = getelementptr i32, ptr %7, i64 %27
  br label %vector.body129

vector.body129:                                   ; preds = %vector.body129, %vector.ph121
  %index130 = phi i64 [ 0, %vector.ph121 ], [ %index.next136, %vector.body129 ]
  %vec.ind131 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph121 ], [ %vec.ind.next134, %vector.body129 ]
  %step.add132 = add <4 x i32> %vec.ind131, <i32 4, i32 4, i32 4, i32 4>
  %gep = getelementptr i32, ptr %invariant.gep, i64 %index130
  %32 = getelementptr inbounds i8, ptr %gep, i64 16
  store <4 x i32> %vec.ind131, ptr %gep, align 4, !tbaa !5
  store <4 x i32> %step.add132, ptr %32, align 4, !tbaa !5
  %index.next136 = add nuw i64 %index130, 8
  %vec.ind.next134 = add <4 x i32> %vec.ind131, <i32 8, i32 8, i32 8, i32 8>
  %33 = icmp eq i64 %index.next136, %n.vec123
  br i1 %33, label %middle.block118, label %vector.body129, !llvm.loop !15

middle.block118:                                  ; preds = %vector.body129
  %cmp.n137 = icmp eq i64 %31, %n.vec123
  br i1 %cmp.n137, label %.preheader54.loopexit, label %.lr.ph.preheader161

.preheader54.loopexit:                            ; preds = %.lr.ph, %middle.block118
  %indvars.iv.next.lcssa = phi i64 [ %ind.end124, %middle.block118 ], [ %indvars.iv.next, %.lr.ph ]
  %34 = trunc nsw i64 %indvars.iv.next.lcssa to i32
  br label %.preheader54

.preheader54:                                     ; preds = %.preheader54.loopexit, %21
  %.2.lcssa = phi i32 [ %.04668, %21 ], [ %34, %.preheader54.loopexit ]
  %35 = icmp sgt i32 %22, -2
  br i1 %35, label %.lr.ph60.preheader, label %.loopexit53

.lr.ph60.preheader:                               ; preds = %.preheader54
  %36 = sext i32 %.2.lcssa to i64
  %37 = add nsw i32 %23, 1
  %38 = zext i32 %37 to i64
  %min.iters.check97 = icmp ult i32 %37, 8
  br i1 %min.iters.check97, label %.lr.ph60.preheader160, label %vector.ph98

.lr.ph60.preheader160:                            ; preds = %middle.block95, %.lr.ph60.preheader
  %indvars.iv82.ph = phi i64 [ %36, %.lr.ph60.preheader ], [ %ind.end101, %middle.block95 ]
  %.04359.ph = phi i32 [ %23, %.lr.ph60.preheader ], [ %ind.end104, %middle.block95 ]
  br label %.lr.ph60

vector.ph98:                                      ; preds = %.lr.ph60.preheader
  %n.vec100 = and i64 %38, 4294967288
  %ind.end101 = add nsw i64 %n.vec100, %36
  %.cast103 = trunc nuw i64 %n.vec100 to i32
  %ind.end104 = sub i32 %23, %.cast103
  %.splatinsert108 = insertelement <4 x i32> poison, i32 %23, i64 0
  %.splat109 = shufflevector <4 x i32> %.splatinsert108, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction110 = add <4 x i32> %.splat109, <i32 0, i32 -1, i32 -2, i32 -3>
  %invariant.gep168 = getelementptr i32, ptr %7, i64 %36
  br label %vector.body106

vector.body106:                                   ; preds = %vector.body106, %vector.ph98
  %index107 = phi i64 [ 0, %vector.ph98 ], [ %index.next116, %vector.body106 ]
  %vec.ind111 = phi <4 x i32> [ %induction110, %vector.ph98 ], [ %vec.ind.next114, %vector.body106 ]
  %step.add112 = add <4 x i32> %vec.ind111, <i32 -4, i32 -4, i32 -4, i32 -4>
  %gep169 = getelementptr i32, ptr %invariant.gep168, i64 %index107
  %39 = getelementptr inbounds i8, ptr %gep169, i64 16
  store <4 x i32> %vec.ind111, ptr %gep169, align 4, !tbaa !5
  store <4 x i32> %step.add112, ptr %39, align 4, !tbaa !5
  %index.next116 = add nuw i64 %index107, 8
  %vec.ind.next114 = add <4 x i32> %vec.ind111, <i32 -8, i32 -8, i32 -8, i32 -8>
  %40 = icmp eq i64 %index.next116, %n.vec100
  br i1 %40, label %middle.block95, label %vector.body106, !llvm.loop !16

middle.block95:                                   ; preds = %vector.body106
  %cmp.n117 = icmp eq i64 %n.vec100, %38
  br i1 %cmp.n117, label %.loopexit53.loopexit78, label %.lr.ph60.preheader160

.lr.ph:                                           ; preds = %.lr.ph.preheader161, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader161 ]
  %.04457 = phi i32 [ %42, %.lr.ph ], [ %.04457.ph, %.lr.ph.preheader161 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %41 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv
  store i32 %.04457, ptr %41, align 4, !tbaa !5
  %42 = add nuw nsw i32 %.04457, 1
  %exitcond.not = icmp eq i32 %42, %25
  br i1 %exitcond.not, label %.preheader54.loopexit, label %.lr.ph, !llvm.loop !17

.lr.ph60:                                         ; preds = %.lr.ph60.preheader160, %.lr.ph60
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph60 ], [ %indvars.iv82.ph, %.lr.ph60.preheader160 ]
  %.04359 = phi i32 [ %44, %.lr.ph60 ], [ %.04359.ph, %.lr.ph60.preheader160 ]
  %indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
  %43 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv82
  store i32 %.04359, ptr %43, align 4, !tbaa !5
  %44 = add nsw i32 %.04359, -1
  %45 = icmp sgt i32 %.04359, 0
  br i1 %45, label %.lr.ph60, label %.loopexit53.loopexit78, !llvm.loop !18

.loopexit53.loopexit:                             ; preds = %.lr.ph64, %middle.block
  %indvars.iv.next86.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next86, %.lr.ph64 ]
  %46 = trunc nsw i64 %indvars.iv.next86.lcssa to i32
  br label %.loopexit53

.loopexit53.loopexit78:                           ; preds = %.lr.ph60, %middle.block95
  %indvars.iv.next83.lcssa = phi i64 [ %ind.end101, %middle.block95 ], [ %indvars.iv.next83, %.lr.ph60 ]
  %47 = trunc nsw i64 %indvars.iv.next83.lcssa to i32
  br label %.loopexit53

.loopexit53:                                      ; preds = %.loopexit53.loopexit78, %.loopexit53.loopexit, %.preheader54, %.lr.ph71
  %.5 = phi i32 [ %.04668, %.lr.ph71 ], [ %.2.lcssa, %.preheader54 ], [ %46, %.loopexit53.loopexit ], [ %47, %.loopexit53.loopexit78 ]
  %.1 = phi i32 [ %.04569, %.lr.ph71 ], [ %.04967, %.preheader54 ], [ %.04967, %.loopexit53.loopexit ], [ %.04967, %.loopexit53.loopexit78 ]
  %48 = getelementptr inbounds i8, ptr %.04270, i64 1
  %49 = add nuw nsw i32 %.04967, 1
  %50 = load i8, ptr %48, align 1, !tbaa !9
  %.not = icmp eq i8 %50, 0
  %indvar.next = add i64 %indvar, 1
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph71, !llvm.loop !19

51:                                               ; preds = %._crit_edge
  %52 = sub nsw i32 %5, %.045.lcssa
  %53 = icmp sgt i32 %52, 1
  br i1 %53, label %.lr.ph77.preheader, label %.loopexit

.lr.ph77.preheader:                               ; preds = %51
  %54 = add i32 %5, -2
  %55 = sub i32 %54, %.045.lcssa
  %56 = zext i32 %55 to i64
  %57 = add nuw nsw i64 %56, 1
  %min.iters.check140 = icmp ult i32 %55, 7
  br i1 %min.iters.check140, label %.lr.ph77.preheader158, label %vector.ph141

vector.ph141:                                     ; preds = %.lr.ph77.preheader
  %n.vec143 = and i64 %57, 8589934584
  %ind.end144 = add nsw i64 %.046.lcssa, %n.vec143
  %.cast146 = trunc i64 %n.vec143 to i32
  %ind.end147 = or disjoint i32 %.cast146, 1
  %58 = getelementptr i32, ptr %7, i64 %.046.lcssa
  br label %vector.body149

vector.body149:                                   ; preds = %vector.body149, %vector.ph141
  %index150 = phi i64 [ 0, %vector.ph141 ], [ %index.next156, %vector.body149 ]
  %vec.ind151 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph141 ], [ %vec.ind.next154, %vector.body149 ]
  %step.add152 = add <4 x i32> %vec.ind151, <i32 4, i32 4, i32 4, i32 4>
  %59 = getelementptr i32, ptr %58, i64 %index150
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  store <4 x i32> %vec.ind151, ptr %59, align 4, !tbaa !5
  store <4 x i32> %step.add152, ptr %60, align 4, !tbaa !5
  %index.next156 = add nuw i64 %index150, 8
  %vec.ind.next154 = add <4 x i32> %vec.ind151, <i32 8, i32 8, i32 8, i32 8>
  %61 = icmp eq i64 %index.next156, %n.vec143
  br i1 %61, label %middle.block138, label %vector.body149, !llvm.loop !20

middle.block138:                                  ; preds = %vector.body149
  %cmp.n157 = icmp eq i64 %57, %n.vec143
  br i1 %cmp.n157, label %.loopexit, label %.lr.ph77.preheader158

.lr.ph77.preheader158:                            ; preds = %middle.block138, %.lr.ph77.preheader
  %indvars.iv88.ph = phi i64 [ %.046.lcssa, %.lr.ph77.preheader ], [ %ind.end144, %middle.block138 ]
  %.075.ph = phi i32 [ 1, %.lr.ph77.preheader ], [ %ind.end147, %middle.block138 ]
  br label %.lr.ph77

.lr.ph77:                                         ; preds = %.lr.ph77.preheader158, %.lr.ph77
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph77 ], [ %indvars.iv88.ph, %.lr.ph77.preheader158 ]
  %.075 = phi i32 [ %63, %.lr.ph77 ], [ %.075.ph, %.lr.ph77.preheader158 ]
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, 1
  %62 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv88
  store i32 %.075, ptr %62, align 4, !tbaa !5
  %63 = add nuw nsw i32 %.075, 1
  %exitcond91.not = icmp eq i32 %63, %52
  br i1 %exitcond91.not, label %.loopexit, label %.lr.ph77, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph77, %middle.block138, %51, %._crit_edge
  ret ptr %7
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) 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

attributes #0 = { nofree 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 memory(argmem: read) "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 = { nounwind willreturn memory(read) }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11, !12, !13}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11, !13, !12}
!18 = distinct !{!18, !11, !13, !12}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11, !12, !13}
!21 = distinct !{!21, !11, !13, !12}


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