; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Medium Hard/XRQRS/A.ll (Z6query1iii)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@roots1 = external dso_local global [500100 x ptr], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4ntovi(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6query1iii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  %21 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z4ntovi(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %7, i32 noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [500100 x ptr], ptr @roots1, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [500100 x ptr], ptr @roots1, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %29, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr %7, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %30 = load ptr, ptr %11, align 8, !tbaa !9
  %31 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %33 = load ptr, ptr %11, align 8, !tbaa !9
  %34 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #4
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  br label %36

36:                                               ; preds = %125, %3
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %128

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %14, align 4, !tbaa !5
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = shl i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  %44 = load i32, ptr %14, align 4, !tbaa !5
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %85

46:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %47 = load ptr, ptr %10, align 8, !tbaa !9
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  br label %54

50:                                               ; preds = %46
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = invoke noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20) %51)
          to label %53 unwind label %75

53:                                               ; preds = %50
  br label %54

54:                                               ; preds = %53, %49
  %55 = phi i32 [ 0, %49 ], [ %52, %53 ]
  %56 = load ptr, ptr %9, align 8, !tbaa !9
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  br label %63

59:                                               ; preds = %54
  %60 = load ptr, ptr %9, align 8, !tbaa !9
  %61 = invoke noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20) %60)
          to label %62 unwind label %75

62:                                               ; preds = %59
  br label %63

63:                                               ; preds = %62, %58
  %64 = phi i32 [ 0, %58 ], [ %61, %62 ]
  %65 = sub nsw i32 %55, %64
  store i32 %65, ptr %15, align 4, !tbaa !5
  %66 = load i32, ptr %15, align 4, !tbaa !5
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %79

68:                                               ; preds = %63
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = or i32 %69, 1
  store i32 %70, ptr %8, align 4, !tbaa !5
  %71 = load ptr, ptr %9, align 8, !tbaa !9
  %72 = call noundef ptr @_Z2goP4nodei(ptr noundef %71, i32 noundef 1)
  store ptr %72, ptr %9, align 8, !tbaa !9
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  %74 = call noundef ptr @_Z2goP4nodei(ptr noundef %73, i32 noundef 1)
  store ptr %74, ptr %10, align 8, !tbaa !9
  br label %84

75:                                               ; preds = %59, %50
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %16, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %127

79:                                               ; preds = %63
  %80 = load ptr, ptr %9, align 8, !tbaa !9
  %81 = call noundef ptr @_Z2goP4nodei(ptr noundef %80, i32 noundef 0)
  store ptr %81, ptr %9, align 8, !tbaa !9
  %82 = load ptr, ptr %10, align 8, !tbaa !9
  %83 = call noundef ptr @_Z2goP4nodei(ptr noundef %82, i32 noundef 0)
  store ptr %83, ptr %10, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %79, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %124

85:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %86 = load ptr, ptr %10, align 8, !tbaa !9
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  br label %93

89:                                               ; preds = %85
  %90 = load ptr, ptr %10, align 8, !tbaa !9
  %91 = invoke noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20) %90)
          to label %92 unwind label %112

92:                                               ; preds = %89
  br label %93

93:                                               ; preds = %92, %88
  %94 = phi i32 [ 0, %88 ], [ %91, %92 ]
  %95 = load ptr, ptr %9, align 8, !tbaa !9
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %98

97:                                               ; preds = %93
  br label %102

98:                                               ; preds = %93
  %99 = load ptr, ptr %9, align 8, !tbaa !9
  %100 = invoke noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20) %99)
          to label %101 unwind label %112

101:                                              ; preds = %98
  br label %102

102:                                              ; preds = %101, %97
  %103 = phi i32 [ 0, %97 ], [ %100, %101 ]
  %104 = sub nsw i32 %94, %103
  store i32 %104, ptr %18, align 4, !tbaa !5
  %105 = load i32, ptr %18, align 4, !tbaa !5
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %116

107:                                              ; preds = %102
  %108 = load ptr, ptr %9, align 8, !tbaa !9
  %109 = call noundef ptr @_Z2goP4nodei(ptr noundef %108, i32 noundef 0)
  store ptr %109, ptr %9, align 8, !tbaa !9
  %110 = load ptr, ptr %10, align 8, !tbaa !9
  %111 = call noundef ptr @_Z2goP4nodei(ptr noundef %110, i32 noundef 0)
  store ptr %111, ptr %10, align 8, !tbaa !9
  br label %123

112:                                              ; preds = %98, %89
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %16, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %127

116:                                              ; preds = %102
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = or i32 %117, 1
  store i32 %118, ptr %8, align 4, !tbaa !5
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  %120 = call noundef ptr @_Z2goP4nodei(ptr noundef %119, i32 noundef 1)
  store ptr %120, ptr %9, align 8, !tbaa !9
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  %122 = call noundef ptr @_Z2goP4nodei(ptr noundef %121, i32 noundef 1)
  store ptr %122, ptr %10, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %116, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %124

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

125:                                              ; preds = %124
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br label %36

127:                                              ; preds = %112, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  br label %130

128:                                              ; preds = %38
  %129 = load i32, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  ret i32 %129

130:                                              ; preds = %127
  %131 = load ptr, ptr %16, align 8
  %132 = load i32, ptr %17, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20)) #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@roots1 = external dso_local local_unnamed_addr global [500100 x ptr], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4ntovi(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6query1iii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = add nsw i32 %0, -1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_Z4ntovi(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %4, i32 noundef %2)
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [500100 x ptr], ptr @roots1, i64 0, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = sext i32 %1 to i64
  %12 = getelementptr inbounds [500100 x ptr], ptr @roots1, i64 0, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %14 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  store ptr %14, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %15 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  store ptr %15, ptr %6, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %43, %3
  %.0.lcssa = phi i32 [ 0, %3 ], [ %.3, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  ret i32 %.0.lcssa

.lr.ph:                                           ; preds = %3, %43
  %.038 = phi i32 [ %.3, %43 ], [ 0, %3 ]
  %.02837 = phi ptr [ %44, %43 ], [ %10, %3 ]
  %.03236 = phi ptr [ %45, %43 ], [ %13, %3 ]
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = shl i32 %.038, 1
  %.not = icmp eq i32 %18, 0
  %20 = icmp eq ptr %.03236, null
  br i1 %.not, label %32, label %21

21:                                               ; preds = %.lr.ph
  br i1 %20, label %24, label %22

22:                                               ; preds = %21
  %23 = call noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20) %.03236)
  br label %24

24:                                               ; preds = %21, %22
  %25 = phi i32 [ %23, %22 ], [ 0, %21 ]
  %26 = icmp eq ptr %.02837, null
  br i1 %26, label %29, label %27

27:                                               ; preds = %24
  %28 = call noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20) %.02837)
  br label %29

29:                                               ; preds = %24, %27
  %30 = phi i32 [ %28, %27 ], [ 0, %24 ]
  %31 = icmp eq i32 %25, %30
  br label %43

32:                                               ; preds = %.lr.ph
  br i1 %20, label %35, label %33

33:                                               ; preds = %32
  %34 = call noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20) %.03236)
  br label %35

35:                                               ; preds = %32, %33
  %36 = phi i32 [ %34, %33 ], [ 0, %32 ]
  %37 = icmp eq ptr %.02837, null
  br i1 %37, label %40, label %38

38:                                               ; preds = %35
  %39 = call noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20) %.02837)
  br label %40

40:                                               ; preds = %35, %38
  %41 = phi i32 [ %39, %38 ], [ 0, %35 ]
  %42 = icmp ne i32 %36, %41
  br label %43

43:                                               ; preds = %40, %29
  %.sink39.in = phi i1 [ %31, %29 ], [ %42, %40 ]
  %.pn = zext i1 %.sink39.in to i32
  %.3 = or disjoint i32 %19, %.pn
  %.sink39 = zext i1 %.sink39.in to i32
  %44 = call noundef ptr @_Z2goP4nodei(ptr noundef %.02837, i32 noundef %.sink39)
  %45 = call noundef ptr @_Z2goP4nodei(ptr noundef %.03236, i32 noundef %.sink39)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %47 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %47, label %.lr.ph, label %._crit_edge
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4node4lcntEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4node4rcntEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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}


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