; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/Vehicle (VehicleSixDOFTest)

; 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.VehicleSixDOFTest = type <{ %class.VehicleTest, ptr, [4 x %"class.JPH::Ref"], %"class.JPH::Mat44", float, float, [8 x i8] }>
%class.VehicleTest = type { %class.Test, %"class.JPH::Array" }
%class.Test = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.Test::ProcessInputParams" = type { float, ptr, %struct.CameraState }
%struct.CameraState = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }

; 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 uwtable
define dso_local void @_ZN17VehicleSixDOFTest12ProcessInputERKN4Test18ProcessInputParamsE(ptr noundef nonnull align 16 dereferenceable(248) %0, ptr noundef nonnull align 16 dereferenceable(80) %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store float 0x403F6A7A40000000, ptr %5, align 4, !tbaa !9
  %7 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 4
  store float 0.000000e+00, ptr %7, align 16, !tbaa !11
  %8 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 5
  store float 0.000000e+00, ptr %8, align 4, !tbaa !23
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %"class.Test::ProcessInputParams", ptr %9, i32 0, i32 1
  %11 = load ptr, ptr %10, align 8, !tbaa !24
  %12 = load ptr, ptr %11, align 8, !tbaa !28
  %13 = getelementptr inbounds ptr, ptr %12, i64 5
  %14 = load ptr, ptr %13, align 8
  %15 = call noundef zeroext i1 %14(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 48)
  br i1 %15, label %16, label %18

16:                                               ; preds = %2
  %17 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 4
  store float 0x3FE0C15240000000, ptr %17, align 16, !tbaa !11
  br label %18

18:                                               ; preds = %16, %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.Test::ProcessInputParams", ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  %22 = load ptr, ptr %21, align 8, !tbaa !28
  %23 = getelementptr inbounds ptr, ptr %22, i64 5
  %24 = load ptr, ptr %23, align 8
  %25 = call noundef zeroext i1 %24(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 49)
  br i1 %25, label %26, label %28

26:                                               ; preds = %18
  %27 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 4
  store float 0xBFE0C15240000000, ptr %27, align 16, !tbaa !11
  br label %28

28:                                               ; preds = %26, %18
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.Test::ProcessInputParams", ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !24
  %32 = load ptr, ptr %31, align 8, !tbaa !28
  %33 = getelementptr inbounds ptr, ptr %32, i64 5
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef zeroext i1 %34(ptr noundef nonnull align 8 dereferenceable(8) %31, i32 noundef 50)
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  %37 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 5
  store float 0x403F6A7A40000000, ptr %37, align 4, !tbaa !23
  br label %38

38:                                               ; preds = %36, %28
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.Test::ProcessInputParams", ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !24
  %42 = load ptr, ptr %41, align 8, !tbaa !28
  %43 = getelementptr inbounds ptr, ptr %42, i64 5
  %44 = load ptr, ptr %43, align 8
  %45 = call noundef zeroext i1 %44(ptr noundef nonnull align 8 dereferenceable(8) %41, i32 noundef 51)
  br i1 %45, label %46, label %48

46:                                               ; preds = %38
  %47 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %6, i32 0, i32 5
  store float 0xC03F6A7A40000000, ptr %47, align 4, !tbaa !23
  br label %48

48:                                               ; preds = %46, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 240}
!12 = !{!"_ZTS17VehicleSixDOFTest", !13, i64 0, !6, i64 136, !7, i64 144, !22, i64 176, !10, i64 240, !10, i64 244}
!13 = !{!"_ZTS11VehicleTest", !14, i64 0, !21, i64 112}
!14 = !{!"_ZTS4Test", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !15, i64 48, !16, i64 56}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !17, i64 0}
!17 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !6, i64 48}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!20 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !10, i64 0, !18, i64 8}
!21 = !{!"_ZTSN3JPH5ArrayIN11VehicleTest4LineENS_12STLAllocatorIS2_EEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!22 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!23 = !{!12, !10, i64 244}
!24 = !{!25, !6, i64 8}
!25 = !{!"_ZTSN4Test18ProcessInputParamsE", !10, i64 0, !6, i64 8, !26, i64 16}
!26 = !{!"_ZTS11CameraState", !27, i64 0, !27, i64 16, !27, i64 32, !10, i64 48}
!27 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !8, i64 0}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17VehicleSixDOFTest12ProcessInputERKN4Test18ProcessInputParamsE(ptr nocapture noundef nonnull writeonly align 16 dereferenceable(248) %0, ptr nocapture noundef nonnull readonly align 16 dereferenceable(80) %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 240
  %4 = getelementptr inbounds i8, ptr %0, i64 244
  store <2 x float> zeroinitializer, ptr %3, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %7, i64 40
  %9 = load ptr, ptr %8, align 8
  %10 = tail call noundef zeroext i1 %9(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 48)
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  store float 0x3FE0C15240000000, ptr %3, align 16, !tbaa !16
  br label %12

12:                                               ; preds = %11, %2
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %14, i64 40
  %16 = load ptr, ptr %15, align 8
  %17 = tail call noundef zeroext i1 %16(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 49)
  br i1 %17, label %18, label %19

18:                                               ; preds = %12
  store float 0xBFE0C15240000000, ptr %3, align 16, !tbaa !16
  br label %19

19:                                               ; preds = %18, %12
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %21, i64 40
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef zeroext i1 %23(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 50)
  br i1 %24, label %25, label %26

25:                                               ; preds = %19
  store float 0x403F6A7A40000000, ptr %4, align 4, !tbaa !28
  br label %26

26:                                               ; preds = %25, %19
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load ptr, ptr %29, align 8
  %31 = tail call noundef zeroext i1 %30(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 51)
  br i1 %31, label %32, label %33

32:                                               ; preds = %26
  store float 0xC03F6A7A40000000, ptr %4, align 4, !tbaa !28
  br label %33

33:                                               ; preds = %32, %26
  ret void
}

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

!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, !11, i64 8}
!10 = !{!"_ZTSN4Test18ProcessInputParamsE", !6, i64 0, !11, i64 8, !12, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_ZTS11CameraState", !13, i64 0, !13, i64 16, !13, i64 32, !6, i64 48}
!13 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!17, !6, i64 240}
!17 = !{!"_ZTS17VehicleSixDOFTest", !18, i64 0, !11, i64 136, !7, i64 144, !27, i64 176, !6, i64 240, !6, i64 244}
!18 = !{!"_ZTS11VehicleTest", !19, i64 0, !26, i64 112}
!19 = !{!"_ZTS4Test", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !20, i64 48, !21, i64 56}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !11, i64 0, !23, i64 8, !24, i64 16, !23, i64 24, !25, i64 32, !11, i64 48}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !11, i64 0}
!25 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !6, i64 0, !23, i64 8}
!26 = !{!"_ZTSN3JPH5ArrayIN11VehicleTest4LineENS_12STLAllocatorIS2_EEEE", !23, i64 0, !23, i64 8, !11, i64 16}
!27 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!28 = !{!17, !6, i64 244}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass