; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: Unit Test/Tests/DataStructuresTests/TreesTest/RedBlackTreeTest (RedBlackTreeTest)

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

%struct.RBTree = type { ptr, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [160 x i8], align 1
@__const.testRBTreeInsert2.valuesArr = external hidden unnamed_addr constant [13 x i32], align 16
@__const.testRBTreeInsert2.valuesArr2 = external hidden unnamed_addr constant [10 x i32], align 16

; Function Attrs: nounwind uwtable
declare dso_local ptr @generateIntPointerRBTT(i32 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: nounwind uwtable
declare dso_local i32 @compareIntPointersRBTT(ptr noundef, ptr noundef) #0

declare ptr @redBlackTreeInitialization(ptr noundef, ptr noundef) #2

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare void @destroyRBTree(ptr noundef) #2

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

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

declare void @rBTreeInsert(ptr noundef, ptr noundef) #2

; 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

; Function Attrs: nounwind uwtable
define dso_local void @testRBTreeInsert2(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [13 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [10 x i32], align 16
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %9 = call ptr @redBlackTreeInitialization(ptr noundef @free, ptr noundef @compareIntPointersRBTT)
  store ptr %9, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 52, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.testRBTreeInsert2.valuesArr, i64 52, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %34, %1
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 13
  br i1 %12, label %14, label %13

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

14:                                               ; preds = %10
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [13 x i32], ptr %4, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = call ptr @generateIntPointerRBTT(i32 noundef %19)
  call void @rBTreeInsert(ptr noundef %15, ptr noundef %20)
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.RBTree, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %24, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %21, ptr noundef @.str, i32 noundef 154, ptr noundef null, i32 noundef 1, i32 noundef %25)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.RBTree, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %29, i32 noundef 0)
  %31 = icmp eq i32 %30, -1
  %32 = zext i1 %31 to i64
  %33 = select i1 %31, i32 0, i32 1
  call void @CuAssertIntEquals_LineMsg(ptr noundef %26, ptr noundef @.str, i32 noundef 155, ptr noundef null, i32 noundef 1, i32 noundef %33)
  br label %34

34:                                               ; preds = %14
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %5, align 4, !tbaa !9
  br label %10, !llvm.loop !13

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

38:                                               ; preds = %61, %37
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = icmp slt i32 %39, 7
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %64

42:                                               ; preds = %38
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds [13 x i32], ptr %4, i64 0, i64 0
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  call void @rBTreeDelete(ptr noundef %43, ptr noundef %47)
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.RBTree, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %51, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %48, ptr noundef @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %52)
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.RBTree, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %56, i32 noundef 0)
  %58 = icmp eq i32 %57, -1
  %59 = zext i1 %58 to i64
  %60 = select i1 %58, i32 0, i32 1
  call void @CuAssertIntEquals_LineMsg(ptr noundef %53, ptr noundef @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %60)
  br label %61

61:                                               ; preds = %42
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %6, align 4, !tbaa !9
  br label %38, !llvm.loop !15

64:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.testRBTreeInsert2.valuesArr2, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %89, %64
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = icmp slt i32 %66, 10
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %65
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = call ptr @generateIntPointerRBTT(i32 noundef %74)
  call void @rBTreeInsert(ptr noundef %70, ptr noundef %75)
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.RBTree, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %79, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %76, ptr noundef @.str, i32 noundef 175, ptr noundef null, i32 noundef 1, i32 noundef %80)
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.RBTree, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %84, i32 noundef 0)
  %86 = icmp eq i32 %85, -1
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 0, i32 1
  call void @CuAssertIntEquals_LineMsg(ptr noundef %81, ptr noundef @.str, i32 noundef 176, ptr noundef null, i32 noundef 1, i32 noundef %88)
  br label %89

89:                                               ; preds = %69
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %8, align 4, !tbaa !9
  br label %65, !llvm.loop !16

92:                                               ; preds = %68
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyRBTree(ptr noundef %93)
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 52, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

declare void @rBTreeDelete(ptr noundef, ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 "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 }

!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 = !{!12, !6, i64 0}
!12 = !{!"RBTree", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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 [160 x i8], align 1
@__const.testRBTreeInsert2.valuesArr = external hidden unnamed_addr constant [13 x i32], align 16
@__const.testRBTreeInsert2.valuesArr2 = external hidden unnamed_addr constant [10 x i32], align 16

; Function Attrs: nounwind uwtable
declare dso_local ptr @generateIntPointerRBTT(i32 noundef) local_unnamed_addr #0

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

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

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

declare ptr @redBlackTreeInitialization(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare void @destroyRBTree(ptr noundef) local_unnamed_addr #2

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

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

declare void @rBTreeInsert(ptr noundef, ptr 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) #4

; Function Attrs: nounwind uwtable
define dso_local void @testRBTreeInsert2(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [13 x i32], align 16
  %3 = tail call ptr @redBlackTreeInitialization(ptr noundef nonnull @free, ptr noundef nonnull @compareIntPointersRBTT) #5
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %2, ptr noundef nonnull align 16 dereferenceable(52) @__const.testRBTreeInsert2.valuesArr, i64 52, i1 false)
  br label %4

4:                                                ; preds = %1, %4
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %4 ]
  %5 = getelementptr inbounds [13 x i32], ptr %2, i64 0, i64 %indvars.iv
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = tail call ptr @generateIntPointerRBTT(i32 noundef %6)
  tail call void @rBTreeInsert(ptr noundef %3, ptr noundef %7) #5
  %8 = load ptr, ptr %3, align 8, !tbaa !9
  %9 = tail call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %8, ptr noundef null)
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 154, ptr noundef null, i32 noundef 1, i32 noundef %9) #5
  %10 = load ptr, ptr %3, align 8, !tbaa !9
  %11 = tail call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %10, i32 noundef 0)
  %12 = icmp ne i32 %11, -1
  %13 = zext i1 %12 to i32
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 155, ptr noundef null, i32 noundef 1, i32 noundef %13) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 13
  br i1 %exitcond.not, label %.preheader26.preheader, label %4, !llvm.loop !12

.preheader26.preheader:                           ; preds = %4
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %2) #5
  %14 = load ptr, ptr %3, align 8, !tbaa !9
  %15 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %14, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %15) #5
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %16, i32 noundef 0)
  %18 = icmp ne i32 %17, -1
  %19 = zext i1 %18 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %19) #5
  %20 = getelementptr inbounds i8, ptr %2, i64 4
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %20) #5
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %21, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %22) #5
  %23 = load ptr, ptr %3, align 8, !tbaa !9
  %24 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %23, i32 noundef 0)
  %25 = icmp ne i32 %24, -1
  %26 = zext i1 %25 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %26) #5
  %27 = getelementptr inbounds i8, ptr %2, i64 8
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %27) #5
  %28 = load ptr, ptr %3, align 8, !tbaa !9
  %29 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %28, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %29) #5
  %30 = load ptr, ptr %3, align 8, !tbaa !9
  %31 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %30, i32 noundef 0)
  %32 = icmp ne i32 %31, -1
  %33 = zext i1 %32 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %33) #5
  %34 = getelementptr inbounds i8, ptr %2, i64 12
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %34) #5
  %35 = load ptr, ptr %3, align 8, !tbaa !9
  %36 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %35, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %36) #5
  %37 = load ptr, ptr %3, align 8, !tbaa !9
  %38 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %37, i32 noundef 0)
  %39 = icmp ne i32 %38, -1
  %40 = zext i1 %39 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %40) #5
  %41 = getelementptr inbounds i8, ptr %2, i64 16
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %41) #5
  %42 = load ptr, ptr %3, align 8, !tbaa !9
  %43 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %42, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %43) #5
  %44 = load ptr, ptr %3, align 8, !tbaa !9
  %45 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %44, i32 noundef 0)
  %46 = icmp ne i32 %45, -1
  %47 = zext i1 %46 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %47) #5
  %48 = getelementptr inbounds i8, ptr %2, i64 20
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %48) #5
  %49 = load ptr, ptr %3, align 8, !tbaa !9
  %50 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %49, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %50) #5
  %51 = load ptr, ptr %3, align 8, !tbaa !9
  %52 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %51, i32 noundef 0)
  %53 = icmp ne i32 %52, -1
  %54 = zext i1 %53 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %54) #5
  %55 = getelementptr inbounds i8, ptr %2, i64 24
  call void @rBTreeDelete(ptr noundef nonnull %3, ptr noundef nonnull %55) #5
  %56 = load ptr, ptr %3, align 8, !tbaa !9
  %57 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %56, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef null, i32 noundef 1, i32 noundef %57) #5
  %58 = load ptr, ptr %3, align 8, !tbaa !9
  %59 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %58, i32 noundef 0)
  %60 = icmp ne i32 %59, -1
  %61 = zext i1 %60 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 165, ptr noundef null, i32 noundef 1, i32 noundef %61) #5
  br label %.preheader

62:                                               ; preds = %.preheader
  call void @destroyRBTree(ptr noundef nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %2) #5
  ret void

.preheader:                                       ; preds = %.preheader26.preheader, %.preheader
  %indvars.iv35 = phi i64 [ 0, %.preheader26.preheader ], [ %indvars.iv.next36, %.preheader ]
  %63 = getelementptr inbounds [10 x i32], ptr @__const.testRBTreeInsert2.valuesArr2, i64 0, i64 %indvars.iv35
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call ptr @generateIntPointerRBTT(i32 noundef %64)
  call void @rBTreeInsert(ptr noundef nonnull %3, ptr noundef %65) #5
  %66 = load ptr, ptr %3, align 8, !tbaa !9
  %67 = call i32 @checkIfValidBinaryTreeRBTT(ptr noundef %66, ptr noundef null)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 175, ptr noundef null, i32 noundef 1, i32 noundef %67) #5
  %68 = load ptr, ptr %3, align 8, !tbaa !9
  %69 = call i32 @checkIfValidRBTree(ptr noundef null, ptr noundef %68, i32 noundef 0)
  %70 = icmp ne i32 %69, -1
  %71 = zext i1 %70 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 176, ptr noundef null, i32 noundef 1, i32 noundef %71) #5
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %exitcond38.not = icmp eq i64 %indvars.iv.next36, 10
  br i1 %exitcond38.not, label %62, label %.preheader, !llvm.loop !14
}

declare void @rBTreeDelete(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"RBTree", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass