; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_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.MArray = type { i32, i16, %union.anon }
%union.anon = type { ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleStringReplace = type { i32 }

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

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

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @endStringReplace(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @m_StringReplace(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %28

26:                                               ; preds = %6
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %27, ptr %8, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %26, %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.MArray, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  store ptr %31, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = call i64 @strlen(ptr noundef %32) #6
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = call i64 @strlen(ptr noundef %35) #6
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MArray, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !12
  store i32 %40, ptr %17, align 4, !tbaa !9
  %41 = load i32, ptr %16, align 4, !tbaa !9
  %42 = load i32, ptr %15, align 4, !tbaa !9
  %43 = icmp sgt i32 %41, %42
  br i1 %43, label %44, label %58

44:                                               ; preds = %28
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = icmp eq ptr %45, %46
  br i1 %47, label %48, label %58

48:                                               ; preds = %44
  %49 = load i32, ptr %17, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  %51 = call ptr @m_Malloc(i32 noundef %50)
  store ptr %51, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = load i32, ptr %17, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %52, ptr align 1 %53, i64 %56, i1 false)
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %57, ptr %14, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %48, %44, %28
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %80

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call ptr @GetHandle(ptr noundef %62, i32 noundef 4, i32 noundef -2102363252, ptr noundef @endStringReplace)
  store ptr %63, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %64 = load ptr, ptr %18, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MHandle, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  store ptr %66, ptr %19, align 8, !tbaa !5
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.MHandle, ptr %67, i32 0, i32 1
  %69 = load volatile i32, ptr %68, align 4, !tbaa !17
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %76

71:                                               ; preds = %61
  %72 = load ptr, ptr %19, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.HandleStringReplace, ptr %72, i32 0, i32 0
  store i32 0, ptr %73, align 4, !tbaa !18
  %74 = load ptr, ptr %18, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MHandle, ptr %74, i32 0, i32 1
  store volatile i32 1, ptr %75, align 4, !tbaa !17
  br label %76

76:                                               ; preds = %71, %61
  %77 = load ptr, ptr %19, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.HandleStringReplace, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !18
  store i32 %79, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %80

80:                                               ; preds = %76, %58
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  store ptr %84, ptr %14, align 8, !tbaa !5
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = icmp sle i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %80
  %88 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %87, %80
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.MArray, ptr %90, i32 0, i32 0
  store i32 0, ptr %91, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %130, %89
  %93 = load i32, ptr %20, align 4, !tbaa !9
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 2, ptr %21, align 4
  br label %133

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = call ptr @strstr(ptr noundef %98, ptr noundef %99) #6
  store ptr %100, ptr %22, align 8, !tbaa !5
  %101 = load ptr, ptr %22, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  store i32 2, ptr %21, align 4
  br label %127

104:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %105 = load ptr, ptr %22, align 8, !tbaa !5
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = ptrtoint ptr %105 to i64
  %108 = ptrtoint ptr %106 to i64
  %109 = sub i64 %107, %108
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %23, align 4, !tbaa !9
  %111 = load i32, ptr %23, align 4, !tbaa !9
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %118

113:                                              ; preds = %104
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = load i32, ptr %23, align 4, !tbaa !9
  %117 = call ptr @m_ArrayWrite(ptr noundef %114, i64 noundef -1, ptr noundef %115, i32 noundef %116)
  br label %118

118:                                              ; preds = %113, %104
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = call ptr @m_ArrayWrite(ptr noundef %119, i64 noundef -1, ptr noundef %120, i32 noundef %121)
  %123 = load ptr, ptr %22, align 8, !tbaa !5
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i8, ptr %123, i64 %125
  store ptr %126, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  store i32 0, ptr %21, align 4
  br label %127

127:                                              ; preds = %118, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %128 = load i32, ptr %21, align 4
  switch i32 %128, label %133 [
    i32 0, label %129
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %20, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %20, align 4, !tbaa !9
  br label %92, !llvm.loop !20

133:                                              ; preds = %127, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = load i32, ptr %17, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.MArray, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !11
  %143 = ptrtoint ptr %139 to i64
  %144 = ptrtoint ptr %142 to i64
  %145 = sub i64 %143, %144
  %146 = sub nsw i64 %138, %145
  %147 = add nsw i64 %146, 1
  %148 = trunc i64 %147 to i32
  %149 = call ptr @m_ArrayWrite(ptr noundef %135, i64 noundef -1, ptr noundef %136, i32 noundef %148)
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %154

152:                                              ; preds = %134
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  call void @m_Free(ptr noundef %153)
  br label %154

154:                                              ; preds = %152, %134
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.MArray, ptr %155, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !11
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret ptr %157
}

declare ptr @m_Malloc(i32 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) #4

declare void @m_Free(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"MArray", !10, i64 0, !14, i64 4, !7, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!16, !10, i64 4}
!18 = !{!19, !10, i64 0}
!19 = !{!"HandleStringReplace", !10, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #0

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

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @endStringReplace(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @m_StringReplace(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = icmp eq ptr %1, null
  %spec.select = select i1 %7, ptr %0, ptr %1
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #4
  %11 = trunc i64 %10 to i32
  %12 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #4
  %13 = trunc i64 %12 to i32
  %14 = load i32, ptr %0, align 8, !tbaa !8
  %15 = icmp sgt i32 %13, %11
  %16 = icmp eq ptr %spec.select, %0
  %or.cond = and i1 %16, %15
  br i1 %or.cond, label %17, label %21

17:                                               ; preds = %6
  %18 = add nsw i32 %14, 1
  %19 = tail call ptr @m_Malloc(i32 noundef %18) #5
  %20 = sext i32 %18 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %9, i64 %20, i1 false)
  br label %21

21:                                               ; preds = %17, %6
  %.057 = phi ptr [ %19, %17 ], [ %9, %6 ]
  %.056 = phi ptr [ %19, %17 ], [ null, %6 ]
  %22 = icmp slt i32 %4, 0
  br i1 %22, label %23, label %31

23:                                               ; preds = %21
  %24 = tail call ptr @GetHandle(ptr noundef nonnull %0, i32 noundef 4, i32 noundef -2102363252, ptr noundef nonnull @endStringReplace) #5
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %24, i64 4
  %28 = load volatile i32, ptr %27, align 4, !tbaa !15
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %._crit_edge

._crit_edge:                                      ; preds = %23
  %.pre = load i32, ptr %26, align 4, !tbaa !16
  br label %31

30:                                               ; preds = %23
  store i32 0, ptr %26, align 4, !tbaa !16
  store volatile i32 1, ptr %27, align 4, !tbaa !15
  br label %31

31:                                               ; preds = %30, %._crit_edge, %21
  %.052 = phi i32 [ %4, %21 ], [ %.pre, %._crit_edge ], [ 0, %30 ]
  %32 = sext i32 %.052 to i64
  %33 = getelementptr inbounds i8, ptr %.057, i64 %32
  %34 = icmp slt i32 %5, 1
  %spec.select65 = select i1 %34, i32 %14, i32 %5
  store i32 0, ptr %spec.select, align 8, !tbaa !8
  %35 = icmp sgt i32 %spec.select65, 0
  br i1 %35, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %31
  %sext = shl i64 %10, 32
  %36 = ashr exact i64 %sext, 32
  br label %37

37:                                               ; preds = %.lr.ph, %46
  %.05468 = phi i32 [ 0, %.lr.ph ], [ %49, %46 ]
  %.167 = phi ptr [ %33, %.lr.ph ], [ %48, %46 ]
  %38 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %.167, ptr noundef nonnull dereferenceable(1) %2) #4
  %.not63 = icmp eq ptr %38, null
  br i1 %.not63, label %.thread, label %39

39:                                               ; preds = %37
  %40 = ptrtoint ptr %38 to i64
  %41 = ptrtoint ptr %.167 to i64
  %42 = sub i64 %40, %41
  %43 = trunc i64 %42 to i32
  %.not = icmp eq i32 %43, 0
  br i1 %.not, label %46, label %44

44:                                               ; preds = %39
  %45 = tail call ptr @m_ArrayWrite(ptr noundef nonnull %spec.select, i64 noundef -1, ptr noundef %.167, i32 noundef %43) #5
  br label %46

46:                                               ; preds = %44, %39
  %47 = tail call ptr @m_ArrayWrite(ptr noundef nonnull %spec.select, i64 noundef -1, ptr noundef %3, i32 noundef %13) #5
  %48 = getelementptr inbounds i8, ptr %38, i64 %36
  %49 = add nuw nsw i32 %.05468, 1
  %exitcond.not = icmp eq i32 %49, %spec.select65
  br i1 %exitcond.not, label %.thread, label %37, !llvm.loop !18

.thread:                                          ; preds = %46, %37, %31
  %.1.lcssa = phi ptr [ %33, %31 ], [ %.167, %37 ], [ %48, %46 ]
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = ptrtoint ptr %.1.lcssa to i64
  %52 = ptrtoint ptr %50 to i64
  %.neg = sub i64 %52, %51
  %53 = trunc i64 %.neg to i32
  %54 = add i32 %14, 1
  %55 = add i32 %54, %53
  %56 = tail call ptr @m_ArrayWrite(ptr noundef nonnull %spec.select, i64 noundef -1, ptr noundef %.1.lcssa, i32 noundef %55) #5
  %.not64 = icmp eq ptr %.056, null
  br i1 %.not64, label %58, label %57

57:                                               ; preds = %.thread
  tail call void @m_Free(ptr noundef nonnull %.056) #5
  br label %58

58:                                               ; preds = %57, %.thread
  %59 = getelementptr inbounds i8, ptr %spec.select, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  ret ptr %60
}

declare ptr @m_Malloc(i32 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) #3

declare void @m_Free(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind willreturn memory(read) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"MArray", !10, i64 0, !11, i64 4, !6, i64 8}
!10 = !{!"int", !6, i64 0}
!11 = !{!"short", !6, i64 0}
!12 = !{!13, !14, i64 16}
!13 = !{!"MHandle", !10, i64 0, !10, i64 4, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!13, !10, i64 4}
!16 = !{!17, !10, i64 0}
!17 = !{!"HandleStringReplace", !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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