; LLVM IR from Dev-XYS/Algorithms :: Heavy-Light-Decomposition.ll (Z10tquery_maxP6vertexS0_)

; 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.vertex = type { ptr, i32, i32, i32, i32, ptr, ptr, ptr }

@root = external dso_local global ptr, align 8
@ivc = external dso_local global i32, align 4

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10tquery_maxP6vertexS0_(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 -1000000000, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  br label %11

11:                                               ; preds = %97, %2
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.vertex, ptr %12, i32 0, i32 7
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.vertex, ptr %15, i32 0, i32 7
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = icmp ne ptr %14, %17
  br i1 %18, label %19, label %98

19:                                               ; preds = %11
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.vertex, ptr %20, i32 0, i32 7
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = icmp eq ptr %22, %23
  br i1 %24, label %25, label %29

25:                                               ; preds = %19
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.vertex, ptr %26, i32 0, i32 5
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  br label %33

29:                                               ; preds = %19
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.vertex, ptr %30, i32 0, i32 7
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  br label %33

33:                                               ; preds = %29, %25
  %34 = phi ptr [ %28, %25 ], [ %32, %29 ]
  store ptr %34, ptr %6, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.vertex, ptr %35, i32 0, i32 7
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = icmp eq ptr %37, %38
  br i1 %39, label %40, label %44

40:                                               ; preds = %33
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.vertex, ptr %41, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  br label %48

44:                                               ; preds = %33
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.vertex, ptr %45, i32 0, i32 7
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  br label %48

48:                                               ; preds = %44, %40
  %49 = phi ptr [ %43, %40 ], [ %47, %44 ]
  store ptr %49, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.vertex, ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 4, !tbaa !14
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.vertex, ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !14
  %56 = icmp slt i32 %52, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %48
  call void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br label %58

58:                                               ; preds = %57, %48
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.vertex, ptr %59, i32 0, i32 7
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = icmp eq ptr %61, %62
  br i1 %63, label %64, label %79

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %65 = load ptr, ptr @root, align 8, !tbaa !5
  %66 = load i32, ptr @ivc, align 4, !tbaa !9
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.vertex, ptr %67, i32 0, i32 4
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.vertex, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 4, !tbaa !15
  %73 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %65, i32 noundef 1, i32 noundef %66, i32 noundef %69, i32 noundef %72)
  store i32 %73, ptr %8, align 4, !tbaa !9
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %75 = load i32, ptr %74, align 4, !tbaa !9
  store i32 %75, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.vertex, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !13
  store ptr %78, ptr %3, align 8, !tbaa !5
  br label %97

79:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %80 = load ptr, ptr @root, align 8, !tbaa !5
  %81 = load i32, ptr @ivc, align 4, !tbaa !9
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.vertex, ptr %82, i32 0, i32 7
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds %struct.vertex, ptr %84, i32 0, i32 4
  %86 = load i32, ptr %85, align 4, !tbaa !15
  %87 = add nsw i32 %86, 1
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.vertex, ptr %88, i32 0, i32 4
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %80, i32 noundef 1, i32 noundef %81, i32 noundef %87, i32 noundef %90)
  store i32 %91, ptr %9, align 4, !tbaa !9
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %93 = load i32, ptr %92, align 4, !tbaa !9
  store i32 %93, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.vertex, ptr %94, i32 0, i32 7
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  store ptr %96, ptr %3, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %79, %64
  br label %11, !llvm.loop !16

98:                                               ; preds = %11
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.vertex, ptr %99, i32 0, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !14
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.vertex, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !14
  %105 = icmp sgt i32 %101, %104
  br i1 %105, label %106, label %107

106:                                              ; preds = %98
  call void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br label %107

107:                                              ; preds = %106, %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %108 = load ptr, ptr @root, align 8, !tbaa !5
  %109 = load i32, ptr @ivc, align 4, !tbaa !9
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.vertex, ptr %110, i32 0, i32 4
  %112 = load i32, ptr %111, align 4, !tbaa !15
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.vertex, ptr %113, i32 0, i32 4
  %115 = load i32, ptr %114, align 4, !tbaa !15
  %116 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %108, i32 noundef 1, i32 noundef %109, i32 noundef %112, i32 noundef %115)
  store i32 %116, ptr %10, align 4, !tbaa !9
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %118 = load i32, ptr %117, align 4, !tbaa !9
  store i32 %118, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %119 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %119
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"_ZTS6vertex", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!12, !6, i64 24}
!14 = !{!12, !10, i64 12}
!15 = !{!12, !10, i64 20}
!16 = distinct !{!16, !17}
!17 = !{!"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"

@root = external dso_local local_unnamed_addr global ptr, align 8
@ivc = external dso_local local_unnamed_addr global i32, align 4

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10tquery_maxP6vertexS0_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 -1000000000, ptr %5, align 4, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %.not6 = icmp eq ptr %10, %12
  br i1 %.not6, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %63
  %13 = phi ptr [ %68, %63 ], [ %12, %2 ]
  %14 = phi ptr [ %66, %63 ], [ %1, %2 ]
  %15 = phi ptr [ %65, %63 ], [ %10, %2 ]
  %16 = phi ptr [ %storemerge, %63 ], [ %0, %2 ]
  %17 = icmp eq ptr %15, %16
  br i1 %17, label %18, label %21

18:                                               ; preds = %.lr.ph
  %19 = getelementptr inbounds i8, ptr %16, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  br label %21

21:                                               ; preds = %.lr.ph, %18
  %22 = phi ptr [ %20, %18 ], [ %15, %.lr.ph ]
  %23 = icmp eq ptr %13, %14
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %14, i64 24
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  br label %27

27:                                               ; preds = %21, %24
  %28 = phi ptr [ %26, %24 ], [ %13, %21 ]
  %29 = getelementptr inbounds i8, ptr %22, i64 12
  %30 = load i32, ptr %29, align 4, !tbaa !14
  %31 = getelementptr inbounds i8, ptr %28, i64 12
  %32 = load i32, ptr %31, align 4, !tbaa !14
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %27
  call void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %.pre = load ptr, ptr %3, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %34, %27
  %36 = phi ptr [ %.pre, %34 ], [ %16, %27 ]
  %37 = getelementptr inbounds i8, ptr %36, i64 40
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = icmp eq ptr %38, %36
  br i1 %39, label %40, label %50

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %41 = load ptr, ptr @root, align 8, !tbaa !5
  %42 = load i32, ptr @ivc, align 4, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %36, i64 20
  %44 = load i32, ptr %43, align 4, !tbaa !15
  %45 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %41, i32 noundef 1, i32 noundef %42, i32 noundef %44, i32 noundef %44)
  store i32 %45, ptr %6, align 4, !tbaa !9
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %47 = load i32, ptr %46, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 24
  br label %63

50:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %51 = load ptr, ptr @root, align 8, !tbaa !5
  %52 = load i32, ptr @ivc, align 4, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %38, i64 20
  %54 = load i32, ptr %53, align 4, !tbaa !15
  %55 = add nsw i32 %54, 1
  %56 = getelementptr inbounds i8, ptr %36, i64 20
  %57 = load i32, ptr %56, align 4, !tbaa !15
  %58 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %51, i32 noundef 1, i32 noundef %52, i32 noundef %55, i32 noundef %57)
  store i32 %58, ptr %7, align 4, !tbaa !9
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %60 = load i32, ptr %59, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 40
  br label %63

63:                                               ; preds = %50, %40
  %.sink = phi i32 [ %47, %40 ], [ %60, %50 ]
  %storemerge.in = phi ptr [ %49, %40 ], [ %62, %50 ]
  store i32 %.sink, ptr %5, align 4
  %storemerge = load ptr, ptr %storemerge.in, align 8, !tbaa !5
  store ptr %storemerge, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %storemerge, i64 40
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 40
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %.not = icmp eq ptr %65, %68
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %63, %2
  %.lcssa5 = phi ptr [ %0, %2 ], [ %storemerge, %63 ]
  %.lcssa = phi ptr [ %1, %2 ], [ %66, %63 ]
  %69 = getelementptr inbounds i8, ptr %.lcssa5, i64 12
  %70 = load i32, ptr %69, align 4, !tbaa !14
  %71 = getelementptr inbounds i8, ptr %.lcssa, i64 12
  %72 = load i32, ptr %71, align 4, !tbaa !14
  %73 = icmp sgt i32 %70, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %._crit_edge
  call void @_ZSt4swapIP6vertexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %.pre9 = load ptr, ptr %3, align 8, !tbaa !5
  %.pre10 = load ptr, ptr %4, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %74, %._crit_edge
  %76 = phi ptr [ %.pre10, %74 ], [ %.lcssa, %._crit_edge ]
  %77 = phi ptr [ %.pre9, %74 ], [ %.lcssa5, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %78 = load ptr, ptr @root, align 8, !tbaa !5
  %79 = load i32, ptr @ivc, align 4, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %77, i64 20
  %81 = load i32, ptr %80, align 4, !tbaa !15
  %82 = getelementptr inbounds i8, ptr %76, i64 20
  %83 = load i32, ptr %82, align 4, !tbaa !15
  %84 = call noundef i32 @_Z9query_maxP4nodeiiii(ptr noundef %78, i32 noundef 1, i32 noundef %79, i32 noundef %81, i32 noundef %83)
  store i32 %84, ptr %8, align 4, !tbaa !9
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %86 = load i32, ptr %85, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret i32 %86
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"_ZTS6vertex", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!12, !6, i64 24}
!14 = !{!12, !10, i64 12}
!15 = !{!12, !10, i64 20}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass