; LLVM IR from DionysiosB/CodeForces :: 0600-0699 (626D-JerrysProtestOLD2)

; 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 [7 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 %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %25 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %26 unwind label %32

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

27:                                               ; preds = %41, %26
  %28 = load i64, ptr %7, align 8, !tbaa !5
  %29 = load i64, ptr %2, 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 %7) #6
  br label %48

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

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

40:                                               ; preds = %36
  br label %41

41:                                               ; preds = %40
  %42 = load i64, ptr %7, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %7, align 8, !tbaa !5
  br label %27, !llvm.loop !9

44:                                               ; preds = %36
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %180

48:                                               ; preds = %31
  %49 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  %51 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %54, ptr %56)
          to label %57 unwind label %63

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %92, %57
  %59 = load i64, ptr %11, align 8, !tbaa !5
  %60 = load i64, ptr %2, align 8, !tbaa !5
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %67, label %62

62:                                               ; preds = %58
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %95

63:                                               ; preds = %48
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %5, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %6, align 4
  br label %180

67:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = load i64, ptr %11, align 8, !tbaa !5
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %13, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %84, %67
  %71 = load i64, ptr %13, align 8, !tbaa !5
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %91

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %76 = load i64, ptr %13, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %76) #6
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %11, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %79) #6
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = sub nsw i64 %78, %81
  store i64 %82, ptr %14, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %83 unwind label %87

83:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %13, align 8, !tbaa !5
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %13, align 8, !tbaa !5
  br label %70, !llvm.loop !11

87:                                               ; preds = %75
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %5, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %179

91:                                               ; preds = %74
  br label %92

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

95:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %96 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  store i64 %96, ptr %15, align 8, !tbaa !5
  %97 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  %99 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %102, ptr %104)
          to label %105 unwind label %111

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

106:                                              ; preds = %156, %105
  %107 = load i64, ptr %19, align 8, !tbaa !5
  %108 = load i64, ptr %15, align 8, !tbaa !5
  %109 = icmp slt i64 %107, %108
  br i1 %109, label %115, label %110

110:                                              ; preds = %106
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %159

111:                                              ; preds = %95
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %5, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %6, align 4
  br label %178

115:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %116 = load i64, ptr %19, align 8, !tbaa !5
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store i64 0, ptr %21, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %152, %115
  %119 = load i64, ptr %21, align 8, !tbaa !5
  %120 = load i64, ptr %15, align 8, !tbaa !5
  %121 = icmp slt i64 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %155

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %124 = load i64, ptr %19, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %124) #6
  %126 = load i64, ptr %125, align 8, !tbaa !5
  %127 = load i64, ptr %21, align 8, !tbaa !5
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %127) #6
  %129 = load i64, ptr %128, align 8, !tbaa !5
  %130 = add nsw i64 %126, %129
  store i64 %130, ptr %22, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %143, %123
  %132 = load i64, ptr %20, align 8, !tbaa !5
  %133 = load i64, ptr %15, align 8, !tbaa !5
  %134 = icmp slt i64 %132, %133
  br i1 %134, label %135, label %141

135:                                              ; preds = %131
  %136 = load i64, ptr %20, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %136) #6
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = load i64, ptr %22, align 8, !tbaa !5
  %140 = icmp sle i64 %138, %139
  br label %141

141:                                              ; preds = %135, %131
  %142 = phi i1 [ false, %131 ], [ %140, %135 ]
  br i1 %142, label %143, label %146

143:                                              ; preds = %141
  %144 = load i64, ptr %20, align 8, !tbaa !5
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %20, align 8, !tbaa !5
  br label %131, !llvm.loop !13

146:                                              ; preds = %141
  %147 = load i64, ptr %15, align 8, !tbaa !5
  %148 = load i64, ptr %20, align 8, !tbaa !5
  %149 = sub nsw i64 %147, %148
  %150 = load i64, ptr %18, align 8, !tbaa !5
  %151 = add nsw i64 %150, %149
  store i64 %151, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %152

152:                                              ; preds = %146
  %153 = load i64, ptr %21, align 8, !tbaa !5
  %154 = add nsw i64 %153, 1
  store i64 %154, ptr %21, align 8, !tbaa !5
  br label %118, !llvm.loop !14

155:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %156

156:                                              ; preds = %155
  %157 = load i64, ptr %19, align 8, !tbaa !5
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %19, align 8, !tbaa !5
  br label %106, !llvm.loop !15

159:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %160 = load i64, ptr %18, align 8, !tbaa !5
  %161 = sitofp i64 %160 to double
  %162 = fmul double 1.000000e+00, %161
  %163 = load i64, ptr %15, align 8, !tbaa !5
  %164 = load i64, ptr %15, align 8, !tbaa !5
  %165 = mul nsw i64 %163, %164
  %166 = load i64, ptr %15, align 8, !tbaa !5
  %167 = mul nsw i64 %165, %166
  %168 = sitofp i64 %167 to double
  %169 = fdiv double %162, %168
  store double %169, ptr %23, align 8, !tbaa !16
  %170 = load double, ptr %23, align 8, !tbaa !16
  %171 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %170)
          to label %172 unwind label %174

172:                                              ; preds = %159
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %173 = load i32, ptr %1, align 4
  ret i32 %173

174:                                              ; preds = %159
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %5, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %178

178:                                              ; preds = %174, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %179

179:                                              ; preds = %178, %87
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %180

180:                                              ; preds = %179, %63, %44
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %181

181:                                              ; preds = %180, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %5, align 8
  %184 = load i32, ptr %6, align 4
  %185 = insertvalue { ptr, i32 } poison, ptr %183, 0
  %186 = insertvalue { ptr, i32 } %185, i32 %184, 1
  resume { ptr, i32 } %186
}

; 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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(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}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}


; 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 [7 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 %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  %7 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %7, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %8 unwind label %13

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

._crit_edge:                                      ; preds = %.lr.ph, %8
  %11 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %12 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %11, ptr %12)
          to label %20 unwind label %44

13:                                               ; preds = %0
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %70

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.04655 = phi i64 [ %17, %.lr.ph ], [ 0, %8 ]
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04655) #6
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %17 = add nuw nsw i64 %.04655, 1
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = icmp slt i64 %17, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !9

20:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph61, label %._crit_edge62

.loopexit54:                                      ; preds = %54, %.lr.ph61
  %23 = phi i64 [ %46, %.lr.ph61 ], [ %56, %54 ]
  %24 = icmp slt i64 %47, %23
  br i1 %24, label %.lr.ph61, label %._crit_edge62, !llvm.loop !11

._crit_edge62:                                    ; preds = %.loopexit54, %20
  %25 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %26 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %27 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %26, ptr %27)
          to label %.preheader unwind label %66

.preheader:                                       ; preds = %._crit_edge62
  %28 = icmp sgt i64 %25, 0
  br i1 %28, label %.lr.ph72.us, label %._crit_edge77

.lr.ph72.us:                                      ; preds = %.preheader, %..loopexit_crit_edge.us
  %.04075.us = phi i64 [ %29, %..loopexit_crit_edge.us ], [ 0, %.preheader ]
  %.04174.us = phi i64 [ %42, %..loopexit_crit_edge.us ], [ 0, %.preheader ]
  %29 = add nuw nsw i64 %.04075.us, 1
  br label %30

30:                                               ; preds = %.lr.ph72.us, %.critedge.us
  %.03770.us = phi i64 [ 0, %.lr.ph72.us ], [ %43, %.critedge.us ]
  %.03869.us = phi i64 [ %29, %.lr.ph72.us ], [ %.139.lcssa.us, %.critedge.us ]
  %.14268.us = phi i64 [ %.04174.us, %.lr.ph72.us ], [ %42, %.critedge.us ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04075.us) #6
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.03770.us) #6
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %34, %32
  %36 = icmp slt i64 %.03869.us, %25
  br i1 %36, label %.lr.ph65.us, label %.critedge.us

.lr.ph65.us:                                      ; preds = %30, %39
  %.13963.us = phi i64 [ %40, %39 ], [ %.03869.us, %30 ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.13963.us) #6
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %.not.us = icmp sgt i64 %38, %35
  br i1 %.not.us, label %.critedge.us, label %39

39:                                               ; preds = %.lr.ph65.us
  %40 = add i64 %.13963.us, 1
  %exitcond.not = icmp eq i64 %40, %25
  br i1 %exitcond.not, label %.critedge.us, label %.lr.ph65.us, !llvm.loop !12

.critedge.us:                                     ; preds = %.lr.ph65.us, %39, %30
  %.139.lcssa.us = phi i64 [ %.03869.us, %30 ], [ %25, %39 ], [ %.13963.us, %.lr.ph65.us ]
  %41 = add i64 %.14268.us, %25
  %42 = sub i64 %41, %.139.lcssa.us
  %43 = add nuw nsw i64 %.03770.us, 1
  %exitcond79.not = icmp eq i64 %43, %25
  br i1 %exitcond79.not, label %..loopexit_crit_edge.us, label %30, !llvm.loop !13

..loopexit_crit_edge.us:                          ; preds = %.critedge.us
  %exitcond80.not = icmp eq i64 %29, %25
  br i1 %exitcond80.not, label %._crit_edge77.loopexit, label %.lr.ph72.us, !llvm.loop !14

44:                                               ; preds = %._crit_edge
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %69

.lr.ph61:                                         ; preds = %20, %.loopexit54
  %46 = phi i64 [ %23, %.loopexit54 ], [ %21, %20 ]
  %.04759 = phi i64 [ %47, %.loopexit54 ], [ 0, %20 ]
  %47 = add nuw nsw i64 %.04759, 1
  %48 = icmp slt i64 %47, %46
  br i1 %48, label %.lr.ph58, label %.loopexit54

.lr.ph58:                                         ; preds = %.lr.ph61, %54
  %.04856 = phi i64 [ %55, %54 ], [ %47, %.lr.ph61 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04856) #6
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04759) #6
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = sub nsw i64 %50, %52
  store i64 %53, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %54 unwind label %58

54:                                               ; preds = %.lr.ph58
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %55 = add nuw nsw i64 %.04856, 1
  %56 = load i64, ptr %1, align 8, !tbaa !5
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %.lr.ph58, label %.loopexit54, !llvm.loop !15

58:                                               ; preds = %.lr.ph58
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %68

._crit_edge77.loopexit:                           ; preds = %..loopexit_crit_edge.us
  %60 = sitofp i64 %42 to double
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge77.loopexit, %.preheader
  %.041.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %60, %._crit_edge77.loopexit ]
  %61 = mul nsw i64 %25, %25
  %62 = mul nsw i64 %61, %25
  %63 = sitofp i64 %62 to double
  %64 = fdiv double %.041.lcssa, %63
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %64)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

66:                                               ; preds = %._crit_edge62
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %68

68:                                               ; preds = %66, %58
  %.pn = phi { ptr, i32 } [ %59, %58 ], [ %67, %66 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %69

69:                                               ; preds = %68, %44
  %.pn.pn = phi { ptr, i32 } [ %.pn, %68 ], [ %45, %44 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %70

70:                                               ; preds = %69, %13
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %69 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(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: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass