; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_list)

; 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.MList = type { i32, ptr }
%struct.HandleList = type { %struct.MList, i32, i32, i32, i32 }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleListCreate = type { ptr, ptr, [8 x i64], i32, i32, ptr, ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@__FUNCTION__.mListWrite = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr 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
declare dso_local void @m_ListAppend(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @mMemoryCreate(i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @mListWrite(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %22, label %18

18:                                               ; preds = %15
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = ptrtoint ptr %19 to i64
  %21 = icmp eq i64 %20, -1
  br label %22

22:                                               ; preds = %18, %15
  %23 = phi i1 [ true, %15 ], [ %21, %18 ]
  %24 = zext i1 %23 to i32
  store i32 %24, ptr %9, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %22
  %28 = load i32, ptr %9, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %28, i32 noundef -1, ptr noundef @.str, i32 noundef 130, ptr noundef @__FUNCTION__.mListWrite, ptr noundef @.str.4)
  br label %29

29:                                               ; preds = %27, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.MList, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !11
  %36 = icmp sgt i32 %32, %35
  %37 = zext i1 %36 to i32
  store i32 %37, ptr %10, align 4, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %46

40:                                               ; preds = %31
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.MList, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !11
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %41, i32 noundef -1, ptr noundef @.str, i32 noundef 131, ptr noundef @__FUNCTION__.mListWrite, ptr noundef @.str.6, i32 noundef %42, i32 noundef %45)
  br label %46

46:                                               ; preds = %40, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 0
  br i1 %49, label %50, label %72

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = icmp eq ptr %52, null
  br i1 %53, label %58, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = icmp eq i64 %56, -1
  br label %58

58:                                               ; preds = %54, %51
  %59 = phi i1 [ true, %51 ], [ %57, %54 ]
  %60 = zext i1 %59 to i32
  store i32 %60, ptr %11, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %58
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %64, i32 noundef -1, ptr noundef @.str, i32 noundef 134, ptr noundef @__FUNCTION__.mListWrite, ptr noundef @.str.7, ptr noundef %65)
  br label %66

66:                                               ; preds = %63, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = call i64 @strlen(ptr noundef %68) #5
  %70 = add i64 %69, 1
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %8, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %67, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.HandleList, ptr %73, i64 -1
  %75 = getelementptr inbounds %struct.HandleList, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds %struct.MList, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !13
  %78 = getelementptr inbounds ptr, ptr %77, i64 0
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.MHandle, ptr %79, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  store ptr %81, ptr %12, align 8, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = icmp slt i32 %82, 0
  br i1 %83, label %84, label %88

84:                                               ; preds = %72
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.MList, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !11
  store i32 %87, ptr %6, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %84, %72
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.HandleListCreate, ptr %89, i32 0, i32 6
  %91 = load ptr, ptr %90, align 8, !tbaa !17
  %92 = icmp eq ptr %91, null
  br i1 %92, label %93, label %97

93:                                               ; preds = %88
  %94 = call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0)
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.HandleListCreate, ptr %95, i32 0, i32 6
  store ptr %94, ptr %96, align 8, !tbaa !17
  br label %97

97:                                               ; preds = %93, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.HandleListCreate, ptr %98, i32 0, i32 6
  %100 = load ptr, ptr %99, align 8, !tbaa !17
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = call ptr @mMemoryWrite(ptr noundef %100, ptr noundef %101, i32 noundef %102)
  store ptr %103, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %104 = load i32, ptr %6, align 4, !tbaa !9
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MList, ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !11
  %108 = icmp eq i32 %104, %107
  %109 = zext i1 %108 to i32
  store i32 %109, ptr %14, align 4, !tbaa !9
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %122, label %112

112:                                              ; preds = %97
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MList, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !19
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = icmp eq ptr %119, null
  %121 = zext i1 %120 to i32
  store i32 %121, ptr %14, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %112, %97
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %149

125:                                              ; preds = %122
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.HandleListCreate, ptr %127, i32 0, i32 4
  %129 = load i32, ptr %128, align 4, !tbaa !20
  %130 = icmp slt i32 %126, %129
  br i1 %130, label %131, label %136

131:                                              ; preds = %125
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.MList, ptr %134, i32 0, i32 0
  store i32 %133, ptr %135, align 8, !tbaa !11
  br label %141

136:                                              ; preds = %125
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  call void @m_ListAppend(ptr noundef %138, ptr noundef null, i32 noundef -1)
  br label %139

139:                                              ; preds = %137
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140, %131
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.MList, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !19
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds ptr, ptr %145, i64 %147
  store ptr %142, ptr %148, align 8, !tbaa !5
  br label %177

149:                                              ; preds = %122
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MList, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !19
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %153, i64 %155
  store ptr %150, ptr %156, align 8, !tbaa !5
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.HandleListCreate, ptr %158, i32 0, i32 7
  %160 = load i32, ptr %159, align 8, !tbaa !21
  %161 = add nsw i32 %160, %157
  store i32 %161, ptr %159, align 8, !tbaa !21
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.HandleListCreate, ptr %162, i32 0, i32 7
  %164 = load i32, ptr %163, align 8, !tbaa !21
  %165 = icmp sgt i32 %164, 16384
  br i1 %165, label %166, label %176

166:                                              ; preds = %149
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.HandleListCreate, ptr %168, i32 0, i32 6
  %170 = load ptr, ptr %169, align 8, !tbaa !17
  call void @mListElementOperate(ptr noundef %167, ptr noundef @MemoryCollect, ptr noundef %170)
  %171 = load ptr, ptr %12, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.HandleListCreate, ptr %171, i32 0, i32 6
  %173 = load ptr, ptr %172, align 8, !tbaa !17
  call void @MemoryDefrag(ptr noundef %173)
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.HandleListCreate, ptr %174, i32 0, i32 7
  store i32 0, ptr %175, align 8, !tbaa !21
  br label %176

176:                                              ; preds = %166, %149
  br label %177

177:                                              ; preds = %176, %141
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.MList, ptr %178, i32 0, i32 1
  %180 = load ptr, ptr %179, align 8, !tbaa !19
  %181 = load i32, ptr %6, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds ptr, ptr %180, i64 %182
  %184 = load ptr, ptr %183, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  ret ptr %184
}

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

declare ptr @mMemoryWrite(ptr noundef, ptr noundef, i32 noundef) #1

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

declare void @MemoryCollect(ptr noundef, ptr noundef) #1

declare void @MemoryDefrag(ptr noundef) #1

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 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 #4 = { nounwind }
attributes #5 = { 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 = !{!12, !10, i64 0}
!12 = !{!"MList", !10, i64 0, !6, i64 8}
!13 = !{!14, !6, i64 8}
!14 = !{!"HandleList", !12, i64 0, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!15 = !{!16, !6, i64 16}
!16 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!18, !6, i64 96}
!18 = !{!"HandleListCreate", !6, i64 0, !6, i64 8, !7, i64 16, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !10, i64 104, !10, i64 108}
!19 = !{!12, !6, i64 8}
!20 = !{!18, !10, i64 84}
!21 = !{!18, !10, i64 104}


; 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 [76 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@__FUNCTION__.mListWrite = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @m_ListAppend(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @mMemoryCreate(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @mListWrite(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %10 [
    i64 -1, label %5
    i64 0, label %5
  ]

5:                                                ; preds = %4, %4
  %6 = icmp eq ptr %0, null
  %7 = icmp eq ptr %0, inttoptr (i64 -1 to ptr)
  %8 = or i1 %6, %7
  %9 = zext i1 %8 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %9, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 130, ptr noundef nonnull @__FUNCTION__.mListWrite, ptr noundef nonnull @.str.4) #3
  br label %10

10:                                               ; preds = %4, %5
  %11 = load i32, ptr %0, align 8, !tbaa !5
  %12 = icmp slt i32 %11, %1
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 131, ptr noundef nonnull @__FUNCTION__.mListWrite, ptr noundef nonnull @.str.6, i32 noundef %1, i32 noundef %11) #3
  br label %14

14:                                               ; preds = %13, %10
  %15 = icmp slt i32 %3, 0
  br i1 %15, label %16, label %26

16:                                               ; preds = %14
  %magicptr55 = ptrtoint ptr %2 to i64
  switch i64 %magicptr55, label %22 [
    i64 -1, label %17
    i64 0, label %17
  ]

17:                                               ; preds = %16, %16
  %18 = icmp eq ptr %2, null
  %19 = icmp eq ptr %2, inttoptr (i64 -1 to ptr)
  %20 = or i1 %18, %19
  %21 = zext i1 %20 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %21, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 134, ptr noundef nonnull @__FUNCTION__.mListWrite, ptr noundef nonnull @.str.7, ptr noundef %2) #3
  br label %22

22:                                               ; preds = %16, %17
  %23 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #4
  %24 = trunc i64 %23 to i32
  %25 = add i32 %24, 1
  br label %26

26:                                               ; preds = %22, %14
  %.051 = phi i32 [ %25, %22 ], [ %3, %14 ]
  %27 = getelementptr inbounds i8, ptr %0, i64 -24
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = icmp slt i32 %1, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %26
  %34 = load i32, ptr %0, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %33, %26
  %.050 = phi i32 [ %34, %33 ], [ %1, %26 ]
  %36 = getelementptr inbounds i8, ptr %31, i64 96
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = tail call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0) #3
  store ptr %40, ptr %36, align 8, !tbaa !16
  br label %41

41:                                               ; preds = %39, %35
  %42 = phi ptr [ %40, %39 ], [ %37, %35 ]
  %43 = tail call ptr @mMemoryWrite(ptr noundef %42, ptr noundef %2, i32 noundef %.051) #3
  %44 = load i32, ptr %0, align 8, !tbaa !5
  %45 = icmp eq i32 %.050, %44
  br i1 %45, label %.thread, label %46

46:                                               ; preds = %41
  %47 = getelementptr inbounds i8, ptr %0, i64 8
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = sext i32 %.050 to i64
  %50 = getelementptr inbounds ptr, ptr %48, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  %52 = icmp eq ptr %51, null
  br i1 %52, label %.thread, label %64

.thread:                                          ; preds = %41, %46
  %53 = getelementptr inbounds i8, ptr %31, i64 84
  %54 = load i32, ptr %53, align 4, !tbaa !19
  %55 = icmp slt i32 %.050, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %.thread
  %57 = add nsw i32 %.050, 1
  store i32 %57, ptr %0, align 8, !tbaa !5
  br label %59

58:                                               ; preds = %.thread
  tail call void @m_ListAppend(ptr noundef nonnull %0, ptr noundef null, i32 noundef -1)
  br label %59

59:                                               ; preds = %58, %56
  %60 = getelementptr inbounds i8, ptr %0, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !18
  %62 = sext i32 %.050 to i64
  %63 = getelementptr inbounds ptr, ptr %61, i64 %62
  store ptr %43, ptr %63, align 8, !tbaa !13
  br label %72

64:                                               ; preds = %46
  store ptr %43, ptr %50, align 8, !tbaa !13
  %65 = getelementptr inbounds i8, ptr %31, i64 104
  %66 = load i32, ptr %65, align 8, !tbaa !20
  %67 = add nsw i32 %66, %.051
  store i32 %67, ptr %65, align 8, !tbaa !20
  %68 = icmp sgt i32 %67, 16384
  br i1 %68, label %69, label %72

69:                                               ; preds = %64
  %70 = load ptr, ptr %36, align 8, !tbaa !16
  tail call void @mListElementOperate(ptr noundef nonnull %0, ptr noundef nonnull @MemoryCollect, ptr noundef %70)
  %71 = load ptr, ptr %36, align 8, !tbaa !16
  tail call void @MemoryDefrag(ptr noundef %71) #3
  store i32 0, ptr %65, align 8, !tbaa !20
  br label %72

72:                                               ; preds = %64, %69, %59
  %.pre-phi = phi i64 [ %49, %64 ], [ %49, %69 ], [ %62, %59 ]
  %73 = getelementptr inbounds i8, ptr %0, i64 8
  %74 = load ptr, ptr %73, align 8, !tbaa !18
  %75 = getelementptr inbounds ptr, ptr %74, i64 %.pre-phi
  %76 = load ptr, ptr %75, align 8, !tbaa !13
  ret ptr %76
}

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

declare ptr @mMemoryWrite(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @mListElementOperate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @MemoryCollect(ptr noundef, ptr noundef) #0

declare void @MemoryDefrag(ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 #2 = { 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 #3 = { nounwind }
attributes #4 = { 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, !7, i64 0}
!6 = !{!"MList", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"HandleList", !6, i64 0, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !10, i64 16}
!15 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!16 = !{!17, !10, i64 96}
!17 = !{!"HandleListCreate", !10, i64 0, !10, i64 8, !8, i64 16, !7, i64 80, !7, i64 84, !10, i64 88, !10, i64 96, !7, i64 104, !7, i64 108}
!18 = !{!6, !10, i64 8}
!19 = !{!17, !7, i64 84}
!20 = !{!17, !7, i64 104}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass