; LLVM IR from trainsn/GNN-Surrogate :: mpas_ght/src/GHT.ll (ZN6GHTree3cutEv)

; 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.GHTree = type { i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<GHNode>, std::allocator<std::vector<GHNode>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<GHNode>, std::allocator<std::vector<GHNode>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<GHNode>, std::allocator<std::vector<GHNode>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<GHNode>, std::allocator<std::vector<GHNode>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.GHNode = type <{ i32, i32, ptr, %"class.std::vector", ptr, i32, i32, float, i8, [3 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<GHNode *, std::allocator<GHNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<GHNode *, std::allocator<GHNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<GHNode *, std::allocator<GHNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GHNode *, std::allocator<GHNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__._ZN6GHTree3cutEv = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6GHTree3cutEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  %10 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 1
  %11 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 0
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = sub nsw i32 %12, 1
  %14 = sext i32 %13 to i64
  %15 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %14) #3
  %16 = call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  %17 = icmp eq i64 %16, 1
  br i1 %17, label %18, label %19

18:                                               ; preds = %1
  br label %21

19:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 34, ptr noundef @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #4
  unreachable

20:                                               ; No predecessors!
  br label %21

21:                                               ; preds = %20, %18
  %22 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 1
  %23 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = sub nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %26) #3
  %28 = call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #3
  %29 = getelementptr inbounds %class.GHNode, ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %21
  br label %35

33:                                               ; preds = %21
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 35, ptr noundef @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #4
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %36 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !24
  br label %39

39:                                               ; preds = %125, %35
  %40 = load i32, ptr %3, align 4, !tbaa !24
  %41 = icmp sge i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %128

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !24
  br label %44

44:                                               ; preds = %121, %43
  %45 = load i32, ptr %6, align 4, !tbaa !24
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 1
  %48 = load i32, ptr %3, align 4, !tbaa !24
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %49) #3
  %51 = call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #3
  %52 = icmp ult i64 %46, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %44
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %124

54:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %55 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 1
  %56 = load i32, ptr %3, align 4, !tbaa !24
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #3
  %59 = load i32, ptr %6, align 4, !tbaa !24
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %60) #3
  store ptr %61, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.GHNode, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %81

66:                                               ; preds = %54
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.GHNode, ptr %67, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  %70 = getelementptr inbounds %class.GHNode, ptr %69, i32 0, i32 8
  %71 = load i8, ptr %70, align 4, !tbaa !25, !range !26, !noundef !27
  %72 = trunc i8 %71 to i1
  br i1 %72, label %73, label %81

73:                                               ; preds = %66
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.GHNode, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !16
  %77 = getelementptr inbounds %class.GHNode, ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !28
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.GHNode, ptr %79, i32 0, i32 4
  store ptr %78, ptr %80, align 8, !tbaa !28
  br label %85

81:                                               ; preds = %66, %54
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %class.GHNode, ptr %83, i32 0, i32 4
  store ptr %82, ptr %84, align 8, !tbaa !28
  br label %85

85:                                               ; preds = %81, %73
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %class.GHNode, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !29
  %89 = load i32, ptr %6, align 4, !tbaa !24
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  br label %94

92:                                               ; preds = %85
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 47, ptr noundef @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #4
  unreachable

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93, %91
  %95 = load i32, ptr %6, align 4, !tbaa !24
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %117

97:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %98 = getelementptr inbounds %class.GHTree, ptr %9, i32 0, i32 1
  %99 = load i32, ptr %3, align 4, !tbaa !24
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #3
  %102 = load i32, ptr %6, align 4, !tbaa !24
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %104) #3
  store ptr %105, ptr %8, align 8, !tbaa !5
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.GHNode, ptr %106, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !28
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.GHNode, ptr %109, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = icmp ne ptr %108, %111
  br i1 %112, label %113, label %116

113:                                              ; preds = %97
  %114 = load i32, ptr %5, align 4, !tbaa !24
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %5, align 4, !tbaa !24
  br label %116

116:                                              ; preds = %113, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %117

117:                                              ; preds = %116, %94
  %118 = load i32, ptr %5, align 4, !tbaa !24
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.GHNode, ptr %119, i32 0, i32 1
  store i32 %118, ptr %120, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %121

121:                                              ; preds = %117
  %122 = load i32, ptr %6, align 4, !tbaa !24
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %6, align 4, !tbaa !24
  br label %44, !llvm.loop !30

124:                                              ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %3, align 4, !tbaa !24
  %127 = add nsw i32 %126, -1
  store i32 %127, ptr %3, align 4, !tbaa !24
  br label %39, !llvm.loop !32

128:                                              ; preds = %42
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { noreturn 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 #3 = { nounwind }
attributes #4 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS6GHTree", !11, i64 0, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!17, !6, i64 8}
!17 = !{!"_ZTS6GHNode", !11, i64 0, !11, i64 4, !6, i64 8, !18, i64 16, !6, i64 40, !11, i64 48, !11, i64 52, !22, i64 56, !23, i64 60}
!18 = !{!"_ZTSSt6vectorIP6GHNodeSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIP6GHNodeSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP6GHNodeSaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP6GHNodeSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"float", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!11, !11, i64 0}
!25 = !{!17, !23, i64 60}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!17, !6, i64 40}
!29 = !{!17, !11, i64 4}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


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

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__._ZN6GHTree3cutEv = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6GHTree3cutEv(ptr noundef nonnull align 8 dereferenceable(32) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load i32, ptr %0, align 8, !tbaa !5
  %4 = add nsw i32 %3, -1
  %5 = sext i32 %4 to i64
  %6 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %5) #2
  %7 = tail call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #2
  %8 = icmp eq i64 %7, 1
  br i1 %8, label %10, label %9

9:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 34, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #3
  unreachable

10:                                               ; preds = %1
  %11 = load i32, ptr %0, align 8, !tbaa !5
  %12 = add nsw i32 %11, -1
  %13 = sext i32 %12 to i64
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %13) #2
  %15 = tail call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 0) #2
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = icmp eq ptr %17, null
  br i1 %18, label %20, label %19

19:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 35, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #3
  unreachable

20:                                               ; preds = %10
  %21 = load i32, ptr %0, align 8, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %20
  %23 = zext nneg i32 %21 to i64
  br label %.preheader

.loopexit:                                        ; preds = %64, %43, %.preheader
  %24 = icmp sgt i64 %indvars.iv38, 1
  br i1 %24, label %.preheader, label %._crit_edge, !llvm.loop !23

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %indvars.iv38 = phi i64 [ %23, %.preheader.preheader ], [ %indvars.iv.next39, %.loopexit ]
  %indvars.iv.next39 = add nsw i64 %indvars.iv38, -1
  %25 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %26 = tail call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #2
  %.not33 = icmp eq i64 %26, 0
  br i1 %.not33, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %27 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %28 = tail call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #2
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %.not.peel = icmp eq ptr %30, null
  br i1 %.not.peel, label %38, label %31

31:                                               ; preds = %.lr.ph.preheader
  %32 = getelementptr inbounds i8, ptr %30, i64 60
  %33 = load i8, ptr %32, align 4, !tbaa !25, !range !26, !noundef !27
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %30, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !28
  br label %38

38:                                               ; preds = %.lr.ph.preheader, %31, %35
  %.sink = phi ptr [ %37, %35 ], [ %28, %31 ], [ %28, %.lr.ph.preheader ]
  %39 = getelementptr inbounds i8, ptr %28, i64 40
  store ptr %.sink, ptr %39, align 8, !tbaa !28
  %40 = getelementptr inbounds i8, ptr %28, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !29
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %.loopexit36

43:                                               ; preds = %38
  %44 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %45 = tail call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #2
  %46 = icmp ugt i64 %45, 1
  br i1 %46, label %.lr.ph, label %.loopexit

._crit_edge:                                      ; preds = %.loopexit, %20
  ret void

.lr.ph:                                           ; preds = %43, %64
  %indvars.iv = phi i64 [ %indvars.iv.next, %64 ], [ 1, %43 ]
  %.02429 = phi i32 [ %spec.select, %64 ], [ 0, %43 ]
  %47 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %48 = tail call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %indvars.iv) #2
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %.not = icmp eq ptr %50, null
  br i1 %.not, label %58, label %51

51:                                               ; preds = %.lr.ph
  %52 = getelementptr inbounds i8, ptr %50, i64 60
  %53 = load i8, ptr %52, align 4, !tbaa !25, !range !26, !noundef !27
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %58

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %50, i64 40
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  br label %58

58:                                               ; preds = %.lr.ph, %51, %55
  %.sink44 = phi ptr [ %57, %55 ], [ %48, %51 ], [ %48, %.lr.ph ]
  %59 = getelementptr inbounds i8, ptr %48, i64 40
  store ptr %.sink44, ptr %59, align 8, !tbaa !28
  %60 = getelementptr inbounds i8, ptr %48, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !29
  %62 = zext i32 %61 to i64
  %63 = icmp eq i64 %indvars.iv, %62
  br i1 %63, label %64, label %.loopexit36

.loopexit36:                                      ; preds = %38, %58
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 47, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6GHTree3cutEv) #3
  unreachable

64:                                               ; preds = %58
  %65 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %66 = add nsw i64 %indvars.iv, -1
  %67 = tail call noundef nonnull align 8 dereferenceable(61) ptr @_ZNSt6vectorI6GHNodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #2
  %68 = getelementptr inbounds i8, ptr %48, i64 40
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = getelementptr inbounds i8, ptr %67, i64 40
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  %.not28 = icmp ne ptr %69, %71
  %72 = zext i1 %.not28 to i32
  %spec.select = add nuw nsw i32 %.02429, %72
  store i32 %spec.select, ptr %60, align 4, !tbaa !29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %73 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next39) #2
  %74 = tail call noundef i64 @_ZNKSt6vectorI6GHNodeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #2
  %75 = icmp ugt i64 %74, %indvars.iv.next
  br i1 %75, label %.lr.ph, label %.loopexit, !llvm.loop !30
}

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 = { noreturn 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 #2 = { nounwind }
attributes #3 = { noreturn 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, !7, i64 0}
!6 = !{!"_ZTS6GHTree", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIS_I6GHNodeSaIS0_EESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseISt6vectorI6GHNodeSaIS1_EESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"_ZTS6GHNode", !7, i64 0, !7, i64 4, !14, i64 8, !17, i64 16, !14, i64 40, !7, i64 48, !7, i64 52, !21, i64 56, !22, i64 60}
!17 = !{!"_ZTSSt6vectorIP6GHNodeSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIP6GHNodeSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP6GHNodeSaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP6GHNodeSaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!21 = !{!"float", !8, i64 0}
!22 = !{!"bool", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!16, !22, i64 60}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!16, !14, i64 40}
!29 = !{!16, !7, i64 4}
!30 = distinct !{!30, !24, !31}
!31 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass