; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Random/Liars/A.ll (Z12shortestPathPSt6vectorISt4pairIiiESaIS1_EEPib)

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

@n = external dso_local global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z12shortestPathPSt6vectorISt4pairIiiESaIS1_EEPib(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 2, ptr %7, align 4, !tbaa !11
  br label %16

16:                                               ; preds = %31, %3
  %17 = load i32, ptr %7, align 4, !tbaa !11
  %18 = load i32, ptr @n, align 4, !tbaa !11
  %19 = add nsw i32 %18, 1
  %20 = icmp sle i32 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %34

22:                                               ; preds = %16
  %23 = load i8, ptr %6, align 1, !tbaa !9, !range !13, !noundef !14
  %24 = trunc i8 %23 to i1
  %25 = zext i1 %24 to i64
  %26 = select i1 %24, i32 1000000000, i32 -1
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load i32, ptr %7, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %27, i64 %29
  store i32 %26, ptr %30, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %22
  %32 = load i32, ptr %7, align 4, !tbaa !11
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %7, align 4, !tbaa !11
  br label %16, !llvm.loop !15

34:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  store i8 1, ptr %8, align 1, !tbaa !9
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds i32, ptr %35, i64 1
  store i32 0, ptr %36, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %142, %34
  %38 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %143

40:                                               ; preds = %37
  store i8 0, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %139, %40
  %42 = load i32, ptr %9, align 4, !tbaa !11
  %43 = load i32, ptr @n, align 4, !tbaa !11
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %142

46:                                               ; preds = %41
  %47 = load i8, ptr %6, align 1, !tbaa !9, !range !13, !noundef !14
  %48 = trunc i8 %47 to i1
  br i1 %48, label %49, label %56

49:                                               ; preds = %46
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i32, ptr %9, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %50, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = icmp eq i32 %54, 1000000000
  br i1 %55, label %66, label %56

56:                                               ; preds = %49, %46
  %57 = load i8, ptr %6, align 1, !tbaa !9, !range !13, !noundef !14
  %58 = trunc i8 %57 to i1
  br i1 %58, label %67, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr %60, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = icmp slt i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %59, %49
  br label %139

67:                                               ; preds = %59, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = load i32, ptr %9, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %"class.std::vector", ptr %68, i64 %70
  %72 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #3
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  br label %74

74:                                               ; preds = %136, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"class.std::vector", ptr %75, i64 %77
  %79 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #3
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  %81 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br i1 %81, label %83, label %82

82:                                               ; preds = %74
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %138

83:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %84 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !17
  store i32 %86, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %87 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  %88 = getelementptr inbounds %"struct.std::pair", ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !19
  store i32 %89, ptr %14, align 4, !tbaa !11
  %90 = load i8, ptr %6, align 1, !tbaa !9, !range !13, !noundef !14
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %106

92:                                               ; preds = %83
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %13, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = load i32, ptr %14, align 4, !tbaa !11
  %104 = add nsw i32 %102, %103
  %105 = icmp sgt i32 %97, %104
  br i1 %105, label %123, label %106

106:                                              ; preds = %92, %83
  %107 = load i8, ptr %6, align 1, !tbaa !9, !range !13, !noundef !14
  %108 = trunc i8 %107 to i1
  br i1 %108, label %135, label %109

109:                                              ; preds = %106
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %110, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !11
  %120 = load i32, ptr %14, align 4, !tbaa !11
  %121 = add nsw i32 %119, %120
  %122 = icmp slt i32 %114, %121
  br i1 %122, label %123, label %135

123:                                              ; preds = %109, %92
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %9, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !11
  %129 = load i32, ptr %14, align 4, !tbaa !11
  %130 = add nsw i32 %128, %129
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load i32, ptr %13, align 4, !tbaa !11
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %131, i64 %133
  store i32 %130, ptr %134, align 4, !tbaa !11
  store i8 1, ptr %8, align 1, !tbaa !9
  br label %135

135:                                              ; preds = %123, %109, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %136

136:                                              ; preds = %135
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  br label %74, !llvm.loop !20

138:                                              ; preds = %82
  br label %139

139:                                              ; preds = %138, %66
  %140 = load i32, ptr %9, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %9, align 4, !tbaa !11
  br label %41, !llvm.loop !21

142:                                              ; preds = %45
  br label %37, !llvm.loop !22

143:                                              ; preds = %37
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load i32, ptr @n, align 4, !tbaa !11
  %146 = add nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %144, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !11
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  ret i32 %149
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !12, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!19 = !{!18, !12, i64 4}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}


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

@n = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z12shortestPathPSt6vectorISt4pairIiiESaIS1_EEPib(ptr noundef %0, ptr nocapture noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not43 = icmp slt i32 %6, 1
  br i1 %.not43, label %.critedge42, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %7 = select i1 %2, i32 1000000000, i32 -1
  br label %38

.critedge42:                                      ; preds = %38, %3
  %8 = phi i32 [ %6, %3 ], [ %40, %38 ]
  %9 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 0, ptr %9, align 4, !tbaa !5
  br i1 %2, label %.critedge42.split.us.outer, label %.critedge42.split.outer

.critedge42.split.us.outer:                       ; preds = %.critedge42, %20
  %.pre5152.ph = phi i32 [ %.pre51.pre, %20 ], [ %8, %.critedge42 ]
  %.037.us.ph = phi i32 [ %21, %20 ], [ 1, %.critedge42 ]
  %.1.us.ph = phi i1 [ %.4.us, %20 ], [ false, %.critedge42 ]
  %.not38.us.peel = icmp sgt i32 %.037.us.ph, %.pre5152.ph
  br i1 %.not38.us.peel, label %10, label %.loopexit, !llvm.loop !9

10:                                               ; preds = %.critedge42.split.us.outer
  %.1.us.ph.not = xor i1 %.1.us.ph, true
  %.not38.us = icmp slt i32 %.pre5152.ph, 1
  %or.cond77 = or i1 %.1.us.ph.not, %.not38.us
  br i1 %or.cond77, label %.split.us, label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %10, %.critedge42.split.us.outer
  %.037.us.lcssa = phi i32 [ %.037.us.ph, %.critedge42.split.us.outer ], [ 1, %10 ]
  %.1.us.lcssa = phi i1 [ %.1.us.ph, %.critedge42.split.us.outer ], [ false, %10 ]
  %11 = zext nneg i32 %.037.us.lcssa to i64
  %12 = getelementptr inbounds i32, ptr %1, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp eq i32 %13, 1000000000
  br i1 %14, label %20, label %15

15:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %16 = getelementptr inbounds %"class.std::vector", ptr %0, i64 %11
  %17 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #3
  store ptr %17, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %18 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #3
  store ptr %18, ptr %5, align 8
  %19 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %19, label %.lr.ph46.us, label %._crit_edge.split.us.us

._crit_edge.split.us.us:                          ; preds = %34, %15
  %.2.lcssa.us = phi i1 [ %.1.us.lcssa, %15 ], [ %.3.us.us, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %.pre51.pre.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %._crit_edge.split.us.us, %.loopexit
  %.pre51.pre = phi i32 [ %.pre5152.ph, %.loopexit ], [ %.pre51.pre.pre, %._crit_edge.split.us.us ]
  %.4.us = phi i1 [ %.1.us.lcssa, %.loopexit ], [ %.2.lcssa.us, %._crit_edge.split.us.us ]
  %21 = add nuw nsw i32 %.037.us.lcssa, 1
  br label %.critedge42.split.us.outer, !llvm.loop !11

.lr.ph46.us:                                      ; preds = %15, %34
  %.245.us.us = phi i1 [ %.3.us.us, %34 ], [ %.1.us.lcssa, %15 ]
  %22 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %24 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !14
  %27 = sext i32 %23 to i64
  %28 = getelementptr inbounds i32, ptr %1, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %12, align 4, !tbaa !5
  %31 = add nsw i32 %30, %26
  %32 = icmp sgt i32 %29, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %.lr.ph46.us
  store i32 %31, ptr %28, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %33, %.lr.ph46.us
  %.3.us.us = phi i1 [ true, %33 ], [ %.245.us.us, %.lr.ph46.us ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %36 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #3
  store ptr %36, ptr %5, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %37, label %.lr.ph46.us, label %._crit_edge.split.us.us, !llvm.loop !15

38:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %39 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  store i32 %7, ptr %39, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %.not = icmp sgt i64 %indvars.iv, %41
  br i1 %.not, label %.critedge42, label %38, !llvm.loop !16

.critedge:                                        ; preds = %69, %.critedge42.split.outer
  %.037.lcssa = phi i32 [ %.037.ph, %.critedge42.split.outer ], [ 1, %69 ]
  %.1.lcssa = phi i1 [ %.1.ph, %.critedge42.split.outer ], [ false, %69 ]
  %42 = zext nneg i32 %.037.lcssa to i64
  %43 = getelementptr inbounds i32, ptr %1, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %67, label %46

46:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %47 = getelementptr inbounds %"class.std::vector", ptr %0, i64 %42
  %48 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %48, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %49 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %49, ptr %5, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %50, label %.critedge40, label %._crit_edge.split

._crit_edge.split:                                ; preds = %63, %46
  %.2.lcssa = phi i1 [ %.1.lcssa, %46 ], [ %.3, %63 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %.pre.pre.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %67

.critedge40:                                      ; preds = %46, %63
  %.245 = phi i1 [ %.3, %63 ], [ %.1.lcssa, %46 ]
  %51 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %52 = load i32, ptr %51, align 4, !tbaa !12
  %53 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !14
  %56 = sext i32 %52 to i64
  %57 = getelementptr inbounds i32, ptr %1, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %43, align 4, !tbaa !5
  %60 = add nsw i32 %59, %55
  %61 = icmp slt i32 %58, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %.critedge40
  store i32 %60, ptr %57, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %62, %.critedge40
  %.3 = phi i1 [ true, %62 ], [ %.245, %.critedge40 ]
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %65 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %65, ptr %5, align 8
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %66, label %.critedge40, label %._crit_edge.split, !llvm.loop !15

67:                                               ; preds = %.critedge, %._crit_edge.split
  %.pre.pre = phi i32 [ %.pre.pre.pre, %._crit_edge.split ], [ %.pre49.ph, %.critedge ]
  %.4 = phi i1 [ %.2.lcssa, %._crit_edge.split ], [ %.1.lcssa, %.critedge ]
  %68 = add nuw nsw i32 %.037.lcssa, 1
  br label %.critedge42.split.outer, !llvm.loop !11

.critedge42.split.outer:                          ; preds = %.critedge42, %67
  %.pre49.ph = phi i32 [ %.pre.pre, %67 ], [ %8, %.critedge42 ]
  %.037.ph = phi i32 [ %68, %67 ], [ 1, %.critedge42 ]
  %.1.ph = phi i1 [ %.4, %67 ], [ false, %.critedge42 ]
  %.not38.peel = icmp sgt i32 %.037.ph, %.pre49.ph
  br i1 %.not38.peel, label %69, label %.critedge, !llvm.loop !9

69:                                               ; preds = %.critedge42.split.outer
  %.1.ph.not = xor i1 %.1.ph, true
  %.not38 = icmp slt i32 %.pre49.ph, 1
  %or.cond = or i1 %.1.ph.not, %.not38
  br i1 %or.cond, label %.split.us, label %.critedge, !llvm.loop !9

.split.us:                                        ; preds = %69, %10
  %70 = phi i32 [ %.pre5152.ph, %10 ], [ %.pre49.ph, %69 ]
  %71 = sext i32 %70 to i64
  %72 = getelementptr i32, ptr %1, i64 %71
  %73 = getelementptr i8, ptr %72, i64 4
  %74 = load i32, ptr %73, align 4, !tbaa !5
  ret i32 %74
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(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_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(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 @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) 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 = !{!"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 = !{!13, !6, i64 0}
!13 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass