; LLVM IR from jingweizhanghuai/Morn :: src/math (morn_matrix)

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

@.str = external hidden unnamed_addr constant [78 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__.MatrixCreate = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare ptr @ObjectAlloc(i32 noundef) #1

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

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

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

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

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

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

29:                                               ; preds = %3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %29, %3
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.MMatrix, ptr %32, i32 0, i32 1
  store i32 %31, ptr %33, align 4, !tbaa !18
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %30
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %36, %30
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.MMatrix, ptr %39, i32 0, i32 0
  store i32 %38, ptr %40, align 8, !tbaa !20
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %63

43:                                               ; preds = %37
  br label %44

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = icmp eq ptr %45, null
  br i1 %46, label %51, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = ptrtoint ptr %48 to i64
  %50 = icmp eq i64 %49, -1
  br label %51

51:                                               ; preds = %47, %44
  %52 = phi i1 [ true, %44 ], [ %50, %47 ]
  %53 = xor i1 %52, true
  %54 = zext i1 %53 to i32
  store i32 %54, ptr %11, align 4, !tbaa !5
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %51
  %58 = load i32, ptr %11, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %58, i32 noundef -1, ptr noundef @.str, i32 noundef 143, ptr noundef @__FUNCTION__.MatrixCreate, ptr noundef @.str.2)
  br label %59

59:                                               ; preds = %57, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %62, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %171

63:                                               ; preds = %37
  %64 = load ptr, ptr %7, align 8, !tbaa !9
  %65 = icmp eq ptr %64, null
  br i1 %65, label %75, label %66

66:                                               ; preds = %63
  %67 = load ptr, ptr %7, align 8, !tbaa !9
  %68 = ptrtoint ptr %67 to i64
  %69 = icmp eq i64 %68, -1
  br i1 %69, label %75, label %70

70:                                               ; preds = %66
  %71 = load ptr, ptr %7, align 8, !tbaa !9
  %72 = load ptr, ptr %8, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.MMatrix, ptr %72, i32 0, i32 2
  store ptr %71, ptr %73, align 8, !tbaa !21
  %74 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %74, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %171

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

88:                                               ; preds = %75
  br label %89

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

92:                                               ; preds = %89
  %93 = load ptr, ptr %7, 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 %13, align 4, !tbaa !5
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %96
  %103 = load i32, ptr %13, 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 158, ptr noundef @__FUNCTION__.MatrixCreate, ptr noundef @.str.2)
  br label %104

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

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %10, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %107, i32 0, i32 6
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = load i32, ptr %5, 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 %157

113:                                              ; preds = %75
  %114 = load ptr, ptr %10, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %114, i32 0, i32 7
  %116 = load ptr, ptr %115, align 8, !tbaa !24
  %117 = icmp eq ptr %116, null
  br i1 %117, label %118, label %128

118:                                              ; preds = %113
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = mul nsw i32 %119, %120
  %122 = sext i32 %121 to i64
  %123 = mul i64 %122, 4
  %124 = trunc i64 %123 to i32
  %125 = call ptr @mMemoryCreate(i32 noundef 1, i32 noundef %124, i32 noundef 0)
  %126 = load ptr, ptr %10, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %126, i32 0, i32 7
  store ptr %125, ptr %127, align 8, !tbaa !24
  br label %128

128:                                              ; preds = %118, %113
  br label %129

129:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %130 = load ptr, ptr %10, align 8, !tbaa !9
  %131 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %130, i32 0, i32 7
  %132 = load ptr, ptr %131, align 8, !tbaa !24
  %133 = getelementptr inbounds %struct.MList, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !25
  %135 = icmp ne i32 %134, 1
  %136 = zext i1 %135 to i32
  store i32 %136, ptr %14, align 4, !tbaa !5
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %141

139:                                              ; preds = %129
  %140 = load i32, ptr %14, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %140, i32 noundef -1, ptr noundef @.str, i32 noundef 164, ptr noundef @__FUNCTION__.MatrixCreate, ptr noundef @.str.9)
  br label %141

141:                                              ; preds = %139, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %10, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %144, i32 0, i32 7
  %146 = load ptr, ptr %145, align 8, !tbaa !24
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = mul i64 %149, 4
  %151 = trunc i64 %150 to i32
  %152 = load ptr, ptr %10, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %152, i32 0, i32 6
  call void @mMemoryIndex(ptr noundef %146, i32 noundef %147, i32 noundef %151, ptr noundef %153, i32 noundef 1)
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = load ptr, ptr %10, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %155, i32 0, i32 5
  store i32 %154, ptr %156, align 8, !tbaa !26
  br label %157

157:                                              ; preds = %143, %106
  %158 = load ptr, ptr %10, align 8, !tbaa !9
  %159 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %158, i32 0, i32 6
  %160 = load ptr, ptr %159, align 8, !tbaa !22
  %161 = load ptr, ptr %8, align 8, !tbaa !9
  %162 = getelementptr inbounds %struct.MMatrix, ptr %161, i32 0, i32 2
  store ptr %160, ptr %162, align 8, !tbaa !21
  br label %163

163:                                              ; preds = %157
  %164 = load ptr, ptr %8, align 8, !tbaa !9
  %165 = load ptr, ptr %10, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct.HandleMatrixCreate, ptr %165, i32 0, i32 7
  %167 = load ptr, ptr %166, align 8, !tbaa !24
  call void @m_PropertyFunction(ptr noundef %164, ptr noundef @.str.3, ptr noundef @mornMemoryDevice, ptr noundef %167)
  br label %168

168:                                              ; preds = %163
  br label %169

169:                                              ; preds = %168
  %170 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %170, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %171

171:                                              ; preds = %169, %70, %61
  call void @llvm.lifetime.end.p0(i64 8, 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
  %172 = load ptr, ptr %4, align 8
  ret ptr %172
}

declare ptr @m_Malloc(i32 noundef) #1

declare void @mMemoryIndex(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 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: write) }
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 = !{!"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, !10, i64 16}
!15 = !{!"MHandle", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16}
!16 = !{!17, !10, i64 0}
!17 = !{!"HandleMatrixCreate", !10, i64 0, !10, i64 8, !7, i64 16, !6, i64 80, !6, i64 84, !6, i64 88, !10, i64 96, !10, i64 104}
!18 = !{!19, !6, i64 4}
!19 = !{!"MMatrix", !6, i64 0, !6, i64 4, !10, i64 8}
!20 = !{!19, !6, i64 0}
!21 = !{!19, !10, i64 8}
!22 = !{!17, !10, i64 96}
!23 = !{!17, !6, i64 84}
!24 = !{!17, !10, i64 104}
!25 = !{!13, !6, i64 0}
!26 = !{!17, !6, i64 88}


; 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 [78 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__.MatrixCreate = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare ptr @ObjectAlloc(i32 noundef) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @MatrixCreate(i32 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = tail call ptr @ObjectAlloc(i32 noundef 16) #4
  %5 = getelementptr inbounds i8, ptr %4, i64 -4
  store i32 -460345994, ptr %5, align 4, !tbaa !5
  %6 = tail call ptr @GetHandle(ptr noundef %4, i32 noundef 112, i32 noundef -460345994, ptr noundef nonnull @endMatrixCreate) #4
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  store ptr %4, ptr %8, align 8, !tbaa !14
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
  %9 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %spec.store.select, ptr %9, align 4, !tbaa !16
  %spec.store.select3 = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
  store i32 %spec.store.select3, ptr %4, align 8, !tbaa !18
  %10 = icmp slt i32 %0, 1
  %magicptr = ptrtoint ptr %2 to i64
  br i1 %10, label %11, label %16

11:                                               ; preds = %3
  switch i64 %magicptr, label %12 [
    i64 -1, label %49
    i64 0, label %49
  ]

12:                                               ; preds = %11
  %13 = icmp ne ptr %2, null
  %14 = icmp ne ptr %2, inttoptr (i64 -1 to ptr)
  %.not55 = and i1 %13, %14
  %15 = zext i1 %.not55 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %15, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 143, ptr noundef nonnull @__FUNCTION__.MatrixCreate, ptr noundef nonnull @.str.2) #4
  br label %49

16:                                               ; preds = %3
  switch i64 %magicptr, label %17 [
    i64 -1, label %19
    i64 0, label %19
  ]

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %2, ptr %18, align 8, !tbaa !19
  br label %49

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

27:                                               ; preds = %19
  tail call void @llvm.memset.p0.i64(ptr align 8 %23, i8 0, i64 %21, i1 false)
  br label %44

28:                                               ; preds = %19
  %29 = getelementptr inbounds i8, ptr %8, i64 104
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %36

32:                                               ; preds = %28
  %33 = shl i32 %spec.store.select3, 2
  %34 = mul i32 %33, %spec.store.select
  %35 = tail call ptr @mMemoryCreate(i32 noundef 1, i32 noundef %34, i32 noundef 0) #4
  store ptr %35, ptr %29, align 8, !tbaa !22
  br label %36

36:                                               ; preds = %28, %32
  %37 = phi ptr [ %30, %28 ], [ %35, %32 ]
  %38 = load i32, ptr %37, align 8, !tbaa !23
  %.not = icmp eq i32 %38, 1
  br i1 %.not, label %40, label %39

39:                                               ; preds = %36
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 164, ptr noundef nonnull @__FUNCTION__.MatrixCreate, ptr noundef nonnull @.str.9) #4
  %.pre = load ptr, ptr %29, align 8, !tbaa !22
  br label %40

40:                                               ; preds = %39, %36
  %41 = phi ptr [ %.pre, %39 ], [ %37, %36 ]
  %42 = shl i32 %spec.store.select, 2
  tail call void @mMemoryIndex(ptr noundef %41, i32 noundef %spec.store.select3, i32 noundef %42, ptr noundef nonnull %24, i32 noundef 1) #4
  %43 = getelementptr inbounds i8, ptr %8, i64 88
  store i32 %spec.store.select, ptr %43, align 8, !tbaa !24
  br label %44

44:                                               ; preds = %40, %27
  %45 = load ptr, ptr %24, align 8, !tbaa !20
  %46 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %45, ptr %46, align 8, !tbaa !19
  %47 = getelementptr inbounds i8, ptr %8, i64 104
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  tail call void @m_PropertyFunction(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, ptr noundef nonnull @mornMemoryDevice, ptr noundef %48) #4
  br label %49

49:                                               ; preds = %12, %11, %11, %44, %17
  ret ptr %4
}

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #0

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

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

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: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !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, !11, i64 16}
!13 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!14 = !{!15, !11, i64 0}
!15 = !{!"HandleMatrixCreate", !11, i64 0, !11, i64 8, !9, i64 16, !8, i64 80, !8, i64 84, !8, i64 88, !11, i64 96, !11, i64 104}
!16 = !{!17, !8, i64 4}
!17 = !{!"MMatrix", !8, i64 0, !8, i64 4, !11, i64 8}
!18 = !{!17, !8, i64 0}
!19 = !{!17, !11, i64 8}
!20 = !{!15, !11, i64 96}
!21 = !{!15, !8, i64 84}
!22 = !{!15, !11, i64 104}
!23 = !{!7, !8, i64 0}
!24 = !{!15, !8, i64 88}


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