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

; 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

declare void @mMemoryRelease(ptr noundef) #1

declare void @m_Free(ptr 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) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mListMerge(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.MList, ptr %12, i32 0, i32 0
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.MList, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = add nsw i32 %14, %17
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mListClear(ptr noundef %21)
  br label %205

22:                                               ; preds = %3
  br label %23

23:                                               ; preds = %22
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.MList, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MList, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = add nsw i32 %27, %30
  %32 = add nsw i32 %31, 0
  %33 = sext i32 %32 to i64
  %34 = trunc i64 %33 to i32
  call void @m_ListAppend(ptr noundef %24, ptr noundef null, i32 noundef %34)
  br label %35

35:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.HandleList, ptr %36, i64 -1
  %38 = getelementptr inbounds %struct.HandleList, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.MList, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %41 = getelementptr inbounds ptr, ptr %40, i64 0
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.MHandle, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  store ptr %44, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HandleList, ptr %45, i64 -1
  %47 = getelementptr inbounds %struct.HandleList, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.MList, ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !12
  %50 = getelementptr inbounds ptr, ptr %49, i64 0
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.MHandle, ptr %51, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  store ptr %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HandleList, ptr %54, i64 -1
  %56 = getelementptr inbounds %struct.HandleList, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.MList, ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !12
  %59 = getelementptr inbounds ptr, ptr %58, i64 0
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.MHandle, ptr %60, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  store ptr %62, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MList, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !9
  store i32 %65, ptr %10, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.MList, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !9
  store i32 %68, ptr %11, align 4, !tbaa !16
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = icmp eq ptr %69, %70
  br i1 %71, label %72, label %96

72:                                               ; preds = %35
  %73 = load i32, ptr %11, align 4, !tbaa !16
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %95

75:                                               ; preds = %72
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.MList, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %79 = load i32, ptr %10, align 4, !tbaa !16
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds ptr, ptr %78, i64 %80
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MList, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !17
  %85 = load i32, ptr %11, align 4, !tbaa !16
  %86 = sext i32 %85 to i64
  %87 = mul i64 %86, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %81, ptr align 8 %84, i64 %87, i1 false)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.MList, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !17
  call void @m_Free(ptr noundef %90)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.MList, ptr %91, i32 0, i32 1
  store ptr null, ptr %92, align 8, !tbaa !17
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.MList, ptr %93, i32 0, i32 0
  store i32 0, ptr %94, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %75, %72
  br label %169

96:                                               ; preds = %35
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = icmp eq ptr %97, %98
  br i1 %99, label %100, label %124

100:                                              ; preds = %96
  %101 = load i32, ptr %10, align 4, !tbaa !16
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %103, label %123

103:                                              ; preds = %100
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.MList, ptr %104, i32 0, i32 1
  %106 = load ptr, ptr %105, align 8, !tbaa !17
  %107 = load i32, ptr %11, align 4, !tbaa !16
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MList, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %113 = load i32, ptr %10, align 4, !tbaa !16
  %114 = sext i32 %113 to i64
  %115 = mul i64 %114, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %109, ptr align 8 %112, i64 %115, i1 false)
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.MList, ptr %116, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8, !tbaa !17
  call void @m_Free(ptr noundef %118)
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MList, ptr %119, i32 0, i32 1
  store ptr null, ptr %120, align 8, !tbaa !17
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.MList, ptr %121, i32 0, i32 0
  store i32 0, ptr %122, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %103, %100
  br label %168

124:                                              ; preds = %96
  %125 = load i32, ptr %10, align 4, !tbaa !16
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %127, label %144

127:                                              ; preds = %124
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.MList, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !17
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.MList, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !17
  %134 = load i32, ptr %10, align 4, !tbaa !16
  %135 = sext i32 %134 to i64
  %136 = mul i64 %135, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %130, ptr align 8 %133, i64 %136, i1 false)
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.MList, ptr %137, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !17
  call void @m_Free(ptr noundef %139)
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.MList, ptr %140, i32 0, i32 1
  store ptr null, ptr %141, align 8, !tbaa !17
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.MList, ptr %142, i32 0, i32 0
  store i32 0, ptr %143, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %127, %124
  %145 = load i32, ptr %11, align 4, !tbaa !16
  %146 = icmp sgt i32 %145, 0
  br i1 %146, label %147, label %167

147:                                              ; preds = %144
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.MList, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !17
  %151 = load i32, ptr %10, align 4, !tbaa !16
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds ptr, ptr %150, i64 %152
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.MList, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !17
  %157 = load i32, ptr %11, align 4, !tbaa !16
  %158 = sext i32 %157 to i64
  %159 = mul i64 %158, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %153, ptr align 8 %156, i64 %159, i1 false)
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.MList, ptr %160, i32 0, i32 1
  %162 = load ptr, ptr %161, align 8, !tbaa !17
  call void @m_Free(ptr noundef %162)
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.MList, ptr %163, i32 0, i32 1
  store ptr null, ptr %164, align 8, !tbaa !17
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MList, ptr %165, i32 0, i32 0
  store i32 0, ptr %166, align 8, !tbaa !9
  br label %167

167:                                              ; preds = %147, %144
  br label %168

168:                                              ; preds = %167, %123
  br label %169

169:                                              ; preds = %168, %95
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.HandleListCreate, ptr %170, i32 0, i32 6
  %172 = load ptr, ptr %171, align 8, !tbaa !18
  %173 = icmp eq ptr %172, null
  br i1 %173, label %174, label %178

174:                                              ; preds = %169
  %175 = call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0)
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.HandleListCreate, ptr %176, i32 0, i32 6
  store ptr %175, ptr %177, align 8, !tbaa !18
  br label %185

178:                                              ; preds = %169
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.HandleListCreate, ptr %179, i32 0, i32 6
  %181 = load ptr, ptr %180, align 8, !tbaa !18
  %182 = load i32, ptr %10, align 4, !tbaa !16
  %183 = load i32, ptr %11, align 4, !tbaa !16
  %184 = add nsw i32 %182, %183
  call void @mMemoryRedefine(ptr noundef %181, i32 noundef %184, i32 noundef -1, i32 noundef -1)
  br label %185

185:                                              ; preds = %178, %174
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.HandleListCreate, ptr %186, i32 0, i32 6
  %188 = load ptr, ptr %187, align 8, !tbaa !18
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.HandleListCreate, ptr %189, i32 0, i32 6
  %191 = load ptr, ptr %190, align 8, !tbaa !18
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.HandleListCreate, ptr %192, i32 0, i32 6
  %194 = load ptr, ptr %193, align 8, !tbaa !18
  call void @mMemoryMerge(ptr noundef %188, ptr noundef %191, ptr noundef %194)
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.HandleListCreate, ptr %195, i32 0, i32 6
  %197 = load ptr, ptr %196, align 8, !tbaa !18
  call void @mMemoryRelease(ptr noundef %197)
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.HandleListCreate, ptr %198, i32 0, i32 6
  store ptr null, ptr %199, align 8, !tbaa !18
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.HandleListCreate, ptr %200, i32 0, i32 6
  %202 = load ptr, ptr %201, align 8, !tbaa !18
  call void @mMemoryRelease(ptr noundef %202)
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.HandleListCreate, ptr %203, i32 0, i32 6
  store ptr null, ptr %204, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %205

205:                                              ; preds = %185, %20
  ret void
}

declare void @mMemoryRedefine(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"MList", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"HandleList", !10, i64 0, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!14 = !{!15, !6, i64 16}
!15 = !{!"MHandle", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 8}
!18 = !{!19, !6, i64 96}
!19 = !{!"HandleListCreate", !6, i64 0, !6, i64 8, !7, i64 16, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !11, i64 104, !11, i64 108}


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

declare void @mMemoryRelease(ptr noundef) local_unnamed_addr #0

declare void @m_Free(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mListMerge(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = load i32, ptr %1, align 8, !tbaa !5
  %6 = add nsw i32 %5, %4
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %3
  tail call void @mListClear(ptr noundef %2)
  br label %70

9:                                                ; preds = %3
  tail call void @m_ListAppend(ptr noundef %2, ptr noundef null, i32 noundef %6)
  %10 = getelementptr inbounds i8, ptr %0, i64 -24
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %1, i64 -24
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %2, i64 -24
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = load i32, ptr %0, align 8, !tbaa !5
  %26 = load i32, ptr %1, align 8, !tbaa !5
  %27 = icmp eq ptr %2, %0
  br i1 %27, label %28, label %30

28:                                               ; preds = %9
  %29 = icmp sgt i32 %26, 0
  br i1 %29, label %.sink.split, label %54

30:                                               ; preds = %9
  %31 = icmp eq ptr %2, %1
  %32 = icmp sgt i32 %25, 0
  br i1 %31, label %33, label %34

33:                                               ; preds = %30
  br i1 %32, label %.sink.split, label %54

34:                                               ; preds = %30
  br i1 %32, label %35, label %43

35:                                               ; preds = %34
  %36 = getelementptr inbounds i8, ptr %2, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = getelementptr inbounds i8, ptr %0, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = zext nneg i32 %25 to i64
  %41 = shl nuw nsw i64 %40, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %39, i64 %41, i1 false)
  %42 = load ptr, ptr %38, align 8, !tbaa !16
  tail call void @m_Free(ptr noundef %42) #3
  store ptr null, ptr %38, align 8, !tbaa !16
  store i32 0, ptr %0, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %35, %34
  %44 = icmp sgt i32 %26, 0
  br i1 %44, label %.sink.split, label %54

.sink.split:                                      ; preds = %43, %33, %28
  %.sink77 = phi i32 [ %25, %28 ], [ %26, %33 ], [ %25, %43 ]
  %.sink74 = phi ptr [ %1, %28 ], [ %0, %33 ], [ %1, %43 ]
  %.sink72 = phi i32 [ %26, %28 ], [ %25, %33 ], [ %26, %43 ]
  %45 = getelementptr inbounds i8, ptr %2, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = sext i32 %.sink77 to i64
  %48 = getelementptr inbounds ptr, ptr %46, i64 %47
  %49 = getelementptr inbounds i8, ptr %.sink74, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = zext nneg i32 %.sink72 to i64
  %52 = shl nuw nsw i64 %51, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %48, ptr noundef nonnull align 8 dereferenceable(1) %50, i64 %52, i1 false)
  %53 = load ptr, ptr %49, align 8, !tbaa !16
  tail call void @m_Free(ptr noundef %53) #3
  store ptr null, ptr %49, align 8, !tbaa !16
  store i32 0, ptr %.sink74, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %.sink.split, %33, %43, %28
  %55 = getelementptr inbounds i8, ptr %24, i64 96
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %60

58:                                               ; preds = %54
  %59 = tail call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0) #3
  store ptr %59, ptr %55, align 8, !tbaa !17
  br label %62

60:                                               ; preds = %54
  %61 = add nsw i32 %26, %25
  tail call void @mMemoryRedefine(ptr noundef nonnull %56, i32 noundef %61, i32 noundef -1, i32 noundef -1) #3
  %.pre = load ptr, ptr %55, align 8, !tbaa !17
  br label %62

62:                                               ; preds = %60, %58
  %63 = phi ptr [ %.pre, %60 ], [ %59, %58 ]
  %64 = getelementptr inbounds i8, ptr %14, i64 96
  %65 = load ptr, ptr %64, align 8, !tbaa !17
  %66 = getelementptr inbounds i8, ptr %19, i64 96
  %67 = load ptr, ptr %66, align 8, !tbaa !17
  tail call void @mMemoryMerge(ptr noundef %65, ptr noundef %67, ptr noundef %63) #3
  %68 = load ptr, ptr %64, align 8, !tbaa !17
  tail call void @mMemoryRelease(ptr noundef %68) #3
  store ptr null, ptr %64, align 8, !tbaa !17
  %69 = load ptr, ptr %66, align 8, !tbaa !17
  tail call void @mMemoryRelease(ptr noundef %69) #3
  store ptr null, ptr %66, align 8, !tbaa !17
  br label %70

70:                                               ; preds = %62, %8
  ret void
}

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

declare void @mMemoryMerge(ptr noundef, ptr noundef, 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 = !{!6, !10, i64 8}
!17 = !{!18, !10, i64 96}
!18 = !{!"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}


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