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

; 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.1079" = type { ptr, ptr, ptr, ptr }
%"class.vl::regex_internal::Transition" = type { ptr, ptr, %"class.vl::regex_internal::CharRange", i32, i64, i64 }
%"class.vl::regex_internal::CharRange" = type { i32, i32 }
%"class.vl::regex_internal::State" = type { %"class.vl::collections::List.1071", %"class.vl::collections::List.1071", i8, ptr }
%"class.vl::collections::List.1071" = type { %"class.vl::collections::ListBase.base.1077", %"class.vl::collections::IEnumerable.1075" }
%"class.vl::collections::ListBase.base.1077" = type <{ %"class.vl::collections::ArrayBase.base.1076", i64, i8 }>
%"class.vl::collections::ArrayBase.base.1076" = type { %"class.vl::collections::ListStore.1074", ptr, i64 }
%"class.vl::collections::ListStore.1074" = type { %"class.vl::Object" }
%"class.vl::Object" = type { ptr }
%"class.vl::collections::IEnumerable.1075" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::regex_internal::Automaton" = type { %"class.vl::collections::List.1054", %"class.vl::collections::List.1062", %"class.vl::collections::List", ptr }
%"class.vl::collections::List.1054" = type { %"class.vl::collections::ListBase.base.1060", %"class.vl::collections::IEnumerable.1058" }
%"class.vl::collections::ListBase.base.1060" = type <{ %"class.vl::collections::ArrayBase.base.1059", i64, i8 }>
%"class.vl::collections::ArrayBase.base.1059" = type { %"class.vl::collections::ListStore.1057", ptr, i64 }
%"class.vl::collections::ListStore.1057" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.1058" = type { %"class.vl::Interface" }
%"class.vl::collections::List.1062" = type { %"class.vl::collections::ListBase.base.1068", %"class.vl::collections::IEnumerable.1066" }
%"class.vl::collections::ListBase.base.1068" = type <{ %"class.vl::collections::ArrayBase.base.1067", i64, i8 }>
%"class.vl::collections::ArrayBase.base.1067" = type { %"class.vl::collections::ListStore.1065", ptr, i64 }
%"class.vl::collections::ListStore.1065" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.1066" = type { %"class.vl::Interface" }
%"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: 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 noundef ptr @_ZN2vl14regex_internal9Automaton13NewTransitionEPNS0_5StateES3_(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, ptr noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.vl::Ptr.1079", 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
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %12 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #7
  invoke void @_ZN2vl14regex_internal10TransitionC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12)
          to label %13 unwind label %31

13:                                               ; preds = %3
  store ptr %12, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.vl::regex_internal::Transition", ptr %15, i32 0, i32 0
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.vl::regex_internal::Transition", ptr %18, i32 0, i32 1
  store ptr %17, ptr %19, align 8, !tbaa !15
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %20, i32 0, i32 0
  %22 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %21, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %23, i32 0, i32 1
  %25 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %24, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %26 = getelementptr inbounds %"class.vl::regex_internal::Automaton", ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %27)
  %28 = invoke noundef i64 @_ZN2vl11collections4ListINS_3PtrINS_14regex_internal10TransitionEEEPS4_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33) %26, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %29 unwind label %35

29:                                               ; preds = %13
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret ptr %30

31:                                               ; preds = %3
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %8, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %12, i64 noundef 48) #8
  br label %39

35:                                               ; preds = %13
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %8, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %9, align 4
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  br label %39

39:                                               ; preds = %35, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr %8, align 8
  %42 = load i32, ptr %9, align 4
  %43 = insertvalue { ptr, i32 } poison, ptr %41, 0
  %44 = insertvalue { ptr, i32 } %43, i32 %42, 1
  resume { ptr, i32 } %44
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 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 = { 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 #5 = { 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 #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"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN2vl14regex_internal10TransitionE", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 24, !14, i64 32, !14, i64 40}
!11 = !{!"_ZTSN2vl14regex_internal9CharRangeE", !12, i64 0, !12, i64 4}
!12 = !{!"wchar_t", !7, i64 0}
!13 = !{!"_ZTSN2vl14regex_internal10Transition4TypeE", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !6, i64 8}


; 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.1079" = 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 noundef ptr @_ZN2vl14regex_internal9Automaton13NewTransitionEPNS0_5StateES3_(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vl::Ptr.1079", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %6 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
  invoke void @_ZN2vl14regex_internal10TransitionC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6)
          to label %7 unwind label %17

7:                                                ; preds = %3
  store ptr %6, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %2, ptr %8, align 8, !tbaa !15
  %9 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %10 = getelementptr inbounds i8, ptr %2, i64 48
  %11 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %10, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %13)
  %14 = invoke noundef i64 @_ZN2vl11collections4ListINS_3PtrINS_14regex_internal10TransitionEEEPS4_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33) %12, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %15 unwind label %19

15:                                               ; preds = %7
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret ptr %16

17:                                               ; preds = %3
  %18 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 48) #8
  br label %21

19:                                               ; preds = %7
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %21

21:                                               ; preds = %19, %17
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_14regex_internal10TransitionEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 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 = { 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 #5 = { 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 #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"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN2vl14regex_internal10TransitionE", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 24, !14, i64 32, !14, i64 40}
!11 = !{!"_ZTSN2vl14regex_internal9CharRangeE", !12, i64 0, !12, i64 4}
!12 = !{!"wchar_t", !7, i64 0}
!13 = !{!"_ZTSN2vl14regex_internal10Transition4TypeE", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !6, i64 8}


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