; LLVM IR from aap/librw :: src/d3d/d3d9.ll (ZN2rw4d3d919defaultUninstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE)

; 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.rw::d3d9::VertexElement" = type { i16, i16, i8, i8, i8, i8 }
%"struct.rw::d3d9::InstanceDataHeader" = type { %"struct.rw::InstanceDataHeader", i32, i32, ptr, i32, [2 x %"struct.rw::d3d9::VertexStream"], i32, ptr, i32, i32, ptr }
%"struct.rw::InstanceDataHeader" = type { i32 }
%"struct.rw::d3d9::VertexStream" = type { ptr, i32, i32, i16, i8, i8 }
%"struct.rw::Geometry" = type { %"struct.rw::Object", i32, i16, i32, i32, i32, i32, ptr, ptr, [8 x ptr], ptr, %"struct.rw::MaterialList", ptr, ptr, i32 }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }
%"struct.rw::MaterialList" = type { ptr, i32, i32 }
%"struct.rw::MorphTarget" = type { ptr, %"struct.rw::Sphere", ptr, ptr }
%"struct.rw::Sphere" = type { %"struct.rw::V3d", float }
%"struct.rw::V3d" = type { float, float, float }

@_ZN2rw3d3d13vertFormatMapE = external global [0 x i32], align 4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw4d3d914getDeclarationEPvPNS0_13VertexElementE(ptr noundef, ptr noundef) #1

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

declare void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw4d3d919defaultUninstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [12 x %"struct.rw::d3d9::VertexElement"], align 16
  %6 = alloca [2 x ptr], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %9, i32 0, i32 5
  %11 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %10, i64 0, i64 0
  %12 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call noundef ptr @_ZN2rw3d3d12lockVerticesEPvjjj(ptr noundef %13, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %15 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  store ptr %14, ptr %15, align 16, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %16, i32 0, i32 5
  %18 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %17, i64 0, i64 1
  %19 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call noundef ptr @_ZN2rw3d3d12lockVerticesEPvjjj(ptr noundef %20, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %22 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  store ptr %21, ptr %22, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 0
  %27 = call noundef i32 @_ZN2rw4d3d914getDeclarationEPvPNS0_13VertexElementE(ptr noundef %25, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %28

28:                                               ; preds = %47, %2
  %29 = load i32, ptr %7, align 4, !tbaa !16
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %30
  %32 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %31, i32 0, i32 4
  %33 = load i8, ptr %32, align 2, !tbaa !17
  %34 = zext i8 %33 to i32
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %44, label %36

36:                                               ; preds = %28
  %37 = load i32, ptr %7, align 4, !tbaa !16
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %38
  %40 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %39, i32 0, i32 5
  %41 = load i8, ptr %40, align 1, !tbaa !19
  %42 = zext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br label %44

44:                                               ; preds = %36, %28
  %45 = phi i1 [ true, %28 ], [ %43, %36 ]
  br i1 %45, label %46, label %50

46:                                               ; preds = %44
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %7, align 4, !tbaa !16
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %7, align 4, !tbaa !16
  br label %28, !llvm.loop !20

50:                                               ; preds = %44
  %51 = load i32, ptr %7, align 4, !tbaa !16
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %52
  %54 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %53, i32 0, i32 2
  %55 = load i8, ptr %54, align 4, !tbaa !22
  %56 = zext i8 %55 to i64
  %57 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !16
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.rw::Geometry", ptr %59, i32 0, i32 10
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %61, i64 0
  %63 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !27
  %65 = load i32, ptr %7, align 4, !tbaa !16
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %66
  %68 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %67, i32 0, i32 0
  %69 = load i16, ptr %68, align 8, !tbaa !32
  %70 = zext i16 %69 to i64
  %71 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = load i32, ptr %7, align 4, !tbaa !16
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %74
  %76 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %75, i32 0, i32 1
  %77 = load i16, ptr %76, align 2, !tbaa !33
  %78 = zext i16 %77 to i32
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %72, i64 %79
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %81, i32 0, i32 9
  %83 = load i32, ptr %82, align 4, !tbaa !34
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %84, i32 0, i32 5
  %86 = load i32, ptr %7, align 4, !tbaa !16
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %87
  %89 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %88, i32 0, i32 0
  %90 = load i16, ptr %89, align 8, !tbaa !32
  %91 = zext i16 %90 to i64
  %92 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %85, i64 0, i64 %91
  %93 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 4, !tbaa !35
  call void @_ZN2rw9uninstV3dEiPNS_3V3dEPhjj(i32 noundef %58, ptr noundef %64, ptr noundef %80, i32 noundef %83, i32 noundef %94)
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.rw::Geometry", ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 8, !tbaa !36
  %98 = and i32 %97, 8
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %165

100:                                              ; preds = %50
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %101

101:                                              ; preds = %120, %100
  %102 = load i32, ptr %7, align 4, !tbaa !16
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %103
  %105 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %104, i32 0, i32 4
  %106 = load i8, ptr %105, align 2, !tbaa !17
  %107 = zext i8 %106 to i32
  %108 = icmp ne i32 %107, 10
  br i1 %108, label %117, label %109

109:                                              ; preds = %101
  %110 = load i32, ptr %7, align 4, !tbaa !16
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %111
  %113 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %112, i32 0, i32 5
  %114 = load i8, ptr %113, align 1, !tbaa !19
  %115 = zext i8 %114 to i32
  %116 = icmp ne i32 %115, 0
  br label %117

117:                                              ; preds = %109, %101
  %118 = phi i1 [ true, %101 ], [ %116, %109 ]
  br i1 %118, label %119, label %123

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %7, align 4, !tbaa !16
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %7, align 4, !tbaa !16
  br label %101, !llvm.loop !37

123:                                              ; preds = %117
  %124 = load i32, ptr %7, align 4, !tbaa !16
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %125
  %127 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %126, i32 0, i32 2
  %128 = load i8, ptr %127, align 4, !tbaa !22
  %129 = zext i8 %128 to i64
  %130 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !16
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.rw::Geometry", ptr %132, i32 0, i32 8
  %134 = load ptr, ptr %133, align 8, !tbaa !38
  %135 = load i32, ptr %7, align 4, !tbaa !16
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %136
  %138 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %137, i32 0, i32 0
  %139 = load i16, ptr %138, align 8, !tbaa !32
  %140 = zext i16 %139 to i64
  %141 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = load i32, ptr %7, align 4, !tbaa !16
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %144
  %146 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %145, i32 0, i32 1
  %147 = load i16, ptr %146, align 2, !tbaa !33
  %148 = zext i16 %147 to i32
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i8, ptr %142, i64 %149
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %151, i32 0, i32 9
  %153 = load i32, ptr %152, align 4, !tbaa !34
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %154, i32 0, i32 5
  %156 = load i32, ptr %7, align 4, !tbaa !16
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %157
  %159 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %158, i32 0, i32 0
  %160 = load i16, ptr %159, align 8, !tbaa !32
  %161 = zext i16 %160 to i64
  %162 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %155, i64 0, i64 %161
  %163 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %162, i32 0, i32 2
  %164 = load i32, ptr %163, align 4, !tbaa !35
  call void @_ZN2rw11uninstColorEiPNS_4RGBAEPhjj(i32 noundef %131, ptr noundef %134, ptr noundef %150, i32 noundef %153, i32 noundef %164)
  br label %165

165:                                              ; preds = %123, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !16
  br label %166

166:                                              ; preds = %242, %165
  %167 = load i32, ptr %8, align 4, !tbaa !16
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.rw::Geometry", ptr %168, i32 0, i32 6
  %170 = load i32, ptr %169, align 4, !tbaa !39
  %171 = icmp slt i32 %167, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %245

173:                                              ; preds = %166
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %174

174:                                              ; preds = %194, %173
  %175 = load i32, ptr %7, align 4, !tbaa !16
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %176
  %178 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %177, i32 0, i32 4
  %179 = load i8, ptr %178, align 2, !tbaa !17
  %180 = zext i8 %179 to i32
  %181 = icmp ne i32 %180, 5
  br i1 %181, label %191, label %182

182:                                              ; preds = %174
  %183 = load i32, ptr %7, align 4, !tbaa !16
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %184
  %186 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %185, i32 0, i32 5
  %187 = load i8, ptr %186, align 1, !tbaa !19
  %188 = zext i8 %187 to i32
  %189 = load i32, ptr %8, align 4, !tbaa !16
  %190 = icmp ne i32 %188, %189
  br label %191

191:                                              ; preds = %182, %174
  %192 = phi i1 [ true, %174 ], [ %190, %182 ]
  br i1 %192, label %193, label %197

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %7, align 4, !tbaa !16
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %7, align 4, !tbaa !16
  br label %174, !llvm.loop !40

197:                                              ; preds = %191
  %198 = load i32, ptr %7, align 4, !tbaa !16
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %199
  %201 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %200, i32 0, i32 2
  %202 = load i8, ptr %201, align 4, !tbaa !22
  %203 = zext i8 %202 to i64
  %204 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !16
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.rw::Geometry", ptr %206, i32 0, i32 9
  %208 = load i32, ptr %8, align 4, !tbaa !16
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [8 x ptr], ptr %207, i64 0, i64 %209
  %211 = load ptr, ptr %210, align 8, !tbaa !5
  %212 = load i32, ptr %7, align 4, !tbaa !16
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %213
  %215 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %214, i32 0, i32 0
  %216 = load i16, ptr %215, align 8, !tbaa !32
  %217 = zext i16 %216 to i64
  %218 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %217
  %219 = load ptr, ptr %218, align 8, !tbaa !5
  %220 = load i32, ptr %7, align 4, !tbaa !16
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %221
  %223 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %222, i32 0, i32 1
  %224 = load i16, ptr %223, align 2, !tbaa !33
  %225 = zext i16 %224 to i32
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i8, ptr %219, i64 %226
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %228, i32 0, i32 9
  %230 = load i32, ptr %229, align 4, !tbaa !34
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %231, i32 0, i32 5
  %233 = load i32, ptr %7, align 4, !tbaa !16
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %234
  %236 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %235, i32 0, i32 0
  %237 = load i16, ptr %236, align 8, !tbaa !32
  %238 = zext i16 %237 to i64
  %239 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %232, i64 0, i64 %238
  %240 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %239, i32 0, i32 2
  %241 = load i32, ptr %240, align 4, !tbaa !35
  call void @_ZN2rw15uninstTexCoordsEiPNS_9TexCoordsEPhjj(i32 noundef %205, ptr noundef %211, ptr noundef %227, i32 noundef %230, i32 noundef %241)
  br label %242

242:                                              ; preds = %197
  %243 = load i32, ptr %8, align 4, !tbaa !16
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %8, align 4, !tbaa !16
  br label %166, !llvm.loop !41

245:                                              ; preds = %172
  %246 = load ptr, ptr %3, align 8, !tbaa !5
  %247 = getelementptr inbounds %"struct.rw::Geometry", ptr %246, i32 0, i32 1
  %248 = load i32, ptr %247, align 8, !tbaa !36
  %249 = and i32 %248, 16
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %251, label %319

251:                                              ; preds = %245
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %252

252:                                              ; preds = %271, %251
  %253 = load i32, ptr %7, align 4, !tbaa !16
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %254
  %256 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %255, i32 0, i32 4
  %257 = load i8, ptr %256, align 2, !tbaa !17
  %258 = zext i8 %257 to i32
  %259 = icmp ne i32 %258, 3
  br i1 %259, label %268, label %260

260:                                              ; preds = %252
  %261 = load i32, ptr %7, align 4, !tbaa !16
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %262
  %264 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %263, i32 0, i32 5
  %265 = load i8, ptr %264, align 1, !tbaa !19
  %266 = zext i8 %265 to i32
  %267 = icmp ne i32 %266, 0
  br label %268

268:                                              ; preds = %260, %252
  %269 = phi i1 [ true, %252 ], [ %267, %260 ]
  br i1 %269, label %270, label %274

270:                                              ; preds = %268
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %7, align 4, !tbaa !16
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %7, align 4, !tbaa !16
  br label %252, !llvm.loop !42

274:                                              ; preds = %268
  %275 = load i32, ptr %7, align 4, !tbaa !16
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %276
  %278 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %277, i32 0, i32 2
  %279 = load i8, ptr %278, align 4, !tbaa !22
  %280 = zext i8 %279 to i64
  %281 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !16
  %283 = load ptr, ptr %3, align 8, !tbaa !5
  %284 = getelementptr inbounds %"struct.rw::Geometry", ptr %283, i32 0, i32 10
  %285 = load ptr, ptr %284, align 8, !tbaa !23
  %286 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %285, i64 0
  %287 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %286, i32 0, i32 3
  %288 = load ptr, ptr %287, align 8, !tbaa !43
  %289 = load i32, ptr %7, align 4, !tbaa !16
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %290
  %292 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %291, i32 0, i32 0
  %293 = load i16, ptr %292, align 8, !tbaa !32
  %294 = zext i16 %293 to i64
  %295 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %294
  %296 = load ptr, ptr %295, align 8, !tbaa !5
  %297 = load i32, ptr %7, align 4, !tbaa !16
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %298
  %300 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %299, i32 0, i32 1
  %301 = load i16, ptr %300, align 2, !tbaa !33
  %302 = zext i16 %301 to i32
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds i8, ptr %296, i64 %303
  %305 = load ptr, ptr %4, align 8, !tbaa !5
  %306 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %305, i32 0, i32 9
  %307 = load i32, ptr %306, align 4, !tbaa !34
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = getelementptr inbounds %"struct.rw::d3d9::InstanceDataHeader", ptr %308, i32 0, i32 5
  %310 = load i32, ptr %7, align 4, !tbaa !16
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %5, i64 0, i64 %311
  %313 = getelementptr inbounds %"struct.rw::d3d9::VertexElement", ptr %312, i32 0, i32 0
  %314 = load i16, ptr %313, align 8, !tbaa !32
  %315 = zext i16 %314 to i64
  %316 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %309, i64 0, i64 %315
  %317 = getelementptr inbounds %"struct.rw::d3d9::VertexStream", ptr %316, i32 0, i32 2
  %318 = load i32, ptr %317, align 4, !tbaa !35
  call void @_ZN2rw9uninstV3dEiPNS_3V3dEPhjj(i32 noundef %282, ptr noundef %288, ptr noundef %304, i32 noundef %307, i32 noundef %318)
  br label %319

319:                                              ; preds = %274, %245
  %320 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %321 = load ptr, ptr %320, align 16, !tbaa !5
  call void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef %321)
  %322 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %323 = load ptr, ptr %322, align 8, !tbaa !5
  call void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef %323)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 96, ptr %5) #4
  ret void
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN2rw4d3d912VertexStreamE", !6, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !7, i64 18, !7, i64 19}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !6, i64 88}
!14 = !{!"_ZTSN2rw4d3d918InstanceDataHeaderE", !15, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 32, !11, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !6, i64 104}
!15 = !{!"_ZTSN2rw18InstanceDataHeaderE", !11, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !7, i64 6}
!18 = !{!"_ZTSN2rw4d3d913VertexElementE", !12, i64 0, !12, i64 2, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!19 = !{!18, !7, i64 7}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !7, i64 4}
!23 = !{!24, !6, i64 120}
!24 = !{!"_ZTSN2rw8GeometryE", !25, i64 0, !11, i64 16, !12, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !26, i64 128, !6, i64 144, !6, i64 152, !11, i64 160}
!25 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!26 = !{!"_ZTSN2rw12MaterialListE", !6, i64 0, !11, i64 8, !11, i64 12}
!27 = !{!28, !6, i64 24}
!28 = !{!"_ZTSN2rw11MorphTargetE", !6, i64 0, !29, i64 8, !6, i64 24, !6, i64 32}
!29 = !{!"_ZTSN2rw6SphereE", !30, i64 0, !31, i64 12}
!30 = !{!"_ZTSN2rw3V3dE", !31, i64 0, !31, i64 4, !31, i64 8}
!31 = !{!"float", !7, i64 0}
!32 = !{!18, !12, i64 0}
!33 = !{!18, !12, i64 2}
!34 = !{!14, !11, i64 100}
!35 = !{!10, !11, i64 12}
!36 = !{!24, !11, i64 16}
!37 = distinct !{!37, !21}
!38 = !{!24, !6, i64 48}
!39 = !{!24, !11, i64 36}
!40 = distinct !{!40, !21}
!41 = distinct !{!41, !21}
!42 = distinct !{!42, !21}
!43 = !{!28, !6, i64 32}


; 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.rw::d3d9::VertexElement" = type { i16, i16, i8, i8, i8, i8 }
%"struct.rw::d3d9::VertexStream" = type { ptr, i32, i32, i16, i8, i8 }

@_ZN2rw3d3d13vertFormatMapE = external local_unnamed_addr global [0 x i32], align 4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw4d3d914getDeclarationEPvPNS0_13VertexElementE(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw4d3d919defaultUninstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca [12 x %"struct.rw::d3d9::VertexElement"], align 16
  %4 = alloca [2 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %5 = getelementptr inbounds i8, ptr %1, i64 32
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef ptr @_ZN2rw3d3d12lockVerticesEPvjjj(ptr noundef %6, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  store ptr %7, ptr %4, align 16, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %1, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef ptr @_ZN2rw3d3d12lockVerticesEPvjjj(ptr noundef %9, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %10, ptr %11, align 8, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %1, i64 88
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = call noundef i32 @_ZN2rw4d3d914getDeclarationEPvPNS0_13VertexElementE(ptr noundef %13, ptr noundef nonnull %3)
  br label %15

15:                                               ; preds = %.critedge, %2
  %indvars.iv = phi i64 [ %indvars.iv.next, %.critedge ], [ 0, %2 ]
  %16 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %3, i64 0, i64 %indvars.iv
  %17 = getelementptr inbounds i8, ptr %16, i64 6
  %18 = load i8, ptr %17, align 2, !tbaa !16
  %.not = icmp eq i8 %18, 0
  br i1 %.not, label %19, label %.critedge

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %16, i64 7
  %21 = load i8, ptr %20, align 1, !tbaa !18
  %.not56 = icmp eq i8 %21, 0
  br i1 %.not56, label %22, label %.critedge

.critedge:                                        ; preds = %15, %19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %15, !llvm.loop !19

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %16, i64 4
  %24 = load i8, ptr %23, align 4, !tbaa !21
  %25 = zext i8 %24 to i64
  %26 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %0, i64 120
  %29 = load ptr, ptr %28, align 8, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %29, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %32 = load i16, ptr %16, align 8, !tbaa !32
  %33 = zext i16 %32 to i64
  %34 = getelementptr inbounds [2 x ptr], ptr %4, i64 0, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %16, i64 2
  %37 = load i16, ptr %36, align 2, !tbaa !33
  %38 = zext i16 %37 to i64
  %39 = getelementptr inbounds i8, ptr %35, i64 %38
  %40 = getelementptr inbounds i8, ptr %1, i64 100
  %41 = load i32, ptr %40, align 4, !tbaa !34
  %42 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %5, i64 0, i64 %33, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !35
  call void @_ZN2rw9uninstV3dEiPNS_3V3dEPhjj(i32 noundef %27, ptr noundef %31, ptr noundef %39, i32 noundef %41, i32 noundef %43)
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  %45 = load i32, ptr %44, align 8, !tbaa !36
  %46 = and i32 %45, 8
  %.not57 = icmp eq i32 %46, 0
  br i1 %.not57, label %72, label %.preheader66

.preheader66:                                     ; preds = %22, %.critedge2
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.critedge2 ], [ 0, %22 ]
  %47 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %3, i64 0, i64 %indvars.iv75
  %48 = getelementptr inbounds i8, ptr %47, i64 6
  %49 = load i8, ptr %48, align 2, !tbaa !16
  %.not58 = icmp eq i8 %49, 10
  br i1 %.not58, label %50, label %.critedge2

50:                                               ; preds = %.preheader66
  %51 = getelementptr inbounds i8, ptr %47, i64 7
  %52 = load i8, ptr %51, align 1, !tbaa !18
  %.not59 = icmp eq i8 %52, 0
  br i1 %.not59, label %53, label %.critedge2

.critedge2:                                       ; preds = %.preheader66, %50
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  br label %.preheader66, !llvm.loop !37

53:                                               ; preds = %50
  %54 = getelementptr inbounds i8, ptr %47, i64 4
  %55 = load i8, ptr %54, align 4, !tbaa !21
  %56 = zext i8 %55 to i64
  %57 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !22
  %59 = getelementptr inbounds i8, ptr %0, i64 48
  %60 = load ptr, ptr %59, align 8, !tbaa !38
  %61 = load i16, ptr %47, align 8, !tbaa !32
  %62 = zext i16 %61 to i64
  %63 = getelementptr inbounds [2 x ptr], ptr %4, i64 0, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !12
  %65 = getelementptr inbounds i8, ptr %47, i64 2
  %66 = load i16, ptr %65, align 2, !tbaa !33
  %67 = zext i16 %66 to i64
  %68 = getelementptr inbounds i8, ptr %64, i64 %67
  %69 = load i32, ptr %40, align 4, !tbaa !34
  %70 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %5, i64 0, i64 %62, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !35
  call void @_ZN2rw11uninstColorEiPNS_4RGBAEPhjj(i32 noundef %58, ptr noundef %60, ptr noundef %68, i32 noundef %69, i32 noundef %71)
  br label %72

72:                                               ; preds = %53, %22
  %73 = getelementptr inbounds i8, ptr %0, i64 36
  %74 = load i32, ptr %73, align 4, !tbaa !39
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.preheader65.lr.ph, label %._crit_edge

.preheader65.lr.ph:                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %0, i64 56
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.lr.ph, %87
  %indvars.iv81 = phi i64 [ 0, %.preheader65.lr.ph ], [ %indvars.iv.next82, %87 ]
  br label %79

._crit_edge:                                      ; preds = %87, %72
  %77 = load i32, ptr %44, align 8, !tbaa !36
  %78 = and i32 %77, 16
  %.not60 = icmp eq i32 %78, 0
  br i1 %.not60, label %135, label %.preheader

79:                                               ; preds = %.preheader65, %.critedge4
  %indvars.iv78 = phi i64 [ 0, %.preheader65 ], [ %indvars.iv.next79, %.critedge4 ]
  %80 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %3, i64 0, i64 %indvars.iv78
  %81 = getelementptr inbounds i8, ptr %80, i64 6
  %82 = load i8, ptr %81, align 2, !tbaa !16
  %.not63 = icmp eq i8 %82, 5
  br i1 %.not63, label %83, label %.critedge4

83:                                               ; preds = %79
  %84 = getelementptr inbounds i8, ptr %80, i64 7
  %85 = load i8, ptr %84, align 1, !tbaa !18
  %86 = zext i8 %85 to i64
  %.not64 = icmp eq i64 %indvars.iv81, %86
  br i1 %.not64, label %87, label %.critedge4

.critedge4:                                       ; preds = %79, %83
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  br label %79, !llvm.loop !40

87:                                               ; preds = %83
  %88 = getelementptr inbounds i8, ptr %80, i64 4
  %89 = load i8, ptr %88, align 4, !tbaa !21
  %90 = zext i8 %89 to i64
  %91 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !22
  %93 = getelementptr inbounds [8 x ptr], ptr %76, i64 0, i64 %indvars.iv81
  %94 = load ptr, ptr %93, align 8, !tbaa !12
  %95 = load i16, ptr %80, align 8, !tbaa !32
  %96 = zext i16 %95 to i64
  %97 = getelementptr inbounds [2 x ptr], ptr %4, i64 0, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !12
  %99 = getelementptr inbounds i8, ptr %80, i64 2
  %100 = load i16, ptr %99, align 2, !tbaa !33
  %101 = zext i16 %100 to i64
  %102 = getelementptr inbounds i8, ptr %98, i64 %101
  %103 = load i32, ptr %40, align 4, !tbaa !34
  %104 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %5, i64 0, i64 %96, i32 2
  %105 = load i32, ptr %104, align 4, !tbaa !35
  call void @_ZN2rw15uninstTexCoordsEiPNS_9TexCoordsEPhjj(i32 noundef %92, ptr noundef %94, ptr noundef %102, i32 noundef %103, i32 noundef %105)
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %106 = load i32, ptr %73, align 4, !tbaa !39
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next82, %107
  br i1 %108, label %.preheader65, label %._crit_edge, !llvm.loop !41

.preheader:                                       ; preds = %._crit_edge, %.critedge6
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.critedge6 ], [ 0, %._crit_edge ]
  %109 = getelementptr inbounds [12 x %"struct.rw::d3d9::VertexElement"], ptr %3, i64 0, i64 %indvars.iv84
  %110 = getelementptr inbounds i8, ptr %109, i64 6
  %111 = load i8, ptr %110, align 2, !tbaa !16
  %.not61 = icmp eq i8 %111, 3
  br i1 %.not61, label %112, label %.critedge6

112:                                              ; preds = %.preheader
  %113 = getelementptr inbounds i8, ptr %109, i64 7
  %114 = load i8, ptr %113, align 1, !tbaa !18
  %.not62 = icmp eq i8 %114, 0
  br i1 %.not62, label %115, label %.critedge6

.critedge6:                                       ; preds = %.preheader, %112
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  br label %.preheader, !llvm.loop !42

115:                                              ; preds = %112
  %116 = getelementptr inbounds i8, ptr %109, i64 4
  %117 = load i8, ptr %116, align 4, !tbaa !21
  %118 = zext i8 %117 to i64
  %119 = getelementptr inbounds [0 x i32], ptr @_ZN2rw3d3d13vertFormatMapE, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !22
  %121 = load ptr, ptr %28, align 8, !tbaa !23
  %122 = getelementptr inbounds i8, ptr %121, i64 32
  %123 = load ptr, ptr %122, align 8, !tbaa !43
  %124 = load i16, ptr %109, align 8, !tbaa !32
  %125 = zext i16 %124 to i64
  %126 = getelementptr inbounds [2 x ptr], ptr %4, i64 0, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !12
  %128 = getelementptr inbounds i8, ptr %109, i64 2
  %129 = load i16, ptr %128, align 2, !tbaa !33
  %130 = zext i16 %129 to i64
  %131 = getelementptr inbounds i8, ptr %127, i64 %130
  %132 = load i32, ptr %40, align 4, !tbaa !34
  %133 = getelementptr inbounds [2 x %"struct.rw::d3d9::VertexStream"], ptr %5, i64 0, i64 %125, i32 2
  %134 = load i32, ptr %133, align 4, !tbaa !35
  call void @_ZN2rw9uninstV3dEiPNS_3V3dEPhjj(i32 noundef %120, ptr noundef %123, ptr noundef %131, i32 noundef %132, i32 noundef %134)
  br label %135

135:                                              ; preds = %115, %._crit_edge
  call void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef %7)
  call void @_ZN2rw3d3d14unlockVerticesEPv(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #4
  ret void
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN2rw4d3d912VertexStreamE", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !8, i64 18, !8, i64 19}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !7, i64 88}
!14 = !{!"_ZTSN2rw4d3d918InstanceDataHeaderE", !15, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !10, i64 24, !8, i64 32, !10, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !7, i64 104}
!15 = !{!"_ZTSN2rw18InstanceDataHeaderE", !10, i64 0}
!16 = !{!17, !8, i64 6}
!17 = !{!"_ZTSN2rw4d3d913VertexElementE", !11, i64 0, !11, i64 2, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!18 = !{!17, !8, i64 7}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!17, !8, i64 4}
!22 = !{!10, !10, i64 0}
!23 = !{!24, !7, i64 120}
!24 = !{!"_ZTSN2rw8GeometryE", !25, i64 0, !10, i64 16, !11, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 48, !8, i64 56, !7, i64 120, !26, i64 128, !7, i64 144, !7, i64 152, !10, i64 160}
!25 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !7, i64 8}
!26 = !{!"_ZTSN2rw12MaterialListE", !7, i64 0, !10, i64 8, !10, i64 12}
!27 = !{!28, !7, i64 24}
!28 = !{!"_ZTSN2rw11MorphTargetE", !7, i64 0, !29, i64 8, !7, i64 24, !7, i64 32}
!29 = !{!"_ZTSN2rw6SphereE", !30, i64 0, !31, i64 12}
!30 = !{!"_ZTSN2rw3V3dE", !31, i64 0, !31, i64 4, !31, i64 8}
!31 = !{!"float", !8, i64 0}
!32 = !{!17, !11, i64 0}
!33 = !{!17, !11, i64 2}
!34 = !{!14, !10, i64 100}
!35 = !{!6, !10, i64 12}
!36 = !{!24, !10, i64 16}
!37 = distinct !{!37, !20}
!38 = !{!24, !7, i64 48}
!39 = !{!24, !10, i64 36}
!40 = distinct !{!40, !20}
!41 = distinct !{!41, !20}
!42 = distinct !{!42, !20}
!43 = !{!28, !7, i64 32}


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