; LLVM IR from DionysiosB/CodeForces :: 1846C-RudolfAndTheAnotherCompetition (main)

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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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 i64, align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %27

27:                                               ; preds = %194, %0
  %28 = load i64, ptr %2, align 8, !tbaa !5
  %29 = add nsw i64 %28, -1
  store i64 %29, ptr %2, align 8, !tbaa !5
  %30 = icmp ne i64 %28, 0
  br i1 %30, label %31, label %202

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  %33 = load i64, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %33, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %34 unwind label %40

34:                                               ; preds = %31
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %49, %34
  %36 = load i64, ptr %10, align 8, !tbaa !5
  %37 = load i64, ptr %4, align 8, !tbaa !5
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %44, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %56

40:                                               ; preds = %31
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %8, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %201

44:                                               ; preds = %35
  %45 = load i64, ptr %10, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %45) #6
  %47 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %46)
          to label %48 unwind label %52

48:                                               ; preds = %44
  br label %49

49:                                               ; preds = %48
  %50 = load i64, ptr %10, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %10, align 8, !tbaa !5
  br label %35, !llvm.loop !9

52:                                               ; preds = %44
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %200

56:                                               ; preds = %39
  %57 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  %59 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %62, ptr %64)
          to label %65 unwind label %71

65:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %91, %65
  %67 = load i64, ptr %16, align 8, !tbaa !5
  %68 = load i64, ptr %4, align 8, !tbaa !5
  %69 = icmp slt i64 %67, %68
  br i1 %69, label %75, label %70

70:                                               ; preds = %66
  store i32 7, ptr %17, align 4
  br label %94

71:                                               ; preds = %56
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %8, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %9, align 4
  br label %200

75:                                               ; preds = %66
  %76 = load i64, ptr %16, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %76) #6
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %13, align 8, !tbaa !5
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr %13, align 8, !tbaa !5
  %81 = load i64, ptr %13, align 8, !tbaa !5
  %82 = load i64, ptr %5, align 8, !tbaa !5
  %83 = icmp sgt i64 %81, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %75
  store i32 7, ptr %17, align 4
  br label %94

85:                                               ; preds = %75
  %86 = load i64, ptr %14, align 8, !tbaa !5
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %14, align 8, !tbaa !5
  %88 = load i64, ptr %13, align 8, !tbaa !5
  %89 = load i64, ptr %15, align 8, !tbaa !5
  %90 = add nsw i64 %89, %88
  store i64 %90, ptr %15, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %85
  %92 = load i64, ptr %16, align 8, !tbaa !5
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %16, align 8, !tbaa !5
  br label %66, !llvm.loop !11

94:                                               ; preds = %84, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %95

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 1, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 1, ptr %19, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %187, %95
  %97 = load i64, ptr %19, align 8, !tbaa !5
  %98 = load i64, ptr %3, align 8, !tbaa !5
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 10, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %191

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %112, %101
  %103 = load i64, ptr %20, align 8, !tbaa !5
  %104 = load i64, ptr %4, align 8, !tbaa !5
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 13, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %119

107:                                              ; preds = %102
  %108 = load i64, ptr %20, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %108) #6
  %110 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %109)
          to label %111 unwind label %115

111:                                              ; preds = %107
  br label %112

112:                                              ; preds = %111
  %113 = load i64, ptr %20, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %20, align 8, !tbaa !5
  br label %102, !llvm.loop !12

115:                                              ; preds = %107
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %8, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %190

119:                                              ; preds = %106
  %120 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %121 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %120, ptr %121, align 8
  %122 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  %124 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8
  %126 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %125, ptr %127)
          to label %128 unwind label %134

128:                                              ; preds = %119
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store i64 0, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store i64 0, ptr %25, align 8, !tbaa !5
  br label %129

129:                                              ; preds = %154, %128
  %130 = load i64, ptr %25, align 8, !tbaa !5
  %131 = load i64, ptr %4, align 8, !tbaa !5
  %132 = icmp slt i64 %130, %131
  br i1 %132, label %138, label %133

133:                                              ; preds = %129
  store i32 16, ptr %17, align 4
  br label %157

134:                                              ; preds = %119
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %8, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %9, align 4
  br label %190

138:                                              ; preds = %129
  %139 = load i64, ptr %25, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %139) #6
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = load i64, ptr %13, align 8, !tbaa !5
  %143 = add nsw i64 %142, %141
  store i64 %143, ptr %13, align 8, !tbaa !5
  %144 = load i64, ptr %13, align 8, !tbaa !5
  %145 = load i64, ptr %5, align 8, !tbaa !5
  %146 = icmp sgt i64 %144, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %138
  store i32 16, ptr %17, align 4
  br label %157

148:                                              ; preds = %138
  %149 = load i64, ptr %23, align 8, !tbaa !5
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %23, align 8, !tbaa !5
  %151 = load i64, ptr %13, align 8, !tbaa !5
  %152 = load i64, ptr %24, align 8, !tbaa !5
  %153 = add nsw i64 %152, %151
  store i64 %153, ptr %24, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %148
  %155 = load i64, ptr %25, align 8, !tbaa !5
  %156 = add nsw i64 %155, 1
  store i64 %156, ptr %25, align 8, !tbaa !5
  br label %129, !llvm.loop !13

157:                                              ; preds = %147, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %23, align 8, !tbaa !5
  %160 = load i64, ptr %14, align 8, !tbaa !5
  %161 = icmp slt i64 %159, %160
  br i1 %161, label %162, label %163

162:                                              ; preds = %158
  store i32 12, ptr %17, align 4
  br label %184

163:                                              ; preds = %158
  %164 = load i64, ptr %23, align 8, !tbaa !5
  %165 = load i64, ptr %14, align 8, !tbaa !5
  %166 = icmp sgt i64 %164, %165
  br i1 %166, label %167, label %170

167:                                              ; preds = %163
  %168 = load i64, ptr %18, align 8, !tbaa !5
  %169 = add nsw i64 %168, 1
  store i64 %169, ptr %18, align 8, !tbaa !5
  br label %182

170:                                              ; preds = %163
  %171 = load i64, ptr %23, align 8, !tbaa !5
  %172 = load i64, ptr %14, align 8, !tbaa !5
  %173 = icmp eq i64 %171, %172
  br i1 %173, label %174, label %181

174:                                              ; preds = %170
  %175 = load i64, ptr %24, align 8, !tbaa !5
  %176 = load i64, ptr %15, align 8, !tbaa !5
  %177 = icmp slt i64 %175, %176
  %178 = zext i1 %177 to i64
  %179 = load i64, ptr %18, align 8, !tbaa !5
  %180 = add nsw i64 %179, %178
  store i64 %180, ptr %18, align 8, !tbaa !5
  br label %181

181:                                              ; preds = %174, %170
  br label %182

182:                                              ; preds = %181, %167
  br label %183

183:                                              ; preds = %182
  store i32 0, ptr %17, align 4
  br label %184

184:                                              ; preds = %183, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  %185 = load i32, ptr %17, align 4
  switch i32 %185, label %209 [
    i32 0, label %186
    i32 12, label %187
  ]

186:                                              ; preds = %184
  br label %187

187:                                              ; preds = %186, %184
  %188 = load i64, ptr %19, align 8, !tbaa !5
  %189 = add nsw i64 %188, 1
  store i64 %189, ptr %19, align 8, !tbaa !5
  br label %96, !llvm.loop !14

190:                                              ; preds = %134, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %199

191:                                              ; preds = %100
  %192 = load i64, ptr %18, align 8, !tbaa !5
  %193 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %192)
          to label %194 unwind label %195

194:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %27, !llvm.loop !15

195:                                              ; preds = %191
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %8, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %9, align 4
  br label %199

199:                                              ; preds = %195, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %200

200:                                              ; preds = %199, %71, %52
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %201

201:                                              ; preds = %200, %40
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %204

202:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %203 = load i32, ptr %1, align 4
  ret i32 %203

204:                                              ; preds = %201
  %205 = load ptr, ptr %8, align 8
  %206 = load i32, ptr %9, align 4
  %207 = insertvalue { ptr, i32 } poison, ptr %205, 0
  %208 = insertvalue { ptr, i32 } %207, i32 %206, 1
  resume { ptr, i32 } %208

209:                                              ; preds = %184
  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 @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(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 @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(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 = { 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 = { 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 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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr %1, align 8, !tbaa !5
  %.not91 = icmp eq i64 %8, 0
  br i1 %.not91, label %._crit_edge94, label %.lr.ph93

.lr.ph93:                                         ; preds = %0, %._crit_edge89
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %11 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %12 unwind label %19

12:                                               ; preds = %.lr.ph93
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %12
  %15 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %16 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %15, ptr %16)
          to label %.preheader60 unwind label %26

.preheader60:                                     ; preds = %._crit_edge
  %17 = load i64, ptr %3, align 8, !tbaa !5
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph67, label %._crit_edge68

19:                                               ; preds = %.lr.ph93
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %80

.lr.ph:                                           ; preds = %12, %.lr.ph
  %.05462 = phi i64 [ %23, %.lr.ph ], [ 0, %12 ]
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.05462) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %21)
  %23 = add nuw nsw i64 %.05462, 1
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !9

26:                                               ; preds = %._crit_edge
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %79

.lr.ph67:                                         ; preds = %.preheader60, %33
  %.04966 = phi i64 [ %34, %33 ], [ 0, %.preheader60 ]
  %.05065 = phi i64 [ %35, %33 ], [ 0, %.preheader60 ]
  %.05263 = phi i64 [ %30, %33 ], [ 0, %.preheader60 ]
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04966) #6
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = add nsw i64 %29, %.05263
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = icmp sgt i64 %30, %31
  br i1 %32, label %._crit_edge68, label %33

33:                                               ; preds = %.lr.ph67
  %34 = add nuw nsw i64 %.04966, 1
  %35 = add nsw i64 %30, %.05065
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = icmp slt i64 %34, %36
  br i1 %37, label %.lr.ph67, label %._crit_edge68, !llvm.loop !11

._crit_edge68:                                    ; preds = %33, %.lr.ph67, %.preheader60
  %.051.lcssa = phi i64 [ 0, %.preheader60 ], [ %.04966, %.lr.ph67 ], [ %34, %33 ]
  %.050.lcssa = phi i64 [ 0, %.preheader60 ], [ %.05065, %.lr.ph67 ], [ %35, %33 ]
  %38 = load i64, ptr %2, align 8, !tbaa !5
  %39 = icmp sgt i64 %38, 1
  br i1 %39, label %.preheader59, label %._crit_edge89

.preheader59:                                     ; preds = %._crit_edge68, %75
  %.04688 = phi i64 [ %76, %75 ], [ 1, %._crit_edge68 ]
  %.04787 = phi i64 [ %.2, %75 ], [ 1, %._crit_edge68 ]
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = icmp sgt i64 %40, 0
  br i1 %41, label %.lr.ph74, label %._crit_edge75

._crit_edge89:                                    ; preds = %75, %._crit_edge68
  %.047.lcssa = phi i64 [ 1, %._crit_edge68 ], [ %.2, %75 ]
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.047.lcssa)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %43 = load i64, ptr %1, align 8, !tbaa !5
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %43, 0
  br i1 %.not, label %._crit_edge94, label %.lr.ph93, !llvm.loop !12

._crit_edge75:                                    ; preds = %.lr.ph74, %.preheader59
  %45 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %46 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %45, ptr %46)
          to label %.preheader unwind label %54

.preheader:                                       ; preds = %._crit_edge75
  %47 = load i64, ptr %3, align 8, !tbaa !5
  %48 = icmp sgt i64 %47, 0
  br i1 %48, label %.lr.ph80, label %._crit_edge81

.lr.ph74:                                         ; preds = %.preheader59, %.lr.ph74
  %.04573 = phi i64 [ %51, %.lr.ph74 ], [ 0, %.preheader59 ]
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04573) #6
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %49)
  %51 = add nuw nsw i64 %.04573, 1
  %52 = load i64, ptr %3, align 8, !tbaa !5
  %53 = icmp slt i64 %51, %52
  br i1 %53, label %.lr.ph74, label %._crit_edge75, !llvm.loop !13

54:                                               ; preds = %._crit_edge75
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %79

.lr.ph80:                                         ; preds = %.preheader, %61
  %.079 = phi i64 [ %62, %61 ], [ 0, %.preheader ]
  %.04078 = phi i64 [ %63, %61 ], [ 0, %.preheader ]
  %.15376 = phi i64 [ %58, %61 ], [ 0, %.preheader ]
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.079) #6
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = add nsw i64 %57, %.15376
  %59 = load i64, ptr %4, align 8, !tbaa !5
  %60 = icmp sgt i64 %58, %59
  br i1 %60, label %._crit_edge81, label %61

61:                                               ; preds = %.lr.ph80
  %62 = add nuw nsw i64 %.079, 1
  %63 = add nsw i64 %58, %.04078
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = icmp slt i64 %62, %64
  br i1 %65, label %.lr.ph80, label %._crit_edge81, !llvm.loop !14

._crit_edge81:                                    ; preds = %61, %.lr.ph80, %.preheader
  %.041.lcssa = phi i64 [ 0, %.preheader ], [ %.079, %.lr.ph80 ], [ %62, %61 ]
  %.040.lcssa = phi i64 [ 0, %.preheader ], [ %.04078, %.lr.ph80 ], [ %63, %61 ]
  %66 = icmp ult i64 %.041.lcssa, %.051.lcssa
  br i1 %66, label %75, label %67

67:                                               ; preds = %._crit_edge81
  %68 = icmp ugt i64 %.041.lcssa, %.051.lcssa
  br i1 %68, label %69, label %71

69:                                               ; preds = %67
  %70 = add nsw i64 %.04787, 1
  br label %75

71:                                               ; preds = %67
  %72 = icmp slt i64 %.040.lcssa, %.050.lcssa
  %73 = zext i1 %72 to i64
  %74 = add nsw i64 %.04787, %73
  br label %75

75:                                               ; preds = %71, %69, %._crit_edge81
  %.2 = phi i64 [ %.04787, %._crit_edge81 ], [ %70, %69 ], [ %74, %71 ]
  %76 = add nuw nsw i64 %.04688, 1
  %77 = load i64, ptr %2, align 8, !tbaa !5
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %.preheader59, label %._crit_edge89, !llvm.loop !15

79:                                               ; preds = %54, %26
  %.pn = phi { ptr, i32 } [ %55, %54 ], [ %27, %26 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %80

80:                                               ; preds = %79, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %79 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn

._crit_edge94:                                    ; preds = %._crit_edge89, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  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 @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(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 @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(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 = { 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 = { 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 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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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