; LLVM IR from yangfengzzz/Arche-webgpu :: vox.animation/runtime/local_to_model_job.ll (ZNK3vox9animation15LocalToModelJob3RunEv)

; 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.vox::span.4" = type { ptr, i64 }
%"struct.vox::simd_math::Float4x4" = type { [4 x <4 x float>] }
%"struct.vox::simd_math::SoaFloat4x4" = type { [4 x %"struct.vox::simd_math::SoaFloat4"] }
%"struct.vox::simd_math::SoaFloat4" = type { <4 x float>, <4 x float>, <4 x float>, <4 x float> }
%"struct.vox::animation::LocalToModelJob" = type { ptr, ptr, i32, i32, i8, %"struct.vox::span", %"struct.vox::span.0" }
%"struct.vox::span" = type { ptr, i64 }
%"struct.vox::span.0" = type { ptr, i64 }
%"struct.vox::simd_math::SoaTransform" = type { %"struct.vox::simd_math::SoaFloat3", %"struct.vox::simd_math::SoaQuaternion", %"struct.vox::simd_math::SoaFloat3" }
%"struct.vox::simd_math::SoaQuaternion" = type { <4 x float>, <4 x float>, <4 x float>, <4 x float> }
%"struct.vox::simd_math::SoaFloat3" = type { <4 x float>, <4 x float>, <4 x float> }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3vox9animation8Skeleton10num_jointsEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob3RunEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #0 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.vox::span.4", align 8
  %6 = alloca %"struct.vox::simd_math::Float4x4", align 16
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"struct.vox::simd_math::SoaFloat4x4", align 16
  %18 = alloca [4 x %"struct.vox::simd_math::Float4x4"], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.vox::simd_math::Float4x4", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8
  %24 = call noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %23)
  br i1 %24, label %26, label %25

25:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %165

26:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %27 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call { ptr, i64 } @_ZNK3vox9animation8Skeleton13joint_parentsEv(ptr noundef nonnull align 8 dereferenceable(48) %28)
  %30 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %31 = extractvalue { ptr, i64 } %29, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %33 = extractvalue { ptr, i64 } %29, 1
  store i64 %33, ptr %32, align 8
  store ptr %5, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #6
  call void @_ZN3vox9simd_math8Float4x48identityEv(ptr dead_on_unwind writable sret(%"struct.vox::simd_math::Float4x4") align 16 %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %34 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %26
  br label %41

38:                                               ; preds = %26
  %39 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  br label %41

41:                                               ; preds = %38, %37
  %42 = phi ptr [ %6, %37 ], [ %40, %38 ]
  store ptr %42, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %43 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !17
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %46 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call noundef i32 @_ZNK3vox9animation8Skeleton10num_jointsEv(ptr noundef nonnull align 8 dereferenceable(48) %47)
  store i32 %48, ptr %10, align 4, !tbaa !18
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %50 = load i32, ptr %49, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  store i32 %50, ptr %8, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %51 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 2
  %52 = load i32, ptr %51, align 8, !tbaa !19
  %53 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 4
  %54 = load i8, ptr %53, align 8, !tbaa !20, !range !21, !noundef !22
  %55 = trunc i8 %54 to i1
  %56 = zext i1 %55 to i32
  %57 = add nsw i32 %52, %56
  store i32 %57, ptr %12, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !18
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %59 = load i32, ptr %58, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  store i32 %59, ptr %11, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %60 = load i32, ptr %11, align 4, !tbaa !18
  %61 = load i32, ptr %8, align 4, !tbaa !18
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %79

63:                                               ; preds = %41
  %64 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 4
  %65 = load i8, ptr %64, align 8, !tbaa !20, !range !21, !noundef !22
  %66 = trunc i8 %65 to i1
  br i1 %66, label %67, label %77

67:                                               ; preds = %63
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = load i32, ptr %11, align 4, !tbaa !18
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %68, i64 noundef %70)
  %72 = load i16, ptr %71, align 2, !tbaa !23
  %73 = sext i16 %72 to i32
  %74 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !19
  %76 = icmp sge i32 %73, %75
  br label %77

77:                                               ; preds = %67, %63
  %78 = phi i1 [ true, %63 ], [ %76, %67 ]
  br label %79

79:                                               ; preds = %77, %41
  %80 = phi i1 [ false, %41 ], [ %78, %77 ]
  %81 = zext i1 %80 to i32
  store i32 %81, ptr %14, align 4, !tbaa !18
  br label %82

82:                                               ; preds = %163, %79
  %83 = load i32, ptr %14, align 4, !tbaa !18
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %164

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %87 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 5
  %88 = load i32, ptr %11, align 4, !tbaa !18
  %89 = sdiv i32 %88, 4
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_9simd_math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %87, i64 noundef %90)
  store ptr %91, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %17) #6
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.vox::simd_math::SoaTransform", ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.vox::simd_math::SoaTransform", ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.vox::simd_math::SoaTransform", ptr %96, i32 0, i32 2
  call void @_ZN3vox9simd_math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind writable sret(%"struct.vox::simd_math::SoaFloat4x4") align 16 %17, ptr noundef nonnull align 16 dereferenceable(48) %93, ptr noundef nonnull align 16 dereferenceable(64) %95, ptr noundef nonnull align 16 dereferenceable(48) %97)
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #6
  %98 = getelementptr inbounds %"struct.vox::simd_math::SoaFloat4x4", ptr %17, i32 0, i32 0
  %99 = getelementptr inbounds [4 x %"struct.vox::simd_math::SoaFloat4"], ptr %98, i64 0, i64 0
  %100 = getelementptr inbounds %"struct.vox::simd_math::SoaFloat4", ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds [4 x %"struct.vox::simd_math::Float4x4"], ptr %18, i64 0, i64 0
  %102 = getelementptr inbounds %"struct.vox::simd_math::Float4x4", ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds [4 x <4 x float>], ptr %102, i64 0, i64 0
  call void @_ZN3vox9simd_math14Transpose16x16EPKDv4_fPS1_(ptr noundef %100, ptr noundef %103)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %104 = load i32, ptr %11, align 4, !tbaa !18
  %105 = add nsw i32 %104, 4
  %106 = and i32 %105, -4
  store i32 %106, ptr %19, align 4, !tbaa !18
  br label %107

107:                                              ; preds = %160, %86
  %108 = load i32, ptr %11, align 4, !tbaa !18
  %109 = load i32, ptr %19, align 4, !tbaa !18
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %107
  %112 = load i32, ptr %14, align 4, !tbaa !18
  %113 = icmp ne i32 %112, 0
  br label %114

114:                                              ; preds = %111, %107
  %115 = phi i1 [ false, %107 ], [ %113, %111 ]
  br i1 %115, label %117, label %116

116:                                              ; preds = %114
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %163

117:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !18
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %118, i64 noundef %120)
  %122 = load i16, ptr %121, align 2, !tbaa !23
  %123 = sext i16 %122 to i32
  store i32 %123, ptr %20, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %124 = load i32, ptr %20, align 4, !tbaa !18
  %125 = icmp eq i32 %124, -1
  br i1 %125, label %126, label %128

126:                                              ; preds = %117
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  br label %133

128:                                              ; preds = %117
  %129 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 6
  %130 = load i32, ptr %20, align 4, !tbaa !18
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %129, i64 noundef %131)
  br label %133

133:                                              ; preds = %128, %126
  %134 = phi ptr [ %127, %126 ], [ %132, %128 ]
  store ptr %134, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #6
  %135 = load ptr, ptr %21, align 8, !tbaa !5
  %136 = load i32, ptr %11, align 4, !tbaa !18
  %137 = and i32 %136, 3
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [4 x %"struct.vox::simd_math::Float4x4"], ptr %18, i64 0, i64 %138
  call void @_ZN3vox9simd_mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind writable sret(%"struct.vox::simd_math::Float4x4") align 16 %22, ptr noundef nonnull align 16 dereferenceable(64) %135, ptr noundef nonnull align 16 dereferenceable(64) %139)
  %140 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 6
  %141 = load i32, ptr %11, align 4, !tbaa !18
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %140, i64 noundef %142)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %143, ptr align 16 %22, i64 64, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %144

144:                                              ; preds = %133
  %145 = load i32, ptr %11, align 4, !tbaa !18
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !18
  %147 = load i32, ptr %11, align 4, !tbaa !18
  %148 = load i32, ptr %8, align 4, !tbaa !18
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %150, label %160

150:                                              ; preds = %144
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = load i32, ptr %11, align 4, !tbaa !18
  %153 = sext i32 %152 to i64
  %154 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %151, i64 noundef %153)
  %155 = load i16, ptr %154, align 2, !tbaa !23
  %156 = sext i16 %155 to i32
  %157 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %23, i32 0, i32 2
  %158 = load i32, ptr %157, align 8, !tbaa !19
  %159 = icmp sge i32 %156, %158
  br label %160

160:                                              ; preds = %150, %144
  %161 = phi i1 [ false, %144 ], [ %159, %150 ]
  %162 = zext i1 %161 to i32
  store i32 %162, ptr %14, align 4, !tbaa !18
  br label %107, !llvm.loop !27

163:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %82, !llvm.loop !29

164:                                              ; preds = %85
  store i1 true, ptr %2, align 1
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %165

165:                                              ; preds = %164, %25
  %166 = load i1, ptr %2, align 1
  ret i1 %166
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3vox9animation8Skeleton13joint_parentsEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math8Float4x48identityEv(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::Float4x4") align 16) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_9simd_math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::SoaFloat4x4") align 16, ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(48)) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math14Transpose16x16EPKDv4_fPS1_(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::Float4x4") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"_ZTSN3vox9animation15LocalToModelJobE", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !13, i64 32, !15, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN3vox4spanIKNS_9simd_math12SoaTransformEEE", !6, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3vox4spanINS_9simd_math8Float4x4EEE", !6, i64 0, !14, i64 8}
!16 = !{!10, !6, i64 8}
!17 = !{!10, !11, i64 20}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !11, i64 16}
!20 = !{!10, !12, i64 24}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{i64 0, i64 64, !26}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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.vox::span.4" = type { ptr, i64 }
%"struct.vox::simd_math::Float4x4" = type { [4 x <4 x float>] }
%"struct.vox::simd_math::SoaFloat4x4" = type { [4 x %"struct.vox::simd_math::SoaFloat4"] }
%"struct.vox::simd_math::SoaFloat4" = type { <4 x float>, <4 x float>, <4 x float>, <4 x float> }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3vox9animation8Skeleton10num_jointsEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob3RunEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #0 align 2 {
  %2 = alloca %"struct.vox::span.4", align 8
  %3 = alloca %"struct.vox::simd_math::Float4x4", align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.vox::simd_math::SoaFloat4x4", align 16
  %9 = alloca [4 x %"struct.vox::simd_math::Float4x4"], align 16
  %10 = alloca %"struct.vox::simd_math::Float4x4", align 16
  %11 = tail call noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  br i1 %11, label %12, label %83

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = tail call { ptr, i64 } @_ZNK3vox9animation8Skeleton13joint_parentsEv(ptr noundef nonnull align 8 dereferenceable(48) %13)
  %15 = extractvalue { ptr, i64 } %14, 0
  store ptr %15, ptr %2, align 8
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = extractvalue { ptr, i64 } %14, 1
  store i64 %17, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #6
  call void @_ZN3vox9simd_math8Float4x48identityEv(ptr dead_on_unwind nonnull writable sret(%"struct.vox::simd_math::Float4x4") align 16 %3)
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = icmp eq ptr %19, null
  %spec.select = select i1 %20, ptr %3, ptr %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %21 = getelementptr inbounds i8, ptr %0, i64 20
  %22 = load i32, ptr %21, align 4, !tbaa !16
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %4, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %24 = load ptr, ptr %0, align 8, !tbaa !5
  %25 = call noundef i32 @_ZNK3vox9animation8Skeleton10num_jointsEv(ptr noundef nonnull align 8 dereferenceable(48) %24)
  store i32 %25, ptr %5, align 4, !tbaa !17
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %27 = load i32, ptr %26, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = load i8, ptr %30, align 8, !tbaa !19, !range !20, !noundef !21
  %32 = zext nneg i8 %31 to i32
  %33 = add nsw i32 %29, %32
  store i32 %33, ptr %6, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !17
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %35 = load i32, ptr %34, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %36 = icmp slt i32 %35, %27
  br i1 %36, label %37, label %._crit_edge40

37:                                               ; preds = %12
  %38 = load i8, ptr %30, align 8, !tbaa !19, !range !20, !noundef !21
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %40, label %.lr.ph39

40:                                               ; preds = %37
  %41 = sext i32 %35 to i64
  %42 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %41)
  %43 = load i16, ptr %42, align 2, !tbaa !22
  %44 = sext i16 %43 to i32
  %45 = load i32, ptr %28, align 8, !tbaa !18
  %.not41 = icmp sgt i32 %45, %44
  br i1 %.not41, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %37, %40
  %46 = getelementptr inbounds i8, ptr %0, i64 32
  %47 = getelementptr inbounds i8, ptr %0, i64 48
  %48 = sext i32 %27 to i64
  br label %49

._crit_edge40:                                    ; preds = %._crit_edge, %12, %40
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  br label %83

49:                                               ; preds = %.lr.ph39, %._crit_edge
  %.02737 = phi i32 [ %35, %.lr.ph39 ], [ %.1.lcssa, %._crit_edge ]
  %50 = sdiv i32 %.02737, 4
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_9simd_math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %46, i64 noundef %51)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %8) #6
  %53 = getelementptr inbounds i8, ptr %52, i64 48
  %54 = getelementptr inbounds i8, ptr %52, i64 112
  call void @_ZN3vox9simd_math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::simd_math::SoaFloat4x4") align 16 %8, ptr noundef nonnull align 16 dereferenceable(48) %52, ptr noundef nonnull align 16 dereferenceable(64) %53, ptr noundef nonnull align 16 dereferenceable(48) %54)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %9) #6
  call void @_ZN3vox9simd_math14Transpose16x16EPKDv4_fPS1_(ptr noundef nonnull %8, ptr noundef nonnull %9)
  %55 = and i32 %.02737, -4
  %56 = add nsw i32 %55, 4
  %57 = icmp slt i32 %.02737, %56
  br i1 %57, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %49
  %58 = sext i32 %.02737 to i64
  %59 = sext i32 %56 to i64
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %69, %75
  %60 = phi i1 [ %80, %75 ], [ false, %69 ]
  %61 = zext i1 %60 to i32
  %62 = trunc nsw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %49
  %.129.lcssa = phi i32 [ 1, %49 ], [ %61, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.02737, %49 ], [ %62, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %8) #6
  %.not = icmp eq i32 %.129.lcssa, 0
  br i1 %.not, label %._crit_edge40, label %49, !llvm.loop !24

.lr.ph:                                           ; preds = %.lr.ph.preheader, %75
  %indvars.iv = phi i64 [ %58, %.lr.ph.preheader ], [ %indvars.iv.next, %75 ]
  %63 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv)
  %64 = load i16, ptr %63, align 2, !tbaa !22
  %65 = icmp eq i16 %64, -1
  br i1 %65, label %69, label %66

66:                                               ; preds = %.lr.ph
  %67 = sext i16 %64 to i64
  %68 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef %67)
  br label %69

69:                                               ; preds = %.lr.ph, %66
  %70 = phi ptr [ %68, %66 ], [ %spec.select, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #6
  %71 = and i64 %indvars.iv, 3
  %72 = getelementptr inbounds [4 x %"struct.vox::simd_math::Float4x4"], ptr %9, i64 0, i64 %71
  call void @_ZN3vox9simd_mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::simd_math::Float4x4") align 16 %10, ptr noundef nonnull align 16 dereferenceable(64) %70, ptr noundef nonnull align 16 dereferenceable(64) %72)
  %73 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef %indvars.iv)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %73, ptr noundef nonnull align 16 dereferenceable(64) %10, i64 64, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #6
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %74 = icmp slt i64 %indvars.iv.next, %48
  br i1 %74, label %75, label %._crit_edge.loopexit

75:                                               ; preds = %69
  %76 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv.next)
  %77 = load i16, ptr %76, align 2, !tbaa !22
  %78 = sext i16 %77 to i32
  %79 = load i32, ptr %28, align 8, !tbaa !18
  %80 = icmp sle i32 %79, %78
  %81 = icmp slt i64 %indvars.iv.next, %59
  %82 = select i1 %81, i1 %80, i1 false
  br i1 %82, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !28

83:                                               ; preds = %1, %._crit_edge40
  ret i1 %11
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3vox9animation8Skeleton13joint_parentsEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math8Float4x48identityEv(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::Float4x4") align 16) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_9simd_math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::SoaFloat4x4") align 16, ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_math14Transpose16x16EPKDv4_fPS1_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_9simd_math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox9simd_mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind noalias writable sret(%"struct.vox::simd_math::Float4x4") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

attributes #0 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"_ZTSN3vox9animation15LocalToModelJobE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !11, i64 24, !12, i64 32, !14, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN3vox4spanIKNS_9simd_math12SoaTransformEEE", !7, i64 0, !13, i64 8}
!13 = !{!"long", !8, i64 0}
!14 = !{!"_ZTSN3vox4spanINS_9simd_math8Float4x4EEE", !7, i64 0, !13, i64 8}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !10, i64 20}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !10, i64 16}
!19 = !{!6, !11, i64 24}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !23, i64 0}
!23 = !{!"short", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{i64 0, i64 64, !27}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !25}


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