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

; 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.MImage = type { i32, i32, i32, [4 x ptr], ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleImageCoordinateTransform = type { i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.MTable = type { i32, i32, i32, %union.anon }
%union.anon = type { ptr }

@.str = external hidden unnamed_addr constant [88 x i8], align 1
@__FUNCTION__.mImageCoordinateTransform = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mImageCoordinateTransform(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.MImage, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %35, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = ptrtoint ptr %32 to i64
  %34 = icmp eq i64 %33, -1
  br i1 %34, label %35, label %36

35:                                               ; preds = %31, %28
  br label %65

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.MImage, ptr %37, i32 0, i32 3
  %39 = getelementptr inbounds [4 x ptr], ptr %38, i64 0, i64 0
  %40 = icmp eq ptr %39, null
  br i1 %40, label %62, label %41

41:                                               ; preds = %36
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.MImage, ptr %42, i32 0, i32 3
  %44 = getelementptr inbounds [4 x ptr], ptr %43, i64 0, i64 0
  %45 = ptrtoint ptr %44 to i64
  %46 = icmp eq i64 %45, -1
  br i1 %46, label %62, label %47

47:                                               ; preds = %41
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.MImage, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !11
  %51 = icmp sle i32 %50, 0
  br i1 %51, label %62, label %52

52:                                               ; preds = %47
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.MImage, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !13
  %56 = icmp sle i32 %55, 0
  br i1 %56, label %62, label %57

57:                                               ; preds = %52
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MImage, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !14
  %61 = icmp sle i32 %60, 0
  br label %62

62:                                               ; preds = %57, %52, %47, %41, %36
  %63 = phi i1 [ true, %52 ], [ true, %47 ], [ true, %41 ], [ true, %36 ], [ %61, %57 ]
  %64 = zext i1 %63 to i32
  br label %65

65:                                               ; preds = %62, %35
  %66 = phi i32 [ 1, %35 ], [ %64, %62 ]
  store i32 %66, ptr %13, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %65
  %70 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %70, i32 noundef -1, ptr noundef @.str, i32 noundef 183, ptr noundef @__FUNCTION__.mImageCoordinateTransform, ptr noundef @.str.1)
  br label %71

71:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %73, ptr %14, align 8, !tbaa !5
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %84, label %76

76:                                               ; preds = %72
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = ptrtoint ptr %77 to i64
  %79 = icmp eq i64 %78, -1
  br i1 %79, label %84, label %80

80:                                               ; preds = %76
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = icmp eq ptr %81, %82
  br i1 %83, label %84, label %96

84:                                               ; preds = %80, %76, %72
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.MImage, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !11
  %88 = add nsw i32 %87, 0
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.MImage, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !13
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MImage, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 8, !tbaa !14
  %95 = call ptr @ImageCreate(i32 noundef %88, i32 noundef %91, i32 noundef %94, ptr noundef null)
  store ptr %95, ptr %8, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %84, %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MImage, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !14
  %100 = icmp sle i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %96
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.MImage, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 8, !tbaa !14
  store i32 %104, ptr %15, align 4, !tbaa !9
  br label %109

105:                                              ; preds = %96
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.MImage, ptr %106, i32 0, i32 2
  %108 = load i32, ptr %107, align 8, !tbaa !14
  store i32 %108, ptr %15, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %105, %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MImage, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !13
  %113 = icmp sle i32 %112, 0
  br i1 %113, label %114, label %118

114:                                              ; preds = %109
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.MImage, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !13
  store i32 %117, ptr %16, align 4, !tbaa !9
  br label %122

118:                                              ; preds = %109
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MImage, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !13
  store i32 %121, ptr %16, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %118, %114
  br label %123

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 4, ptr %17, align 4, !tbaa !9
  %124 = load i32, ptr %17, align 4, !tbaa !9
  %125 = icmp eq i32 %124, 2
  br i1 %125, label %126, label %136

126:                                              ; preds = %123
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.MImage, ptr %128, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !11
  %131 = add nsw i32 %130, 0
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.MImage, ptr %133, i32 0, i32 3
  %135 = getelementptr inbounds [4 x ptr], ptr %134, i64 0, i64 0
  call void @ImageRedefine(ptr noundef %127, i32 noundef -1, i32 noundef %131, i32 noundef %132, ptr noundef %135)
  br label %175

136:                                              ; preds = %123
  %137 = load i32, ptr %17, align 4, !tbaa !9
  %138 = icmp eq i32 %137, 3
  br i1 %138, label %139, label %150

139:                                              ; preds = %136
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.MImage, ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 8, !tbaa !11
  %144 = add nsw i32 %143, 0
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = load i32, ptr %15, align 4, !tbaa !9
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.MImage, ptr %147, i32 0, i32 3
  %149 = getelementptr inbounds [4 x ptr], ptr %148, i64 0, i64 0
  call void @ImageRedefine(ptr noundef %140, i32 noundef %144, i32 noundef %145, i32 noundef %146, ptr noundef %149)
  br label %174

150:                                              ; preds = %136
  %151 = load i32, ptr %17, align 4, !tbaa !9
  %152 = icmp eq i32 %151, 4
  br i1 %152, label %153, label %164

153:                                              ; preds = %150
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.MImage, ptr %155, i32 0, i32 0
  %157 = load i32, ptr %156, align 8, !tbaa !11
  %158 = add nsw i32 %157, 0
  %159 = load i32, ptr %16, align 4, !tbaa !9
  %160 = load i32, ptr %15, align 4, !tbaa !9
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.MImage, ptr %161, i32 0, i32 3
  %163 = getelementptr inbounds [4 x ptr], ptr %162, i64 0, i64 0
  call void @ImageRedefine(ptr noundef %154, i32 noundef %158, i32 noundef %159, i32 noundef %160, ptr noundef %163)
  br label %173

164:                                              ; preds = %150
  br label %165

165:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 1, ptr %18, align 4, !tbaa !9
  %166 = load i32, ptr %18, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %165
  %169 = load i32, ptr %18, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %169, i32 noundef -1, ptr noundef @.str, i32 noundef 190, ptr noundef @__FUNCTION__.mImageCoordinateTransform, ptr noundef @.str.2)
  br label %170

170:                                              ; preds = %168, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172, %153
  br label %174

174:                                              ; preds = %173, %139
  br label %175

175:                                              ; preds = %174, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = call ptr @GetHandle(ptr noundef %178, i32 noundef 48, i32 noundef 1598343100, ptr noundef @endImageCoordinateTransform)
  store ptr %179, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %180 = load ptr, ptr %19, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.MHandle, ptr %180, i32 0, i32 3
  %182 = load ptr, ptr %181, align 8, !tbaa !15
  store ptr %182, ptr %20, align 8, !tbaa !5
  %183 = load ptr, ptr %19, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.MHandle, ptr %183, i32 0, i32 1
  %185 = load volatile i32, ptr %184, align 4, !tbaa !17
  %186 = icmp eq i32 %185, 0
  br i1 %186, label %211, label %187

187:                                              ; preds = %177
  %188 = load ptr, ptr %20, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %188, i32 0, i32 0
  %190 = load i32, ptr %189, align 8, !tbaa !18
  %191 = load i32, ptr %16, align 4, !tbaa !9
  %192 = icmp ne i32 %190, %191
  br i1 %192, label %211, label %193

193:                                              ; preds = %187
  %194 = load ptr, ptr %20, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !20
  %197 = load i32, ptr %15, align 4, !tbaa !9
  %198 = icmp ne i32 %196, %197
  br i1 %198, label %211, label %199

199:                                              ; preds = %193
  %200 = load ptr, ptr %20, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !21
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = icmp ne ptr %202, %203
  br i1 %204, label %211, label %205

205:                                              ; preds = %199
  %206 = load ptr, ptr %20, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !22
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = icmp ne ptr %208, %209
  br i1 %210, label %211, label %396

211:                                              ; preds = %205, %199, %193, %187, %177
  %212 = load i32, ptr %16, align 4, !tbaa !9
  %213 = load ptr, ptr %20, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %213, i32 0, i32 0
  store i32 %212, ptr %214, align 8, !tbaa !18
  %215 = load i32, ptr %15, align 4, !tbaa !9
  %216 = load ptr, ptr %20, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %216, i32 0, i32 1
  store i32 %215, ptr %217, align 4, !tbaa !20
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = load ptr, ptr %20, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %219, i32 0, i32 2
  store ptr %218, ptr %220, align 8, !tbaa !21
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = load ptr, ptr %20, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %222, i32 0, i32 3
  store ptr %221, ptr %223, align 8, !tbaa !22
  %224 = load ptr, ptr %20, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %224, i32 0, i32 4
  %226 = load ptr, ptr %225, align 8, !tbaa !23
  %227 = icmp eq ptr %226, null
  br i1 %227, label %228, label %235

228:                                              ; preds = %211
  %229 = load i32, ptr %16, align 4, !tbaa !9
  %230 = add nsw i32 %229, 0
  %231 = load i32, ptr %15, align 4, !tbaa !9
  %232 = call ptr @TableCreate(i32 noundef %230, i32 noundef %231, i32 noundef 2, ptr noundef null)
  %233 = load ptr, ptr %20, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %233, i32 0, i32 4
  store ptr %232, ptr %234, align 8, !tbaa !23
  br label %276

235:                                              ; preds = %211
  br label %236

236:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 5, ptr %21, align 4, !tbaa !9
  br label %237

237:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %238 = load i32, ptr %21, align 4, !tbaa !9
  %239 = icmp eq i32 %238, 0
  br i1 %239, label %243, label %240

240:                                              ; preds = %237
  %241 = load i32, ptr %21, align 4, !tbaa !9
  %242 = icmp eq i32 %241, 2
  br label %243

243:                                              ; preds = %240, %237
  %244 = phi i1 [ true, %237 ], [ %242, %240 ]
  %245 = zext i1 %244 to i32
  store i32 %245, ptr %22, align 4, !tbaa !9
  %246 = load i32, ptr %22, align 4, !tbaa !9
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %250

248:                                              ; preds = %243
  %249 = load i32, ptr %22, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %249, i32 noundef -1, ptr noundef @.str, i32 noundef 204, ptr noundef @__FUNCTION__.mImageCoordinateTransform, ptr noundef @.str.3)
  br label %250

250:                                              ; preds = %248, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251
  %253 = load i32, ptr %21, align 4, !tbaa !9
  %254 = icmp eq i32 %253, 3
  br i1 %254, label %255, label %262

255:                                              ; preds = %252
  %256 = load ptr, ptr %20, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %256, i32 0, i32 4
  %258 = load ptr, ptr %257, align 8, !tbaa !23
  %259 = getelementptr inbounds %struct.MTable, ptr %258, i64 0
  %260 = load i32, ptr %16, align 4, !tbaa !9
  %261 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %259, i32 noundef %260, i32 noundef %261, i32 noundef -1, ptr noundef null)
  br label %273

262:                                              ; preds = %252
  %263 = load i32, ptr %21, align 4, !tbaa !9
  %264 = icmp sge i32 %263, 4
  br i1 %264, label %265, label %272

265:                                              ; preds = %262
  %266 = load ptr, ptr %20, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %266, i32 0, i32 4
  %268 = load ptr, ptr %267, align 8, !tbaa !23
  %269 = getelementptr inbounds %struct.MTable, ptr %268, i64 0
  %270 = load i32, ptr %16, align 4, !tbaa !9
  %271 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %269, i32 noundef %270, i32 noundef %271, i32 noundef 2, ptr noundef null)
  br label %272

272:                                              ; preds = %265, %262
  br label %273

273:                                              ; preds = %272, %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %274

274:                                              ; preds = %273
  br label %275

275:                                              ; preds = %274
  br label %276

276:                                              ; preds = %275, %228
  %277 = load ptr, ptr %20, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %277, i32 0, i32 5
  %279 = load ptr, ptr %278, align 8, !tbaa !24
  %280 = icmp eq ptr %279, null
  br i1 %280, label %281, label %288

281:                                              ; preds = %276
  %282 = load i32, ptr %16, align 4, !tbaa !9
  %283 = add nsw i32 %282, 0
  %284 = load i32, ptr %15, align 4, !tbaa !9
  %285 = call ptr @TableCreate(i32 noundef %283, i32 noundef %284, i32 noundef 2, ptr noundef null)
  %286 = load ptr, ptr %20, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %286, i32 0, i32 5
  store ptr %285, ptr %287, align 8, !tbaa !24
  br label %329

288:                                              ; preds = %276
  br label %289

289:                                              ; preds = %288
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 5, ptr %23, align 4, !tbaa !9
  br label %290

290:                                              ; preds = %289
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %291 = load i32, ptr %23, align 4, !tbaa !9
  %292 = icmp eq i32 %291, 0
  br i1 %292, label %296, label %293

293:                                              ; preds = %290
  %294 = load i32, ptr %23, align 4, !tbaa !9
  %295 = icmp eq i32 %294, 2
  br label %296

296:                                              ; preds = %293, %290
  %297 = phi i1 [ true, %290 ], [ %295, %293 ]
  %298 = zext i1 %297 to i32
  store i32 %298, ptr %24, align 4, !tbaa !9
  %299 = load i32, ptr %24, align 4, !tbaa !9
  %300 = icmp ne i32 %299, 0
  br i1 %300, label %301, label %303

301:                                              ; preds = %296
  %302 = load i32, ptr %24, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %302, i32 noundef -1, ptr noundef @.str, i32 noundef 206, ptr noundef @__FUNCTION__.mImageCoordinateTransform, ptr noundef @.str.3)
  br label %303

303:                                              ; preds = %301, %296
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %304

304:                                              ; preds = %303
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %23, align 4, !tbaa !9
  %307 = icmp eq i32 %306, 3
  br i1 %307, label %308, label %315

308:                                              ; preds = %305
  %309 = load ptr, ptr %20, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %309, i32 0, i32 5
  %311 = load ptr, ptr %310, align 8, !tbaa !24
  %312 = getelementptr inbounds %struct.MTable, ptr %311, i64 0
  %313 = load i32, ptr %16, align 4, !tbaa !9
  %314 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %312, i32 noundef %313, i32 noundef %314, i32 noundef -1, ptr noundef null)
  br label %326

315:                                              ; preds = %305
  %316 = load i32, ptr %23, align 4, !tbaa !9
  %317 = icmp sge i32 %316, 4
  br i1 %317, label %318, label %325

318:                                              ; preds = %315
  %319 = load ptr, ptr %20, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %319, i32 0, i32 5
  %321 = load ptr, ptr %320, align 8, !tbaa !24
  %322 = getelementptr inbounds %struct.MTable, ptr %321, i64 0
  %323 = load i32, ptr %16, align 4, !tbaa !9
  %324 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %322, i32 noundef %323, i32 noundef %324, i32 noundef 2, ptr noundef null)
  br label %325

325:                                              ; preds = %318, %315
  br label %326

326:                                              ; preds = %325, %308
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %327

327:                                              ; preds = %326
  br label %328

328:                                              ; preds = %327
  br label %329

329:                                              ; preds = %328, %281
  %330 = load ptr, ptr %20, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %330, i32 0, i32 6
  %332 = load ptr, ptr %331, align 8, !tbaa !25
  %333 = icmp eq ptr %332, null
  br i1 %333, label %334, label %341

334:                                              ; preds = %329
  %335 = load i32, ptr %16, align 4, !tbaa !9
  %336 = add nsw i32 %335, 0
  %337 = load i32, ptr %15, align 4, !tbaa !9
  %338 = call ptr @TableCreate(i32 noundef %336, i32 noundef %337, i32 noundef 1, ptr noundef null)
  %339 = load ptr, ptr %20, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %339, i32 0, i32 6
  store ptr %338, ptr %340, align 8, !tbaa !25
  br label %382

341:                                              ; preds = %329
  br label %342

342:                                              ; preds = %341
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 5, ptr %25, align 4, !tbaa !9
  br label %343

343:                                              ; preds = %342
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %344 = load i32, ptr %25, align 4, !tbaa !9
  %345 = icmp eq i32 %344, 0
  br i1 %345, label %349, label %346

346:                                              ; preds = %343
  %347 = load i32, ptr %25, align 4, !tbaa !9
  %348 = icmp eq i32 %347, 2
  br label %349

349:                                              ; preds = %346, %343
  %350 = phi i1 [ true, %343 ], [ %348, %346 ]
  %351 = zext i1 %350 to i32
  store i32 %351, ptr %26, align 4, !tbaa !9
  %352 = load i32, ptr %26, align 4, !tbaa !9
  %353 = icmp ne i32 %352, 0
  br i1 %353, label %354, label %356

354:                                              ; preds = %349
  %355 = load i32, ptr %26, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %355, i32 noundef -1, ptr noundef @.str, i32 noundef 208, ptr noundef @__FUNCTION__.mImageCoordinateTransform, ptr noundef @.str.3)
  br label %356

356:                                              ; preds = %354, %349
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %357

357:                                              ; preds = %356
  br label %358

358:                                              ; preds = %357
  %359 = load i32, ptr %25, align 4, !tbaa !9
  %360 = icmp eq i32 %359, 3
  br i1 %360, label %361, label %368

361:                                              ; preds = %358
  %362 = load ptr, ptr %20, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %362, i32 0, i32 6
  %364 = load ptr, ptr %363, align 8, !tbaa !25
  %365 = getelementptr inbounds %struct.MTable, ptr %364, i64 0
  %366 = load i32, ptr %16, align 4, !tbaa !9
  %367 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %365, i32 noundef %366, i32 noundef %367, i32 noundef -1, ptr noundef null)
  br label %379

368:                                              ; preds = %358
  %369 = load i32, ptr %25, align 4, !tbaa !9
  %370 = icmp sge i32 %369, 4
  br i1 %370, label %371, label %378

371:                                              ; preds = %368
  %372 = load ptr, ptr %20, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %372, i32 0, i32 6
  %374 = load ptr, ptr %373, align 8, !tbaa !25
  %375 = getelementptr inbounds %struct.MTable, ptr %374, i64 0
  %376 = load i32, ptr %16, align 4, !tbaa !9
  %377 = load i32, ptr %15, align 4, !tbaa !9
  call void @TableRedefine(ptr noundef %375, i32 noundef %376, i32 noundef %377, i32 noundef 1, ptr noundef null)
  br label %378

378:                                              ; preds = %371, %368
  br label %379

379:                                              ; preds = %378, %361
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %380

380:                                              ; preds = %379
  br label %381

381:                                              ; preds = %380
  br label %382

382:                                              ; preds = %381, %334
  %383 = load ptr, ptr %7, align 8, !tbaa !5
  %384 = load ptr, ptr %9, align 8, !tbaa !5
  %385 = load ptr, ptr %10, align 8, !tbaa !5
  %386 = load ptr, ptr %11, align 8, !tbaa !5
  %387 = load ptr, ptr %20, align 8, !tbaa !5
  %388 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %387, i32 0, i32 4
  %389 = load ptr, ptr %388, align 8, !tbaa !23
  %390 = load ptr, ptr %20, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %390, i32 0, i32 5
  %392 = load ptr, ptr %391, align 8, !tbaa !24
  %393 = load ptr, ptr %20, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %393, i32 0, i32 6
  %395 = load ptr, ptr %394, align 8, !tbaa !25
  call void @TransformGrid(ptr noundef %383, ptr noundef %384, ptr noundef %385, ptr noundef %386, ptr noundef %389, ptr noundef %392, ptr noundef %395)
  br label %396

396:                                              ; preds = %382, %205
  %397 = load ptr, ptr %7, align 8, !tbaa !5
  %398 = load ptr, ptr %8, align 8, !tbaa !5
  %399 = load ptr, ptr %20, align 8, !tbaa !5
  %400 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %399, i32 0, i32 4
  %401 = load ptr, ptr %400, align 8, !tbaa !23
  %402 = load ptr, ptr %20, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %402, i32 0, i32 5
  %404 = load ptr, ptr %403, align 8, !tbaa !24
  %405 = load ptr, ptr %20, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct.HandleImageCoordinateTransform, ptr %405, i32 0, i32 6
  %407 = load ptr, ptr %406, align 8, !tbaa !25
  %408 = load i32, ptr %12, align 4, !tbaa !9
  call void @GridInterpolation(ptr noundef %397, ptr noundef %398, ptr noundef %401, ptr noundef %404, ptr noundef %407, i32 noundef %408)
  %409 = load ptr, ptr %14, align 8, !tbaa !5
  %410 = load ptr, ptr %8, align 8, !tbaa !5
  %411 = icmp ne ptr %409, %410
  br i1 %411, label %412, label %423

412:                                              ; preds = %396
  br label %413

413:                                              ; preds = %412
  call void @llvm.lifetime.start.p0(i64 56, ptr %27) #4
  %414 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %414, i64 56, i1 false), !tbaa.struct !26
  %415 = load ptr, ptr %7, align 8, !tbaa !5
  %416 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %415, ptr align 8 %416, i64 56, i1 false), !tbaa.struct !26
  %417 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %417, ptr align 8 %27, i64 56, i1 false), !tbaa.struct !26
  %418 = load ptr, ptr %7, align 8, !tbaa !5
  %419 = load ptr, ptr %8, align 8, !tbaa !5
  call void @HandleExchange(ptr noundef %418, ptr noundef %419)
  call void @llvm.lifetime.end.p0(i64 56, ptr %27) #4
  br label %420

420:                                              ; preds = %413
  br label %421

421:                                              ; preds = %420
  %422 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mImageRelease(ptr noundef %422)
  br label %423

423:                                              ; preds = %421, %396
  %424 = load ptr, ptr %19, align 8, !tbaa !5
  %425 = getelementptr inbounds %struct.MHandle, ptr %424, i32 0, i32 1
  store volatile i32 1, ptr %425, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  ret void
}

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

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

declare void @ImageRedefine(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

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

declare void @TableRedefine(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr 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) #3

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

declare void @mImageRelease(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: readwrite) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"MImage", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !6, i64 48}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !6, i64 16}
!16 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!16, !10, i64 4}
!18 = !{!19, !10, i64 0}
!19 = !{!"HandleImageCoordinateTransform", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!19, !10, i64 4}
!21 = !{!19, !6, i64 8}
!22 = !{!19, !6, i64 16}
!23 = !{!19, !6, i64 24}
!24 = !{!19, !6, i64 32}
!25 = !{!19, !6, i64 40}
!26 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 16, i64 32, !27, i64 48, i64 8, !5}
!27 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.MImage = type { i32, i32, i32, [4 x ptr], ptr }

@.str = external hidden unnamed_addr constant [88 x i8], align 1
@__FUNCTION__.mImageCoordinateTransform = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mImageCoordinateTransform(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = alloca %struct.MImage, align 8
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %8 [
    i64 -1, label %.thread
    i64 0, label %.thread
  ]

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = icmp eq ptr %9, inttoptr (i64 -1 to ptr)
  br i1 %10, label %.thread, label %11

11:                                               ; preds = %8
  %12 = load i32, ptr %0, align 8, !tbaa !5
  %13 = icmp slt i32 %12, 1
  br i1 %13, label %.thread, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !11
  %17 = icmp slt i32 %16, 1
  br i1 %17, label %.thread, label %18

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %.thread

.thread:                                          ; preds = %8, %11, %14, %6, %6, %18
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 183, ptr noundef nonnull @__FUNCTION__.mImageCoordinateTransform, ptr noundef nonnull @.str.1) #4
  br label %22

22:                                               ; preds = %.thread, %18
  %magicptr153 = ptrtoint ptr %1 to i64
  switch i64 %magicptr153, label %23 [
    i64 -1, label %25
    i64 0, label %25
  ]

23:                                               ; preds = %22
  %24 = icmp eq ptr %1, %0
  br i1 %24, label %25, label %32

25:                                               ; preds = %22, %22, %23
  %26 = load i32, ptr %0, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load i32, ptr %29, align 8, !tbaa !12
  %31 = tail call ptr @ImageCreate(i32 noundef %26, i32 noundef %28, i32 noundef %30, ptr noundef null) #4
  br label %32

32:                                               ; preds = %25, %23
  %.0 = phi ptr [ %31, %25 ], [ %1, %23 ]
  %33 = getelementptr inbounds i8, ptr %.0, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !12
  %35 = icmp slt i32 %34, 1
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = getelementptr inbounds i8, ptr %0, i64 8
  %38 = load i32, ptr %37, align 8, !tbaa !12
  br label %39

39:                                               ; preds = %32, %36
  %.0141 = phi i32 [ %38, %36 ], [ %34, %32 ]
  %40 = getelementptr inbounds i8, ptr %.0, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = icmp slt i32 %41, 1
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %0, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %43, %39
  %.0142 = phi i32 [ %45, %43 ], [ %41, %39 ]
  %47 = load i32, ptr %0, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %.0, i64 16
  tail call void @ImageRedefine(ptr noundef nonnull %.0, i32 noundef %47, i32 noundef %.0142, i32 noundef %.0141, ptr noundef nonnull %48) #4
  %49 = tail call ptr @GetHandle(ptr noundef nonnull %0, i32 noundef 48, i32 noundef 1598343100, ptr noundef nonnull @endImageCoordinateTransform) #4
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %49, i64 4
  %53 = load volatile i32, ptr %52, align 4, !tbaa !15
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %66, label %55

55:                                               ; preds = %46
  %56 = load i32, ptr %51, align 8, !tbaa !16
  %.not148 = icmp eq i32 %56, %.0142
  br i1 %.not148, label %57, label %66

57:                                               ; preds = %55
  %58 = getelementptr inbounds i8, ptr %51, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !18
  %.not149 = icmp eq i32 %59, %.0141
  br i1 %.not149, label %60, label %66

60:                                               ; preds = %57
  %61 = getelementptr inbounds i8, ptr %51, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %.not150 = icmp eq ptr %62, %2
  br i1 %.not150, label %63, label %66

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %51, i64 16
  %65 = load ptr, ptr %64, align 8, !tbaa !20
  %.not151 = icmp eq ptr %65, %3
  br i1 %.not151, label %94, label %66

66:                                               ; preds = %63, %60, %57, %55, %46
  store i32 %.0142, ptr %51, align 8, !tbaa !16
  %67 = getelementptr inbounds i8, ptr %51, i64 4
  store i32 %.0141, ptr %67, align 4, !tbaa !18
  %68 = getelementptr inbounds i8, ptr %51, i64 8
  store ptr %2, ptr %68, align 8, !tbaa !19
  %69 = getelementptr inbounds i8, ptr %51, i64 16
  store ptr %3, ptr %69, align 8, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %51, i64 24
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %75

73:                                               ; preds = %66
  %74 = tail call ptr @TableCreate(i32 noundef %.0142, i32 noundef %.0141, i32 noundef 2, ptr noundef null) #4
  store ptr %74, ptr %70, align 8, !tbaa !21
  br label %76

75:                                               ; preds = %66
  tail call void @TableRedefine(ptr noundef nonnull %71, i32 noundef %.0142, i32 noundef %.0141, i32 noundef 2, ptr noundef null) #4
  br label %76

76:                                               ; preds = %75, %73
  %77 = getelementptr inbounds i8, ptr %51, i64 32
  %78 = load ptr, ptr %77, align 8, !tbaa !22
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %82

80:                                               ; preds = %76
  %81 = tail call ptr @TableCreate(i32 noundef %.0142, i32 noundef %.0141, i32 noundef 2, ptr noundef null) #4
  store ptr %81, ptr %77, align 8, !tbaa !22
  br label %83

82:                                               ; preds = %76
  tail call void @TableRedefine(ptr noundef nonnull %78, i32 noundef %.0142, i32 noundef %.0141, i32 noundef 2, ptr noundef null) #4
  br label %83

83:                                               ; preds = %82, %80
  %84 = getelementptr inbounds i8, ptr %51, i64 40
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %89

87:                                               ; preds = %83
  %88 = tail call ptr @TableCreate(i32 noundef %.0142, i32 noundef %.0141, i32 noundef 1, ptr noundef null) #4
  store ptr %88, ptr %84, align 8, !tbaa !23
  br label %90

89:                                               ; preds = %83
  tail call void @TableRedefine(ptr noundef nonnull %85, i32 noundef %.0142, i32 noundef %.0141, i32 noundef 1, ptr noundef null) #4
  %.pre = load ptr, ptr %84, align 8, !tbaa !23
  br label %90

90:                                               ; preds = %89, %87
  %91 = phi ptr [ %.pre, %89 ], [ %88, %87 ]
  %92 = load ptr, ptr %70, align 8, !tbaa !21
  %93 = load ptr, ptr %77, align 8, !tbaa !22
  tail call void @TransformGrid(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %92, ptr noundef %93, ptr noundef %91)
  br label %94

94:                                               ; preds = %90, %63
  %95 = getelementptr inbounds i8, ptr %51, i64 24
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = getelementptr inbounds i8, ptr %51, i64 32
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = getelementptr inbounds i8, ptr %51, i64 40
  %100 = load ptr, ptr %99, align 8, !tbaa !23
  tail call void @GridInterpolation(ptr noundef nonnull %0, ptr noundef nonnull %.0, ptr noundef %96, ptr noundef %98, ptr noundef %100, i32 noundef %5)
  %.not152 = icmp eq ptr %.0, %1
  br i1 %.not152, label %102, label %101

101:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull align 8 dereferenceable(56) %0, i64 56, i1 false), !tbaa.struct !24
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %.0, i64 56, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %.0, ptr noundef nonnull align 8 dereferenceable(56) %7, i64 56, i1 false), !tbaa.struct !24
  tail call void @HandleExchange(ptr noundef nonnull %0, ptr noundef nonnull %.0) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7)
  tail call void @mImageRelease(ptr noundef nonnull %.0) #4
  br label %102

102:                                              ; preds = %101, %94
  store volatile i32 1, ptr %52, align 4, !tbaa !15
  ret void
}

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

declare ptr @ImageCreate(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @ImageRedefine(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @TableCreate(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @TableRedefine(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; 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 void @HandleExchange(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @mImageRelease(ptr noundef) local_unnamed_addr #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 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"MImage", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 16, !10, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !10, i64 16}
!14 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!15 = !{!14, !7, i64 4}
!16 = !{!17, !7, i64 0}
!17 = !{!"HandleImageCoordinateTransform", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!18 = !{!17, !7, i64 4}
!19 = !{!17, !10, i64 8}
!20 = !{!17, !10, i64 16}
!21 = !{!17, !10, i64 24}
!22 = !{!17, !10, i64 32}
!23 = !{!17, !10, i64 40}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 16, i64 32, !26, i64 48, i64 8, !27}
!25 = !{!7, !7, i64 0}
!26 = !{!8, !8, i64 0}
!27 = !{!10, !10, i64 0}


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