; LLVM IR from VAR-solutions/Algorithms :: Other Algorithms/HeavyLightDecompotion.ll (Z3hldi)

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

@v = external dso_local global [200002 x %"class.std::vector"], align 16
@ans = external dso_local global [200002 x %"class.std::vector"], align 16
@an = external dso_local global [200002 x %"class.std::vector"], align 16
@pos = external dso_local global [200002 x [2 x i32]], align 16
@par = external dso_local global [200002 x i32], align 16
@sub = external dso_local global [200002 x i32], align 16
@chain = external dso_local global [200002 x %"class.std::vector"], align 16
@cn = 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3hldi(i32 noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr @cn, align 4, !tbaa !5
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [200002 x [2 x i32]], ptr @pos, i64 0, i64 %12
  %14 = getelementptr inbounds [2 x i32], ptr %13, i64 0, i64 0
  store i32 %10, ptr %14, align 8, !tbaa !5
  %15 = load i32, ptr @cn, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @chain, i64 0, i64 %16
  %18 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = trunc i64 %18 to i32
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200002 x [2 x i32]], ptr @pos, i64 0, i64 %21
  %23 = getelementptr inbounds [2 x i32], ptr %22, i64 0, i64 1
  store i32 %19, ptr %23, align 4, !tbaa !5
  %24 = load i32, ptr @cn, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @chain, i64 0, i64 %25
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %27 = load i32, ptr @cn, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @ans, i64 0, i64 %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %30 = load i32, ptr @cn, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @an, i64 0, i64 %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %68, %1
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %37
  %39 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #4
  %40 = icmp ult i64 %35, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %71

42:                                               ; preds = %33
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %44
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #4
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200002 x i32], ptr @par, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp ne i32 %49, %53
  br i1 %54, label %55, label %67

55:                                               ; preds = %42
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %60) #4
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %63
  %65 = 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) %64)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %5, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %55, %42
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %33, !llvm.loop !9

71:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %112, %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %76
  %78 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #4
  %79 = icmp ult i64 %74, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %72
  store i32 5, ptr %8, align 4
  br label %115

81:                                               ; preds = %72
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86) #4
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = icmp eq i32 %91, %92
  br i1 %93, label %94, label %111

94:                                               ; preds = %81
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %99) #4
  %101 = load i32, ptr %100, align 4, !tbaa !5
  call void @_Z3hldi(i32 noundef %101)
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #4
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %109
  store i32 -1, ptr %110, align 4, !tbaa !5
  store i32 5, ptr %8, align 4
  br label %115

111:                                              ; preds = %81
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !11

115:                                              ; preds = %94, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %162, %116
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %121
  %123 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %122) #4
  %124 = icmp ult i64 %119, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %117
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %165

126:                                              ; preds = %117
  %127 = load i32, ptr %2, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %128
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %129, i64 noundef %131) #4
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [200002 x i32], ptr @par, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp ne i32 %133, %137
  br i1 %138, label %139, label %161

139:                                              ; preds = %126
  %140 = load i32, ptr %2, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %141
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %142, i64 noundef %144) #4
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = icmp ne i32 %149, -1
  br i1 %150, label %151, label %161

151:                                              ; preds = %139
  %152 = load i32, ptr @cn, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr @cn, align 4, !tbaa !5
  %154 = load i32, ptr %2, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %155
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %156, i64 noundef %158) #4
  %160 = load i32, ptr %159, align 4, !tbaa !5
  call void @_Z3hldi(i32 noundef %160)
  br label %161

161:                                              ; preds = %151, %139, %126
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %9, align 4, !tbaa !5
  br label %117, !llvm.loop !12

165:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; 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)) #3

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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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

@v = external dso_local global [200002 x %"class.std::vector"], align 16
@ans = external dso_local global [200002 x %"class.std::vector"], align 16
@an = external dso_local global [200002 x %"class.std::vector"], align 16
@pos = external dso_local local_unnamed_addr global [200002 x [2 x i32]], align 16
@par = external dso_local local_unnamed_addr global [200002 x i32], align 16
@sub = external dso_local global [200002 x i32], align 16
@chain = external dso_local global [200002 x %"class.std::vector"], align 16
@cn = 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3hldi(i32 noundef %0) local_unnamed_addr #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %6 = load i32, ptr @cn, align 4, !tbaa !5
  %7 = sext i32 %0 to i64
  %8 = getelementptr inbounds [200002 x [2 x i32]], ptr @pos, i64 0, i64 %7
  store i32 %6, ptr %8, align 8, !tbaa !5
  %9 = sext i32 %6 to i64
  %10 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @chain, i64 0, i64 %9
  %11 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %12 = trunc i64 %11 to i32
  %13 = getelementptr inbounds [200002 x [2 x i32]], ptr @pos, i64 0, i64 %7, i64 1
  store i32 %12, ptr %13, align 4, !tbaa !5
  %14 = load i32, ptr @cn, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @chain, i64 0, i64 %15
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr @cn, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @ans, i64 0, i64 %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %20 = load i32, ptr @cn, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @an, i64 0, i64 %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %24
  %26 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #4
  %.not27 = icmp eq i64 %26, 0
  br i1 %.not27, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %48, %1
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %28
  %30 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #4
  %.not28 = icmp eq i64 %30, 0
  br i1 %.not28, label %.loopexit, label %.lr.ph24

.lr.ph:                                           ; preds = %1, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ 0, %1 ]
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %32
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %indvars.iv) #4
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200002 x i32], ptr @par, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %.not20 = icmp eq i32 %35, %39
  br i1 %.not20, label %48, label %40

40:                                               ; preds = %.lr.ph
  %41 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %37
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %indvars.iv) #4
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %44
  %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) %45)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  store i32 %47, ptr %5, align 4, !tbaa !5
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre40 = sext i32 %.pre to i64
  br label %48

48:                                               ; preds = %.lr.ph, %40
  %.pre-phi = phi i64 [ %37, %.lr.ph ], [ %.pre40, %40 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %.pre-phi
  %50 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #4
  %51 = icmp ugt i64 %50, %indvars.iv.next
  br i1 %51, label %.lr.ph, label %.preheader, !llvm.loop !9

52:                                               ; preds = %.lr.ph24
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %54
  %56 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #4
  %57 = icmp ugt i64 %56, %indvars.iv.next33
  br i1 %57, label %.lr.ph24, label %.loopexit, !llvm.loop !11

.lr.ph24:                                         ; preds = %.preheader, %52
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %52 ], [ 0, %.preheader ]
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %59
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %indvars.iv32) #4
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %68, label %52

68:                                               ; preds = %.lr.ph24
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %70
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %indvars.iv32) #4
  %73 = load i32, ptr %72, align 4, !tbaa !5
  call void @_Z3hldi(i32 noundef %73)
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %75
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %indvars.iv32) #4
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %79
  store i32 -1, ptr %80, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %52, %.preheader, %68
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %82
  %84 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #4
  %.not29 = icmp eq i64 %84, 0
  br i1 %.not29, label %._crit_edge, label %.lr.ph26

._crit_edge:                                      ; preds = %108, %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  ret void

.lr.ph26:                                         ; preds = %.loopexit, %108
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %108 ], [ 0, %.loopexit ]
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %86
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %indvars.iv35) #4
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200002 x i32], ptr @par, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %.not = icmp eq i32 %89, %93
  br i1 %.not, label %108, label %94

94:                                               ; preds = %.lr.ph26
  %95 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %91
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %indvars.iv35) #4
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200002 x i32], ptr @sub, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %.not19 = icmp eq i32 %100, -1
  %.pre39 = load i32, ptr %2, align 4, !tbaa !5
  br i1 %.not19, label %108, label %101

101:                                              ; preds = %94
  %102 = load i32, ptr @cn, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @cn, align 4, !tbaa !5
  %104 = sext i32 %.pre39 to i64
  %105 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %104
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %indvars.iv35) #4
  %107 = load i32, ptr %106, align 4, !tbaa !5
  call void @_Z3hldi(i32 noundef %107)
  %.pre38 = load i32, ptr %2, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %.lr.ph26, %94, %101
  %109 = phi i32 [ %90, %.lr.ph26 ], [ %.pre39, %94 ], [ %.pre38, %101 ]
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200002 x %"class.std::vector"], ptr @v, i64 0, i64 %110
  %112 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %111) #4
  %113 = icmp ugt i64 %112, %indvars.iv.next36
  br i1 %113, label %.lr.ph26, label %._crit_edge, !llvm.loop !12
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; 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 #3

attributes #0 = { mustprogress 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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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