; 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::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::Transition" = type { ptr, ptr, %"class.vl::regex_internal::CharRange", i32, i64, i64 }
%"class.vl::regex_internal::CharRange" = type { i32, i32 }

; 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: 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)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl14regex_internal14CollectEpsilonEPNS0_5StateES2_PFbPNS0_10TransitionEERNS_11collections4ListIS2_S2_EERNS8_IS4_S4_EE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(33) %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %13 = load ptr, ptr %9, align 8, !tbaa !5
  %14 = call noundef zeroext i1 @_ZNK2vl11collections4ListIPNS_14regex_internal5StateES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %14, label %66, label %15

15:                                               ; preds = %5
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal5StateES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %16, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %62, %15
  %19 = load i64, ptr %11, align 8, !tbaa !9
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %20, i32 0, i32 0
  %22 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_14regex_internal10TransitionEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %23 = icmp slt i64 %19, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %65

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %26, i32 0, i32 0
  %28 = load i64, ptr %11, align 8, !tbaa !9
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %27, i64 noundef %28)
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  store ptr %30, ptr %12, align 8, !tbaa !5
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = call noundef zeroext i1 %31(ptr noundef %32)
  br i1 %33, label %34, label %58

34:                                               ; preds = %25
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.vl::regex_internal::Transition", ptr %36, i32 0, i32 1
  %38 = call noundef zeroext i1 @_ZNK2vl11collections4ListIPNS_14regex_internal5StateES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %35, ptr noundef nonnull align 8 dereferenceable(8) %37)
  br i1 %38, label %57, label %39

39:                                               ; preds = %34
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.vl::regex_internal::Transition", ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %42, i32 0, i32 2
  %44 = load i8, ptr %43, align 8, !tbaa !16, !range !24, !noundef !25
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %49

46:                                               ; preds = %39
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.vl::regex_internal::State", ptr %47, i32 0, i32 2
  store i8 1, ptr %48, align 8, !tbaa !16
  br label %49

49:                                               ; preds = %46, %39
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.vl::regex_internal::Transition", ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN2vl14regex_internal14CollectEpsilonEPNS0_5StateES2_PFbPNS0_10TransitionEERNS_11collections4ListIS2_S2_EERNS8_IS4_S4_EE(ptr noundef %50, ptr noundef %53, ptr noundef %54, ptr noundef nonnull align 8 dereferenceable(33) %55, ptr noundef nonnull align 8 dereferenceable(33) %56)
  br label %57

57:                                               ; preds = %49, %34
  br label %61

58:                                               ; preds = %25
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %59, ptr noundef nonnull align 8 dereferenceable(8) %12)
  br label %61

61:                                               ; preds = %58, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %62

62:                                               ; preds = %61
  %63 = load i64, ptr %11, align 8, !tbaa !9
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %11, align 8, !tbaa !9
  br label %18, !llvm.loop !26

65:                                               ; preds = %24
  br label %66

66:                                               ; preds = %65, %5
  ret void
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN2vl14regex_internal10TransitionE", !6, i64 0, !6, i64 8, !13, i64 16, !15, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!"_ZTSN2vl14regex_internal9CharRangeE", !14, i64 0, !14, i64 4}
!14 = !{!"wchar_t", !7, i64 0}
!15 = !{!"_ZTSN2vl14regex_internal10Transition4TypeE", !7, i64 0}
!16 = !{!17, !23, i64 96}
!17 = !{!"_ZTSN2vl14regex_internal5StateE", !18, i64 0, !18, i64 48, !23, i64 96, !6, i64 104}
!18 = !{!"_ZTSN2vl11collections4ListIPNS_14regex_internal10TransitionES4_EE", !19, i64 0}
!19 = !{!"_ZTSN2vl11collections8ListBaseIPNS_14regex_internal10TransitionES4_EE", !20, i64 0, !10, i64 24, !23, i64 32}
!20 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_14regex_internal10TransitionEEE", !21, i64 0, !6, i64 8, !10, i64 16}
!21 = !{!"_ZTSN2vl11collections9ListStoreIPNS_14regex_internal10TransitionELb1EEE", !22, i64 0}
!22 = !{!"_ZTSN2vl6ObjectE"}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

; 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 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 #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl14regex_internal14CollectEpsilonEPNS0_5StateES2_PFbPNS0_10TransitionEERNS_11collections4ListIS2_S2_EERNS8_IS4_S4_EE(ptr nocapture noundef writeonly %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(33) %4) local_unnamed_addr #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  %8 = call noundef zeroext i1 @_ZNK2vl11collections4ListIPNS_14regex_internal5StateES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %8, label %.loopexit, label %9

9:                                                ; preds = %5
  %10 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal5StateES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_14regex_internal10TransitionEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  br label %15

15:                                               ; preds = %.lr.ph, %35
  %.012 = phi i64 [ 0, %.lr.ph ], [ %36, %35 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %16, i64 noundef %.012)
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = call noundef zeroext i1 %2(ptr noundef %18)
  br i1 %19, label %20, label %33

20:                                               ; preds = %15
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = call noundef zeroext i1 @_ZNK2vl11collections4ListIPNS_14regex_internal5StateES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(8) %22)
  br i1 %23, label %35, label %24

24:                                               ; preds = %20
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 96
  %29 = load i8, ptr %28, align 8, !tbaa !15, !range !23, !noundef !24
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %31, label %32

31:                                               ; preds = %24
  store i8 1, ptr %14, align 8, !tbaa !15
  br label %32

32:                                               ; preds = %31, %24
  call void @_ZN2vl14regex_internal14CollectEpsilonEPNS0_5StateES2_PFbPNS0_10TransitionEERNS_11collections4ListIS2_S2_EERNS8_IS4_S4_EE(ptr noundef %0, ptr noundef nonnull %27, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(33) %4)
  br label %35

33:                                               ; preds = %15
  %34 = call noundef i64 @_ZN2vl11collections4ListIPNS_14regex_internal10TransitionES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  br label %35

35:                                               ; preds = %20, %32, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %36 = add nuw nsw i64 %.012, 1
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_14regex_internal10TransitionEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  %39 = icmp slt i64 %36, %38
  br i1 %39, label %15, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %35, %9, %5
  ret void
}

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 8}
!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 = !{!16, !22, i64 96}
!16 = !{!"_ZTSN2vl14regex_internal5StateE", !17, i64 0, !17, i64 48, !22, i64 96, !6, i64 104}
!17 = !{!"_ZTSN2vl11collections4ListIPNS_14regex_internal10TransitionES4_EE", !18, i64 0}
!18 = !{!"_ZTSN2vl11collections8ListBaseIPNS_14regex_internal10TransitionES4_EE", !19, i64 0, !14, i64 24, !22, i64 32}
!19 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_14regex_internal10TransitionEEE", !20, i64 0, !6, i64 8, !14, i64 16}
!20 = !{!"_ZTSN2vl11collections9ListStoreIPNS_14regex_internal10TransitionELb1EEE", !21, i64 0}
!21 = !{!"_ZTSN2vl6ObjectE"}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass