; LLVM IR from andreimaximov/algorithms :: codeforces/karen-and-supermarket/main.ll (Z3dfsi)

; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@C = external dso_local global [5000 x i64], align 16
@D = external dso_local global [5000 x i64], align 16
@T = external dso_local global [5000 x %"class.std::vector"], align 16
@S = external dso_local global [5000 x i32], align 16
@F = external dso_local global [5000 x [5001 x i64]], align 16
@G = external dso_local global [5000 x [5001 x i64]], align 16
@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._Z3dfsi = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sge i32 %12, 0
  br i1 %13, label %14, label %18

14:                                               ; preds = %1
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br label %18

18:                                               ; preds = %14, %1
  %19 = phi i1 [ false, %1 ], [ %17, %14 ]
  br i1 %19, label %20, label %21

20:                                               ; preds = %18
  br label %23

21:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.2, i32 noundef 41, ptr noundef @__PRETTY_FUNCTION__._Z3dfsi) #5
  unreachable

22:                                               ; No predecessors!
  br label %23

23:                                               ; preds = %22, %20
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %25
  %27 = getelementptr inbounds [5001 x i64], ptr %26, i64 0, i64 0
  store i64 1000000001, ptr %27, align 8, !tbaa !9
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [5000 x i64], ptr @C, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [5000 x i64], ptr @D, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = sub nsw i64 %31, %35
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %38
  %40 = getelementptr inbounds [5001 x i64], ptr %39, i64 0, i64 1
  store i64 %36, ptr %40, align 8, !tbaa !9
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %42
  %44 = getelementptr inbounds [5001 x i64], ptr %43, i64 0, i64 0
  store i64 0, ptr %44, align 8, !tbaa !9
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5000 x i64], ptr @C, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %50
  %52 = getelementptr inbounds [5001 x i64], ptr %51, i64 0, i64 1
  store i64 %48, ptr %52, align 8, !tbaa !9
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %54
  store i32 1, ptr %55, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [5000 x %"class.std::vector"], ptr @T, i64 0, i64 %57
  store ptr %58, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %59 = load ptr, ptr %3, align 8, !tbaa !11
  %60 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #6
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %62 = load ptr, ptr %3, align 8, !tbaa !11
  %63 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #6
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  br label %65

65:                                               ; preds = %180, %23
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %66, label %68, label %67

67:                                               ; preds = %65
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %182

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %8, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %167, %68
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = icmp sge i32 %77, 0
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  store i32 4, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %170

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %9, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %163, %80
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = icmp sge i32 %86, 0
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %166

89:                                               ; preds = %85
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = add nsw i32 %93, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [5001 x i64], ptr %92, i64 0, i64 %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %99
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [5001 x i64], ptr %100, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %106
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [5001 x i64], ptr %107, i64 0, i64 %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %112
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5001 x i64], ptr %113, i64 0, i64 %115
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef nonnull align 8 dereferenceable(8) %116)
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = add nsw i64 %104, %118
  store i64 %119, ptr %10, align 8, !tbaa !9
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %123
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %125, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [5001 x i64], ptr %124, i64 0, i64 %128
  store i64 %121, ptr %129, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %131
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [5001 x i64], ptr %132, i64 0, i64 %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %139
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [5001 x i64], ptr %140, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %146
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [5001 x i64], ptr %147, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = add nsw i64 %144, %151
  store i64 %152, ptr %11, align 8, !tbaa !9
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %154 = load i64, ptr %153, align 8, !tbaa !9
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %156
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = add nsw i32 %158, %159
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [5001 x i64], ptr %157, i64 0, i64 %161
  store i64 %154, ptr %162, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %163

163:                                              ; preds = %89
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = add nsw i32 %164, -1
  store i32 %165, ptr %9, align 4, !tbaa !5
  br label %85, !llvm.loop !13

166:                                              ; preds = %88
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = add nsw i32 %168, -1
  store i32 %169, ptr %8, align 4, !tbaa !5
  br label %76, !llvm.loop !15

170:                                              ; preds = %79
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = load i32, ptr %2, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = add nsw i32 %178, %174
  store i32 %179, ptr %177, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %180

180:                                              ; preds = %170
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %65

182:                                              ; preds = %67
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

attributes #0 = { 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 #1 = { noreturn nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@C = external dso_local local_unnamed_addr global [5000 x i64], align 16
@D = external dso_local local_unnamed_addr global [5000 x i64], align 16
@T = external dso_local global [5000 x %"class.std::vector"], align 16
@S = external dso_local local_unnamed_addr global [5000 x i32], align 16
@F = external dso_local global [5000 x [5001 x i64]], align 16
@G = external dso_local global [5000 x [5001 x i64]], align 16
@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._Z3dfsi = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = icmp sgt i32 %0, -1
  %7 = load i32, ptr @n, align 4
  %8 = icmp sgt i32 %7, %0
  %9 = select i1 %6, i1 %8, i1 false
  br i1 %9, label %11, label %10

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, i32 noundef 41, ptr noundef nonnull @__PRETTY_FUNCTION__._Z3dfsi) #4
  unreachable

11:                                               ; preds = %1
  %12 = zext nneg i32 %0 to i64
  %13 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %12
  store i64 1000000001, ptr %13, align 8, !tbaa !5
  %14 = getelementptr inbounds [5000 x i64], ptr @C, i64 0, i64 %12
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds [5000 x i64], ptr @D, i64 0, i64 %12
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = sub nsw i64 %15, %17
  %19 = getelementptr inbounds i8, ptr %13, i64 8
  store i64 %18, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %12
  store i64 0, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  store i64 %15, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %12
  store i32 1, ptr %22, align 4, !tbaa !9
  %23 = getelementptr inbounds [5000 x %"class.std::vector"], ptr @T, i64 0, i64 %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %24 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  store ptr %24, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %25 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  store ptr %25, ptr %3, align 8
  %26 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %26, label %.lr.ph51, label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge49, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret void

.lr.ph51:                                         ; preds = %11, %._crit_edge49
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %28 = load i32, ptr %27, align 4, !tbaa !9
  call void @_Z3dfsi(i32 noundef %28)
  %29 = load i32, ptr %22, align 4, !tbaa !9
  %30 = icmp sgt i32 %29, -1
  %31 = sext i32 %28 to i64
  br i1 %30, label %.lr.ph48, label %._crit_edge49

.lr.ph48:                                         ; preds = %.lr.ph51
  %32 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = icmp sgt i32 %33, -1
  br i1 %34, label %.lr.ph48.split.preheader, label %._crit_edge49

.lr.ph48.split.preheader:                         ; preds = %.lr.ph48
  %35 = zext nneg i32 %29 to i64
  br label %.lr.ph48.split

._crit_edge49.loopexit:                           ; preds = %._crit_edge
  %.pre = load i32, ptr %22, align 4, !tbaa !9
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %.lr.ph51, %.lr.ph48, %._crit_edge49.loopexit
  %36 = phi i32 [ %.pre, %._crit_edge49.loopexit ], [ %29, %.lr.ph48 ], [ %29, %.lr.ph51 ]
  %37 = getelementptr inbounds [5000 x i32], ptr @S, i64 0, i64 %31
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = add nsw i32 %36, %38
  store i32 %39, ptr %22, align 4, !tbaa !9
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %41, label %.lr.ph51, label %._crit_edge52

.lr.ph48.splitthread-pre-split:                   ; preds = %._crit_edge
  %indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
  %.pr = load i32, ptr %32, align 4, !tbaa !9
  br label %.lr.ph48.split

.lr.ph48.split:                                   ; preds = %.lr.ph48.splitthread-pre-split, %.lr.ph48.split.preheader
  %42 = phi i32 [ %.pr, %.lr.ph48.splitthread-pre-split ], [ %33, %.lr.ph48.split.preheader ]
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %.lr.ph48.splitthread-pre-split ], [ %35, %.lr.ph48.split.preheader ]
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph48.split
  %44 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %12, i64 %indvars.iv55
  %45 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %12, i64 %indvars.iv55
  %46 = zext nneg i32 %42 to i64
  br label %48

._crit_edge:                                      ; preds = %48, %.lr.ph48.split
  %47 = icmp sgt i64 %indvars.iv55, 0
  br i1 %47, label %.lr.ph48.splitthread-pre-split, label %._crit_edge49.loopexit, !llvm.loop !11

48:                                               ; preds = %.lr.ph, %48
  %indvars.iv = phi i64 [ %46, %.lr.ph ], [ %indvars.iv.next, %48 ]
  %49 = add nuw nsw i64 %indvars.iv, %indvars.iv55
  %50 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %12, i64 %49
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %51 = load i64, ptr %44, align 8, !tbaa !5
  %52 = getelementptr inbounds [5000 x [5001 x i64]], ptr @F, i64 0, i64 %31, i64 %indvars.iv
  %53 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %31, i64 %indvars.iv
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %53)
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = add nsw i64 %55, %51
  store i64 %56, ptr %4, align 8, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %58 = load i64, ptr %57, align 8, !tbaa !5
  store i64 %58, ptr %50, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %59 = getelementptr inbounds [5000 x [5001 x i64]], ptr @G, i64 0, i64 %12, i64 %49
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %60 = load i64, ptr %45, align 8, !tbaa !5
  %61 = load i64, ptr %53, align 8, !tbaa !5
  %62 = add nsw i64 %61, %60
  store i64 %62, ptr %5, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %64 = load i64, ptr %63, align 8, !tbaa !5
  store i64 %64, ptr %59, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not = icmp eq i64 %indvars.iv, 0
  br i1 %.not, label %._crit_edge, label %48, !llvm.loop !14
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(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_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind }
attributes #5 = { 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass