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

; 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, i16, %union.anon.0 }
%union.anon.0 = type { ptr }
%struct.HandleList = type { %struct.MList, i32, i32, i32, i32 }
%struct.MList = type { i32, ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleArrayCreate = type { ptr, ptr, [8 x i64], i32, i32, i32, ptr, i32 }
%struct.MMemoryBlock = type { i32, i32, ptr, ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [77 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.m_ArrayPushBack = external hidden unnamed_addr constant [16 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

declare void @mMemoryBlockRelease(ptr noundef) #1

declare ptr @mMemoryBlockCreate(i32 noundef, i32 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
define dso_local ptr @m_ArrayPushBack(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %13, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._MArray, ptr %14, i32 0, i32 1
  %16 = load i16, ptr %15, align 4, !tbaa !9
  %17 = sext i16 %16 to i32
  store i32 %17, ptr %7, align 4, !tbaa !13
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._MArray, ptr %18, i32 0, i32 2
  %20 = load i16, ptr %19, align 2, !tbaa !14
  %21 = zext i16 %20 to i32
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %107

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.HandleList, ptr %24, i64 -1
  %26 = getelementptr inbounds %struct.HandleList, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %struct.MList, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.MHandle, ptr %30, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  store ptr %32, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.HandleArrayCreate, ptr %33, i32 0, i32 4
  %35 = load i32, ptr %34, align 4, !tbaa !20
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._MArray, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %39 = icmp sle i32 %35, %38
  br i1 %39, label %40, label %95

40:                                               ; preds = %23
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.HandleArrayCreate, ptr %42, i32 0, i32 6
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %45 = icmp eq ptr %44, null
  %46 = zext i1 %45 to i32
  store i32 %46, ptr %9, align 4, !tbaa !13
  %47 = load i32, ptr %9, align 4, !tbaa !13
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %41
  %50 = load i32, ptr %9, align 4, !tbaa !13
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %50, i32 noundef -1, ptr noundef @.str, i32 noundef 271, ptr noundef @__FUNCTION__.m_ArrayPushBack, ptr noundef @.str.1)
  br label %51

51:                                               ; preds = %49, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HandleArrayCreate, ptr %54, i32 0, i32 6
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = getelementptr inbounds %struct.MMemoryBlock, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !24
  store i32 %58, ptr %10, align 4, !tbaa !13
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HandleArrayCreate, ptr %59, i32 0, i32 4
  %61 = load i32, ptr %60, align 4, !tbaa !20
  %62 = mul nsw i32 %61, 2
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.HandleArrayCreate, ptr %63, i32 0, i32 4
  store i32 %62, ptr %64, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.HandleArrayCreate, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 4, !tbaa !20
  %68 = load i32, ptr %7, align 4, !tbaa !13
  %69 = mul nsw i32 %67, %68
  %70 = load i32, ptr %10, align 4, !tbaa !13
  %71 = call ptr @mMemoryBlockCreate(i32 noundef %69, i32 noundef %70)
  store ptr %71, ptr %11, align 8, !tbaa !5
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.MMemoryBlock, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !26
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._MArray, ptr %75, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  %78 = load i32, ptr %7, align 4, !tbaa !13
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._MArray, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !22
  %82 = mul nsw i32 %78, %81
  %83 = sext i32 %82 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr align 1 %77, i64 %83, i1 false)
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.HandleArrayCreate, ptr %84, i32 0, i32 6
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  store ptr %86, ptr %6, align 8, !tbaa !5
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.HandleArrayCreate, ptr %88, i32 0, i32 6
  store ptr %87, ptr %89, align 8, !tbaa !23
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.MMemoryBlock, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !26
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._MArray, ptr %93, i32 0, i32 3
  store ptr %92, ptr %94, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %95

95:                                               ; preds = %53, %23
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.HandleArrayCreate, ptr %96, i32 0, i32 4
  %98 = load i32, ptr %97, align 4, !tbaa !20
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._MArray, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !22
  %102 = sub nsw i32 %98, %101
  %103 = and i32 %102, 65535
  %104 = trunc i32 %103 to i16
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._MArray, ptr %105, i32 0, i32 2
  store i16 %104, ptr %106, align 2, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %107

107:                                              ; preds = %95, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._MArray, ptr %108, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !27
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._MArray, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !22
  %114 = load i32, ptr %7, align 4, !tbaa !13
  %115 = mul nsw i32 %113, %114
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i8, ptr %110, i64 %116
  store ptr %117, ptr %12, align 8, !tbaa !5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %107
  br label %158

121:                                              ; preds = %107
  %122 = load i32, ptr %7, align 4, !tbaa !13
  %123 = icmp eq i32 %122, 4
  br i1 %123, label %124, label %128

124:                                              ; preds = %121
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load i32, ptr %125, align 4, !tbaa !13
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %126, ptr %127, align 4, !tbaa !13
  br label %157

128:                                              ; preds = %121
  %129 = load i32, ptr %7, align 4, !tbaa !13
  %130 = icmp eq i32 %129, 8
  br i1 %130, label %131, label %135

131:                                              ; preds = %128
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = load i64, ptr %132, align 8, !tbaa !28
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %133, ptr %134, align 8, !tbaa !28
  br label %156

135:                                              ; preds = %128
  %136 = load i32, ptr %7, align 4, !tbaa !13
  %137 = icmp eq i32 %136, 1
  br i1 %137, label %138, label %142

138:                                              ; preds = %135
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i8, ptr %139, align 1, !tbaa !27
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 %140, ptr %141, align 1, !tbaa !27
  br label %155

142:                                              ; preds = %135
  %143 = load i32, ptr %7, align 4, !tbaa !13
  %144 = icmp eq i32 %143, 2
  br i1 %144, label %145, label %149

145:                                              ; preds = %142
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load i16, ptr %146, align 2, !tbaa !30
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  store i16 %147, ptr %148, align 2, !tbaa !30
  br label %154

149:                                              ; preds = %142
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = load i32, ptr %7, align 4, !tbaa !13
  %153 = sext i32 %152 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %150, ptr align 1 %151, i64 %153, i1 false)
  br label %154

154:                                              ; preds = %149, %145
  br label %155

155:                                              ; preds = %154, %138
  br label %156

156:                                              ; preds = %155, %131
  br label %157

157:                                              ; preds = %156, %124
  br label %158

158:                                              ; preds = %157, %120
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._MArray, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !22
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %160, align 8, !tbaa !22
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._MArray, ptr %163, i32 0, i32 2
  %165 = load i16, ptr %164, align 2, !tbaa !14
  %166 = add i16 %165, -1
  store i16 %166, ptr %164, align 2, !tbaa !14
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = icmp ne ptr %167, null
  br i1 %168, label %169, label %171

169:                                              ; preds = %158
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mMemoryBlockRelease(ptr noundef %170)
  br label %171

171:                                              ; preds = %169, %158
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret ptr %172
}

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, !12, i64 4}
!10 = !{!"_MArray", !11, i64 0, !12, i64 4, !12, i64 6, !7, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !12, i64 6}
!15 = !{!16, !6, i64 8}
!16 = !{!"HandleList", !17, i64 0, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!17 = !{!"MList", !11, i64 0, !6, i64 8}
!18 = !{!19, !6, i64 16}
!19 = !{!"MHandle", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!20 = !{!21, !11, i64 84}
!21 = !{!"HandleArrayCreate", !6, i64 0, !6, i64 8, !7, i64 16, !11, i64 80, !11, i64 84, !11, i64 88, !6, i64 96, !11, i64 104}
!22 = !{!10, !11, i64 0}
!23 = !{!21, !6, i64 96}
!24 = !{!25, !11, i64 0}
!25 = !{!"MMemoryBlock", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32}
!26 = !{!25, !6, i64 8}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"long", !7, i64 0}
!30 = !{!12, !12, i64 0}


; 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 [77 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.m_ArrayPushBack = external hidden unnamed_addr constant [16 x i8], align 1

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

declare void @mMemoryBlockRelease(ptr noundef) local_unnamed_addr #0

declare ptr @mMemoryBlockCreate(i32 noundef, i32 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
define dso_local ptr @m_ArrayPushBack(ptr nocapture noundef %0, ptr noundef readonly %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = load i16, ptr %3, align 4, !tbaa !5
  %5 = sext i16 %4 to i32
  %6 = getelementptr inbounds i8, ptr %0, i64 6
  %7 = load i16, ptr %6, align 2, !tbaa !11
  %8 = icmp eq i16 %7, 0
  %.pre56 = load i32, ptr %0, align 8, !tbaa !12
  br i1 %8, label %9, label %43

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %0, i64 -24
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = load ptr, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %14, i64 84
  %16 = load i32, ptr %15, align 4, !tbaa !20
  %.not = icmp sgt i32 %16, %.pre56
  br i1 %.not, label %38, label %17

17:                                               ; preds = %9
  %18 = getelementptr inbounds i8, ptr %14, i64 96
  %19 = load ptr, ptr %18, align 8, !tbaa !22
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 271, ptr noundef nonnull @__FUNCTION__.m_ArrayPushBack, ptr noundef nonnull @.str.1) #3
  %.pre = load ptr, ptr %18, align 8, !tbaa !22
  %.pre53 = load i32, ptr %15, align 4, !tbaa !20
  br label %22

22:                                               ; preds = %21, %17
  %23 = phi i32 [ %.pre53, %21 ], [ %16, %17 ]
  %24 = phi ptr [ %.pre, %21 ], [ %19, %17 ]
  %25 = load i32, ptr %24, align 8, !tbaa !23
  %26 = shl nsw i32 %23, 1
  store i32 %26, ptr %15, align 4, !tbaa !20
  %27 = mul nsw i32 %26, %5
  %28 = tail call ptr @mMemoryBlockCreate(i32 noundef %27, i32 noundef %25) #3
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !25
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !26
  %33 = load i32, ptr %0, align 8, !tbaa !12
  %34 = mul nsw i32 %33, %5
  %35 = sext i32 %34 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %30, ptr align 1 %32, i64 %35, i1 false)
  %36 = load ptr, ptr %18, align 8, !tbaa !22
  store ptr %28, ptr %18, align 8, !tbaa !22
  %37 = load ptr, ptr %29, align 8, !tbaa !25
  store ptr %37, ptr %31, align 8, !tbaa !26
  %.pre54 = load i32, ptr %15, align 4, !tbaa !20
  %.pre55 = load i32, ptr %0, align 8, !tbaa !12
  br label %38

38:                                               ; preds = %22, %9
  %39 = phi i32 [ %.pre55, %22 ], [ %.pre56, %9 ]
  %40 = phi i32 [ %.pre54, %22 ], [ %16, %9 ]
  %.0 = phi ptr [ %36, %22 ], [ null, %9 ]
  %41 = sub nsw i32 %40, %39
  %42 = trunc i32 %41 to i16
  store i16 %42, ptr %6, align 2, !tbaa !11
  br label %43

43:                                               ; preds = %38, %2
  %44 = phi i32 [ %39, %38 ], [ %.pre56, %2 ]
  %.1 = phi ptr [ %.0, %38 ], [ null, %2 ]
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  %47 = mul nsw i32 %44, %5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %46, i64 %48
  %50 = icmp eq ptr %1, null
  br i1 %50, label %62, label %51

51:                                               ; preds = %43
  switch i16 %4, label %60 [
    i16 4, label %52
    i16 8, label %54
    i16 1, label %56
    i16 2, label %58
  ]

52:                                               ; preds = %51
  %53 = load i32, ptr %1, align 4, !tbaa !27
  store i32 %53, ptr %49, align 4, !tbaa !27
  br label %62

54:                                               ; preds = %51
  %55 = load i64, ptr %1, align 8, !tbaa !28
  store i64 %55, ptr %49, align 8, !tbaa !28
  br label %62

56:                                               ; preds = %51
  %57 = load i8, ptr %1, align 1, !tbaa !26
  store i8 %57, ptr %49, align 1, !tbaa !26
  br label %62

58:                                               ; preds = %51
  %59 = load i16, ptr %1, align 2, !tbaa !30
  store i16 %59, ptr %49, align 2, !tbaa !30
  br label %62

60:                                               ; preds = %51
  %61 = sext i16 %4 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr nonnull align 1 %1, i64 %61, i1 false)
  br label %62

62:                                               ; preds = %52, %56, %60, %58, %54, %43
  %63 = load i32, ptr %0, align 8, !tbaa !12
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %0, align 8, !tbaa !12
  %65 = load i16, ptr %6, align 2, !tbaa !11
  %66 = add i16 %65, -1
  store i16 %66, ptr %6, align 2, !tbaa !11
  %.not52 = icmp eq ptr %.1, null
  br i1 %.not52, label %68, label %67

67:                                               ; preds = %62
  tail call void @mMemoryBlockRelease(ptr noundef nonnull %.1) #3
  br label %68

68:                                               ; preds = %67, %62
  ret ptr %49
}

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, !10, i64 4}
!6 = !{!"_MArray", !7, i64 0, !10, i64 4, !10, i64 6, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!6, !10, i64 6}
!12 = !{!6, !7, i64 0}
!13 = !{!14, !16, i64 8}
!14 = !{!"HandleList", !15, i64 0, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!15 = !{!"MList", !7, i64 0, !16, i64 8}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !16, i64 16}
!19 = !{!"MHandle", !7, i64 0, !7, i64 4, !16, i64 8, !16, i64 16}
!20 = !{!21, !7, i64 84}
!21 = !{!"HandleArrayCreate", !16, i64 0, !16, i64 8, !8, i64 16, !7, i64 80, !7, i64 84, !7, i64 88, !16, i64 96, !7, i64 104}
!22 = !{!21, !16, i64 96}
!23 = !{!24, !7, i64 0}
!24 = !{!"MMemoryBlock", !7, i64 0, !7, i64 4, !16, i64 8, !16, i64 16, !16, i64 24, !7, i64 32}
!25 = !{!24, !16, i64 8}
!26 = !{!8, !8, i64 0}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"long", !8, i64 0}
!30 = !{!10, !10, i64 0}


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