; LLVM IR from aap/librw :: src/ps2/ps2skin.ll (ZN2rw3ps214findVertexSkinEPNS_8GeometryEPjjPNS0_6VertexE)

; 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::Skin" = type { i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }
%"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 }
%"struct.rw::ps2::Vertex" = type { %"struct.rw::V3d", %"struct.rw::TexCoords", %"struct.rw::TexCoords", %"struct.rw::RGBA", %"struct.rw::V3d", [4 x float], [4 x i8] }
%"struct.rw::TexCoords" = type { float, float }
%"struct.rw::RGBA" = type { i8, i8, i8, i8 }

; 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 ptr @_ZN2rw4Skin3getEPKNS_8GeometryE(ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2rw3ps214findVertexSkinEPNS_8GeometryEPjjPNS0_6VertexE(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef ptr @_ZN2rw4Skin3getEPKNS_8GeometryE(ptr noundef %21)
  store ptr %22, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr null, ptr %12, align 8, !tbaa !5
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %32

25:                                               ; preds = %4
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.rw::Skin", ptr %26, i32 0, i32 6
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  store ptr %28, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.rw::Skin", ptr %29, i32 0, i32 5
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  store ptr %31, ptr %12, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %25, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.rw::Geometry", ptr %33, i32 0, i32 10
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %35, i64 0
  %37 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  store ptr %38, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.rw::Geometry", ptr %39, i32 0, i32 9
  %41 = getelementptr inbounds [8 x ptr], ptr %40, i64 0, i64 0
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.rw::Geometry", ptr %43, i32 0, i32 9
  %45 = getelementptr inbounds [8 x ptr], ptr %44, i64 0, i64 1
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  store ptr %46, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.rw::Geometry", ptr %47, i32 0, i32 10
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %49, i64 0
  %51 = getelementptr inbounds %"struct.rw::MorphTarget", ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  store ptr %52, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.rw::Geometry", ptr %53, i32 0, i32 8
  %55 = load ptr, ptr %54, align 8, !tbaa !25
  store ptr %55, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %246, %32
  %57 = load i32, ptr %18, align 4, !tbaa !9
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.rw::Geometry", ptr %58, i32 0, i32 4
  %60 = load i32, ptr %59, align 4, !tbaa !26
  %61 = icmp slt i32 %57, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %56
  store i32 2, ptr %19, align 4
  br label %249

63:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %72

66:                                               ; preds = %63
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %18, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %67, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !9
  br label %73

72:                                               ; preds = %63
  br label %73

73:                                               ; preds = %72, %66
  %74 = phi i32 [ %71, %66 ], [ -1, %72 ]
  store i32 %74, ptr %20, align 4, !tbaa !9
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = load i32, ptr %20, align 4, !tbaa !9
  %77 = and i32 %75, %76
  %78 = and i32 %77, 1
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %87

80:                                               ; preds = %73
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %82, i32 0, i32 0
  %84 = call noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %81, ptr noundef nonnull align 4 dereferenceable(12) %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %87, label %86

86:                                               ; preds = %80
  br label %228

87:                                               ; preds = %80, %73
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = load i32, ptr %20, align 4, !tbaa !9
  %90 = and i32 %88, %89
  %91 = and i32 %90, 16
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %100

93:                                               ; preds = %87
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %95, i32 0, i32 4
  %97 = call noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %94, ptr noundef nonnull align 4 dereferenceable(12) %96)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  br label %228

100:                                              ; preds = %93, %87
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = load i32, ptr %20, align 4, !tbaa !9
  %103 = and i32 %101, %102
  %104 = and i32 %103, 256
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %100
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %108, i32 0, i32 3
  %110 = call noundef i32 @_ZN2rw5equalERKNS_4RGBAES2_(ptr noundef nonnull align 1 dereferenceable(4) %107, ptr noundef nonnull align 1 dereferenceable(4) %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %113, label %112

112:                                              ; preds = %106
  br label %228

113:                                              ; preds = %106, %100
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = load i32, ptr %20, align 4, !tbaa !9
  %116 = and i32 %114, %115
  %117 = and i32 %116, 4096
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %126

119:                                              ; preds = %113
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %121, i32 0, i32 1
  %123 = call noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8) %120, ptr noundef nonnull align 4 dereferenceable(8) %122)
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %119
  br label %228

126:                                              ; preds = %119, %113
  %127 = load i32, ptr %8, align 4, !tbaa !9
  %128 = load i32, ptr %20, align 4, !tbaa !9
  %129 = and i32 %127, %128
  %130 = and i32 %129, 8192
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %139

132:                                              ; preds = %126
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %134, i32 0, i32 2
  %136 = call noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8) %133, ptr noundef nonnull align 4 dereferenceable(8) %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %139, label %138

138:                                              ; preds = %132
  br label %228

139:                                              ; preds = %132, %126
  %140 = load i32, ptr %8, align 4, !tbaa !9
  %141 = load i32, ptr %20, align 4, !tbaa !9
  %142 = and i32 %140, %141
  %143 = and i32 %142, 65536
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %226

145:                                              ; preds = %139
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds float, ptr %146, i64 0
  %148 = load float, ptr %147, align 4, !tbaa !27
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %149, i32 0, i32 5
  %151 = getelementptr inbounds [4 x float], ptr %150, i64 0, i64 0
  %152 = load float, ptr %151, align 4, !tbaa !27
  %153 = fcmp oeq float %148, %152
  br i1 %153, label %154, label %225

154:                                              ; preds = %145
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = getelementptr inbounds float, ptr %155, i64 1
  %157 = load float, ptr %156, align 4, !tbaa !27
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %158, i32 0, i32 5
  %160 = getelementptr inbounds [4 x float], ptr %159, i64 0, i64 1
  %161 = load float, ptr %160, align 4, !tbaa !27
  %162 = fcmp oeq float %157, %161
  br i1 %162, label %163, label %225

163:                                              ; preds = %154
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds float, ptr %164, i64 2
  %166 = load float, ptr %165, align 4, !tbaa !27
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %167, i32 0, i32 5
  %169 = getelementptr inbounds [4 x float], ptr %168, i64 0, i64 2
  %170 = load float, ptr %169, align 4, !tbaa !27
  %171 = fcmp oeq float %166, %170
  br i1 %171, label %172, label %225

172:                                              ; preds = %163
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  %174 = getelementptr inbounds float, ptr %173, i64 3
  %175 = load float, ptr %174, align 4, !tbaa !27
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %176, i32 0, i32 5
  %178 = getelementptr inbounds [4 x float], ptr %177, i64 0, i64 3
  %179 = load float, ptr %178, align 4, !tbaa !27
  %180 = fcmp oeq float %175, %179
  br i1 %180, label %181, label %225

181:                                              ; preds = %172
  %182 = load ptr, ptr %12, align 8, !tbaa !5
  %183 = getelementptr inbounds i8, ptr %182, i64 0
  %184 = load i8, ptr %183, align 1, !tbaa !28
  %185 = zext i8 %184 to i32
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %186, i32 0, i32 6
  %188 = getelementptr inbounds [4 x i8], ptr %187, i64 0, i64 0
  %189 = load i8, ptr %188, align 4, !tbaa !28
  %190 = zext i8 %189 to i32
  %191 = icmp eq i32 %185, %190
  br i1 %191, label %192, label %225

192:                                              ; preds = %181
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i64 1
  %195 = load i8, ptr %194, align 1, !tbaa !28
  %196 = zext i8 %195 to i32
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %197, i32 0, i32 6
  %199 = getelementptr inbounds [4 x i8], ptr %198, i64 0, i64 1
  %200 = load i8, ptr %199, align 1, !tbaa !28
  %201 = zext i8 %200 to i32
  %202 = icmp eq i32 %196, %201
  br i1 %202, label %203, label %225

203:                                              ; preds = %192
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = getelementptr inbounds i8, ptr %204, i64 2
  %206 = load i8, ptr %205, align 1, !tbaa !28
  %207 = zext i8 %206 to i32
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %208, i32 0, i32 6
  %210 = getelementptr inbounds [4 x i8], ptr %209, i64 0, i64 2
  %211 = load i8, ptr %210, align 2, !tbaa !28
  %212 = zext i8 %211 to i32
  %213 = icmp eq i32 %207, %212
  br i1 %213, label %214, label %225

214:                                              ; preds = %203
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = getelementptr inbounds i8, ptr %215, i64 3
  %217 = load i8, ptr %216, align 1, !tbaa !28
  %218 = zext i8 %217 to i32
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %"struct.rw::ps2::Vertex", ptr %219, i32 0, i32 6
  %221 = getelementptr inbounds [4 x i8], ptr %220, i64 0, i64 3
  %222 = load i8, ptr %221, align 1, !tbaa !28
  %223 = zext i8 %222 to i32
  %224 = icmp eq i32 %218, %223
  br i1 %224, label %226, label %225

225:                                              ; preds = %214, %203, %192, %181, %172, %163, %154, %145
  br label %228

226:                                              ; preds = %214, %139
  %227 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %227, ptr %5, align 4
  store i32 1, ptr %19, align 4
  br label %243

228:                                              ; preds = %225, %138, %125, %112, %99, %86
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %"struct.rw::V3d", ptr %229, i32 1
  store ptr %230, ptr %13, align 8, !tbaa !5
  %231 = load ptr, ptr %14, align 8, !tbaa !5
  %232 = getelementptr inbounds %"struct.rw::TexCoords", ptr %231, i32 1
  store ptr %232, ptr %14, align 8, !tbaa !5
  %233 = load ptr, ptr %15, align 8, !tbaa !5
  %234 = getelementptr inbounds %"struct.rw::TexCoords", ptr %233, i32 1
  store ptr %234, ptr %15, align 8, !tbaa !5
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  %236 = getelementptr inbounds %"struct.rw::V3d", ptr %235, i32 1
  store ptr %236, ptr %16, align 8, !tbaa !5
  %237 = load ptr, ptr %17, align 8, !tbaa !5
  %238 = getelementptr inbounds %"struct.rw::RGBA", ptr %237, i32 1
  store ptr %238, ptr %17, align 8, !tbaa !5
  %239 = load ptr, ptr %11, align 8, !tbaa !5
  %240 = getelementptr inbounds float, ptr %239, i64 4
  store ptr %240, ptr %11, align 8, !tbaa !5
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = getelementptr inbounds i8, ptr %241, i64 4
  store ptr %242, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %19, align 4
  br label %243

243:                                              ; preds = %228, %226
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %244 = load i32, ptr %19, align 4
  switch i32 %244, label %249 [
    i32 0, label %245
  ]

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %18, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %18, align 4, !tbaa !9
  br label %56, !llvm.loop !29

249:                                              ; preds = %243, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %250 = load i32, ptr %19, align 4
  switch i32 %250, label %252 [
    i32 2, label %251
  ]

251:                                              ; preds = %249
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %19, align 4
  br label %252

252:                                              ; preds = %251, %249
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %253 = load i32, ptr %5, align 4
  ret i32 %253
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_4RGBAES2_(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

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 = { 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 = { inlinehint 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"_ZTSN2rw4SkinE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !10, i64 104}
!13 = !{!12, !6, i64 32}
!14 = !{!15, !6, i64 120}
!15 = !{!"_ZTSN2rw8GeometryE", !16, i64 0, !10, i64 16, !17, 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, !18, i64 128, !6, i64 144, !6, i64 152, !10, i64 160}
!16 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTSN2rw12MaterialListE", !6, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!20, !6, i64 24}
!20 = !{!"_ZTSN2rw11MorphTargetE", !6, i64 0, !21, i64 8, !6, i64 24, !6, i64 32}
!21 = !{!"_ZTSN2rw6SphereE", !22, i64 0, !23, i64 12}
!22 = !{!"_ZTSN2rw3V3dE", !23, i64 0, !23, i64 4, !23, i64 8}
!23 = !{!"float", !7, i64 0}
!24 = !{!20, !6, i64 32}
!25 = !{!15, !6, i64 48}
!26 = !{!15, !10, i64 28}
!27 = !{!23, !23, i64 0}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw4Skin3getEPKNS_8GeometryE(ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN2rw3ps214findVertexSkinEPNS_8GeometryEPjjPNS0_6VertexE(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = tail call noundef ptr @_ZN2rw4Skin3getEPKNS_8GeometryE(ptr noundef %0)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %11, label %6

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %5, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 32
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  br label %11

11:                                               ; preds = %6, %4
  %.080 = phi ptr [ %8, %6 ], [ null, %4 ]
  %.077 = phi ptr [ %10, %6 ], [ null, %4 ]
  %12 = getelementptr inbounds i8, ptr %0, i64 28
  %13 = load i32, ptr %12, align 4, !tbaa !12
  %.not97107 = icmp sgt i32 %13, 0
  br i1 %.not97107, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  %15 = load ptr, ptr %14, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 120
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  %22 = getelementptr inbounds i8, ptr %0, i64 56
  %23 = load ptr, ptr %22, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %17, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !25
  %.not85 = icmp eq ptr %1, null
  %26 = getelementptr inbounds i8, ptr %3, i64 32
  %27 = getelementptr inbounds i8, ptr %3, i64 28
  %28 = getelementptr inbounds i8, ptr %3, i64 12
  %29 = getelementptr inbounds i8, ptr %3, i64 20
  %30 = getelementptr inbounds i8, ptr %3, i64 44
  %31 = getelementptr inbounds i8, ptr %3, i64 48
  %32 = getelementptr inbounds i8, ptr %3, i64 52
  %33 = getelementptr inbounds i8, ptr %3, i64 56
  %34 = getelementptr inbounds i8, ptr %3, i64 60
  %35 = getelementptr inbounds i8, ptr %3, i64 61
  %36 = getelementptr inbounds i8, ptr %3, i64 62
  %37 = getelementptr inbounds i8, ptr %3, i64 63
  br label %38

38:                                               ; preds = %.lr.ph, %104
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %104 ]
  %.067114 = phi ptr [ %15, %.lr.ph ], [ %109, %104 ]
  %.069113 = phi ptr [ %19, %.lr.ph ], [ %108, %104 ]
  %.071112 = phi ptr [ %21, %.lr.ph ], [ %107, %104 ]
  %.073111 = phi ptr [ %23, %.lr.ph ], [ %106, %104 ]
  %.075110 = phi ptr [ %25, %.lr.ph ], [ %105, %104 ]
  %.178109 = phi ptr [ %.077, %.lr.ph ], [ %111, %104 ]
  %.181108 = phi ptr [ %.080, %.lr.ph ], [ %110, %104 ]
  br i1 %.not85, label %42, label %39

39:                                               ; preds = %38
  %40 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %41 = load i32, ptr %40, align 4, !tbaa !26
  br label %42

42:                                               ; preds = %38, %39
  %43 = phi i32 [ %41, %39 ], [ -1, %38 ]
  %44 = and i32 %43, %2
  %45 = and i32 %44, 1
  %.not86 = icmp eq i32 %45, 0
  br i1 %.not86, label %48, label %46

46:                                               ; preds = %42
  %47 = tail call noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %.075110, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %.not87 = icmp eq i32 %47, 0
  br i1 %.not87, label %104, label %48

48:                                               ; preds = %46, %42
  %49 = and i32 %44, 16
  %.not88 = icmp eq i32 %49, 0
  br i1 %.not88, label %52, label %50

50:                                               ; preds = %48
  %51 = tail call noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %.069113, ptr noundef nonnull align 4 dereferenceable(12) %26)
  %.not89 = icmp eq i32 %51, 0
  br i1 %.not89, label %104, label %52

52:                                               ; preds = %50, %48
  %53 = and i32 %44, 256
  %.not90 = icmp eq i32 %53, 0
  br i1 %.not90, label %56, label %54

54:                                               ; preds = %52
  %55 = tail call noundef i32 @_ZN2rw5equalERKNS_4RGBAES2_(ptr noundef nonnull align 1 dereferenceable(4) %.067114, ptr noundef nonnull align 1 dereferenceable(4) %27)
  %.not91 = icmp eq i32 %55, 0
  br i1 %.not91, label %104, label %56

56:                                               ; preds = %54, %52
  %57 = and i32 %44, 4096
  %.not92 = icmp eq i32 %57, 0
  br i1 %.not92, label %60, label %58

58:                                               ; preds = %56
  %59 = tail call noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8) %.073111, ptr noundef nonnull align 4 dereferenceable(8) %28)
  %.not93 = icmp eq i32 %59, 0
  br i1 %.not93, label %104, label %60

60:                                               ; preds = %58, %56
  %61 = and i32 %44, 8192
  %.not94 = icmp eq i32 %61, 0
  br i1 %.not94, label %64, label %62

62:                                               ; preds = %60
  %63 = tail call noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8) %.071112, ptr noundef nonnull align 4 dereferenceable(8) %29)
  %.not95 = icmp eq i32 %63, 0
  br i1 %.not95, label %104, label %64

64:                                               ; preds = %62, %60
  %65 = and i32 %44, 65536
  %.not96 = icmp eq i32 %65, 0
  br i1 %.not96, label %.thread.loopexit.split.loop.exit, label %66

66:                                               ; preds = %64
  %67 = load float, ptr %.181108, align 4, !tbaa !27
  %68 = load float, ptr %30, align 4, !tbaa !27
  %69 = fcmp oeq float %67, %68
  br i1 %69, label %70, label %104

70:                                               ; preds = %66
  %71 = getelementptr inbounds i8, ptr %.181108, i64 4
  %72 = load float, ptr %71, align 4, !tbaa !27
  %73 = load float, ptr %31, align 4, !tbaa !27
  %74 = fcmp oeq float %72, %73
  br i1 %74, label %75, label %104

75:                                               ; preds = %70
  %76 = getelementptr inbounds i8, ptr %.181108, i64 8
  %77 = load float, ptr %76, align 4, !tbaa !27
  %78 = load float, ptr %32, align 4, !tbaa !27
  %79 = fcmp oeq float %77, %78
  br i1 %79, label %80, label %104

80:                                               ; preds = %75
  %81 = getelementptr inbounds i8, ptr %.181108, i64 12
  %82 = load float, ptr %81, align 4, !tbaa !27
  %83 = load float, ptr %33, align 4, !tbaa !27
  %84 = fcmp oeq float %82, %83
  br i1 %84, label %85, label %104

85:                                               ; preds = %80
  %86 = load i8, ptr %.178109, align 1, !tbaa !28
  %87 = load i8, ptr %34, align 4, !tbaa !28
  %88 = icmp eq i8 %86, %87
  br i1 %88, label %89, label %104

89:                                               ; preds = %85
  %90 = getelementptr inbounds i8, ptr %.178109, i64 1
  %91 = load i8, ptr %90, align 1, !tbaa !28
  %92 = load i8, ptr %35, align 1, !tbaa !28
  %93 = icmp eq i8 %91, %92
  br i1 %93, label %94, label %104

94:                                               ; preds = %89
  %95 = getelementptr inbounds i8, ptr %.178109, i64 2
  %96 = load i8, ptr %95, align 1, !tbaa !28
  %97 = load i8, ptr %36, align 2, !tbaa !28
  %98 = icmp eq i8 %96, %97
  br i1 %98, label %99, label %104

99:                                               ; preds = %94
  %100 = getelementptr inbounds i8, ptr %.178109, i64 3
  %101 = load i8, ptr %100, align 1, !tbaa !28
  %102 = load i8, ptr %37, align 1, !tbaa !28
  %103 = icmp eq i8 %101, %102
  br i1 %103, label %.thread.loopexit.split.loop.exit121, label %104

104:                                              ; preds = %66, %70, %75, %80, %85, %89, %94, %99, %62, %58, %54, %50, %46
  %105 = getelementptr inbounds i8, ptr %.075110, i64 12
  %106 = getelementptr inbounds i8, ptr %.073111, i64 8
  %107 = getelementptr inbounds i8, ptr %.071112, i64 8
  %108 = getelementptr inbounds i8, ptr %.069113, i64 12
  %109 = getelementptr inbounds i8, ptr %.067114, i64 4
  %110 = getelementptr inbounds i8, ptr %.181108, i64 16
  %111 = getelementptr inbounds i8, ptr %.178109, i64 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %112 = load i32, ptr %12, align 4, !tbaa !12
  %113 = sext i32 %112 to i64
  %.not97 = icmp slt i64 %indvars.iv.next, %113
  br i1 %.not97, label %38, label %.thread, !llvm.loop !29

.thread.loopexit.split.loop.exit:                 ; preds = %64
  %114 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.thread

.thread.loopexit.split.loop.exit121:              ; preds = %99
  %115 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.thread

.thread:                                          ; preds = %104, %.thread.loopexit.split.loop.exit, %.thread.loopexit.split.loop.exit121, %11
  %spec.select = phi i32 [ -1, %11 ], [ %114, %.thread.loopexit.split.loop.exit ], [ %115, %.thread.loopexit.split.loop.exit121 ], [ -1, %104 ]
  ret i32 %spec.select
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_4RGBAES2_(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5equalERKNS_9TexCoordsES2_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

attributes #0 = { 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 #1 = { inlinehint 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" }

!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, !10, i64 40}
!6 = !{!"_ZTSN2rw4SkinE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !7, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 32}
!12 = !{!13, !7, i64 28}
!13 = !{!"_ZTSN2rw8GeometryE", !14, i64 0, !7, i64 16, !15, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !10, i64 40, !10, i64 48, !8, i64 56, !10, i64 120, !16, i64 128, !10, i64 144, !10, i64 152, !7, i64 160}
!14 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !10, i64 8}
!15 = !{!"short", !8, i64 0}
!16 = !{!"_ZTSN2rw12MaterialListE", !10, i64 0, !7, i64 8, !7, i64 12}
!17 = !{!13, !10, i64 48}
!18 = !{!13, !10, i64 120}
!19 = !{!20, !10, i64 32}
!20 = !{!"_ZTSN2rw11MorphTargetE", !10, i64 0, !21, i64 8, !10, i64 24, !10, i64 32}
!21 = !{!"_ZTSN2rw6SphereE", !22, i64 0, !23, i64 12}
!22 = !{!"_ZTSN2rw3V3dE", !23, i64 0, !23, i64 4, !23, i64 8}
!23 = !{!"float", !8, i64 0}
!24 = !{!10, !10, i64 0}
!25 = !{!20, !10, i64 24}
!26 = !{!7, !7, i64 0}
!27 = !{!23, !23, i64 0}
!28 = !{!8, !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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