; LLVM IR from kaynewbie/algorithm :: algorithm/LeetCode/Easy (longest-palindromic-substring)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @formatString(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @longestPalindromicSubstringByManacher(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %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 ptr, align 8
  %17 = 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 8, ptr %5) #6
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = call ptr @formatString(ptr noundef %18, i32 noundef %19)
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = mul nsw i32 %21, 2
  %23 = add nsw i32 %22, 3
  store i32 %23, ptr %6, align 4, !tbaa !9
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %7, align 8
  %27 = alloca i32, i64 %25, align 16
  store i64 %25, ptr %8, align 8
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = mul i64 4, %29
  call void @llvm.memset.p0.i64(ptr align 16 %27, i8 0, i64 %30, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %122, %2
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sub nsw i32 %33, 1
  %35 = icmp slt i32 %32, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %125

37:                                               ; preds = %31
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = mul nsw i32 2, %38
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = sub nsw i32 %39, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %27, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = sub nsw i32 %45, %46
  %48 = icmp sgt i32 %44, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %37
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = sub nsw i32 %50, %51
  br label %61

53:                                               ; preds = %37
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = mul nsw i32 2, %54
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = sub nsw i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %27, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %53, %49
  %62 = phi i32 [ %52, %49 ], [ %60, %53 ]
  store i32 %62, ptr %11, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = icmp sgt i32 %63, %64
  br i1 %65, label %66, label %68

66:                                               ; preds = %61
  %67 = load i32, ptr %11, align 4, !tbaa !9
  br label %69

68:                                               ; preds = %61
  br label %69

69:                                               ; preds = %68, %66
  %70 = phi i32 [ %67, %66 ], [ 1, %68 ]
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %27, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %98, %69
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %27, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = add nsw i32 %76, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %75, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %27, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = sub nsw i32 %87, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %86, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !11
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %85, %96
  br i1 %97, label %98, label %104

98:                                               ; preds = %74
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %27, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %101, align 4, !tbaa !9
  br label %74, !llvm.loop !12

104:                                              ; preds = %74
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %27, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = add nsw i32 %105, %109
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = icmp sgt i32 %110, %111
  br i1 %112, label %113, label %121

113:                                              ; preds = %104
  %114 = load i32, ptr %12, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %27, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = add nsw i32 %114, %118
  store i32 %119, ptr %9, align 4, !tbaa !9
  %120 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %120, ptr %10, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %113, %104
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !9
  br label %31, !llvm.loop !14

125:                                              ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %146, %125
  %127 = load i32, ptr %15, align 4, !tbaa !9
  %128 = load i32, ptr %6, align 4, !tbaa !9
  %129 = sub nsw i32 %128, 1
  %130 = icmp slt i32 %127, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %149

132:                                              ; preds = %126
  %133 = load i32, ptr %15, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr %27, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = load i32, ptr %13, align 4, !tbaa !9
  %138 = icmp sgt i32 %136, %137
  br i1 %138, label %139, label %145

139:                                              ; preds = %132
  %140 = load i32, ptr %15, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %27, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  store i32 %143, ptr %13, align 4, !tbaa !9
  %144 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %144, ptr %14, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %139, %132
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %15, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %15, align 4, !tbaa !9
  br label %126, !llvm.loop !15

149:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = mul i64 1, %151
  %153 = call noalias ptr @malloc(i64 noundef %152) #7
  store ptr %153, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = sub nsw i32 %154, %155
  %157 = sdiv i32 %156, 2
  store i32 %157, ptr %17, align 4, !tbaa !9
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = load i32, ptr %17, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i8, ptr %159, i64 %161
  %163 = load i32, ptr %13, align 4, !tbaa !9
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = mul i64 1, %165
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %158, ptr align 1 %162, i64 %166, i1 false)
  %167 = load ptr, ptr %16, align 8, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %167, i64 %169
  %171 = getelementptr inbounds i8, ptr %170, i64 -1
  store i8 0, ptr %171, align 1, !tbaa !11
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %173 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %173)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret ptr %172
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @formatString(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @longestPalindromicSubstringByManacher(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = tail call ptr @formatString(ptr noundef %0, i32 noundef %1)
  %4 = shl i32 %1, 1
  %5 = add nsw i32 %4, 3
  %6 = zext i32 %5 to i64
  %7 = alloca i32, i64 %6, align 16
  %8 = sext i32 %5 to i64
  %9 = shl nsw i64 %8, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %7, i8 0, i64 %9, i1 false)
  %10 = icmp sgt i32 %1, -1
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %11 = add i32 %4, 2
  %smax = tail call i32 @llvm.smax.i32(i32 %11, i32 2)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.lr.ph

.preheader:                                       ; preds = %34
  br i1 %10, label %.lr.ph73.preheader, label %._crit_edge

.lr.ph73.preheader:                               ; preds = %.preheader
  %12 = add nsw i64 %wide.trip.count, -1
  %13 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %12, 3
  %14 = icmp ult i64 %13, 3
  br i1 %14, label %.lr.ph73.epil.preheader, label %.lr.ph73.preheader.new

.lr.ph73.preheader.new:                           ; preds = %.lr.ph73.preheader
  %unroll_iter = and i64 %12, -4
  br label %.lr.ph73

.lr.ph:                                           ; preds = %.lr.ph.preheader, %34
  %indvars.iv77 = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next78, %34 ]
  %.069 = phi i32 [ 0, %.lr.ph.preheader ], [ %spec.select63, %34 ]
  %.05068 = phi i32 [ 0, %.lr.ph.preheader ], [ %spec.select, %34 ]
  %15 = shl nsw i32 %.05068, 1
  %16 = sext i32 %15 to i64
  %17 = sub nsw i64 %16, %indvars.iv77
  %18 = getelementptr inbounds i32, ptr %7, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = trunc nuw nsw i64 %indvars.iv77 to i32
  %21 = sub nsw i32 %.069, %20
  %. = tail call i32 @llvm.smin.i32(i32 %19, i32 %21)
  %22 = sext i32 %.069 to i64
  %23 = icmp slt i64 %indvars.iv77, %22
  %24 = sext i32 %. to i64
  %25 = select i1 %23, i64 %24, i64 1
  br label %26

26:                                               ; preds = %26, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %26 ], [ %25, %.lr.ph ]
  %27 = add nsw i64 %indvars.iv, %indvars.iv77
  %28 = getelementptr inbounds i8, ptr %3, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sub nsw i64 %indvars.iv77, %indvars.iv
  %31 = getelementptr inbounds i8, ptr %3, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = icmp eq i8 %29, %32
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  br i1 %33, label %26, label %34, !llvm.loop !10

34:                                               ; preds = %26
  %35 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv77
  %36 = trunc nsw i64 %indvars.iv to i32
  %37 = trunc nsw i64 %27 to i32
  store i32 %36, ptr %35, align 4, !tbaa !5
  %38 = icmp slt i32 %.069, %37
  %spec.select = select i1 %38, i32 %20, i32 %.05068
  %spec.select63 = tail call i32 @llvm.smax.i32(i32 %37, i32 %.069)
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !12

.lr.ph73.epil.preheader:                          ; preds = %.lr.ph73.preheader, %.lr.ph73
  %indvars.iv80.unr = phi i64 [ 1, %.lr.ph73.preheader ], [ %indvars.iv.next81.3, %.lr.ph73 ]
  %.05371.unr = phi i32 [ 0, %.lr.ph73.preheader ], [ %spec.select65.3, %.lr.ph73 ]
  %.05570.unr = phi i32 [ 0, %.lr.ph73.preheader ], [ %spec.select64.3, %.lr.ph73 ]
  br label %.lr.ph73.epil

.lr.ph73.epil:                                    ; preds = %.lr.ph73.epil, %.lr.ph73.epil.preheader
  %indvars.iv80.epil = phi i64 [ %indvars.iv80.unr, %.lr.ph73.epil.preheader ], [ %indvars.iv.next81.epil, %.lr.ph73.epil ]
  %.05371.epil = phi i32 [ %.05371.unr, %.lr.ph73.epil.preheader ], [ %spec.select65.epil, %.lr.ph73.epil ]
  %.05570.epil = phi i32 [ %.05570.unr, %.lr.ph73.epil.preheader ], [ %spec.select64.epil, %.lr.ph73.epil ]
  %epil.iter = phi i64 [ 0, %.lr.ph73.epil.preheader ], [ %epil.iter.next, %.lr.ph73.epil ]
  %39 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv80.epil
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, %.05570.epil
  %spec.select64.epil = tail call i32 @llvm.smax.i32(i32 %40, i32 %.05570.epil)
  %42 = trunc nuw nsw i64 %indvars.iv80.epil to i32
  %spec.select65.epil = select i1 %41, i32 %42, i32 %.05371.epil
  %indvars.iv.next81.epil = add nuw nsw i64 %indvars.iv80.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph73.epil, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph73.epil, %2, %.preheader
  %.055.lcssa = phi i32 [ 0, %.preheader ], [ 0, %2 ], [ %spec.select64.epil, %.lr.ph73.epil ]
  %.053.lcssa = phi i32 [ 0, %.preheader ], [ 0, %2 ], [ %spec.select65.epil, %.lr.ph73.epil ]
  %43 = zext nneg i32 %.055.lcssa to i64
  %44 = tail call noalias ptr @malloc(i64 noundef %43) #5
  %45 = sub nsw i32 %.053.lcssa, %.055.lcssa
  %46 = sdiv i32 %45, 2
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %0, i64 %47
  %49 = add nsw i32 %.055.lcssa, -1
  %50 = sext i32 %49 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 %48, i64 %50, i1 false)
  %51 = getelementptr inbounds i8, ptr %44, i64 %43
  %52 = getelementptr inbounds i8, ptr %51, i64 -1
  store i8 0, ptr %52, align 1, !tbaa !9
  ret ptr %44

.lr.ph73:                                         ; preds = %.lr.ph73, %.lr.ph73.preheader.new
  %indvars.iv80 = phi i64 [ 1, %.lr.ph73.preheader.new ], [ %indvars.iv.next81.3, %.lr.ph73 ]
  %.05371 = phi i32 [ 0, %.lr.ph73.preheader.new ], [ %spec.select65.3, %.lr.ph73 ]
  %.05570 = phi i32 [ 0, %.lr.ph73.preheader.new ], [ %spec.select64.3, %.lr.ph73 ]
  %niter = phi i64 [ 0, %.lr.ph73.preheader.new ], [ %niter.next.3, %.lr.ph73 ]
  %53 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv80
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, %.05570
  %spec.select64 = tail call i32 @llvm.smax.i32(i32 %54, i32 %.05570)
  %56 = trunc nuw nsw i64 %indvars.iv80 to i32
  %spec.select65 = select i1 %55, i32 %56, i32 %.05371
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %57 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next81
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, %spec.select64
  %spec.select64.1 = tail call i32 @llvm.smax.i32(i32 %58, i32 %spec.select64)
  %60 = trunc nuw nsw i64 %indvars.iv.next81 to i32
  %spec.select65.1 = select i1 %59, i32 %60, i32 %spec.select65
  %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
  %61 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next81.1
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, %spec.select64.1
  %spec.select64.2 = tail call i32 @llvm.smax.i32(i32 %62, i32 %spec.select64.1)
  %64 = trunc nuw nsw i64 %indvars.iv.next81.1 to i32
  %spec.select65.2 = select i1 %63, i32 %64, i32 %spec.select65.1
  %indvars.iv.next81.2 = add nuw nsw i64 %indvars.iv80, 3
  %65 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next81.2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, %spec.select64.2
  %spec.select64.3 = tail call i32 @llvm.smax.i32(i32 %66, i32 %spec.select64.2)
  %68 = trunc nuw nsw i64 %indvars.iv.next81.2 to i32
  %spec.select65.3 = select i1 %67, i32 %68, i32 %spec.select65.2
  %indvars.iv.next81.3 = add nuw nsw i64 %indvars.iv80, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.lr.ph73.epil.preheader, label %.lr.ph73, !llvm.loop !15
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !11}


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