; 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"

%"struct.vl::parsing::ParsingTextRange" = type { %"struct.vl::parsing::ParsingTextPos", %"struct.vl::parsing::ParsingTextPos", i64 }
%"struct.vl::parsing::ParsingTextPos" = type { i64, i64, i64 }
%"class.vl::parsing::ParsingTreeCustomBase" = type { %"class.vl::Object", %"class.vl::reflection::Description.base", %"struct.vl::parsing::ParsingTextRange", %"class.vl::collections::List", %"class.vl::reflection::DescriptableObject" }
%"class.vl::Object" = type { ptr }
%"class.vl::reflection::Description.base" = type { ptr }
%"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::reflection::DescriptableObject" = type { ptr, i64, ptr, i64, ptr, %"class.vl::Ptr.12" }
%"class.vl::Ptr.12" = type { ptr, ptr, ptr, ptr }
%"class.vl::parsing::ParsingOriginalLocationRecorder" = type { %"class.vl::Object", %"class.vl::Ptr.684", %"class.vl::parsing::IParsingPrintNodeRecorder" }
%"class.vl::Ptr.684" = type { ptr, ptr, ptr, ptr }
%"class.vl::parsing::IParsingPrintNodeRecorder" = 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing31ParsingOriginalLocationRecorder6RecordEPNS0_21ParsingTreeCustomBaseERKNS0_16ParsingTextRangeE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(56) %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.vl::parsing::ParsingTextRange", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %7) #4
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %"class.vl::parsing::ParsingTreeCustomBase", ptr %9, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %10, i64 56, i1 false), !tbaa.struct !9
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.vl::parsing::ParsingTextRange", ptr %11, i32 0, i32 2
  %13 = load i64, ptr %12, align 8, !tbaa !12
  %14 = getelementptr inbounds %"struct.vl::parsing::ParsingTextRange", ptr %7, i32 0, i32 2
  store i64 %13, ptr %14, align 8, !tbaa !12
  %15 = getelementptr inbounds %"class.vl::parsing::ParsingOriginalLocationRecorder", ptr %8, i32 0, i32 1
  %16 = call noundef ptr @_ZNK2vl3PtrINS_7parsing25IParsingPrintNodeRecorderEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %16, align 8, !tbaa !15
  %19 = getelementptr inbounds ptr, ptr %18, i64 2
  %20 = load ptr, ptr %19, align 8
  call void %20(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %17, ptr noundef nonnull align 8 dereferenceable(56) %7)
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{i64 0, i64 8, !10, i64 8, i64 8, !10, i64 16, i64 8, !10, i64 24, i64 8, !10, i64 32, i64 8, !10, i64 40, i64 8, !10, i64 48, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !11, i64 48}
!13 = !{!"_ZTSN2vl7parsing16ParsingTextRangeE", !14, i64 0, !14, i64 24, !11, i64 48}
!14 = !{!"_ZTSN2vl7parsing14ParsingTextPosE", !11, i64 0, !11, i64 8, !11, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}


; 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"

%"struct.vl::parsing::ParsingTextRange" = type { %"struct.vl::parsing::ParsingTextPos", %"struct.vl::parsing::ParsingTextPos", i64 }
%"struct.vl::parsing::ParsingTextPos" = type { i64, i64, i64 }

; 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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing31ParsingOriginalLocationRecorder6RecordEPNS0_21ParsingTreeCustomBaseERKNS0_16ParsingTextRangeE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(56) %2) unnamed_addr #3 align 2 {
  %4 = alloca %"struct.vl::parsing::ParsingTextRange", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #4
  %5 = getelementptr inbounds i8, ptr %1, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(56) %5, i64 48, i1 false), !tbaa.struct !5
  %6 = getelementptr inbounds i8, ptr %2, i64 48
  %7 = load i64, ptr %6, align 8, !tbaa !10
  %8 = getelementptr inbounds i8, ptr %4, i64 48
  store i64 %7, ptr %8, align 8, !tbaa !10
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing25IParsingPrintNodeRecorderEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load ptr, ptr %12, align 8
  call void %13(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(56) %4)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{i64 0, i64 8, !6, i64 8, i64 8, !6, i64 16, i64 8, !6, i64 24, i64 8, !6, i64 32, i64 8, !6, i64 40, i64 8, !6, i64 48, i64 8, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 48}
!11 = !{!"_ZTSN2vl7parsing16ParsingTextRangeE", !12, i64 0, !12, i64 24, !7, i64 48}
!12 = !{!"_ZTSN2vl7parsing14ParsingTextPosE", !7, i64 0, !7, i64 8, !7, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !9, i64 0}


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