; 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::FindTypeVisitor" = type { %"class.vl::Object", %"class.vl::parsing::definitions::ParsingDefinitionType::IVisitor", ptr, ptr, ptr, ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::parsing::definitions::ParsingDefinitionType::IVisitor" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheGetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolE(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheSetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolES7_(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2vl7parsing9analyzing8FindTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSC_EE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(33) %3) #2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.vl::parsing::analyzing::FindTypeVisitor", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = call noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheGetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolE(ptr noundef nonnull align 8 dereferenceable(632) %13, ptr noundef %14, ptr noundef %15)
  store ptr %16, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %53, label %19

19:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #4
  %20 = load ptr, ptr %6, 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 = %19
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  br label %28

25:                                               ; preds = %19
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager9GetGlobalEv(ptr noundef nonnull align 8 dereferenceable(632) %26)
  br label %28

28:                                               ; preds = %25, %23
  %29 = phi ptr [ %24, %23 ], [ %27, %25 ]
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorC2EPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSA_EE(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef %20, ptr noundef %29, ptr noundef nonnull align 8 dereferenceable(33) %30)
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = icmp eq ptr %10, null
  br i1 %32, label %35, label %33

33:                                               ; preds = %28
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  br label %35

35:                                               ; preds = %33, %28
  %36 = phi ptr [ %34, %33 ], [ null, %28 ]
  %37 = load ptr, ptr %31, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 2
  %39 = load ptr, ptr %38, align 8
  invoke void %39(ptr noundef nonnull align 8 dereferenceable(120) %31, ptr noundef %36)
          to label %40 unwind label %49

40:                                               ; preds = %35
  %41 = getelementptr inbounds %"class.vl::parsing::analyzing::FindTypeVisitor", ptr %10, i32 0, i32 5
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  store ptr %42, ptr %9, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = invoke noundef zeroext i1 @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheSetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolES7_(ptr noundef nonnull align 8 dereferenceable(632) %43, ptr noundef %44, ptr noundef %45, ptr noundef %46)
          to label %48 unwind label %49

48:                                               ; preds = %40
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #4
  br label %53

49:                                               ; preds = %40, %35
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %11, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %12, align 4
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %55

53:                                               ; preds = %48, %4
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret ptr %54

55:                                               ; preds = %49
  %56 = load ptr, ptr %11, align 8
  %57 = load i32, ptr %12, align 4
  %58 = insertvalue { ptr, i32 } poison, ptr %56, 0
  %59 = insertvalue { ptr, i32 } %58, i32 %57, 1
  resume { ptr, i32 } %59
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl7parsing9analyzing15FindTypeVisitorC2EPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSA_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { 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 #3 = { inlinehint 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 #4 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"_ZTSN2vl7parsing9analyzing15FindTypeVisitorE", !13, i64 0, !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"_ZTSN2vl6ObjectE"}
!14 = !{!"_ZTSN2vl7parsing11definitions21ParsingDefinitionType8IVisitorE", !15, i64 0}
!15 = !{!"_ZTSN2vl9InterfaceE"}


; 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::parsing::analyzing::FindTypeVisitor" = type { %"class.vl::Object", %"class.vl::parsing::definitions::ParsingDefinitionType::IVisitor", ptr, ptr, ptr, ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::parsing::definitions::ParsingDefinitionType::IVisitor" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }

; 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheGetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolE(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2vl7parsing9analyzing8FindTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSC_EE(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(33) %3) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.vl::parsing::analyzing::FindTypeVisitor", align 8
  %6 = tail call noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheGetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolE(ptr noundef nonnull align 8 dereferenceable(632) %1, ptr noundef %0, ptr noundef %2)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %23

7:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #4
  %.not18 = icmp eq ptr %2, null
  br i1 %.not18, label %8, label %10

8:                                                ; preds = %7
  %9 = tail call noundef ptr @_ZN2vl7parsing9analyzing20ParsingSymbolManager9GetGlobalEv(ptr noundef nonnull align 8 dereferenceable(632) %1)
  br label %10

10:                                               ; preds = %7, %8
  %11 = phi ptr [ %9, %8 ], [ %2, %7 ]
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorC2EPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSA_EE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull %1, ptr noundef %11, ptr noundef nonnull align 8 dereferenceable(33) %3)
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8
  invoke void %15(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull %12)
          to label %16 unwind label %21

16:                                               ; preds = %10
  %17 = getelementptr inbounds i8, ptr %5, i64 40
  %18 = load ptr, ptr %17, align 8, !tbaa !8
  %19 = invoke noundef zeroext i1 @_ZN2vl7parsing9analyzing20ParsingSymbolManager12CacheSetTypeEPNS0_11definitions21ParsingDefinitionTypeEPNS1_13ParsingSymbolES7_(ptr noundef nonnull align 8 dereferenceable(632) %1, ptr noundef nonnull %0, ptr noundef %2, ptr noundef %18)
          to label %20 unwind label %21

20:                                               ; preds = %16
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  br label %23

21:                                               ; preds = %16, %10
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  resume { ptr, i32 } %22

23:                                               ; preds = %20, %4
  %.0 = phi ptr [ %6, %4 ], [ %18, %20 ]
  ret ptr %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl7parsing9analyzing15FindTypeVisitorC2EPNS1_20ParsingSymbolManagerEPNS1_13ParsingSymbolERNS_11collections4ListINS_3PtrINS0_12ParsingErrorEEEPSA_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2vl7parsing9analyzing15FindTypeVisitorD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { 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 #3 = { inlinehint 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 #4 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 40}
!9 = !{!"_ZTSN2vl7parsing9analyzing15FindTypeVisitorE", !10, i64 0, !11, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!10 = !{!"_ZTSN2vl6ObjectE"}
!11 = !{!"_ZTSN2vl7parsing11definitions21ParsingDefinitionType8IVisitorE", !12, i64 0}
!12 = !{!"_ZTSN2vl9InterfaceE"}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass