; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/PostProcessing (ConvertToLHProcess)

; 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"

%class.aiMatrix4x4t = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.aiNode = type { %struct.aiString, %class.aiMatrix4x4t, ptr, i32, ptr, i32, ptr, ptr }
%struct.aiString = type { i32, [1024 x i8] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp21MakeLeftHandedProcess11ProcessNodeEP6aiNodeRK12aiMatrix4x4tIfE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(64) %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %class.aiMatrix4x4t, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.aiNode, ptr %10, i32 0, i32 1
  %12 = getelementptr inbounds %class.aiMatrix4x4t, ptr %11, i32 0, i32 8
  %13 = load float, ptr %12, align 4, !tbaa !9
  %14 = fneg float %13
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.aiNode, ptr %15, i32 0, i32 1
  %17 = getelementptr inbounds %class.aiMatrix4x4t, ptr %16, i32 0, i32 8
  store float %14, ptr %17, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.aiNode, ptr %18, i32 0, i32 1
  %20 = getelementptr inbounds %class.aiMatrix4x4t, ptr %19, i32 0, i32 9
  %21 = load float, ptr %20, align 4, !tbaa !15
  %22 = fneg float %21
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.aiNode, ptr %23, i32 0, i32 1
  %25 = getelementptr inbounds %class.aiMatrix4x4t, ptr %24, i32 0, i32 9
  store float %22, ptr %25, align 4, !tbaa !15
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.aiNode, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds %class.aiMatrix4x4t, ptr %27, i32 0, i32 10
  %29 = load float, ptr %28, align 4, !tbaa !16
  %30 = fneg float %29
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.aiNode, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %class.aiMatrix4x4t, ptr %32, i32 0, i32 10
  store float %30, ptr %33, align 4, !tbaa !16
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.aiNode, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %class.aiMatrix4x4t, ptr %35, i32 0, i32 11
  %37 = load float, ptr %36, align 4, !tbaa !17
  %38 = fneg float %37
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.aiNode, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %class.aiMatrix4x4t, ptr %40, i32 0, i32 11
  store float %38, ptr %41, align 4, !tbaa !17
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.aiNode, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds %class.aiMatrix4x4t, ptr %43, i32 0, i32 2
  %45 = load float, ptr %44, align 4, !tbaa !18
  %46 = fneg float %45
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.aiNode, ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds %class.aiMatrix4x4t, ptr %48, i32 0, i32 2
  store float %46, ptr %49, align 4, !tbaa !18
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.aiNode, ptr %50, i32 0, i32 1
  %52 = getelementptr inbounds %class.aiMatrix4x4t, ptr %51, i32 0, i32 6
  %53 = load float, ptr %52, align 4, !tbaa !19
  %54 = fneg float %53
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.aiNode, ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds %class.aiMatrix4x4t, ptr %56, i32 0, i32 6
  store float %54, ptr %57, align 4, !tbaa !19
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.aiNode, ptr %58, i32 0, i32 1
  %60 = getelementptr inbounds %class.aiMatrix4x4t, ptr %59, i32 0, i32 10
  %61 = load float, ptr %60, align 4, !tbaa !16
  %62 = fneg float %61
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.aiNode, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %class.aiMatrix4x4t, ptr %64, i32 0, i32 10
  store float %62, ptr %65, align 4, !tbaa !16
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.aiNode, ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %class.aiMatrix4x4t, ptr %67, i32 0, i32 14
  %69 = load float, ptr %68, align 4, !tbaa !20
  %70 = fneg float %69
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.aiNode, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %class.aiMatrix4x4t, ptr %72, i32 0, i32 14
  store float %70, ptr %73, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !21
  br label %74

74:                                               ; preds = %92, %3
  %75 = load i64, ptr %7, align 8, !tbaa !21
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.aiNode, ptr %76, i32 0, i32 3
  %78 = load i32, ptr %77, align 8, !tbaa !23
  %79 = zext i32 %78 to i64
  %80 = icmp ult i64 %75, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %95

82:                                               ; preds = %74
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.aiNode, ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !24
  %86 = load i64, ptr %7, align 8, !tbaa !21
  %87 = getelementptr inbounds ptr, ptr %85, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #3
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.aiNode, ptr %90, i32 0, i32 1
  call void @_ZNK12aiMatrix4x4tIfEmlERKS0_(ptr dead_on_unwind writable sret(%class.aiMatrix4x4t) align 4 %8, ptr noundef nonnull align 4 dereferenceable(64) %89, ptr noundef nonnull align 4 dereferenceable(64) %91)
  call void @_ZN6Assimp21MakeLeftHandedProcess11ProcessNodeEP6aiNodeRK12aiMatrix4x4tIfE(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef %88, ptr noundef nonnull align 4 dereferenceable(64) %8)
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #3
  br label %92

92:                                               ; preds = %82
  %93 = load i64, ptr %7, align 8, !tbaa !21
  %94 = add i64 %93, 1
  store i64 %94, ptr %7, align 8, !tbaa !21
  br label %74, !llvm.loop !25

95:                                               ; preds = %81
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK12aiMatrix4x4tIfEmlERKS0_(ptr dead_on_unwind noalias writable sret(%class.aiMatrix4x4t) align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) #2 align 2

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !14, i64 1060}
!10 = !{!"_ZTS6aiNode", !11, i64 0, !13, i64 1028, !6, i64 1096, !12, i64 1104, !6, i64 1112, !12, i64 1120, !6, i64 1128, !6, i64 1136}
!11 = !{!"_ZTS8aiString", !12, i64 0, !7, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS12aiMatrix4x4tIfE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60}
!14 = !{!"float", !7, i64 0}
!15 = !{!10, !14, i64 1064}
!16 = !{!10, !14, i64 1068}
!17 = !{!10, !14, i64 1072}
!18 = !{!10, !14, i64 1036}
!19 = !{!10, !14, i64 1052}
!20 = !{!10, !14, i64 1084}
!21 = !{!22, !22, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!10, !12, i64 1104}
!24 = !{!10, !6, i64 1112}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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

%class.aiMatrix4x4t = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp21MakeLeftHandedProcess11ProcessNodeEP6aiNodeRK12aiMatrix4x4tIfE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(64) %2) local_unnamed_addr #0 align 2 {
  %4 = alloca %class.aiMatrix4x4t, align 4
  %5 = getelementptr inbounds i8, ptr %1, i64 1028
  %6 = getelementptr inbounds i8, ptr %1, i64 1060
  %7 = load <2 x float>, ptr %6, align 4, !tbaa !5
  %8 = fneg <2 x float> %7
  store <2 x float> %8, ptr %6, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 1068
  %10 = load float, ptr %9, align 4, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %1, i64 1072
  %12 = load float, ptr %11, align 4, !tbaa !15
  %13 = fneg float %12
  store float %13, ptr %11, align 4, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %1, i64 1036
  %15 = load float, ptr %14, align 4, !tbaa !16
  %16 = fneg float %15
  store float %16, ptr %14, align 4, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %1, i64 1052
  %18 = load float, ptr %17, align 4, !tbaa !17
  %19 = fneg float %18
  store float %19, ptr %17, align 4, !tbaa !17
  store float %10, ptr %9, align 4, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %1, i64 1084
  %21 = load float, ptr %20, align 4, !tbaa !18
  %22 = fneg float %21
  store float %22, ptr %20, align 4, !tbaa !18
  %23 = getelementptr inbounds i8, ptr %1, i64 1104
  %24 = load i32, ptr %23, align 8, !tbaa !19
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %25 = getelementptr inbounds i8, ptr %1, i64 1112
  br label %26

._crit_edge:                                      ; preds = %26, %3
  ret void

26:                                               ; preds = %.lr.ph, %26
  %.023 = phi i64 [ 0, %.lr.ph ], [ %30, %26 ]
  %27 = load ptr, ptr %25, align 8, !tbaa !20
  %28 = getelementptr inbounds ptr, ptr %27, i64 %.023
  %29 = load ptr, ptr %28, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #3
  call void @_ZNK12aiMatrix4x4tIfEmlERKS0_(ptr dead_on_unwind nonnull writable sret(%class.aiMatrix4x4t) align 4 %4, ptr noundef nonnull align 4 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(64) %5)
  call void @_ZN6Assimp21MakeLeftHandedProcess11ProcessNodeEP6aiNodeRK12aiMatrix4x4tIfE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %29, ptr noundef nonnull align 4 dereferenceable(64) %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #3
  %30 = add nuw nsw i64 %.023, 1
  %31 = load i32, ptr %23, align 8, !tbaa !19
  %32 = zext i32 %31 to i64
  %33 = icmp ult i64 %30, %32
  br i1 %33, label %26, label %._crit_edge, !llvm.loop !22
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK12aiMatrix4x4tIfEmlERKS0_(ptr dead_on_unwind noalias writable sret(%class.aiMatrix4x4t) align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #2 align 2

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 1068}
!10 = !{!"_ZTS6aiNode", !11, i64 0, !13, i64 1028, !14, i64 1096, !12, i64 1104, !14, i64 1112, !12, i64 1120, !14, i64 1128, !14, i64 1136}
!11 = !{!"_ZTS8aiString", !12, i64 0, !7, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS12aiMatrix4x4tIfE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!10, !6, i64 1072}
!16 = !{!10, !6, i64 1036}
!17 = !{!10, !6, i64 1052}
!18 = !{!10, !6, i64 1084}
!19 = !{!10, !12, i64 1104}
!20 = !{!10, !14, i64 1112}
!21 = !{!14, !14, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass