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

@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
@rl_data_type_string = external global %struct.rl_data_type, align 8

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

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

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

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

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

23:                                               ; preds = %5
  br label %139

24:                                               ; preds = %5
  %25 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %25, ptr %11, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = call i32 @rl_list_get_element(ptr noundef %26, ptr noundef %27, ptr noundef %13, i64 noundef 0)
  store i32 %28, ptr %14, align 4, !tbaa !11
  %29 = load i32, ptr %14, align 4, !tbaa !11
  %30 = icmp ne i32 2, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %24
  br label %139

32:                                               ; preds = %24
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = load i64, ptr %33, align 8, !tbaa !9
  store i64 %34, ptr %15, align 8, !tbaa !9
  %35 = call noalias ptr @malloc(i64 noundef 8) #6
  store ptr %35, ptr %13, align 8, !tbaa !5
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %32
  store i32 4, ptr %14, align 4, !tbaa !11
  br label %139

39:                                               ; preds = %32
  %40 = load i64, ptr %15, align 8, !tbaa !9
  %41 = load i64, ptr %9, align 8, !tbaa !9
  %42 = add nsw i64 %40, %41
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %42, ptr %43, align 8, !tbaa !9
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = call i32 @rl_list_add_element(ptr noundef %44, ptr noundef %45, i64 noundef %46, ptr noundef %47, i64 noundef 0)
  store i32 %48, ptr %14, align 4, !tbaa !11
  %49 = load i32, ptr %14, align 4, !tbaa !11
  %50 = icmp ne i32 0, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %39
  br label %139

52:                                               ; preds = %39
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load i64, ptr %7, align 8, !tbaa !9
  %56 = call i32 @rl_list_remove_element(ptr noundef %53, ptr noundef %54, i64 noundef %55, i64 noundef 1)
  store i32 %56, ptr %14, align 4, !tbaa !11
  %57 = load i32, ptr %14, align 4, !tbaa !11
  %58 = icmp ne i32 0, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %52
  br label %139

60:                                               ; preds = %52
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %68

63:                                               ; preds = %60
  %64 = load i64, ptr %15, align 8, !tbaa !9
  %65 = load i64, ptr %9, align 8, !tbaa !9
  %66 = add nsw i64 %64, %65
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %66, ptr %67, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %63, %60
  %69 = load i64, ptr %15, align 8, !tbaa !9
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.rlite, ptr %70, i32 0, i32 6
  %72 = load i64, ptr %71, align 8, !tbaa !13
  %73 = srem i64 %69, %72
  store i64 %73, ptr %15, align 8, !tbaa !9
  %74 = load i64, ptr %15, align 8, !tbaa !9
  %75 = icmp sgt i64 %74, 0
  br i1 %75, label %76, label %124

76:                                               ; preds = %68
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = call i32 @rl_list_get_element(ptr noundef %77, ptr noundef %78, ptr noundef %13, i64 noundef -1)
  store i32 %79, ptr %14, align 4, !tbaa !11
  %80 = load i32, ptr %14, align 4, !tbaa !11
  %81 = icmp ne i32 2, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %76
  br label %139

83:                                               ; preds = %76
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = load i64, ptr %84, align 8, !tbaa !9
  store i64 %85, ptr %17, align 8, !tbaa !9
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i64, ptr %17, align 8, !tbaa !9
  %88 = call i32 @rl_string_get(ptr noundef %86, ptr noundef %12, i64 noundef %87)
  store i32 %88, ptr %14, align 4, !tbaa !11
  %89 = load i32, ptr %14, align 4, !tbaa !11
  %90 = icmp ne i32 0, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %139

92:                                               ; preds = %83
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.rlite, ptr %93, i32 0, i32 6
  %95 = load i64, ptr %94, align 8, !tbaa !13
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = sub nsw i64 %95, %96
  store i64 %97, ptr %16, align 8, !tbaa !9
  %98 = load i64, ptr %16, align 8, !tbaa !9
  %99 = load i64, ptr %9, align 8, !tbaa !9
  %100 = icmp sgt i64 %98, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %92
  %102 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %102, ptr %16, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %101, %92
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = load i64, ptr %15, align 8, !tbaa !9
  %106 = getelementptr inbounds i8, ptr %104, i64 %105
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load i64, ptr %16, align 8, !tbaa !9
  %109 = mul i64 %108, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %106, ptr align 1 %107, i64 %109, i1 false)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load i64, ptr %17, align 8, !tbaa !9
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = call i32 @rl_write(ptr noundef %110, ptr noundef @rl_data_type_string, i64 noundef %111, ptr noundef %112)
  store i32 %113, ptr %14, align 4, !tbaa !11
  %114 = load i32, ptr %14, align 4, !tbaa !11
  %115 = icmp ne i32 0, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %103
  br label %139

117:                                              ; preds = %103
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load i64, ptr %16, align 8, !tbaa !9
  %120 = getelementptr inbounds i8, ptr %118, i64 %119
  store ptr %120, ptr %8, align 8, !tbaa !5
  %121 = load i64, ptr %16, align 8, !tbaa !9
  %122 = load i64, ptr %9, align 8, !tbaa !9
  %123 = sub nsw i64 %122, %121
  store i64 %123, ptr %9, align 8, !tbaa !9
  br label %124

124:                                              ; preds = %117, %68
  %125 = load i64, ptr %9, align 8, !tbaa !9
  %126 = icmp sgt i64 %125, 0
  br i1 %126, label %127, label %138

127:                                              ; preds = %124
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load i64, ptr %7, align 8, !tbaa !9
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = load i64, ptr %9, align 8, !tbaa !9
  %133 = call i32 @append(ptr noundef %128, ptr noundef %129, i64 noundef %130, ptr noundef %131, i64 noundef %132)
  store i32 %133, ptr %14, align 4, !tbaa !11
  %134 = load i32, ptr %14, align 4, !tbaa !11
  %135 = icmp ne i32 0, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %127
  br label %139

137:                                              ; preds = %127
  br label %138

138:                                              ; preds = %137, %124
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %139

139:                                              ; preds = %138, %136, %116, %91, %82, %59, %51, %38, %31, %23
  %140 = load i32, ptr %14, align 4, !tbaa !11
  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 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret i32 %140
}

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

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

declare i32 @rl_list_add_element(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #1

declare i32 @rl_list_remove_element(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #1

; 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) #4

declare i32 @rl_write(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @append(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!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}


; 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
@rl_data_type_string = external global %struct.rl_data_type, align 8

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

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

declare i32 @rl_string_get(ptr noundef, ptr noundef, i64 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

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_multi_string_append(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef writeonly %4) local_unnamed_addr #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %8 = 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 %7, i32 noundef 0) #6
  %.not = icmp eq i32 %8, 2
  br i1 %.not, label %9, label %49

9:                                                ; preds = %5
  %10 = load ptr, ptr %7, align 8, !tbaa !5
  %11 = call i32 @rl_list_get_element(ptr noundef %0, ptr noundef %10, ptr noundef nonnull %7, i64 noundef 0) #6
  %.not67 = icmp eq i32 %11, 2
  br i1 %.not67, label %12, label %49

12:                                               ; preds = %9
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  store ptr %15, ptr %7, align 8, !tbaa !5
  %.not68 = icmp eq ptr %15, null
  br i1 %.not68, label %49, label %16

16:                                               ; preds = %12
  %17 = add nsw i64 %14, %3
  store i64 %17, ptr %15, align 8, !tbaa !9
  %18 = call i32 @rl_list_add_element(ptr noundef %0, ptr noundef %10, i64 noundef %1, ptr noundef nonnull %15, i64 noundef 0) #6
  %.not69 = icmp eq i32 %18, 0
  br i1 %.not69, label %19, label %49

19:                                               ; preds = %16
  %20 = call i32 @rl_list_remove_element(ptr noundef %0, ptr noundef %10, i64 noundef %1, i64 noundef 1) #6
  %.not70 = icmp eq i32 %20, 0
  br i1 %.not70, label %21, label %49

21:                                               ; preds = %19
  %.not71 = icmp eq ptr %4, null
  br i1 %.not71, label %23, label %22

22:                                               ; preds = %21
  store i64 %17, ptr %4, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %22, %21
  %24 = getelementptr inbounds i8, ptr %0, i64 48
  %25 = load i64, ptr %24, align 8, !tbaa !11
  %26 = srem i64 %14, %25
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %28, label %44

28:                                               ; preds = %23
  %29 = call i32 @rl_list_get_element(ptr noundef nonnull %0, ptr noundef %10, ptr noundef nonnull %7, i64 noundef -1) #6
  %.not72 = icmp eq i32 %29, 2
  br i1 %.not72, label %30, label %49

30:                                               ; preds = %28
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = call i32 @rl_string_get(ptr noundef nonnull %0, ptr noundef nonnull %6, i64 noundef %32) #6
  %.not73 = icmp eq i32 %33, 0
  br i1 %.not73, label %34, label %49

34:                                               ; preds = %30
  %35 = load i64, ptr %24, align 8, !tbaa !11
  %36 = sub nsw i64 %35, %26
  %spec.select = call i64 @llvm.smin.i64(i64 %36, i64 %3)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %38, ptr align 1 %2, i64 %spec.select, i1 false)
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call i32 @rl_write(ptr noundef nonnull %0, ptr noundef nonnull @rl_data_type_string, i64 noundef %32, ptr noundef %39) #6
  %.not74 = icmp eq i32 %40, 0
  br i1 %.not74, label %41, label %49

41:                                               ; preds = %34
  %42 = getelementptr inbounds i8, ptr %2, i64 %spec.select
  %43 = sub nsw i64 %3, %spec.select
  br label %44

44:                                               ; preds = %41, %23
  %.053 = phi i64 [ %43, %41 ], [ %3, %23 ]
  %.0 = phi ptr [ %42, %41 ], [ %2, %23 ]
  %45 = icmp sgt i64 %.053, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %44
  %47 = call i32 @append(ptr noundef nonnull %0, ptr noundef %10, i64 noundef %1, ptr noundef %.0, i64 noundef %.053)
  %.not75 = icmp eq i32 %47, 0
  br i1 %.not75, label %48, label %49

48:                                               ; preds = %46, %44
  br label %49

49:                                               ; preds = %12, %46, %34, %30, %28, %19, %16, %9, %5, %48
  %.052 = phi i32 [ %8, %5 ], [ %11, %9 ], [ %18, %16 ], [ %20, %19 ], [ %29, %28 ], [ %33, %30 ], [ %40, %34 ], [ %47, %46 ], [ 0, %48 ], [ 4, %12 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  ret i32 %.052
}

declare i32 @rl_list_get_element(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #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 #3

declare i32 @rl_list_add_element(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @rl_list_remove_element(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; 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) #4

declare i32 @rl_write(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @append(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 48}
!12 = !{!"rlite", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, 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}
!13 = !{!"int", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass