; LLVM IR from jingweizhanghuai/Morn :: src/image (morn_image)

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

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@__FUNCTION__.ImageCreate = 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 [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endImageCreate(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 @ImageCreate(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 i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = 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
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %25

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

25:                                               ; preds = %24, %4
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %29

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

29:                                               ; preds = %28, %25
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %32, label %33

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

33:                                               ; preds = %32, %29
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 4
  %37 = zext i1 %36 to i32
  store i32 %37, ptr %10, align 4, !tbaa !5
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %34
  %41 = load i32, ptr %10, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %41, i32 noundef -1, ptr noundef @.str, i32 noundef 45, ptr noundef @__FUNCTION__.ImageCreate, ptr noundef @.str.2)
  br label %42

42:                                               ; preds = %40, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %43

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %44 = call ptr @ObjectAlloc(i32 noundef 56)
  store ptr %44, ptr %11, align 8, !tbaa !9
  %45 = load ptr, ptr %11, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.HandleList, ptr %45, i64 -1
  %47 = getelementptr inbounds %struct.HandleList, ptr %46, i32 0, i32 4
  store i32 -860663930, ptr %47, align 4, !tbaa !11
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.MImage, ptr %49, i32 0, i32 1
  store i32 %48, ptr %50, align 4, !tbaa !14
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.MImage, ptr %52, i32 0, i32 2
  store i32 %51, ptr %53, align 8, !tbaa !16
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load ptr, ptr %11, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.MImage, ptr %55, i32 0, i32 0
  store i32 %54, ptr %56, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %57 = load ptr, ptr %11, align 8, !tbaa !9
  %58 = call ptr @GetHandle(ptr noundef %57, i32 noundef 168, i32 noundef -860663930, ptr noundef @endImageCreate)
  store ptr %58, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %59 = load ptr, ptr %12, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.MHandle, ptr %59, i32 0, i32 3
  %61 = load ptr, ptr %60, align 8, !tbaa !18
  store ptr %61, ptr %13, align 8, !tbaa !9
  %62 = load ptr, ptr %11, align 8, !tbaa !9
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.HandleImageCreate, ptr %63, i32 0, i32 0
  store ptr %62, ptr %64, align 8, !tbaa !20
  %65 = load ptr, ptr %11, align 8, !tbaa !9
  %66 = load ptr, ptr %13, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.HandleImageCreate, ptr %66, i32 0, i32 12
  call void @m_PropertyVariate(ptr noundef %65, ptr noundef @.str.3, ptr noundef %67, i32 noundef 4)
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %73

70:                                               ; preds = %43
  %71 = load ptr, ptr %13, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.HandleImageCreate, ptr %71, i32 0, i32 12
  store i32 1, ptr %72, align 8, !tbaa !22
  br label %90

73:                                               ; preds = %43
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 3
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load ptr, ptr %13, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.HandleImageCreate, ptr %77, i32 0, i32 12
  store i32 3, ptr %78, align 8, !tbaa !22
  br label %89

79:                                               ; preds = %73
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = icmp eq i32 %80, 4
  br i1 %81, label %82, label %85

82:                                               ; preds = %79
  %83 = load ptr, ptr %13, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.HandleImageCreate, ptr %83, i32 0, i32 12
  store i32 4, ptr %84, align 8, !tbaa !22
  br label %88

85:                                               ; preds = %79
  %86 = load ptr, ptr %13, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.HandleImageCreate, ptr %86, i32 0, i32 12
  store i32 -1, ptr %87, align 8, !tbaa !22
  br label %88

88:                                               ; preds = %85, %82
  br label %89

89:                                               ; preds = %88, %76
  br label %90

90:                                               ; preds = %89, %70
  %91 = load ptr, ptr %11, align 8, !tbaa !9
  %92 = load ptr, ptr %13, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.HandleImageCreate, ptr %92, i32 0, i32 13
  call void @m_PropertyVariate(ptr noundef %91, ptr noundef @.str.4, ptr noundef %93, i32 noundef 4)
  %94 = load ptr, ptr %13, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.HandleImageCreate, ptr %94, i32 0, i32 13
  store i32 -1, ptr %95, align 4, !tbaa !23
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %101, label %98

98:                                               ; preds = %90
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %121

101:                                              ; preds = %98, %90
  br label %102

102:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %103 = load ptr, ptr %9, align 8, !tbaa !9
  %104 = icmp eq ptr %103, null
  br i1 %104, label %109, label %105

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  %107 = ptrtoint ptr %106 to i64
  %108 = icmp eq i64 %107, -1
  br label %109

109:                                              ; preds = %105, %102
  %110 = phi i1 [ true, %102 ], [ %108, %105 ]
  %111 = xor i1 %110, true
  %112 = zext i1 %111 to i32
  store i32 %112, ptr %14, align 4, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %117

115:                                              ; preds = %109
  %116 = load i32, ptr %14, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %116, i32 noundef -1, ptr noundef @.str, i32 noundef 65, ptr noundef @__FUNCTION__.ImageCreate, ptr noundef @.str.2)
  br label %117

117:                                              ; preds = %115, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %120, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %300

121:                                              ; preds = %98
  %122 = load ptr, ptr %9, align 8, !tbaa !9
  %123 = icmp eq ptr %122, null
  br i1 %123, label %139, label %124

124:                                              ; preds = %121
  %125 = load ptr, ptr %9, align 8, !tbaa !9
  %126 = ptrtoint ptr %125 to i64
  %127 = icmp eq i64 %126, -1
  br i1 %127, label %139, label %128

128:                                              ; preds = %124
  %129 = load ptr, ptr %11, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.MImage, ptr %129, i32 0, i32 3
  %131 = getelementptr inbounds [4 x ptr], ptr %130, i64 0, i64 0
  %132 = load ptr, ptr %9, align 8, !tbaa !9
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = mul i64 %134, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 8 %132, i64 %135, i1 false)
  %136 = load ptr, ptr %13, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.HandleImageCreate, ptr %136, i32 0, i32 13
  store i32 5, ptr %137, align 4, !tbaa !23
  %138 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %138, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %300

139:                                              ; preds = %124, %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = add nsw i32 %140, 32
  store i32 %141, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = add nsw i32 %142, 16
  store i32 %143, ptr %17, align 4, !tbaa !5
  %144 = load i32, ptr %17, align 4, !tbaa !5
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = mul nsw i32 %144, %145
  %147 = sext i32 %146 to i64
  %148 = mul i64 %147, 8
  %149 = trunc i64 %148 to i32
  %150 = call ptr @m_Malloc(i32 noundef %149)
  %151 = load ptr, ptr %13, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.HandleImageCreate, ptr %151, i32 0, i32 7
  store ptr %150, ptr %152, align 8, !tbaa !24
  %153 = load i32, ptr %7, align 4, !tbaa !5
  %154 = load ptr, ptr %13, align 8, !tbaa !9
  %155 = getelementptr inbounds %struct.HandleImageCreate, ptr %154, i32 0, i32 5
  store i32 %153, ptr %155, align 8, !tbaa !25
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = load ptr, ptr %13, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct.HandleImageCreate, ptr %157, i32 0, i32 4
  store i32 %156, ptr %158, align 4, !tbaa !26
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %191

161:                                              ; preds = %139
  br label %162

162:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %163 = load ptr, ptr %9, align 8, !tbaa !9
  %164 = icmp eq ptr %163, null
  br i1 %164, label %169, label %165

165:                                              ; preds = %162
  %166 = load ptr, ptr %9, align 8, !tbaa !9
  %167 = ptrtoint ptr %166 to i64
  %168 = icmp eq i64 %167, -1
  br label %169

169:                                              ; preds = %165, %162
  %170 = phi i1 [ true, %162 ], [ %168, %165 ]
  %171 = xor i1 %170, true
  %172 = zext i1 %171 to i32
  store i32 %172, ptr %18, align 4, !tbaa !5
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %177

175:                                              ; preds = %169
  %176 = load i32, ptr %18, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %176, i32 noundef -1, ptr noundef @.str, i32 noundef 84, ptr noundef @__FUNCTION__.ImageCreate, ptr noundef @.str.2)
  br label %177

177:                                              ; preds = %175, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %13, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.HandleImageCreate, ptr %180, i32 0, i32 7
  %182 = load ptr, ptr %181, align 8, !tbaa !24
  %183 = load i32, ptr %17, align 4, !tbaa !5
  %184 = load i32, ptr %6, align 4, !tbaa !5
  %185 = mul nsw i32 %183, %184
  %186 = sext i32 %185 to i64
  %187 = mul i64 %186, 8
  call void @llvm.memset.p0.i64(ptr align 8 %182, i8 0, i64 %187, i1 false)
  %188 = load ptr, ptr %13, align 8, !tbaa !9
  %189 = getelementptr inbounds %struct.HandleImageCreate, ptr %188, i32 0, i32 13
  store i32 5, ptr %189, align 4, !tbaa !23
  %190 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %190, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %299

191:                                              ; preds = %139
  %192 = load ptr, ptr %13, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.HandleImageCreate, ptr %192, i32 0, i32 8
  %194 = load ptr, ptr %193, align 8, !tbaa !27
  %195 = icmp eq ptr %194, null
  br i1 %195, label %196, label %208

196:                                              ; preds = %191
  %197 = load i32, ptr %6, align 4, !tbaa !5
  %198 = load i32, ptr %17, align 4, !tbaa !5
  %199 = mul nsw i32 %197, %198
  %200 = load i32, ptr %16, align 4, !tbaa !5
  %201 = mul nsw i32 %199, %200
  %202 = sext i32 %201 to i64
  %203 = mul i64 %202, 1
  %204 = trunc i64 %203 to i32
  %205 = call ptr @mMemoryCreate(i32 noundef 1, i32 noundef %204, i32 noundef 0)
  %206 = load ptr, ptr %13, align 8, !tbaa !9
  %207 = getelementptr inbounds %struct.HandleImageCreate, ptr %206, i32 0, i32 8
  store ptr %205, ptr %207, align 8, !tbaa !27
  br label %208

208:                                              ; preds = %196, %191
  br label %209

209:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %210 = load ptr, ptr %13, align 8, !tbaa !9
  %211 = getelementptr inbounds %struct.HandleImageCreate, ptr %210, i32 0, i32 8
  %212 = load ptr, ptr %211, align 8, !tbaa !27
  %213 = getelementptr inbounds %struct.MList, ptr %212, i32 0, i32 0
  %214 = load i32, ptr %213, align 8, !tbaa !28
  %215 = icmp ne i32 %214, 1
  %216 = zext i1 %215 to i32
  store i32 %216, ptr %19, align 4, !tbaa !5
  %217 = load i32, ptr %19, align 4, !tbaa !5
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %221

219:                                              ; preds = %209
  %220 = load i32, ptr %19, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %220, i32 noundef -1, ptr noundef @.str, i32 noundef 91, ptr noundef @__FUNCTION__.ImageCreate, ptr noundef @.str.5)
  br label %221

221:                                              ; preds = %219, %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %222

222:                                              ; preds = %221
  br label %223

223:                                              ; preds = %222
  %224 = load ptr, ptr %13, align 8, !tbaa !9
  %225 = getelementptr inbounds %struct.HandleImageCreate, ptr %224, i32 0, i32 8
  %226 = load ptr, ptr %225, align 8, !tbaa !27
  %227 = load i32, ptr %6, align 4, !tbaa !5
  %228 = load i32, ptr %17, align 4, !tbaa !5
  %229 = mul nsw i32 %227, %228
  %230 = load i32, ptr %16, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = mul i64 %231, 1
  %233 = trunc i64 %232 to i32
  %234 = load ptr, ptr %13, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.HandleImageCreate, ptr %234, i32 0, i32 7
  call void @mMemoryIndex(ptr noundef %226, i32 noundef %229, i32 noundef %233, ptr noundef %235, i32 noundef 1)
  %236 = load i32, ptr %8, align 4, !tbaa !5
  %237 = load ptr, ptr %13, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.HandleImageCreate, ptr %237, i32 0, i32 6
  store i32 %236, ptr %238, align 4, !tbaa !29
  br label %239

239:                                              ; preds = %223
  %240 = load ptr, ptr %11, align 8, !tbaa !9
  %241 = load ptr, ptr %13, align 8, !tbaa !9
  %242 = getelementptr inbounds %struct.HandleImageCreate, ptr %241, i32 0, i32 8
  %243 = load ptr, ptr %242, align 8, !tbaa !27
  call void @m_PropertyFunction(ptr noundef %240, ptr noundef @.str.6, ptr noundef @mornMemoryDevice, ptr noundef %243)
  br label %244

244:                                              ; preds = %239
  br label %245

245:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %246

246:                                              ; preds = %268, %245
  %247 = load i32, ptr %20, align 4, !tbaa !5
  %248 = load i32, ptr %6, align 4, !tbaa !5
  %249 = load i32, ptr %17, align 4, !tbaa !5
  %250 = mul nsw i32 %248, %249
  %251 = icmp slt i32 %247, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %246
  store i32 12, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %271

253:                                              ; preds = %246
  %254 = load ptr, ptr %13, align 8, !tbaa !9
  %255 = getelementptr inbounds %struct.HandleImageCreate, ptr %254, i32 0, i32 7
  %256 = load ptr, ptr %255, align 8, !tbaa !24
  %257 = load i32, ptr %20, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds ptr, ptr %256, i64 %258
  %260 = load ptr, ptr %259, align 8, !tbaa !9
  %261 = getelementptr inbounds i8, ptr %260, i64 16
  %262 = load ptr, ptr %13, align 8, !tbaa !9
  %263 = getelementptr inbounds %struct.HandleImageCreate, ptr %262, i32 0, i32 7
  %264 = load ptr, ptr %263, align 8, !tbaa !24
  %265 = load i32, ptr %20, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds ptr, ptr %264, i64 %266
  store ptr %261, ptr %267, align 8, !tbaa !9
  br label %268

268:                                              ; preds = %253
  %269 = load i32, ptr %20, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %20, align 4, !tbaa !5
  br label %246, !llvm.loop !30

271:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %292, %271
  %273 = load i32, ptr %21, align 4, !tbaa !5
  %274 = load i32, ptr %6, align 4, !tbaa !5
  %275 = icmp slt i32 %273, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %272
  store i32 15, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %295

277:                                              ; preds = %272
  %278 = load ptr, ptr %13, align 8, !tbaa !9
  %279 = getelementptr inbounds %struct.HandleImageCreate, ptr %278, i32 0, i32 7
  %280 = load ptr, ptr %279, align 8, !tbaa !24
  %281 = load i32, ptr %21, align 4, !tbaa !5
  %282 = load i32, ptr %17, align 4, !tbaa !5
  %283 = mul nsw i32 %281, %282
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds ptr, ptr %280, i64 %284
  %286 = getelementptr inbounds ptr, ptr %285, i64 8
  %287 = load ptr, ptr %11, align 8, !tbaa !9
  %288 = getelementptr inbounds %struct.MImage, ptr %287, i32 0, i32 3
  %289 = load i32, ptr %21, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [4 x ptr], ptr %288, i64 0, i64 %290
  store ptr %286, ptr %291, align 8, !tbaa !9
  br label %292

292:                                              ; preds = %277
  %293 = load i32, ptr %21, align 4, !tbaa !5
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %21, align 4, !tbaa !5
  br label %272, !llvm.loop !32

295:                                              ; preds = %276
  %296 = load ptr, ptr %13, align 8, !tbaa !9
  %297 = getelementptr inbounds %struct.HandleImageCreate, ptr %296, i32 0, i32 13
  store i32 -1, ptr %297, align 4, !tbaa !23
  %298 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %298, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %299

299:                                              ; preds = %295, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %300

300:                                              ; preds = %299, %128, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %301 = load ptr, ptr %5, align 8
  ret ptr %301
}

declare ptr @ObjectAlloc(i32 noundef) #2

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

declare void @m_PropertyVariate(ptr noundef, ptr noundef, ptr noundef, 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 @m_Malloc(i32 noundef) #2

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

declare void @mMemoryIndex(ptr noundef, i32 noundef, i32 noundef, ptr 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 = !{!"MImage", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 16, !10, i64 48}
!16 = !{!15, !6, i64 8}
!17 = !{!15, !6, i64 0}
!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 = !{!"HandleImageCreate", !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, !10, i64 112, !10, i64 120, !7, i64 128, !6, i64 160, !6, i64 164}
!22 = !{!21, !6, i64 160}
!23 = !{!21, !6, i64 164}
!24 = !{!21, !10, i64 96}
!25 = !{!21, !6, i64 88}
!26 = !{!21, !6, i64 84}
!27 = !{!21, !10, i64 104}
!28 = !{!13, !6, i64 0}
!29 = !{!21, !6, i64 92}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


; 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
@__FUNCTION__.ImageCreate = 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 [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@switch.table.ImageCreate = private unnamed_addr constant [4 x i32] [i32 1, i32 -1, i32 3, i32 4], align 4

; Function Attrs: nounwind uwtable
declare dso_local void @endImageCreate(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 @ImageCreate(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
  %spec.store.select6 = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %2, i32 0)
  %5 = icmp sgt i32 %0, 4
  br i1 %5, label %6, label %7

6:                                                ; preds = %4
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 45, ptr noundef nonnull @__FUNCTION__.ImageCreate, ptr noundef nonnull @.str.2) #5
  br label %7

7:                                                ; preds = %6, %4
  %8 = tail call ptr @ObjectAlloc(i32 noundef 56) #5
  %9 = getelementptr inbounds i8, ptr %8, i64 -4
  store i32 -860663930, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 %spec.store.select6, ptr %10, align 4, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %spec.store.select1, ptr %11, align 8, !tbaa !14
  store i32 %spec.store.select, ptr %8, align 8, !tbaa !15
  %12 = tail call ptr @GetHandle(ptr noundef nonnull %8, i32 noundef 168, i32 noundef -860663930, ptr noundef nonnull @endImageCreate) #5
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  store ptr %8, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %14, i64 160
  tail call void @m_PropertyVariate(ptr noundef nonnull %8, ptr noundef nonnull @.str.3, ptr noundef nonnull %15, i32 noundef 4) #5
  %switch.tableidx = add i32 %0, -1
  %16 = icmp ult i32 %switch.tableidx, 4
  br i1 %16, label %switch.lookup, label %18

switch.lookup:                                    ; preds = %7
  %17 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [4 x i32], ptr @switch.table.ImageCreate, i64 0, i64 %17
  %switch.load = load i32, ptr %switch.gep, align 4
  br label %18

18:                                               ; preds = %7, %switch.lookup
  %.sink = phi i32 [ %switch.load, %switch.lookup ], [ -1, %7 ]
  store i32 %.sink, ptr %15, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %14, i64 164
  tail call void @m_PropertyVariate(ptr noundef nonnull %8, ptr noundef nonnull @.str.4, ptr noundef nonnull %19, i32 noundef 4) #5
  store i32 -1, ptr %19, align 4, !tbaa !21
  %20 = icmp slt i32 %0, 1
  %21 = icmp slt i32 %1, 1
  %or.cond = or i1 %20, %21
  %magicptr = ptrtoint ptr %3 to i64
  br i1 %or.cond, label %22, label %27

22:                                               ; preds = %18
  switch i64 %magicptr, label %23 [
    i64 -1, label %118
    i64 0, label %118
  ]

23:                                               ; preds = %22
  %24 = icmp ne ptr %3, null
  %25 = icmp ne ptr %3, inttoptr (i64 -1 to ptr)
  %.not107 = and i1 %24, %25
  %26 = zext i1 %.not107 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %26, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 65, ptr noundef nonnull @__FUNCTION__.ImageCreate, ptr noundef nonnull @.str.2) #5
  br label %118

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

28:                                               ; preds = %27
  %29 = getelementptr inbounds i8, ptr %8, i64 16
  %30 = zext nneg i32 %spec.store.select to i64
  %31 = shl nuw nsw i64 %30, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %29, ptr align 8 %3, i64 %31, i1 false)
  store i32 5, ptr %19, align 4, !tbaa !21
  br label %118

32:                                               ; preds = %27, %27
  %33 = add nuw nsw i32 %spec.store.select1, 32
  %34 = add nuw nsw i32 %spec.store.select6, 16
  %35 = mul nuw nsw i32 %34, %spec.store.select
  %36 = zext nneg i32 %35 to i64
  %37 = shl nuw nsw i64 %36, 3
  %38 = trunc i64 %37 to i32
  %39 = tail call ptr @m_Malloc(i32 noundef %38) #5
  %40 = getelementptr inbounds i8, ptr %14, i64 96
  store ptr %39, ptr %40, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %14, i64 88
  store i32 %spec.store.select6, ptr %41, align 8, !tbaa !23
  %42 = getelementptr inbounds i8, ptr %14, i64 84
  store i32 %spec.store.select, ptr %42, align 4, !tbaa !24
  %43 = icmp slt i32 %2, 1
  br i1 %43, label %44, label %45

44:                                               ; preds = %32
  tail call void @llvm.memset.p0.i64(ptr align 8 %39, i8 0, i64 %37, i1 false)
  br label %.loopexit

45:                                               ; preds = %32
  %46 = getelementptr inbounds i8, ptr %14, i64 104
  %47 = load ptr, ptr %46, align 8, !tbaa !25
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %52

49:                                               ; preds = %45
  %50 = mul nuw nsw i32 %35, %33
  %51 = tail call ptr @mMemoryCreate(i32 noundef 1, i32 noundef %50, i32 noundef 0) #5
  store ptr %51, ptr %46, align 8, !tbaa !25
  br label %52

52:                                               ; preds = %45, %49
  %53 = phi ptr [ %47, %45 ], [ %51, %49 ]
  %54 = load i32, ptr %53, align 8, !tbaa !26
  %.not = icmp eq i32 %54, 1
  br i1 %.not, label %.lr.ph.preheader, label %55

55:                                               ; preds = %52
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 91, ptr noundef nonnull @__FUNCTION__.ImageCreate, ptr noundef nonnull @.str.5) #5
  %.pre = load ptr, ptr %46, align 8, !tbaa !25
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %52, %55
  %56 = phi ptr [ %.pre, %55 ], [ %53, %52 ]
  tail call void @mMemoryIndex(ptr noundef %56, i32 noundef %35, i32 noundef %33, ptr noundef nonnull %40, i32 noundef 1) #5
  %57 = getelementptr inbounds i8, ptr %14, i64 92
  store i32 %spec.store.select1, ptr %57, align 4, !tbaa !27
  %58 = load ptr, ptr %46, align 8, !tbaa !25
  tail call void @m_PropertyFunction(ptr noundef nonnull %8, ptr noundef nonnull @.str.6, ptr noundef nonnull @mornMemoryDevice, ptr noundef %58) #5
  %umax = tail call i32 @llvm.umax.i32(i32 %35, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %59 = icmp ult i32 %35, 4
  br i1 %59, label %.preheader.unr-lcssa, label %.lr.ph.preheader.new

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

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

.lr.ph.epil:                                      ; preds = %.preheader.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader.unr-lcssa ]
  %60 = load ptr, ptr %40, align 8, !tbaa !22
  %61 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv.epil
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  store ptr %63, ptr %61, align 8, !tbaa !28
  %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 %.preheader, label %.lr.ph.epil, !llvm.loop !29

.preheader:                                       ; preds = %.lr.ph.epil, %.preheader.unr-lcssa
  %64 = icmp sgt i32 %0, 0
  br i1 %64, label %.lr.ph111, label %.loopexit

.lr.ph111:                                        ; preds = %.preheader
  %65 = getelementptr inbounds i8, ptr %8, i64 16
  %66 = zext nneg i32 %34 to i64
  %wide.trip.count117 = zext nneg i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 10
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph111
  %indvars.iv114.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph111 ], [ %n.vec, %middle.block ]
  %xtraiter125 = and i64 %wide.trip.count117, 3
  %lcmp.mod126.not = icmp eq i64 %xtraiter125, 0
  br i1 %lcmp.mod126.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv114.prol = phi i64 [ %indvars.iv.next115.prol, %scalar.ph.prol ], [ %indvars.iv114.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %67 = load ptr, ptr %40, align 8, !tbaa !22
  %68 = mul nuw nsw i64 %indvars.iv114.prol, %66
  %69 = getelementptr inbounds ptr, ptr %67, i64 %68
  %70 = getelementptr inbounds i8, ptr %69, i64 64
  %71 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %indvars.iv114.prol
  store ptr %70, ptr %71, align 8, !tbaa !28
  %indvars.iv.next115.prol = add nuw nsw i64 %indvars.iv114.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter125
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !31

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv114.unr = phi i64 [ %indvars.iv114.ph, %scalar.ph.preheader ], [ %indvars.iv.next115.prol, %scalar.ph.prol ]
  %72 = sub nsw i64 %indvars.iv114.ph, %wide.trip.count117
  %73 = icmp ugt i64 %72, -4
  br i1 %73, label %.loopexit, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph111
  %74 = shl nuw nsw i64 %wide.trip.count117, 3
  %75 = getelementptr i8, ptr %8, i64 %74
  %scevgep = getelementptr i8, ptr %75, i64 16
  %scevgep119 = getelementptr i8, ptr %14, i64 104
  %bound0 = icmp ult ptr %65, %scevgep119
  %bound1 = icmp ult ptr %40, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count117, 2147483644
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %66, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %76 = load ptr, ptr %40, align 8, !tbaa !22, !alias.scope !32
  %broadcast.splatinsert123 = insertelement <2 x ptr> poison, ptr %76, i64 0
  %broadcast.splat124 = shufflevector <2 x ptr> %broadcast.splatinsert123, <2 x ptr> poison, <2 x i32> zeroinitializer
  %invariant.gep = getelementptr i8, <2 x ptr> %broadcast.splat124, i64 64
  %invariant.gep127 = getelementptr i8, <2 x ptr> %broadcast.splat124, i64 64
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %77 = mul nuw nsw <2 x i64> %vec.ind, %broadcast.splat
  %78 = mul nuw nsw <2 x i64> %step.add, %broadcast.splat
  %gep = getelementptr ptr, <2 x ptr> %invariant.gep, <2 x i64> %77
  %gep128 = getelementptr ptr, <2 x ptr> %invariant.gep127, <2 x i64> %78
  %79 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %index
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  store <2 x ptr> %gep, ptr %79, align 8, !tbaa !28, !alias.scope !35, !noalias !32
  store <2 x ptr> %gep128, ptr %80, align 8, !tbaa !28, !alias.scope !35, !noalias !32
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !37

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count117
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %82 = load ptr, ptr %40, align 8, !tbaa !22
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  store ptr %85, ptr %83, align 8, !tbaa !28
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %86 = load ptr, ptr %40, align 8, !tbaa !22
  %87 = getelementptr inbounds ptr, ptr %86, i64 %indvars.iv.next
  %88 = load ptr, ptr %87, align 8, !tbaa !28
  %89 = getelementptr inbounds i8, ptr %88, i64 16
  store ptr %89, ptr %87, align 8, !tbaa !28
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %90 = load ptr, ptr %40, align 8, !tbaa !22
  %91 = getelementptr inbounds ptr, ptr %90, i64 %indvars.iv.next.1
  %92 = load ptr, ptr %91, align 8, !tbaa !28
  %93 = getelementptr inbounds i8, ptr %92, i64 16
  store ptr %93, ptr %91, align 8, !tbaa !28
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %94 = load ptr, ptr %40, align 8, !tbaa !22
  %95 = getelementptr inbounds ptr, ptr %94, i64 %indvars.iv.next.2
  %96 = load ptr, ptr %95, align 8, !tbaa !28
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  store ptr %97, ptr %95, align 8, !tbaa !28
  %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 %.preheader.unr-lcssa, label %.lr.ph, !llvm.loop !41

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv114 = phi i64 [ %indvars.iv.next115.3, %scalar.ph ], [ %indvars.iv114.unr, %scalar.ph.prol.loopexit ]
  %98 = load ptr, ptr %40, align 8, !tbaa !22
  %99 = mul nuw nsw i64 %indvars.iv114, %66
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  %101 = getelementptr inbounds i8, ptr %100, i64 64
  %102 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %indvars.iv114
  store ptr %101, ptr %102, align 8, !tbaa !28
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %103 = load ptr, ptr %40, align 8, !tbaa !22
  %104 = mul nuw nsw i64 %indvars.iv.next115, %66
  %105 = getelementptr inbounds ptr, ptr %103, i64 %104
  %106 = getelementptr inbounds i8, ptr %105, i64 64
  %107 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %indvars.iv.next115
  store ptr %106, ptr %107, align 8, !tbaa !28
  %indvars.iv.next115.1 = add nuw nsw i64 %indvars.iv114, 2
  %108 = load ptr, ptr %40, align 8, !tbaa !22
  %109 = mul nuw nsw i64 %indvars.iv.next115.1, %66
  %110 = getelementptr inbounds ptr, ptr %108, i64 %109
  %111 = getelementptr inbounds i8, ptr %110, i64 64
  %112 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %indvars.iv.next115.1
  store ptr %111, ptr %112, align 8, !tbaa !28
  %indvars.iv.next115.2 = add nuw nsw i64 %indvars.iv114, 3
  %113 = load ptr, ptr %40, align 8, !tbaa !22
  %114 = mul nuw nsw i64 %indvars.iv.next115.2, %66
  %115 = getelementptr inbounds ptr, ptr %113, i64 %114
  %116 = getelementptr inbounds i8, ptr %115, i64 64
  %117 = getelementptr inbounds [4 x ptr], ptr %65, i64 0, i64 %indvars.iv.next115.2
  store ptr %116, ptr %117, align 8, !tbaa !28
  %indvars.iv.next115.3 = add nuw nsw i64 %indvars.iv114, 4
  %exitcond118.not.3 = icmp eq i64 %indvars.iv.next115.3, %wide.trip.count117
  br i1 %exitcond118.not.3, label %.loopexit, label %scalar.ph, !llvm.loop !42

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.preheader, %44
  %storemerge = phi i32 [ 5, %44 ], [ -1, %.preheader ], [ -1, %middle.block ], [ -1, %scalar.ph ], [ -1, %scalar.ph.prol.loopexit ]
  store i32 %storemerge, ptr %19, align 4, !tbaa !21
  br label %118

118:                                              ; preds = %23, %22, %22, %.loopexit, %28
  ret ptr %8
}

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

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

declare void @mMemoryIndex(ptr noundef, i32 noundef, i32 noundef, ptr 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.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 = !{!"MImage", !8, i64 0, !8, i64 4, !8, i64 8, !9, i64 16, !11, i64 48}
!14 = !{!13, !8, i64 8}
!15 = !{!13, !8, i64 0}
!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 = !{!"HandleImageCreate", !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, !11, i64 112, !11, i64 120, !9, i64 128, !8, i64 160, !8, i64 164}
!20 = !{!19, !8, i64 160}
!21 = !{!19, !8, i64 164}
!22 = !{!19, !11, i64 96}
!23 = !{!19, !8, i64 88}
!24 = !{!19, !8, i64 84}
!25 = !{!19, !11, i64 104}
!26 = !{!7, !8, i64 0}
!27 = !{!19, !8, i64 92}
!28 = !{!11, !11, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.unroll.disable"}
!31 = distinct !{!31, !30}
!32 = !{!33}
!33 = distinct !{!33, !34}
!34 = distinct !{!34, !"LVerDomain"}
!35 = !{!36}
!36 = distinct !{!36, !34}
!37 = distinct !{!37, !38, !39, !40}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!"llvm.loop.isvectorized", i32 1}
!40 = !{!"llvm.loop.unroll.runtime.disable"}
!41 = distinct !{!41, !38}
!42 = distinct !{!42, !38, !39}


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