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

; 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.6 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.main.to_insert = external hidden unnamed_addr constant [10 x ptr], align 16
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.23 = 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 @randomize(ptr noundef, i32 noundef) #0

; 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
declare dso_local i32 @compare_string_function(ptr noundef, ptr noundef, 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 ptr], align 16
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = call i64 @time(ptr noundef null) #5
  %8 = trunc i64 %7 to i32
  call void @srand(i32 noundef %8) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #5
  %9 = call i32 @rbtree_create(ptr noundef %2, i64 noundef 8)
  %10 = call i32 @rbtree_set_compare_function(ptr noundef %2, ptr noundef @compare_string_function, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.main.to_insert, i64 80, i1 false)
  %11 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 0
  call void @randomize(ptr noundef %11, i32 noundef 10)
  %12 = getelementptr inbounds [10 x ptr], 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 ptr], 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 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %28 = call i32 @rbtree_min_value(ptr noundef %2, ptr noundef %5)
  %29 = icmp eq i32 %28, 0
  %30 = zext i1 %29 to i32
  store i32 %30, ptr %6, align 4, !tbaa !5
  br i1 %29, label %31, label %34

31:                                               ; preds = %24
  %32 = load ptr, ptr %5, align 8, !tbaa !15
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %32)
  br label %38

34:                                               ; preds = %24
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = call ptr @gerror_to_str(i32 noundef %35)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %36)
  br label %38

38:                                               ; preds = %34, %31
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %40 = call i32 @rbtree_max_value(ptr noundef %2, ptr noundef %5)
  store i32 %40, ptr %6, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  %43 = load ptr, ptr %5, align 8, !tbaa !15
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %43)
  br label %49

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

49:                                               ; preds = %45, %42
  call void @rbtree_check(ptr noundef %2)
  %50 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 0
  call void @randomize(ptr noundef %50, i32 noundef 10)
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %52 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 0
  call void @vprint(ptr noundef %52, i32 noundef 10)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %71, %49
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 10
  br i1 %55, label %56, label %74

56:                                               ; preds = %53
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !15
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, ptr noundef %60)
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 %63
  %65 = call i32 @rbtree_remove_item(ptr noundef %2, ptr noundef %64)
  %66 = getelementptr inbounds %struct.redblacktree_t, ptr %2, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !16
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i64 noundef %67)
  %69 = getelementptr inbounds %struct.redblacktree_t, ptr %2, i32 0, i32 5
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  call void @print_rbt(ptr noundef %70, i32 noundef 0)
  call void @rbtree_check(ptr noundef %2)
  br label %71

71:                                               ; preds = %56
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %3, align 4, !tbaa !5
  br label %53, !llvm.loop !17

74:                                               ; preds = %53
  %75 = call i32 @rbtree_destroy(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #5
  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_set_compare_function(ptr noundef, 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

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

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

declare ptr @gerror_to_str(i32 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 = { 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 = 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 = !{!14, !14, i64 0}
!16 = !{!12, !13, i64 0}
!17 = distinct !{!17, !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.6 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.main.to_insert = external hidden unnamed_addr constant [10 x ptr], align 16
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.23 = 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 @randomize(ptr noundef, i32 noundef) local_unnamed_addr #0

; 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
declare dso_local i32 @compare_string_function(ptr noundef, ptr noundef, ptr noundef) #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 ptr], align 16
  %3 = alloca ptr, align 8
  %4 = tail call i64 @time(ptr noundef null) #6
  %5 = trunc i64 %4 to i32
  tail call void @srand(i32 noundef %5) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #6
  %6 = call i32 @rbtree_create(ptr noundef nonnull %1, i64 noundef 8) #6
  %7 = call i32 @rbtree_set_compare_function(ptr noundef nonnull %1, ptr noundef nonnull @compare_string_function, ptr noundef null) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %2, ptr noundef nonnull align 16 dereferenceable(80) @__const.main.to_insert, i64 80, i1 false)
  call void @randomize(ptr noundef nonnull %2, i32 noundef 10)
  call void @vprint(ptr noundef nonnull %2, i32 noundef 10)
  %8 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %2) #6
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  %10 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %9) #6
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  %12 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %11) #6
  %13 = getelementptr inbounds i8, ptr %2, i64 24
  %14 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %13) #6
  %15 = getelementptr inbounds i8, ptr %2, i64 32
  %16 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %15) #6
  %17 = getelementptr inbounds i8, ptr %2, i64 40
  %18 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %17) #6
  %19 = getelementptr inbounds i8, ptr %2, i64 48
  %20 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %19) #6
  %21 = getelementptr inbounds i8, ptr %2, i64 56
  %22 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %21) #6
  %23 = getelementptr inbounds i8, ptr %2, i64 64
  %24 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %23) #6
  %25 = getelementptr inbounds i8, ptr %2, i64 72
  %26 = call i32 @rbtree_add(ptr noundef nonnull %1, ptr noundef nonnull %25) #6
  %27 = getelementptr inbounds i8, ptr %1, i64 40
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %28, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %30 = call i32 @rbtree_min_value(ptr noundef nonnull %1, ptr noundef nonnull %3) #6
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %0
  %33 = load ptr, ptr %3, align 8, !tbaa !11
  br label %36

34:                                               ; preds = %0
  %35 = call ptr @gerror_to_str(i32 noundef 0) #6
  br label %36

36:                                               ; preds = %34, %32
  %.sink = phi ptr [ %35, %34 ], [ %33, %32 ]
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %.sink)
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %39 = call i32 @rbtree_max_value(ptr noundef nonnull %1, ptr noundef nonnull %3) #6
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %36
  %42 = load ptr, ptr %3, align 8, !tbaa !11
  br label %45

43:                                               ; preds = %36
  %44 = call ptr @gerror_to_str(i32 noundef %39) #6
  br label %45

45:                                               ; preds = %43, %41
  %.sink14 = phi ptr [ %44, %43 ], [ %42, %41 ]
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %.sink14)
  call void @rbtree_check(ptr noundef nonnull %1)
  call void @randomize(ptr noundef nonnull %2, i32 noundef 10)
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  call void @vprint(ptr noundef nonnull %2, i32 noundef 10)
  %48 = load ptr, ptr %2, align 16, !tbaa !11
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %48)
  %50 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %2) #6
  %51 = load i64, ptr %1, align 8, !tbaa !12
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %51)
  %53 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %53, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %54 = load ptr, ptr %9, align 8, !tbaa !11
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %54)
  %56 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %9) #6
  %57 = load i64, ptr %1, align 8, !tbaa !12
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %57)
  %59 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %59, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %60 = load ptr, ptr %11, align 16, !tbaa !11
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %60)
  %62 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %11) #6
  %63 = load i64, ptr %1, align 8, !tbaa !12
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %63)
  %65 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %65, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %66 = load ptr, ptr %13, align 8, !tbaa !11
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %66)
  %68 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %13) #6
  %69 = load i64, ptr %1, align 8, !tbaa !12
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %69)
  %71 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %71, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %72 = load ptr, ptr %15, align 16, !tbaa !11
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %72)
  %74 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %15) #6
  %75 = load i64, ptr %1, align 8, !tbaa !12
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %75)
  %77 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %77, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %78 = load ptr, ptr %17, align 8, !tbaa !11
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %78)
  %80 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %17) #6
  %81 = load i64, ptr %1, align 8, !tbaa !12
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %81)
  %83 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %83, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %84 = load ptr, ptr %19, align 16, !tbaa !11
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %84)
  %86 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %19) #6
  %87 = load i64, ptr %1, align 8, !tbaa !12
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %87)
  %89 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %89, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %90 = load ptr, ptr %21, align 8, !tbaa !11
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %90)
  %92 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %21) #6
  %93 = load i64, ptr %1, align 8, !tbaa !12
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %93)
  %95 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %95, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %96 = load ptr, ptr %23, align 16, !tbaa !11
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %96)
  %98 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %23) #6
  %99 = load i64, ptr %1, align 8, !tbaa !12
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %99)
  %101 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %101, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %102 = load ptr, ptr %25, align 8, !tbaa !11
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %102)
  %104 = call i32 @rbtree_remove_item(ptr noundef nonnull %1, ptr noundef nonnull %25) #6
  %105 = load i64, ptr %1, align 8, !tbaa !12
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %105)
  %107 = load ptr, ptr %27, align 8, !tbaa !5
  call void @print_rbt(ptr noundef %107, i32 noundef 0)
  call void @rbtree_check(ptr noundef nonnull %1)
  %108 = call i32 @rbtree_destroy(ptr noundef nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

declare i32 @rbtree_set_compare_function(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

declare ptr @gerror_to_str(i32 noundef) local_unnamed_addr #4

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

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

declare i32 @rbtree_destroy(ptr noundef) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!10, !10, i64 0}
!12 = !{!6, !7, i64 0}


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