; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-16/O.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 }

@m = external dso_local global i32, align 4
@f = external dso_local global [1001 x [201 x i32]], align 16
@g = external dso_local global [1001 x [201 x i32]], align 16
@e = external dso_local global [1001 x %"class.std::vector"], align 16
@vis = external dso_local global [1001 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [1001 x i8], ptr @vis, i64 0, i64 %13
  store i8 1, ptr %14, align 1, !tbaa !9
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @e, i64 0, i64 %16
  %18 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = icmp eq i64 %18, 1
  br i1 %19, label %20, label %24

20:                                               ; preds = %1
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 1
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  br label %227

24:                                               ; preds = %20, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @e, i64 0, i64 %26
  %28 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #4
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  br label %30

30:                                               ; preds = %155, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @e, i64 0, i64 %32
  %34 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #4
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %30
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1001 x i8], ptr @vis, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !9, !range !11, !noundef !12
  %44 = trunc i8 %43 to i1
  br i1 %44, label %154, label %45

45:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  store ptr %46, ptr %6, align 8, !tbaa !13
  %47 = load ptr, ptr %6, align 8, !tbaa !13
  %48 = load i32, ptr %47, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %48)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %49 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %49, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %150, %45
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = icmp sge i32 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %153

54:                                               ; preds = %50
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %56
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [201 x i32], ptr %57, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !13
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %64
  %66 = getelementptr inbounds [201 x i32], ptr %65, i64 0, i64 0
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %61, %67
  br i1 %68, label %69, label %82

69:                                               ; preds = %54
  %70 = load ptr, ptr %6, align 8, !tbaa !13
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %72
  %74 = getelementptr inbounds [201 x i32], ptr %73, i64 0, i64 0
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %77
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [201 x i32], ptr %78, i64 0, i64 %80
  store i32 %75, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %69, %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %146, %82
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %149

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %90
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sub nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [201 x i32], ptr %91, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load ptr, ptr %6, align 8, !tbaa !13
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [201 x i32], ptr %101, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = icmp slt i32 %97, %105
  br i1 %106, label %107, label %117

107:                                              ; preds = %88
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sub nsw i32 %111, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [201 x i32], ptr %110, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  br label %126

117:                                              ; preds = %88
  %118 = load ptr, ptr %6, align 8, !tbaa !13
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %120
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [201 x i32], ptr %121, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %117, %107
  %127 = phi i32 [ %116, %107 ], [ %125, %117 ]
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %129
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [201 x i32], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %145

137:                                              ; preds = %126
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %140
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [201 x i32], ptr %141, i64 0, i64 %143
  store i32 %138, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %137, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %8, align 4, !tbaa !5
  br label %83, !llvm.loop !15

149:                                              ; preds = %87
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !17

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

154:                                              ; preds = %153, %38
  br label %155

155:                                              ; preds = %154
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br label %30, !llvm.loop !18

157:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %158 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %158, ptr %10, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %224, %157
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = icmp sge i32 %160, 0
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %227

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %220, %163
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = load i32, ptr %10, align 4, !tbaa !5
  %167 = icmp sle i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %223

169:                                              ; preds = %164
  %170 = load i32, ptr %2, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [201 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %2, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %178
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = sub nsw i32 %180, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [201 x i32], ptr %179, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = load i32, ptr %2, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %187
  %189 = load i32, ptr %11, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [201 x i32], ptr %188, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = add nsw i32 %185, %192
  %194 = icmp slt i32 %176, %193
  br i1 %194, label %195, label %219

195:                                              ; preds = %169
  %196 = load i32, ptr %2, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %197
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = load i32, ptr %11, align 4, !tbaa !5
  %201 = sub nsw i32 %199, %200
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [201 x i32], ptr %198, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = load i32, ptr %2, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %206
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [201 x i32], ptr %207, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = add nsw i32 %204, %211
  %213 = load i32, ptr %2, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %214
  %216 = load i32, ptr %10, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [201 x i32], ptr %215, i64 0, i64 %217
  store i32 %212, ptr %218, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %195, %169
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %11, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %11, align 4, !tbaa !5
  br label %164, !llvm.loop !19

223:                                              ; preds = %168
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %10, align 4, !tbaa !5
  %226 = add nsw i32 %225, -1
  store i32 %226, ptr %10, align 4, !tbaa !5
  br label %159, !llvm.loop !20

227:                                              ; preds = %162, %23
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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: 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

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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
@f = external dso_local local_unnamed_addr global [1001 x [201 x i32]], align 16
@g = external dso_local local_unnamed_addr global [1001 x [201 x i32]], align 16
@e = external dso_local global [1001 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [1001 x i8], 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 = sext i32 %0 to i64
  %5 = getelementptr inbounds [1001 x i8], ptr @vis, i64 0, i64 %4
  store i8 1, ptr %5, align 1, !tbaa !5
  %6 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @e, i64 0, i64 %4
  %7 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %8 = icmp eq i64 %7, 1
  %9 = icmp ne i32 %0, 1
  %or.cond = and i1 %9, %8
  br i1 %or.cond, label %.loopexit, label %10

10:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %11 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  store ptr %11, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %12 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  store ptr %12, ptr %3, align 8
  %13 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %13, label %.lr.ph68, label %._crit_edge69

._crit_edge69:                                    ; preds = %.loopexit61, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %14 = load i32, ptr @m, align 4, !tbaa !9
  %15 = icmp sgt i32 %14, -1
  br i1 %15, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %._crit_edge69
  %16 = add nuw i32 %14, 1
  %17 = zext i32 %16 to i64
  %18 = zext nneg i32 %14 to i64
  %19 = zext nneg i32 %14 to i64
  br label %.preheader

.lr.ph68:                                         ; preds = %10, %.loopexit61
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [1001 x i8], ptr @vis, i64 0, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !5, !range !11, !noundef !12
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %.loopexit61, label %26

26:                                               ; preds = %.lr.ph68
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %28 = load i32, ptr %27, align 4, !tbaa !9
  call void @_Z3dfsi(i32 noundef %28)
  %29 = load i32, ptr @m, align 4, !tbaa !9
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %.lr.ph66.preheader, label %.loopexit61

.lr.ph66.preheader:                               ; preds = %26
  %31 = add nuw i32 %29, 1
  %32 = zext i32 %31 to i64
  %33 = zext nneg i32 %29 to i64
  br label %.lr.ph66

.lr.ph66:                                         ; preds = %._crit_edge, %.lr.ph66.preheader
  %indvars.iv77 = phi i64 [ %33, %.lr.ph66.preheader ], [ %indvars.iv.next78, %._crit_edge ]
  %indvars.iv75 = phi i64 [ %32, %.lr.ph66.preheader ], [ %indvars.iv.next76, %._crit_edge ]
  %34 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %4, i64 %indvars.iv77
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = load i32, ptr %27, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = icmp sgt i32 %35, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %.lr.ph66
  store i32 %39, ptr %34, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %41, %.lr.ph66
  %43 = phi i32 [ %39, %41 ], [ %35, %.lr.ph66 ]
  %.not6062 = icmp slt i64 %indvars.iv77, 1
  br i1 %.not6062, label %.loopexit61, label %.lr.ph

._crit_edge:                                      ; preds = %54
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, -1
  %indvars.iv.next76 = add nsw i64 %indvars.iv75, -1
  br label %.lr.ph66, !llvm.loop !13

.lr.ph:                                           ; preds = %42, %54
  %44 = phi i32 [ %55, %54 ], [ %43, %42 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %54 ], [ 1, %42 ]
  %45 = sub nsw i64 %indvars.iv77, %indvars.iv
  %46 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %4, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = load i32, ptr %27, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %49, i64 %indvars.iv
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %. = call i32 @llvm.smin.i32(i32 %47, i32 %51)
  %52 = icmp slt i32 %44, %.
  br i1 %52, label %53, label %54

53:                                               ; preds = %.lr.ph
  store i32 %., ptr %34, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %53, %.lr.ph
  %55 = phi i32 [ %., %53 ], [ %44, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv75
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

.loopexit61:                                      ; preds = %42, %26, %.lr.ph68
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %57 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  store ptr %57, ptr %3, align 8
  %58 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %58, label %.lr.ph68, label %._crit_edge69, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %.epilog-lcssa
  %indvar = phi i64 [ 0, %.preheader.preheader ], [ %indvar.next, %.epilog-lcssa ]
  %indvars.iv90 = phi i64 [ %18, %.preheader.preheader ], [ %indvars.iv.next91, %.epilog-lcssa ]
  %indvars.iv88 = phi i64 [ %17, %.preheader.preheader ], [ %indvars.iv.next89, %.epilog-lcssa ]
  %59 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %4, i64 %indvars.iv90
  %.promoted = load i32, ptr %59, align 4, !tbaa !9
  %xtraiter = and i64 %indvars.iv88, 1
  %60 = icmp eq i64 %indvar, %19
  br i1 %60, label %.unr-lcssa, label %.preheader.new

.preheader.new:                                   ; preds = %.preheader
  %unroll_iter = and i64 %indvars.iv88, -2
  br label %70

.unr-lcssa:                                       ; preds = %90, %.preheader
  %indvars.iv82.unr = phi i64 [ 0, %.preheader ], [ %indvars.iv.next83.1, %90 ]
  %.unr = phi i32 [ %.promoted, %.preheader ], [ %91, %90 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa
  %61 = sub nsw i64 %indvars.iv90, %indvars.iv82.unr
  %62 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %4, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %4, i64 %indvars.iv82.unr
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = add nsw i32 %65, %63
  %67 = icmp slt i32 %.unr, %66
  br i1 %67, label %68, label %.epilog-lcssa

68:                                               ; preds = %.epil.preheader
  store i32 %66, ptr %59, align 4, !tbaa !9
  br label %.epilog-lcssa

.epilog-lcssa:                                    ; preds = %.epil.preheader, %68, %.unr-lcssa
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, -1
  %69 = icmp sgt i64 %indvars.iv90, 0
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
  %indvar.next = add i64 %indvar, 1
  br i1 %69, label %.preheader, label %.loopexit, !llvm.loop !17

70:                                               ; preds = %90, %.preheader.new
  %indvars.iv82 = phi i64 [ 0, %.preheader.new ], [ %indvars.iv.next83.1, %90 ]
  %71 = phi i32 [ %.promoted, %.preheader.new ], [ %91, %90 ]
  %niter = phi i64 [ 0, %.preheader.new ], [ %niter.next.1, %90 ]
  %72 = sub nsw i64 %indvars.iv90, %indvars.iv82
  %73 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %4, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %4, i64 %indvars.iv82
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = add nsw i32 %76, %74
  %78 = icmp slt i32 %71, %77
  br i1 %78, label %79, label %80

79:                                               ; preds = %70
  store i32 %77, ptr %59, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %70, %79
  %81 = phi i32 [ %71, %70 ], [ %77, %79 ]
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %82 = sub nsw i64 %indvars.iv90, %indvars.iv.next83
  %83 = getelementptr inbounds [1001 x [201 x i32]], ptr @f, i64 0, i64 %4, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = getelementptr inbounds [1001 x [201 x i32]], ptr @g, i64 0, i64 %4, i64 %indvars.iv.next83
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = add nsw i32 %86, %84
  %88 = icmp slt i32 %81, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %80
  store i32 %87, ptr %59, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %89, %80
  %91 = phi i32 [ %81, %80 ], [ %87, %89 ]
  %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.unr-lcssa, label %70, !llvm.loop !18

.loopexit:                                        ; preds = %.epilog-lcssa, %._crit_edge69, %1
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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: 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 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 nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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