; LLVM IR from DionysiosB/CodeForces :: 1400-1499 (1484B-RestoreModulo)

; 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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i8, align 1
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %19

19:                                               ; preds = %208, %206, %0
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add nsw i64 %20, -1
  store i64 %21, ptr %2, align 8, !tbaa !5
  %22 = icmp ne i64 %20, 0
  br i1 %22, label %23, label %211

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  %25 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %26 unwind label %32

26:                                               ; preds = %23
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %54, %26
  %28 = load i64, ptr %9, align 8, !tbaa !5
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %61

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %210

36:                                               ; preds = %27
  %37 = load i64, ptr %9, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %37) #5
  %39 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %38)
          to label %40 unwind label %57

40:                                               ; preds = %36
  %41 = load i64, ptr %4, align 8, !tbaa !5
  %42 = load i64, ptr %9, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %42) #5
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = icmp sgt i64 %41, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %40
  %47 = load i64, ptr %4, align 8, !tbaa !5
  br label %52

48:                                               ; preds = %40
  %49 = load i64, ptr %9, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %49) #5
  %51 = load i64, ptr %50, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %48, %46
  %53 = phi i64 [ %47, %46 ], [ %51, %48 ]
  store i64 %53, ptr %4, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %52
  %55 = load i64, ptr %9, align 8, !tbaa !5
  %56 = add nsw i64 %55, 1
  store i64 %56, ptr %9, align 8, !tbaa !5
  br label %27, !llvm.loop !9

57:                                               ; preds = %36
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %209

61:                                               ; preds = %31
  %62 = load i64, ptr %3, align 8, !tbaa !5
  %63 = icmp sle i64 %62, 1
  br i1 %63, label %64, label %71

64:                                               ; preds = %61
  %65 = invoke i32 @puts(ptr noundef @.str.1)
          to label %66 unwind label %67

66:                                               ; preds = %64
  store i32 2, ptr %10, align 4
  br label %206, !llvm.loop !11

67:                                               ; preds = %64
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %7, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %8, align 4
  br label %209

71:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 -1, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 -1, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %114, %71
  %73 = load i64, ptr %13, align 8, !tbaa !5
  %74 = load i64, ptr %3, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %117

77:                                               ; preds = %72
  %78 = load i64, ptr %13, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %78) #5
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = load i64, ptr %13, align 8, !tbaa !5
  %82 = sub nsw i64 %81, 1
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %82) #5
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = icmp sge i64 %80, %84
  br i1 %85, label %86, label %95

86:                                               ; preds = %77
  %87 = load i64, ptr %13, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %87) #5
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = load i64, ptr %13, align 8, !tbaa !5
  %91 = sub nsw i64 %90, 1
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %91) #5
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = sub nsw i64 %89, %93
  store i64 %94, ptr %11, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %86, %77
  %96 = load i64, ptr %13, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %96) #5
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = load i64, ptr %13, align 8, !tbaa !5
  %100 = sub nsw i64 %99, 1
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %100) #5
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %103 = icmp sle i64 %98, %102
  br i1 %103, label %104, label %113

104:                                              ; preds = %95
  %105 = load i64, ptr %13, align 8, !tbaa !5
  %106 = sub nsw i64 %105, 1
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %106) #5
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = load i64, ptr %13, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %109) #5
  %111 = load i64, ptr %110, align 8, !tbaa !5
  %112 = sub nsw i64 %108, %111
  store i64 %112, ptr %12, align 8, !tbaa !5
  br label %113

113:                                              ; preds = %104, %95
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %13, align 8, !tbaa !5
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %13, align 8, !tbaa !5
  br label %72, !llvm.loop !12

117:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  %118 = load i64, ptr %11, align 8, !tbaa !5
  %119 = icmp ne i64 %118, 0
  br i1 %119, label %120, label %128

120:                                              ; preds = %117
  %121 = load i64, ptr %12, align 8, !tbaa !5
  %122 = icmp ne i64 %121, 0
  br i1 %122, label %123, label %128

123:                                              ; preds = %120
  %124 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %124, ptr %14, align 8, !tbaa !5
  %125 = load i64, ptr %11, align 8, !tbaa !5
  %126 = load i64, ptr %12, align 8, !tbaa !5
  %127 = add nsw i64 %125, %126
  store i64 %127, ptr %15, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %123, %120, %117
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  %129 = load i64, ptr %15, align 8, !tbaa !5
  %130 = icmp sle i64 %129, 0
  br i1 %130, label %135, label %131

131:                                              ; preds = %128
  %132 = load i64, ptr %15, align 8, !tbaa !5
  %133 = load i64, ptr %4, align 8, !tbaa !5
  %134 = icmp sgt i64 %132, %133
  br label %135

135:                                              ; preds = %131, %128
  %136 = phi i1 [ true, %128 ], [ %134, %131 ]
  %137 = zext i1 %136 to i8
  store i8 %137, ptr %16, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 1, ptr %17, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %177, %135
  %139 = load i64, ptr %17, align 8, !tbaa !5
  %140 = load i64, ptr %3, align 8, !tbaa !5
  %141 = icmp slt i64 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %180

143:                                              ; preds = %138
  %144 = load i64, ptr %15, align 8, !tbaa !5
  %145 = icmp sgt i64 %144, 0
  br i1 %145, label %146, label %160

146:                                              ; preds = %143
  %147 = load i64, ptr %17, align 8, !tbaa !5
  %148 = sub nsw i64 %147, 1
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %148) #5
  %150 = load i64, ptr %149, align 8, !tbaa !5
  %151 = load i64, ptr %14, align 8, !tbaa !5
  %152 = add nsw i64 %150, %151
  %153 = load i64, ptr %15, align 8, !tbaa !5
  %154 = srem i64 %152, %153
  %155 = load i64, ptr %17, align 8, !tbaa !5
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %155) #5
  %157 = load i64, ptr %156, align 8, !tbaa !5
  %158 = icmp ne i64 %154, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %146
  store i8 0, ptr %16, align 1, !tbaa !13
  br label %176

160:                                              ; preds = %146, %143
  %161 = load i64, ptr %15, align 8, !tbaa !5
  %162 = icmp sle i64 %161, 0
  br i1 %162, label %163, label %175

163:                                              ; preds = %160
  %164 = load i64, ptr %17, align 8, !tbaa !5
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %164) #5
  %166 = load i64, ptr %165, align 8, !tbaa !5
  %167 = load i64, ptr %17, align 8, !tbaa !5
  %168 = sub nsw i64 %167, 1
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %168) #5
  %170 = load i64, ptr %169, align 8, !tbaa !5
  %171 = sub nsw i64 %166, %170
  %172 = load i64, ptr %14, align 8, !tbaa !5
  %173 = icmp ne i64 %171, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %163
  store i8 0, ptr %16, align 1, !tbaa !13
  br label %175

175:                                              ; preds = %174, %163, %160
  br label %176

176:                                              ; preds = %175, %159
  br label %177

177:                                              ; preds = %176
  %178 = load i64, ptr %17, align 8, !tbaa !5
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %17, align 8, !tbaa !5
  br label %138, !llvm.loop !15

180:                                              ; preds = %142
  %181 = load i8, ptr %16, align 1, !tbaa !13, !range !16, !noundef !17
  %182 = trunc i8 %181 to i1
  br i1 %182, label %183, label %195

183:                                              ; preds = %180
  %184 = load i64, ptr %15, align 8, !tbaa !5
  %185 = icmp sgt i64 %184, 0
  br i1 %185, label %186, label %195

186:                                              ; preds = %183
  %187 = load i64, ptr %15, align 8, !tbaa !5
  %188 = load i64, ptr %14, align 8, !tbaa !5
  %189 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %187, i64 noundef %188)
          to label %190 unwind label %191

190:                                              ; preds = %186
  br label %205

191:                                              ; preds = %201, %198, %186
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %7, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %209

195:                                              ; preds = %183, %180
  %196 = load i8, ptr %16, align 1, !tbaa !13, !range !16, !noundef !17
  %197 = trunc i8 %196 to i1
  br i1 %197, label %198, label %201

198:                                              ; preds = %195
  %199 = invoke i32 @puts(ptr noundef @.str.1)
          to label %200 unwind label %191

200:                                              ; preds = %198
  br label %204

201:                                              ; preds = %195
  %202 = invoke i32 @puts(ptr noundef @.str.3)
          to label %203 unwind label %191

203:                                              ; preds = %201
  br label %204

204:                                              ; preds = %203, %200
  br label %205

205:                                              ; preds = %204, %190
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  store i32 0, ptr %10, align 4
  br label %206

206:                                              ; preds = %205, %66
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %207 = load i32, ptr %10, align 4
  switch i32 %207, label %218 [
    i32 0, label %208
    i32 2, label %19
  ]

208:                                              ; preds = %206
  br label %19, !llvm.loop !11

209:                                              ; preds = %191, %67, %57
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %210

210:                                              ; preds = %209, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %213

211:                                              ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %212 = load i32, ptr %1, align 4
  ret i32 %212

213:                                              ; preds = %210
  %214 = load ptr, ptr %7, align 8
  %215 = load i32, ptr %8, align 4
  %216 = insertvalue { ptr, i32 } poison, ptr %214, 0
  %217 = insertvalue { ptr, i32 } %216, i32 %215, 1
  resume { ptr, i32 } %217

218:                                              ; preds = %206
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

declare i32 @puts(ptr noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"long", !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 = !{i8 0, i8 2}
!17 = !{}


; 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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i64, ptr %1, align 8, !tbaa !5
  %7 = add nsw i64 %6, -1
  store i64 %7, ptr %1, align 8, !tbaa !5
  %.not80 = icmp eq i64 %6, 0
  br i1 %.not80, label %._crit_edge83, label %.lr.ph82

.lr.ph82:                                         ; preds = %0, %91
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %9 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %10 unwind label %14

10:                                               ; preds = %.lr.ph82
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %24
  %13 = icmp slt i64 %27, 2
  br i1 %13, label %._crit_edge.thread, label %.lr.ph70

14:                                               ; preds = %.lr.ph82
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %15

.lr.ph:                                           ; preds = %10, %24
  %.05465 = phi i64 [ %26, %24 ], [ 0, %10 ]
  %.05564 = phi i64 [ %25, %24 ], [ 0, %10 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.05465) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.05465) #5
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = icmp sgt i64 %.05564, %19
  br i1 %20, label %24, label %21

21:                                               ; preds = %.lr.ph
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.05465) #5
  %23 = load i64, ptr %22, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %.lr.ph, %21
  %25 = phi i64 [ %23, %21 ], [ %.05564, %.lr.ph ]
  %26 = add nuw nsw i64 %.05465, 1
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge.thread:                               ; preds = %10, %._crit_edge
  %29 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %91, !llvm.loop !11

._crit_edge71:                                    ; preds = %70
  %30 = icmp ne i64 %.153, 0
  %31 = icmp ne i64 %.151, 0
  %or.cond = select i1 %30, i1 %31, i1 false
  %32 = add nsw i64 %.151, %.153
  %spec.select = select i1 %or.cond, i64 %.153, i64 0
  %spec.select61 = select i1 %or.cond, i64 %32, i64 0
  %33 = icmp slt i64 %spec.select61, 1
  %34 = icmp sgt i64 %spec.select61, %25
  %35 = select i1 %33, i1 true, i1 %34
  %36 = icmp sgt i64 %72, 1
  br i1 %36, label %.lr.ph77, label %._crit_edge78

.lr.ph77:                                         ; preds = %._crit_edge71
  %37 = icmp sgt i64 %spec.select61, 0
  br i1 %37, label %.lr.ph77.split.us, label %.lr.ph77.split

.lr.ph77.split.us:                                ; preds = %.lr.ph77, %.lr.ph77.split.us
  %.075.us = phi i64 [ %45, %.lr.ph77.split.us ], [ 1, %.lr.ph77 ]
  %.04674.us = phi i1 [ %.mux.us, %.lr.ph77.split.us ], [ %35, %.lr.ph77 ]
  %38 = add nsw i64 %.075.us, -1
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = add nsw i64 %40, %spec.select
  %42 = srem i64 %41, %32
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.075.us) #5
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %.not57.not.us = icmp eq i64 %42, %44
  %.mux.us = select i1 %.not57.not.us, i1 %.04674.us, i1 false
  %45 = add nuw nsw i64 %.075.us, 1
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %.lr.ph77.split.us, label %._crit_edge78, !llvm.loop !12

.lr.ph70:                                         ; preds = %._crit_edge, %70
  %.04969 = phi i64 [ %71, %70 ], [ 1, %._crit_edge ]
  %.05068 = phi i64 [ %.151, %70 ], [ -1, %._crit_edge ]
  %.05267 = phi i64 [ %.153, %70 ], [ -1, %._crit_edge ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04969) #5
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = add nsw i64 %.04969, -1
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #5
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %.not59 = icmp slt i64 %49, %52
  br i1 %.not59, label %59, label %53

53:                                               ; preds = %.lr.ph70
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04969) #5
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #5
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = sub nsw i64 %55, %57
  br label %59

59:                                               ; preds = %53, %.lr.ph70
  %.153 = phi i64 [ %58, %53 ], [ %.05267, %.lr.ph70 ]
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04969) #5
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #5
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %.not60 = icmp sgt i64 %61, %63
  br i1 %.not60, label %70, label %64

64:                                               ; preds = %59
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #5
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04969) #5
  %68 = load i64, ptr %67, align 8, !tbaa !5
  %69 = sub nsw i64 %66, %68
  br label %70

70:                                               ; preds = %59, %64
  %.151 = phi i64 [ %69, %64 ], [ %.05068, %59 ]
  %71 = add nuw nsw i64 %.04969, 1
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %.lr.ph70, label %._crit_edge71, !llvm.loop !13

._crit_edge78:                                    ; preds = %.lr.ph77.split, %.lr.ph77.split.us, %._crit_edge71
  %.046.lcssa = phi i1 [ %35, %._crit_edge71 ], [ %.mux.us, %.lr.ph77.split.us ], [ %spec.select63, %.lr.ph77.split ]
  %74 = icmp sgt i64 %spec.select61, 0
  %or.cond3 = select i1 %.046.lcssa, i1 %74, i1 false
  br i1 %or.cond3, label %84, label %86

.lr.ph77.split:                                   ; preds = %.lr.ph77, %.lr.ph77.split
  %.075 = phi i64 [ %81, %.lr.ph77.split ], [ 1, %.lr.ph77 ]
  %.04674 = phi i1 [ %spec.select63, %.lr.ph77.split ], [ %35, %.lr.ph77 ]
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.075) #5
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %.075, -1
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %77) #5
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = sub nsw i64 %76, %79
  %.not58 = icmp eq i64 %80, %spec.select
  %spec.select63 = select i1 %.not58, i1 %.04674, i1 false
  %81 = add nuw nsw i64 %.075, 1
  %82 = load i64, ptr %2, align 8, !tbaa !5
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %.lr.ph77.split, label %._crit_edge78, !llvm.loop !12

84:                                               ; preds = %._crit_edge78
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select61, i64 noundef %spec.select)
  br label %91

86:                                               ; preds = %._crit_edge78
  br i1 %.046.lcssa, label %87, label %89

87:                                               ; preds = %86
  %88 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %91

89:                                               ; preds = %86
  %90 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %91

91:                                               ; preds = %84, %89, %87, %._crit_edge.thread
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %92 = load i64, ptr %1, align 8, !tbaa !5
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %92, 0
  br i1 %.not, label %._crit_edge83, label %.lr.ph82

._crit_edge83:                                    ; preds = %91, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"long", !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: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass