; LLVM IR from tangjz/acm-icpc :: codeforces/gym (103957H)

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

@bits = external dso_local global [16385 x i32], align 16
@tr = external dso_local global [16385 x %"class.std::vector"], align 16
@t = external dso_local global i32, align 4
@seq = external dso_local global [15 x i32], align 16
@typ = external dso_local global [16385 x i32], align 16
@val = external dso_local global [16385 x i32], align 16
@buf = external dso_local global [3 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL5score = external hidden constant [2 x [10 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4scanPc(ptr 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 uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 16383, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %79, %0
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %82

32:                                               ; preds = %27
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = ashr i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = and i32 %38, 1
  %40 = add nsw i32 %37, %39
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp eq i32 %47, 9
  br i1 %48, label %49, label %78

49:                                               ; preds = %32
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %51
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = and i32 %54, %55
  store i32 %56, ptr %5, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %72, %49
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %57
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, 4
  br i1 %66, label %67, label %71

67:                                               ; preds = %61
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %69
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %71

71:                                               ; preds = %67, %61
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = and i32 %74, %75
  store i32 %76, ptr %5, align 4, !tbaa !5
  br label %57, !llvm.loop !9

77:                                               ; preds = %60
  br label %78

78:                                               ; preds = %77, %32
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !11

82:                                               ; preds = %31
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %271, %82
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr @t, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %274

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

90:                                               ; preds = %100, %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = icmp slt i32 %91, 14
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %103

94:                                               ; preds = %90
  %95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @buf)
  %96 = call noundef i32 @_Z4scanPc(ptr noundef @buf)
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [15 x i32], ptr @seq, i64 0, i64 %98
  store i32 %96, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %94
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !12

103:                                              ; preds = %93
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @seq, ptr noundef getelementptr inbounds (i32, ptr @seq, i64 14))
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %105
  store ptr %106, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %107 = load ptr, ptr %9, align 8, !tbaa !13
  %108 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #7
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %110 = load ptr, ptr %9, align 8, !tbaa !13
  %111 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #7
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  br label %113

113:                                              ; preds = %265, %103
  %114 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %114, label %116, label %115

115:                                              ; preds = %113
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %267

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  store ptr %117, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = load ptr, ptr %12, align 8, !tbaa !13
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sub nsw i32 %118, %120
  store i32 %121, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10 x i32], ptr @_ZL5score, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  store i32 %128, ptr %14, align 4, !tbaa !5
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [10 x i32], ptr getelementptr inbounds ([2 x [10 x i32]], ptr @_ZL5score, i64 0, i64 1), i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = add nsw i32 %129, %136
  %138 = add nsw i32 %137, 22
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %141, label %142

141:                                              ; preds = %116
  store i32 15, ptr %4, align 4
  br label %259

142:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %143 = load ptr, ptr %12, align 8, !tbaa !13
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %145
  store ptr %146, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %147 = load ptr, ptr %15, align 8, !tbaa !13
  %148 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %147) #7
  %149 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %150 = load ptr, ptr %15, align 8, !tbaa !13
  %151 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %150) #7
  %152 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  br label %153

153:                                              ; preds = %256, %142
  %154 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %154, label %156, label %155

155:                                              ; preds = %153
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %258

156:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  store ptr %157, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %158 = load ptr, ptr %12, align 8, !tbaa !13
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = load ptr, ptr %18, align 8, !tbaa !13
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = sub nsw i32 %159, %161
  store i32 %162, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = load i32, ptr %19, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [10 x i32], ptr getelementptr inbounds ([2 x [10 x i32]], ptr @_ZL5score, i64 0, i64 1), i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = add nsw i32 %163, %170
  store i32 %171, ptr %20, align 4, !tbaa !5
  %172 = call noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %19)
  br i1 %172, label %178, label %173

173:                                              ; preds = %156
  %174 = load i32, ptr %20, align 4, !tbaa !5
  %175 = add nsw i32 %174, 22
  %176 = load i32, ptr %8, align 4, !tbaa !5
  %177 = icmp sle i32 %175, %176
  br i1 %177, label %178, label %179

178:                                              ; preds = %173, %156
  store i32 17, ptr %4, align 4
  br label %250

179:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %180 = load ptr, ptr %18, align 8, !tbaa !13
  %181 = load i32, ptr %180, align 4, !tbaa !5
  store i32 %181, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %182 = load i32, ptr %21, align 4, !tbaa !5
  %183 = load i32, ptr %21, align 4, !tbaa !5
  %184 = sub nsw i32 0, %183
  %185 = and i32 %182, %184
  store i32 %185, ptr %22, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %241, %179
  %187 = load i32, ptr %21, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %190, label %189

189:                                              ; preds = %186
  store i32 18, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %249

190:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %191 = load ptr, ptr %18, align 8, !tbaa !13
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = load i32, ptr %22, align 4, !tbaa !5
  %194 = sub nsw i32 %192, %193
  store i32 %194, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %195 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %195, ptr %24, align 4, !tbaa !5
  %196 = call noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %23)
  br i1 %196, label %197, label %198

197:                                              ; preds = %190
  store i32 20, ptr %4, align 4
  br label %238

198:                                              ; preds = %190
  %199 = load i32, ptr %23, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = icmp eq i32 %202, 3
  br i1 %203, label %204, label %213

204:                                              ; preds = %198
  %205 = load i32, ptr %23, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [16385 x i32], ptr @val, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = ashr i32 %208, 8
  %210 = add nsw i32 %209, 9
  %211 = load i32, ptr %24, align 4, !tbaa !5
  %212 = add nsw i32 %211, %210
  store i32 %212, ptr %24, align 4, !tbaa !5
  br label %231

213:                                              ; preds = %198
  %214 = load i32, ptr %23, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = icmp eq i32 %217, 1
  br i1 %218, label %219, label %230

219:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %220 = load i32, ptr %23, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [16385 x i32], ptr @val, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = ashr i32 %223, 12
  %225 = sub nsw i32 %224, 3
  store i32 %225, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load i32, ptr %24, align 4, !tbaa !5
  %229 = add nsw i32 %228, %227
  store i32 %229, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %230

230:                                              ; preds = %219, %213
  br label %231

231:                                              ; preds = %230, %204
  %232 = load i32, ptr %8, align 4, !tbaa !5
  %233 = load i32, ptr %24, align 4, !tbaa !5
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %235, label %237

235:                                              ; preds = %231
  %236 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %236, ptr %8, align 4, !tbaa !5
  br label %237

237:                                              ; preds = %235, %231
  store i32 0, ptr %4, align 4
  br label %238

238:                                              ; preds = %237, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  %239 = load i32, ptr %4, align 4
  switch i32 %239, label %276 [
    i32 0, label %240
    i32 20, label %241
  ]

240:                                              ; preds = %238
  br label %241

241:                                              ; preds = %240, %238
  %242 = load i32, ptr %22, align 4, !tbaa !5
  %243 = load i32, ptr %21, align 4, !tbaa !5
  %244 = sub nsw i32 %243, %242
  store i32 %244, ptr %21, align 4, !tbaa !5
  %245 = load i32, ptr %21, align 4, !tbaa !5
  %246 = load i32, ptr %21, align 4, !tbaa !5
  %247 = sub nsw i32 0, %246
  %248 = and i32 %245, %247
  store i32 %248, ptr %22, align 4, !tbaa !5
  br label %186, !llvm.loop !15

249:                                              ; preds = %189
  store i32 0, ptr %4, align 4
  br label %250

250:                                              ; preds = %249, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %251 = load i32, ptr %4, align 4
  switch i32 %251, label %253 [
    i32 0, label %252
  ]

252:                                              ; preds = %250
  store i32 0, ptr %4, align 4
  br label %253

253:                                              ; preds = %252, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %254 = load i32, ptr %4, align 4
  switch i32 %254, label %276 [
    i32 0, label %255
    i32 17, label %256
  ]

255:                                              ; preds = %253
  br label %256

256:                                              ; preds = %255, %253
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br label %153

258:                                              ; preds = %155
  store i32 0, ptr %4, align 4
  br label %259

259:                                              ; preds = %258, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %260 = load i32, ptr %4, align 4
  switch i32 %260, label %262 [
    i32 0, label %261
  ]

261:                                              ; preds = %259
  store i32 0, ptr %4, align 4
  br label %262

262:                                              ; preds = %261, %259
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %263 = load i32, ptr %4, align 4
  switch i32 %263, label %276 [
    i32 0, label %264
    i32 15, label %265
  ]

264:                                              ; preds = %262
  br label %265

265:                                              ; preds = %264, %262
  %266 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %113

267:                                              ; preds = %115
  %268 = load i32, ptr %6, align 4, !tbaa !5
  %269 = load i32, ptr %8, align 4, !tbaa !5
  %270 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %268, i32 noundef %269)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %271

271:                                              ; preds = %267
  %272 = load i32, ptr %6, align 4, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %6, align 4, !tbaa !5
  br label %84, !llvm.loop !16

274:                                              ; preds = %88
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %275 = load i32, ptr %1, align 4
  ret i32 %275

276:                                              ; preds = %262, %253, %238
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 #5 = { inlinehint 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 #6 = { 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 #7 = { 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 = !{!"any pointer", !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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@bits = external dso_local local_unnamed_addr global [16385 x i32], align 16
@tr = external dso_local global [16385 x %"class.std::vector"], align 16
@t = external dso_local global i32, align 4
@seq = external dso_local global [15 x i32], align 16
@typ = external dso_local local_unnamed_addr global [16385 x i32], align 16
@val = external dso_local local_unnamed_addr global [16385 x i32], align 16
@buf = external dso_local global [3 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL5score = external hidden local_unnamed_addr constant [2 x [10 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4scanPc(ptr 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 uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %15

12:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %.not80 = icmp slt i32 %14, 1
  br i1 %.not80, label %._crit_edge82, label %.preheader

15:                                               ; preds = %0, %43
  %storemerge62 = phi i32 [ 1, %0 ], [ %45, %43 ]
  %16 = ashr i32 %storemerge62, 1
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = and i32 %storemerge62, 1
  %21 = add nsw i32 %19, %20
  %22 = sext i32 %storemerge62 to i64
  %23 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %22
  store i32 %21, ptr %23, align 4, !tbaa !5
  %24 = icmp eq i32 %21, 9
  br i1 %24, label %25, label %43

25:                                               ; preds = %15
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @tr, i64 393192), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  %28 = and i32 %27, %26
  store i32 %28, ptr %2, align 4, !tbaa !5
  %.not5860 = icmp eq i32 %28, 0
  br i1 %.not5860, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %38, %25
  %29 = phi i32 [ %26, %25 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  br label %43

.lr.ph:                                           ; preds = %25, %38
  %30 = phi i32 [ %39, %38 ], [ %26, %25 ]
  %storemerge5761 = phi i32 [ %42, %38 ], [ %28, %25 ]
  %31 = sext i32 %storemerge5761 to i64
  %32 = getelementptr inbounds [16385 x i32], ptr @bits, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 4
  br i1 %34, label %35, label %38

35:                                               ; preds = %.lr.ph
  %36 = sext i32 %30 to i64
  %37 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %36
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre84 = load i32, ptr %1, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %.lr.ph, %35
  %39 = phi i32 [ %30, %.lr.ph ], [ %.pre84, %35 ]
  %40 = phi i32 [ %storemerge5761, %.lr.ph ], [ %.pre, %35 ]
  %41 = add nsw i32 %40, -1
  %42 = and i32 %41, %39
  store i32 %42, ptr %2, align 4, !tbaa !5
  %.not58 = icmp eq i32 %42, 0
  br i1 %.not58, label %._crit_edge, label %.lr.ph, !llvm.loop !9

43:                                               ; preds = %15, %._crit_edge
  %44 = phi i32 [ %storemerge62, %15 ], [ %29, %._crit_edge ]
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %1, align 4, !tbaa !5
  %46 = icmp slt i32 %44, 16383
  br i1 %46, label %15, label %12, !llvm.loop !11

.preheader:                                       ; preds = %12, %._crit_edge78
  %.04781 = phi i32 [ %79, %._crit_edge78 ], [ 1, %12 ]
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %48 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %48, ptr @seq, align 16, !tbaa !5
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %50 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %50, ptr getelementptr inbounds (i8, ptr @seq, i64 4), align 4, !tbaa !5
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %52 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %52, ptr getelementptr inbounds (i8, ptr @seq, i64 8), align 8, !tbaa !5
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %54 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %54, ptr getelementptr inbounds (i8, ptr @seq, i64 12), align 4, !tbaa !5
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %56 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %56, ptr getelementptr inbounds (i8, ptr @seq, i64 16), align 16, !tbaa !5
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %58 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %58, ptr getelementptr inbounds (i8, ptr @seq, i64 20), align 4, !tbaa !5
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %60 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %60, ptr getelementptr inbounds (i8, ptr @seq, i64 24), align 8, !tbaa !5
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %62 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %62, ptr getelementptr inbounds (i8, ptr @seq, i64 28), align 4, !tbaa !5
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %64 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %64, ptr getelementptr inbounds (i8, ptr @seq, i64 32), align 16, !tbaa !5
  %65 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %66 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %66, ptr getelementptr inbounds (i8, ptr @seq, i64 36), align 4, !tbaa !5
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %68 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %68, ptr getelementptr inbounds (i8, ptr @seq, i64 40), align 8, !tbaa !5
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %70 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %70, ptr getelementptr inbounds (i8, ptr @seq, i64 44), align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %72 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %72, ptr getelementptr inbounds (i8, ptr @seq, i64 48), align 16, !tbaa !5
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf)
  %74 = call noundef i32 @_Z4scanPc(ptr noundef nonnull @buf)
  store i32 %74, ptr getelementptr inbounds (i8, ptr @seq, i64 52), align 4, !tbaa !5
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @seq, ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 56))
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %75 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @tr, i64 393192)) #8
  store ptr %75, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %76 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @tr, i64 393192)) #8
  store ptr %76, ptr %4, align 8
  %77 = 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) #8
  br i1 %77, label %.lr.ph77, label %._crit_edge78

._crit_edge82:                                    ; preds = %._crit_edge78, %12
  ret i32 0

._crit_edge78:                                    ; preds = %148, %.preheader
  %.049.lcssa = phi i32 [ 0, %.preheader ], [ %.6, %148 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.04781, i32 noundef %.049.lcssa)
  %79 = add nuw nsw i32 %.04781, 1
  %80 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04781, %80
  br i1 %.not.not, label %.preheader, label %._crit_edge82, !llvm.loop !12

.lr.ph77:                                         ; preds = %.preheader, %148
  %.04975 = phi i32 [ %.6, %148 ], [ 0, %.preheader ]
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sub nsw i32 16383, %82
  store i32 %83, ptr %5, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x i32], ptr @_ZL5score, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = getelementptr inbounds [10 x i32], ptr getelementptr inbounds (i8, ptr @_ZL5score, i64 40), i64 0, i64 %87
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add i32 %89, 22
  %93 = add i32 %92, %91
  %.not54 = icmp sgt i32 %93, %.04975
  br i1 %.not54, label %94, label %148

94:                                               ; preds = %.lr.ph77
  %95 = load i32, ptr %81, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [16385 x %"class.std::vector"], ptr @tr, i64 0, i64 %96
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %98 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #8
  store ptr %98, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %99 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #8
  store ptr %99, ptr %7, align 8
  %100 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %100, label %.lr.ph72, label %._crit_edge73

._crit_edge73:                                    ; preds = %.loopexit, %94
  %.150.lcssa = phi i32 [ %.04975, %94 ], [ %.5, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %148

.lr.ph72:                                         ; preds = %94, %.loopexit
  %.15070 = phi i32 [ %.5, %.loopexit ], [ %.04975, %94 ]
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %102 = load i32, ptr %81, align 4, !tbaa !5
  %103 = load i32, ptr %101, align 4, !tbaa !5
  %104 = sub nsw i32 %102, %103
  store i32 %104, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10 x i32], ptr getelementptr inbounds (i8, ptr @_ZL5score, i64 40), i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, %89
  %112 = call noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %113 = add nsw i32 %111, 22
  %.not55 = icmp sle i32 %113, %.15070
  %or.cond.not = select i1 %112, i1 true, i1 %.not55
  br i1 %or.cond.not, label %.loopexit, label %114

114:                                              ; preds = %.lr.ph72
  %115 = load i32, ptr %101, align 4, !tbaa !5
  %.not5664 = icmp eq i32 %115, 0
  br i1 %.not5664, label %.loopexit, label %.lr.ph69

.lr.ph69:                                         ; preds = %114
  %116 = sub nsw i32 0, %115
  %117 = and i32 %115, %116
  %118 = add i32 %111, 9
  br label %119

119:                                              ; preds = %.lr.ph69, %142
  %.04467 = phi i32 [ %117, %.lr.ph69 ], [ %145, %142 ]
  %.04566 = phi i32 [ %115, %.lr.ph69 ], [ %143, %142 ]
  %.265 = phi i32 [ %.15070, %.lr.ph69 ], [ %.4, %142 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %120 = load i32, ptr %101, align 4, !tbaa !5
  %121 = sub nsw i32 %120, %.04467
  store i32 %121, ptr %9, align 4, !tbaa !5
  %122 = call noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  br i1 %122, label %142, label %123

123:                                              ; preds = %119
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [16385 x i32], ptr @typ, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  switch i32 %127, label %141 [
    i32 3, label %128
    i32 1, label %133
  ]

128:                                              ; preds = %123
  %129 = getelementptr inbounds [16385 x i32], ptr @val, i64 0, i64 %125
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = ashr i32 %130, 8
  %132 = add i32 %118, %131
  br label %141

133:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %134 = getelementptr inbounds [16385 x i32], ptr @val, i64 0, i64 %125
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = ashr i32 %135, 12
  %137 = add nsw i32 %136, -3
  store i32 %137, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  %138 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  br label %141

141:                                              ; preds = %123, %133, %128
  %.0 = phi i32 [ %132, %128 ], [ %140, %133 ], [ %111, %123 ]
  %spec.select = call i32 @llvm.smax.i32(i32 %.265, i32 %.0)
  br label %142

142:                                              ; preds = %119, %141
  %.4 = phi i32 [ %spec.select, %141 ], [ %.265, %119 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  %143 = sub nsw i32 %.04566, %.04467
  %144 = sub nsw i32 0, %143
  %145 = and i32 %143, %144
  %.not56 = icmp eq i32 %143, 0
  br i1 %.not56, label %.loopexit, label %119, !llvm.loop !13

.loopexit:                                        ; preds = %142, %114, %.lr.ph72
  %.5 = phi i32 [ %.15070, %.lr.ph72 ], [ %.15070, %114 ], [ %.4, %142 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %147 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %147, label %.lr.ph72, label %._crit_edge73

148:                                              ; preds = %.lr.ph77, %._crit_edge73
  %.6 = phi i32 [ %.150.lcssa, %._crit_edge73 ], [ %.04975, %.lr.ph77 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %150 = 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) #8
  br i1 %150, label %.lr.ph77, label %._crit_edge78
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; 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 #6

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

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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 = { 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 #3 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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}


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