; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RNBasics/RNArray.ll (ZN8RNVArray6ResizeEi)

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

%class.RNVArray = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind
declare void @free(ptr 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: mustprogress uwtable
define dso_local void @_ZN8RNVArray6ResizeEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %12 = load i32, ptr %11, align 4, !tbaa !11
  %13 = icmp sge i32 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %2
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 264, ptr noundef @.str.2)
  br label %15

15:                                               ; preds = %14, %2
  %16 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %20 = icmp sle i32 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %15
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 265, ptr noundef @.str.2)
  br label %22

22:                                               ; preds = %21, %15
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 1
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = icmp sgt i32 %23, %25
  br i1 %26, label %27, label %121

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

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

32:                                               ; preds = %28
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = mul nsw i32 %33, 2
  store i32 %34, ptr %5, align 4, !tbaa !9
  br label %28, !llvm.loop !14

35:                                               ; preds = %28
  %36 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %36, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %48

39:                                               ; preds = %35
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = mul i64 %41, 8
  %43 = call noalias ptr @malloc(i64 noundef %42) #6
  store ptr %43, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %47, label %46

46:                                               ; preds = %39
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 278, ptr noundef @.str.2)
  br label %47

47:                                               ; preds = %46, %39
  br label %48

48:                                               ; preds = %47, %35
  %49 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !11
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %52, label %83

52:                                               ; preds = %48
  %53 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = icmp ne ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.5, i32 noundef 283, ptr noundef @.str.2)
  br label %57

57:                                               ; preds = %56, %52
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 284, ptr noundef @.str.2)
  br label %61

61:                                               ; preds = %60, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %79, %61
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %62
  %69 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !16
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  store ptr %74, ptr %78, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %68
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %7, align 4, !tbaa !9
  br label %62, !llvm.loop !17

82:                                               ; preds = %67
  br label %83

83:                                               ; preds = %82, %48
  %84 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = load i32, ptr %4, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %109

88:                                               ; preds = %83
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 291, ptr noundef @.str.2)
  br label %92

92:                                               ; preds = %91, %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %93 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 2
  %94 = load i32, ptr %93, align 4, !tbaa !11
  store i32 %94, ptr %8, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %105, %92
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = load i32, ptr %4, align 4, !tbaa !9
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %95
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  store ptr null, ptr %104, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %100
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %8, align 4, !tbaa !9
  br label %95, !llvm.loop !18

108:                                              ; preds = %99
  br label %109

109:                                              ; preds = %108, %83
  %110 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !16
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %116

113:                                              ; preds = %109
  %114 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !16
  call void @free(ptr noundef %115) #5
  br label %116

116:                                              ; preds = %113, %109
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 0
  store ptr %117, ptr %118, align 8, !tbaa !16
  %119 = load i32, ptr %4, align 4, !tbaa !9
  %120 = getelementptr inbounds %class.RNVArray, ptr %9, i32 0, i32 1
  store i32 %119, ptr %120, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %121

121:                                              ; preds = %116, %22
  ret void
}

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { "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 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 #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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTS8RNVArray", !6, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !6, i64 0}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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 [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8RNVArray6ResizeEi(ptr nocapture noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 12
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %.not = icmp sgt i32 %4, %1
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 264, ptr noundef nonnull @.str.2)
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %5, %2
  %7 = phi i32 [ %.pre, %5 ], [ %4, %2 ]
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %.not30 = icmp sgt i32 %7, %9
  br i1 %.not30, label %10, label %11

10:                                               ; preds = %6
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 265, ptr noundef nonnull @.str.2)
  %.pre44 = load i32, ptr %8, align 8, !tbaa !11
  br label %11

11:                                               ; preds = %10, %6
  %12 = phi i32 [ %.pre44, %10 ], [ %9, %6 ]
  %13 = icmp slt i32 %12, %1
  br i1 %13, label %.preheader, label %75

.preheader:                                       ; preds = %11, %.preheader
  %.026 = phi i32 [ %15, %.preheader ], [ 1, %11 ]
  %14 = icmp slt i32 %.026, %1
  %15 = shl nsw i32 %.026, 1
  br i1 %14, label %.preheader, label %16, !llvm.loop !12

16:                                               ; preds = %.preheader
  %17 = zext nneg i32 %.026 to i64
  %18 = shl nuw nsw i64 %17, 3
  %19 = tail call noalias ptr @malloc(i64 noundef %18) #5
  %20 = ptrtoint ptr %19 to i64
  %.not31 = icmp eq ptr %19, null
  br i1 %.not31, label %21, label %22

21:                                               ; preds = %16
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 278, ptr noundef nonnull @.str.2)
  br label %22

22:                                               ; preds = %16, %21
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %.loopexit36

25:                                               ; preds = %22
  %26 = load ptr, ptr %0, align 8, !tbaa !14
  %.not32 = icmp eq ptr %26, null
  br i1 %.not32, label %27, label %28

27:                                               ; preds = %25
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, i32 noundef 283, ptr noundef nonnull @.str.2)
  br label %28

28:                                               ; preds = %27, %25
  br i1 %.not31, label %29, label %30

29:                                               ; preds = %28
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 284, ptr noundef nonnull @.str.2)
  br label %30

30:                                               ; preds = %29, %28
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %.loopexit36

.lr.ph:                                           ; preds = %30
  %33 = load ptr, ptr %0, align 8, !tbaa !14
  %wide.trip.count = zext nneg i32 %31 to i64
  %min.iters.check = icmp ult i32 %31, 6
  %34 = ptrtoint ptr %33 to i64
  %35 = sub i64 %20, %34
  %diff.check = icmp ult i64 %35, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = getelementptr inbounds ptr, ptr %33, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load = load <2 x ptr>, ptr %36, align 8, !tbaa !15
  %wide.load46 = load <2 x ptr>, ptr %37, align 8, !tbaa !15
  %38 = getelementptr inbounds ptr, ptr %19, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store <2 x ptr> %wide.load, ptr %38, align 8, !tbaa !15
  store <2 x ptr> %wide.load46, ptr %39, align 8, !tbaa !15
  %index.next = add nuw i64 %index, 4
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !16

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

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %41 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv.prol
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv.prol
  store ptr %42, ptr %43, align 8, !tbaa !15
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !19

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %44 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %45 = icmp ugt i64 %44, -4
  br i1 %45, label %.loopexit36, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %46 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv
  store ptr %47, ptr %48, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv.next
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv.next
  store ptr %50, ptr %51, align 8, !tbaa !15
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %52 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv.next.1
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv.next.1
  store ptr %53, ptr %54, align 8, !tbaa !15
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %55 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv.next.2
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv.next.2
  store ptr %56, ptr %57, align 8, !tbaa !15
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.loopexit36, label %scalar.ph, !llvm.loop !21

.loopexit36:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %30, %22
  %58 = phi i32 [ %31, %30 ], [ %23, %22 ], [ %31, %middle.block ], [ %31, %scalar.ph ], [ %31, %scalar.ph.prol.loopexit ]
  %59 = icmp slt i32 %58, %.026
  br i1 %59, label %60, label %.loopexit

60:                                               ; preds = %.loopexit36
  br i1 %.not31, label %61, label %62

61:                                               ; preds = %60
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 291, ptr noundef nonnull @.str.2)
  %.pre45 = load i32, ptr %3, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %61, %60
  %63 = phi i32 [ %.pre45, %61 ], [ %58, %60 ]
  %64 = icmp slt i32 %63, %.026
  br i1 %64, label %.lr.ph39.preheader, label %.loopexit

.lr.ph39.preheader:                               ; preds = %62
  %65 = sext i32 %63 to i64
  %66 = shl nsw i64 %65, 3
  %scevgep = getelementptr i8, ptr %19, i64 %66
  %67 = xor i32 %63, -1
  %68 = add i32 %.026, %67
  %69 = zext i32 %68 to i64
  %70 = shl nuw nsw i64 %69, 3
  %71 = add nuw nsw i64 %70, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %71, i1 false), !tbaa !15
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph39.preheader, %62, %.loopexit36
  %72 = load ptr, ptr %0, align 8, !tbaa !14
  %.not35 = icmp eq ptr %72, null
  br i1 %.not35, label %74, label %73

73:                                               ; preds = %.loopexit
  tail call void @free(ptr noundef nonnull %72) #6
  br label %74

74:                                               ; preds = %73, %.loopexit
  store ptr %19, ptr %0, align 8, !tbaa !14
  store i32 %.026, ptr %8, align 8, !tbaa !11
  br label %75

75:                                               ; preds = %74, %11
  ret void
}

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { 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 #1 = { mustprogress 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 #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind }

!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, !10, i64 12}
!6 = !{!"_ZTS8RNVArray", !7, i64 0, !10, i64 8, !10, i64 12}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !13, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !13, !17}


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