; LLVM IR from yangfengzzz/DigitalVox3 :: vox.render/runtime/animation (local_to_model_job)

; 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::math::Float4x4" = type { [4 x <4 x float>] }
%"struct.vox::math::SoaFloat4x4" = type { [4 x %"struct.vox::math::SoaFloat4"] }
%"struct.vox::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::math::SoaTransform" = type { %"struct.vox::math::SoaFloat3", %"struct.vox::math::SoaQuaternion", %"struct.vox::math::SoaFloat3" }
%"struct.vox::math::SoaQuaternion" = type { <4 x float>, <4 x float>, <4 x float>, <4 x float> }
%"struct.vox::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::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 ptr, align 8
  %13 = alloca %"struct.vox::math::SoaFloat4x4", align 16
  %14 = alloca [4 x %"struct.vox::math::Float4x4"], align 16
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"struct.vox::math::Float4x4", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8
  %20 = call noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %19)
  br i1 %20, label %22, label %21

21:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %159

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

33:                                               ; preds = %22
  br label %37

34:                                               ; preds = %22
  %35 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  br label %37

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

57:                                               ; preds = %37
  %58 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 4
  %59 = load i8, ptr %58, align 8, !tbaa !20, !range !21, !noundef !22
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %71

61:                                               ; preds = %57
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = load i32, ptr %9, align 4, !tbaa !18
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %62, i64 noundef %64)
  %66 = load i16, ptr %65, align 2, !tbaa !23
  %67 = sext i16 %66 to i32
  %68 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 2
  %69 = load i32, ptr %68, align 8, !tbaa !19
  %70 = icmp sge i32 %67, %69
  br label %71

71:                                               ; preds = %61, %57
  %72 = phi i1 [ true, %57 ], [ %70, %61 ]
  br label %73

73:                                               ; preds = %71, %37
  %74 = phi i1 [ false, %37 ], [ %72, %71 ]
  %75 = zext i1 %74 to i32
  store i32 %75, ptr %10, align 4, !tbaa !18
  br label %76

76:                                               ; preds = %157, %73
  %77 = load i32, ptr %10, align 4, !tbaa !18
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %158

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %81 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 5
  %82 = load i32, ptr %9, align 4, !tbaa !18
  %83 = sdiv i32 %82, 4
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_4math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %81, i64 noundef %84)
  store ptr %85, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %13) #6
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.vox::math::SoaTransform", ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.vox::math::SoaTransform", ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.vox::math::SoaTransform", ptr %90, i32 0, i32 2
  call void @_ZN3vox4math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind writable sret(%"struct.vox::math::SoaFloat4x4") align 16 %13, ptr noundef nonnull align 16 dereferenceable(48) %87, ptr noundef nonnull align 16 dereferenceable(64) %89, ptr noundef nonnull align 16 dereferenceable(48) %91)
  call void @llvm.lifetime.start.p0(i64 256, ptr %14) #6
  %92 = getelementptr inbounds %"struct.vox::math::SoaFloat4x4", ptr %13, i32 0, i32 0
  %93 = getelementptr inbounds [4 x %"struct.vox::math::SoaFloat4"], ptr %92, i64 0, i64 0
  %94 = getelementptr inbounds %"struct.vox::math::SoaFloat4", ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds [4 x %"struct.vox::math::Float4x4"], ptr %14, i64 0, i64 0
  %96 = getelementptr inbounds %"struct.vox::math::Float4x4", ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds [4 x <4 x float>], ptr %96, i64 0, i64 0
  call void @_ZN3vox4math14Transpose16x16EPKDv4_fPS1_(ptr noundef %94, ptr noundef %97)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %98 = load i32, ptr %9, align 4, !tbaa !18
  %99 = add nsw i32 %98, 4
  %100 = and i32 %99, -4
  store i32 %100, ptr %15, align 4, !tbaa !18
  br label %101

101:                                              ; preds = %154, %80
  %102 = load i32, ptr %9, align 4, !tbaa !18
  %103 = load i32, ptr %15, align 4, !tbaa !18
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %108

105:                                              ; preds = %101
  %106 = load i32, ptr %10, align 4, !tbaa !18
  %107 = icmp ne i32 %106, 0
  br label %108

108:                                              ; preds = %105, %101
  %109 = phi i1 [ false, %101 ], [ %107, %105 ]
  br i1 %109, label %111, label %110

110:                                              ; preds = %108
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %157

111:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !18
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %112, i64 noundef %114)
  %116 = load i16, ptr %115, align 2, !tbaa !23
  %117 = sext i16 %116 to i32
  store i32 %117, ptr %16, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %118 = load i32, ptr %16, align 4, !tbaa !18
  %119 = icmp eq i32 %118, -1
  br i1 %119, label %120, label %122

120:                                              ; preds = %111
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  br label %127

122:                                              ; preds = %111
  %123 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 6
  %124 = load i32, ptr %16, align 4, !tbaa !18
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_4math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %123, i64 noundef %125)
  br label %127

127:                                              ; preds = %122, %120
  %128 = phi ptr [ %121, %120 ], [ %126, %122 ]
  store ptr %128, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #6
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !18
  %131 = and i32 %130, 3
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [4 x %"struct.vox::math::Float4x4"], ptr %14, i64 0, i64 %132
  call void @_ZN3vox4mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind writable sret(%"struct.vox::math::Float4x4") align 16 %18, ptr noundef nonnull align 16 dereferenceable(64) %129, ptr noundef nonnull align 16 dereferenceable(64) %133)
  %134 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 6
  %135 = load i32, ptr %9, align 4, !tbaa !18
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_4math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %134, i64 noundef %136)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %137, ptr align 16 %18, i64 64, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %138

138:                                              ; preds = %127
  %139 = load i32, ptr %9, align 4, !tbaa !18
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !18
  %141 = load i32, ptr %9, align 4, !tbaa !18
  %142 = load i32, ptr %8, align 4, !tbaa !18
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %154

144:                                              ; preds = %138
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load i32, ptr %9, align 4, !tbaa !18
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %145, i64 noundef %147)
  %149 = load i16, ptr %148, align 2, !tbaa !23
  %150 = sext i16 %149 to i32
  %151 = getelementptr inbounds %"struct.vox::animation::LocalToModelJob", ptr %19, i32 0, i32 2
  %152 = load i32, ptr %151, align 8, !tbaa !19
  %153 = icmp sge i32 %150, %152
  br label %154

154:                                              ; preds = %144, %138
  %155 = phi i1 [ false, %138 ], [ %153, %144 ]
  %156 = zext i1 %155 to i32
  store i32 %156, ptr %10, align 4, !tbaa !18
  br label %101, !llvm.loop !27

157:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 256, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %76, !llvm.loop !29

158:                                              ; preds = %79
  store i1 true, ptr %2, align 1
  store i32 1, ptr %11, 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 %159

159:                                              ; preds = %158, %21
  %160 = load i1, ptr %2, align 1
  ret i1 %160
}

; 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 @_ZN3vox4math8Float4x48identityEv(ptr dead_on_unwind noalias writable sret(%"struct.vox::math::Float4x4") align 16) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3vox4math3MinIiEET_S2_S2_(i32 noundef, i32 noundef) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3vox4math3MaxIiEET_S2_S2_(i32 noundef, i32 noundef) #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_4math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox4math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind noalias writable sret(%"struct.vox::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 @_ZN3vox4math14Transpose16x16EPKDv4_fPS1_(ptr noundef, ptr noundef) #2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox4mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind noalias writable sret(%"struct.vox::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 = { alwaysinline 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_4math12SoaTransformEEE", !6, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3vox4spanINS_4math8Float4x4EEE", !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::math::Float4x4" = type { [4 x <4 x float>] }
%"struct.vox::math::SoaFloat4x4" = type { [4 x %"struct.vox::math::SoaFloat4"] }
%"struct.vox::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::math::Float4x4", align 16
  %4 = alloca %"struct.vox::math::SoaFloat4x4", align 16
  %5 = alloca [4 x %"struct.vox::math::Float4x4"], align 16
  %6 = alloca %"struct.vox::math::Float4x4", align 16
  %7 = tail call noundef zeroext i1 @_ZNK3vox9animation15LocalToModelJob8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  br i1 %7, label %8, label %77

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

31:                                               ; preds = %8
  %32 = load i8, ptr %25, align 8, !tbaa !18, !range !19, !noundef !20
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %.lr.ph39

34:                                               ; preds = %31
  %35 = sext i32 %29 to i64
  %36 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %35)
  %37 = load i16, ptr %36, align 2, !tbaa !21
  %38 = sext i16 %37 to i32
  %39 = load i32, ptr %23, align 8, !tbaa !17
  %.not41 = icmp sgt i32 %39, %38
  br i1 %.not41, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %31, %34
  %40 = getelementptr inbounds i8, ptr %0, i64 32
  %41 = getelementptr inbounds i8, ptr %0, i64 48
  %42 = sext i32 %22 to i64
  br label %43

._crit_edge40:                                    ; preds = %._crit_edge, %8, %34
  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 %77

43:                                               ; preds = %.lr.ph39, %._crit_edge
  %.02737 = phi i32 [ %29, %.lr.ph39 ], [ %.1.lcssa, %._crit_edge ]
  %44 = sdiv i32 %.02737, 4
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 16 dereferenceable(160) ptr @_ZNK3vox4spanIKNS_4math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %40, i64 noundef %45)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #6
  %47 = getelementptr inbounds i8, ptr %46, i64 48
  %48 = getelementptr inbounds i8, ptr %46, i64 112
  call void @_ZN3vox4math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::math::SoaFloat4x4") align 16 %4, ptr noundef nonnull align 16 dereferenceable(48) %46, ptr noundef nonnull align 16 dereferenceable(64) %47, ptr noundef nonnull align 16 dereferenceable(48) %48)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #6
  call void @_ZN3vox4math14Transpose16x16EPKDv4_fPS1_(ptr noundef nonnull %4, ptr noundef nonnull %5)
  %49 = and i32 %.02737, -4
  %50 = add nsw i32 %49, 4
  %51 = icmp slt i32 %.02737, %50
  br i1 %51, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %43
  %52 = sext i32 %.02737 to i64
  %53 = sext i32 %50 to i64
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %63, %69
  %54 = phi i1 [ %74, %69 ], [ false, %63 ]
  %55 = zext i1 %54 to i32
  %56 = trunc nsw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %43
  %.129.lcssa = phi i32 [ 1, %43 ], [ %55, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.02737, %43 ], [ %56, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  %.not = icmp eq i32 %.129.lcssa, 0
  br i1 %.not, label %._crit_edge40, label %43, !llvm.loop !23

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

60:                                               ; preds = %.lr.ph
  %61 = sext i16 %58 to i64
  %62 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_4math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %41, i64 noundef %61)
  br label %63

63:                                               ; preds = %.lr.ph, %60
  %64 = phi ptr [ %62, %60 ], [ %spec.select, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  %65 = and i64 %indvars.iv, 3
  %66 = getelementptr inbounds [4 x %"struct.vox::math::Float4x4"], ptr %5, i64 0, i64 %65
  call void @_ZN3vox4mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::math::Float4x4") align 16 %6, ptr noundef nonnull align 16 dereferenceable(64) %64, ptr noundef nonnull align 16 dereferenceable(64) %66)
  %67 = call noundef nonnull align 16 dereferenceable(64) ptr @_ZNK3vox4spanINS_4math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %41, i64 noundef %indvars.iv)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %67, ptr noundef nonnull align 16 dereferenceable(64) %6, i64 64, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %68 = icmp slt i64 %indvars.iv.next, %42
  br i1 %68, label %69, label %._crit_edge.loopexit

69:                                               ; preds = %63
  %70 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZNK3vox4spanIKsEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv.next)
  %71 = load i16, ptr %70, align 2, !tbaa !21
  %72 = sext i16 %71 to i32
  %73 = load i32, ptr %23, align 8, !tbaa !17
  %74 = icmp sle i32 %73, %72
  %75 = icmp slt i64 %indvars.iv.next, %53
  %76 = select i1 %75, i1 %74, i1 false
  br i1 %76, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !27

77:                                               ; preds = %1, %._crit_edge40
  ret i1 %7
}

; 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 @_ZN3vox4math8Float4x48identityEv(ptr dead_on_unwind noalias writable sret(%"struct.vox::math::Float4x4") align 16) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3vox4math3MinIiEET_S2_S2_(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3vox4math3MaxIiEET_S2_S2_(i32 noundef, i32 noundef) 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_4math12SoaTransformEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox4math11SoaFloat4x410FromAffineERKNS0_9SoaFloat3ERKNS0_13SoaQuaternionES4_(ptr dead_on_unwind noalias writable sret(%"struct.vox::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 @_ZN3vox4math14Transpose16x16EPKDv4_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_4math8Float4x4EEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3vox4mathmlERKNS0_8Float4x4ES3_(ptr dead_on_unwind noalias writable sret(%"struct.vox::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 = { alwaysinline 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_4math12SoaTransformEEE", !7, i64 0, !13, i64 8}
!13 = !{!"long", !8, i64 0}
!14 = !{!"_ZTSN3vox4spanINS_4math8Float4x4EEE", !7, i64 0, !13, i64 8}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !10, i64 20}
!17 = !{!6, !10, i64 16}
!18 = !{!6, !11, i64 24}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{i64 0, i64 64, !26}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !24}


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