; LLVM IR from Algo-Phantoms/Algo-Tree :: Code/C++/avl_tree.ll (Z14delete_elementP4nodei)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10LLrotationP4node(ptr noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10RRrotationP4node(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10LRrotationP4node(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10RLrotationP4node(ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z12minimum_nodeP4node(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14delete_elementP4nodei(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %13

11:                                               ; preds = %2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %12, ptr %3, align 8
  br label %166

13:                                               ; preds = %2
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.node, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp slt i32 %14, %17
  br i1 %18, label %19, label %27

19:                                               ; preds = %13
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.node, ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = call noundef ptr @_Z14delete_elementP4nodei(ptr noundef %22, i32 noundef %23)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.node, ptr %25, i32 0, i32 1
  store ptr %24, ptr %26, align 8, !tbaa !13
  br label %91

27:                                               ; preds = %13
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.node, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp sgt i32 %28, %31
  br i1 %32, label %33, label %41

33:                                               ; preds = %27
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.node, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = call noundef ptr @_Z14delete_elementP4nodei(ptr noundef %36, i32 noundef %37)
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.node, ptr %39, i32 0, i32 2
  store ptr %38, ptr %40, align 8, !tbaa !14
  br label %90

41:                                               ; preds = %27
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.node, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %70

46:                                               ; preds = %41
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.node, ptr %47, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %70

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.node, ptr %52, i32 0, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = call noundef ptr @_Z12minimum_nodeP4node(ptr noundef %54)
  store ptr %55, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.node, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !11
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.node, ptr %59, i32 0, i32 0
  store i32 %58, ptr %60, align 8, !tbaa !11
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.node, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.node, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !11
  %67 = call noundef ptr @_Z14delete_elementP4nodei(ptr noundef %63, i32 noundef %66)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.node, ptr %68, i32 0, i32 2
  store ptr %67, ptr %69, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %89

70:                                               ; preds = %46, %41
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.node, ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !13
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %79

75:                                               ; preds = %70
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.node, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !13
  store ptr %78, ptr %3, align 8
  br label %166

79:                                               ; preds = %70
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.node, ptr %80, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !14
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %88

84:                                               ; preds = %79
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.node, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  store ptr %87, ptr %3, align 8
  br label %166

88:                                               ; preds = %79
  store ptr null, ptr %3, align 8
  br label %166

89:                                               ; preds = %51
  br label %90

90:                                               ; preds = %89, %33
  br label %91

91:                                               ; preds = %90, %19
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = icmp eq ptr %92, null
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %95, ptr %3, align 8
  br label %166

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.node, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  %100 = call noundef i32 @_Z6heightP4node(ptr noundef %99)
  store i32 %100, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.node, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !14
  %104 = call noundef i32 @_Z6heightP4node(ptr noundef %103)
  store i32 %104, ptr %8, align 4, !tbaa !9
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = add nsw i32 1, %106
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.node, ptr %108, i32 0, i32 3
  store i32 %107, ptr %109, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %110)
  %112 = icmp eq i32 %111, 2
  br i1 %112, label %113, label %122

113:                                              ; preds = %96
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.node, ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !13
  %117 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %116)
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %122

119:                                              ; preds = %113
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = call noundef ptr @_Z10LLrotationP4node(ptr noundef %120)
  store ptr %121, ptr %3, align 8
  br label %166

122:                                              ; preds = %113, %96
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %123)
  %125 = icmp eq i32 %124, 2
  br i1 %125, label %126, label %135

126:                                              ; preds = %122
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.node, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !13
  %130 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %129)
  %131 = icmp eq i32 %130, -1
  br i1 %131, label %132, label %135

132:                                              ; preds = %126
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = call noundef ptr @_Z10LRrotationP4node(ptr noundef %133)
  store ptr %134, ptr %3, align 8
  br label %166

135:                                              ; preds = %126, %122
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %136)
  %138 = icmp eq i32 %137, -2
  br i1 %138, label %139, label %148

139:                                              ; preds = %135
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.node, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !14
  %143 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %142)
  %144 = icmp eq i32 %143, -1
  br i1 %144, label %145, label %148

145:                                              ; preds = %139
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = call noundef ptr @_Z10RRrotationP4node(ptr noundef %146)
  store ptr %147, ptr %3, align 8
  br label %166

148:                                              ; preds = %139, %135
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %149)
  %151 = icmp eq i32 %150, -2
  br i1 %151, label %152, label %161

152:                                              ; preds = %148
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.node, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !14
  %156 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %155)
  %157 = icmp eq i32 %156, 1
  br i1 %157, label %158, label %161

158:                                              ; preds = %152
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = call noundef ptr @_Z10RLrotationP4node(ptr noundef %159)
  store ptr %160, ptr %3, align 8
  br label %166

161:                                              ; preds = %152, %148
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %165, ptr %3, align 8
  br label %166

166:                                              ; preds = %164, %158, %145, %132, %119, %94, %88, %84, %75, %11
  %167 = load ptr, ptr %3, align 8
  ret ptr %167
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS4node", !10, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 16}
!15 = !{!12, !10, i64 24}


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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10LLrotationP4node(ptr 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z10RRrotationP4node(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z12minimum_nodeP4node(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14delete_elementP4nodei(ptr noundef %0, i32 noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = icmp eq ptr %0, null
  br i1 %5, label %72, label %6

6:                                                ; preds = %2
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = icmp sgt i32 %7, %1
  br i1 %8, label %9, label %11

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  br label %24

11:                                               ; preds = %6
  %12 = icmp slt i32 %7, %1
  br i1 %12, label %13, label %15

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  br label %24

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %.not = icmp eq ptr %17, null
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  br i1 %.not, label %72, label %20

20:                                               ; preds = %15
  %.not49 = icmp eq ptr %19, null
  br i1 %.not49, label %72, label %21

21:                                               ; preds = %20
  %22 = tail call noundef ptr @_Z12minimum_nodeP4node(ptr noundef nonnull %19)
  %23 = load i32, ptr %22, align 8, !tbaa !5
  store i32 %23, ptr %0, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %9, %21, %13
  %.sink = phi ptr [ %10, %9 ], [ %18, %21 ], [ %14, %13 ]
  %.sink54 = phi i32 [ %1, %9 ], [ %23, %21 ], [ %1, %13 ]
  %25 = load ptr, ptr %.sink, align 8, !tbaa !13
  %26 = tail call noundef ptr @_Z14delete_elementP4nodei(ptr noundef %25, i32 noundef %.sink54)
  store ptr %26, ptr %.sink, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = tail call noundef i32 @_Z6heightP4node(ptr noundef %28)
  store i32 %29, ptr %3, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = tail call noundef i32 @_Z6heightP4node(ptr noundef %31)
  store i32 %32, ptr %4, align 4, !tbaa !14
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = add nsw i32 %34, 1
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %35, ptr %36, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %37 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef nonnull %0)
  %38 = icmp eq i32 %37, 2
  br i1 %38, label %39, label %45

39:                                               ; preds = %24
  %40 = load ptr, ptr %27, align 8, !tbaa !11
  %41 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %40)
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %45

43:                                               ; preds = %39
  %44 = call noundef ptr @_Z10LLrotationP4node(ptr noundef nonnull %0)
  br label %72

45:                                               ; preds = %39, %24
  %46 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef nonnull %0)
  %47 = icmp eq i32 %46, 2
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  %49 = load ptr, ptr %27, align 8, !tbaa !11
  %50 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %49)
  %51 = icmp eq i32 %50, -1
  br i1 %51, label %52, label %54

52:                                               ; preds = %48
  %53 = call noundef ptr @_Z10LRrotationP4node(ptr noundef nonnull %0)
  br label %72

54:                                               ; preds = %48, %45
  %55 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef nonnull %0)
  %56 = icmp eq i32 %55, -2
  br i1 %56, label %57, label %63

57:                                               ; preds = %54
  %58 = load ptr, ptr %30, align 8, !tbaa !12
  %59 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %58)
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  %62 = call noundef ptr @_Z10RRrotationP4node(ptr noundef nonnull %0)
  br label %72

63:                                               ; preds = %57, %54
  %64 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef nonnull %0)
  %65 = icmp eq i32 %64, -2
  br i1 %65, label %66, label %72

66:                                               ; preds = %63
  %67 = load ptr, ptr %30, align 8, !tbaa !12
  %68 = call noundef i32 @_Z13BalanceFactorP4node(ptr noundef %67)
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = call noundef ptr @_Z10RLrotationP4node(ptr noundef nonnull %0)
  br label %72

72:                                               ; preds = %15, %20, %66, %63, %2, %70, %61, %52, %43
  %.0 = phi ptr [ %44, %43 ], [ %53, %52 ], [ %62, %61 ], [ %71, %70 ], [ null, %2 ], [ %0, %63 ], [ %0, %66 ], [ %17, %20 ], [ %19, %15 ]
  ret ptr %.0
}

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTS4node", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!10, !10, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass