; LLVM IR from Tunghohin/Competitive_Coding :: Nowcoder/28260_D.ll (Z3dfsi)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@dp = external dso_local global [310 x [310 x i64]], align 16
@val = external dso_local global [310 x i32], align 16
@sz = external dso_local global [310 x i32], align 16
@G = external dso_local global [310 x %"class.std::vector"], align 16
@_ZZ3dfsiE3tmp = external hidden global [310 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %15
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [310 x %"class.std::vector"], ptr @G, i64 0, i64 %18
  store ptr %19, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %20 = load ptr, ptr %3, align 8, !tbaa !9
  %21 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %22 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %21, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !9
  %24 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  br label %26

26:                                               ; preds = %144, %1
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %50, %29
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %38, %42
  %44 = icmp sle i32 %34, %43
  br i1 %44, label %46, label %45

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

46:                                               ; preds = %33
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %48
  store i64 -1061109567, ptr %49, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %8, align 4, !tbaa !5
  br label %33, !llvm.loop !13

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %103, %53
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp sle i32 %55, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %99, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp sle i32 %64, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %63
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %102

71:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [310 x i64], ptr %74, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [310 x i64], ptr %81, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !11
  %86 = add nsw i64 %78, %85
  store i64 %86, ptr %11, align 8, !tbaa !11
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = add nsw i32 %87, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %90
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %91)
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %97
  store i64 %93, ptr %98, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %99

99:                                               ; preds = %71
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %10, align 4, !tbaa !5
  br label %63, !llvm.loop !15

102:                                              ; preds = %70
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %9, align 4, !tbaa !5
  br label %54, !llvm.loop !16

106:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %131, %106
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = add nsw i32 %112, %116
  %118 = icmp sle i32 %108, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %107
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %134

120:                                              ; preds = %107
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !11
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %126
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [310 x i64], ptr %127, i64 0, i64 %129
  store i64 %124, ptr %130, align 8, !tbaa !11
  br label %131

131:                                              ; preds = %120
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %12, align 4, !tbaa !5
  br label %107, !llvm.loop !17

134:                                              ; preds = %119
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, %138
  store i32 %143, ptr %141, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %144

144:                                              ; preds = %134
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %26

146:                                              ; preds = %28
  %147 = load i32, ptr %2, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %149, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %13, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %181, %146
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = icmp sge i32 %157, 1
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  store i32 16, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %184

160:                                              ; preds = %156
  %161 = load i32, ptr %2, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %162
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [310 x i64], ptr %163, i64 0, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !11
  %169 = load i32, ptr %2, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [310 x i32], ptr @val, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = add nsw i64 %168, %173
  %175 = load i32, ptr %2, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %176
  %178 = load i32, ptr %13, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [310 x i64], ptr %177, i64 0, i64 %179
  store i64 %174, ptr %180, align 8, !tbaa !11
  br label %181

181:                                              ; preds = %160
  %182 = load i32, ptr %13, align 4, !tbaa !5
  %183 = add nsw i32 %182, -1
  store i32 %183, ptr %13, align 4, !tbaa !5
  br label %156, !llvm.loop !18

184:                                              ; preds = %159
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %186
  %188 = getelementptr inbounds [310 x i64], ptr %187, i64 0, i64 0
  store i64 0, ptr %188, align 16, !tbaa !11
  ret void
}

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

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

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@dp = external dso_local local_unnamed_addr global [310 x [310 x i64]], align 16
@val = external dso_local local_unnamed_addr global [310 x i32], align 16
@sz = external dso_local local_unnamed_addr global [310 x i32], align 16
@G = external dso_local global [310 x %"class.std::vector"], align 16
@_ZZ3dfsiE3tmp = external hidden global [310 x i64], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca i64, align 8
  %5 = sext i32 %0 to i64
  %6 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %5
  store i32 0, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds [310 x %"class.std::vector"], ptr @G, i64 0, i64 %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %8 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %8, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %9, ptr %3, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %10, label %.lr.ph71.preheader, label %._crit_edge72

.lr.ph71.preheader:                               ; preds = %1
  %11 = mul nsw i64 %5, 2480
  %scevgep = getelementptr i8, ptr @dp, i64 %11
  br label %.lr.ph71

._crit_edge72:                                    ; preds = %._crit_edge68, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %12 = load i32, ptr %6, align 4, !tbaa !5
  %13 = add i32 %12, 1
  store i32 %13, ptr %6, align 4, !tbaa !5
  %14 = icmp sgt i32 %12, -1
  br i1 %14, label %.lr.ph75, label %._crit_edge76

.lr.ph75:                                         ; preds = %._crit_edge72
  %15 = getelementptr inbounds [310 x i32], ptr @val, i64 0, i64 %5
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = zext i32 %13 to i64
  %19 = add nuw i32 %12, 1
  %smin = call i32 @llvm.smin.i32(i32 %13, i32 1)
  %20 = sub i32 %19, %smin
  %21 = zext i32 %20 to i64
  %22 = add nuw nsw i64 %21, 1
  %min.iters.check98 = icmp ult i32 %20, 3
  br i1 %min.iters.check98, label %scalar.ph97.preheader, label %vector.ph99

scalar.ph97.preheader:                            ; preds = %middle.block96, %.lr.ph75
  %indvars.iv88.ph = phi i64 [ %18, %.lr.ph75 ], [ %ind.end, %middle.block96 ]
  br label %scalar.ph97

vector.ph99:                                      ; preds = %.lr.ph75
  %n.vec101 = and i64 %22, 8589934588
  %ind.end = sub nsw i64 %18, %n.vec101
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %17, i64 0
  %23 = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %24 = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body103

vector.body103:                                   ; preds = %vector.body103, %vector.ph99
  %index104 = phi i64 [ 0, %vector.ph99 ], [ %index.next109, %vector.body103 ]
  %offset.idx = sub i64 %18, %index104
  %25 = add nsw i64 %offset.idx, -1
  %26 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 -8
  %28 = getelementptr inbounds i8, ptr %26, i64 -24
  %wide.load = load <2 x i64>, ptr %27, align 8, !tbaa !9
  %wide.load105 = load <2 x i64>, ptr %28, align 8, !tbaa !9
  %29 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5, i64 %offset.idx
  %30 = getelementptr inbounds i8, ptr %29, i64 -8
  %31 = getelementptr inbounds i8, ptr %29, i64 -24
  %reverse107 = add nsw <2 x i64> %wide.load, %23
  store <2 x i64> %reverse107, ptr %30, align 8, !tbaa !9
  %reverse108 = add nsw <2 x i64> %wide.load105, %24
  store <2 x i64> %reverse108, ptr %31, align 8, !tbaa !9
  %index.next109 = add nuw i64 %index104, 4
  %32 = icmp eq i64 %index.next109, %n.vec101
  br i1 %32, label %middle.block96, label %vector.body103, !llvm.loop !11

middle.block96:                                   ; preds = %vector.body103
  %cmp.n110 = icmp eq i64 %22, %n.vec101
  br i1 %cmp.n110, label %._crit_edge76, label %scalar.ph97.preheader

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %._crit_edge68
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %34 = load i32, ptr %33, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %34)
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = sext i32 %34 to i64
  %37 = getelementptr inbounds [310 x i32], ptr @sz, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %35
  %.not56 = icmp slt i32 %39, 0
  br i1 %.not56, label %.preheader51, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph71
  %40 = add i32 %38, 1
  %41 = add i32 %40, %35
  %wide.trip.count = zext i32 %41 to i64
  %min.iters.check = icmp ult i32 %41, 4
  br i1 %min.iters.check, label %.lr.ph.preheader111, label %vector.ph

.lr.ph.preheader111:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 4294967292
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %42 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %index
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <2 x i64> <i64 -1061109567, i64 -1061109567>, ptr %42, align 16, !tbaa !9
  store <2 x i64> <i64 -1061109567, i64 -1061109567>, ptr %43, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %44 = icmp eq i64 %index.next, %n.vec
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader51, label %.lr.ph.preheader111

.preheader51:                                     ; preds = %.lr.ph, %middle.block, %.lr.ph71
  %45 = or i32 %35, %38
  %or.cond.not = icmp sgt i32 %45, -1
  br i1 %or.cond.not, label %.preheader, label %.preheader50

.lr.ph:                                           ; preds = %.lr.ph.preheader111, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader111 ]
  %46 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %indvars.iv
  store i64 -1061109567, ptr %46, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader51, label %.lr.ph, !llvm.loop !16

.preheader50.loopexit77:                          ; preds = %._crit_edge
  %.pre91 = add nsw i32 %56, %55
  br label %.preheader50

.preheader50:                                     ; preds = %.preheader50.loopexit77, %.preheader51
  %.pre-phi = phi i32 [ %.pre91, %.preheader50.loopexit77 ], [ %39, %.preheader51 ]
  %47 = phi i32 [ %56, %.preheader50.loopexit77 ], [ %38, %.preheader51 ]
  %.lcssa53 = phi i32 [ %55, %.preheader50.loopexit77 ], [ %35, %.preheader51 ]
  %.not4865 = icmp slt i32 %.pre-phi, 0
  br i1 %.not4865, label %._crit_edge68, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %.preheader50
  %48 = add i32 %.lcssa53, 1
  %49 = add i32 %48, %47
  %50 = zext i32 %49 to i64
  %51 = shl nuw nsw i64 %50, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep, ptr nonnull align 16 @_ZZ3dfsiE3tmp, i64 %51, i1 false), !tbaa !9
  br label %._crit_edge68

.preheader:                                       ; preds = %.preheader51, %._crit_edge
  %52 = phi i32 [ %55, %._crit_edge ], [ %35, %.preheader51 ]
  %53 = phi i32 [ %56, %._crit_edge ], [ %38, %.preheader51 ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %._crit_edge ], [ 0, %.preheader51 ]
  %.not4959 = icmp slt i32 %53, 0
  br i1 %.not4959, label %._crit_edge, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader
  %54 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5, i64 %indvars.iv82
  br label %58

._crit_edge.loopexit:                             ; preds = %58
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %55 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %52, %.preheader ]
  %56 = phi i32 [ %67, %._crit_edge.loopexit ], [ %53, %.preheader ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %57 = sext i32 %55 to i64
  %.not47.not = icmp slt i64 %indvars.iv82, %57
  br i1 %.not47.not, label %.preheader, label %.preheader50.loopexit77, !llvm.loop !17

58:                                               ; preds = %.lr.ph61, %58
  %indvars.iv79 = phi i64 [ 0, %.lr.ph61 ], [ %indvars.iv.next80, %58 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %59 = load i64, ptr %54, align 8, !tbaa !9
  %60 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %36, i64 %indvars.iv79
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = add nsw i64 %61, %59
  store i64 %62, ptr %4, align 8, !tbaa !9
  %63 = add nuw nsw i64 %indvars.iv79, %indvars.iv82
  %64 = getelementptr inbounds [310 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %64)
  %66 = load i64, ptr %65, align 8, !tbaa !9
  store i64 %66, ptr %64, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %67 = load i32, ptr %37, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %.not49.not = icmp slt i64 %indvars.iv79, %68
  br i1 %.not49.not, label %58, label %._crit_edge.loopexit, !llvm.loop !19

._crit_edge68:                                    ; preds = %.lr.ph67.preheader, %.preheader50
  store i32 %.pre-phi, ptr %6, align 4, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %70 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %70, label %.lr.ph71, label %._crit_edge72

._crit_edge76:                                    ; preds = %scalar.ph97, %middle.block96, %._crit_edge72
  %71 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5
  store i64 0, ptr %71, align 16, !tbaa !9
  ret void

scalar.ph97:                                      ; preds = %scalar.ph97.preheader, %scalar.ph97
  %indvars.iv88 = phi i64 [ %72, %scalar.ph97 ], [ %indvars.iv88.ph, %scalar.ph97.preheader ]
  %72 = add nsw i64 %indvars.iv88, -1
  %73 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = add nsw i64 %74, %17
  %76 = getelementptr inbounds [310 x [310 x i64]], ptr @dp, i64 0, i64 %5, i64 %indvars.iv88
  store i64 %75, ptr %76, align 8, !tbaa !9
  %77 = trunc nuw i64 %indvars.iv88 to i32
  %78 = icmp sgt i32 %77, 1
  br i1 %78, label %scalar.ph97, label %._crit_edge76, !llvm.loop !20
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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 #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(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 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !13, !14}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !14, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass