; LLVM IR from tangjz/acm-icpc :: codeforces/gym/102028K.ll (Z3dfsiii)

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

@dep = external dso_local global [100001 x i32], align 16
@fa = external dso_local global [17 x [100001 x i32]], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sa = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x i32], align 16
@buf = external dso_local global [100001 x i8], 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %17
  %19 = call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %22
  %24 = call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %27, ptr %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %31
  %33 = call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #5
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  br label %35

35:                                               ; preds = %159, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %37
  %39 = call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #5
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIciESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br i1 %41, label %43, label %42

42:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %161

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %44 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %45 = getelementptr inbounds %"struct.std::pair", ptr %44, i32 0, i32 0
  %46 = load i8, ptr %45, align 4, !tbaa !9
  store i8 %46, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %47 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %48 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !12
  store i32 %49, ptr %12, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %81, %43
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %54, label %71

54:                                               ; preds = %50
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %58, %62
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = load i8, ptr %11, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp slt i32 %67, %69
  br label %71

71:                                               ; preds = %54, %50
  %72 = phi i1 [ false, %50 ], [ %70, %54 ]
  br i1 %72, label %73, label %84

73:                                               ; preds = %71
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %79
  store i32 %74, ptr %80, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %73
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %5, align 4, !tbaa !5
  br label %50, !llvm.loop !13

84:                                               ; preds = %71
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %88, label %158

88:                                               ; preds = %84
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %92, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = sext i8 %100 to i32
  %102 = load i8, ptr %11, align 1, !tbaa !11
  %103 = sext i8 %102 to i32
  %104 = icmp eq i32 %101, %103
  br i1 %104, label %105, label %158

105:                                              ; preds = %88
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %112
  store i32 %110, ptr %113, align 4, !tbaa !5
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %116
  store i32 %114, ptr %117, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %118 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %118, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %119 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %119, ptr %14, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %151, %105
  %121 = load i32, ptr %13, align 4, !tbaa !5
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %152

124:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %125 = load i32, ptr %13, align 4, !tbaa !5
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = add nsw i32 %125, %126
  %128 = add nsw i32 %127, 1
  %129 = ashr i32 %128, 1
  store i32 %129, ptr %15, align 4, !tbaa !5
  %130 = load i32, ptr %15, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %133, %137
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !11
  %142 = sext i8 %141 to i32
  %143 = load i8, ptr %11, align 1, !tbaa !11
  %144 = sext i8 %143 to i32
  %145 = icmp eq i32 %142, %144
  br i1 %145, label %146, label %148

146:                                              ; preds = %124
  %147 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %147, ptr %13, align 4, !tbaa !5
  br label %151

148:                                              ; preds = %124
  %149 = load i32, ptr %15, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  store i32 %150, ptr %14, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %148, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %120, !llvm.loop !15

152:                                              ; preds = %120
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3dfsiii(i32 noundef %153, i32 noundef %154, i32 noundef %155)
  %156 = load i32, ptr %13, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %158

158:                                              ; preds = %152, %88, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %159

159:                                              ; preds = %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %35, !llvm.loop !16

161:                                              ; preds = %42
  br label %162

162:                                              ; preds = %174, %161
  %163 = load i32, ptr %5, align 4, !tbaa !5
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = icmp sle i32 %163, %164
  br i1 %165, label %166, label %177

166:                                              ; preds = %162
  %167 = load i32, ptr %4, align 4, !tbaa !5
  %168 = load i32, ptr %5, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %172
  store i32 %167, ptr %173, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %166
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %5, align 4, !tbaa !5
  br label %162, !llvm.loop !17

177:                                              ; preds = %162
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #2

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = { 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, !7, i64 0}
!10 = !{!"_ZTSSt4pairIciE", !7, i64 0, !6, i64 4}
!11 = !{!7, !7, i64 0}
!12 = !{!10, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@dep = external dso_local local_unnamed_addr global [100001 x i32], align 16
@fa = external dso_local local_unnamed_addr global [17 x [100001 x i32]], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sa = external dso_local local_unnamed_addr global [100001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [100001 x i32], align 16
@buf = external dso_local local_unnamed_addr global [100001 x i8], 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = sext i32 %0 to i64
  %7 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %6
  %8 = tail call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %9 = tail call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %8, ptr %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %10 = tail call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %10, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %11 = tail call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %11, ptr %5, align 8
  %12 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIciESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %12, label %.lr.ph61, label %._crit_edge62

.lr.ph61:                                         ; preds = %3
  %13 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %6
  %14 = add i32 %2, 1
  br label %24

._crit_edge62:                                    ; preds = %.critedge49, %3
  %.0.lcssa = phi i32 [ %1, %3 ], [ %.2, %.critedge49 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %.not64 = icmp sgt i32 %.0.lcssa, %2
  br i1 %.not64, label %._crit_edge68, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %._crit_edge62
  %15 = sext i32 %.0.lcssa to i64
  %16 = add i32 %2, 1
  %17 = sub i32 %16, %.0.lcssa
  %18 = sub i32 %2, %.0.lcssa
  %xtraiter = and i32 %17, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph67.prol.loopexit, label %.lr.ph67.prol

.lr.ph67.prol:                                    ; preds = %.lr.ph67.preheader, %.lr.ph67.prol
  %indvars.iv73.prol = phi i64 [ %indvars.iv.next74.prol, %.lr.ph67.prol ], [ %15, %.lr.ph67.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph67.prol ], [ 0, %.lr.ph67.preheader ]
  %19 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv73.prol
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %21
  store i32 %0, ptr %22, align 4, !tbaa !5
  %indvars.iv.next74.prol = add nsw i64 %indvars.iv73.prol, 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph67.prol.loopexit, label %.lr.ph67.prol, !llvm.loop !9

.lr.ph67.prol.loopexit:                           ; preds = %.lr.ph67.prol, %.lr.ph67.preheader
  %indvars.iv73.unr = phi i64 [ %15, %.lr.ph67.preheader ], [ %indvars.iv.next74.prol, %.lr.ph67.prol ]
  %23 = icmp ult i32 %18, 3
  br i1 %23, label %._crit_edge68, label %.lr.ph67

24:                                               ; preds = %.lr.ph61, %.critedge49
  %.059 = phi i32 [ %1, %.lr.ph61 ], [ %.2, %.critedge49 ]
  %25 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %26 = load i8, ptr %25, align 4, !tbaa !11
  %27 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %.not4853 = icmp sgt i32 %.059, %2
  br i1 %.not4853, label %.critedge49, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %30 = load i32, ptr %13, align 4, !tbaa !5
  %31 = sext i32 %.059 to i64
  br label %32

32:                                               ; preds = %.lr.ph, %40
  %indvars.iv = phi i64 [ %31, %.lr.ph ], [ %indvars.iv.next, %40 ]
  %33 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %30, %34
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !14
  %39 = icmp slt i8 %38, %26
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %32
  %41 = sext i32 %34 to i64
  %42 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %41
  store i32 %0, ptr %42, align 4, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %14, %lftr.wideiv
  br i1 %exitcond.not, label %.critedge49, label %32, !llvm.loop !15

.critedge:                                        ; preds = %32
  %43 = trunc nsw i64 %indvars.iv to i32
  %44 = icmp eq i8 %38, %26
  br i1 %44, label %45, label %.critedge49

45:                                               ; preds = %.critedge
  %46 = add nsw i32 %30, 1
  %47 = sext i32 %29 to i64
  %48 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %47
  store i32 %46, ptr %48, align 4, !tbaa !5
  %49 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %47
  store i32 %0, ptr %49, align 4, !tbaa !5
  %50 = icmp slt i32 %43, %2
  br i1 %50, label %.lr.ph57, label %._crit_edge

.lr.ph57:                                         ; preds = %45
  %51 = load i32, ptr %13, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %.lr.ph57, %52
  %.04256 = phi i32 [ %2, %.lr.ph57 ], [ %.143, %52 ]
  %.04455 = phi i32 [ %43, %.lr.ph57 ], [ %.145, %52 ]
  %53 = add nsw i32 %.04455, 1
  %54 = add i32 %53, %.04256
  %55 = ashr i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %51, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !14
  %63 = icmp eq i8 %62, %26
  %64 = add nsw i32 %55, -1
  %.145 = select i1 %63, i32 %55, i32 %.04455
  %.143 = select i1 %63, i32 %.04256, i32 %64
  %65 = icmp slt i32 %.145, %.143
  br i1 %65, label %52, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %52, %45
  %.044.lcssa = phi i32 [ %43, %45 ], [ %.145, %52 ]
  call void @_Z3dfsiii(i32 noundef %29, i32 noundef %43, i32 noundef %.044.lcssa)
  %66 = add nsw i32 %.044.lcssa, 1
  br label %.critedge49

.critedge49:                                      ; preds = %40, %24, %._crit_edge, %.critedge
  %.2 = phi i32 [ %66, %._crit_edge ], [ %43, %.critedge ], [ %.059, %24 ], [ %14, %40 ]
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %68 = call ptr @_ZNSt6vectorISt4pairIciESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %68, ptr %5, align 8
  %69 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIciESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %69, label %24, label %._crit_edge62, !llvm.loop !18

.lr.ph67:                                         ; preds = %.lr.ph67.prol.loopexit, %.lr.ph67
  %indvars.iv73 = phi i64 [ %indvars.iv.next74.3, %.lr.ph67 ], [ %indvars.iv73.unr, %.lr.ph67.prol.loopexit ]
  %70 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv73
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %72
  store i32 %0, ptr %73, align 4, !tbaa !5
  %indvars.iv.next74 = add nsw i64 %indvars.iv73, 1
  %74 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv.next74
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %76
  store i32 %0, ptr %77, align 4, !tbaa !5
  %indvars.iv.next74.1 = add nsw i64 %indvars.iv73, 2
  %78 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv.next74.1
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %80
  store i32 %0, ptr %81, align 4, !tbaa !5
  %indvars.iv.next74.2 = add nsw i64 %indvars.iv73, 3
  %82 = getelementptr inbounds [100001 x i32], ptr @sa, i64 0, i64 %indvars.iv.next74.2
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %84
  store i32 %0, ptr %85, align 4, !tbaa !5
  %indvars.iv.next74.3 = add nsw i64 %indvars.iv73, 4
  %lftr.wideiv76.3 = trunc i64 %indvars.iv.next74.3 to i32
  %exitcond77.not.3 = icmp eq i32 %16, %lftr.wideiv76.3
  br i1 %exitcond77.not.3, label %._crit_edge68, label %.lr.ph67, !llvm.loop !19

._crit_edge68:                                    ; preds = %.lr.ph67.prol.loopexit, %.lr.ph67, %._crit_edge62
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIciESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #2

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = { 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.unroll.disable"}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTSSt4pairIciE", !7, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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