; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan/270.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 }

@G = external dso_local global [500010 x %"class.std::vector"], align 16
@val = external dso_local global [500010 x i32], align 16
@sz = external dso_local global [500010 x i32], align 16
@dp = external dso_local global [500010 x [110 x i64]], align 16
@_ZZ3dfsiE3tmp = external hidden global [110 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
  %14 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %16
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [500010 x %"class.std::vector"], ptr @G, i64 0, i64 %19
  store ptr %20, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %24 = load ptr, ptr %3, align 8, !tbaa !9
  %25 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  br label %27

27:                                               ; preds = %167, %1
  %28 = 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 %28, label %30, label %29

29:                                               ; preds = %27
  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 %169

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

34:                                               ; preds = %56, %30
  %35 = load i32, ptr %8, align 4, !tbaa !5
  %36 = icmp sle i32 %35, 100
  br i1 %36, label %37, label %49

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

49:                                               ; preds = %37, %34
  %50 = phi i1 [ false, %34 ], [ %48, %37 ]
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %49
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %54
  store i64 -1061109567, ptr %55, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %52
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !5
  br label %34, !llvm.loop !13

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

60:                                               ; preds = %121, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = icmp sle i32 %61, 100
  br i1 %62, label %63, label %70

63:                                               ; preds = %60
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp sle i32 %64, %68
  br label %70

70:                                               ; preds = %63, %60
  %71 = phi i1 [ false, %60 ], [ %69, %63 ]
  br i1 %71, label %73, label %72

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

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

74:                                               ; preds = %117, %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %75, %76
  %78 = icmp sle i32 %77, 100
  br i1 %78, label %79, label %86

79:                                               ; preds = %74
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sle i32 %80, %84
  br label %86

86:                                               ; preds = %79, %74
  %87 = phi i1 [ false, %74 ], [ %85, %79 ]
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %86
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = add nsw i32 %90, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [110 x i64], ptr %97, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !11
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %103
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [110 x i64], ptr %104, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = add nsw i64 %101, %108
  store i64 %109, ptr %11, align 8, !tbaa !11
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %111 = load i64, ptr %110, align 8, !tbaa !11
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = add nsw i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %115
  store i64 %111, ptr %116, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %117

117:                                              ; preds = %89
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  br label %74, !llvm.loop !15

120:                                              ; preds = %88
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !16

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

125:                                              ; preds = %154, %124
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = icmp sle i32 %126, 100
  br i1 %127, label %128, label %140

128:                                              ; preds = %125
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %133, %137
  %139 = icmp sle i32 %129, %138
  br label %140

140:                                              ; preds = %128, %125
  %141 = phi i1 [ false, %125 ], [ %139, %128 ]
  br i1 %141, label %143, label %142

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

143:                                              ; preds = %140
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !11
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %149
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [110 x i64], ptr %150, i64 0, i64 %152
  store i64 %147, ptr %153, align 8, !tbaa !11
  br label %154

154:                                              ; preds = %143
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %12, align 4, !tbaa !5
  br label %125, !llvm.loop !17

157:                                              ; preds = %142
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = add nsw i32 %165, %161
  store i32 %166, ptr %164, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %167

167:                                              ; preds = %157
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %27

169:                                              ; preds = %29
  %170 = load i32, ptr %2, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %172, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %175 = load i32, ptr %2, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 100, ptr %14, align 4, !tbaa !5
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %177, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %179 = load i32, ptr %178, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  store i32 %179, ptr %13, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %205, %169
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = icmp sge i32 %181, 1
  br i1 %182, label %184, label %183

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

184:                                              ; preds = %180
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %186
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [110 x i64], ptr %187, i64 0, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !11
  %193 = load i32, ptr %2, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [500010 x i32], ptr @val, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = add nsw i64 %192, %197
  %199 = load i32, ptr %2, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %200
  %202 = load i32, ptr %13, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [110 x i64], ptr %201, i64 0, i64 %203
  store i64 %198, ptr %204, align 8, !tbaa !11
  br label %205

205:                                              ; preds = %184
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = add nsw i32 %206, -1
  store i32 %207, ptr %13, align 4, !tbaa !5
  br label %180, !llvm.loop !18

208:                                              ; preds = %183
  %209 = load i32, ptr %2, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %210
  %212 = getelementptr inbounds [110 x i64], ptr %211, i64 0, i64 0
  store i64 0, ptr %212, 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

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

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 }

@G = external dso_local global [500010 x %"class.std::vector"], align 16
@val = external dso_local local_unnamed_addr global [500010 x i32], align 16
@sz = external dso_local global [500010 x i32], align 16
@dp = external dso_local local_unnamed_addr global [500010 x [110 x i64]], align 16
@_ZZ3dfsiE3tmp = external hidden global [110 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 = alloca i32, align 4
  %6 = sext i32 %0 to i64
  %7 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %6
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds [500010 x %"class.std::vector"], ptr @G, i64 0, i64 %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %9, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %10 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %10, ptr %3, align 8
  %11 = 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) #4
  br i1 %11, label %.lr.ph66, label %._crit_edge

._crit_edge:                                      ; preds = %.critedge6, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %12 = load i32, ptr %7, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 100, ptr %5, align 4, !tbaa !5
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph69, label %._crit_edge70

.lr.ph69:                                         ; preds = %._crit_edge
  %17 = getelementptr inbounds [500010 x i32], ptr @val, i64 0, i64 %6
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = zext nneg i32 %15 to i64
  %min.iters.check114 = icmp ult i32 %15, 4
  br i1 %min.iters.check114, label %scalar.ph113.preheader, label %vector.ph115

scalar.ph113.preheader:                           ; preds = %middle.block112, %.lr.ph69
  %indvars.iv95.ph = phi i64 [ %20, %.lr.ph69 ], [ %ind.end, %middle.block112 ]
  br label %scalar.ph113

vector.ph115:                                     ; preds = %.lr.ph69
  %n.vec117 = and i64 %20, 2147483644
  %ind.end = and i64 %20, 3
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %19, i64 0
  %21 = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %22 = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body119

vector.body119:                                   ; preds = %vector.body119, %vector.ph115
  %index120 = phi i64 [ 0, %vector.ph115 ], [ %index.next126, %vector.body119 ]
  %offset.idx = sub i64 %20, %index120
  %23 = add nsw i64 %offset.idx, -1
  %24 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 -8
  %26 = getelementptr inbounds i8, ptr %24, i64 -24
  %wide.load121 = load <2 x i64>, ptr %25, align 8, !tbaa !9
  %wide.load122 = load <2 x i64>, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %offset.idx
  %28 = getelementptr inbounds i8, ptr %27, i64 -8
  %29 = getelementptr inbounds i8, ptr %27, i64 -24
  %reverse124 = add nsw <2 x i64> %wide.load121, %21
  store <2 x i64> %reverse124, ptr %28, align 8, !tbaa !9
  %reverse125 = add nsw <2 x i64> %wide.load122, %22
  store <2 x i64> %reverse125, ptr %29, align 8, !tbaa !9
  %index.next126 = add nuw i64 %index120, 4
  %30 = icmp eq i64 %index.next126, %n.vec117
  br i1 %30, label %middle.block112, label %vector.body119, !llvm.loop !11

middle.block112:                                  ; preds = %vector.body119
  %cmp.n = icmp eq i64 %n.vec117, %20
  br i1 %cmp.n, label %._crit_edge70, label %scalar.ph113.preheader

.lr.ph66:                                         ; preds = %1, %.critedge6
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %32)
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %32 to i64
  %35 = getelementptr inbounds [500010 x i32], ptr @sz, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, %33
  %smax = call i32 @llvm.smax.i32(i32 %37, i32 -1)
  %38 = add i32 %smax, 1
  %wide.trip.count = zext i32 %38 to i64
  %min.iters.check104 = icmp ult i32 %38, 4
  br i1 %min.iters.check104, label %scalar.ph103.preheader, label %vector.ph105

vector.ph105:                                     ; preds = %.lr.ph66
  %umin101 = call i64 @llvm.umin.i64(i64 %wide.trip.count, i64 100)
  %39 = add nuw nsw i64 %umin101, 1
  %n.mod.vf106 = and i64 %39, 3
  %40 = icmp eq i64 %n.mod.vf106, 0
  %41 = select i1 %40, i64 4, i64 %n.mod.vf106
  %n.vec107 = sub nsw i64 %39, %41
  br label %vector.body109

vector.body109:                                   ; preds = %vector.body109, %vector.ph105
  %index110 = phi i64 [ 0, %vector.ph105 ], [ %index.next111, %vector.body109 ]
  %42 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %index110
  %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.next111 = add nuw i64 %index110, 4
  %44 = icmp eq i64 %index.next111, %n.vec107
  br i1 %44, label %scalar.ph103.preheader, label %vector.body109, !llvm.loop !15

scalar.ph103.preheader:                           ; preds = %vector.body109, %.lr.ph66
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph66 ], [ %n.vec107, %vector.body109 ]
  br label %scalar.ph103

scalar.ph103:                                     ; preds = %scalar.ph103.preheader, %45
  %indvars.iv = phi i64 [ %indvars.iv.next, %45 ], [ %indvars.iv.ph, %scalar.ph103.preheader ]
  %exitcond = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond, label %.critedge.preheader, label %45

45:                                               ; preds = %scalar.ph103
  %46 = getelementptr inbounds [110 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
  %exitcond72.not = icmp eq i64 %indvars.iv.next, 101
  br i1 %exitcond72.not, label %.critedge.preheader, label %scalar.ph103, !llvm.loop !16

.critedge.preheader:                              ; preds = %45, %scalar.ph103
  br label %.critedge

.critedge:                                        ; preds = %.critedge.preheader, %.critedge4
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.critedge4 ], [ 0, %.critedge.preheader ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.critedge4 ], [ 101, %.critedge.preheader ]
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %.not58 = icmp sgt i64 %indvars.iv82, %48
  br i1 %.not58, label %.critedge2, label %.lr.ph

.lr.ph:                                           ; preds = %.critedge
  %49 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %indvars.iv82
  br label %62

.critedge2:                                       ; preds = %.critedge, %.critedge4..critedge2_crit_edge
  %50 = phi i32 [ %.pre, %.critedge4..critedge2_crit_edge ], [ %47, %.critedge ]
  %51 = load i32, ptr %35, align 4, !tbaa !5
  %52 = add nsw i32 %51, %50
  %smax91 = call i32 @llvm.smax.i32(i32 %52, i32 -1)
  %53 = add i32 %smax91, 1
  %wide.trip.count92 = zext i32 %53 to i64
  %min.iters.check = icmp ult i32 %53, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %vector.body, %.critedge2
  %indvars.iv88.ph = phi i64 [ 0, %.critedge2 ], [ %n.vec, %vector.body ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.critedge2
  %umin = call i64 @llvm.umin.i64(i64 %wide.trip.count92, i64 100)
  %54 = add nuw nsw i64 %umin, 1
  %n.mod.vf = and i64 %54, 3
  %55 = icmp eq i64 %n.mod.vf, 0
  %56 = select i1 %55, i64 4, i64 %n.mod.vf
  %n.vec = sub nsw i64 %54, %56
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %57 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %index
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %wide.load = load <2 x i64>, ptr %57, align 16, !tbaa !9
  %wide.load100 = load <2 x i64>, ptr %58, align 16, !tbaa !9
  %59 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %index
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  store <2 x i64> %wide.load, ptr %59, align 16, !tbaa !9
  store <2 x i64> %wide.load100, ptr %60, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %scalar.ph.preheader, label %vector.body, !llvm.loop !17

62:                                               ; preds = %.lr.ph, %65
  %indvars.iv73 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next74, %65 ]
  %63 = load i32, ptr %35, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not60 = icmp sgt i64 %indvars.iv73, %64
  br i1 %.not60, label %.critedge4, label %65

.critedge4:                                       ; preds = %62, %65
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, -1
  %exitcond87.not = icmp eq i64 %indvars.iv.next83, 101
  br i1 %exitcond87.not, label %.critedge4..critedge2_crit_edge, label %.critedge, !llvm.loop !18

.critedge4..critedge2_crit_edge:                  ; preds = %.critedge4
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %.critedge2

65:                                               ; preds = %62
  %66 = add nuw nsw i64 %indvars.iv73, %indvars.iv82
  %67 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %68 = load i64, ptr %49, align 8, !tbaa !9
  %69 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %34, i64 %indvars.iv73
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = add nsw i64 %70, %68
  store i64 %71, ptr %4, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %73 = load i64, ptr %72, align 8, !tbaa !9
  store i64 %73, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next74, %indvars.iv80
  br i1 %exitcond79.not, label %.critedge4, label %62, !llvm.loop !19

scalar.ph:                                        ; preds = %scalar.ph.preheader, %76
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %76 ], [ %indvars.iv88.ph, %scalar.ph.preheader ]
  %exitcond93 = icmp eq i64 %indvars.iv88, %wide.trip.count92
  br i1 %exitcond93, label %.critedge6, label %76

.critedge6:                                       ; preds = %76, %scalar.ph
  store i32 %52, ptr %7, align 4, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %75 = 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) #4
  br i1 %75, label %.lr.ph66, label %._crit_edge

76:                                               ; preds = %scalar.ph
  %77 = getelementptr inbounds [110 x i64], ptr @_ZZ3dfsiE3tmp, i64 0, i64 %indvars.iv88
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %indvars.iv88
  store i64 %78, ptr %79, align 8, !tbaa !9
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next89, 101
  br i1 %exitcond94.not, label %.critedge6, label %scalar.ph, !llvm.loop !20

._crit_edge70:                                    ; preds = %scalar.ph113, %middle.block112, %._crit_edge
  %80 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6
  store i64 0, ptr %80, align 16, !tbaa !9
  ret void

scalar.ph113:                                     ; preds = %scalar.ph113.preheader, %scalar.ph113
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %scalar.ph113 ], [ %indvars.iv95.ph, %scalar.ph113.preheader ]
  %indvars.iv.next96 = add nsw i64 %indvars.iv95, -1
  %81 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %indvars.iv.next96
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = add nsw i64 %82, %19
  %84 = getelementptr inbounds [500010 x [110 x i64]], ptr @dp, i64 0, i64 %6, i64 %indvars.iv95
  store i64 %83, ptr %84, align 8, !tbaa !9
  %85 = icmp ugt i64 %indvars.iv95, 1
  br i1 %85, label %scalar.ph113, label %._crit_edge70, !llvm.loop !21
}

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

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 nosync nounwind speculatable willreturn memory(none) }
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, !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, !13, !14}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !14, !13}
!21 = distinct !{!21, !12, !14, !13}


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