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

; 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.837" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr.838" = 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
define dso_local void @_ZN2vl10reflection11description10IValueList6CreateEv(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.837") align 8 %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.vl::Ptr.838", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  %6 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #6
  invoke void @_ZN2vl11collections4ListINS_10reflection11description5ValueES4_EC1Ev(ptr noundef nonnull align 8 dereferenceable(33) %6)
          to label %7 unwind label %20

7:                                                ; preds = %1
  call void @_ZN2vl3PtrINS_11collections4ListINS_10reflection11description5ValueES5_EEEC2EPS6_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %6)
  %8 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 152) #6
          to label %9 unwind label %24

9:                                                ; preds = %7
  invoke void @_ZN2vl10reflection11description16ValueListWrapperINS_3PtrINS_11collections4ListINS1_5ValueES6_EEEEEC1ERKS8_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %10 unwind label %28

10:                                               ; preds = %9
  %11 = icmp eq ptr %8, null
  br i1 %11, label %17, label %12

12:                                               ; preds = %10
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -64
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr %8, i64 %15
  br label %17

17:                                               ; preds = %12, %10
  %18 = phi ptr [ %16, %12 ], [ null, %10 ]
  invoke void @_ZN2vl3PtrINS_10reflection11description10IValueListEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %18)
          to label %19 unwind label %24

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

20:                                               ; preds = %1
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %4, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %6, i64 noundef 48) #7
  br label %33

24:                                               ; preds = %17, %7
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %4, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %5, align 4
  br label %32

28:                                               ; preds = %9
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %4, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %8, i64 noundef 152) #7
  br label %32

32:                                               ; preds = %28, %24
  call void @_ZN2vl3PtrINS_11collections4ListINS_10reflection11description5ValueES5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %33

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

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

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

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

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

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

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

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 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"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::Ptr.837" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr.838" = 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
define dso_local void @_ZN2vl10reflection11description10IValueList6CreateEv(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.837") align 8 %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.vl::Ptr.838", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  %3 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #6
  invoke void @_ZN2vl11collections4ListINS_10reflection11description5ValueES4_EC1Ev(ptr noundef nonnull align 8 dereferenceable(33) %3)
          to label %4 unwind label %12

4:                                                ; preds = %1
  call void @_ZN2vl3PtrINS_11collections4ListINS_10reflection11description5ValueES5_EEEC2EPS6_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull %3)
  %5 = invoke noalias noundef nonnull dereferenceable(152) ptr @_Znwm(i64 noundef 152) #6
          to label %6 unwind label %14

6:                                                ; preds = %4
  invoke void @_ZN2vl10reflection11description16ValueListWrapperINS_3PtrINS_11collections4ListINS1_5ValueES6_EEEEEC1ERKS8_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %7 unwind label %16

7:                                                ; preds = %6
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -64
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr %5, i64 %10
  call void @_ZN2vl3PtrINS_10reflection11description10IValueListEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %11)
  call void @_ZN2vl3PtrINS_11collections4ListINS_10reflection11description5ValueES5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  ret void

12:                                               ; preds = %1
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 48) #7
  br label %19

14:                                               ; preds = %4
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %18

16:                                               ; preds = %6
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 152) #7
  br label %18

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

19:                                               ; preds = %18, %12
  %.pn.pn = phi { ptr, i32 } [ %.pn, %18 ], [ %13, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

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 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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