; 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::parsing::analyzing::ParsingSymbol" = type { %"class.vl::Object", ptr, i32, %"class.vl::ObjectString", ptr, %"class.vl::ObjectString", ptr, ptr, %"class.vl::collections::List.212", %"class.vl::collections::Dictionary.220" }
%"class.vl::Object" = type { ptr }
%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"class.vl::collections::List.212" = type { %"class.vl::collections::ListBase.base.218", %"class.vl::collections::IEnumerable.216" }
%"class.vl::collections::ListBase.base.218" = type <{ %"class.vl::collections::ArrayBase.base.217", i64, i8 }>
%"class.vl::collections::ArrayBase.base.217" = type { %"class.vl::collections::ListStore.215", ptr, i64 }
%"class.vl::collections::ListStore.215" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.216" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::collections::Dictionary.220" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List.212", %"class.vl::collections::IEnumerable.221" }
%"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::IEnumerable.221" = type { %"class.vl::Interface" }

; 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 noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol18GetSubSymbolByNameERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol20SearchClassSubSymbolERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  %10 = getelementptr inbounds %"class.vl::parsing::analyzing::ParsingSymbol", ptr %9, i32 0, i32 2
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %13, label %36

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

14:                                               ; preds = %31, %13
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %32

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol18GetSubSymbolByNameERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304) %18, ptr noundef nonnull align 8 dereferenceable(48) %19)
  store ptr %20, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %17
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %24, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %29

25:                                               ; preds = %17
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol19GetDescriptorSymbolEv(ptr noundef nonnull align 8 dereferenceable(304) %26)
  store ptr %27, ptr %6, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %25
  store i32 0, ptr %8, align 4
  br label %29

29:                                               ; preds = %28, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %30 = load i32, ptr %8, align 4
  switch i32 %30, label %33 [
    i32 0, label %31
  ]

31:                                               ; preds = %29
  br label %14, !llvm.loop !25

32:                                               ; preds = %14
  store i32 0, ptr %8, align 4
  br label %33

33:                                               ; preds = %32, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %34 = load i32, ptr %8, align 4
  switch i32 %34, label %39 [
    i32 0, label %35
    i32 1, label %37
  ]

35:                                               ; preds = %33
  br label %36

36:                                               ; preds = %35, %2
  store ptr null, ptr %3, align 8
  br label %37

37:                                               ; preds = %36, %33
  %38 = load ptr, ptr %3, align 8
  ret ptr %38

39:                                               ; preds = %33
  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, !12, i64 16}
!10 = !{!"_ZTSN2vl7parsing9analyzing13ParsingSymbolE", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !6, i64 72, !13, i64 80, !6, i64 128, !6, i64 136, !15, i64 144, !20, i64 192}
!11 = !{!"_ZTSN2vl6ObjectE"}
!12 = !{!"_ZTSN2vl7parsing9analyzing13ParsingSymbol10SymbolTypeE", !7, i64 0}
!13 = !{!"_ZTSN2vl12ObjectStringIwEE", !11, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 32, !14, i64 40}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN2vl11collections4ListIPNS_7parsing9analyzing13ParsingSymbolES5_EE", !16, i64 0}
!16 = !{!"_ZTSN2vl11collections8ListBaseIPNS_7parsing9analyzing13ParsingSymbolES5_EE", !17, i64 0, !14, i64 24, !19, i64 32}
!17 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_7parsing9analyzing13ParsingSymbolEEE", !18, i64 0, !6, i64 8, !14, i64 16}
!18 = !{!"_ZTSN2vl11collections9ListStoreIPNS_7parsing9analyzing13ParsingSymbolELb1EEE", !11, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSN2vl11collections10DictionaryINS_12ObjectStringIwEEPNS_7parsing9analyzing13ParsingSymbolES3_S7_EE", !11, i64 0, !21, i64 8, !15, i64 56}
!21 = !{!"_ZTSN2vl11collections10SortedListINS_12ObjectStringIwEES3_EE", !22, i64 0}
!22 = !{!"_ZTSN2vl11collections8ListBaseINS_12ObjectStringIwEES3_EE", !23, i64 0, !14, i64 24, !19, i64 32}
!23 = !{!"_ZTSN2vl11collections9ArrayBaseINS_12ObjectStringIwEEEE", !24, i64 0, !6, i64 8, !14, i64 16}
!24 = !{!"_ZTSN2vl11collections9ListStoreINS_12ObjectStringIwEELb0EEE", !11, i64 0}
!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"

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol18GetSubSymbolByNameERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol20SearchClassSubSymbolERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %.preheader, label %.thread17

.preheader:                                       ; preds = %2, %7
  %.01120 = phi ptr [ %8, %7 ], [ %0, %2 ]
  %6 = tail call noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol18GetSubSymbolByNameERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(304) %.01120, ptr noundef nonnull align 8 dereferenceable(48) %1)
  %.not14 = icmp eq ptr %6, null
  br i1 %.not14, label %7, label %.thread17

7:                                                ; preds = %.preheader
  %8 = tail call noundef ptr @_ZN2vl7parsing9analyzing13ParsingSymbol19GetDescriptorSymbolEv(ptr noundef nonnull align 8 dereferenceable(304) %.01120)
  %.not.not = icmp eq ptr %8, null
  br i1 %.not.not, label %.thread17, label %.preheader, !llvm.loop !24

.thread17:                                        ; preds = %7, %.preheader, %2
  %.3 = phi ptr [ null, %2 ], [ null, %7 ], [ %6, %.preheader ]
  ret ptr %.3
}

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 = !{!6, !11, i64 16}
!6 = !{!"_ZTSN2vl7parsing9analyzing13ParsingSymbolE", !7, i64 0, !8, i64 8, !11, i64 16, !12, i64 24, !8, i64 72, !12, i64 80, !8, i64 128, !8, i64 136, !14, i64 144, !19, i64 192}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN2vl7parsing9analyzing13ParsingSymbol10SymbolTypeE", !9, i64 0}
!12 = !{!"_ZTSN2vl12ObjectStringIwEE", !7, i64 0, !8, i64 8, !8, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!13 = !{!"long", !9, i64 0}
!14 = !{!"_ZTSN2vl11collections4ListIPNS_7parsing9analyzing13ParsingSymbolES5_EE", !15, i64 0}
!15 = !{!"_ZTSN2vl11collections8ListBaseIPNS_7parsing9analyzing13ParsingSymbolES5_EE", !16, i64 0, !13, i64 24, !18, i64 32}
!16 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_7parsing9analyzing13ParsingSymbolEEE", !17, i64 0, !8, i64 8, !13, i64 16}
!17 = !{!"_ZTSN2vl11collections9ListStoreIPNS_7parsing9analyzing13ParsingSymbolELb1EEE", !7, i64 0}
!18 = !{!"bool", !9, i64 0}
!19 = !{!"_ZTSN2vl11collections10DictionaryINS_12ObjectStringIwEEPNS_7parsing9analyzing13ParsingSymbolES3_S7_EE", !7, i64 0, !20, i64 8, !14, i64 56}
!20 = !{!"_ZTSN2vl11collections10SortedListINS_12ObjectStringIwEES3_EE", !21, i64 0}
!21 = !{!"_ZTSN2vl11collections8ListBaseINS_12ObjectStringIwEES3_EE", !22, i64 0, !13, i64 24, !18, i64 32}
!22 = !{!"_ZTSN2vl11collections9ArrayBaseINS_12ObjectStringIwEEEE", !23, i64 0, !8, i64 8, !13, i64 16}
!23 = !{!"_ZTSN2vl11collections9ListStoreINS_12ObjectStringIwEELb0EEE", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass