; LLVM IR from yudi-matsuzake/libgenerics :: doc/examples (rbtree1)

; 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.redblacktree_t = type { i64, i64, ptr, ptr, i64, ptr }

@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

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

; 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 void @find_int(ptr noundef, i32 noundef) #0

declare ptr @gerror_to_str(i32 noundef) #2

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

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

; Function Attrs: nounwind
declare i32 @rand() #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @rbtree_check(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.redblacktree_t, align 8
  %3 = alloca i32, align 4
  %4 = alloca [10 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = call i64 @time(ptr noundef null) #4
  %8 = trunc i64 %7 to i32
  call void @srand(i32 noundef %8) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #4
  %9 = call i32 @rbtree_create(ptr noundef %2, i64 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #4
  %10 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 0
  call void @inicialize(ptr noundef %10, i32 noundef 10)
  %11 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 0
  call void @randomize(ptr noundef %11, i32 noundef 10)
  %12 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 0
  call void @vprint(ptr noundef %12, i32 noundef 10)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %21, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 10
  br i1 %15, label %16, label %24

16:                                               ; preds = %13
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 %18
  %20 = call i32 @rbtree_add(ptr noundef %2, ptr noundef %19)
  br label %21

21:                                               ; preds = %16
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !9

24:                                               ; preds = %13
  %25 = getelementptr inbounds %struct.redblacktree_t, ptr %2, i32 0, i32 5
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  call void @print_rbt(ptr noundef %26, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %27 = call i32 @rand() #4
  %28 = srem i32 %27, 10
  store i32 %28, ptr %5, align 4, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %29)
  %31 = load i32, ptr %5, align 4, !tbaa !5
  call void @find_int(ptr noundef %2, i32 noundef %31)
  %32 = call i32 @rand() #4
  %33 = srem i32 %32, 10
  %34 = add nsw i32 %33, 10
  store i32 %34, ptr %5, align 4, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %35)
  %37 = load i32, ptr %5, align 4, !tbaa !5
  call void @find_int(ptr noundef %2, i32 noundef %37)
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %39 = call i32 @rbtree_min_value(ptr noundef %2, ptr noundef %5)
  store i32 %39, ptr %6, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %24
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %42)
  br label %48

44:                                               ; preds = %24
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = call ptr @gerror_to_str(i32 noundef %45)
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %46)
  br label %48

48:                                               ; preds = %44, %41
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %50 = call i32 @rbtree_max_value(ptr noundef %2, ptr noundef %5)
  store i32 %50, ptr %6, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %48
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %53)
  br label %59

55:                                               ; preds = %48
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = call ptr @gerror_to_str(i32 noundef %56)
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %57)
  br label %59

59:                                               ; preds = %55, %52
  call void @rbtree_check(ptr noundef %2)
  %60 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 0
  call void @randomize(ptr noundef %60, i32 noundef 10)
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %62 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 0
  call void @vprint(ptr noundef %62, i32 noundef 10)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %81, %59
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = icmp slt i32 %64, 10
  br i1 %65, label %66, label %84

66:                                               ; preds = %63
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i32 noundef %70)
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 %73
  %75 = call i32 @rbtree_remove_item(ptr noundef %2, ptr noundef %74)
  %76 = getelementptr inbounds %struct.redblacktree_t, ptr %2, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !15
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, i64 noundef %77)
  %79 = getelementptr inbounds %struct.redblacktree_t, ptr %2, i32 0, i32 5
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  call void @print_rbt(ptr noundef %80, i32 noundef 0)
  call void @rbtree_check(ptr noundef %2)
  br label %81

81:                                               ; preds = %66
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %3, align 4, !tbaa !5
  br label %63, !llvm.loop !16

84:                                               ; preds = %63
  %85 = call i32 @rbtree_destroy(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #4
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

declare i32 @rbtree_create(ptr noundef, i64 noundef) #2

declare i32 @rbtree_add(ptr noundef, ptr noundef) #2

declare i32 @rbtree_min_value(ptr noundef, ptr noundef) #2

declare i32 @rbtree_max_value(ptr noundef, ptr noundef) #2

declare i32 @rbtree_remove_item(ptr noundef, ptr noundef) #2

declare i32 @rbtree_destroy(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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !14, i64 40}
!12 = !{!"redblacktree_t", !13, i64 0, !13, i64 8, !14, i64 16, !14, i64 24, !13, i64 32, !14, i64 40}
!13 = !{!"long", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!12, !13, i64 0}
!16 = distinct !{!16, !10}


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

%struct.redblacktree_t = type { i64, i64, ptr, ptr, i64, ptr }

@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_rbt(ptr noundef, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; 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 void @find_int(ptr noundef, i32 noundef) local_unnamed_addr #0

declare ptr @gerror_to_str(i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.redblacktree_t, align 8
  %2 = alloca [10 x i32], align 16
  %3 = alloca i32, align 4
  %4 = tail call i64 @time(ptr noundef null) #5
  %5 = trunc i64 %4 to i32
  tail call void @srand(i32 noundef %5) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #5
  %6 = call i32 @rbtree_create(ptr noundef nonnull %1, i64 noundef 4) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #5
  call void @inicialize(ptr noundef nonnull %2, i32 noundef 10)
  call void @randomize(ptr noundef nonnull %2, i32 noundef 10)
  call void @vprint(ptr noundef nonnull %2, i32 noundef 10)
  %7 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %2) #5
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %8) #5
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %10) #5
  %12 = getelementptr inbounds i8, ptr %2, i64 12
  %13 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %12) #5
  %14 = getelementptr inbounds i8, ptr %2, i64 16
  %15 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %14) #5
  %16 = getelementptr inbounds i8, ptr %2, i64 20
  %17 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %16) #5
  %18 = getelementptr inbounds i8, ptr %2, i64 24
  %19 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %18) #5
  %20 = getelementptr inbounds i8, ptr %2, i64 28
  %21 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %20) #5
  %22 = getelementptr inbounds i8, ptr %2, i64 32
  %23 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %22) #5
  %24 = getelementptr inbounds i8, ptr %2, i64 36
  %25 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %24) #5
  %26 = getelementptr inbounds i8, ptr %1, i64 40
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %27, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %28 = call i32 @rand() #5
  %29 = srem i32 %28, 10
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %29)
  call void @find_int(ptr noundef nonnull %1, i32 noundef %29)
  %31 = call i32 @rand() #5
  %32 = srem i32 %31, 10
  %33 = add nsw i32 %32, 10
  store i32 %33, ptr %3, align 4, !tbaa !11
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %33)
  call void @find_int(ptr noundef nonnull %1, i32 noundef %33)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %36 = call i32 @rbtree_min_value(ptr noundef nonnull %1, ptr noundef nonnull %3) #5
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %0
  %39 = load i32, ptr %3, align 4, !tbaa !11
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %39)
  br label %44

41:                                               ; preds = %0
  %42 = call ptr @gerror_to_str(i32 noundef %36) #5
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %42)
  br label %44

44:                                               ; preds = %41, %38
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %46 = call i32 @rbtree_max_value(ptr noundef nonnull %1, ptr noundef nonnull %3) #5
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %44
  %49 = load i32, ptr %3, align 4, !tbaa !11
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %49)
  br label %54

51:                                               ; preds = %44
  %52 = call ptr @gerror_to_str(i32 noundef %46) #5
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %52)
  br label %54

54:                                               ; preds = %51, %48
  call void @rbtree_check(ptr noundef nonnull %1)
  call void @randomize(ptr noundef nonnull %2, i32 noundef 10)
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  call void @vprint(ptr noundef nonnull %2, i32 noundef 10)
  %56 = load i32, ptr %2, align 16, !tbaa !11
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %56)
  %58 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %2) #5
  %59 = load i64, ptr %1, align 8, !tbaa !13
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %59)
  %61 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %61, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %62)
  %64 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %8) #5
  %65 = load i64, ptr %1, align 8, !tbaa !13
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %65)
  %67 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %67, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %68 = load i32, ptr %10, align 8, !tbaa !11
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %68)
  %70 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %10) #5
  %71 = load i64, ptr %1, align 8, !tbaa !13
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %71)
  %73 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %73, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %74 = load i32, ptr %12, align 4, !tbaa !11
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %74)
  %76 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %12) #5
  %77 = load i64, ptr %1, align 8, !tbaa !13
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %77)
  %79 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %79, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %80 = load i32, ptr %14, align 16, !tbaa !11
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %80)
  %82 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %14) #5
  %83 = load i64, ptr %1, align 8, !tbaa !13
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %83)
  %85 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %85, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %86 = load i32, ptr %16, align 4, !tbaa !11
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %86)
  %88 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %16) #5
  %89 = load i64, ptr %1, align 8, !tbaa !13
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %89)
  %91 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %91, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %92 = load i32, ptr %18, align 8, !tbaa !11
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %92)
  %94 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %18) #5
  %95 = load i64, ptr %1, align 8, !tbaa !13
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %95)
  %97 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %97, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %98 = load i32, ptr %20, align 4, !tbaa !11
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %98)
  %100 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %20) #5
  %101 = load i64, ptr %1, align 8, !tbaa !13
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %101)
  %103 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %103, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %104 = load i32, ptr %22, align 16, !tbaa !11
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %104)
  %106 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %22) #5
  %107 = load i64, ptr %1, align 8, !tbaa !13
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %107)
  %109 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %109, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %110 = load i32, ptr %24, align 4, !tbaa !11
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %110)
  %112 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %24) #5
  %113 = load i64, ptr %1, align 8, !tbaa !13
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %113)
  %115 = load ptr, ptr %26, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %115, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %116 = call i32 @rbtree_destroy(ptr noundef nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

declare i32 @rbtree_create(ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @rbtree_add(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @rbtree_min_value(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @rbtree_max_value(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @rbtree_remove_item(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @rbtree_destroy(ptr noundef) local_unnamed_addr #3

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 = { 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 #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 "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 }

!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 40}
!6 = !{!"redblacktree_t", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !10, i64 40}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 0}


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