; LLVM IR from aap/librw :: src/d3d/xbox.ll (ZN2rw4xbox17defaultInstanceCBEPNS_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::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::xbox::InstanceDataHeader" = type { %"struct.rw::InstanceDataHeader", i32, i16, i16, i32, i32, i32, ptr, i32, ptr, ptr, ptr }
%"struct.rw::InstanceDataHeader" = type { 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 }

@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@_ZN2rw4xbox12v3dFormatMapE = external dso_local global [6 x i32], align 16
@_ZN2rw4xbox12v2dFormatMapE = external dso_local global [6 x i32], align 16
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@_ZN2rw4xbox17vertexFormatSizesE = external global [6 x i32], align 16
@.str.12 = external hidden unnamed_addr constant [49 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE = external hidden unnamed_addr constant [67 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = 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 8, ptr %5) #5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = call noundef ptr @_ZN2rw4xbox12getVertexFmtEPNS_8GeometryE(ptr noundef %11)
  store ptr %12, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %25

16:                                               ; preds = %2
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.rw::Geometry", ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.rw::Geometry", ptr %20, i32 0, i32 6
  %22 = load i32, ptr %21, align 4, !tbaa !16
  %23 = call noundef i32 @_ZN2rw4xbox13makeVertexFmtEij(i32 noundef %19, i32 noundef %22)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 %23, ptr %24, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %16, %2
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = call noundef i32 @_ZN2rw4xbox18getVertexFmtStrideEj(i32 noundef %27)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %29, i32 0, i32 6
  store i32 %28, ptr %30, align 4, !tbaa !17
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %31, i32 0, i32 6
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %34, i32 0, i32 5
  %36 = load i32, ptr %35, align 8, !tbaa !20
  %37 = mul nsw i32 %33, %36
  %38 = sext i32 %37 to i64
  %39 = mul i64 %38, 1
  %40 = call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %39, i32 noundef 196623, ptr noundef @.str.11)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %41, i32 0, i32 7
  store ptr %40, ptr %42, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %43, i32 0, i32 7
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  store ptr %45, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load i32, ptr %46, align 4, !tbaa !9
  store i32 %47, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = and i32 %48, 15
  store i32 %49, ptr %8, align 4, !tbaa !9
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v3dFormatMapE, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.rw::Geometry", ptr %55, i32 0, i32 10
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %57, i64 0
  %59 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %61, i32 0, i32 5
  %63 = load i32, ptr %62, align 8, !tbaa !20
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %64, i32 0, i32 6
  %66 = load i32, ptr %65, align 4, !tbaa !17
  call void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef %53, ptr noundef %54, ptr noundef %60, i32 noundef %63, i32 noundef %66)
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = icmp eq i32 %67, 4
  br i1 %68, label %69, label %70

69:                                               ; preds = %25
  br label %76

70:                                               ; preds = %25
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = mul i32 3, %74
  br label %76

76:                                               ; preds = %70, %69
  %77 = phi i32 [ 4, %69 ], [ %75, %70 ]
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = zext i32 %77 to i64
  %80 = getelementptr inbounds i8, ptr %78, i64 %79
  store ptr %80, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = lshr i32 %81, 4
  %83 = and i32 %82, 15
  store i32 %83, ptr %8, align 4, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %118

86:                                               ; preds = %76
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v3dFormatMapE, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.rw::Geometry", ptr %92, i32 0, i32 10
  %94 = load ptr, ptr %93, align 8, !tbaa !22
  %95 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %94, i64 0
  %96 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !28
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %98, i32 0, i32 5
  %100 = load i32, ptr %99, align 8, !tbaa !20
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %101, i32 0, i32 6
  %103 = load i32, ptr %102, align 4, !tbaa !17
  call void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef %90, ptr noundef %91, ptr noundef %97, i32 noundef %100, i32 noundef %103)
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 4
  br i1 %105, label %106, label %107

106:                                              ; preds = %86
  br label %113

107:                                              ; preds = %86
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = mul i32 3, %111
  br label %113

113:                                              ; preds = %107, %106
  %114 = phi i32 [ 4, %106 ], [ %112, %107 ]
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = zext i32 %114 to i64
  %117 = getelementptr inbounds i8, ptr %115, i64 %116
  store ptr %117, ptr %6, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %113, %76
  %119 = load i32, ptr %7, align 4, !tbaa !9
  %120 = and i32 %119, 16777216
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %138

122:                                              ; preds = %118
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.rw::Geometry", ptr %124, i32 0, i32 8
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %127, i32 0, i32 5
  %129 = load i32, ptr %128, align 8, !tbaa !20
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %130, i32 0, i32 6
  %132 = load i32, ptr %131, align 4, !tbaa !17
  %133 = call noundef i32 @_ZN2rw9instColorEiPhPNS_4RGBAEjj(i32 noundef 10, ptr noundef %123, ptr noundef %126, i32 noundef %129, i32 noundef %132)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %134, i32 0, i32 8
  store i32 %133, ptr %135, align 8, !tbaa !30
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 4
  store ptr %137, ptr %6, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %122, %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %185, %138
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = icmp slt i32 %140, 4
  br i1 %141, label %143, label %142

142:                                              ; preds = %139
  store i32 2, ptr %10, align 4
  br label %188

143:                                              ; preds = %139
  %144 = load i32, ptr %7, align 4, !tbaa !9
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = mul nsw i32 %145, 4
  %147 = add nsw i32 %146, 8
  %148 = lshr i32 %144, %147
  %149 = and i32 %148, 15
  store i32 %149, ptr %8, align 4, !tbaa !9
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %152, label %153

152:                                              ; preds = %143
  store i32 2, ptr %10, align 4
  br label %188

153:                                              ; preds = %143
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = zext i32 %154 to i64
  %156 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v2dFormatMapE, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %"struct.rw::Geometry", ptr %159, i32 0, i32 9
  %161 = load i32, ptr %9, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [8 x ptr], ptr %160, i64 0, i64 %162
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %165, i32 0, i32 5
  %167 = load i32, ptr %166, align 8, !tbaa !20
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.rw::xbox::InstanceDataHeader", ptr %168, i32 0, i32 6
  %170 = load i32, ptr %169, align 4, !tbaa !17
  call void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef %157, ptr noundef %158, ptr noundef %164, i32 noundef %167, i32 noundef %170)
  %171 = load i32, ptr %8, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 4
  br i1 %172, label %173, label %174

173:                                              ; preds = %153
  br label %180

174:                                              ; preds = %153
  %175 = load i32, ptr %8, align 4, !tbaa !9
  %176 = zext i32 %175 to i64
  %177 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !9
  %179 = mul i32 2, %178
  br label %180

180:                                              ; preds = %174, %173
  %181 = phi i32 [ 4, %173 ], [ %179, %174 ]
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = zext i32 %181 to i64
  %184 = getelementptr inbounds i8, ptr %182, i64 %183
  store ptr %184, ptr %6, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %180
  %186 = load i32, ptr %9, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %9, align 4, !tbaa !9
  br label %139, !llvm.loop !31

188:                                              ; preds = %152, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %7, align 4, !tbaa !9
  %191 = and i32 %190, 234881024
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %189
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 354, ptr noundef @__PRETTY_FUNCTION__._ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE) #6
  unreachable

194:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

declare noundef ptr @_ZN2rw4xbox12getVertexFmtEPNS_8GeometryE(ptr noundef) #4

declare noundef i32 @_ZN2rw4xbox13makeVertexFmtEij(i32 noundef, i32 noundef) #4

declare noundef i32 @_ZN2rw4xbox18getVertexFmtStrideEj(i32 noundef) #4

declare void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

declare noundef i32 @_ZN2rw9instColorEiPhPNS_4RGBAEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

declare void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { noreturn nounwind "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 = { "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 #5 = { nounwind }
attributes #6 = { noreturn 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTSN2rw8GeometryE", !13, i64 0, !10, i64 16, !14, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !15, i64 128, !6, i64 144, !6, i64 152, !10, i64 160}
!13 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSN2rw12MaterialListE", !6, i64 0, !10, i64 8, !10, i64 12}
!16 = !{!12, !10, i64 36}
!17 = !{!18, !10, i64 20}
!18 = !{!"_ZTSN2rw4xbox18InstanceDataHeaderE", !19, i64 0, !10, i64 4, !14, i64 8, !14, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!19 = !{!"_ZTSN2rw18InstanceDataHeaderE", !10, i64 0}
!20 = !{!18, !10, i64 16}
!21 = !{!18, !6, i64 24}
!22 = !{!12, !6, i64 120}
!23 = !{!24, !6, i64 24}
!24 = !{!"_ZTSN2rw11MorphTargetE", !6, i64 0, !25, i64 8, !6, i64 24, !6, i64 32}
!25 = !{!"_ZTSN2rw6SphereE", !26, i64 0, !27, i64 12}
!26 = !{!"_ZTSN2rw3V3dE", !27, i64 0, !27, i64 4, !27, i64 8}
!27 = !{!"float", !7, i64 0}
!28 = !{!24, !6, i64 32}
!29 = !{!12, !6, i64 48}
!30 = !{!18, !10, i64 32}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; 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.1 = external hidden unnamed_addr constant [60 x i8], align 1
@_ZN2rw4xbox12v3dFormatMapE = external dso_local local_unnamed_addr global [6 x i32], align 16
@_ZN2rw4xbox12v2dFormatMapE = external dso_local local_unnamed_addr global [6 x i32], align 16
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@_ZN2rw4xbox17vertexFormatSizesE = external local_unnamed_addr global [6 x i32], align 16
@.str.12 = external hidden unnamed_addr constant [49 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE = external hidden unnamed_addr constant [67 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #2 {
  %3 = tail call noundef ptr @_ZN2rw4xbox12getVertexFmtEPNS_8GeometryE(ptr noundef %0)
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %6, label %12

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %0, i64 36
  %10 = load i32, ptr %9, align 4, !tbaa !15
  %11 = tail call noundef i32 @_ZN2rw4xbox13makeVertexFmtEij(i32 noundef %8, i32 noundef %10)
  store i32 %11, ptr %3, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %6, %2
  %13 = phi i32 [ %11, %6 ], [ %4, %2 ]
  %14 = tail call noundef i32 @_ZN2rw4xbox18getVertexFmtStrideEj(i32 noundef %13)
  %15 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 %14, ptr %15, align 4, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !19
  %18 = mul nsw i32 %17, %14
  %19 = sext i32 %18 to i64
  %20 = tail call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %19, i32 noundef 196623, ptr noundef nonnull @.str.11)
  %21 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr %20, ptr %21, align 8, !tbaa !20
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = and i32 %22, 15
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v3dFormatMapE, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 120
  %28 = load ptr, ptr %27, align 8, !tbaa !21
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = load i32, ptr %16, align 8, !tbaa !19
  %32 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef %26, ptr noundef %20, ptr noundef %30, i32 noundef %31, i32 noundef %32)
  %33 = icmp eq i32 %23, 4
  br i1 %33, label %39, label %34

34:                                               ; preds = %12
  %35 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %24
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = mul i32 %36, 3
  %38 = zext i32 %37 to i64
  br label %39

39:                                               ; preds = %12, %34
  %40 = phi i64 [ %38, %34 ], [ 4, %12 ]
  %41 = getelementptr inbounds i8, ptr %20, i64 %40
  %42 = lshr i32 %22, 4
  %43 = and i32 %42, 15
  %.not = icmp eq i32 %43, 0
  br i1 %.not, label %62, label %44

44:                                               ; preds = %39
  %45 = zext nneg i32 %43 to i64
  %46 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v3dFormatMapE, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load ptr, ptr %27, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %48, i64 32
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %51 = load i32, ptr %16, align 8, !tbaa !19
  %52 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef %47, ptr noundef %41, ptr noundef %50, i32 noundef %51, i32 noundef %52)
  %53 = icmp eq i32 %43, 4
  br i1 %53, label %59, label %54

54:                                               ; preds = %44
  %55 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %45
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = mul i32 %56, 3
  %58 = zext i32 %57 to i64
  br label %59

59:                                               ; preds = %44, %54
  %60 = phi i64 [ %58, %54 ], [ 4, %44 ]
  %61 = getelementptr inbounds i8, ptr %41, i64 %60
  br label %62

62:                                               ; preds = %59, %39
  %.052 = phi ptr [ %61, %59 ], [ %41, %39 ]
  %63 = and i32 %22, 16777216
  %.not55 = icmp eq i32 %63, 0
  br i1 %.not55, label %72, label %64

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %0, i64 48
  %66 = load ptr, ptr %65, align 8, !tbaa !28
  %67 = load i32, ptr %16, align 8, !tbaa !19
  %68 = load i32, ptr %15, align 4, !tbaa !16
  %69 = tail call noundef i32 @_ZN2rw9instColorEiPhPNS_4RGBAEjj(i32 noundef 10, ptr noundef %.052, ptr noundef %66, i32 noundef %67, i32 noundef %68)
  %70 = getelementptr inbounds i8, ptr %1, i64 32
  store i32 %69, ptr %70, align 8, !tbaa !29
  %71 = getelementptr inbounds i8, ptr %.052, i64 4
  br label %72

72:                                               ; preds = %64, %62
  %.1 = phi ptr [ %71, %64 ], [ %.052, %62 ]
  %73 = lshr i32 %22, 8
  %74 = and i32 %73, 15
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %144, label %76

76:                                               ; preds = %72
  %77 = getelementptr inbounds i8, ptr %0, i64 56
  %78 = zext nneg i32 %74 to i64
  %79 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v2dFormatMapE, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load ptr, ptr %77, align 8, !tbaa !30
  %82 = load i32, ptr %16, align 8, !tbaa !19
  %83 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef %80, ptr noundef %.1, ptr noundef %81, i32 noundef %82, i32 noundef %83)
  %84 = icmp eq i32 %74, 4
  br i1 %84, label %90, label %85

85:                                               ; preds = %76
  %86 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %78
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = shl i32 %87, 1
  %89 = zext i32 %88 to i64
  br label %90

90:                                               ; preds = %76, %85
  %91 = phi i64 [ %89, %85 ], [ 4, %76 ]
  %92 = getelementptr inbounds i8, ptr %.1, i64 %91
  %93 = lshr i32 %22, 12
  %94 = and i32 %93, 15
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %144, label %96

96:                                               ; preds = %90
  %97 = zext nneg i32 %94 to i64
  %98 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v2dFormatMapE, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %0, i64 64
  %101 = load ptr, ptr %100, align 8, !tbaa !30
  %102 = load i32, ptr %16, align 8, !tbaa !19
  %103 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef %99, ptr noundef %92, ptr noundef %101, i32 noundef %102, i32 noundef %103)
  %104 = icmp eq i32 %94, 4
  br i1 %104, label %110, label %105

105:                                              ; preds = %96
  %106 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %97
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = shl i32 %107, 1
  %109 = zext i32 %108 to i64
  br label %110

110:                                              ; preds = %105, %96
  %111 = phi i64 [ %109, %105 ], [ 4, %96 ]
  %112 = getelementptr inbounds i8, ptr %92, i64 %111
  %113 = lshr i32 %22, 16
  %114 = and i32 %113, 15
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %144, label %116

116:                                              ; preds = %110
  %117 = zext nneg i32 %114 to i64
  %118 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v2dFormatMapE, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %0, i64 72
  %121 = load ptr, ptr %120, align 8, !tbaa !30
  %122 = load i32, ptr %16, align 8, !tbaa !19
  %123 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef %119, ptr noundef %112, ptr noundef %121, i32 noundef %122, i32 noundef %123)
  %124 = icmp eq i32 %114, 4
  br i1 %124, label %130, label %125

125:                                              ; preds = %116
  %126 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox17vertexFormatSizesE, i64 0, i64 %117
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = shl i32 %127, 1
  %129 = zext i32 %128 to i64
  br label %130

130:                                              ; preds = %125, %116
  %131 = phi i64 [ %129, %125 ], [ 4, %116 ]
  %132 = lshr i32 %22, 20
  %133 = and i32 %132, 15
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %144, label %135

135:                                              ; preds = %130
  %136 = getelementptr inbounds i8, ptr %112, i64 %131
  %137 = zext nneg i32 %133 to i64
  %138 = getelementptr inbounds [6 x i32], ptr @_ZN2rw4xbox12v2dFormatMapE, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %0, i64 80
  %141 = load ptr, ptr %140, align 8, !tbaa !30
  %142 = load i32, ptr %16, align 8, !tbaa !19
  %143 = load i32, ptr %15, align 4, !tbaa !16
  tail call void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef %139, ptr noundef %136, ptr noundef %141, i32 noundef %142, i32 noundef %143)
  br label %144

144:                                              ; preds = %135, %130, %110, %90, %72
  %145 = and i32 %22, 234881024
  %.not56 = icmp eq i32 %145, 0
  br i1 %.not56, label %147, label %146

146:                                              ; preds = %144
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 354, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN2rw4xbox17defaultInstanceCBEPNS_8GeometryEPNS0_18InstanceDataHeaderE) #4
  unreachable

147:                                              ; preds = %144
  ret void
}

declare noundef ptr @_ZN2rw4xbox12getVertexFmtEPNS_8GeometryE(ptr noundef) local_unnamed_addr #3

declare noundef i32 @_ZN2rw4xbox13makeVertexFmtEij(i32 noundef, i32 noundef) local_unnamed_addr #3

declare noundef i32 @_ZN2rw4xbox18getVertexFmtStrideEj(i32 noundef) local_unnamed_addr #3

declare void @_ZN2rw7instV3dEiPhPNS_3V3dEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare noundef i32 @_ZN2rw9instColorEiPhPNS_4RGBAEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN2rw13instTexCoordsEiPhPNS_9TexCoordsEjj(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { inlinehint 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 #1 = { noreturn nounwind "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { noreturn 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++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN2rw8GeometryE", !11, i64 0, !6, i64 16, !13, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !12, i64 40, !12, i64 48, !7, i64 56, !12, i64 120, !14, i64 128, !12, i64 144, !12, i64 152, !6, i64 160}
!11 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_ZTSN2rw12MaterialListE", !12, i64 0, !6, i64 8, !6, i64 12}
!15 = !{!10, !6, i64 36}
!16 = !{!17, !6, i64 20}
!17 = !{!"_ZTSN2rw4xbox18InstanceDataHeaderE", !18, i64 0, !6, i64 4, !13, i64 8, !13, i64 10, !6, i64 12, !6, i64 16, !6, i64 20, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!18 = !{!"_ZTSN2rw18InstanceDataHeaderE", !6, i64 0}
!19 = !{!17, !6, i64 16}
!20 = !{!17, !12, i64 24}
!21 = !{!10, !12, i64 120}
!22 = !{!23, !12, i64 24}
!23 = !{!"_ZTSN2rw11MorphTargetE", !12, i64 0, !24, i64 8, !12, i64 24, !12, i64 32}
!24 = !{!"_ZTSN2rw6SphereE", !25, i64 0, !26, i64 12}
!25 = !{!"_ZTSN2rw3V3dE", !26, i64 0, !26, i64 4, !26, i64 8}
!26 = !{!"float", !7, i64 0}
!27 = !{!23, !12, i64 32}
!28 = !{!10, !12, i64 48}
!29 = !{!17, !6, i64 32}
!30 = !{!12, !12, i64 0}


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