; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/test/test_malloc_compliance.ll (Z20InvariantDataReallocbmb)

; 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.Harness::FastRandom" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [98 x i8], align 1
@Tfree = external dso_local global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1

; 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: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8TreallocPvm(ptr noundef, 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: mustprogress uwtable
declare dso_local noundef ptr @_Z7Tmallocm(i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20InvariantDataReallocbmb(i1 noundef zeroext %0, i64 noundef %1, i1 noundef zeroext %2) #1 {
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca %"class.Harness::FastRandom", align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = zext i1 %0 to i8
  store i8 %16, ptr %4, align 1, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %17 = zext i1 %2 to i8
  store i8 %17, ptr %6, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @_ZN7Harness10FastRandomC2Ej(ptr noundef nonnull align 4 dereferenceable(8) %7, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %18 = load i64, ptr %5, align 8, !tbaa !9
  %19 = mul i64 2, %18
  %20 = call noundef ptr @_Z7Tmallocm(i64 noundef %19)
  store ptr %20, ptr %11, align 8, !tbaa !11
  %21 = load ptr, ptr %11, align 8, !tbaa !11
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  br label %25

24:                                               ; preds = %3
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 362, ptr noundef @.str.26, ptr noundef null)
  br label %25

25:                                               ; preds = %24, %23
  %26 = load i64, ptr %5, align 8, !tbaa !9
  %27 = mul i64 2, %26
  %28 = urem i64 %27, 2
  %29 = icmp ne i64 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  br label %32

31:                                               ; preds = %25
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 364, ptr noundef @.str.27, ptr noundef @.str.28)
  br label %32

32:                                               ; preds = %31, %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %44, %32
  %34 = load i64, ptr %12, align 8, !tbaa !9
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = mul i64 2, %35
  %37 = icmp ult i64 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %47

39:                                               ; preds = %33
  %40 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %41 = load ptr, ptr %11, align 8, !tbaa !11
  %42 = load i64, ptr %12, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %41, i64 %42
  store i16 %40, ptr %43, align 2, !tbaa !13
  br label %44

44:                                               ; preds = %39
  %45 = load i64, ptr %12, align 8, !tbaa !9
  %46 = add i64 %45, 2
  store i64 %46, ptr %12, align 8, !tbaa !9
  br label %33, !llvm.loop !15

47:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %48

48:                                               ; preds = %106, %47
  %49 = load i32, ptr %13, align 4, !tbaa !17
  %50 = icmp slt i32 %49, 100
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %109

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %53 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %54 = zext i16 %53 to i64
  %55 = load i64, ptr %5, align 8, !tbaa !9
  %56 = sub i64 %55, 1
  %57 = urem i64 %54, %56
  %58 = add i64 %57, 1
  store i64 %58, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %59 = load i8, ptr %4, align 1, !tbaa !5, !range !19, !noundef !20
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %66

61:                                               ; preds = %52
  %62 = load ptr, ptr %10, align 8, !tbaa !11
  %63 = load i64, ptr %14, align 8, !tbaa !9
  %64 = call noundef i64 @_Z23choose_random_alignmentv()
  %65 = call noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef %62, i64 noundef %63, i64 noundef %64)
  br label %70

66:                                               ; preds = %52
  %67 = load ptr, ptr %10, align 8, !tbaa !11
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = call noundef ptr @_Z8TreallocPvm(ptr noundef %67, i64 noundef %68)
  br label %70

70:                                               ; preds = %66, %61
  %71 = phi ptr [ %65, %61 ], [ %69, %66 ]
  store ptr %71, ptr %15, align 8, !tbaa !11
  %72 = load ptr, ptr %15, align 8, !tbaa !11
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %70
  br label %76

75:                                               ; preds = %70
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 374, ptr noundef @.str.29, ptr noundef null)
  br label %76

76:                                               ; preds = %75, %74
  %77 = load i8, ptr %6, align 1, !tbaa !5, !range !19, !noundef !20
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %90

79:                                               ; preds = %76
  %80 = load ptr, ptr %15, align 8, !tbaa !11
  %81 = load ptr, ptr %11, align 8, !tbaa !11
  %82 = load i64, ptr %9, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %81, i64 %82
  %84 = call noundef i64 @_Z3minImmET_RKS0_RKT0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %85 = call i32 @memcmp(ptr noundef %80, ptr noundef %83, i64 noundef %84) #7
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %79
  br label %89

88:                                               ; preds = %79
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 377, ptr noundef @.str.30, ptr noundef @.str.31)
  br label %89

89:                                               ; preds = %88, %87
  br label %90

90:                                               ; preds = %89, %76
  %91 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %91, ptr %8, align 8, !tbaa !9
  %92 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %92, ptr %10, align 8, !tbaa !11
  %93 = load i8, ptr %6, align 1, !tbaa !5, !range !19, !noundef !20
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %105

95:                                               ; preds = %90
  %96 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %97 = zext i16 %96 to i64
  %98 = load i64, ptr %5, align 8, !tbaa !9
  %99 = urem i64 %97, %98
  store i64 %99, ptr %9, align 8, !tbaa !9
  %100 = load ptr, ptr %10, align 8, !tbaa !11
  %101 = load ptr, ptr %11, align 8, !tbaa !11
  %102 = load i64, ptr %9, align 8, !tbaa !9
  %103 = getelementptr inbounds i8, ptr %101, i64 %102
  %104 = load i64, ptr %8, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %100, ptr align 1 %103, i64 %104, i1 false)
  br label %105

105:                                              ; preds = %95, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %13, align 4, !tbaa !17
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %13, align 4, !tbaa !17
  br label %48, !llvm.loop !21

109:                                              ; preds = %51
  %110 = load i8, ptr %4, align 1, !tbaa !5, !range !19, !noundef !20
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %116

112:                                              ; preds = %109
  %113 = load ptr, ptr %10, align 8, !tbaa !11
  %114 = call noundef i64 @_Z23choose_random_alignmentv()
  %115 = call noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef %113, i64 noundef 0, i64 noundef %114)
  br label %119

116:                                              ; preds = %109
  %117 = load ptr, ptr %10, align 8, !tbaa !11
  %118 = call noundef ptr @_Z8TreallocPvm(ptr noundef %117, i64 noundef 0)
  br label %119

119:                                              ; preds = %116, %112
  %120 = load ptr, ptr @Tfree, align 8, !tbaa !11
  %121 = load ptr, ptr %11, align 8, !tbaa !11
  call void %120(ptr noundef %121)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Harness10FastRandomC2Ej(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z23choose_random_alignmentv() #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3minImmET_RKS0_RKT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { inlinehint mustprogress 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !16}


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

%"class.Harness::FastRandom" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [98 x i8], align 1
@Tfree = external dso_local local_unnamed_addr global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8TreallocPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z7Tmallocm(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20InvariantDataReallocbmb(i1 noundef zeroext %0, i64 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = alloca %"class.Harness::FastRandom", align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN7Harness10FastRandomC2Ej(ptr noundef nonnull align 4 dereferenceable(8) %4, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  %7 = shl i64 %1, 1
  %8 = call noundef ptr @_Z7Tmallocm(i64 noundef %7)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %3
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 362, ptr noundef nonnull @.str.26, ptr noundef null)
  br label %10

10:                                               ; preds = %9, %3
  %.not42 = icmp eq i64 %7, 0
  br i1 %.not42, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %10
  %11 = add i64 %1, -1
  br i1 %2, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %28
  %.036.us = phi i64 [ %32, %28 ], [ 0, %.preheader ]
  %.02835.us = phi i32 [ %35, %28 ], [ 0, %.preheader ]
  %.03034.us = phi ptr [ %22, %28 ], [ null, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %12 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %13 = zext i16 %12 to i64
  %14 = urem i64 %13, %11
  %15 = add nuw nsw i64 %14, 1
  store i64 %15, ptr %6, align 8, !tbaa !5
  br i1 %0, label %18, label %16

16:                                               ; preds = %.preheader.split.us
  %17 = call noundef ptr @_Z8TreallocPvm(ptr noundef %.03034.us, i64 noundef %15)
  br label %21

18:                                               ; preds = %.preheader.split.us
  %19 = call noundef i64 @_Z23choose_random_alignmentv()
  %20 = call noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef %.03034.us, i64 noundef %15, i64 noundef %19)
  br label %21

21:                                               ; preds = %18, %16
  %22 = phi ptr [ %20, %18 ], [ %17, %16 ]
  %.not31.us = icmp eq ptr %22, null
  br i1 %.not31.us, label %23, label %24

23:                                               ; preds = %21
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 374, ptr noundef nonnull @.str.29, ptr noundef null)
  br label %24

24:                                               ; preds = %23, %21
  %25 = getelementptr inbounds i8, ptr %8, i64 %.036.us
  %26 = call noundef i64 @_Z3minImmET_RKS0_RKT0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %bcmp.us = call i32 @bcmp(ptr %22, ptr %25, i64 %26)
  %.not32.us = icmp eq i32 %bcmp.us, 0
  br i1 %.not32.us, label %28, label %27

27:                                               ; preds = %24
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 377, ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.31)
  br label %28

28:                                               ; preds = %27, %24
  %29 = load i64, ptr %6, align 8, !tbaa !5
  store i64 %29, ptr %5, align 8, !tbaa !5
  %30 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %31 = zext i16 %30 to i64
  %32 = urem i64 %31, %1
  %33 = getelementptr inbounds i8, ptr %8, i64 %32
  %34 = load i64, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %22, ptr align 1 %33, i64 %34, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %35 = add nuw nsw i32 %.02835.us, 1
  %exitcond48.not = icmp eq i32 %35, 100
  br i1 %exitcond48.not, label %.split.us, label %.preheader.split.us, !llvm.loop !9

.preheader.split:                                 ; preds = %.preheader
  br i1 %0, label %.preheader.split.split.us, label %.preheader.split.split

.preheader.split.split.us:                        ; preds = %.preheader.split, %.critedge.us
  %.02835.us37 = phi i32 [ %43, %.critedge.us ], [ 0, %.preheader.split ]
  %.03034.us38 = phi ptr [ %41, %.critedge.us ], [ null, %.preheader.split ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %36 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %37 = zext i16 %36 to i64
  %38 = urem i64 %37, %11
  %39 = add nuw nsw i64 %38, 1
  %40 = call noundef i64 @_Z23choose_random_alignmentv()
  %41 = call noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef %.03034.us38, i64 noundef %39, i64 noundef %40)
  %.not31.us39 = icmp eq ptr %41, null
  br i1 %.not31.us39, label %42, label %.critedge.us

42:                                               ; preds = %.preheader.split.split.us
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 374, ptr noundef nonnull @.str.29, ptr noundef null)
  br label %.critedge.us

.critedge.us:                                     ; preds = %42, %.preheader.split.split.us
  store i64 %39, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %43 = add nuw nsw i32 %.02835.us37, 1
  %exitcond47.not = icmp eq i32 %43, 100
  br i1 %exitcond47.not, label %.split.us, label %.preheader.split.split.us, !llvm.loop !9

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.02933 = phi i64 [ %46, %.lr.ph ], [ 0, %10 ]
  %44 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %45 = getelementptr inbounds i8, ptr %8, i64 %.02933
  store i16 %44, ptr %45, align 2, !tbaa !11
  %46 = add nuw i64 %.02933, 2
  %47 = icmp ult i64 %46, %7
  br i1 %47, label %.lr.ph, label %.preheader, !llvm.loop !13

.split.us:                                        ; preds = %.critedge, %.critedge.us, %28
  %.us-phi = phi ptr [ %22, %28 ], [ %41, %.critedge.us ], [ %52, %.critedge ]
  br i1 %0, label %55, label %58

.preheader.split.split:                           ; preds = %.preheader.split, %.critedge
  %.02835 = phi i32 [ %54, %.critedge ], [ 0, %.preheader.split ]
  %.03034 = phi ptr [ %52, %.critedge ], [ null, %.preheader.split ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %48 = call noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %49 = zext i16 %48 to i64
  %50 = urem i64 %49, %11
  %51 = add nuw nsw i64 %50, 1
  %52 = call noundef ptr @_Z8TreallocPvm(ptr noundef %.03034, i64 noundef %51)
  %.not31 = icmp eq ptr %52, null
  br i1 %.not31, label %53, label %.critedge

53:                                               ; preds = %.preheader.split.split
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 374, ptr noundef nonnull @.str.29, ptr noundef null)
  br label %.critedge

.critedge:                                        ; preds = %.preheader.split.split, %53
  store i64 %51, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %54 = add nuw nsw i32 %.02835, 1
  %exitcond.not = icmp eq i32 %54, 100
  br i1 %exitcond.not, label %.split.us, label %.preheader.split.split, !llvm.loop !9

55:                                               ; preds = %.split.us
  %56 = call noundef i64 @_Z23choose_random_alignmentv()
  %57 = call noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef %.us-phi, i64 noundef 0, i64 noundef %56)
  br label %60

58:                                               ; preds = %.split.us
  %59 = call noundef ptr @_Z8TreallocPvm(ptr noundef %.us-phi, i64 noundef 0)
  br label %60

60:                                               ; preds = %58, %55
  %61 = load ptr, ptr @Tfree, align 8, !tbaa !14
  call void %61(ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Harness10FastRandomC2Ej(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN7Harness10FastRandom3getEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z16Taligned_reallocPvmm(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z23choose_random_alignmentv() local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3minImmET_RKS0_RKT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { inlinehint mustprogress 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 #5 = { nofree nounwind willreturn memory(argmem: read) }
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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass