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

; 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::definitions::ParsingDefinitionGrammarWriter" = type { %"class.vl::Object", %"class.vl::Ptr.337" }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.337" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr.592" = type { ptr, ptr, ptr, ptr }
%"class.vl::parsing::definitions::ParsingDefinitionPrimitiveGrammar" = type { %"class.vl::parsing::definitions::ParsingDefinitionGrammar.base", %"class.vl::ObjectString", %"class.vl::reflection::DescriptableObject" }
%"class.vl::parsing::definitions::ParsingDefinitionGrammar.base" = type { %"class.vl::parsing::ParsingTreeCustomBase.base" }
%"class.vl::parsing::ParsingTreeCustomBase.base" = type { %"class.vl::Object", %"class.vl::reflection::Description.base", %"struct.vl::parsing::ParsingTextRange", %"class.vl::collections::List" }
%"class.vl::reflection::Description.base" = type { ptr }
%"struct.vl::parsing::ParsingTextRange" = type { %"struct.vl::parsing::ParsingTextPos", %"struct.vl::parsing::ParsingTextPos", i64 }
%"struct.vl::parsing::ParsingTextPos" = type { 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" }
%"class.vl::Interface" = type { ptr }
%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing11definitions4RuleERKNS_12ObjectStringIwEE(ptr dead_on_unwind noalias writable sret(%"class.vl::parsing::definitions::ParsingDefinitionGrammarWriter") align 8 %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vl::Ptr.592", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.vl::Ptr.337", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #6
  %9 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 240) #7
  invoke void @_ZN2vl7parsing11definitions33ParsingDefinitionPrimitiveGrammarC1Ev(ptr noundef nonnull align 8 dereferenceable(168) %9)
          to label %10 unwind label %19

10:                                               ; preds = %2
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %9)
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = invoke noundef ptr @_ZNK2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %13 unwind label %23

13:                                               ; preds = %10
  %14 = getelementptr inbounds %"class.vl::parsing::definitions::ParsingDefinitionPrimitiveGrammar", ptr %12, i32 0, i32 1
  %15 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZN2vl12ObjectStringIwEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %16 unwind label %23

16:                                               ; preds = %13
  invoke void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEEC2INS2_33ParsingDefinitionPrimitiveGrammarEEERKNS0_IT_EE(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %17 unwind label %23

17:                                               ; preds = %16
  invoke void @_ZN2vl7parsing11definitions30ParsingDefinitionGrammarWriterC1ENS_3PtrINS1_24ParsingDefinitionGrammarEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %8)
          to label %18 unwind label %27

18:                                               ; preds = %17
  call void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  ret void

19:                                               ; preds = %2
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %6, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %9, i64 noundef 240) #8
  br label %32

23:                                               ; preds = %16, %13, %10
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %6, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %7, align 4
  br label %31

27:                                               ; preds = %17
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %7, align 4
  call void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %31

31:                                               ; preds = %27, %23
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %32

32:                                               ; preds = %31, %19
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  br label %33

33:                                               ; preds = %32
  %34 = load ptr, ptr %6, align 8
  %35 = load i32, ptr %7, align 4
  %36 = insertvalue { ptr, i32 } poison, ptr %34, 0
  %37 = insertvalue { ptr, i32 } %36, i32 %35, 1
  resume { ptr, i32 } %37
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl7parsing11definitions33ParsingDefinitionPrimitiveGrammarC1Ev(ptr noundef nonnull align 8 dereferenceable(168)) unnamed_addr #5 align 2

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

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

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

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

declare void @_ZN2vl7parsing11definitions30ParsingDefinitionGrammarWriterC1ENS_3PtrINS1_24ParsingDefinitionGrammarEEE(ptr, ptr)

attributes #0 = { nobuiltin nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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"}


; 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::definitions::ParsingDefinitionGrammarWriter" = type { %"class.vl::Object", %"class.vl::Ptr.337" }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.337" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr.592" = type { ptr, ptr, ptr, ptr }

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing11definitions4RuleERKNS_12ObjectStringIwEE(ptr dead_on_unwind noalias writable sret(%"class.vl::parsing::definitions::ParsingDefinitionGrammarWriter") align 8 %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.vl::Ptr.592", align 8
  %4 = alloca %"class.vl::Ptr.337", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %5 = tail call noalias noundef nonnull dereferenceable(240) ptr @_Znwm(i64 noundef 240) #7
  invoke void @_ZN2vl7parsing11definitions33ParsingDefinitionPrimitiveGrammarC1Ev(ptr noundef nonnull align 8 dereferenceable(168) %5)
          to label %6 unwind label %13

6:                                                ; preds = %2
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %5)
  %7 = call noundef ptr @_ZNK2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %8 = getelementptr inbounds i8, ptr %7, i64 120
  %9 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZN2vl12ObjectStringIwEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %10 unwind label %15

10:                                               ; preds = %6
  invoke void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEEC2INS2_33ParsingDefinitionPrimitiveGrammarEEERKNS0_IT_EE(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %11 unwind label %15

11:                                               ; preds = %10
  invoke void @_ZN2vl7parsing11definitions30ParsingDefinitionGrammarWriterC1ENS_3PtrINS1_24ParsingDefinitionGrammarEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %4)
          to label %12 unwind label %17

12:                                               ; preds = %11
  call void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  ret void

13:                                               ; preds = %2
  %14 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 240) #8
  br label %20

15:                                               ; preds = %10, %6
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %19

17:                                               ; preds = %11
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl3PtrINS_7parsing11definitions24ParsingDefinitionGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %19

19:                                               ; preds = %17, %15
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ]
  call void @_ZN2vl3PtrINS_7parsing11definitions33ParsingDefinitionPrimitiveGrammarEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  br label %20

20:                                               ; preds = %19, %13
  %.pn.pn = phi { ptr, i32 } [ %.pn, %19 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl7parsing11definitions33ParsingDefinitionPrimitiveGrammarC1Ev(ptr noundef nonnull align 8 dereferenceable(168)) unnamed_addr #5 align 2

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

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

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

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

declare void @_ZN2vl7parsing11definitions30ParsingDefinitionGrammarWriterC1ENS_3PtrINS1_24ParsingDefinitionGrammarEEE(ptr, ptr) local_unnamed_addr

attributes #0 = { nobuiltin nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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)"}


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