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

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

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

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

39:                                               ; preds = %6
  br label %167

40:                                               ; preds = %6
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = call i32 @rl_smembers(ptr noundef %41, ptr noundef %20, ptr noundef %42, i64 noundef %43)
  store i32 %44, ptr %13, align 4, !tbaa !12
  %45 = load i32, ptr %13, align 4, !tbaa !12
  %46 = icmp ne i32 0, %45
  br i1 %46, label %47, label %51

47:                                               ; preds = %40
  %48 = load i32, ptr %13, align 4, !tbaa !12
  %49 = icmp ne i32 3, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %167

51:                                               ; preds = %47, %40
  %52 = load i32, ptr %13, align 4, !tbaa !12
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %65

54:                                               ; preds = %51
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %20, align 8, !tbaa !5
  %57 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 0
  %58 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 0
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = call i32 @publish_to_members(ptr noundef %55, ptr noundef %56, i32 noundef 4, ptr noundef %57, ptr noundef %58, ptr noundef %59)
  store i32 %60, ptr %13, align 4, !tbaa !12
  %61 = load i32, ptr %13, align 4, !tbaa !12
  %62 = icmp ne i32 0, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %54
  br label %167

64:                                               ; preds = %54
  br label %65

65:                                               ; preds = %64, %51
  store i8 4, ptr %21, align 1, !tbaa !11
  %66 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 0
  store ptr %21, ptr %66, align 16, !tbaa !5
  %67 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 0
  store i64 1, ptr %67, align 16, !tbaa !9
  %68 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 1
  store ptr @.str.1, ptr %68, align 8, !tbaa !5
  %69 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 1
  store i64 8, ptr %69, align 8, !tbaa !9
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 3
  store ptr %70, ptr %71, align 8, !tbaa !5
  %72 = load i64, ptr %9, align 8, !tbaa !9
  %73 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 3
  store i64 %72, ptr %73, align 8, !tbaa !9
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 4
  store ptr %74, ptr %75, align 16, !tbaa !5
  %76 = load i64, ptr %11, align 8, !tbaa !9
  %77 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 4
  store i64 %76, ptr %77, align 16, !tbaa !9
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = call i32 @rl_select_internal(ptr noundef %78, i32 noundef 5)
  store i32 %79, ptr %13, align 4, !tbaa !12
  %80 = load i32, ptr %13, align 4, !tbaa !12
  %81 = icmp ne i32 0, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %65
  br label %167

83:                                               ; preds = %65
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = call i32 @rl_keys(ptr noundef %84, ptr noundef @.str.2, i64 noundef 1, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  store i32 %85, ptr %13, align 4, !tbaa !12
  %86 = load i32, ptr %13, align 4, !tbaa !12
  %87 = icmp ne i32 0, %86
  br i1 %87, label %88, label %92

88:                                               ; preds = %83
  %89 = load i32, ptr %13, align 4, !tbaa !12
  %90 = icmp ne i32 3, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  br label %167

92:                                               ; preds = %88, %83
  %93 = load i32, ptr %13, align 4, !tbaa !12
  %94 = icmp eq i32 %93, 3
  br i1 %94, label %98, label %95

95:                                               ; preds = %92
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = icmp eq i64 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %95, %92
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %166

99:                                               ; preds = %95
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %162, %99
  %101 = load i64, ptr %14, align 8, !tbaa !9
  %102 = load i64, ptr %15, align 8, !tbaa !9
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %104, label %165

104:                                              ; preds = %100
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = load i64, ptr %14, align 8, !tbaa !9
  %107 = getelementptr inbounds ptr, ptr %105, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = load i64, ptr %14, align 8, !tbaa !9
  %111 = getelementptr inbounds i64, ptr %109, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = trunc i64 %112 to i32
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load i64, ptr %9, align 8, !tbaa !9
  %116 = trunc i64 %115 to i32
  %117 = call i32 @rl_stringmatchlen(ptr noundef %108, i32 noundef %113, ptr noundef %114, i32 noundef %116, i32 noundef 0)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %104
  br label %162

120:                                              ; preds = %104
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = load i64, ptr %14, align 8, !tbaa !9
  %124 = getelementptr inbounds ptr, ptr %122, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = load ptr, ptr %17, align 8, !tbaa !5
  %127 = load i64, ptr %14, align 8, !tbaa !9
  %128 = getelementptr inbounds i64, ptr %126, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = call i32 @rl_smembers(ptr noundef %121, ptr noundef %20, ptr noundef %125, i64 noundef %129)
  store i32 %130, ptr %13, align 4, !tbaa !12
  %131 = load i32, ptr %13, align 4, !tbaa !12
  %132 = icmp ne i32 0, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %120
  %134 = load i32, ptr %13, align 4, !tbaa !12
  %135 = icmp ne i32 3, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  br label %167

137:                                              ; preds = %133, %120
  %138 = load i32, ptr %13, align 4, !tbaa !12
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %161

140:                                              ; preds = %137
  %141 = load ptr, ptr %16, align 8, !tbaa !5
  %142 = load i64, ptr %14, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %141, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 2
  store ptr %144, ptr %145, align 16, !tbaa !5
  %146 = load ptr, ptr %17, align 8, !tbaa !5
  %147 = load i64, ptr %14, align 8, !tbaa !9
  %148 = getelementptr inbounds i64, ptr %146, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 2
  store i64 %149, ptr %150, align 16, !tbaa !9
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = load ptr, ptr %20, align 8, !tbaa !5
  %153 = getelementptr inbounds [5 x ptr], ptr %18, i64 0, i64 0
  %154 = getelementptr inbounds [5 x i64], ptr %19, i64 0, i64 0
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = call i32 @publish_to_members(ptr noundef %151, ptr noundef %152, i32 noundef 5, ptr noundef %153, ptr noundef %154, ptr noundef %155)
  store i32 %156, ptr %13, align 4, !tbaa !12
  %157 = load i32, ptr %13, align 4, !tbaa !12
  %158 = icmp ne i32 0, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %140
  br label %167

160:                                              ; preds = %140
  br label %161

161:                                              ; preds = %160, %137
  br label %162

162:                                              ; preds = %161, %119
  %163 = load i64, ptr %14, align 8, !tbaa !9
  %164 = add nsw i64 %163, 1
  store i64 %164, ptr %14, align 8, !tbaa !9
  br label %100, !llvm.loop !14

165:                                              ; preds = %100
  br label %166

166:                                              ; preds = %165, %98
  br label %167

167:                                              ; preds = %166, %159, %136, %91, %82, %63, %50, %39
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %177, %167
  %169 = load i64, ptr %14, align 8, !tbaa !9
  %170 = load i64, ptr %15, align 8, !tbaa !9
  %171 = icmp slt i64 %169, %170
  br i1 %171, label %172, label %180

172:                                              ; preds = %168
  %173 = load ptr, ptr %16, align 8, !tbaa !5
  %174 = load i64, ptr %14, align 8, !tbaa !9
  %175 = getelementptr inbounds ptr, ptr %173, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  call void @free(ptr noundef %176) #4
  br label %177

177:                                              ; preds = %172
  %178 = load i64, ptr %14, align 8, !tbaa !9
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %14, align 8, !tbaa !9
  br label %168, !llvm.loop !16

180:                                              ; preds = %168
  %181 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %181) #4
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %182) #4
  %183 = load i32, ptr %13, align 4, !tbaa !12
  %184 = icmp eq i32 %183, 3
  br i1 %184, label %185, label %186

185:                                              ; preds = %180
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %186

186:                                              ; preds = %185, %180
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = call i32 @rl_select_internal(ptr noundef %187, i32 noundef 0)
  %189 = load i32, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret i32 %189
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @publish_to_members(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

declare i32 @rl_select_internal(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_publish(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5) local_unnamed_addr #3 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [5 x ptr], align 16
  %11 = alloca [5 x i64], align 16
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #4
  store i8 3, ptr %13, align 1, !tbaa !11
  store ptr %13, ptr %10, align 16, !tbaa !9
  store i64 1, ptr %11, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr @.str, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  store i64 7, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %10, i64 16
  store ptr %1, ptr %16, align 16, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %11, i64 16
  store i64 %2, ptr %17, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %10, i64 24
  store ptr %3, ptr %18, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %11, i64 24
  store i64 %4, ptr %19, align 8, !tbaa !5
  %20 = call i32 @rl_select_internal(ptr noundef %0, i32 noundef 3) #4
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %21, label %.loopexitthread-pre-split

21:                                               ; preds = %6
  %22 = call i32 @rl_smembers(ptr noundef %0, ptr noundef nonnull %12, ptr noundef %1, i64 noundef %2) #4
  switch i32 %22, label %.loopexitthread-pre-split [
    i32 0, label %23
    i32 3, label %26
  ]

23:                                               ; preds = %21
  %24 = load ptr, ptr %12, align 8, !tbaa !9
  %25 = call i32 @publish_to_members(ptr noundef %0, ptr noundef %24, i32 noundef 4, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %5)
  %.not67 = icmp eq i32 %25, 0
  br i1 %.not67, label %26, label %.loopexitthread-pre-split

26:                                               ; preds = %21, %23
  store i8 4, ptr %13, align 1, !tbaa !11
  store ptr %13, ptr %10, align 16, !tbaa !9
  store i64 1, ptr %11, align 16, !tbaa !5
  store ptr @.str.1, ptr %14, align 8, !tbaa !9
  store i64 8, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %18, align 8, !tbaa !9
  store i64 %2, ptr %19, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %10, i64 32
  store ptr %3, ptr %27, align 16, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %11, i64 32
  store i64 %4, ptr %28, align 16, !tbaa !5
  %29 = call i32 @rl_select_internal(ptr noundef %0, i32 noundef 5) #4
  %.not68 = icmp eq i32 %29, 0
  br i1 %.not68, label %30, label %.loopexitthread-pre-split

30:                                               ; preds = %26
  %31 = call i32 @rl_keys(ptr noundef %0, ptr noundef nonnull @.str.2, i64 noundef 1, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #4
  switch i32 %31, label %.loopexitthread-pre-split [
    i32 3, label %32
    i32 0, label %32
  ]

32:                                               ; preds = %30, %30
  %33 = icmp eq i32 %31, 3
  %34 = load i64, ptr %7, align 8
  %35 = icmp eq i64 %34, 0
  %or.cond5 = select i1 %33, i1 true, i1 %35
  br i1 %or.cond5, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %32
  %36 = icmp sgt i64 %34, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %37 = trunc i64 %2 to i32
  br label %38

38:                                               ; preds = %.lr.ph, %64
  %.072 = phi i64 [ 0, %.lr.ph ], [ %65, %64 ]
  %.05571 = phi i32 [ %31, %.lr.ph ], [ %.156, %64 ]
  %39 = load ptr, ptr %8, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %39, i64 %.072
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %9, align 8, !tbaa !9
  %43 = getelementptr inbounds i64, ptr %42, i64 %.072
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = trunc i64 %44 to i32
  %46 = call i32 @rl_stringmatchlen(ptr noundef %41, i32 noundef %45, ptr noundef %1, i32 noundef %37, i32 noundef 0) #4
  %.not69 = icmp eq i32 %46, 0
  br i1 %.not69, label %64, label %47

47:                                               ; preds = %38
  %48 = load ptr, ptr %8, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 %.072
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = getelementptr inbounds i64, ptr %51, i64 %.072
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = call i32 @rl_smembers(ptr noundef %0, ptr noundef nonnull %12, ptr noundef %50, i64 noundef %53) #4
  switch i32 %54, label %.loopexitthread-pre-split [
    i32 0, label %55
    i32 3, label %64
  ]

55:                                               ; preds = %47
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = getelementptr inbounds ptr, ptr %56, i64 %.072
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  store ptr %58, ptr %16, align 16, !tbaa !9
  %59 = load ptr, ptr %9, align 8, !tbaa !9
  %60 = getelementptr inbounds i64, ptr %59, i64 %.072
  %61 = load i64, ptr %60, align 8, !tbaa !5
  store i64 %61, ptr %17, align 16, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = call i32 @publish_to_members(ptr noundef %0, ptr noundef %62, i32 noundef 5, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %5)
  %.not70 = icmp eq i32 %63, 0
  br i1 %.not70, label %64, label %.loopexitthread-pre-split

64:                                               ; preds = %47, %55, %38
  %.156 = phi i32 [ 0, %55 ], [ %.05571, %38 ], [ %54, %47 ]
  %65 = add nuw nsw i64 %.072, 1
  %66 = load i64, ptr %7, align 8, !tbaa !5
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %38, label %.loopexit, !llvm.loop !12

.loopexitthread-pre-split:                        ; preds = %47, %55, %6, %23, %26, %21, %30
  %.2.ph = phi i32 [ %31, %30 ], [ %29, %26 ], [ %25, %23 ], [ %22, %21 ], [ %20, %6 ], [ %54, %47 ], [ %63, %55 ]
  %.pr = load i64, ptr %7, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %64, %.loopexitthread-pre-split, %32
  %68 = phi i64 [ %.pr, %.loopexitthread-pre-split ], [ %34, %32 ], [ %66, %64 ]
  %.2 = phi i32 [ %.2.ph, %.loopexitthread-pre-split ], [ 0, %32 ], [ %.156, %64 ]
  %69 = icmp sgt i64 %68, 0
  br i1 %69, label %.lr.ph78, label %._crit_edge

.lr.ph78:                                         ; preds = %.loopexit, %.lr.ph78
  %.177 = phi i64 [ %73, %.lr.ph78 ], [ 0, %.loopexit ]
  %70 = load ptr, ptr %8, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 %.177
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  call void @free(ptr noundef %72) #4
  %73 = add nuw nsw i64 %.177, 1
  %74 = load i64, ptr %7, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %.lr.ph78, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph78, %.preheader, %.loopexit
  %.280 = phi i32 [ %.2, %.loopexit ], [ %31, %.preheader ], [ %.2, %.lr.ph78 ]
  %76 = load ptr, ptr %8, align 8, !tbaa !9
  call void @free(ptr noundef %76) #4
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %77) #4
  %78 = icmp eq i32 %.280, 3
  %spec.store.select = select i1 %78, i32 0, i32 %.280
  %79 = call i32 @rl_select_internal(ptr noundef %0, i32 noundef 0) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  ret i32 %spec.store.select
}

declare i32 @rl_smembers(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @publish_to_members(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @rl_keys(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @rl_stringmatchlen(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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