; 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::parsing::analyzing::Action" = type { %"class.vl::Object", i32, ptr, ptr, ptr, ptr, ptr }
%"class.vl::Object" = type { ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN2vl7parsing9analyzing27CompareActionForRearrangingENS_3PtrINS1_6ActionEEES4_(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %7 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %6, i32 0, i32 1
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %10 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %9, i32 0, i32 1
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = icmp slt i32 %8, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i64 -1, ptr %3, align 8
  br label %60

14:                                               ; preds = %2
  %15 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %16 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %19 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = icmp sgt i32 %17, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %14
  store i64 1, ptr %3, align 8
  br label %60

23:                                               ; preds = %14
  %24 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %25 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %28 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = icmp ult ptr %26, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i64 -1, ptr %3, align 8
  br label %60

32:                                               ; preds = %23
  %33 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %34 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %37 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = icmp ugt ptr %35, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %32
  store i64 1, ptr %3, align 8
  br label %60

41:                                               ; preds = %32
  %42 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %43 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  %45 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %46 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = icmp ult ptr %44, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %41
  store i64 -1, ptr %3, align 8
  br label %60

50:                                               ; preds = %41
  %51 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %52 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %51, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %55 = getelementptr inbounds %"class.vl::parsing::analyzing::Action", ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = icmp ugt ptr %53, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %50
  store i64 1, ptr %3, align 8
  br label %60

59:                                               ; preds = %50
  store i64 0, ptr %3, align 8
  br label %60

60:                                               ; preds = %59, %58, %49, %40, %31, %22, %13
  %61 = load i64, ptr %3, align 8
  ret i64 %61
}

attributes #0 = { 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 #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" }

!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, !12, i64 8}
!10 = !{!"_ZTSN2vl7parsing9analyzing6ActionE", !11, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"_ZTSN2vl6ObjectE"}
!12 = !{!"_ZTSN2vl7parsing9analyzing6Action10ActionTypeE", !7, i64 0}
!13 = !{!10, !6, i64 24}
!14 = !{!10, !6, i64 16}


; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i64 -1, 2) i64 @_ZN2vl7parsing9analyzing27CompareActionForRearrangingENS_3PtrINS1_6ActionEEES4_(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp slt i32 %5, %8
  br i1 %9, label %50, label %10

10:                                               ; preds = %2
  %11 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %14 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !5
  %17 = icmp sgt i32 %13, %16
  br i1 %17, label %50, label %18

18:                                               ; preds = %10
  %19 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = icmp ult ptr %21, %24
  br i1 %25, label %50, label %26

26:                                               ; preds = %18
  %27 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %28 = getelementptr inbounds i8, ptr %27, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = icmp ugt ptr %29, %32
  br i1 %33, label %50, label %34

34:                                               ; preds = %26
  %35 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = icmp ult ptr %37, %40
  br i1 %41, label %50, label %42

42:                                               ; preds = %34
  %43 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = tail call noundef ptr @_ZNK2vl3PtrINS_7parsing9analyzing6ActionEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %49 = icmp ugt ptr %45, %48
  %. = zext i1 %49 to i64
  br label %50

50:                                               ; preds = %42, %34, %26, %18, %10, %2
  %.0 = phi i64 [ -1, %2 ], [ 1, %10 ], [ -1, %18 ], [ 1, %26 ], [ -1, %34 ], [ %., %42 ]
  ret i64 %.0
}

attributes #0 = { 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" }

!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, !8, i64 8}
!6 = !{!"_ZTSN2vl7parsing9analyzing6ActionE", !7, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"_ZTSN2vl7parsing9analyzing6Action10ActionTypeE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !11, i64 16}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass