; LLVM IR from eyangch/competitive-programming :: Codeforces/1436/d.ll (Z3dfsx)

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

@a = external dso_local global [200000 x i64], align 16
@graph = external dso_local global [200000 x %"class.std::vector"], align 16
@leaves = external dso_local global [200000 x i64], align 16
@mx = external dso_local global [200000 x i64], align 16
@def = external dso_local global [200000 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsx(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @graph, i64 0, i64 %9
  store ptr %10, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %11 = load ptr, ptr %3, align 8, !tbaa !9
  %12 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %13 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %12, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %14 = load ptr, ptr %3, align 8, !tbaa !9
  %15 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %16 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %15, ptr %16, align 8
  br label %17

17:                                               ; preds = %101, %1
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  br i1 %18, label %20, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %103

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %22 = load i64, ptr %21, align 8, !tbaa !5
  store i64 %22, ptr %6, align 8, !tbaa !5
  %23 = load i64, ptr %6, align 8, !tbaa !5
  call void @_Z3dfsx(i64 noundef %23)
  %24 = load i64, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = load i64, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = icmp eq i64 %26, %29
  br i1 %30, label %31, label %39

31:                                               ; preds = %20
  %32 = load i64, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, %34
  store i64 %38, ptr %36, align 8, !tbaa !5
  br label %93

39:                                               ; preds = %20
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = load i64, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = icmp sgt i64 %42, %45
  br i1 %46, label %47, label %67

47:                                               ; preds = %39
  %48 = load i64, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = sub nsw i64 %53, %56
  %58 = load i64, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = mul nsw i64 %57, %60
  %62 = add nsw i64 %50, %61
  %63 = load i64, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = add nsw i64 %65, %62
  store i64 %66, ptr %64, align 8, !tbaa !5
  br label %92

67:                                               ; preds = %39
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = sub nsw i64 %73, %76
  %78 = load i64, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = mul nsw i64 %77, %80
  %82 = add nsw i64 %70, %81
  %83 = load i64, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = add nsw i64 %85, %82
  store i64 %86, ptr %84, align 8, !tbaa !5
  %87 = load i64, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = load i64, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %90
  store i64 %89, ptr %91, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %67, %47
  br label %93

93:                                               ; preds = %92, %31
  %94 = load i64, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = load i64, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = add nsw i64 %99, %96
  store i64 %100, ptr %98, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %101

101:                                              ; preds = %93
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %17

103:                                              ; preds = %19
  %104 = load i64, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @graph, i64 0, i64 %104
  %106 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #4
  %107 = icmp eq i64 %106, 0
  br i1 %107, label %108, label %118

108:                                              ; preds = %103
  %109 = load i64, ptr %2, align 8, !tbaa !5
  %110 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %109
  store i64 1, ptr %110, align 8, !tbaa !5
  %111 = load i64, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !5
  %114 = load i64, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %114
  store i64 %113, ptr %115, align 8, !tbaa !5
  %116 = load i64, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %116
  store i64 0, ptr %117, align 8, !tbaa !5
  br label %179

118:                                              ; preds = %103
  %119 = load i64, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !5
  %122 = load i64, ptr %2, align 8, !tbaa !5
  %123 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !5
  %125 = icmp sge i64 %121, %124
  br i1 %125, label %126, label %134

126:                                              ; preds = %118
  %127 = load i64, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !5
  %130 = load i64, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = sub nsw i64 %132, %129
  store i64 %133, ptr %131, align 8, !tbaa !5
  br label %178

134:                                              ; preds = %118
  %135 = load i64, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = load i64, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !5
  %141 = sub nsw i64 %140, %137
  store i64 %141, ptr %139, align 8, !tbaa !5
  %142 = load i64, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %142
  store i64 0, ptr %143, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %144 = load i64, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !5
  %147 = load i64, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = sdiv i64 %146, %149
  store i64 %150, ptr %7, align 8, !tbaa !5
  %151 = load i64, ptr %7, align 8, !tbaa !5
  %152 = load i64, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !5
  %155 = add nsw i64 %154, %151
  store i64 %155, ptr %153, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %156 = load i64, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !5
  %159 = load i64, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !5
  %162 = srem i64 %158, %161
  store i64 %162, ptr %8, align 8, !tbaa !5
  %163 = load i64, ptr %8, align 8, !tbaa !5
  %164 = icmp sgt i64 %163, 0
  br i1 %164, label %165, label %177

165:                                              ; preds = %134
  %166 = load i64, ptr %2, align 8, !tbaa !5
  %167 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !5
  %169 = add nsw i64 %168, 1
  store i64 %169, ptr %167, align 8, !tbaa !5
  %170 = load i64, ptr %2, align 8, !tbaa !5
  %171 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !5
  %173 = load i64, ptr %8, align 8, !tbaa !5
  %174 = sub nsw i64 %172, %173
  %175 = load i64, ptr %2, align 8, !tbaa !5
  %176 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %175
  store i64 %174, ptr %176, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %165, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %178

178:                                              ; preds = %177, %126
  br label %179

179:                                              ; preds = %178, %108
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_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 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 = !{!"long long", !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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@a = external dso_local local_unnamed_addr global [200000 x i64], align 16
@graph = external dso_local global [200000 x %"class.std::vector"], align 16
@leaves = external dso_local local_unnamed_addr global [200000 x i64], align 16
@mx = external dso_local local_unnamed_addr global [200000 x i64], align 16
@def = external dso_local local_unnamed_addr global [200000 x i64], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsx(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @graph, i64 0, i64 %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %5 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  store ptr %5, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %6 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  store ptr %6, ptr %3, align 8
  %7 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %8 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %0
  %9 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %0
  %10 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %0
  br label %14

._crit_edge:                                      ; preds = %45, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  %11 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %12 = icmp eq i64 %11, 0
  %13 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %0
  br i1 %12, label %52, label %57

14:                                               ; preds = %.lr.ph, %45
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %16 = load i64, ptr %15, align 8, !tbaa !5
  call void @_Z3dfsx(i64 noundef %16)
  %17 = load i64, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %16
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = icmp eq i64 %17, %19
  br i1 %20, label %21, label %26

21:                                               ; preds = %14
  %22 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %16
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = load i64, ptr %10, align 8, !tbaa !5
  %25 = add nsw i64 %24, %23
  store i64 %25, ptr %10, align 8, !tbaa !5
  br label %45

26:                                               ; preds = %14
  %27 = icmp sgt i64 %17, %19
  %28 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %16
  %29 = load i64, ptr %28, align 8, !tbaa !5
  br i1 %27, label %30, label %38

30:                                               ; preds = %26
  %31 = sub nsw i64 %17, %19
  %32 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %16
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = mul nsw i64 %33, %31
  %35 = add nsw i64 %34, %29
  %36 = load i64, ptr %10, align 8, !tbaa !5
  %37 = add nsw i64 %35, %36
  store i64 %37, ptr %10, align 8, !tbaa !5
  br label %45

38:                                               ; preds = %26
  %39 = sub nsw i64 %19, %17
  %40 = load i64, ptr %9, align 8, !tbaa !5
  %41 = mul nsw i64 %40, %39
  %42 = add nsw i64 %41, %29
  %43 = load i64, ptr %10, align 8, !tbaa !5
  %44 = add nsw i64 %42, %43
  store i64 %44, ptr %10, align 8, !tbaa !5
  store i64 %19, ptr %8, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %30, %38, %21
  %46 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %16
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = load i64, ptr %9, align 8, !tbaa !5
  %49 = add nsw i64 %48, %47
  store i64 %49, ptr %9, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %51 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  br i1 %51, label %14, label %._crit_edge

52:                                               ; preds = %._crit_edge
  %53 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %0
  store i64 1, ptr %53, align 8, !tbaa !5
  %54 = load i64, ptr %13, align 8, !tbaa !5
  %55 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %0
  store i64 %54, ptr %55, align 8, !tbaa !5
  %56 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %0
  store i64 0, ptr %56, align 8, !tbaa !5
  br label %76

57:                                               ; preds = %._crit_edge
  %58 = getelementptr inbounds [200000 x i64], ptr @def, i64 0, i64 %0
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = load i64, ptr %13, align 8, !tbaa !5
  %.not = icmp slt i64 %59, %60
  br i1 %.not, label %63, label %61

61:                                               ; preds = %57
  %62 = sub nsw i64 %59, %60
  store i64 %62, ptr %58, align 8, !tbaa !5
  br label %76

63:                                               ; preds = %57
  %64 = sub nsw i64 %60, %59
  store i64 %64, ptr %13, align 8, !tbaa !5
  store i64 0, ptr %58, align 8, !tbaa !5
  %65 = getelementptr inbounds [200000 x i64], ptr @leaves, i64 0, i64 %0
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = sdiv i64 %64, %66
  %68 = getelementptr inbounds [200000 x i64], ptr @mx, i64 0, i64 %0
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = add nsw i64 %69, %67
  store i64 %70, ptr %68, align 8, !tbaa !5
  %71 = srem i64 %64, %66
  %72 = icmp sgt i64 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %63
  %74 = add nsw i64 %70, 1
  store i64 %74, ptr %68, align 8, !tbaa !5
  %75 = sub nsw i64 %66, %71
  store i64 %75, ptr %58, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %63, %73, %61, %52
  ret void
}

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

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

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

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

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

; 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass