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

; 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
@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 @_Z4dfs2i(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
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %10
  %12 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %13 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %12, ptr %13, align 8
  br label %14

14:                                               ; preds = %161, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %16
  %18 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %18, ptr %19, align 8
  %20 = 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 %20, label %22, label %21

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

22:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1000001 x i32], ptr @fa1, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp eq i32 %25, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %22
  store i32 4, ptr %5, align 4
  br label %158

32:                                               ; preds = %22
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = icmp ne i32 %36, %37
  br i1 %38, label %39, label %94

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = load i32, ptr @size, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = add nsw i64 %43, %45
  store i64 %46, ptr %7, align 8, !tbaa !9
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %53, label %76

53:                                               ; preds = %39
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %59
  store i64 %57, ptr %60, align 8, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %66
  store i32 %64, ptr %67, align 4, !tbaa !5
  %68 = load i64, ptr %7, align 8, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %70
  store i64 %68, ptr %71, align 8, !tbaa !9
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %93

76:                                               ; preds = %39
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = icmp slt i64 %80, %81
  br i1 %82, label %83, label %92

83:                                               ; preds = %76
  %84 = load i64, ptr %7, align 8, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %86
  store i64 %84, ptr %87, align 8, !tbaa !9
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %83, %76
  br label %93

93:                                               ; preds = %92, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %94

94:                                               ; preds = %93, %32
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = icmp ne i32 %98, %99
  br i1 %100, label %101, label %156

101:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = load i32, ptr @size, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = add nsw i64 %105, %107
  store i64 %108, ptr %8, align 8, !tbaa !9
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = load i64, ptr %8, align 8, !tbaa !9
  %114 = icmp slt i64 %112, %113
  br i1 %114, label %115, label %138

115:                                              ; preds = %101
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %121
  store i64 %119, ptr %122, align 8, !tbaa !9
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  %130 = load i64, ptr %8, align 8, !tbaa !9
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %132
  store i64 %130, ptr %133, align 8, !tbaa !9
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %136
  store i32 %134, ptr %137, align 4, !tbaa !5
  br label %155

138:                                              ; preds = %101
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !9
  %143 = load i64, ptr %8, align 8, !tbaa !9
  %144 = icmp slt i64 %142, %143
  br i1 %144, label %145, label %154

145:                                              ; preds = %138
  %146 = load i64, ptr %8, align 8, !tbaa !9
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %148
  store i64 %146, ptr %149, align 8, !tbaa !9
  %150 = load i32, ptr %2, align 4, !tbaa !5
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %145, %138
  br label %155

155:                                              ; preds = %154, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %156

156:                                              ; preds = %155, %94
  %157 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z4dfs2i(i32 noundef %157)
  store i32 0, ptr %5, align 4
  br label %158

158:                                              ; preds = %156, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %159 = load i32, ptr %5, align 4
  switch i32 %159, label %164 [
    i32 0, label %160
    i32 4, label %161
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %158
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br label %14, !llvm.loop !11

163:                                              ; preds = %21
  ret void

164:                                              ; preds = %158
  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
@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 @_Z4dfs2i(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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %4 = sext i32 %0 to i64
  %5 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e1, i64 0, i64 %4
  %6 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %6, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %7 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %7, ptr %3, align 8
  %8 = 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 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds [1000001 x i32], ptr @fa1, i64 0, i64 %4
  %10 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %4
  %11 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %4
  %12 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %4
  %13 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %4
  br label %14

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

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

19:                                               ; preds = %14
  %20 = load i32, ptr %10, align 4, !tbaa !5
  %.not = icmp eq i32 %20, %16
  br i1 %.not, label %40, label %21

21:                                               ; preds = %19
  %22 = load i64, ptr %11, align 8, !tbaa !9
  %23 = load i32, ptr @size, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = add nsw i64 %22, %24
  %26 = sext i32 %16 to i64
  %27 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = icmp slt i64 %28, %25
  %30 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %26
  br i1 %29, label %31, label %35

31:                                               ; preds = %21
  store i64 %28, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %26
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %26
  store i32 %33, ptr %34, align 4, !tbaa !5
  store i64 %25, ptr %27, align 8, !tbaa !9
  br label %.sink.split

35:                                               ; preds = %21
  %36 = load i64, ptr %30, align 8, !tbaa !9
  %37 = icmp slt i64 %36, %25
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  store i64 %25, ptr %30, align 8, !tbaa !9
  %39 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %26
  br label %.sink.split

.sink.split:                                      ; preds = %38, %31
  %.sink = phi ptr [ %32, %31 ], [ %39, %38 ]
  store i32 %0, ptr %.sink, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %.sink.split, %35, %19
  %41 = load i32, ptr %12, align 4, !tbaa !5
  %.not48 = icmp eq i32 %41, %16
  br i1 %.not48, label %61, label %42

42:                                               ; preds = %40
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = load i32, ptr @size, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = add nsw i64 %43, %45
  %47 = sext i32 %16 to i64
  %48 = getelementptr inbounds [1000001 x i64], ptr @val1, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = icmp slt i64 %49, %46
  %51 = getelementptr inbounds [1000001 x i64], ptr @val2, i64 0, i64 %47
  br i1 %50, label %52, label %56

52:                                               ; preds = %42
  store i64 %49, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds [1000001 x i32], ptr @pos1, i64 0, i64 %47
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %47
  store i32 %54, ptr %55, align 4, !tbaa !5
  store i64 %46, ptr %48, align 8, !tbaa !9
  br label %.sink.split49

56:                                               ; preds = %42
  %57 = load i64, ptr %51, align 8, !tbaa !9
  %58 = icmp slt i64 %57, %46
  br i1 %58, label %59, label %61

59:                                               ; preds = %56
  store i64 %46, ptr %51, align 8, !tbaa !9
  %60 = getelementptr inbounds [1000001 x i32], ptr @pos2, i64 0, i64 %47
  br label %.sink.split49

.sink.split49:                                    ; preds = %59, %52
  %.sink50 = phi ptr [ %53, %52 ], [ %60, %59 ]
  store i32 %0, ptr %.sink50, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %.sink.split49, %56, %40
  call void @_Z4dfs2i(i32 noundef %16)
  br label %62

62:                                               ; preds = %14, %61
  %63 = 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
  %64 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %64, ptr %3, align 8
  %65 = 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 %65, label %14, 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 = !{!"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"}


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