; LLVM IR from abeaumont/competitive-programming :: codeforces/1304/e.ll (Z4distxx)

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

@d = external dso_local global %"class.std::vector", align 8
@anc = external dso_local global %"class.std::vector.0", align 8

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

; 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 noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 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
define dso_local noundef i64 @_Z4distxx(i64 noundef %0, i64 noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %13) #2
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = load i64, ptr %4, align 8, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %16) #2
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = add nsw i64 %15, %18
  store i64 %19, ptr %5, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %46, %2
  %21 = load i64, ptr %3, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %21) #2
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %24) #2
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = icmp sgt i64 %23, %26
  br i1 %27, label %28, label %52

28:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %29) #2
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = load i64, ptr %4, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %32) #2
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = sub nsw i64 %31, %34
  store i64 %35, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  store i64 1, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %41, %28
  %37 = load i64, ptr %7, align 8, !tbaa !5
  %38 = mul nsw i64 %37, 2
  %39 = load i64, ptr %6, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %46

41:                                               ; preds = %36
  %42 = load i64, ptr %8, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = mul nsw i64 %44, 2
  store i64 %45, ptr %7, align 8, !tbaa !5
  br label %36, !llvm.loop !9

46:                                               ; preds = %36
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %47) #2
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %49) #2
  %51 = load i64, ptr %50, align 8, !tbaa !5
  store i64 %51, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  br label %20, !llvm.loop !11

52:                                               ; preds = %20
  br label %53

53:                                               ; preds = %79, %52
  %54 = load i64, ptr %4, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %54) #2
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = load i64, ptr %3, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %57) #2
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = icmp sgt i64 %56, %59
  br i1 %60, label %61, label %85

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  %62 = load i64, ptr %4, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %62) #2
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = load i64, ptr %3, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %65) #2
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = sub nsw i64 %64, %67
  store i64 %68, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  store i64 1, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %74, %61
  %70 = load i64, ptr %10, align 8, !tbaa !5
  %71 = mul nsw i64 %70, 2
  %72 = load i64, ptr %9, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %74, label %79

74:                                               ; preds = %69
  %75 = load i64, ptr %11, align 8, !tbaa !5
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %11, align 8, !tbaa !5
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = mul nsw i64 %77, 2
  store i64 %78, ptr %10, align 8, !tbaa !5
  br label %69, !llvm.loop !12

79:                                               ; preds = %69
  %80 = load i64, ptr %11, align 8, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %80) #2
  %82 = load i64, ptr %4, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %82) #2
  %84 = load i64, ptr %83, align 8, !tbaa !5
  store i64 %84, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  br label %53, !llvm.loop !13

85:                                               ; preds = %53
  br label %86

86:                                               ; preds = %108, %85
  %87 = load i64, ptr %3, align 8, !tbaa !5
  %88 = load i64, ptr %4, align 8, !tbaa !5
  %89 = icmp ne i64 %87, %88
  br i1 %89, label %90, label %119

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %105, %90
  %92 = load i64, ptr %12, align 8, !tbaa !5
  %93 = add nsw i64 %92, 1
  %94 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %93) #2
  %95 = load i64, ptr %3, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef %95) #2
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = load i64, ptr %12, align 8, !tbaa !5
  %99 = add nsw i64 %98, 1
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %99) #2
  %101 = load i64, ptr %4, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %101) #2
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = icmp ne i64 %97, %103
  br i1 %104, label %105, label %108

105:                                              ; preds = %91
  %106 = load i64, ptr %12, align 8, !tbaa !5
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %12, align 8, !tbaa !5
  br label %91, !llvm.loop !14

108:                                              ; preds = %91
  %109 = load i64, ptr %12, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %109) #2
  %111 = load i64, ptr %3, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %110, i64 noundef %111) #2
  %113 = load i64, ptr %112, align 8, !tbaa !5
  store i64 %113, ptr %3, align 8, !tbaa !5
  %114 = load i64, ptr %12, align 8, !tbaa !5
  %115 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %114) #2
  %116 = load i64, ptr %4, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %116) #2
  %118 = load i64, ptr %117, align 8, !tbaa !5
  store i64 %118, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  br label %86, !llvm.loop !15

119:                                              ; preds = %86
  %120 = load i64, ptr %5, align 8, !tbaa !5
  %121 = load i64, ptr %3, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %121) #2
  %123 = load i64, ptr %122, align 8, !tbaa !5
  %124 = mul nsw i64 2, %123
  %125 = sub nsw i64 %120, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret i64 %125
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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<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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@d = external dso_local global %"class.std::vector", align 8
@anc = external dso_local global %"class.std::vector.0", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z4distxx(i64 noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %0) #1
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %1) #1
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %0) #1
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %1) #1
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i64 %8, %10
  br i1 %11, label %.lr.ph, label %.preheader46

.preheader46:                                     ; preds = %26, %2
  %.037.lcssa = phi i64 [ %0, %2 ], [ %29, %26 ]
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %1) #1
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.037.lcssa) #1
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = icmp sgt i64 %13, %15
  br i1 %16, label %.lr.ph49, label %.preheader45

.lr.ph:                                           ; preds = %2, %26
  %.03747 = phi i64 [ %29, %26 ], [ %0, %2 ]
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.03747) #1
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %1) #1
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = sub nsw i64 %18, %20
  br label %22

22:                                               ; preds = %22, %.lr.ph
  %.039 = phi i64 [ 1, %.lr.ph ], [ %23, %22 ]
  %.038 = phi i64 [ 0, %.lr.ph ], [ %25, %22 ]
  %23 = shl nsw i64 %.039, 1
  %24 = icmp slt i64 %23, %21
  %25 = add nuw nsw i64 %.038, 1
  br i1 %24, label %22, label %26, !llvm.loop !9

26:                                               ; preds = %22
  %27 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %.038) #1
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %.03747) #1
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %29) #1
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %1) #1
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = icmp sgt i64 %31, %33
  br i1 %34, label %.lr.ph, label %.preheader46, !llvm.loop !11

.preheader45:                                     ; preds = %44, %.preheader46
  %.040.lcssa = phi i64 [ %1, %.preheader46 ], [ %47, %44 ]
  %.not51 = icmp eq i64 %.037.lcssa, %.040.lcssa
  br i1 %.not51, label %._crit_edge, label %.preheader

.lr.ph49:                                         ; preds = %.preheader46, %44
  %.04048 = phi i64 [ %47, %44 ], [ %1, %.preheader46 ]
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.04048) #1
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.037.lcssa) #1
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = sub nsw i64 %36, %38
  br label %40

40:                                               ; preds = %40, %.lr.ph49
  %.036 = phi i64 [ 1, %.lr.ph49 ], [ %41, %40 ]
  %.035 = phi i64 [ 0, %.lr.ph49 ], [ %43, %40 ]
  %41 = shl nsw i64 %.036, 1
  %42 = icmp slt i64 %41, %39
  %43 = add nuw nsw i64 %.035, 1
  br i1 %42, label %40, label %44, !llvm.loop !12

44:                                               ; preds = %40
  %45 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %.035) #1
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %.04048) #1
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %47) #1
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.037.lcssa) #1
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = icmp sgt i64 %49, %51
  br i1 %52, label %.lr.ph49, label %.preheader45, !llvm.loop !13

.preheader:                                       ; preds = %.preheader45, %61
  %.153 = phi i64 [ %64, %61 ], [ %.037.lcssa, %.preheader45 ]
  %.14152 = phi i64 [ %67, %61 ], [ %.040.lcssa, %.preheader45 ]
  br label %53

53:                                               ; preds = %.preheader, %53
  %.0 = phi i64 [ %54, %53 ], [ 0, %.preheader ]
  %54 = add nuw nsw i64 %.0, 1
  %55 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %54) #1
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %.153) #1
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %54) #1
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %.14152) #1
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %.not44 = icmp eq i64 %57, %60
  br i1 %.not44, label %61, label %53, !llvm.loop !14

61:                                               ; preds = %53
  %62 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %.0) #1
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %.153) #1
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @anc, i64 noundef %.0) #1
  %66 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %.14152) #1
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %.not = icmp eq i64 %64, %67
  br i1 %.not, label %._crit_edge, label %.preheader, !llvm.loop !15

._crit_edge:                                      ; preds = %61, %.preheader45
  %.1.lcssa = phi i64 [ %.037.lcssa, %.preheader45 ], [ %64, %61 ]
  %68 = add nsw i64 %6, %4
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %.1.lcssa) #1
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = shl i64 %70, 1
  %72 = sub i64 %68, %71
  ret i64 %72
}

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


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