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

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

@.str = external hidden unnamed_addr constant [77 x i8], align 1
@__FUNCTION__.TableCreate = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endTableCreate(ptr noundef) #0

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @TableCreate(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %18 = call ptr @ObjectAlloc(i32 noundef 24)
  store ptr %18, ptr %10, align 8, !tbaa !9
  %19 = load ptr, ptr %10, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.HandleList, ptr %19, i64 -1
  %21 = getelementptr inbounds %struct.HandleList, ptr %20, i32 0, i32 4
  store i32 1458920063, ptr %21, align 4, !tbaa !11
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %24, %4
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.MTable, ptr %27, i32 0, i32 1
  store i32 %26, ptr %28, align 4, !tbaa !14
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %25
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %31, %25
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load ptr, ptr %10, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.MTable, ptr %34, i32 0, i32 0
  store i32 %33, ptr %35, align 8, !tbaa !16
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %32
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %38, %32
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = load ptr, ptr %10, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.MTable, ptr %41, i32 0, i32 2
  store i32 %40, ptr %42, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %43 = load ptr, ptr %10, align 8, !tbaa !9
  %44 = call ptr @GetHandle(ptr noundef %43, i32 noundef 112, i32 noundef 1458920063, ptr noundef @endTableCreate)
  store ptr %44, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %45 = load ptr, ptr %11, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.MHandle, ptr %45, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  store ptr %47, ptr %12, align 8, !tbaa !9
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  %49 = load ptr, ptr %12, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.HandleTableCreate, ptr %49, i32 0, i32 0
  store ptr %48, ptr %50, align 8, !tbaa !20
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %73

53:                                               ; preds = %39
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %55 = load ptr, ptr %9, align 8, !tbaa !9
  %56 = icmp eq ptr %55, null
  br i1 %56, label %61, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = ptrtoint ptr %58 to i64
  %60 = icmp eq i64 %59, -1
  br label %61

61:                                               ; preds = %57, %54
  %62 = phi i1 [ true, %54 ], [ %60, %57 ]
  %63 = xor i1 %62, true
  %64 = zext i1 %63 to i32
  store i32 %64, ptr %13, align 4, !tbaa !5
  %65 = load i32, ptr %13, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %61
  %68 = load i32, ptr %13, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %68, i32 noundef -1, ptr noundef @.str, i32 noundef 44, ptr noundef @__FUNCTION__.TableCreate, ptr noundef @.str.2)
  br label %69

69:                                               ; preds = %67, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %72, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %201

73:                                               ; preds = %39
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = mul i64 %75, 8
  %77 = trunc i64 %76 to i32
  %78 = call ptr @m_Malloc(i32 noundef %77)
  %79 = load ptr, ptr %12, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.HandleTableCreate, ptr %79, i32 0, i32 7
  store ptr %78, ptr %80, align 8, !tbaa !22
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = load ptr, ptr %12, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.HandleTableCreate, ptr %82, i32 0, i32 4
  store i32 %81, ptr %83, align 4, !tbaa !23
  %84 = load ptr, ptr %10, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.MTable, ptr %84, i32 0, i32 3
  store ptr null, ptr %85, align 8, !tbaa !24
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %113

88:                                               ; preds = %73
  br label %89

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %90 = load ptr, ptr %9, align 8, !tbaa !9
  %91 = icmp eq ptr %90, null
  br i1 %91, label %96, label %92

92:                                               ; preds = %89
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  %94 = ptrtoint ptr %93 to i64
  %95 = icmp eq i64 %94, -1
  br label %96

96:                                               ; preds = %92, %89
  %97 = phi i1 [ true, %89 ], [ %95, %92 ]
  %98 = xor i1 %97, true
  %99 = zext i1 %98 to i32
  store i32 %99, ptr %15, align 4, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %96
  %103 = load i32, ptr %15, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %103, i32 noundef -1, ptr noundef @.str, i32 noundef 55, ptr noundef @__FUNCTION__.TableCreate, ptr noundef @.str.2)
  br label %104

104:                                              ; preds = %102, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %12, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.HandleTableCreate, ptr %107, i32 0, i32 7
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = mul i64 %111, 8
  call void @llvm.memset.p0.i64(ptr align 8 %109, i8 0, i64 %112, i1 false)
  br label %192

113:                                              ; preds = %73
  %114 = load ptr, ptr %9, align 8, !tbaa !9
  %115 = icmp eq ptr %114, null
  br i1 %115, label %133, label %116

116:                                              ; preds = %113
  %117 = load ptr, ptr %9, align 8, !tbaa !9
  %118 = ptrtoint ptr %117 to i64
  %119 = icmp eq i64 %118, -1
  br i1 %119, label %133, label %120

120:                                              ; preds = %116
  %121 = load ptr, ptr %12, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.HandleTableCreate, ptr %121, i32 0, i32 7
  %123 = load ptr, ptr %122, align 8, !tbaa !22
  %124 = load ptr, ptr %9, align 8, !tbaa !9
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul i64 %126, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %123, ptr align 8 %124, i64 %127, i1 false)
  %128 = load ptr, ptr %12, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.HandleTableCreate, ptr %128, i32 0, i32 7
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  %131 = load ptr, ptr %10, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.MTable, ptr %131, i32 0, i32 3
  store ptr %130, ptr %132, align 8, !tbaa !24
  br label %191

133:                                              ; preds = %116, %113
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %136, label %190

136:                                              ; preds = %133
  %137 = load ptr, ptr %12, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.HandleTableCreate, ptr %137, i32 0, i32 8
  %139 = load ptr, ptr %138, align 8, !tbaa !25
  %140 = icmp eq ptr %139, null
  br i1 %140, label %141, label %150

141:                                              ; preds = %136
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = mul nsw i32 %142, %143
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = mul nsw i32 %144, %145
  %147 = call ptr @mMemoryBlockCreate(i32 noundef %146, i32 noundef 0)
  %148 = load ptr, ptr %12, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.HandleTableCreate, ptr %148, i32 0, i32 8
  store ptr %147, ptr %149, align 8, !tbaa !25
  br label %150

150:                                              ; preds = %141, %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %151 = load ptr, ptr %12, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.HandleTableCreate, ptr %151, i32 0, i32 8
  %153 = load ptr, ptr %152, align 8, !tbaa !25
  %154 = getelementptr inbounds %struct.MMemoryBlock, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !26
  store ptr %155, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %175, %150
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 6, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %178

161:                                              ; preds = %156
  %162 = load ptr, ptr %16, align 8, !tbaa !9
  %163 = load ptr, ptr %12, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.HandleTableCreate, ptr %163, i32 0, i32 7
  %165 = load ptr, ptr %164, align 8, !tbaa !22
  %166 = load i32, ptr %17, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds ptr, ptr %165, i64 %167
  store ptr %162, ptr %168, align 8, !tbaa !9
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = mul nsw i32 %169, %170
  %172 = load ptr, ptr %16, align 8, !tbaa !9
  %173 = sext i32 %171 to i64
  %174 = getelementptr inbounds i8, ptr %172, i64 %173
  store ptr %174, ptr %16, align 8, !tbaa !9
  br label %175

175:                                              ; preds = %161
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %17, align 4, !tbaa !5
  br label %156, !llvm.loop !28

178:                                              ; preds = %160
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = load ptr, ptr %12, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.HandleTableCreate, ptr %180, i32 0, i32 5
  store i32 %179, ptr %181, align 8, !tbaa !30
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = load ptr, ptr %12, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.HandleTableCreate, ptr %183, i32 0, i32 6
  store i32 %182, ptr %184, align 4, !tbaa !31
  %185 = load ptr, ptr %12, align 8, !tbaa !9
  %186 = getelementptr inbounds %struct.HandleTableCreate, ptr %185, i32 0, i32 7
  %187 = load ptr, ptr %186, align 8, !tbaa !22
  %188 = load ptr, ptr %10, align 8, !tbaa !9
  %189 = getelementptr inbounds %struct.MTable, ptr %188, i32 0, i32 3
  store ptr %187, ptr %189, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %190

190:                                              ; preds = %178, %133
  br label %191

191:                                              ; preds = %190, %120
  br label %192

192:                                              ; preds = %191, %106
  br label %193

193:                                              ; preds = %192
  %194 = load ptr, ptr %10, align 8, !tbaa !9
  %195 = load ptr, ptr %12, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.HandleTableCreate, ptr %195, i32 0, i32 8
  %197 = load ptr, ptr %196, align 8, !tbaa !25
  call void @m_PropertyFunction(ptr noundef %194, ptr noundef @.str.3, ptr noundef @mornMemoryDevice, ptr noundef %197)
  br label %198

198:                                              ; preds = %193
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %200, ptr %5, align 8
  store i32 1, ptr %14, align 4
  br label %201

201:                                              ; preds = %199, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %202 = load ptr, ptr %5, align 8
  ret ptr %202
}

declare ptr @ObjectAlloc(i32 noundef) #2

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

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 ptr @mMemoryBlockCreate(i32 noundef, i32 noundef) #2

declare void @m_PropertyFunction(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @mornMemoryDevice(ptr noundef, ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 28}
!12 = !{!"HandleList", !13, i64 0, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!13 = !{!"MList", !6, i64 0, !10, i64 8}
!14 = !{!15, !6, i64 4}
!15 = !{!"MTable", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 16}
!16 = !{!15, !6, i64 0}
!17 = !{!15, !6, i64 8}
!18 = !{!19, !10, i64 16}
!19 = !{!"MHandle", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16}
!20 = !{!21, !10, i64 0}
!21 = !{!"HandleTableCreate", !10, i64 0, !10, i64 8, !7, i64 16, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !10, i64 96, !10, i64 104}
!22 = !{!21, !10, i64 96}
!23 = !{!21, !6, i64 84}
!24 = !{!7, !7, i64 0}
!25 = !{!21, !10, i64 104}
!26 = !{!27, !10, i64 8}
!27 = !{!"MMemoryBlock", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!21, !6, i64 88}
!31 = !{!21, !6, i64 92}


; 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
@__FUNCTION__.TableCreate = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endTableCreate(ptr noundef) #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @TableCreate(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = tail call ptr @ObjectAlloc(i32 noundef 24) #5
  %6 = getelementptr inbounds i8, ptr %5, i64 -4
  store i32 1458920063, ptr %6, align 4, !tbaa !5
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
  %7 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %spec.store.select, ptr %7, align 4, !tbaa !12
  %spec.store.select4 = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
  store i32 %spec.store.select4, ptr %5, align 8, !tbaa !14
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %2, i32 0)
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %spec.store.select1, ptr %8, align 8, !tbaa !15
  %9 = tail call ptr @GetHandle(ptr noundef nonnull %5, i32 noundef 112, i32 noundef 1458920063, ptr noundef nonnull @endTableCreate) #5
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  store ptr %5, ptr %11, align 8, !tbaa !18
  %12 = icmp slt i32 %0, 1
  br i1 %12, label %13, label %18

13:                                               ; preds = %4
  %magicptr = ptrtoint ptr %3 to i64
  switch i64 %magicptr, label %14 [
    i64 -1, label %75
    i64 0, label %75
  ]

14:                                               ; preds = %13
  %15 = icmp ne ptr %3, null
  %16 = icmp ne ptr %3, inttoptr (i64 -1 to ptr)
  %.not76 = and i1 %15, %16
  %17 = zext i1 %.not76 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %17, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 44, ptr noundef nonnull @__FUNCTION__.TableCreate, ptr noundef nonnull @.str.2) #5
  br label %75

18:                                               ; preds = %4
  %19 = zext nneg i32 %spec.store.select4 to i64
  %20 = shl nuw nsw i64 %19, 3
  %21 = trunc i64 %20 to i32
  %22 = tail call ptr @m_Malloc(i32 noundef %21) #5
  %23 = getelementptr inbounds i8, ptr %11, i64 96
  store ptr %22, ptr %23, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %11, i64 84
  store i32 %spec.store.select4, ptr %24, align 4, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %25, align 8, !tbaa !22
  %26 = icmp slt i32 %1, 1
  %magicptr77 = ptrtoint ptr %3 to i64
  br i1 %26, label %27, label %34

27:                                               ; preds = %18
  switch i64 %magicptr77, label %28 [
    i64 -1, label %32
    i64 0, label %32
  ]

28:                                               ; preds = %27
  %29 = icmp ne ptr %3, null
  %30 = icmp ne ptr %3, inttoptr (i64 -1 to ptr)
  %.not73 = and i1 %29, %30
  %31 = zext i1 %.not73 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %31, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 55, ptr noundef nonnull @__FUNCTION__.TableCreate, ptr noundef nonnull @.str.2) #5
  br label %32

32:                                               ; preds = %27, %27, %28
  %33 = load ptr, ptr %23, align 8, !tbaa !20
  tail call void @llvm.memset.p0.i64(ptr align 8 %33, i8 0, i64 %20, i1 false)
  br label %72

34:                                               ; preds = %18
  switch i64 %magicptr77, label %35 [
    i64 -1, label %38
    i64 0, label %38
  ]

35:                                               ; preds = %34
  %36 = load ptr, ptr %23, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %3, i64 %20, i1 false)
  %37 = load ptr, ptr %23, align 8, !tbaa !20
  store ptr %37, ptr %25, align 8, !tbaa !22
  br label %72

38:                                               ; preds = %34, %34
  %.not = icmp slt i32 %2, 1
  br i1 %.not, label %72, label %39

39:                                               ; preds = %38
  %40 = getelementptr inbounds i8, ptr %11, i64 104
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %.lr.ph

43:                                               ; preds = %39
  %44 = mul i32 %spec.store.select1, %spec.store.select
  %45 = mul i32 %44, %spec.store.select4
  %46 = tail call ptr @mMemoryBlockCreate(i32 noundef %45, i32 noundef 0) #5
  store ptr %46, ptr %40, align 8, !tbaa !23
  br label %.lr.ph

.lr.ph:                                           ; preds = %39, %43
  %47 = phi ptr [ %46, %43 ], [ %41, %39 ]
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  %50 = mul nuw nsw i32 %spec.store.select1, %spec.store.select
  %51 = zext nneg i32 %50 to i64
  %wide.trip.count = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %52 = icmp ult i32 %0, 4
  br i1 %52, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %59

._crit_edge.unr-lcssa:                            ; preds = %59, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %59 ]
  %.06879.unr = phi ptr [ %49, %.lr.ph ], [ %71, %59 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %.06879.epil = phi ptr [ %55, %.epil.preheader ], [ %.06879.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %53 = load ptr, ptr %23, align 8, !tbaa !20
  %54 = getelementptr inbounds ptr, ptr %53, i64 %indvars.iv.epil
  store ptr %.06879.epil, ptr %54, align 8, !tbaa !26
  %55 = getelementptr inbounds i8, ptr %.06879.epil, i64 %51
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !27

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  %56 = getelementptr inbounds i8, ptr %11, i64 88
  store i32 %spec.store.select, ptr %56, align 8, !tbaa !29
  %57 = getelementptr inbounds i8, ptr %11, i64 92
  store i32 %spec.store.select1, ptr %57, align 4, !tbaa !30
  %58 = load ptr, ptr %23, align 8, !tbaa !20
  store ptr %58, ptr %25, align 8, !tbaa !22
  br label %72

59:                                               ; preds = %59, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %59 ]
  %.06879 = phi ptr [ %49, %.lr.ph.new ], [ %71, %59 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %59 ]
  %60 = load ptr, ptr %23, align 8, !tbaa !20
  %61 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv
  store ptr %.06879, ptr %61, align 8, !tbaa !26
  %62 = getelementptr inbounds i8, ptr %.06879, i64 %51
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %63 = load ptr, ptr %23, align 8, !tbaa !20
  %64 = getelementptr inbounds ptr, ptr %63, i64 %indvars.iv.next
  store ptr %62, ptr %64, align 8, !tbaa !26
  %65 = getelementptr inbounds i8, ptr %62, i64 %51
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %66 = load ptr, ptr %23, align 8, !tbaa !20
  %67 = getelementptr inbounds ptr, ptr %66, i64 %indvars.iv.next.1
  store ptr %65, ptr %67, align 8, !tbaa !26
  %68 = getelementptr inbounds i8, ptr %65, i64 %51
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %69 = load ptr, ptr %23, align 8, !tbaa !20
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv.next.2
  store ptr %68, ptr %70, align 8, !tbaa !26
  %71 = getelementptr inbounds i8, ptr %68, i64 %51
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %59, !llvm.loop !31

72:                                               ; preds = %32, %38, %._crit_edge, %35
  %73 = getelementptr inbounds i8, ptr %11, i64 104
  %74 = load ptr, ptr %73, align 8, !tbaa !23
  tail call void @m_PropertyFunction(ptr noundef nonnull %5, ptr noundef nonnull @.str.3, ptr noundef nonnull @mornMemoryDevice, ptr noundef %74) #5
  br label %75

75:                                               ; preds = %14, %13, %13, %72
  ret ptr %5
}

declare ptr @ObjectAlloc(i32 noundef) local_unnamed_addr #1

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

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 ptr @mMemoryBlockCreate(i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @m_PropertyFunction(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !8, i64 28}
!6 = !{!"HandleList", !7, i64 0, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!7 = !{!"MList", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!13, !8, i64 4}
!13 = !{!"MTable", !8, i64 0, !8, i64 4, !8, i64 8, !9, i64 16}
!14 = !{!13, !8, i64 0}
!15 = !{!13, !8, i64 8}
!16 = !{!17, !11, i64 16}
!17 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!18 = !{!19, !11, i64 0}
!19 = !{!"HandleTableCreate", !11, i64 0, !11, i64 8, !9, i64 16, !8, i64 80, !8, i64 84, !8, i64 88, !8, i64 92, !11, i64 96, !11, i64 104}
!20 = !{!19, !11, i64 96}
!21 = !{!19, !8, i64 84}
!22 = !{!9, !9, i64 0}
!23 = !{!19, !11, i64 104}
!24 = !{!25, !11, i64 8}
!25 = !{!"MMemoryBlock", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !8, i64 32}
!26 = !{!11, !11, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = !{!19, !8, i64 88}
!30 = !{!19, !8, i64 92}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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