; LLVM IR from seppo0010/rlite :: src (type_set)

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_set_get_objects(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare i32 @rl_btree_find_score(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @rl_multi_string_set(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @rl_btree_add_element(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

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

declare i32 @rl_btree_iterator_next(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @rl_multi_string_get(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @rl_btree_iterator_create(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @rl_key_delete_with_value(ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_sunionstore(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i64 %2, ptr %10, align 8, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !11
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store ptr null, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store i64 0, ptr %27, align 8, !tbaa !9
  %28 = load ptr, ptr %14, align 8, !tbaa !5
  store i64 0, ptr %28, align 8, !tbaa !9
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i64, ptr %10, align 8, !tbaa !9
  %32 = call i32 @rl_key_delete_with_value(ptr noundef %29, ptr noundef %30, i64 noundef %31)
  store i32 %32, ptr %15, align 4, !tbaa !11
  %33 = load i32, ptr %15, align 4, !tbaa !11
  %34 = icmp ne i32 %33, 3
  br i1 %34, label %35, label %39

35:                                               ; preds = %7
  %36 = load i32, ptr %15, align 4, !tbaa !11
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  br label %164

39:                                               ; preds = %35, %7
  %40 = load i32, ptr %11, align 4, !tbaa !11
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  store i32 3, ptr %15, align 4, !tbaa !11
  br label %164

43:                                               ; preds = %39
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = call i32 @rl_set_get_objects(ptr noundef %44, ptr noundef %45, i64 noundef %46, ptr noundef %24, ptr noundef %16, i32 noundef 0, i32 noundef 1)
  store i32 %47, ptr %15, align 4, !tbaa !11
  %48 = load i32, ptr %15, align 4, !tbaa !11
  %49 = icmp ne i32 0, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %43
  br label %164

51:                                               ; preds = %43
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %146, %51
  %53 = load i64, ptr %22, align 8, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %53, %55
  br i1 %56, label %57, label %149

57:                                               ; preds = %52
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = load i64, ptr %22, align 8, !tbaa !9
  %61 = getelementptr inbounds ptr, ptr %59, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = load i64, ptr %22, align 8, !tbaa !9
  %65 = getelementptr inbounds i64, ptr %63, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = call i32 @rl_set_get_objects(ptr noundef %58, ptr noundef %62, i64 noundef %66, ptr noundef null, ptr noundef %17, i32 noundef 0, i32 noundef 0)
  store i32 %67, ptr %15, align 4, !tbaa !11
  %68 = load i32, ptr %15, align 4, !tbaa !11
  %69 = icmp eq i32 %68, 3
  br i1 %69, label %70, label %71

70:                                               ; preds = %57
  br label %146

71:                                               ; preds = %57
  %72 = load i32, ptr %15, align 4, !tbaa !11
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %71
  br label %164

75:                                               ; preds = %71
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load ptr, ptr %17, align 8, !tbaa !5
  %79 = call i32 @rl_btree_iterator_create(ptr noundef %77, ptr noundef %78, ptr noundef %18)
  store i32 %79, ptr %15, align 4, !tbaa !11
  %80 = load i32, ptr %15, align 4, !tbaa !11
  %81 = icmp ne i32 0, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %76
  br label %164

83:                                               ; preds = %76
  br label %84

84:                                               ; preds = %140, %83
  %85 = load ptr, ptr %18, align 8, !tbaa !5
  %86 = call i32 @rl_btree_iterator_next(ptr noundef %85, ptr noundef %19, ptr noundef %25)
  store i32 %86, ptr %15, align 4, !tbaa !11
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %141

88:                                               ; preds = %84
  %89 = load ptr, ptr %25, align 8, !tbaa !5
  %90 = load i64, ptr %89, align 8, !tbaa !9
  store i64 %90, ptr %23, align 8, !tbaa !9
  %91 = load ptr, ptr %25, align 8, !tbaa !5
  call void @free(ptr noundef %91) #5
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = call i32 @rl_btree_find_score(ptr noundef %92, ptr noundef %93, ptr noundef %94, ptr noundef %25, ptr noundef null, ptr noundef null)
  store i32 %95, ptr %15, align 4, !tbaa !11
  %96 = load i32, ptr %15, align 4, !tbaa !11
  %97 = icmp eq i32 %96, 3
  br i1 %97, label %98, label %133

98:                                               ; preds = %88
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = load i64, ptr %23, align 8, !tbaa !9
  %101 = call i32 @rl_multi_string_get(ptr noundef %99, i64 noundef %100, ptr noundef %20, ptr noundef %21)
  store i32 %101, ptr %15, align 4, !tbaa !11
  %102 = load i32, ptr %15, align 4, !tbaa !11
  %103 = icmp ne i32 0, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %98
  br label %164

105:                                              ; preds = %98
  %106 = call noalias ptr @malloc(i64 noundef 8) #6
  store ptr %106, ptr %26, align 8, !tbaa !5
  %107 = load ptr, ptr %26, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 4, ptr %15, align 4, !tbaa !11
  br label %164

110:                                              ; preds = %105
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = load ptr, ptr %26, align 8, !tbaa !5
  %113 = load ptr, ptr %20, align 8, !tbaa !5
  %114 = load i64, ptr %21, align 8, !tbaa !9
  %115 = call i32 @rl_multi_string_set(ptr noundef %111, ptr noundef %112, ptr noundef %113, i64 noundef %114)
  store i32 %115, ptr %15, align 4, !tbaa !11
  %116 = load i32, ptr %15, align 4, !tbaa !11
  %117 = icmp ne i32 0, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %110
  br label %164

119:                                              ; preds = %110
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = load i64, ptr %24, align 8, !tbaa !9
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = load ptr, ptr %26, align 8, !tbaa !5
  %125 = call i32 @rl_btree_add_element(ptr noundef %120, ptr noundef %121, i64 noundef %122, ptr noundef %123, ptr noundef %124)
  store i32 %125, ptr %15, align 4, !tbaa !11
  %126 = load i32, ptr %15, align 4, !tbaa !11
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %119
  br label %164

129:                                              ; preds = %119
  %130 = load i64, ptr %27, align 8, !tbaa !9
  %131 = add nsw i64 %130, 1
  store i64 %131, ptr %27, align 8, !tbaa !9
  %132 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %132) #5
  br label %140

133:                                              ; preds = %88
  %134 = load i32, ptr %15, align 4, !tbaa !11
  %135 = icmp eq i32 %134, 2
  br i1 %135, label %136, label %138

136:                                              ; preds = %133
  %137 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %137) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  br label %139

138:                                              ; preds = %133
  br label %164

139:                                              ; preds = %136
  br label %140

140:                                              ; preds = %139, %129
  br label %84, !llvm.loop !13

141:                                              ; preds = %84
  store ptr null, ptr %18, align 8, !tbaa !5
  %142 = load i32, ptr %15, align 4, !tbaa !11
  %143 = icmp ne i32 %142, 9
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  br label %164

145:                                              ; preds = %141
  br label %146

146:                                              ; preds = %145, %70
  %147 = load i64, ptr %22, align 8, !tbaa !9
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %22, align 8, !tbaa !9
  br label %52, !llvm.loop !15

149:                                              ; preds = %52
  %150 = load i64, ptr %27, align 8, !tbaa !9
  %151 = icmp eq i64 %150, 0
  br i1 %151, label %152, label %161

152:                                              ; preds = %149
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = load i64, ptr %10, align 8, !tbaa !9
  %156 = call i32 @rl_key_delete_with_value(ptr noundef %153, ptr noundef %154, i64 noundef %155)
  store i32 %156, ptr %15, align 4, !tbaa !11
  %157 = load i32, ptr %15, align 4, !tbaa !11
  %158 = icmp ne i32 0, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %152
  br label %164

160:                                              ; preds = %152
  br label %161

161:                                              ; preds = %160, %149
  %162 = load i64, ptr %27, align 8, !tbaa !9
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  store i64 %162, ptr %163, align 8, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %164

164:                                              ; preds = %161, %159, %144, %138, %128, %118, %109, %104, %82, %74, %50, %42, %38
  %165 = load i32, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  ret i32 %165
}

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 = { nounwind allocsize(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 = { 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 }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_set_get_objects(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_sunionstore(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  store i64 0, ptr %6, align 8, !tbaa !9
  %16 = tail call i32 @rl_key_delete_with_value(ptr noundef %0, ptr noundef %1, i64 noundef %2) #5
  switch i32 %16, label %.loopexit [
    i32 3, label %17
    i32 0, label %17
  ]

17:                                               ; preds = %7, %7
  %18 = icmp eq i32 %3, 0
  br i1 %18, label %.loopexit, label %19

19:                                               ; preds = %17
  %20 = call i32 @rl_set_get_objects(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull %14, ptr noundef nonnull %8, i32 noundef 0, i32 noundef 1)
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %.preheader68, label %.loopexit

.preheader68:                                     ; preds = %19
  %21 = sext i32 %3 to i64
  %22 = icmp sgt i32 %3, 0
  br i1 %22, label %.lr.ph79, label %._crit_edge80.thread

.lr.ph79:                                         ; preds = %.preheader68, %61
  %.078 = phi i64 [ %.3, %61 ], [ 0, %.preheader68 ]
  %.04777 = phi i64 [ %62, %61 ], [ 0, %.preheader68 ]
  %23 = getelementptr inbounds ptr, ptr %4, i64 %.04777
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i64, ptr %5, i64 %.04777
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = call i32 @rl_set_get_objects(ptr noundef %0, ptr noundef %24, i64 noundef %26, ptr noundef null, ptr noundef nonnull %9, i32 noundef 0, i32 noundef 0)
  switch i32 %27, label %.loopexit [
    i32 3, label %61
    i32 0, label %28
  ]

28:                                               ; preds = %.lr.ph79
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = call i32 @rl_btree_iterator_create(ptr noundef %0, ptr noundef %29, ptr noundef nonnull %10) #5
  %.not62 = icmp eq i32 %30, 0
  br i1 %.not62, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %28
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = call i32 @rl_btree_iterator_next(ptr noundef %31, ptr noundef nonnull %11, ptr noundef nonnull %15) #5
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %57
  %.175 = phi i64 [ %.2, %57 ], [ %.078, %.preheader ]
  %34 = load ptr, ptr %15, align 8, !tbaa !5
  %35 = load i64, ptr %34, align 8, !tbaa !9
  call void @free(ptr noundef %34) #5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = call i32 @rl_btree_find_score(ptr noundef %0, ptr noundef %36, ptr noundef %37, ptr noundef nonnull %15, ptr noundef null, ptr noundef null) #5
  switch i32 %38, label %.loopexit [
    i32 3, label %39
    i32 2, label %55
  ]

39:                                               ; preds = %.lr.ph
  %40 = call i32 @rl_multi_string_get(ptr noundef %0, i64 noundef %35, ptr noundef nonnull %12, ptr noundef nonnull %13) #5
  %.not64 = icmp eq i32 %40, 0
  br i1 %.not64, label %41, label %.loopexit

41:                                               ; preds = %39
  %42 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
  %.not65 = icmp eq ptr %42, null
  br i1 %.not65, label %.loopexit, label %43

43:                                               ; preds = %41
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = load i64, ptr %13, align 8, !tbaa !9
  %46 = call i32 @rl_multi_string_set(ptr noundef %0, ptr noundef nonnull %42, ptr noundef %44, i64 noundef %45) #5
  %.not66 = icmp eq i32 %46, 0
  br i1 %.not66, label %47, label %.loopexit

47:                                               ; preds = %43
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i64, ptr %14, align 8, !tbaa !9
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call i32 @rl_btree_add_element(ptr noundef %0, ptr noundef %48, i64 noundef %49, ptr noundef %50, ptr noundef nonnull %42) #5
  %.not67 = icmp eq i32 %51, 0
  br i1 %.not67, label %52, label %.loopexit

52:                                               ; preds = %47
  %53 = add nsw i64 %.175, 1
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %54) #5
  br label %57

55:                                               ; preds = %.lr.ph
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %56) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %55, %52
  %.2 = phi i64 [ %53, %52 ], [ %.175, %55 ]
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = call i32 @rl_btree_iterator_next(ptr noundef %58, ptr noundef nonnull %11, ptr noundef nonnull %15) #5
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %57, %.preheader
  %.1.lcssa = phi i64 [ %.078, %.preheader ], [ %.2, %57 ]
  %.lcssa = phi i32 [ %32, %.preheader ], [ %59, %57 ]
  store ptr null, ptr %10, align 8, !tbaa !5
  %.not63 = icmp eq i32 %.lcssa, 9
  br i1 %.not63, label %61, label %.loopexit

61:                                               ; preds = %.lr.ph79, %._crit_edge
  %.3 = phi i64 [ %.078, %.lr.ph79 ], [ %.1.lcssa, %._crit_edge ]
  %62 = add nuw nsw i64 %.04777, 1
  %exitcond.not = icmp eq i64 %62, %21
  br i1 %exitcond.not, label %._crit_edge80, label %.lr.ph79, !llvm.loop !13

._crit_edge80:                                    ; preds = %61
  %63 = icmp eq i64 %.3, 0
  br i1 %63, label %._crit_edge80.thread, label %65

._crit_edge80.thread:                             ; preds = %.preheader68, %._crit_edge80
  %64 = call i32 @rl_key_delete_with_value(ptr noundef %0, ptr noundef %1, i64 noundef %2) #5
  %.not60 = icmp eq i32 %64, 0
  br i1 %.not60, label %65, label %.loopexit

65:                                               ; preds = %._crit_edge80.thread, %._crit_edge80
  %.0.lcssa86 = phi i64 [ 0, %._crit_edge80.thread ], [ %.3, %._crit_edge80 ]
  store i64 %.0.lcssa86, ptr %6, align 8, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph79, %._crit_edge, %28, %.lr.ph, %41, %47, %43, %39, %17, %7, %._crit_edge80.thread, %19, %65
  %.046 = phi i32 [ %16, %7 ], [ %20, %19 ], [ %64, %._crit_edge80.thread ], [ 0, %65 ], [ 3, %17 ], [ %38, %.lr.ph ], [ 4, %41 ], [ %51, %47 ], [ %46, %43 ], [ %40, %39 ], [ %27, %.lr.ph79 ], [ %.lcssa, %._crit_edge ], [ %30, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  ret i32 %.046
}

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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass