; LLVM IR from aap/librw :: src/uvanim.ll (ZN2rw6UVAnim11applyUpdateEPNS_8MaterialE)

; 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::Matrix" = type { %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32 }
%"struct.rw::V3d" = type { float, float, float }
%"struct.rw::UVAnim" = type { [2 x ptr], [8 x ptr] }
%"struct.rw::AnimInterpolator" = type { ptr, float, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr }
%"struct.rw::UVAnimCustomData" = type { [32 x i8], [8 x i32], i32 }

@_ZN2rw12uvAnimOffsetE = external dso_local global i32, align 4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw6UVAnim11applyUpdateEPNS_8MaterialE(ptr noundef %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.rw::Matrix", align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = load i32, ptr @_ZN2rw12uvAnimOffsetE, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i8, ptr %13, i64 %15
  store ptr %16, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %36, %1
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = icmp slt i32 %18, 2
  br i1 %19, label %20, label %39

20:                                               ; preds = %17
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.rw::UVAnim", ptr %21, i32 0, i32 0
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2 x ptr], ptr %22, i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %35

28:                                               ; preds = %20
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.rw::UVAnim", ptr %29, i32 0, i32 0
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [2 x ptr], ptr %30, i64 0, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  call void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64) %34)
  br label %35

35:                                               ; preds = %28, %20
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !9
  br label %17, !llvm.loop !11

39:                                               ; preds = %17
  call void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64) %6)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %104, %39
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = icmp slt i32 %41, 8
  br i1 %42, label %43, label %107

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.rw::UVAnim", ptr %44, i32 0, i32 1
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [8 x ptr], ptr %45, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %8, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %43
  store i32 7, ptr %9, align 4
  br label %101

53:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.rw::AnimInterpolator", ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !13
  %57 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %56)
  store ptr %57, ptr %10, align 8, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %97, %53
  %59 = load i32, ptr %4, align 4, !tbaa !9
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.rw::AnimInterpolator", ptr %60, i32 0, i32 6
  %62 = load i32, ptr %61, align 4, !tbaa !16
  %63 = icmp slt i32 %59, %62
  br i1 %63, label %64, label %100

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !9
  %67 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %65, i32 noundef %66)
  store ptr %67, ptr %11, align 8, !tbaa !5
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.rw::UVAnimCustomData", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [8 x i32], ptr %69, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !9
  store i32 %73, ptr %5, align 4, !tbaa !9
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 2
  br i1 %75, label %76, label %96

76:                                               ; preds = %64
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.rw::UVAnim", ptr %77, i32 0, i32 0
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2 x ptr], ptr %78, i64 0, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %96

84:                                               ; preds = %76
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.rw::AnimInterpolator", ptr %85, i32 0, i32 7
  %87 = load ptr, ptr %86, align 8, !tbaa !17
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  call void %87(ptr noundef %6, ptr noundef %88)
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.rw::UVAnim", ptr %89, i32 0, i32 0
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2 x ptr], ptr %90, i64 0, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %94, ptr noundef %6, i32 noundef 1)
  br label %96

96:                                               ; preds = %84, %76, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %4, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %4, align 4, !tbaa !9
  br label %58, !llvm.loop !18

100:                                              ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  store i32 0, ptr %9, align 4
  br label %101

101:                                              ; preds = %100, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %102 = load i32, ptr %9, align 4
  switch i32 %102, label %123 [
    i32 0, label %103
    i32 7, label %104
  ]

103:                                              ; preds = %101
  br label %104

104:                                              ; preds = %103, %101
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %3, align 4, !tbaa !9
  br label %40, !llvm.loop !19

107:                                              ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = call noundef ptr @_ZN2rw5MatFX3getEPKNS_8MaterialE(ptr noundef %108)
  store ptr %109, ptr %12, align 8, !tbaa !5
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %122

112:                                              ; preds = %107
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.rw::UVAnim", ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds [2 x ptr], ptr %115, i64 0, i64 0
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.rw::UVAnim", ptr %118, i32 0, i32 0
  %120 = getelementptr inbounds [2 x ptr], ptr %119, i64 0, i64 1
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  call void @_ZN2rw5MatFX22setUVTransformMatricesEPNS_6MatrixES2_(ptr noundef nonnull align 8 dereferenceable(88) %113, ptr noundef %117, ptr noundef %121)
  br label %122

122:                                              ; preds = %112, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void

123:                                              ; preds = %101
  unreachable
}

declare void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #2 align 2

declare noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef, i32 noundef) #3

declare noundef ptr @_ZN2rw5MatFX3getEPKNS_8MaterialE(ptr noundef) #3

declare void @_ZN2rw5MatFX22setUVTransformMatricesEPNS_6MatrixES2_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef, ptr noundef) #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 = { "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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN2rw16AnimInterpolatorE", !6, i64 0, !15, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !10, i64 36}
!17 = !{!14, !6, i64 40}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.rw::Matrix" = type { %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32 }
%"struct.rw::V3d" = type { float, float, float }

@_ZN2rw12uvAnimOffsetE = external dso_local local_unnamed_addr global i32, align 4

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw6UVAnim11applyUpdateEPNS_8MaterialE(ptr noundef %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %"struct.rw::Matrix", align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #4
  %3 = load i32, ptr @_ZN2rw12uvAnimOffsetE, align 4, !tbaa !5
  %4 = sext i32 %3 to i64
  %5 = getelementptr inbounds i8, ptr %0, i64 %4
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %.not37 = icmp eq ptr %6, null
  br i1 %.not37, label %8, label %7

7:                                                ; preds = %1
  tail call void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64) %6)
  br label %8

8:                                                ; preds = %1, %7
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %.not37.1 = icmp eq ptr %10, null
  br i1 %.not37.1, label %12, label %11

11:                                               ; preds = %8
  tail call void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64) %10)
  br label %12

12:                                               ; preds = %11, %8
  call void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64) %2)
  %13 = getelementptr inbounds i8, ptr %5, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp eq ptr %14, null
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %12
  %17 = load ptr, ptr %14, align 8, !tbaa !11
  %18 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %17)
  %19 = getelementptr inbounds i8, ptr %14, i64 36
  %20 = load i32, ptr %19, align 4, !tbaa !14
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %16
  %22 = getelementptr inbounds i8, ptr %18, i64 32
  %23 = getelementptr inbounds i8, ptr %14, i64 40
  br label %24

24:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %25 = trunc nuw nsw i64 %indvars.iv to i32
  %26 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %14, i32 noundef %25)
  %27 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 %indvars.iv
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 2
  br i1 %29, label %30, label %38

30:                                               ; preds = %24
  %31 = sext i32 %28 to i64
  %32 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %.not36 = icmp eq ptr %33, null
  br i1 %.not36, label %38, label %34

34:                                               ; preds = %30
  %35 = load ptr, ptr %23, align 8, !tbaa !15
  call void %35(ptr noundef nonnull %2, ptr noundef %26)
  %36 = load ptr, ptr %32, align 8, !tbaa !9
  %37 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %36, ptr noundef nonnull %2, i32 noundef 1)
  br label %38

38:                                               ; preds = %34, %30, %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %19, align 4, !tbaa !14
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %24, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %38, %16, %12
  %42 = getelementptr inbounds i8, ptr %5, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = icmp eq ptr %43, null
  br i1 %44, label %.loopexit.1, label %45

45:                                               ; preds = %.loopexit
  %46 = load ptr, ptr %43, align 8, !tbaa !11
  %47 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %46)
  %48 = getelementptr inbounds i8, ptr %43, i64 36
  %49 = load i32, ptr %48, align 4, !tbaa !14
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph.1, label %.loopexit.1

.lr.ph.1:                                         ; preds = %45
  %51 = getelementptr inbounds i8, ptr %47, i64 32
  %52 = getelementptr inbounds i8, ptr %43, i64 40
  br label %53

53:                                               ; preds = %67, %.lr.ph.1
  %indvars.iv.1 = phi i64 [ 0, %.lr.ph.1 ], [ %indvars.iv.next.1, %67 ]
  %54 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %55 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %43, i32 noundef %54)
  %56 = getelementptr inbounds [8 x i32], ptr %51, i64 0, i64 %indvars.iv.1
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 2
  br i1 %58, label %59, label %67

59:                                               ; preds = %53
  %60 = sext i32 %57 to i64
  %61 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %.not36.1 = icmp eq ptr %62, null
  br i1 %.not36.1, label %67, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr %52, align 8, !tbaa !15
  call void %64(ptr noundef nonnull %2, ptr noundef %55)
  %65 = load ptr, ptr %61, align 8, !tbaa !9
  %66 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %65, ptr noundef nonnull %2, i32 noundef 1)
  br label %67

67:                                               ; preds = %63, %59, %53
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %68 = load i32, ptr %48, align 4, !tbaa !14
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next.1, %69
  br i1 %70, label %53, label %.loopexit.1, !llvm.loop !16

.loopexit.1:                                      ; preds = %67, %45, %.loopexit
  %71 = getelementptr inbounds i8, ptr %5, i64 32
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = icmp eq ptr %72, null
  br i1 %73, label %.loopexit.2, label %74

74:                                               ; preds = %.loopexit.1
  %75 = load ptr, ptr %72, align 8, !tbaa !11
  %76 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %75)
  %77 = getelementptr inbounds i8, ptr %72, i64 36
  %78 = load i32, ptr %77, align 4, !tbaa !14
  %79 = icmp sgt i32 %78, 0
  br i1 %79, label %.lr.ph.2, label %.loopexit.2

.lr.ph.2:                                         ; preds = %74
  %80 = getelementptr inbounds i8, ptr %76, i64 32
  %81 = getelementptr inbounds i8, ptr %72, i64 40
  br label %82

82:                                               ; preds = %96, %.lr.ph.2
  %indvars.iv.2 = phi i64 [ 0, %.lr.ph.2 ], [ %indvars.iv.next.2, %96 ]
  %83 = trunc nuw nsw i64 %indvars.iv.2 to i32
  %84 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %72, i32 noundef %83)
  %85 = getelementptr inbounds [8 x i32], ptr %80, i64 0, i64 %indvars.iv.2
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp slt i32 %86, 2
  br i1 %87, label %88, label %96

88:                                               ; preds = %82
  %89 = sext i32 %86 to i64
  %90 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %89
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %.not36.2 = icmp eq ptr %91, null
  br i1 %.not36.2, label %96, label %92

92:                                               ; preds = %88
  %93 = load ptr, ptr %81, align 8, !tbaa !15
  call void %93(ptr noundef nonnull %2, ptr noundef %84)
  %94 = load ptr, ptr %90, align 8, !tbaa !9
  %95 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %94, ptr noundef nonnull %2, i32 noundef 1)
  br label %96

96:                                               ; preds = %92, %88, %82
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %97 = load i32, ptr %77, align 4, !tbaa !14
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next.2, %98
  br i1 %99, label %82, label %.loopexit.2, !llvm.loop !16

.loopexit.2:                                      ; preds = %96, %74, %.loopexit.1
  %100 = getelementptr inbounds i8, ptr %5, i64 40
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = icmp eq ptr %101, null
  br i1 %102, label %.loopexit.3, label %103

103:                                              ; preds = %.loopexit.2
  %104 = load ptr, ptr %101, align 8, !tbaa !11
  %105 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %104)
  %106 = getelementptr inbounds i8, ptr %101, i64 36
  %107 = load i32, ptr %106, align 4, !tbaa !14
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %.lr.ph.3, label %.loopexit.3

.lr.ph.3:                                         ; preds = %103
  %109 = getelementptr inbounds i8, ptr %105, i64 32
  %110 = getelementptr inbounds i8, ptr %101, i64 40
  br label %111

111:                                              ; preds = %125, %.lr.ph.3
  %indvars.iv.3 = phi i64 [ 0, %.lr.ph.3 ], [ %indvars.iv.next.3, %125 ]
  %112 = trunc nuw nsw i64 %indvars.iv.3 to i32
  %113 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %101, i32 noundef %112)
  %114 = getelementptr inbounds [8 x i32], ptr %109, i64 0, i64 %indvars.iv.3
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp slt i32 %115, 2
  br i1 %116, label %117, label %125

117:                                              ; preds = %111
  %118 = sext i32 %115 to i64
  %119 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %.not36.3 = icmp eq ptr %120, null
  br i1 %.not36.3, label %125, label %121

121:                                              ; preds = %117
  %122 = load ptr, ptr %110, align 8, !tbaa !15
  call void %122(ptr noundef nonnull %2, ptr noundef %113)
  %123 = load ptr, ptr %119, align 8, !tbaa !9
  %124 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %123, ptr noundef nonnull %2, i32 noundef 1)
  br label %125

125:                                              ; preds = %121, %117, %111
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %126 = load i32, ptr %106, align 4, !tbaa !14
  %127 = sext i32 %126 to i64
  %128 = icmp slt i64 %indvars.iv.next.3, %127
  br i1 %128, label %111, label %.loopexit.3, !llvm.loop !16

.loopexit.3:                                      ; preds = %125, %103, %.loopexit.2
  %129 = getelementptr inbounds i8, ptr %5, i64 48
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = icmp eq ptr %130, null
  br i1 %131, label %.loopexit.4, label %132

132:                                              ; preds = %.loopexit.3
  %133 = load ptr, ptr %130, align 8, !tbaa !11
  %134 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %133)
  %135 = getelementptr inbounds i8, ptr %130, i64 36
  %136 = load i32, ptr %135, align 4, !tbaa !14
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph.4, label %.loopexit.4

.lr.ph.4:                                         ; preds = %132
  %138 = getelementptr inbounds i8, ptr %134, i64 32
  %139 = getelementptr inbounds i8, ptr %130, i64 40
  br label %140

140:                                              ; preds = %154, %.lr.ph.4
  %indvars.iv.4 = phi i64 [ 0, %.lr.ph.4 ], [ %indvars.iv.next.4, %154 ]
  %141 = trunc nuw nsw i64 %indvars.iv.4 to i32
  %142 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %130, i32 noundef %141)
  %143 = getelementptr inbounds [8 x i32], ptr %138, i64 0, i64 %indvars.iv.4
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp slt i32 %144, 2
  br i1 %145, label %146, label %154

146:                                              ; preds = %140
  %147 = sext i32 %144 to i64
  %148 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %.not36.4 = icmp eq ptr %149, null
  br i1 %.not36.4, label %154, label %150

150:                                              ; preds = %146
  %151 = load ptr, ptr %139, align 8, !tbaa !15
  call void %151(ptr noundef nonnull %2, ptr noundef %142)
  %152 = load ptr, ptr %148, align 8, !tbaa !9
  %153 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %152, ptr noundef nonnull %2, i32 noundef 1)
  br label %154

154:                                              ; preds = %150, %146, %140
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %155 = load i32, ptr %135, align 4, !tbaa !14
  %156 = sext i32 %155 to i64
  %157 = icmp slt i64 %indvars.iv.next.4, %156
  br i1 %157, label %140, label %.loopexit.4, !llvm.loop !16

.loopexit.4:                                      ; preds = %154, %132, %.loopexit.3
  %158 = getelementptr inbounds i8, ptr %5, i64 56
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = icmp eq ptr %159, null
  br i1 %160, label %.loopexit.5, label %161

161:                                              ; preds = %.loopexit.4
  %162 = load ptr, ptr %159, align 8, !tbaa !11
  %163 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %162)
  %164 = getelementptr inbounds i8, ptr %159, i64 36
  %165 = load i32, ptr %164, align 4, !tbaa !14
  %166 = icmp sgt i32 %165, 0
  br i1 %166, label %.lr.ph.5, label %.loopexit.5

.lr.ph.5:                                         ; preds = %161
  %167 = getelementptr inbounds i8, ptr %163, i64 32
  %168 = getelementptr inbounds i8, ptr %159, i64 40
  br label %169

169:                                              ; preds = %183, %.lr.ph.5
  %indvars.iv.5 = phi i64 [ 0, %.lr.ph.5 ], [ %indvars.iv.next.5, %183 ]
  %170 = trunc nuw nsw i64 %indvars.iv.5 to i32
  %171 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %159, i32 noundef %170)
  %172 = getelementptr inbounds [8 x i32], ptr %167, i64 0, i64 %indvars.iv.5
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = icmp slt i32 %173, 2
  br i1 %174, label %175, label %183

175:                                              ; preds = %169
  %176 = sext i32 %173 to i64
  %177 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !9
  %.not36.5 = icmp eq ptr %178, null
  br i1 %.not36.5, label %183, label %179

179:                                              ; preds = %175
  %180 = load ptr, ptr %168, align 8, !tbaa !15
  call void %180(ptr noundef nonnull %2, ptr noundef %171)
  %181 = load ptr, ptr %177, align 8, !tbaa !9
  %182 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %181, ptr noundef nonnull %2, i32 noundef 1)
  br label %183

183:                                              ; preds = %179, %175, %169
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %184 = load i32, ptr %164, align 4, !tbaa !14
  %185 = sext i32 %184 to i64
  %186 = icmp slt i64 %indvars.iv.next.5, %185
  br i1 %186, label %169, label %.loopexit.5, !llvm.loop !16

.loopexit.5:                                      ; preds = %183, %161, %.loopexit.4
  %187 = getelementptr inbounds i8, ptr %5, i64 64
  %188 = load ptr, ptr %187, align 8, !tbaa !9
  %189 = icmp eq ptr %188, null
  br i1 %189, label %.loopexit.6, label %190

190:                                              ; preds = %.loopexit.5
  %191 = load ptr, ptr %188, align 8, !tbaa !11
  %192 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %191)
  %193 = getelementptr inbounds i8, ptr %188, i64 36
  %194 = load i32, ptr %193, align 4, !tbaa !14
  %195 = icmp sgt i32 %194, 0
  br i1 %195, label %.lr.ph.6, label %.loopexit.6

.lr.ph.6:                                         ; preds = %190
  %196 = getelementptr inbounds i8, ptr %192, i64 32
  %197 = getelementptr inbounds i8, ptr %188, i64 40
  br label %198

198:                                              ; preds = %212, %.lr.ph.6
  %indvars.iv.6 = phi i64 [ 0, %.lr.ph.6 ], [ %indvars.iv.next.6, %212 ]
  %199 = trunc nuw nsw i64 %indvars.iv.6 to i32
  %200 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %188, i32 noundef %199)
  %201 = getelementptr inbounds [8 x i32], ptr %196, i64 0, i64 %indvars.iv.6
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = icmp slt i32 %202, 2
  br i1 %203, label %204, label %212

204:                                              ; preds = %198
  %205 = sext i32 %202 to i64
  %206 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %205
  %207 = load ptr, ptr %206, align 8, !tbaa !9
  %.not36.6 = icmp eq ptr %207, null
  br i1 %.not36.6, label %212, label %208

208:                                              ; preds = %204
  %209 = load ptr, ptr %197, align 8, !tbaa !15
  call void %209(ptr noundef nonnull %2, ptr noundef %200)
  %210 = load ptr, ptr %206, align 8, !tbaa !9
  %211 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %210, ptr noundef nonnull %2, i32 noundef 1)
  br label %212

212:                                              ; preds = %208, %204, %198
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %213 = load i32, ptr %193, align 4, !tbaa !14
  %214 = sext i32 %213 to i64
  %215 = icmp slt i64 %indvars.iv.next.6, %214
  br i1 %215, label %198, label %.loopexit.6, !llvm.loop !16

.loopexit.6:                                      ; preds = %212, %190, %.loopexit.5
  %216 = getelementptr inbounds i8, ptr %5, i64 72
  %217 = load ptr, ptr %216, align 8, !tbaa !9
  %218 = icmp eq ptr %217, null
  br i1 %218, label %.loopexit.7, label %219

219:                                              ; preds = %.loopexit.6
  %220 = load ptr, ptr %217, align 8, !tbaa !11
  %221 = call noundef ptr @_ZN2rw16UVAnimCustomData3getEPNS_9AnimationE(ptr noundef %220)
  %222 = getelementptr inbounds i8, ptr %217, i64 36
  %223 = load i32, ptr %222, align 4, !tbaa !14
  %224 = icmp sgt i32 %223, 0
  br i1 %224, label %.lr.ph.7, label %.loopexit.7

.lr.ph.7:                                         ; preds = %219
  %225 = getelementptr inbounds i8, ptr %221, i64 32
  %226 = getelementptr inbounds i8, ptr %217, i64 40
  br label %227

227:                                              ; preds = %241, %.lr.ph.7
  %indvars.iv.7 = phi i64 [ 0, %.lr.ph.7 ], [ %indvars.iv.next.7, %241 ]
  %228 = trunc nuw nsw i64 %indvars.iv.7 to i32
  %229 = call noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72) %217, i32 noundef %228)
  %230 = getelementptr inbounds [8 x i32], ptr %225, i64 0, i64 %indvars.iv.7
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = icmp slt i32 %231, 2
  br i1 %232, label %233, label %241

233:                                              ; preds = %227
  %234 = sext i32 %231 to i64
  %235 = getelementptr inbounds [2 x ptr], ptr %5, i64 0, i64 %234
  %236 = load ptr, ptr %235, align 8, !tbaa !9
  %.not36.7 = icmp eq ptr %236, null
  br i1 %.not36.7, label %241, label %237

237:                                              ; preds = %233
  %238 = load ptr, ptr %226, align 8, !tbaa !15
  call void %238(ptr noundef nonnull %2, ptr noundef %229)
  %239 = load ptr, ptr %235, align 8, !tbaa !9
  %240 = call noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64) %239, ptr noundef nonnull %2, i32 noundef 1)
  br label %241

241:                                              ; preds = %237, %233, %227
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %242 = load i32, ptr %222, align 4, !tbaa !14
  %243 = sext i32 %242 to i64
  %244 = icmp slt i64 %indvars.iv.next.7, %243
  br i1 %244, label %227, label %.loopexit.7, !llvm.loop !16

.loopexit.7:                                      ; preds = %241, %219, %.loopexit.6
  %245 = call noundef ptr @_ZN2rw5MatFX3getEPKNS_8MaterialE(ptr noundef %0)
  %.not = icmp eq ptr %245, null
  br i1 %.not, label %249, label %246

246:                                              ; preds = %.loopexit.7
  %247 = load ptr, ptr %5, align 8, !tbaa !9
  %248 = load ptr, ptr %9, align 8, !tbaa !9
  call void @_ZN2rw5MatFX22setUVTransformMatricesEPNS_6MatrixES2_(ptr noundef nonnull align 8 dereferenceable(88) %245, ptr noundef %247, ptr noundef %248)
  br label %249

249:                                              ; preds = %246, %.loopexit.7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #4
  ret void
}

declare void @_ZN2rw6Matrix11setIdentityEv(ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw16AnimInterpolator14getInterpFrameEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #2 align 2

declare noundef ptr @_ZN2rw6Matrix9transformEPKS0_NS_9CombineOpE(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef, i32 noundef) local_unnamed_addr #3

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

declare void @_ZN2rw5MatFX22setUVTransformMatricesEPNS_6MatrixES2_(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN2rw16AnimInterpolatorE", !10, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !6, i64 36}
!15 = !{!12, !10, i64 40}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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