; LLVM IR from ravireddy07/cpp-book :: src/Code-Chef/MAR2021-Long/CCNF.ll (Z3mcsv)

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

@n = external dso_local global i32, align 4
@e = external dso_local global [150 x [150 x i32]], align 16
@pe = external dso_local global [150 x i32], align 16
@rk = external dso_local global [150 x i32], align 16

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3mcsv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca [150 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca [150 x %"class.std::vector"], align 16
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 600, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 3600, ptr %3) #4
  %11 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i32 0, i32 0
  %12 = getelementptr inbounds %"class.std::vector", ptr %11, i64 150
  br label %13

13:                                               ; preds = %13, %0
  %14 = phi ptr [ %11, %0 ], [ %15, %13 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %15 = getelementptr inbounds %"class.std::vector", ptr %14, i64 1
  %16 = icmp eq ptr %15, %12
  br i1 %16, label %17, label %13

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %29, %17
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %36

23:                                               ; preds = %18
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %25
  store i32 0, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %28 unwind label %32

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %4, align 4, !tbaa !5
  br label %18, !llvm.loop !9

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %5, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %148

36:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr %7, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %137, %36
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = icmp sge i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %140

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 -1, ptr %9, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %77, %43
  br label %45

45:                                               ; preds = %68, %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %47
  %49 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #4
  %50 = xor i1 %49, true
  br i1 %50, label %51, label %72

51:                                               ; preds = %45
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %53
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #4
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp ne i32 %59, -1
  br i1 %60, label %61, label %67

61:                                               ; preds = %51
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %63
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #4
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %9, align 4, !tbaa !5
  br label %72

67:                                               ; preds = %51
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %70
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #4
  br label %45, !llvm.loop !11

72:                                               ; preds = %61, %45
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = icmp ne i32 %73, -1
  br i1 %74, label %75, label %76

75:                                               ; preds = %72
  br label %80

76:                                               ; preds = %72
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %2, align 4, !tbaa !5
  br label %44, !llvm.loop !12

80:                                               ; preds = %75
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [150 x i32], ptr @pe, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [150 x i32], ptr @rk, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %90
  store i32 -1, ptr %91, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %129, %80
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %136

97:                                               ; preds = %92
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [150 x [150 x i32]], ptr @e, i64 0, i64 %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [150 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %112

106:                                              ; preds = %97
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp eq i32 %110, -1
  br i1 %111, label %112, label %113

112:                                              ; preds = %106, %97
  br label %129

113:                                              ; preds = %106
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %116, align 4, !tbaa !5
  %119 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %116)
          to label %120 unwind label %132

120:                                              ; preds = %113
  %121 = load i32, ptr %119, align 4, !tbaa !5
  store i32 %121, ptr %2, align 4, !tbaa !5
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %126
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %127, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %128 unwind label %132

128:                                              ; preds = %120
  br label %129

129:                                              ; preds = %128, %112
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %10, align 4, !tbaa !5
  br label %92, !llvm.loop !13

132:                                              ; preds = %120, %113
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %5, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %148

136:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %7, align 4, !tbaa !5
  br label %39, !llvm.loop !14

140:                                              ; preds = %42
  %141 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i32 0, i32 0
  %142 = getelementptr inbounds %"class.std::vector", ptr %141, i64 150
  br label %143

143:                                              ; preds = %143, %140
  %144 = phi ptr [ %142, %140 ], [ %145, %143 ]
  %145 = getelementptr inbounds %"class.std::vector", ptr %144, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %145) #4
  %146 = icmp eq ptr %145, %141
  br i1 %146, label %147, label %143

147:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 3600, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 600, ptr %1) #4
  ret void

148:                                              ; preds = %132, %32
  %149 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i32 0, i32 0
  %150 = getelementptr inbounds %"class.std::vector", ptr %149, i64 150
  br label %151

151:                                              ; preds = %151, %148
  %152 = phi ptr [ %150, %148 ], [ %153, %151 ]
  %153 = getelementptr inbounds %"class.std::vector", ptr %152, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %153) #4
  %154 = icmp eq ptr %153, %149
  br i1 %154, label %155, label %151

155:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 3600, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 600, ptr %1) #4
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %5, align 8
  %158 = load i32, ptr %6, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 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 = { 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 = { 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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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 }

@n = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local local_unnamed_addr global [150 x [150 x i32]], align 16
@pe = external dso_local local_unnamed_addr global [150 x i32], align 16
@rk = external dso_local local_unnamed_addr global [150 x i32], align 16

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3mcsv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca [150 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca [150 x %"class.std::vector"], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 3600, ptr nonnull %3) #4
  br label %6

6:                                                ; preds = %6, %0
  %.idx = phi i64 [ 0, %0 ], [ %.add, %6 ]
  %.ptr = getelementptr inbounds i8, ptr %3, i64 %.idx
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #4
  %.add = add nuw nsw i64 %.idx, 24
  %7 = icmp eq i64 %.add, 3600
  br i1 %7, label %8, label %6

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %3, i64 3600
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not31 = icmp slt i32 %10, 1
  br i1 %.not31, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %.preheader.preheader

._crit_edge:                                      ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %11 = icmp sgt i32 %18, 0
  br i1 %11, label %.preheader28.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge39, %._crit_edge.thread, %._crit_edge
  br label %.preheader

.preheader28.preheader:                           ; preds = %._crit_edge
  %12 = zext nneg i32 %18 to i64
  br label %.preheader28

.lr.ph:                                           ; preds = %8, %15
  %storemerge32 = phi i32 [ %17, %15 ], [ 1, %8 ]
  %13 = sext i32 %storemerge32 to i64
  %14 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %13
  store i32 0, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %15 unwind label %19

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %16, %18
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

19:                                               ; preds = %.lr.ph
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %83

.preheader28:                                     ; preds = %.preheader28.preheader, %._crit_edge39
  %indvars.iv = phi i64 [ %12, %.preheader28.preheader ], [ %indvars.iv.next, %._crit_edge39 ]
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %.preheader28, %.thread
  %22 = phi i32 [ %.pre, %.preheader28 ], [ %46, %.thread ]
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %23
  %25 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  br i1 %25, label %.thread, label %.lr.ph34

.lr.ph34:                                         ; preds = %21, %37
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %27
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %.not20 = icmp eq i32 %33, -1
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %35
  br i1 %.not20, label %37, label %42

37:                                               ; preds = %.lr.ph34
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %39
  %41 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  br i1 %41, label %.thread, label %.lr.ph34, !llvm.loop !11

42:                                               ; preds = %.lr.ph34
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %.not21 = icmp eq i32 %44, -1
  br i1 %.not21, label %.thread, label %47

.thread:                                          ; preds = %37, %21, %42
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !12

47:                                               ; preds = %42
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %48 = getelementptr inbounds [150 x i32], ptr @pe, i64 0, i64 %indvars.iv.next
  store i32 %44, ptr %48, align 4, !tbaa !5
  %49 = sext i32 %44 to i64
  %50 = getelementptr inbounds [150 x i32], ptr @rk, i64 0, i64 %49
  %51 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %51, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %49
  store i32 -1, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %.not2335 = icmp slt i32 %53, 1
  br i1 %.not2335, label %._crit_edge39, label %.lr.ph38

._crit_edge39:                                    ; preds = %73, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %54 = icmp sgt i64 %indvars.iv, 1
  br i1 %54, label %.preheader28, label %.preheader.preheader, !llvm.loop !13

.lr.ph38:                                         ; preds = %47, %73
  %55 = phi i32 [ %74, %73 ], [ %53, %47 ]
  %storemerge2236 = phi i32 [ %76, %73 ], [ 1, %47 ]
  %56 = sext i32 %storemerge2236 to i64
  %57 = getelementptr inbounds [150 x [150 x i32]], ptr @e, i64 0, i64 %49, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not24 = icmp eq i32 %58, 0
  br i1 %.not24, label %73, label %59

59:                                               ; preds = %.lr.ph38
  %60 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %56
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, -1
  br i1 %62, label %73, label %63

63:                                               ; preds = %59
  %64 = add nuw nsw i32 %61, 1
  store i32 %64, ptr %60, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %60)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %2, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [150 x %"class.std::vector"], ptr %3, i64 0, i64 %71
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %._crit_edge44 unwind label %77

._crit_edge44:                                    ; preds = %63
  %.pre45 = load i32, ptr %5, align 4, !tbaa !5
  %.pre46 = load i32, ptr @n, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %._crit_edge44, %.lr.ph38, %59
  %74 = phi i32 [ %.pre46, %._crit_edge44 ], [ %55, %.lr.ph38 ], [ %55, %59 ]
  %75 = phi i32 [ %.pre45, %._crit_edge44 ], [ %storemerge2236, %.lr.ph38 ], [ %storemerge2236, %59 ]
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !5
  %.not23.not = icmp slt i32 %75, %74
  br i1 %.not23.not, label %.lr.ph38, label %._crit_edge39, !llvm.loop !14

77:                                               ; preds = %63
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %83

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %79 = phi ptr [ %80, %.preheader ], [ %9, %.preheader.preheader ]
  %80 = getelementptr inbounds i8, ptr %79, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %80) #4
  %81 = icmp eq ptr %80, %3
  br i1 %81, label %82, label %.preheader

82:                                               ; preds = %.preheader
  call void @llvm.lifetime.end.p0(i64 3600, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %1) #4
  ret void

83:                                               ; preds = %77, %19
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %78, %77 ]
  br label %84

84:                                               ; preds = %84, %83
  %85 = phi ptr [ %9, %83 ], [ %86, %84 ]
  %86 = getelementptr inbounds i8, ptr %85, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %86) #4
  %87 = icmp eq ptr %86, %3
  br i1 %87, label %88, label %84

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 3600, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %1) #4
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 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 = { 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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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