; 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::Ptr.482" = type { ptr, ptr, ptr, ptr }
%"class.vl::parsing::tabling::ParsingTable::AttributeInfoList" = type { %"class.vl::Object", %"class.vl::collections::List.483" }
%"class.vl::Object" = type { ptr }
%"class.vl::collections::List.483" = type { %"class.vl::collections::ListBase.base.489", %"class.vl::collections::IEnumerable.487" }
%"class.vl::collections::ListBase.base.489" = type <{ %"class.vl::collections::ArrayBase.base.488", i64, i8 }>
%"class.vl::collections::ArrayBase.base.488" = type { %"class.vl::collections::ListStore.486", ptr, i64 }
%"class.vl::collections::ListStore.486" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.487" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::parsing::tabling::ParsingTable::AttributeInfo" = type { %"class.vl::Object", %"class.vl::ObjectString", %"class.vl::collections::List" }
%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"class.vl::collections::List" = 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" }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2EPS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing7tabling12ParsingTable17AttributeInfoList9FindFirstERKNS_12ObjectStringIwEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.482") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(48) %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %29, %3
  %11 = load i64, ptr %7, align 8, !tbaa !9
  %12 = getelementptr inbounds %"class.vl::parsing::tabling::ParsingTable::AttributeInfoList", ptr %9, i32 0, i32 1
  %13 = call noundef i64 @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %14 = icmp slt i64 %11, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %10
  store i32 2, ptr %8, align 4
  br label %32

16:                                               ; preds = %10
  %17 = getelementptr inbounds %"class.vl::parsing::tabling::ParsingTable::AttributeInfoList", ptr %9, i32 0, i32 1
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl11collections4ListINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEPS6_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %17, i64 noundef %18)
  %20 = call noundef ptr @_ZNK2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
  %21 = getelementptr inbounds %"class.vl::parsing::tabling::ParsingTable::AttributeInfo", ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef zeroext i1 @_ZNK2vl12ObjectStringIwEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(48) %22)
  br i1 %23, label %24, label %28

24:                                               ; preds = %16
  %25 = getelementptr inbounds %"class.vl::parsing::tabling::ParsingTable::AttributeInfoList", ptr %9, i32 0, i32 1
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl11collections4ListINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEPS6_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %25, i64 noundef %26)
  call void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %27)
  store i32 1, ptr %8, align 4
  br label %32

28:                                               ; preds = %16
  br label %29

29:                                               ; preds = %28
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %7, align 8, !tbaa !9
  br label %10, !llvm.loop !11

32:                                               ; preds = %24, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %33 = load i32, ptr %8, align 4
  switch i32 %33, label %36 [
    i32 2, label %34
    i32 1, label %35
  ]

34:                                               ; preds = %32
  call void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2EPS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef null)
  br label %35

35:                                               ; preds = %34, %32
  ret void

36:                                               ; preds = %32
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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"

%"class.vl::Ptr.482" = type { ptr, ptr, ptr, ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2EPS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing7tabling12ParsingTable17AttributeInfoList9FindFirstERKNS_12ObjectStringIwEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.482") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(48) %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %6 = icmp sgt i64 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3, %11
  %.0612 = phi i64 [ %12, %11 ], [ 0, %3 ]
  %7 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl11collections4ListINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEPS6_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %4, i64 noundef %.0612)
  %8 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = tail call noundef zeroext i1 @_ZNK2vl12ObjectStringIwEeqERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(48) %2)
  br i1 %10, label %15, label %11

11:                                               ; preds = %.lr.ph
  %12 = add nuw nsw i64 %.0612, 1
  %13 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %14 = icmp slt i64 %12, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !5

15:                                               ; preds = %.lr.ph
  %16 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl11collections4ListINS_3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEEPS6_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %4, i64 noundef %.0612)
  tail call void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %16)
  br label %17

._crit_edge:                                      ; preds = %11, %3
  tail call void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2EPS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef null)
  br label %17

17:                                               ; preds = %15, %._crit_edge
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_7parsing7tabling12ParsingTable13AttributeInfoEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) 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"}


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