; LLVM IR from vczh/herodb :: Kernel/Source (Vlpp)

; 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.vl::reflection::description::TypeDescriptorImpl" = type { %"class.vl::Object", %"class.vl::reflection::description::ITypeDescriptor.base", i8, %"class.vl::ObjectString", %"class.vl::ObjectString", %"class.vl::Ptr.918", %"class.vl::collections::List.919", %"class.vl::collections::Dictionary.927", %"class.vl::collections::Dictionary.938", %"class.vl::collections::Dictionary.949", %"class.vl::Ptr.960", %"class.vl::reflection::IDescriptable.base", %"class.vl::Interface", %"class.vl::reflection::DescriptableObject" }
%"class.vl::Object" = type { ptr }
%"class.vl::reflection::description::ITypeDescriptor.base" = type { %"class.vl::reflection::Description.base.779" }
%"class.vl::reflection::Description.base.779" = type { ptr }
%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"class.vl::Ptr.918" = type { ptr, ptr, ptr, ptr }
%"class.vl::collections::List.919" = type { %"class.vl::collections::ListBase.base.925", %"class.vl::collections::IEnumerable.923" }
%"class.vl::collections::ListBase.base.925" = type <{ %"class.vl::collections::ArrayBase.base.924", i64, i8 }>
%"class.vl::collections::ArrayBase.base.924" = type { %"class.vl::collections::ListStore.922", ptr, i64 }
%"class.vl::collections::ListStore.922" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.923" = type { %"class.vl::Interface" }
%"class.vl::collections::Dictionary.927" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List.928", %"class.vl::collections::IEnumerable.936" }
%"class.vl::collections::SortedList" = type { %"class.vl::collections::ListBase.base", %"class.vl::collections::IEnumerable.2" }
%"class.vl::collections::ListBase.base" = type <{ %"class.vl::collections::ArrayBase.base.3", i64, i8 }>
%"class.vl::collections::ArrayBase.base.3" = type { %"class.vl::collections::ListStore.1", ptr, i64 }
%"class.vl::collections::ListStore.1" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.2" = type { %"class.vl::Interface" }
%"class.vl::collections::List.928" = type { %"class.vl::collections::ListBase.base.934", %"class.vl::collections::IEnumerable.932" }
%"class.vl::collections::ListBase.base.934" = type <{ %"class.vl::collections::ArrayBase.base.933", i64, i8 }>
%"class.vl::collections::ArrayBase.base.933" = type { %"class.vl::collections::ListStore.931", ptr, i64 }
%"class.vl::collections::ListStore.931" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.932" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.936" = type { %"class.vl::Interface" }
%"class.vl::collections::Dictionary.938" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List.939", %"class.vl::collections::IEnumerable.947" }
%"class.vl::collections::List.939" = type { %"class.vl::collections::ListBase.base.945", %"class.vl::collections::IEnumerable.943" }
%"class.vl::collections::ListBase.base.945" = type <{ %"class.vl::collections::ArrayBase.base.944", i64, i8 }>
%"class.vl::collections::ArrayBase.base.944" = type { %"class.vl::collections::ListStore.942", ptr, i64 }
%"class.vl::collections::ListStore.942" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.943" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.947" = type { %"class.vl::Interface" }
%"class.vl::collections::Dictionary.949" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List.950", %"class.vl::collections::IEnumerable.958" }
%"class.vl::collections::List.950" = type { %"class.vl::collections::ListBase.base.956", %"class.vl::collections::IEnumerable.954" }
%"class.vl::collections::ListBase.base.956" = type <{ %"class.vl::collections::ArrayBase.base.955", i64, i8 }>
%"class.vl::collections::ArrayBase.base.955" = type { %"class.vl::collections::ListStore.953", ptr, i64 }
%"class.vl::collections::ListStore.953" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.954" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.958" = type { %"class.vl::Interface" }
%"class.vl::Ptr.960" = type { ptr, ptr, ptr, ptr }
%"class.vl::reflection::IDescriptable.base" = type { %"class.vl::reflection::Description.base.17" }
%"class.vl::reflection::Description.base.17" = type { ptr }
%"class.vl::Interface" = type { ptr }
%"class.vl::reflection::DescriptableObject" = type { ptr, i64, ptr, i64, ptr, %"class.vl::Ptr.12" }
%"class.vl::Ptr.12" = type { ptr, 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
declare dso_local void @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_12ObjectStringIwEES3_E8ContainsERKS3_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl10reflection11description18TypeDescriptorImpl13IsEventExistsERKNS_12ObjectStringIwEEb(ptr noundef nonnull align 8 dereferenceable(568) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %2) unnamed_addr #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %10 = zext i1 %2 to i8
  store i8 %10, ptr %7, align 1, !tbaa !9
  %11 = load ptr, ptr %5, align 8
  call void @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568) %11)
  %12 = getelementptr inbounds %"class.vl::reflection::description::TypeDescriptorImpl", ptr %11, i32 0, i32 8
  %13 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_12ObjectStringIwEENS_3PtrINS_10reflection11description10IEventInfoEEES3_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %12)
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = call noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_12ObjectStringIwEES3_E8ContainsERKS3_(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef nonnull align 8 dereferenceable(48) %14)
  br i1 %15, label %16, label %17

16:                                               ; preds = %3
  store i1 true, ptr %4, align 1
  br label %46

17:                                               ; preds = %3
  %18 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %45

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store i64 0, ptr %8, align 8, !tbaa !13
  br label %21

21:                                               ; preds = %39, %20
  %22 = load i64, ptr %8, align 8, !tbaa !13
  %23 = getelementptr inbounds %"class.vl::reflection::description::TypeDescriptorImpl", ptr %11, i32 0, i32 6
  %24 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %25 = icmp slt i64 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  store i32 2, ptr %9, align 4
  br label %42

27:                                               ; preds = %21
  %28 = getelementptr inbounds %"class.vl::reflection::description::TypeDescriptorImpl", ptr %11, i32 0, i32 6
  %29 = load i64, ptr %8, align 8, !tbaa !13
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %28, i64 noundef %29)
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %31, align 8, !tbaa !15
  %34 = getelementptr inbounds ptr, ptr %33, i64 14
  %35 = load ptr, ptr %34, align 8
  %36 = call noundef zeroext i1 %35(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(48) %32, i1 noundef zeroext true)
  br i1 %36, label %37, label %38

37:                                               ; preds = %27
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %42

38:                                               ; preds = %27
  br label %39

39:                                               ; preds = %38
  %40 = load i64, ptr %8, align 8, !tbaa !13
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %8, align 8, !tbaa !13
  br label %21, !llvm.loop !17

42:                                               ; preds = %37, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %43 = load i32, ptr %9, align 4
  switch i32 %43, label %48 [
    i32 2, label %44
    i32 1, label %46
  ]

44:                                               ; preds = %42
  br label %45

45:                                               ; preds = %44, %17
  store i1 false, ptr %4, align 1
  br label %46

46:                                               ; preds = %45, %42, %16
  %47 = load i1, ptr %4, align 1
  ret i1 %47

48:                                               ; preds = %42
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_12ObjectStringIwEENS_3PtrINS_10reflection11description10IEventInfoEEES3_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104)) #2 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 = { 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 #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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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"

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_12ObjectStringIwEES3_E8ContainsERKS3_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl10reflection11description18TypeDescriptorImpl13IsEventExistsERKNS_12ObjectStringIwEEb(ptr noundef nonnull align 8 dereferenceable(568) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %2) unnamed_addr #0 align 2 {
  tail call void @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 312
  %5 = tail call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_12ObjectStringIwEENS_3PtrINS_10reflection11description10IEventInfoEEES3_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %4)
  %6 = tail call noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_12ObjectStringIwEES3_E8ContainsERKS3_(ptr noundef nonnull align 8 dereferenceable(33) %5, ptr noundef nonnull align 8 dereferenceable(48) %1)
  %.not = xor i1 %2, true
  %brmerge = or i1 %6, %.not
  br i1 %brmerge, label %.thread, label %.preheader

.preheader:                                       ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 152
  %8 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph, label %.thread

10:                                               ; preds = %.lr.ph
  %11 = add nuw nsw i64 %.0813, 1
  %12 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %13 = icmp slt i64 %11, %12
  br i1 %13, label %.lr.ph, label %.thread, !llvm.loop !5

.lr.ph:                                           ; preds = %.preheader, %10
  %.0813 = phi i64 [ %11, %10 ], [ 0, %.preheader ]
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %7, i64 noundef %.0813)
  %15 = load ptr, ptr %14, align 8, !tbaa !7
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %16, i64 112
  %18 = load ptr, ptr %17, align 8
  %19 = tail call noundef zeroext i1 %18(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext true)
  br i1 %19, label %.thread, label %10

.thread:                                          ; preds = %10, %.lr.ph, %.preheader, %3
  %.1 = phi i1 [ %6, %3 ], [ false, %.preheader ], [ %19, %.lr.ph ], [ %19, %10 ]
  ret i1 %.1
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_12ObjectStringIwEENS_3PtrINS_10reflection11description10IEventInfoEEES3_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 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 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" }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !10, i64 0}


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