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

; 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.rl_data_type = type { ptr, ptr, ptr, ptr }
%struct.rl_list_type = type { ptr, ptr, i32, ptr }
%struct.rlite = type { i64, i64, i32, ptr, i64, i64, i64, ptr, i32, i32, i32, i32, ptr, i64, i64, ptr, i64, i64, ptr, ptr, ptr, ptr }
%struct.rl_list = type { i64, i64, ptr, i64, i64 }

@rl_data_type_list_long = external global %struct.rl_data_type, align 8
@rl_list_type_long = external global %struct.rl_list_type, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_normalize_string_range(i64 noundef, ptr noundef, ptr noundef) #0

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

30:                                               ; preds = %6
  br label %138

31:                                               ; preds = %6
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %32, ptr %14, align 8, !tbaa !5
  store i64 0, ptr %21, align 8, !tbaa !9
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %14, align 8, !tbaa !5
  %35 = call i32 @rl_list_get_element(ptr noundef %33, ptr noundef %34, ptr noundef %17, i64 noundef 0)
  store i32 %35, ptr %18, align 4, !tbaa !11
  %36 = load i32, ptr %18, align 4, !tbaa !11
  %37 = icmp ne i32 2, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %31
  br label %138

39:                                               ; preds = %31
  %40 = load ptr, ptr %17, align 8, !tbaa !5
  %41 = load i64, ptr %40, align 8, !tbaa !9
  store i64 %41, ptr %13, align 8, !tbaa !9
  %42 = load i64, ptr %13, align 8, !tbaa !9
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %50

44:                                               ; preds = %39
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %48, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %47, %44
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %138

50:                                               ; preds = %39
  %51 = load i64, ptr %13, align 8, !tbaa !9
  %52 = call i32 @rl_normalize_string_range(i64 noundef %51, ptr noundef %11, ptr noundef %12)
  %53 = load i64, ptr %12, align 8, !tbaa !9
  %54 = load i64, ptr %11, align 8, !tbaa !9
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %56, label %62

56:                                               ; preds = %50
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %61

59:                                               ; preds = %56
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %60, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %59, %56
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %138

62:                                               ; preds = %50
  %63 = load i64, ptr %12, align 8, !tbaa !9
  %64 = load i64, ptr %11, align 8, !tbaa !9
  %65 = sub nsw i64 %63, %64
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %24, align 8, !tbaa !9
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %72

69:                                               ; preds = %62
  %70 = load i64, ptr %24, align 8, !tbaa !9
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %70, ptr %71, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %69, %62
  %73 = load i64, ptr %11, align 8, !tbaa !9
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.rlite, ptr %74, i32 0, i32 6
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = sdiv i64 %73, %76
  store i64 %77, ptr %20, align 8, !tbaa !9
  %78 = load i64, ptr %11, align 8, !tbaa !9
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.rlite, ptr %79, i32 0, i32 6
  %81 = load i64, ptr %80, align 8, !tbaa !13
  %82 = srem i64 %78, %81
  store i64 %82, ptr %23, align 8, !tbaa !9
  %83 = load i64, ptr %20, align 8, !tbaa !9
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %20, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %134, %72
  %86 = load i64, ptr %20, align 8, !tbaa !9
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.rl_list, ptr %87, i32 0, i32 1
  %89 = load i64, ptr %88, align 8, !tbaa !15
  %90 = icmp slt i64 %86, %89
  br i1 %90, label %91, label %137

91:                                               ; preds = %85
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = load i64, ptr %20, align 8, !tbaa !9
  %95 = call i32 @rl_list_get_element(ptr noundef %92, ptr noundef %93, ptr noundef %17, i64 noundef %94)
  store i32 %95, ptr %18, align 4, !tbaa !11
  %96 = load i32, ptr %18, align 4, !tbaa !11
  %97 = icmp ne i32 2, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %91
  br label %138

99:                                               ; preds = %91
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = call i32 @rl_string_get(ptr noundef %100, ptr noundef %19, i64 noundef %102)
  store i32 %103, ptr %18, align 4, !tbaa !11
  %104 = load i32, ptr %18, align 4, !tbaa !11
  %105 = icmp ne i32 0, %104
  br i1 %105, label %106, label %107

106:                                              ; preds = %99
  br label %138

107:                                              ; preds = %99
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.rlite, ptr %108, i32 0, i32 6
  %110 = load i64, ptr %109, align 8, !tbaa !13
  %111 = load i64, ptr %23, align 8, !tbaa !9
  %112 = sub nsw i64 %110, %111
  store i64 %112, ptr %22, align 8, !tbaa !9
  %113 = load i64, ptr %21, align 8, !tbaa !9
  %114 = load i64, ptr %22, align 8, !tbaa !9
  %115 = add nsw i64 %113, %114
  %116 = load i64, ptr %24, align 8, !tbaa !9
  %117 = icmp sgt i64 %115, %116
  br i1 %117, label %118, label %122

118:                                              ; preds = %107
  %119 = load i64, ptr %24, align 8, !tbaa !9
  %120 = load i64, ptr %21, align 8, !tbaa !9
  %121 = sub nsw i64 %119, %120
  store i64 %121, ptr %22, align 8, !tbaa !9
  br label %122

122:                                              ; preds = %118, %107
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load i64, ptr %21, align 8, !tbaa !9
  %125 = getelementptr inbounds i8, ptr %123, i64 %124
  %126 = load ptr, ptr %19, align 8, !tbaa !5
  %127 = load i64, ptr %23, align 8, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %126, i64 %127
  %129 = load i64, ptr %22, align 8, !tbaa !9
  %130 = mul i64 1, %129
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %125, ptr align 1 %128, i64 %130, i1 false)
  %131 = load i64, ptr %22, align 8, !tbaa !9
  %132 = load i64, ptr %21, align 8, !tbaa !9
  %133 = add nsw i64 %132, %131
  store i64 %133, ptr %21, align 8, !tbaa !9
  store i64 0, ptr %23, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %122
  %135 = load i64, ptr %20, align 8, !tbaa !9
  %136 = add nsw i64 %135, 1
  store i64 %136, ptr %20, align 8, !tbaa !9
  br label %85, !llvm.loop !17

137:                                              ; preds = %85
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %138

138:                                              ; preds = %137, %106, %98, %61, %49, %38, %30
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %145

141:                                              ; preds = %138
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = call i32 @rl_list_destroy(ptr noundef %142, ptr noundef %143)
  br label %145

145:                                              ; preds = %141, %138
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %152

148:                                              ; preds = %145
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = call i32 @rl_list_node_destroy(ptr noundef %149, ptr noundef %150)
  br label %152

152:                                              ; preds = %148, %145
  %153 = load i32, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %13) #4
  ret i32 %153
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 48}
!14 = !{!"rlite", !10, i64 0, !10, i64 8, !12, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !6, i64 80, !10, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!15 = !{!16, !10, i64 8}
!16 = !{!"rl_list", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

%struct.rl_data_type = type { ptr, ptr, ptr, ptr }
%struct.rl_list_type = type { ptr, ptr, i32, ptr }

@rl_data_type_list_long = external global %struct.rl_data_type, align 8
@rl_list_type_long = external global %struct.rl_list_type, align 8

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_multi_string_cpyrange(ptr noundef %0, i64 noundef %1, ptr nocapture noundef writeonly %2, ptr noundef writeonly %3, i64 noundef %4, i64 noundef %5) local_unnamed_addr #0 {
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store i64 %4, ptr %7, align 8, !tbaa !5
  store i64 %5, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %12 = call i32 @rl_read(ptr noundef %0, ptr noundef nonnull @rl_data_type_list_long, i64 noundef %1, ptr noundef nonnull @rl_list_type_long, ptr noundef nonnull %9, i32 noundef 0) #5
  %.not = icmp eq i32 %12, 2
  br i1 %.not, label %13, label %.thread73

13:                                               ; preds = %6
  %14 = load ptr, ptr %9, align 8, !tbaa !9
  %15 = call i32 @rl_list_get_element(ptr noundef %0, ptr noundef %14, ptr noundef nonnull %10, i64 noundef 0) #5
  %.not60 = icmp eq i32 %15, 2
  br i1 %.not60, label %16, label %.loopexit

16:                                               ; preds = %13
  %17 = load ptr, ptr %10, align 8, !tbaa !9
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %16
  %.not65 = icmp eq ptr %3, null
  br i1 %.not65, label %.loopexit, label %.loopexit.sink.split

21:                                               ; preds = %16
  %22 = call i32 @rl_normalize_string_range(i64 noundef %18, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %23 = load i64, ptr %8, align 8, !tbaa !5
  %24 = load i64, ptr %7, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %21
  %.not64 = icmp eq ptr %3, null
  br i1 %.not64, label %.loopexit, label %.loopexit.sink.split

27:                                               ; preds = %21
  %28 = sub nsw i64 %23, %24
  %29 = add nsw i64 %28, 1
  %.not61 = icmp eq ptr %3, null
  br i1 %.not61, label %31, label %30

30:                                               ; preds = %27
  store i64 %29, ptr %3, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %30, %27
  %32 = getelementptr inbounds i8, ptr %0, i64 48
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = sdiv i64 %24, %33
  %35 = srem i64 %24, %33
  %36 = getelementptr inbounds i8, ptr %14, i64 8
  %.04977 = add nsw i64 %34, 1
  %37 = load i64, ptr %36, align 8, !tbaa !14
  %38 = icmp slt i64 %.04977, %37
  br i1 %38, label %.lr.ph.preheader, label %.thread

.lr.ph.preheader:                                 ; preds = %31
  %39 = call i32 @rl_list_get_element(ptr noundef nonnull %0, ptr noundef nonnull %14, ptr noundef nonnull %10, i64 noundef %.04977) #5
  %.not62.peel = icmp eq i32 %39, 2
  br i1 %.not62.peel, label %40, label %.thread

40:                                               ; preds = %.lr.ph.preheader
  %41 = load ptr, ptr %10, align 8, !tbaa !9
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = call i32 @rl_string_get(ptr noundef nonnull %0, ptr noundef nonnull %11, i64 noundef %42) #5
  %.not63.peel = icmp eq i32 %43, 0
  br i1 %.not63.peel, label %44, label %.thread

44:                                               ; preds = %40
  %45 = load i64, ptr %32, align 8, !tbaa !11
  %46 = sub nsw i64 %45, %35
  %spec.select.peel = call i64 @llvm.smin.i64(i64 %46, i64 %29)
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %47, i64 %35
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %2, ptr align 1 %48, i64 %spec.select.peel, i1 false)
  %.049.peel = add nsw i64 %34, 2
  %49 = load i64, ptr %36, align 8, !tbaa !14
  %50 = icmp slt i64 %.049.peel, %49
  br i1 %50, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %44, %56
  %.04980 = phi i64 [ %.049, %56 ], [ %.049.peel, %44 ]
  %.04878 = phi i64 [ %63, %56 ], [ %spec.select.peel, %44 ]
  %51 = call i32 @rl_list_get_element(ptr noundef nonnull %0, ptr noundef nonnull %14, ptr noundef nonnull %10, i64 noundef %.04980) #5
  %.not62 = icmp eq i32 %51, 2
  br i1 %.not62, label %52, label %.thread

52:                                               ; preds = %.lr.ph
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = call i32 @rl_string_get(ptr noundef nonnull %0, ptr noundef nonnull %11, i64 noundef %54) #5
  %.not63 = icmp eq i32 %55, 0
  br i1 %.not63, label %56, label %.thread

56:                                               ; preds = %52
  %57 = load i64, ptr %32, align 8, !tbaa !11
  %58 = add nsw i64 %57, %.04878
  %59 = icmp sgt i64 %58, %29
  %60 = sub nsw i64 %29, %.04878
  %spec.select = select i1 %59, i64 %60, i64 %57
  %61 = getelementptr inbounds i8, ptr %2, i64 %.04878
  %62 = load ptr, ptr %11, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %61, ptr align 1 %62, i64 %spec.select, i1 false)
  %63 = add nsw i64 %spec.select, %.04878
  %.049 = add nsw i64 %.04980, 1
  %64 = load i64, ptr %36, align 8, !tbaa !14
  %65 = icmp slt i64 %.049, %64
  br i1 %65, label %.lr.ph, label %.thread, !llvm.loop !16

.loopexit.sink.split:                             ; preds = %26, %20
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.sink.split, %26, %20, %13
  %.050 = phi i32 [ %15, %13 ], [ 0, %20 ], [ 0, %26 ], [ 0, %.loopexit.sink.split ]
  %.not66 = icmp eq ptr %14, null
  br i1 %.not66, label %.thread73, label %.thread

.thread:                                          ; preds = %52, %.lr.ph, %56, %40, %.lr.ph.preheader, %44, %31, %.loopexit
  %.05070 = phi i32 [ %.050, %.loopexit ], [ 0, %31 ], [ %39, %.lr.ph.preheader ], [ 0, %44 ], [ %43, %40 ], [ %55, %52 ], [ 0, %56 ], [ %51, %.lr.ph ]
  %66 = call i32 @rl_list_destroy(ptr noundef %0, ptr noundef nonnull %14) #5
  br label %.thread73

.thread73:                                        ; preds = %6, %.loopexit, %.thread
  %.05071 = phi i32 [ %.050, %.loopexit ], [ %.05070, %.thread ], [ %12, %6 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  ret i32 %.05071
}

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!12, !6, i64 48}
!12 = !{!"rlite", !6, i64 0, !6, i64 8, !13, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !10, i64 80, !6, i64 88, !6, i64 96, !10, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 8}
!15 = !{!"rl_list", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 32}
!16 = distinct !{!16, !17, !18}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.peeled.count", i32 1}


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