; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan/274.ll (Z5dfs_2i)

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

@m = external dso_local global i32, align 4
@son = external dso_local global [100010 x %"class.std::vector"], align 16
@f = external dso_local global [100010 x i64], align 16
@dp = external dso_local global [100010 x i64], align 16
@res = external dso_local global [100010 x i64], align 16
@_ZZ5dfs_2iE3pre = external hidden global [100010 x i64], align 16
@_ZZ5dfs_2iE3suf = external hidden global [100010 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(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 noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 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 @_Z5dfs_2i(i32 noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %13
  %15 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %3, align 4, !tbaa !5
  store i64 1, ptr @_ZZ5dfs_2iE3pre, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %46, %1
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %49

22:                                               ; preds = %17
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3pre, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %31) #4
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = add nsw i64 %36, 1
  %38 = mul nsw i64 %26, %37
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = srem i64 %38, %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3pre, i64 0, i64 %44
  store i64 %41, ptr %45, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %22
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !11

49:                                               ; preds = %21
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %51
  store i64 1, ptr %52, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sub nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %83, %49
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = icmp sge i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %86

59:                                               ; preds = %55
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %66
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %69) #4
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = add nsw i64 %74, 1
  %76 = mul nsw i64 %64, %75
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = srem i64 %76, %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %81
  store i64 %79, ptr %82, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %59
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %5, align 4, !tbaa !5
  br label %55, !llvm.loop !13

86:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %141, %86
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %144

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %94
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %97) #4
  %99 = load i32, ptr %98, align 4, !tbaa !5
  store i32 %99, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x i64], ptr @dp, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = add nsw i64 %103, 1
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3pre, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = mul nsw i64 %104, %108
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = srem i64 %109, %111
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !9
  %118 = mul nsw i64 %112, %117
  %119 = load i32, ptr @m, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = srem i64 %118, %120
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100010 x i64], ptr @dp, i64 0, i64 %123
  store i64 %121, ptr %124, align 8, !tbaa !9
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100010 x i64], ptr @dp, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = add nsw i64 %128, 1
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !9
  %134 = mul nsw i64 %129, %133
  %135 = load i32, ptr @m, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = srem i64 %134, %136
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100010 x i64], ptr @res, i64 0, i64 %139
  store i64 %137, ptr %140, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %141

141:                                              ; preds = %92
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %6, align 4, !tbaa !5
  br label %87, !llvm.loop !14

144:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %145 = load i32, ptr %2, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %146
  store ptr %147, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %148 = load ptr, ptr %8, align 8, !tbaa !15
  %149 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #4
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %151 = load ptr, ptr %8, align 8, !tbaa !15
  %152 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %151) #4
  %153 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  br label %154

154:                                              ; preds = %161, %144
  %155 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %155, label %157, label %156

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

157:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %158 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %159 = load i32, ptr %158, align 4, !tbaa !5
  store i32 %159, ptr %11, align 4, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !5
  call void @_Z5dfs_2i(i32 noundef %160)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %161

161:                                              ; preds = %157
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br label %154

163:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

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"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


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

@m = external dso_local local_unnamed_addr global i32, align 4
@son = external dso_local global [100010 x %"class.std::vector"], align 16
@f = external dso_local local_unnamed_addr global [100010 x i64], align 16
@dp = external dso_local local_unnamed_addr global [100010 x i64], align 16
@res = external dso_local local_unnamed_addr global [100010 x i64], align 16
@_ZZ5dfs_2iE3pre = external hidden local_unnamed_addr global [100010 x i64], align 16
@_ZZ5dfs_2iE3suf = external hidden local_unnamed_addr global [100010 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(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 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 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 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 @_Z5dfs_2i(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 [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %4
  %6 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %7 = trunc i64 %6 to i32
  store i64 1, ptr @_ZZ5dfs_2iE3pre, align 16, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %1
  %sext53 = shl i64 %6, 32
  %9 = ashr exact i64 %sext53, 32
  %10 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %9
  store i64 1, ptr %10, align 8, !tbaa !5
  br label %._crit_edge40

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = and i64 %6, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %sext = and i64 %6, 2147483647
  %11 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %sext
  store i64 1, ptr %11, align 8, !tbaa !5
  br i1 %8, label %.lr.ph37.preheader, label %._crit_edge40

.lr.ph37.preheader:                               ; preds = %._crit_edge
  %12 = and i64 %6, 2147483647
  %.phi.trans.insert = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %12
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !5
  br label %.lr.ph37

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %13 = phi i64 [ 1, %.lr.ph.preheader ], [ %23, %.lr.ph ]
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #3
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %16
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = add nsw i64 %18, 1
  %20 = mul nsw i64 %19, %13
  %21 = load i32, ptr @m, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = srem i64 %20, %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3pre, i64 0, i64 %indvars.iv.next
  store i64 %23, ptr %24, align 8, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph37
  br i1 %8, label %.lr.ph39, label %._crit_edge40

.lr.ph39:                                         ; preds = %.preheader
  %25 = getelementptr inbounds [100010 x i64], ptr @dp, i64 0, i64 %4
  %wide.trip.count51 = and i64 %6, 2147483647
  br label %42

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %.lr.ph37
  %26 = phi i64 [ %.pre, %.lr.ph37.preheader ], [ %36, %.lr.ph37 ]
  %indvars.iv45 = phi i64 [ %12, %.lr.ph37.preheader ], [ %indvars.iv.next46, %.lr.ph37 ]
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %27 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv.next46) #3
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  %33 = mul nsw i64 %32, %26
  %34 = load i32, ptr @m, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = srem i64 %33, %35
  %37 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %indvars.iv.next46
  store i64 %36, ptr %37, align 8, !tbaa !5
  %38 = icmp ugt i64 %indvars.iv45, 1
  br i1 %38, label %.lr.ph37, label %.preheader, !llvm.loop !13

._crit_edge40:                                    ; preds = %42, %._crit_edge, %._crit_edge.thread, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %39 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %39, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %40 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %40, ptr %3, align 8
  %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) #3
  br i1 %41, label %.lr.ph42, label %._crit_edge43

42:                                               ; preds = %.lr.ph39, %42
  %indvars.iv48 = phi i64 [ 0, %.lr.ph39 ], [ %indvars.iv.next49, %42 ]
  %43 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv48) #3
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = load i64, ptr %25, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  %47 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3pre, i64 0, i64 %indvars.iv48
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = mul nsw i64 %46, %48
  %50 = load i32, ptr @m, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = srem i64 %49, %51
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %53 = getelementptr inbounds [100010 x i64], ptr @_ZZ5dfs_2iE3suf, i64 0, i64 %indvars.iv.next49
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = mul nsw i64 %54, %52
  %56 = srem i64 %55, %51
  %57 = sext i32 %44 to i64
  %58 = getelementptr inbounds [100010 x i64], ptr @dp, i64 0, i64 %57
  store i64 %56, ptr %58, align 8, !tbaa !5
  %59 = add nsw i64 %56, 1
  %60 = getelementptr inbounds [100010 x i64], ptr @f, i64 0, i64 %57
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = mul nsw i64 %61, %59
  %63 = srem i64 %62, %51
  %64 = getelementptr inbounds [100010 x i64], ptr @res, i64 0, i64 %57
  store i64 %63, ptr %64, align 8, !tbaa !5
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge40, label %42, !llvm.loop !14

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret void

.lr.ph42:                                         ; preds = %._crit_edge40, %.lr.ph42
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %66 = load i32, ptr %65, align 4, !tbaa !9
  call void @_Z5dfs_2i(i32 noundef %66)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %68 = 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
  br i1 %68, label %.lr.ph42, label %._crit_edge43
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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