; 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
define dso_local noundef zeroext i1 @_ZN2vl10reflection11description18TypeDescriptorImpl12CanConvertToEPNS1_15ITypeDescriptorE(ptr noundef nonnull align 8 dereferenceable(568) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, 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 @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568) %8)
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = icmp eq ptr %9, %10
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  store i1 true, ptr %3, align 1
  br label %38

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

14:                                               ; preds = %32, %13
  %15 = load i64, ptr %6, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.vl::reflection::description::TypeDescriptorImpl", ptr %8, i32 0, i32 6
  %17 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = icmp slt i64 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  store i32 2, ptr %7, align 4
  br label %35

20:                                               ; preds = %14
  %21 = getelementptr inbounds %"class.vl::reflection::description::TypeDescriptorImpl", ptr %8, i32 0, i32 6
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %21, i64 noundef %22)
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %24, align 8, !tbaa !11
  %27 = getelementptr inbounds ptr, ptr %26, i64 7
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef zeroext i1 %28(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef %25)
  br i1 %29, label %30, label %31

30:                                               ; preds = %20
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %35

31:                                               ; preds = %20
  br label %32

32:                                               ; preds = %31
  %33 = load i64, ptr %6, align 8, !tbaa !9
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %6, align 8, !tbaa !9
  br label %14, !llvm.loop !13

35:                                               ; preds = %30, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %36 = load i32, ptr %7, align 4
  switch i32 %36, label %40 [
    i32 2, label %37
    i32 1, label %38
  ]

37:                                               ; preds = %35
  store i1 false, ptr %3, align 1
  br label %38

38:                                               ; preds = %37, %35, %12
  %39 = load i1, ptr %3, align 1
  ret i1 %39

40:                                               ; preds = %35
  unreachable
}

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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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
define dso_local noundef zeroext i1 @_ZN2vl10reflection11description18TypeDescriptorImpl12CanConvertToEPNS1_15ITypeDescriptorE(ptr noundef nonnull align 8 dereferenceable(568) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  tail call void @_ZN2vl10reflection11description18TypeDescriptorImpl4LoadEv(ptr noundef nonnull align 8 dereferenceable(568) %0)
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = icmp eq ptr %3, %1
  br i1 %4, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  %6 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %.not10 = icmp sgt i64 %6, 0
  br i1 %.not10, label %.lr.ph, label %.loopexit

7:                                                ; preds = %.lr.ph
  %8 = add nuw nsw i64 %.0711, 1
  %9 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_10reflection11description15ITypeDescriptorEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %.not = icmp slt i64 %8, %9
  br i1 %.not, label %.lr.ph, label %.loopexit, !llvm.loop !5

.lr.ph:                                           ; preds = %.preheader, %7
  %.0711 = phi i64 [ %8, %7 ], [ 0, %.preheader ]
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_10reflection11description15ITypeDescriptorES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %5, i64 noundef %.0711)
  %11 = load ptr, ptr %10, align 8, !tbaa !7
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 56
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef zeroext i1 %14(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %1)
  br i1 %15, label %.loopexit, label %7

.loopexit:                                        ; preds = %.lr.ph, %7, %.preheader, %2
  %.1 = phi i1 [ true, %2 ], [ false, %.preheader ], [ %15, %7 ], [ %15, %.lr.ph ]
  ret i1 %.1
}

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: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass