; LLVM IR from fmela/libdict :: src (tr_tree)

; 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.dict_insert_result = type { ptr, i8 }
%struct.tr_tree = type { ptr, i64, ptr, i64, ptr }
%struct.tr_node = type { ptr, ptr, ptr, ptr, ptr, i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__func__.tr_tree_insert = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @abort() #2

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

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, i8 } @tr_tree_insert(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca %struct.dict_insert_result, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.tr_tree, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  store ptr %13, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %47, %2
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %48

17:                                               ; preds = %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.tr_tree, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.tr_node, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = call i32 %20(ptr noundef %21, ptr noundef %24)
  store i32 %25, ptr %6, align 4, !tbaa !9
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %33

28:                                               ; preds = %17
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %29, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.tr_node, ptr %30, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  store ptr %32, ptr %7, align 8, !tbaa !5
  br label %47

33:                                               ; preds = %17
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %41

36:                                               ; preds = %33
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.tr_node, ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  store ptr %40, ptr %7, align 8, !tbaa !5
  br label %46

41:                                               ; preds = %33
  %42 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 0
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.tr_node, ptr %43, i32 0, i32 1
  store ptr %44, ptr %42, align 8, !tbaa !19
  %45 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 1
  store i8 0, ptr %45, align 8, !tbaa !22
  store i32 1, ptr %9, align 4
  br label %167

46:                                               ; preds = %36
  br label %47

47:                                               ; preds = %46, %28
  br label %14, !llvm.loop !23

48:                                               ; preds = %14
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = call ptr @node_new(ptr noundef %49)
  store ptr %50, ptr %7, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %55, label %52

52:                                               ; preds = %48
  %53 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 0
  store ptr null, ptr %53, align 8, !tbaa !19
  %54 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 1
  store i8 0, ptr %54, align 8, !tbaa !22
  store i32 1, ptr %9, align 4
  br label %167

55:                                               ; preds = %48
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.tr_tree, ptr %56, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %66

60:                                               ; preds = %55
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.tr_tree, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call i32 %63(ptr noundef %64)
  br label %68

66:                                               ; preds = %55
  %67 = call i32 @dict_rand()
  br label %68

68:                                               ; preds = %66, %60
  %69 = phi i32 [ %65, %60 ], [ %67, %66 ]
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.tr_node, ptr %70, i32 0, i32 5
  store i32 %69, ptr %71, align 8, !tbaa !26
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.tr_node, ptr %73, i32 0, i32 2
  store ptr %72, ptr %74, align 8, !tbaa !27
  %75 = icmp ne ptr %72, null
  br i1 %75, label %110, label %76

76:                                               ; preds = %68
  br label %77

77:                                               ; preds = %76
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.tr_tree, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = icmp eq ptr %80, null
  %82 = zext i1 %81 to i32
  %83 = sext i32 %82 to i64
  %84 = call i64 @llvm.expect.i64(i64 %83, i64 1)
  %85 = icmp ne i64 %84, 0
  br i1 %85, label %89, label %86

86:                                               ; preds = %77
  %87 = load ptr, ptr @stderr, align 8, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 159, ptr noundef @__func__.tr_tree_insert, ptr noundef @.str.3) #7
  call void @abort() #8
  unreachable

89:                                               ; preds = %77
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.tr_tree, ptr %93, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !28
  %96 = icmp eq i64 %95, 0
  %97 = zext i1 %96 to i32
  %98 = sext i32 %97 to i64
  %99 = call i64 @llvm.expect.i64(i64 %98, i64 1)
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %104, label %101

101:                                              ; preds = %92
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 160, ptr noundef @__func__.tr_tree_insert, ptr noundef @.str.4) #7
  call void @abort() #8
  unreachable

104:                                              ; preds = %92
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.tr_tree, ptr %108, i32 0, i32 0
  store ptr %107, ptr %109, align 8, !tbaa !11
  br label %158

110:                                              ; preds = %68
  %111 = load i32, ptr %6, align 4, !tbaa !9
  %112 = icmp slt i32 %111, 0
  br i1 %112, label %113, label %117

113:                                              ; preds = %110
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.tr_node, ptr %115, i32 0, i32 3
  store ptr %114, ptr %116, align 8, !tbaa !17
  br label %121

117:                                              ; preds = %110
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.tr_node, ptr %119, i32 0, i32 4
  store ptr %118, ptr %120, align 8, !tbaa !18
  br label %121

121:                                              ; preds = %117, %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %150, %121
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.tr_node, ptr %123, i32 0, i32 5
  %125 = load i32, ptr %124, align 8, !tbaa !26
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.tr_node, ptr %126, i32 0, i32 5
  %128 = load i32, ptr %127, align 8, !tbaa !26
  %129 = icmp ult i32 %125, %128
  br i1 %129, label %130, label %151

130:                                              ; preds = %122
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = add i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !9
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.tr_node, ptr %133, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !17
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = icmp eq ptr %135, %136
  br i1 %137, label %138, label %141

138:                                              ; preds = %130
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tree_node_rot_right(ptr noundef %139, ptr noundef %140)
  br label %144

141:                                              ; preds = %130
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tree_node_rot_left(ptr noundef %142, ptr noundef %143)
  br label %144

144:                                              ; preds = %141, %138
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.tr_node, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !27
  store ptr %147, ptr %8, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %150, label %149

149:                                              ; preds = %144
  br label %151

150:                                              ; preds = %144
  br label %122, !llvm.loop !29

151:                                              ; preds = %149, %122
  %152 = load i32, ptr %10, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.tr_tree, ptr %154, i32 0, i32 3
  %156 = load i64, ptr %155, align 8, !tbaa !30
  %157 = add i64 %156, %153
  store i64 %157, ptr %155, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %158

158:                                              ; preds = %151, %106
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.tr_tree, ptr %159, i32 0, i32 1
  %161 = load i64, ptr %160, align 8, !tbaa !28
  %162 = add i64 %161, 1
  store i64 %162, ptr %160, align 8, !tbaa !28
  %163 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 0
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.tr_node, ptr %164, i32 0, i32 1
  store ptr %165, ptr %163, align 8, !tbaa !19
  %166 = getelementptr inbounds %struct.dict_insert_result, ptr %3, i32 0, i32 1
  store i8 1, ptr %166, align 8, !tbaa !22
  store i32 1, ptr %9, align 4
  br label %167

167:                                              ; preds = %158, %52, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %168 = load { ptr, i8 }, ptr %3, align 8
  ret { ptr, i8 } %168
}

; Function Attrs: nounwind uwtable
declare hidden ptr @node_new(ptr noundef) #4

declare void @tree_node_rot_right(ptr noundef, ptr noundef) #5

declare void @tree_node_rot_left(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @dict_rand() #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #1 = { 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 #2 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"tr_tree", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{!16, !6, i64 0}
!16 = !{!"tr_node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40}
!17 = !{!16, !6, i64 24}
!18 = !{!16, !6, i64 32}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !21, i64 8}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!20, !21, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !6, i64 32}
!26 = !{!16, !10, i64 40}
!27 = !{!16, !6, i64 16}
!28 = !{!12, !13, i64 8}
!29 = distinct !{!29, !24}
!30 = !{!12, !13, 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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__func__.tr_tree_insert = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local { ptr, i8 } @tr_tree_insert(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %.04358 = load ptr, ptr %0, align 8, !tbaa !5
  %.not59 = icmp eq ptr %.04358, null
  br i1 %.not59, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  br label %4

4:                                                ; preds = %.lr.ph, %12
  %.04360 = phi ptr [ %.04358, %.lr.ph ], [ %.043, %12 ]
  %5 = load ptr, ptr %3, align 8, !tbaa !9
  %6 = load ptr, ptr %.04360, align 8, !tbaa !12
  %7 = tail call i32 %5(ptr noundef %1, ptr noundef %6) #5
  %8 = icmp slt i32 %7, 0
  br i1 %8, label %12, label %9

9:                                                ; preds = %4
  %.not54 = icmp eq i32 %7, 0
  br i1 %.not54, label %10, label %12

10:                                               ; preds = %9
  %11 = getelementptr inbounds i8, ptr %.04360, i64 8
  br label %68

12:                                               ; preds = %9, %4
  %.sink = phi i64 [ 24, %4 ], [ 32, %9 ]
  %13 = getelementptr inbounds i8, ptr %.04360, i64 %.sink
  %.043 = load ptr, ptr %13, align 8, !tbaa !5
  %.not = icmp eq ptr %.043, null
  br i1 %.not, label %._crit_edge.loopexit, label %4, !llvm.loop !15

._crit_edge.loopexit:                             ; preds = %12
  %14 = icmp slt i32 %7, 0
  %15 = select i1 %14, i64 24, i64 32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.045.lcssa = phi i64 [ 32, %2 ], [ %15, %._crit_edge.loopexit ]
  %.041.lcssa = phi ptr [ null, %2 ], [ %.04360, %._crit_edge.loopexit ]
  %16 = tail call ptr @node_new(ptr noundef %1)
  %.not50 = icmp eq ptr %16, null
  br i1 %.not50, label %68, label %17

17:                                               ; preds = %._crit_edge
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %.not51 = icmp eq ptr %19, null
  br i1 %.not51, label %22, label %20

20:                                               ; preds = %17
  %21 = tail call i32 %19(ptr noundef %1) #5
  br label %24

22:                                               ; preds = %17
  %23 = tail call i32 @dict_rand()
  br label %24

24:                                               ; preds = %22, %20
  %25 = phi i32 [ %21, %20 ], [ %23, %22 ]
  %26 = getelementptr inbounds i8, ptr %16, i64 40
  store i32 %25, ptr %26, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %16, i64 16
  store ptr %.041.lcssa, ptr %27, align 8, !tbaa !19
  %.not52 = icmp eq ptr %.041.lcssa, null
  br i1 %.not52, label %28, label %42

28:                                               ; preds = %24
  %29 = load ptr, ptr %0, align 8, !tbaa !20
  %30 = icmp eq ptr %29, null
  br i1 %30, label %34, label %31, !prof !21

31:                                               ; preds = %28
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 159, ptr noundef nonnull @__func__.tr_tree_insert, ptr noundef nonnull @.str.3) #6
  tail call void @abort() #7
  unreachable

34:                                               ; preds = %28
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !22
  %37 = icmp eq i64 %36, 0
  br i1 %37, label %41, label %38, !prof !21

38:                                               ; preds = %34
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 160, ptr noundef nonnull @__func__.tr_tree_insert, ptr noundef nonnull @.str.4) #6
  tail call void @abort() #7
  unreachable

41:                                               ; preds = %34
  store ptr %16, ptr %0, align 8, !tbaa !20
  br label %64

42:                                               ; preds = %24
  %43 = getelementptr inbounds i8, ptr %.041.lcssa, i64 %.045.lcssa
  store ptr %16, ptr %43, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %56, %42
  %.2 = phi ptr [ %.041.lcssa, %42 ], [ %57, %56 ]
  %.0 = phi i32 [ 0, %42 ], [ %50, %56 ]
  %45 = getelementptr inbounds i8, ptr %.2, i64 40
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = load i32, ptr %26, align 8, !tbaa !18
  %48 = icmp ult i32 %46, %47
  br i1 %48, label %49, label %58

49:                                               ; preds = %44
  %50 = add i32 %.0, 1
  %51 = getelementptr inbounds i8, ptr %.2, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !23
  %53 = icmp eq ptr %52, %16
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  tail call void @tree_node_rot_right(ptr noundef nonnull %0, ptr noundef nonnull %.2) #5
  br label %56

55:                                               ; preds = %49
  tail call void @tree_node_rot_left(ptr noundef nonnull %0, ptr noundef nonnull %.2) #5
  br label %56

56:                                               ; preds = %55, %54
  %57 = load ptr, ptr %27, align 8, !tbaa !19
  %.not53 = icmp eq ptr %57, null
  br i1 %.not53, label %58, label %44, !llvm.loop !24

58:                                               ; preds = %56, %44
  %.1 = phi i32 [ %50, %56 ], [ %.0, %44 ]
  %59 = zext i32 %.1 to i64
  %60 = getelementptr inbounds i8, ptr %0, i64 24
  %61 = load i64, ptr %60, align 8, !tbaa !25
  %62 = add i64 %61, %59
  store i64 %62, ptr %60, align 8, !tbaa !25
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 8
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !22
  %63 = add i64 %.pre, 1
  br label %64

64:                                               ; preds = %58, %41
  %65 = phi i64 [ %63, %58 ], [ 1, %41 ]
  %66 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %65, ptr %66, align 8, !tbaa !22
  %67 = getelementptr inbounds i8, ptr %16, i64 8
  br label %68

68:                                               ; preds = %._crit_edge, %64, %10
  %.sroa.0.0 = phi ptr [ %11, %10 ], [ %67, %64 ], [ null, %._crit_edge ]
  %.sroa.4.0 = phi i8 [ 0, %10 ], [ 1, %64 ], [ 0, %._crit_edge ]
  %.fca.0.insert = insertvalue { ptr, i8 } poison, ptr %.sroa.0.0, 0
  %.fca.1.insert = insertvalue { ptr, i8 } %.fca.0.insert, i8 %.sroa.4.0, 1
  ret { ptr, i8 } %.fca.1.insert
}

; Function Attrs: nounwind uwtable
declare hidden ptr @node_new(ptr noundef) local_unnamed_addr #2

declare void @tree_node_rot_right(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @tree_node_rot_left(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @dict_rand() local_unnamed_addr #4

attributes #0 = { 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 #1 = { noreturn 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 #2 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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, !6, i64 16}
!10 = !{!"tr_tree", !6, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !6, i64 32}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"tr_node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !14, i64 40}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !6, i64 32}
!18 = !{!13, !14, i64 40}
!19 = !{!13, !6, i64 16}
!20 = !{!10, !6, i64 0}
!21 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!22 = !{!10, !11, i64 8}
!23 = !{!13, !6, i64 24}
!24 = distinct !{!24, !16}
!25 = !{!10, !11, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass