; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-07-08 (A - Passage - tjz)

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

@n = external dso_local global i32, align 4
@col = external dso_local global [205 x i32], align 16
@que = external dso_local global [205 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@e = external dso_local global [205 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  %16 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %17)
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %44, %0
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = load i32, ptr @n, align 4, !tbaa !9
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %40, %25
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %5)
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %35
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %38
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %40

40:                                               ; preds = %32
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %6, align 4, !tbaa !9
  br label %27, !llvm.loop !11

43:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %2, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %2, align 4, !tbaa !9
  br label %20, !llvm.loop !13

47:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %198, %47
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = load i32, ptr @n, align 4, !tbaa !9
  %51 = icmp sle i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %3, align 4
  br label %201

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %8, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %192, %53
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr @n, align 4, !tbaa !9
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 11, ptr %3, align 4
  br label %195

61:                                               ; preds = %56
  %62 = load i32, ptr @n, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = mul i64 %63, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @col, i64 1), i8 0, i64 %64, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  store i8 1, ptr %9, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %180, %61
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = load i32, ptr @n, align 4, !tbaa !9
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 14, ptr %3, align 4
  br label %183

70:                                               ; preds = %65
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %84, label %74

74:                                               ; preds = %70
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %84, label %78

78:                                               ; preds = %74
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %78, %74, %70
  br label %180

85:                                               ; preds = %78
  store i32 0, ptr @R, align 4, !tbaa !9
  store i32 0, ptr @L, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %87
  store i32 1, ptr %88, align 4, !tbaa !9
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr @R, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @R, align 4, !tbaa !9
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds [205 x i32], ptr @que, i64 0, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %174, %85
  %95 = load i32, ptr @L, align 4, !tbaa !9
  %96 = load i32, ptr @R, align 4, !tbaa !9
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %98, label %175

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %99 = load i32, ptr @L, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @L, align 4, !tbaa !9
  %101 = sext i32 %99 to i64
  %102 = getelementptr inbounds [205 x i32], ptr @que, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  store i32 %103, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %105
  %107 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %106) #7
  %108 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %107, ptr %108, align 8
  br label %109

109:                                              ; preds = %164, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %111
  %113 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #7
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  %115 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %115, label %117, label %116

116:                                              ; preds = %109
  store i32 19, ptr %3, align 4
  br label %166

117:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %119 = load i32, ptr %118, align 4, !tbaa !9
  store i32 %119, ptr %14, align 4, !tbaa !9
  %120 = load i32, ptr %7, align 4, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = icmp eq i32 %120, %121
  br i1 %122, label %138, label %123

123:                                              ; preds = %117
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = icmp eq i32 %124, %125
  br i1 %126, label %138, label %127

127:                                              ; preds = %123
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = add nsw i32 %131, %135
  %137 = icmp eq i32 %136, 3
  br i1 %137, label %138, label %139

138:                                              ; preds = %127, %123, %117
  store i32 21, ptr %3, align 4
  br label %161

139:                                              ; preds = %127
  %140 = load i32, ptr %14, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %159, label %145

145:                                              ; preds = %139
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !9
  %150 = sub nsw i32 3, %149
  %151 = load i32, ptr %14, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !9
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = load i32, ptr @R, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr @R, align 4, !tbaa !9
  %157 = sext i32 %155 to i64
  %158 = getelementptr inbounds [205 x i32], ptr @que, i64 0, i64 %157
  store i32 %154, ptr %158, align 4, !tbaa !9
  br label %160

159:                                              ; preds = %139
  store i8 0, ptr %9, align 1, !tbaa !14
  store i32 19, ptr %3, align 4
  br label %161

160:                                              ; preds = %145
  store i32 0, ptr %3, align 4
  br label %161

161:                                              ; preds = %160, %159, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %162 = load i32, ptr %3, align 4
  switch i32 %162, label %166 [
    i32 0, label %163
    i32 21, label %164
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %161
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %109, !llvm.loop !16

166:                                              ; preds = %161, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %167

167:                                              ; preds = %166
  %168 = load i8, ptr %9, align 1, !tbaa !14, !range !17, !noundef !18
  %169 = trunc i8 %168 to i1
  br i1 %169, label %171, label %170

170:                                              ; preds = %167
  store i32 18, ptr %3, align 4
  br label %172

171:                                              ; preds = %167
  store i32 0, ptr %3, align 4
  br label %172

172:                                              ; preds = %171, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %173 = load i32, ptr %3, align 4
  switch i32 %173, label %207 [
    i32 0, label %174
    i32 18, label %175
  ]

174:                                              ; preds = %172
  br label %94, !llvm.loop !19

175:                                              ; preds = %172, %94
  %176 = load i8, ptr %9, align 1, !tbaa !14, !range !17, !noundef !18
  %177 = trunc i8 %176 to i1
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 14, ptr %3, align 4
  br label %183

179:                                              ; preds = %175
  br label %180

180:                                              ; preds = %179, %84
  %181 = load i32, ptr %10, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %10, align 4, !tbaa !9
  br label %65, !llvm.loop !20

183:                                              ; preds = %178, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %184

184:                                              ; preds = %183
  %185 = load i8, ptr %9, align 1, !tbaa !14, !range !17, !noundef !18
  %186 = trunc i8 %185 to i1
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  store i32 13, ptr %3, align 4
  br label %190

188:                                              ; preds = %184
  %189 = call i32 @puts(ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %190

190:                                              ; preds = %188, %187
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  %191 = load i32, ptr %3, align 4
  switch i32 %191, label %195 [
    i32 13, label %192
  ]

192:                                              ; preds = %190
  %193 = load i32, ptr %8, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %8, align 4, !tbaa !9
  br label %56, !llvm.loop !21

195:                                              ; preds = %190, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %196 = load i32, ptr %3, align 4
  switch i32 %196, label %201 [
    i32 11, label %197
  ]

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %7, align 4, !tbaa !9
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %7, align 4, !tbaa !9
  br label %48, !llvm.loop !22

201:                                              ; preds = %195, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %202 = load i32, ptr %3, align 4
  switch i32 %202, label %207 [
    i32 8, label %203
    i32 1, label %205
  ]

203:                                              ; preds = %201
  %204 = call i32 @puts(ptr noundef @.str.6)
  store i32 0, ptr %1, align 4
  br label %205

205:                                              ; preds = %203, %201
  %206 = load i32, ptr %1, align 4
  ret i32 %206

207:                                              ; preds = %201, %172
  unreachable
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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)) #3 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: 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 ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 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 ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 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)) #5 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)) #5 align 2

declare i32 @puts(ptr noundef) #1

attributes #0 = { 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 #1 = { "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 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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

@n = external dso_local global i32, align 4
@col = external dso_local local_unnamed_addr global [205 x i32], align 16
@que = external dso_local local_unnamed_addr global [205 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [205 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = load ptr, ptr @stdin, align 8, !tbaa !5
  %7 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %6)
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  %9 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %8)
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 1, ptr %1, align 4, !tbaa !9
  %11 = load i32, ptr @n, align 4, !tbaa !9
  %.not85 = icmp slt i32 %11, 1
  br i1 %.not85, label %._crit_edge88.thread, label %.lr.ph87

._crit_edge88.thread:                             ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  br label %._crit_edge98

._crit_edge88:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %.not56104 = icmp slt i32 %16, 1
  br i1 %.not56104, label %._crit_edge98, label %.lr.ph107

.lr.ph87:                                         ; preds = %0, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %2)
  %13 = load i32, ptr %2, align 4, !tbaa !9
  %.not6183 = icmp slt i32 %13, 1
  br i1 %.not6183, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %14 = load i32, ptr %1, align 4, !tbaa !9
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %1, align 4, !tbaa !9
  %16 = load i32, ptr @n, align 4, !tbaa !9
  %.not.not = icmp slt i32 %14, %16
  br i1 %.not.not, label %.lr.ph87, label %._crit_edge88, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph87, %.lr.ph
  %.05284 = phi i32 [ %24, %.lr.ph ], [ 1, %.lr.ph87 ]
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %3)
  %18 = load i32, ptr %1, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [205 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) %3)
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %22
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %24 = add nuw nsw i32 %.05284, 1
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %.not61.not = icmp slt i32 %.05284, %25
  br i1 %.not61.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.loopexit82.loopexit:                             ; preds = %.thread70
  %.pre119 = sext i32 %64 to i64
  br label %.loopexit82

.loopexit82:                                      ; preds = %.loopexit82.loopexit, %.lr.ph107
  %.pre-phi = phi i64 [ %.pre119, %.loopexit82.loopexit ], [ %28, %.lr.ph107 ]
  %26 = phi i32 [ %64, %.loopexit82.loopexit ], [ %27, %.lr.ph107 ]
  %.not56.not = icmp slt i64 %indvars.iv116, %.pre-phi
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  br i1 %.not56.not, label %.lr.ph107, label %._crit_edge98, !llvm.loop !14

.lr.ph107:                                        ; preds = %._crit_edge88, %.loopexit82
  %27 = phi i32 [ %26, %.loopexit82 ], [ %16, %._crit_edge88 ]
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.loopexit82 ], [ 1, %._crit_edge88 ]
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.loopexit82 ], [ 2, %._crit_edge88 ]
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %28 = sext i32 %27 to i64
  %.not57100.not = icmp slt i64 %indvars.iv116, %28
  br i1 %.not57100.not, label %.lr.ph103, label %.loopexit82

.lr.ph103:                                        ; preds = %.lr.ph107, %.thread70
  %29 = phi i32 [ %64, %.thread70 ], [ %27, %.lr.ph107 ]
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.thread70 ], [ %indvars.iv111, %.lr.ph107 ]
  %30 = sext i32 %29 to i64
  %31 = shl nsw i64 %30, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @col, i64 4), i8 0, i64 %31, i1 false)
  %.not5894 = icmp slt i32 %29, 1
  br i1 %.not5894, label %._crit_edge98, label %.lr.ph97

.lr.ph97:                                         ; preds = %.lr.ph103, %.loopexit
  %32 = phi i32 [ %79, %.loopexit ], [ %29, %.lr.ph103 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 1, %.lr.ph103 ]
  %33 = icmp eq i64 %indvars.iv116, %indvars.iv
  %34 = icmp eq i64 %indvars.iv113, %indvars.iv
  %or.cond = or i1 %33, %34
  br i1 %or.cond, label %.loopexit, label %35

35:                                               ; preds = %.lr.ph97
  %36 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %indvars.iv
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %.not59 = icmp eq i32 %37, 0
  br i1 %.not59, label %.lr.ph93.preheader, label %.loopexit

.lr.ph93.preheader:                               ; preds = %35
  store i32 1, ptr %36, align 4, !tbaa !9
  store i32 1, ptr @R, align 4, !tbaa !9
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %38, ptr @que, align 16, !tbaa !9
  br label %.lr.ph93

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %._crit_edge91
  %39 = phi i32 [ %76, %._crit_edge91 ], [ 0, %.lr.ph93.preheader ]
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr @L, align 4, !tbaa !9
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [205 x i32], ptr @que, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [205 x %"class.std::vector"], ptr @e, i64 0, i64 %44
  %46 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #8
  store ptr %46, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %47 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #8
  store ptr %47, ptr %5, align 8
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %48, label %.lr.ph90, label %._crit_edge91

.lr.ph90:                                         ; preds = %.lr.ph93
  %49 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %44
  br label %50

50:                                               ; preds = %.lr.ph90, %72
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = icmp eq i64 %indvars.iv116, %53
  %55 = icmp eq i64 %indvars.iv113, %53
  %or.cond62 = or i1 %54, %55
  br i1 %or.cond62, label %72, label %56

56:                                               ; preds = %50
  %57 = load i32, ptr %49, align 4, !tbaa !9
  %58 = sext i32 %52 to i64
  %59 = getelementptr inbounds [205 x i32], ptr @col, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = add nsw i32 %60, %57
  %62 = icmp eq i32 %61, 3
  br i1 %62, label %72, label %63

63:                                               ; preds = %56
  %.not60 = icmp eq i32 %60, 0
  br i1 %.not60, label %66, label %.thread70

.thread70:                                        ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %64 = load i32, ptr @n, align 4, !tbaa !9
  %65 = trunc nuw i64 %indvars.iv113 to i32
  %.not57.not = icmp sgt i32 %64, %65
  br i1 %.not57.not, label %.lr.ph103, label %.loopexit82.loopexit, !llvm.loop !15

66:                                               ; preds = %63
  %67 = sub nsw i32 3, %57
  store i32 %67, ptr %59, align 4, !tbaa !9
  %68 = load i32, ptr @R, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr @R, align 4, !tbaa !9
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [205 x i32], ptr @que, i64 0, i64 %70
  store i32 %52, ptr %71, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %66, %56, %50
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %74 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #8
  store ptr %74, ptr %5, align 8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %75, label %50, label %._crit_edge91, !llvm.loop !16

._crit_edge91:                                    ; preds = %72, %.lr.ph93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %76 = load i32, ptr @L, align 4, !tbaa !9
  %77 = load i32, ptr @R, align 4, !tbaa !9
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %.lr.ph93, label %.loopexit.loopexit

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

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph97, %35
  %79 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %32, %.lr.ph97 ], [ %32, %35 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %80 = sext i32 %79 to i64
  %.not58.not = icmp slt i64 %indvars.iv, %80
  br i1 %.not58.not, label %.lr.ph97, label %._crit_edge98, !llvm.loop !17

._crit_edge98:                                    ; preds = %.loopexit82, %.lr.ph103, %.loopexit, %._crit_edge88, %._crit_edge88.thread
  %.str.5.sink = phi ptr [ @.str.6, %._crit_edge88.thread ], [ @.str.6, %._crit_edge88 ], [ @.str.5, %.loopexit ], [ @.str.5, %.lr.ph103 ], [ @.str.6, %.loopexit82 ]
  %81 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

attributes #0 = { 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 #1 = { "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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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