; LLVM IR from tangjz/acm-icpc :: uvalive (6907)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@deg = external dso_local global [101 x i32], align 16
@fa = external dso_local global [101 x i32], align 16
@bri = external dso_local global [101 x [3 x i32]], align 16
@tmp_s = external dso_local global i32, align 4
@tmp_c = external dso_local global i32, align 4
@tmp_t = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@e = external dso_local global [101 x %"class.std::vector"], align 16
@vis = external dso_local global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %216, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %219

16:                                               ; preds = %11
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @deg, i8 0, i64 404, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @fa, i8 -1, i64 404, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @bri, i8 0, i64 1212, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 101, i1 false)
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %27, %16
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %18
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %25
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #6
  br label %27

27:                                               ; preds = %23
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %4, align 4, !tbaa !5
  br label %18, !llvm.loop !9

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

31:                                               ; preds = %74, %30
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %77

36:                                               ; preds = %31
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6, ptr noundef %7)
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %39
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %42
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !5
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = call noundef i32 @_Z4findi(i32 noundef %54)
  store i32 %55, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = call noundef i32 @_Z4findi(i32 noundef %56)
  store i32 %57, ptr %7, align 4, !tbaa !5
  %58 = icmp ne i32 %55, %57
  br i1 %58, label %59, label %73

59:                                               ; preds = %36
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %67, %63
  store i32 %68, ptr %66, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %59, %36
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !5
  br label %31, !llvm.loop !11

77:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %136, %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %139

83:                                               ; preds = %78
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = call noundef i32 @_Z4findi(i32 noundef %84)
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = and i32 %88, 1
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %136

92:                                               ; preds = %83
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = call noundef i32 @_Z4findi(i32 noundef %97)
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sub nsw i32 0, %101
  %103 = sdiv i32 %102, 2
  %104 = icmp eq i32 %96, %103
  br i1 %104, label %105, label %135

105:                                              ; preds = %92
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = call noundef i32 @_Z4findi(i32 noundef %106)
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %108
  %110 = getelementptr inbounds [3 x i32], ptr %109, i64 0, i64 0
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = call noundef i32 @_Z4findi(i32 noundef %113)
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %115
  %117 = getelementptr inbounds [3 x i32], ptr %116, i64 0, i64 0
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp sle i32 %118, 2
  br i1 %119, label %120, label %134

120:                                              ; preds = %105
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = call noundef i32 @_Z4findi(i32 noundef %122)
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = call noundef i32 @_Z4findi(i32 noundef %126)
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %128
  %130 = getelementptr inbounds [3 x i32], ptr %129, i64 0, i64 0
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [3 x i32], ptr %125, i64 0, i64 %132
  store i32 %121, ptr %133, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %120, %105
  br label %135

135:                                              ; preds = %134, %92
  br label %136

136:                                              ; preds = %135, %91
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %8, align 4, !tbaa !5
  br label %78, !llvm.loop !12

139:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %209, %139
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %212

145:                                              ; preds = %140
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = call noundef i32 @_Z4findi(i32 noundef %147)
  %149 = icmp ne i32 %146, %148
  br i1 %149, label %157, label %150

150:                                              ; preds = %145
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %152
  %154 = getelementptr inbounds [3 x i32], ptr %153, i64 0, i64 0
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = icmp ne i32 %155, 2
  br i1 %156, label %157, label %158

157:                                              ; preds = %150, %145
  br label %209

158:                                              ; preds = %150
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %160
  %162 = getelementptr inbounds [3 x i32], ptr %161, i64 0, i64 2
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %164
  store i8 1, ptr %165, align 1, !tbaa !13
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sub nsw i32 0, %169
  %171 = sdiv i32 %170, 2
  store i32 %171, ptr @tmp_s, align 4, !tbaa !5
  store i32 0, ptr @tmp_c, align 4, !tbaa !5
  store i32 1, ptr @tmp_t, align 4, !tbaa !5
  %172 = load i32, ptr %9, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %173
  %175 = getelementptr inbounds [3 x i32], ptr %174, i64 0, i64 1
  %176 = load i32, ptr %175, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %176)
  %177 = load i32, ptr @tmp_s, align 4, !tbaa !5
  %178 = load i32, ptr @tmp_c, align 4, !tbaa !5
  %179 = icmp ne i32 %177, %178
  br i1 %179, label %184, label %180

180:                                              ; preds = %158
  %181 = load i32, ptr @tmp_c, align 4, !tbaa !5
  %182 = load i32, ptr @tmp_t, align 4, !tbaa !5
  %183 = icmp ne i32 %181, %182
  br i1 %183, label %184, label %185

184:                                              ; preds = %180, %158
  br label %209

185:                                              ; preds = %180
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %187
  %189 = getelementptr inbounds [3 x i32], ptr %188, i64 0, i64 2
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %191
  store i8 0, ptr %192, align 1, !tbaa !13
  store i32 0, ptr @tmp_c, align 4, !tbaa !5
  store i32 1, ptr @tmp_t, align 4, !tbaa !5
  %193 = load i32, ptr %9, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %194
  %196 = getelementptr inbounds [3 x i32], ptr %195, i64 0, i64 2
  %197 = load i32, ptr %196, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %197)
  %198 = load i32, ptr @tmp_s, align 4, !tbaa !5
  %199 = load i32, ptr @tmp_t, align 4, !tbaa !5
  %200 = icmp eq i32 %198, %199
  br i1 %200, label %201, label %208

201:                                              ; preds = %185
  %202 = load i32, ptr @tmp_c, align 4, !tbaa !5
  %203 = load i32, ptr @tmp_t, align 4, !tbaa !5
  %204 = icmp eq i32 %202, %203
  br i1 %204, label %205, label %208

205:                                              ; preds = %201
  %206 = load i32, ptr @ans, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr @ans, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %205, %201, %185
  br label %209

209:                                              ; preds = %208, %184, %157
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %9, align 4, !tbaa !5
  br label %140, !llvm.loop !15

212:                                              ; preds = %144
  %213 = load i32, ptr %2, align 4, !tbaa !5
  %214 = load i32, ptr @ans, align 4, !tbaa !5
  %215 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %213, i32 noundef %214)
  br label %216

216:                                              ; preds = %212
  %217 = load i32, ptr %2, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !16

219:                                              ; preds = %15
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @printf(ptr noundef, ...) #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 norecurse 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@deg = external dso_local local_unnamed_addr global [101 x i32], align 16
@fa = external dso_local local_unnamed_addr global [101 x i32], align 16
@bri = external dso_local local_unnamed_addr global [101 x [3 x i32]], align 16
@tmp_s = external dso_local local_unnamed_addr global i32, align 4
@tmp_c = external dso_local local_unnamed_addr global i32, align 4
@tmp_t = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [101 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %.not60 = icmp slt i32 %4, 1
  br i1 %.not60, label %._crit_edge64, label %.lr.ph63

._crit_edge64:                                    ; preds = %._crit_edge59, %0
  ret i32 0

.lr.ph63:                                         ; preds = %0, %._crit_edge59
  %.03161 = phi i32 [ %87, %._crit_edge59 ], [ 1, %0 ]
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @deg, i8 0, i64 404, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @fa, i8 -1, i64 404, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1212) @bri, i8 0, i64 1212, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) @vis, i8 0, i64 101, i1 false)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not3546 = icmp slt i32 %6, 1
  br i1 %.not3546, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph63
  %7 = phi i32 [ %6, %.lr.ph63 ], [ %11, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph50, label %._crit_edge51

.lr.ph:                                           ; preds = %.lr.ph63, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph63 ]
  %10 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not35.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not35.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge51.loopexit:                           ; preds = %43
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.loopexit, %._crit_edge
  %13 = phi i32 [ %.pre, %._crit_edge51.loopexit ], [ %7, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.not3652 = icmp slt i32 %13, 1
  br i1 %.not3652, label %._crit_edge59, label %.lr.ph55

.lr.ph50:                                         ; preds = %._crit_edge, %43
  %.02948 = phi i32 [ %44, %43 ], [ 0, %._crit_edge ]
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %16
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %19
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %23, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = call noundef i32 @_Z4findi(i32 noundef %21)
  store i32 %31, ptr %1, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = call noundef i32 @_Z4findi(i32 noundef %32)
  store i32 %33, ptr %2, align 4, !tbaa !5
  %.not43 = icmp eq i32 %31, %33
  br i1 %.not43, label %43, label %34

34:                                               ; preds = %.lr.ph50
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, %37
  store i32 %42, ptr %40, align 4, !tbaa !5
  store i32 %38, ptr %36, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %.lr.ph50, %34
  %44 = add nuw nsw i32 %.02948, 1
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %.lr.ph50, label %._crit_edge51.loopexit, !llvm.loop !11

.preheader:                                       ; preds = %82
  %.not3756 = icmp slt i32 %83, 1
  br i1 %.not3756, label %._crit_edge59, label %.lr.ph58

.lr.ph55:                                         ; preds = %._crit_edge51, %82
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %82 ], [ 1, %._crit_edge51 ]
  %47 = trunc nuw nsw i64 %indvars.iv66 to i32
  %48 = call noundef i32 @_Z4findi(i32 noundef %47)
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = and i32 %51, 1
  %.not42 = icmp eq i32 %52, 0
  br i1 %.not42, label %53, label %82

53:                                               ; preds = %.lr.ph55
  %54 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %indvars.iv66
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = call noundef i32 @_Z4findi(i32 noundef %47)
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sdiv i32 %59, -2
  %61 = icmp eq i32 %55, %60
  br i1 %61, label %62, label %82

62:                                               ; preds = %53
  %63 = call noundef i32 @_Z4findi(i32 noundef %47)
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = call noundef i32 @_Z4findi(i32 noundef %47)
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 3
  br i1 %72, label %73, label %82

73:                                               ; preds = %62
  %74 = call noundef i32 @_Z4findi(i32 noundef %47)
  %75 = sext i32 %74 to i64
  %76 = call noundef i32 @_Z4findi(i32 noundef %47)
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %75, i64 %80
  store i32 %47, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %53, %73, %62, %.lr.ph55
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %.not36.not = icmp slt i64 %indvars.iv66, %84
  br i1 %.not36.not, label %.lr.ph55, label %.preheader, !llvm.loop !12

._crit_edge59:                                    ; preds = %120, %._crit_edge51, %.preheader
  %85 = load i32, ptr @ans, align 4, !tbaa !5
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.03161, i32 noundef %85)
  %87 = add nuw nsw i32 %.03161, 1
  %88 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03161, %88
  br i1 %.not.not, label %.lr.ph63, label %._crit_edge64, !llvm.loop !13

.lr.ph58:                                         ; preds = %.preheader, %120
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %120 ], [ 1, %.preheader ]
  %89 = trunc nuw nsw i64 %indvars.iv69 to i32
  %90 = call noundef i32 @_Z4findi(i32 noundef %89)
  %91 = zext i32 %90 to i64
  %.not38 = icmp eq i64 %indvars.iv69, %91
  br i1 %.not38, label %92, label %120

92:                                               ; preds = %.lr.ph58
  %93 = getelementptr inbounds [101 x [3 x i32]], ptr @bri, i64 0, i64 %indvars.iv69
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %.not39 = icmp eq i32 %94, 2
  br i1 %.not39, label %95, label %120

95:                                               ; preds = %92
  %96 = getelementptr inbounds i8, ptr %93, i64 8
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %98
  store i8 1, ptr %99, align 1, !tbaa !14
  %100 = getelementptr inbounds [101 x i32], ptr @fa, i64 0, i64 %indvars.iv69
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sdiv i32 %101, -2
  store i32 %102, ptr @tmp_s, align 4, !tbaa !5
  store i32 0, ptr @tmp_c, align 4, !tbaa !5
  store i32 1, ptr @tmp_t, align 4, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %93, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %104)
  %105 = load i32, ptr @tmp_s, align 4, !tbaa !5
  %106 = load i32, ptr @tmp_c, align 4, !tbaa !5
  %.not40 = icmp eq i32 %105, %106
  %107 = load i32, ptr @tmp_t, align 4
  %.not41 = icmp eq i32 %106, %107
  %or.cond = select i1 %.not40, i1 %.not41, i1 false
  br i1 %or.cond, label %108, label %120

108:                                              ; preds = %95
  %109 = load i32, ptr %96, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %110
  store i8 0, ptr %111, align 1, !tbaa !14
  store i32 0, ptr @tmp_c, align 4, !tbaa !5
  store i32 1, ptr @tmp_t, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %109)
  %112 = load i32, ptr @tmp_s, align 4, !tbaa !5
  %113 = load i32, ptr @tmp_t, align 4, !tbaa !5
  %114 = icmp eq i32 %112, %113
  %115 = load i32, ptr @tmp_c, align 4
  %116 = icmp eq i32 %115, %113
  %or.cond45 = select i1 %114, i1 %116, i1 false
  br i1 %or.cond45, label %117, label %120

117:                                              ; preds = %108
  %118 = load i32, ptr @ans, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr @ans, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %108, %117, %95, %.lr.ph58, %92
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %.not37.not = icmp slt i64 %indvars.iv69, %122
  br i1 %.not37.not, label %.lr.ph58, label %._crit_edge59, !llvm.loop !16
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { nofree nounwind "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}


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