; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint April/Problem H/H.ll (Z4costi)

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

@l = external dso_local global [262144 x i32], align 16
@lft = external dso_local global [262144 x i32], align 16
@rgt = external dso_local global [262144 x i32], align 16
@c = external dso_local global [262144 x i64], align 16
@f = external dso_local global [262144 x i64], align 16
@buffer = external dso_local global %"class.std::vector.2", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z4costi(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [262144 x i64], ptr @c, i64 0, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %15, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [262144 x i32], ptr @lft, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %20 = call ptr @_ZNSt6vectorISt4pairIS0_IxxES1_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @buffer) #3
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %5, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  br label %22

22:                                               ; preds = %97, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %23 = call ptr @_ZNSt6vectorISt4pairIS0_IxxES1_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @buffer) #3
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %6, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  %25 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %99

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %28 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %29 = getelementptr inbounds %"struct.std::pair.8", ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %"struct.std::pair", ptr %29, i32 0, i32 0
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %7, align 4, !tbaa !5
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [262144 x i32], ptr @lft, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %39, label %96

39:                                               ; preds = %27
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [262144 x i32], ptr @rgt, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp sle i32 %40, %44
  br i1 %45, label %46, label %96

46:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sub nsw i32 %50, %54
  %56 = sext i32 %55 to i64
  store i64 %56, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %57 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %58 = getelementptr inbounds %"struct.std::pair.8", ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds %"struct.std::pair", ptr %58, i32 0, i32 0
  %60 = load i64, ptr %59, align 8, !tbaa !14
  %61 = load i64, ptr %8, align 8, !tbaa !9
  %62 = add nsw i64 %61, 2
  %63 = getelementptr inbounds [262144 x i64], ptr @f, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = mul nsw i64 %60, %64
  %66 = srem i64 %65, 1000000007
  store i64 %66, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %67 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %68 = getelementptr inbounds %"struct.std::pair.8", ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !15
  %71 = load i64, ptr %8, align 8, !tbaa !9
  %72 = add nsw i64 %71, 1
  %73 = getelementptr inbounds [262144 x i64], ptr @f, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = mul nsw i64 %70, %74
  %76 = srem i64 %75, 1000000007
  store i64 %76, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = load i64, ptr %10, align 8, !tbaa !9
  %79 = add nsw i64 %77, %78
  %80 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %81 = getelementptr inbounds %"struct.std::pair.8", ptr %80, i32 0, i32 1
  %82 = getelementptr inbounds %"struct.std::pair", ptr %81, i32 0, i32 0
  %83 = load i64, ptr %82, align 8, !tbaa !14
  %84 = sub nsw i64 %79, %83
  %85 = add nsw i64 %84, 1000000007
  %86 = srem i64 %85, 1000000007
  store i64 %86, ptr %11, align 8, !tbaa !9
  %87 = load i64, ptr %11, align 8, !tbaa !9
  %88 = load i64, ptr %3, align 8, !tbaa !9
  %89 = add nsw i64 %88, %87
  store i64 %89, ptr %3, align 8, !tbaa !9
  %90 = load i64, ptr %3, align 8, !tbaa !9
  %91 = icmp sge i64 %90, 1000000007
  br i1 %91, label %92, label %95

92:                                               ; preds = %46
  %93 = load i64, ptr %3, align 8, !tbaa !9
  %94 = sub nsw i64 %93, 1000000007
  store i64 %94, ptr %3, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %92, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %96

96:                                               ; preds = %95, %39, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %97

97:                                               ; preds = %96
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br label %22, !llvm.loop !16

99:                                               ; preds = %26
  %100 = load i64, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i64 %100
}

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

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

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

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

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

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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSSt4pairIS_IxxES0_E", !13, i64 0, !13, i64 16}
!13 = !{!"_ZTSSt4pairIxxE", !10, i64 0, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !10, i64 24}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

@l = external dso_local local_unnamed_addr global [262144 x i32], align 16
@lft = external dso_local local_unnamed_addr global [262144 x i32], align 16
@rgt = external dso_local local_unnamed_addr global [262144 x i32], align 16
@c = external dso_local local_unnamed_addr global [262144 x i64], align 16
@f = external dso_local local_unnamed_addr global [262144 x i64], align 16
@buffer = external dso_local global %"class.std::vector.2", align 8

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z4costi(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %4 = sext i32 %0 to i64
  %5 = getelementptr inbounds [262144 x i64], ptr @c, i64 0, i64 %4
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds [262144 x i32], ptr @lft, i64 0, i64 %4
  %8 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %9 = tail call ptr @_ZNSt6vectorISt4pairIS0_IxxES1_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @buffer) #3
  store ptr %9, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %10 = tail call ptr @_ZNSt6vectorISt4pairIS0_IxxES1_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @buffer) #3
  store ptr %10, ptr %3, align 8
  %11 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %4
  br label %13

._crit_edge:                                      ; preds = %54, %1
  %.0.lcssa = phi i64 [ %6, %1 ], [ %.2, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i64 %.0.lcssa

13:                                               ; preds = %.lr.ph, %54
  %.021 = phi i64 [ %6, %.lr.ph ], [ %.2, %54 ]
  %14 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %sext = shl i64 %15, 32
  %16 = ashr exact i64 %sext, 32
  %17 = getelementptr inbounds [262144 x i32], ptr @lft, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %.not = icmp sgt i32 %18, %8
  br i1 %.not, label %54, label %19

19:                                               ; preds = %13
  %20 = getelementptr inbounds [262144 x i32], ptr @rgt, i64 0, i64 %16
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %.not20 = icmp sgt i32 %8, %21
  br i1 %.not20, label %54, label %22

22:                                               ; preds = %19
  %23 = load i32, ptr %12, align 4, !tbaa !9
  %24 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %16
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = sub nsw i32 %23, %25
  %27 = sext i32 %26 to i64
  %28 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = load i64, ptr %29, align 8, !tbaa !14
  %31 = add nsw i64 %27, 2
  %32 = getelementptr inbounds [262144 x i64], ptr @f, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = mul nsw i64 %33, %30
  %35 = srem i64 %34, 1000000007
  %36 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load i64, ptr %37, align 8, !tbaa !15
  %39 = add nsw i64 %27, 1
  %40 = getelementptr inbounds [262144 x i64], ptr @f, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = mul nsw i64 %41, %38
  %43 = srem i64 %42, 1000000007
  %44 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load i64, ptr %45, align 8, !tbaa !14
  %47 = add nsw i64 %35, 1000000007
  %48 = add nsw i64 %47, %43
  %49 = sub i64 %48, %46
  %50 = srem i64 %49, 1000000007
  %51 = add nsw i64 %50, %.021
  %52 = icmp sgt i64 %51, 1000000006
  %53 = add nsw i64 %51, -1000000007
  %spec.select = select i1 %52, i64 %53, i64 %51
  br label %54

54:                                               ; preds = %22, %19, %13
  %.2 = phi i64 [ %spec.select, %22 ], [ %.021, %19 ], [ %.021, %13 ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %56 = call ptr @_ZNSt6vectorISt4pairIS0_IxxES1_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @buffer) #3
  store ptr %56, ptr %3, align 8
  %57 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IxxES2_ESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %57, label %13, label %._crit_edge, !llvm.loop !16
}

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

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

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

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

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 = { 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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIS_IxxES0_E", !13, i64 0, !13, i64 16}
!13 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!14 = !{!12, !6, i64 16}
!15 = !{!12, !6, i64 24}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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