; LLVM IR from tangjz/acm-icpc :: 51nod/1578.ll (Z4pfs2i)

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

@fa1 = external dso_local global [1000001 x i32], align 16
@size = external dso_local global [3 x i32], align 4
@dist1 = external dso_local global [1000001 x i64], align 16
@e1 = external dso_local global [1000001 x %"class.std::vector"], align 16
@pos1 = external dso_local global [1000001 x i32], align 16
@pos2 = external dso_local global [1000001 x i32], align 16
@val1 = external dso_local global [1000001 x i64], align 16
@val2 = external dso_local global [1000001 x i64], align 16

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

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

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

; 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
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(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_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4pfs2i(i32 noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [1000001 x i64], ptr @dist1, i64 0, i64 %10
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %14
  store i64 %12, ptr %15, align 8, !tbaa !9
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %18
  store i32 %16, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %21
  store i64 -1, ptr %22, align 8, !tbaa !9
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %24
  store i32 -1, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %27
  %29 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  br label %31

31:                                               ; preds = %169, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %33
  %35 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #4
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1000001 x i32], ptr @fa1, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %42, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %39
  store i32 4, ptr %5, align 4
  br label %166

49:                                               ; preds = %39
  %50 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z4pfs2i(i32 noundef %50)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = load i32, ptr @size, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = add nsw i64 %54, %56
  store i64 %57, ptr %7, align 8, !tbaa !9
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load i64, ptr %7, align 8, !tbaa !9
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %64, label %87

64:                                               ; preds = %49
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %70
  store i64 %68, ptr %71, align 8, !tbaa !9
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %77
  store i32 %75, ptr %78, align 4, !tbaa !5
  %79 = load i64, ptr %7, align 8, !tbaa !9
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %81
  store i64 %79, ptr %82, align 8, !tbaa !9
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %85
  store i32 %83, ptr %86, align 4, !tbaa !5
  br label %104

87:                                               ; preds = %49
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = load i64, ptr %7, align 8, !tbaa !9
  %93 = icmp slt i64 %91, %92
  br i1 %93, label %94, label %103

94:                                               ; preds = %87
  %95 = load i64, ptr %7, align 8, !tbaa !9
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %97
  store i64 %95, ptr %98, align 8, !tbaa !9
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %94, %87
  br label %104

104:                                              ; preds = %103, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = icmp ne i64 %108, -1
  br i1 %109, label %110, label %165

110:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = load i32, ptr @size, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = add nsw i64 %114, %116
  store i64 %117, ptr %8, align 8, !tbaa !9
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = load i64, ptr %8, align 8, !tbaa !9
  %123 = icmp slt i64 %121, %122
  br i1 %123, label %124, label %147

124:                                              ; preds = %110
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %130
  store i64 %128, ptr %131, align 8, !tbaa !9
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !5
  %139 = load i64, ptr %8, align 8, !tbaa !9
  %140 = load i32, ptr %2, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %141
  store i64 %139, ptr %142, align 8, !tbaa !9
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %145
  store i32 %143, ptr %146, align 4, !tbaa !5
  br label %164

147:                                              ; preds = %110
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = load i64, ptr %8, align 8, !tbaa !9
  %153 = icmp slt i64 %151, %152
  br i1 %153, label %154, label %163

154:                                              ; preds = %147
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %157
  store i64 %155, ptr %158, align 8, !tbaa !9
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %161
  store i32 %159, ptr %162, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %154, %147
  br label %164

164:                                              ; preds = %163, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %165

165:                                              ; preds = %164, %104
  store i32 0, ptr %5, align 4
  br label %166

166:                                              ; preds = %165, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %167 = load i32, ptr %5, align 4
  switch i32 %167, label %172 [
    i32 0, label %168
    i32 4, label %169
  ]

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168, %166
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br label %31, !llvm.loop !11

171:                                              ; preds = %38
  ret void

172:                                              ; preds = %166
  unreachable
}

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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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" = 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 }

@fa1 = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@size = external dso_local local_unnamed_addr global [3 x i32], align 4
@dist1 = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@e1 = external dso_local global [1000001 x %"class.std::vector"], align 16
@pos1 = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@pos2 = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@val1 = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@val2 = external dso_local local_unnamed_addr global [1000001 x i64], align 16

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(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_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(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 @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; 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
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 #1 align 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 #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z4pfs2i(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = sext i32 %0 to i64
  %5 = getelementptr inbounds [1000001 x i64], ptr @dist1, i64 0, i64 %4
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %4
  store i64 %6, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %4
  store i32 %0, ptr %8, align 4, !tbaa !9
  %9 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %4
  store i64 -1, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %4
  store i32 -1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %11 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %4
  %12 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %12, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %13 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %13, ptr %3, align 8
  %14 = 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) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %15 = getelementptr inbounds [1000001 x i32], ptr @fa1, i64 0, i64 %4
  br label %16

._crit_edge:                                      ; preds = %47, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret void

16:                                               ; preds = %.lr.ph, %47
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = load i32, ptr %15, align 4, !tbaa !9
  %20 = icmp eq i32 %18, %19
  br i1 %20, label %47, label %21

21:                                               ; preds = %16
  call void @_Z4pfs2i(i32 noundef %18)
  %22 = sext i32 %18 to i64
  %23 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %22
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = load i32, ptr @size, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = add nsw i64 %24, %26
  %28 = load i64, ptr %7, align 8, !tbaa !5
  %29 = icmp slt i64 %28, %27
  br i1 %29, label %30, label %32

30:                                               ; preds = %21
  store i64 %28, ptr %9, align 8, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %31, ptr %10, align 4, !tbaa !9
  br label %.sink.split

32:                                               ; preds = %21
  %33 = load i64, ptr %9, align 8, !tbaa !5
  %34 = icmp slt i64 %33, %27
  br i1 %34, label %.sink.split, label %35

.sink.split:                                      ; preds = %32, %30
  %.sink53 = phi ptr [ %7, %30 ], [ %9, %32 ]
  %.sink = phi ptr [ %8, %30 ], [ %10, %32 ]
  %.ph = phi i64 [ %28, %30 ], [ %27, %32 ]
  %.ph52 = phi i64 [ %27, %30 ], [ %28, %32 ]
  store i64 %27, ptr %.sink53, align 8, !tbaa !5
  store i32 %18, ptr %.sink, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %.sink.split, %32
  %36 = phi i64 [ %33, %32 ], [ %.ph, %.sink.split ]
  %37 = phi i64 [ %28, %32 ], [ %.ph52, %.sink.split ]
  %38 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %22
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %.not = icmp eq i64 %39, -1
  br i1 %.not, label %47, label %40

40:                                               ; preds = %35
  %41 = add nsw i64 %39, %26
  %42 = icmp slt i64 %37, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  store i64 %37, ptr %9, align 8, !tbaa !5
  %44 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %44, ptr %10, align 4, !tbaa !9
  br label %.sink.split54

45:                                               ; preds = %40
  %46 = icmp slt i64 %36, %41
  br i1 %46, label %.sink.split54, label %47

.sink.split54:                                    ; preds = %45, %43
  %.sink56 = phi ptr [ %7, %43 ], [ %9, %45 ]
  %.sink55 = phi ptr [ %8, %43 ], [ %10, %45 ]
  store i64 %41, ptr %.sink56, align 8, !tbaa !5
  store i32 %18, ptr %.sink55, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %.sink.split54, %35, %45, %16
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %49 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %49, ptr %3, align 8
  %50 = 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) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %50, label %16, label %._crit_edge, !llvm.loop !11
}

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


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