; LLVM IR from Razakhel/RaZ :: src/RaZ/XR/XrSystem.ll (ZN3Raz8XrSystem6updateERKNS_13FrameTimeInfoE)

; 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.XrEventDataBuffer = type { i32, ptr, [4000 x i8] }
%"class.Raz::XrSystem" = type <{ %"class.Raz::System", %"class.Raz::XrContext", %"class.Raz::XrSession", %"class.std::vector.25", i32, [4 x i8], %"class.std::vector.30", i32, i32, %"class.std::vector.25", i32, [4 x i8] }>
%"class.Raz::System" = type { ptr, %"class.std::vector", %"class.Raz::Bitset" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Raz::Entity *, std::allocator<Raz::Entity *>>::_Vector_impl" }
%"struct.std::_Vector_base<Raz::Entity *, std::allocator<Raz::Entity *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Raz::Entity *, std::allocator<Raz::Entity *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Raz::Entity *, std::allocator<Raz::Entity *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Raz::Bitset" = type { %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.Raz::XrContext" = type { %"class.std::vector.4", %"class.std::vector.9", %"class.std::vector.4", %"class.std::vector.9", ptr, ptr, i64 }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Raz::XrSession" = type { ptr, ptr, i32, i8, ptr, %"class.std::vector.14", %"class.std::vector.14", %"class.std::unordered_map" }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<XrSwapchain_T *, std::allocator<XrSwapchain_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<XrSwapchain_T *, std::allocator<XrSwapchain_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<XrSwapchain_T *, std::allocator<XrSwapchain_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<XrSwapchain_T *, std::allocator<XrSwapchain_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = type { %"struct.std::_Vector_base<XrViewConfigurationView, std::allocator<XrViewConfigurationView>>::_Vector_impl" }
%"struct.std::_Vector_base<XrViewConfigurationView, std::allocator<XrViewConfigurationView>>::_Vector_impl" = type { %"struct.std::_Vector_base<XrViewConfigurationView, std::allocator<XrViewConfigurationView>>::_Vector_impl_data" }
%"struct.std::_Vector_base<XrViewConfigurationView, std::allocator<XrViewConfigurationView>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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 noundef zeroext i1 @_ZN3Raz8XrSystem6updateERKNS_13FrameTimeInfoE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef nonnull align 1 %1) unnamed_addr #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.XrEventDataBuffer, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4016, ptr %6) #3
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 4016, i1 false)
  br label %9

9:                                                ; preds = %32, %2
  %10 = getelementptr inbounds %"class.Raz::XrSystem", ptr %8, i32 0, i32 1
  %11 = getelementptr inbounds %"class.Raz::XrContext", ptr %10, i32 0, i32 4
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = call noundef zeroext i1 @_ZN3Raz12_GLOBAL__N_113pollNextEventEP12XrInstance_TR17XrEventDataBuffer(ptr noundef %12, ptr noundef nonnull align 8 dereferenceable(4016) %6)
  br i1 %13, label %14, label %33

14:                                               ; preds = %9
  %15 = getelementptr inbounds %struct.XrEventDataBuffer, ptr %6, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !53
  switch i32 %16, label %31 [
    i32 49, label %17
    i32 17, label %18
    i32 52, label %21
    i32 40, label %25
    i32 18, label %29
  ]

17:                                               ; preds = %14
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK21XrEventDataEventsLost(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br label %32

18:                                               ; preds = %14
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK30XrEventDataInstanceLossPending(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %19 = getelementptr inbounds %"class.Raz::XrSystem", ptr %8, i32 0, i32 2
  %20 = getelementptr inbounds %"class.Raz::XrSession", ptr %19, i32 0, i32 3
  store i8 0, ptr %20, align 4, !tbaa !56
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %34

21:                                               ; preds = %14
  %22 = getelementptr inbounds %"class.Raz::XrSystem", ptr %8, i32 0, i32 2
  %23 = getelementptr inbounds %"class.Raz::XrSession", ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !57
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK36XrEventDataInteractionProfileChangedP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef %24)
  br label %32

25:                                               ; preds = %14
  %26 = getelementptr inbounds %"class.Raz::XrSystem", ptr %8, i32 0, i32 2
  %27 = getelementptr inbounds %"class.Raz::XrSession", ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !57
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK38XrEventDataReferenceSpaceChangePendingP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(72) %6, ptr noundef %28)
  br label %32

29:                                               ; preds = %14
  %30 = call noundef zeroext i1 @_ZN3Raz8XrSystem26processSessionStateChangedERK30XrEventDataSessionStateChanged(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef nonnull align 8 dereferenceable(40) %6)
  br label %32

31:                                               ; preds = %14
  br label %32

32:                                               ; preds = %31, %29, %25, %21, %17
  br label %9, !llvm.loop !58

33:                                               ; preds = %9
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %34

34:                                               ; preds = %33, %18
  call void @llvm.lifetime.end.p0(i64 4016, ptr %6) #3
  %35 = load i1, ptr %3, align 1
  ret i1 %35
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN3Raz12_GLOBAL__N_113pollNextEventEP12XrInstance_TR17XrEventDataBuffer(ptr noundef, ptr noundef nonnull align 8 dereferenceable(4016)) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK21XrEventDataEventsLost(ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK30XrEventDataInstanceLossPending(ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK36XrEventDataInteractionProfileChangedP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK38XrEventDataReferenceSpaceChangePendingP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3Raz8XrSystem26processSessionStateChangedERK30XrEventDataSessionStateChanged(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 168}
!10 = !{!"_ZTSN3Raz8XrSystemE", !11, i64 0, !24, i64 72, !34, i64 192, !45, i64 328, !23, i64 352, !49, i64 360, !23, i64 384, !23, i64 388, !45, i64 392, !23, i64 416}
!11 = !{!"_ZTSN3Raz6SystemE", !12, i64 8, !16, i64 32}
!12 = !{!"_ZTSSt6vectorIPN3Raz6EntityESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPN3Raz6EntityESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN3Raz6EntityESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN3Raz6EntityESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSN3Raz6BitsetE", !17, i64 0}
!17 = !{!"_ZTSSt6vectorIbSaIbEE", !18, i64 0}
!18 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !19, i64 0}
!19 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !21, i64 0, !21, i64 16, !6, i64 32}
!21 = !{!"_ZTSSt13_Bit_iterator", !22, i64 0}
!22 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !23, i64 8}
!23 = !{!"int", !7, i64 0}
!24 = !{!"_ZTSN3Raz9XrContextE", !25, i64 0, !29, i64 24, !25, i64 48, !29, i64 72, !6, i64 96, !6, i64 104, !33, i64 112}
!25 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"long", !7, i64 0}
!34 = !{!"_ZTSN3Raz9XrSessionE", !6, i64 0, !6, i64 8, !23, i64 16, !35, i64 20, !6, i64 24, !36, i64 32, !36, i64 56, !40, i64 80}
!35 = !{!"bool", !7, i64 0}
!36 = !{!"_ZTSSt6vectorIP13XrSwapchain_TSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTSSt13unordered_mapIP13XrSwapchain_TSt6vectorI25XrSwapchainImageOpenGLKHRSaIS3_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S5_EEE", !41, i64 0}
!41 = !{!"_ZTSSt10_HashtableIP13XrSwapchain_TSt4pairIKS1_St6vectorI25XrSwapchainImageOpenGLKHRSaIS5_EEESaIS8_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !33, i64 8, !42, i64 16, !33, i64 24, !43, i64 32, !6, i64 48}
!42 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!43 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !44, i64 0, !33, i64 8}
!44 = !{!"float", !7, i64 0}
!45 = !{!"_ZTSSt6vectorIjSaIjEE", !46, i64 0}
!46 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!49 = !{!"_ZTSSt6vectorI23XrViewConfigurationViewSaIS0_EE", !50, i64 0}
!50 = !{!"_ZTSSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE12_Vector_implE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!53 = !{!54, !55, i64 0}
!54 = !{!"_ZTS17XrEventDataBuffer", !55, i64 0, !6, i64 8, !7, i64 16}
!55 = !{!"_ZTS15XrStructureType", !7, i64 0}
!56 = !{!10, !35, i64 212}
!57 = !{!10, !6, i64 192}
!58 = distinct !{!58, !59}
!59 = !{!"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"

%struct.XrEventDataBuffer = type { i32, ptr, [4000 x i8] }

; 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 uwtable
define dso_local noundef zeroext i1 @_ZN3Raz8XrSystem6updateERKNS_13FrameTimeInfoE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr nocapture noundef nonnull readnone align 1 %1) unnamed_addr #1 align 2 {
  %3 = alloca %struct.XrEventDataBuffer, align 8
  call void @llvm.lifetime.start.p0(i64 4016, ptr nonnull %3) #3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(4016) %3, i8 0, i64 4016, i1 false)
  %4 = getelementptr inbounds i8, ptr %0, i64 168
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = call noundef zeroext i1 @_ZN3Raz12_GLOBAL__N_113pollNextEventEP12XrInstance_TR17XrEventDataBuffer(ptr noundef %5, ptr noundef nonnull align 8 dereferenceable(4016) %3)
  br i1 %6, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 192
  br label %8

8:                                                ; preds = %.lr.ph, %19
  %9 = load i32, ptr %3, align 8, !tbaa !52
  switch i32 %9, label %19 [
    i32 49, label %10
    i32 17, label %11
    i32 52, label %13
    i32 40, label %15
    i32 18, label %17
  ]

10:                                               ; preds = %8
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK21XrEventDataEventsLost(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br label %19

11:                                               ; preds = %8
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK30XrEventDataInstanceLossPending(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %12 = getelementptr inbounds i8, ptr %0, i64 212
  store i8 0, ptr %12, align 4, !tbaa !55
  br label %.loopexit

13:                                               ; preds = %8
  %14 = load ptr, ptr %7, align 8, !tbaa !56
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK36XrEventDataInteractionProfileChangedP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef %14)
  br label %19

15:                                               ; preds = %8
  %16 = load ptr, ptr %7, align 8, !tbaa !56
  call void @_ZN3Raz12_GLOBAL__N_116processEventDataERK38XrEventDataReferenceSpaceChangePendingP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(72) %3, ptr noundef %16)
  br label %19

17:                                               ; preds = %8
  %18 = call noundef zeroext i1 @_ZN3Raz8XrSystem26processSessionStateChangedERK30XrEventDataSessionStateChanged(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef nonnull align 8 dereferenceable(40) %3)
  br label %19

19:                                               ; preds = %8, %17, %15, %13, %10
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZN3Raz12_GLOBAL__N_113pollNextEventEP12XrInstance_TR17XrEventDataBuffer(ptr noundef %20, ptr noundef nonnull align 8 dereferenceable(4016) %3)
  br i1 %21, label %8, label %.loopexit, !llvm.loop !57

.loopexit:                                        ; preds = %19, %2, %11
  %.0 = phi i1 [ false, %11 ], [ true, %2 ], [ true, %19 ]
  call void @llvm.lifetime.end.p0(i64 4016, ptr nonnull %3) #3
  ret i1 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN3Raz12_GLOBAL__N_113pollNextEventEP12XrInstance_TR17XrEventDataBuffer(ptr noundef, ptr noundef nonnull align 8 dereferenceable(4016)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK21XrEventDataEventsLost(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK30XrEventDataInstanceLossPending(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK36XrEventDataInteractionProfileChangedP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3Raz12_GLOBAL__N_116processEventDataERK38XrEventDataReferenceSpaceChangePendingP11XrSession_T(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3Raz8XrSystem26processSessionStateChangedERK30XrEventDataSessionStateChanged(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !12, i64 168}
!6 = !{!"_ZTSN3Raz8XrSystemE", !7, i64 0, !23, i64 72, !33, i64 192, !44, i64 328, !22, i64 352, !48, i64 360, !22, i64 384, !22, i64 388, !44, i64 392, !22, i64 416}
!7 = !{!"_ZTSN3Raz6SystemE", !8, i64 8, !15, i64 32}
!8 = !{!"_ZTSSt6vectorIPN3Raz6EntityESaIS2_EE", !9, i64 0}
!9 = !{!"_ZTSSt12_Vector_baseIPN3Raz6EntityESaIS2_EE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIPN3Raz6EntityESaIS2_EE12_Vector_implE", !11, i64 0}
!11 = !{!"_ZTSNSt12_Vector_baseIPN3Raz6EntityESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"_ZTSN3Raz6BitsetE", !16, i64 0}
!16 = !{!"_ZTSSt6vectorIbSaIbEE", !17, i64 0}
!17 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !18, i64 0}
!18 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !20, i64 0, !20, i64 16, !12, i64 32}
!20 = !{!"_ZTSSt13_Bit_iterator", !21, i64 0}
!21 = !{!"_ZTSSt18_Bit_iterator_base", !12, i64 0, !22, i64 8}
!22 = !{!"int", !13, i64 0}
!23 = !{!"_ZTSN3Raz9XrContextE", !24, i64 0, !28, i64 24, !24, i64 48, !28, i64 72, !12, i64 96, !12, i64 104, !32, i64 112}
!24 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!28 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!32 = !{!"long", !13, i64 0}
!33 = !{!"_ZTSN3Raz9XrSessionE", !12, i64 0, !12, i64 8, !22, i64 16, !34, i64 20, !12, i64 24, !35, i64 32, !35, i64 56, !39, i64 80}
!34 = !{!"bool", !13, i64 0}
!35 = !{!"_ZTSSt6vectorIP13XrSwapchain_TSaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP13XrSwapchain_TSaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!39 = !{!"_ZTSSt13unordered_mapIP13XrSwapchain_TSt6vectorI25XrSwapchainImageOpenGLKHRSaIS3_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S5_EEE", !40, i64 0}
!40 = !{!"_ZTSSt10_HashtableIP13XrSwapchain_TSt4pairIKS1_St6vectorI25XrSwapchainImageOpenGLKHRSaIS5_EEESaIS8_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb0ELb0ELb1EEEE", !12, i64 0, !32, i64 8, !41, i64 16, !32, i64 24, !42, i64 32, !12, i64 48}
!41 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !12, i64 0}
!42 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !43, i64 0, !32, i64 8}
!43 = !{!"float", !13, i64 0}
!44 = !{!"_ZTSSt6vectorIjSaIjEE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!48 = !{!"_ZTSSt6vectorI23XrViewConfigurationViewSaIS0_EE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseI23XrViewConfigurationViewSaIS0_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!52 = !{!53, !54, i64 0}
!53 = !{!"_ZTS17XrEventDataBuffer", !54, i64 0, !12, i64 8, !13, i64 16}
!54 = !{!"_ZTS15XrStructureType", !13, i64 0}
!55 = !{!6, !34, i64 212}
!56 = !{!6, !12, i64 192}
!57 = distinct !{!57, !58}
!58 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass