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

@.str = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @longestPalindromicSubstring(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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 ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  store i32 -1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %66, %2
  %16 = load i32, ptr %11, align 4, !tbaa !9
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  %21 = load i32, ptr %11, align 4, !tbaa !9
  %22 = sub nsw i32 %21, 1
  store i32 %22, ptr %6, align 4, !tbaa !9
  %23 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %23, ptr %7, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %47, %20
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = icmp sge i32 %25, 0
  br i1 %26, label %27, label %45

27:                                               ; preds = %24
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %31, label %45

31:                                               ; preds = %27
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %32, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %38, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = icmp eq i32 %37, %43
  br label %45

45:                                               ; preds = %31, %27, %24
  %46 = phi i1 [ false, %27 ], [ false, %24 ], [ %44, %31 ]
  br i1 %46, label %47, label %52

47:                                               ; preds = %45
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %6, align 4, !tbaa !9
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %7, align 4, !tbaa !9
  br label %24, !llvm.loop !12

52:                                               ; preds = %45
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = sub nsw i32 %53, %54
  store i32 %55, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = mul nsw i32 %56, 2
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp sgt i32 %57, %58
  br i1 %59, label %60, label %65

60:                                               ; preds = %52
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = mul nsw i32 %61, 2
  store i32 %62, ptr %9, align 4, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %10, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %60, %52
  br label %66

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

69:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %124, %69
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = sub nsw i32 %72, 1
  %74 = icmp slt i32 %71, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %127

76:                                               ; preds = %70
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !9
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %7, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %104, %76
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = icmp sge i32 %82, 0
  br i1 %83, label %84, label %102

84:                                               ; preds = %81
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %102

88:                                               ; preds = %84
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = sext i8 %93 to i32
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !11
  %100 = sext i8 %99 to i32
  %101 = icmp eq i32 %94, %100
  br label %102

102:                                              ; preds = %88, %84, %81
  %103 = phi i1 [ false, %84 ], [ false, %81 ], [ %101, %88 ]
  br i1 %103, label %104, label %109

104:                                              ; preds = %102
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %6, align 4, !tbaa !9
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %7, align 4, !tbaa !9
  br label %81, !llvm.loop !15

109:                                              ; preds = %102
  %110 = load i32, ptr %7, align 4, !tbaa !9
  %111 = sub nsw i32 %110, 1
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = sub nsw i32 %111, %112
  %114 = mul nsw i32 %113, 2
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %8, align 4, !tbaa !9
  %116 = load i32, ptr %8, align 4, !tbaa !9
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = icmp sgt i32 %116, %117
  br i1 %118, label %119, label %123

119:                                              ; preds = %109
  %120 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %120, ptr %9, align 4, !tbaa !9
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %10, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %119, %109
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %12, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %12, align 4, !tbaa !9
  br label %70, !llvm.loop !16

127:                                              ; preds = %75
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = load i32, ptr %9, align 4, !tbaa !9
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %128, i32 noundef %129)
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %133, label %152

133:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = mul i64 1, %136
  %138 = call noalias ptr @malloc(i64 noundef %137) #6
  store ptr %138, ptr %13, align 8, !tbaa !5
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load i32, ptr %10, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %140, i64 %142
  %144 = load i32, ptr %9, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = mul i64 1, %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %139, ptr align 1 %143, i64 %146, i1 false)
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  store i8 0, ptr %150, align 1, !tbaa !11
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %151, ptr %3, align 8
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %153

152:                                              ; preds = %127
  store ptr null, ptr %3, align 8
  store i32 1, ptr %14, align 4
  br label %153

153:                                              ; preds = %152, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  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 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %154 = load ptr, ptr %3, align 8
  ret ptr %154
}

; 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

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

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

; 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) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !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"

@.str = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noalias noundef ptr @longestPalindromicSubstring(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = icmp sgt i32 %1, 1
  br i1 %3, label %.preheader72.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %2
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef -1, i32 noundef 0)
  br label %44

.preheader72.preheader:                           ; preds = %2
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.preheader72

.preheader72:                                     ; preds = %.preheader72.preheader, %.critedge
  %indvars.iv = phi i64 [ 1, %.preheader72.preheader ], [ %indvars.iv.next, %.critedge ]
  %.05578 = phi i32 [ -1, %.preheader72.preheader ], [ %spec.select68, %.critedge ]
  %.05677 = phi i32 [ 0, %.preheader72.preheader ], [ %spec.select, %.critedge ]
  %indvars104 = trunc i64 %indvars.iv to i32
  br label %6

.preheader:                                       ; preds = %.critedge
  %.not131 = icmp eq i32 %1, 2
  br i1 %.not131, label %._crit_edge, label %.lr.ph93.preheader

.lr.ph93.preheader:                               ; preds = %.preheader
  %5 = add nsw i32 %1, -1
  %wide.trip.count119 = zext nneg i32 %5 to i64
  br label %.lr.ph.preheader

6:                                                ; preds = %.preheader72, %13
  %indvars.iv98 = phi i64 [ %indvars.iv, %.preheader72 ], [ %indvars.iv.next99, %13 ]
  %indvars.iv96 = phi i64 [ %indvars.iv, %.preheader72 ], [ %indvars.iv.next97, %13 ]
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, -1
  %7 = and i64 %indvars.iv.next99, 4294967295
  %8 = getelementptr inbounds i8, ptr %0, i64 %7
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv96
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = icmp eq i8 %9, %11
  br i1 %12, label %13, label %.critedge.split.loop.exit125

13:                                               ; preds = %6
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %indvars = trunc i64 %indvars.iv.next97 to i32
  %14 = icmp sgt i64 %indvars.iv98, 1
  %15 = icmp slt i32 %indvars, %1
  %or.cond = select i1 %14, i1 %15, i1 false
  br i1 %or.cond, label %6, label %.critedge, !llvm.loop !8

.critedge.split.loop.exit125:                     ; preds = %6
  %16 = trunc nuw nsw i64 %indvars.iv96 to i32
  br label %.critedge

.critedge:                                        ; preds = %13, %.critedge.split.loop.exit125
  %.062.in.lcssa.in = phi i64 [ %indvars.iv98, %.critedge.split.loop.exit125 ], [ %indvars.iv.next99, %13 ]
  %.060.lcssa = phi i32 [ %16, %.critedge.split.loop.exit125 ], [ %indvars, %13 ]
  %.062.in.lcssa = trunc i64 %.062.in.lcssa.in to i32
  %17 = sub nsw i32 %.060.lcssa, %indvars104
  %18 = shl nsw i32 %17, 1
  %19 = icmp sgt i32 %18, %.05677
  %spec.select = tail call i32 @llvm.smax.i32(i32 %18, i32 %.05677)
  %spec.select68 = select i1 %19, i32 %.062.in.lcssa, i32 %.05578
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.preheader72, !llvm.loop !10

._crit_edge:                                      ; preds = %.critedge2, %.preheader
  %.258.lcssa = phi i32 [ %spec.select, %.preheader ], [ %spec.select70, %.critedge2 ]
  %.2.lcssa = phi i32 [ %spec.select68, %.preheader ], [ %spec.select71, %.critedge2 ]
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.2.lcssa, i32 noundef %.258.lcssa)
  %21 = icmp sgt i32 %.258.lcssa, 0
  br i1 %21, label %36, label %44

.lr.ph.preheader:                                 ; preds = %.critedge2, %.lr.ph93.preheader
  %indvars.iv109 = phi i64 [ 1, %.lr.ph93.preheader ], [ %indvars.iv.next110, %.critedge2 ]
  %indvars.iv105 = phi i64 [ 2, %.lr.ph93.preheader ], [ %indvars.iv.next106, %.critedge2 ]
  %.291 = phi i32 [ %spec.select68, %.lr.ph93.preheader ], [ %spec.select71, %.critedge2 ]
  %.25890 = phi i32 [ %spec.select, %.lr.ph93.preheader ], [ %spec.select70, %.critedge2 ]
  %indvars118 = trunc i64 %indvars.iv109 to i32
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %28
  %indvars.iv111 = phi i64 [ %indvars.iv109, %.lr.ph.preheader ], [ %indvars.iv.next112, %28 ]
  %indvars.iv107 = phi i64 [ %indvars.iv105, %.lr.ph.preheader ], [ %indvars.iv.next108, %28 ]
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, -1
  %22 = and i64 %indvars.iv.next112, 4294967295
  %23 = getelementptr inbounds i8, ptr %0, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv107
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = icmp eq i8 %24, %26
  br i1 %27, label %28, label %.critedge2.split.loop.exit

28:                                               ; preds = %.lr.ph
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %indvars113 = trunc i64 %indvars.iv.next108 to i32
  %29 = icmp sgt i64 %indvars.iv111, 1
  %30 = icmp slt i32 %indvars113, %1
  %or.cond69 = select i1 %29, i1 %30, i1 false
  br i1 %or.cond69, label %.lr.ph, label %.critedge2, !llvm.loop !11

.critedge2.split.loop.exit:                       ; preds = %.lr.ph
  %31 = trunc nuw nsw i64 %indvars.iv107 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %28, %.critedge2.split.loop.exit
  %.163.in.lcssa.ph.in = phi i64 [ %indvars.iv111, %.critedge2.split.loop.exit ], [ %indvars.iv.next112, %28 ]
  %.161.lcssa.ph = phi i32 [ %31, %.critedge2.split.loop.exit ], [ %indvars113, %28 ]
  %.163.in.lcssa.ph = trunc i64 %.163.in.lcssa.ph.in to i32
  %32 = xor i32 %indvars118, -1
  %33 = add nsw i32 %.161.lcssa.ph, %32
  %34 = shl nsw i32 %33, 1
  %.not = icmp slt i32 %34, %.25890
  %35 = or disjoint i32 %34, 1
  %spec.select70 = select i1 %.not, i32 %.25890, i32 %35
  %spec.select71 = select i1 %.not, i32 %.291, i32 %.163.in.lcssa.ph
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count119
  br i1 %exitcond120.not, label %._crit_edge, label %.lr.ph.preheader, !llvm.loop !12

36:                                               ; preds = %._crit_edge
  %37 = add nuw nsw i32 %.258.lcssa, 1
  %38 = zext nneg i32 %37 to i64
  %39 = tail call noalias ptr @malloc(i64 noundef %38) #5
  %40 = sext i32 %.2.lcssa to i64
  %41 = getelementptr inbounds i8, ptr %0, i64 %40
  %42 = zext nneg i32 %.258.lcssa to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %39, ptr align 1 %41, i64 %42, i1 false)
  %43 = getelementptr inbounds i8, ptr %39, i64 %42
  store i8 0, ptr %43, align 1, !tbaa !5
  br label %44

44:                                               ; preds = %._crit_edge.thread, %._crit_edge, %36
  %.0 = phi ptr [ %39, %36 ], [ null, %._crit_edge ], [ null, %._crit_edge.thread ]
  ret ptr %.0
}

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

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

; Function Attrs: 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) #3

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

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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


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