; LLVM IR from DionysiosB/CodeForces :: 1500-1599 (1512D-CorruptedArray)

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

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

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  %26 = load i64, ptr %3, align 8, !tbaa !5
  %27 = add nsw i64 %26, 2
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %27, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %28 unwind label %35

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

29:                                               ; preds = %44, %28
  %30 = load i64, ptr %8, align 8, !tbaa !5
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = add nsw i64 %31, 2
  %33 = icmp slt i64 %30, %32
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %51

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

39:                                               ; preds = %29
  %40 = load i64, ptr %8, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %40) #6
  %42 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %41)
          to label %43 unwind label %47

43:                                               ; preds = %39
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %8, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %8, align 8, !tbaa !5
  br label %29, !llvm.loop !9

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %181

51:                                               ; preds = %34
  %52 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  %54 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %57, ptr %59)
          to label %60 unwind label %66

60:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %76, %60
  %62 = load i64, ptr %12, align 8, !tbaa !5
  %63 = load i64, ptr %3, align 8, !tbaa !5
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %70, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %79

66:                                               ; preds = %51
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  br label %181

70:                                               ; preds = %61
  %71 = load i64, ptr %12, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %71) #6
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %11, align 8, !tbaa !5
  %75 = add nsw i64 %74, %73
  store i64 %75, ptr %11, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %70
  %77 = load i64, ptr %12, align 8, !tbaa !5
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %12, align 8, !tbaa !5
  br label %61, !llvm.loop !11

79:                                               ; preds = %65
  %80 = load i64, ptr %11, align 8, !tbaa !5
  %81 = load i64, ptr %3, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %81) #6
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = icmp eq i64 %80, %83
  br i1 %84, label %85, label %111

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %97, %85
  %87 = load i64, ptr %13, align 8, !tbaa !5
  %88 = load i64, ptr %3, align 8, !tbaa !5
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %104

91:                                               ; preds = %86
  %92 = load i64, ptr %13, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %92) #6
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %94)
          to label %96 unwind label %100

96:                                               ; preds = %91
  br label %97

97:                                               ; preds = %96
  %98 = load i64, ptr %13, align 8, !tbaa !5
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %13, align 8, !tbaa !5
  br label %86, !llvm.loop !12

100:                                              ; preds = %91
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %6, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %180

104:                                              ; preds = %90
  %105 = invoke i32 @puts(ptr noundef @.str.2)
          to label %106 unwind label %107

106:                                              ; preds = %104
  br label %179

107:                                              ; preds = %104
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %6, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %7, align 4
  br label %180

111:                                              ; preds = %79
  %112 = load i64, ptr %3, align 8, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %112) #6
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = load i64, ptr %11, align 8, !tbaa !5
  %116 = add nsw i64 %115, %114
  store i64 %116, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %118 = load i64, ptr %117, align 8, !tbaa !5
  store i64 %118, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 -1, 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 %119

119:                                              ; preds = %135, %111
  %120 = load i64, ptr %16, align 8, !tbaa !5
  %121 = load i64, ptr %3, align 8, !tbaa !5
  %122 = icmp sle i64 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 13, ptr %17, align 4
  br label %138

124:                                              ; preds = %119
  %125 = load i64, ptr %14, align 8, !tbaa !5
  %126 = load i64, ptr %16, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %126) #6
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = add nsw i64 %125, %128
  %130 = load i64, ptr %11, align 8, !tbaa !5
  %131 = icmp eq i64 %129, %130
  br i1 %131, label %132, label %134

132:                                              ; preds = %124
  %133 = load i64, ptr %16, align 8, !tbaa !5
  store i64 %133, ptr %15, align 8, !tbaa !5
  store i32 13, ptr %17, align 4
  br label %138

134:                                              ; preds = %124
  br label %135

135:                                              ; preds = %134
  %136 = load i64, ptr %16, align 8, !tbaa !5
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %16, align 8, !tbaa !5
  br label %119, !llvm.loop !13

138:                                              ; preds = %132, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %15, align 8, !tbaa !5
  %141 = icmp slt i64 %140, 0
  br i1 %141, label %142, label %149

142:                                              ; preds = %139
  %143 = invoke i32 @puts(ptr noundef @.str.3)
          to label %144 unwind label %145

144:                                              ; preds = %142
  br label %177

145:                                              ; preds = %174, %142
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %6, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %7, align 4
  br label %178

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

150:                                              ; preds = %171, %149
  %151 = load i64, ptr %18, align 8, !tbaa !5
  %152 = load i64, ptr %3, align 8, !tbaa !5
  %153 = icmp sle i64 %151, %152
  br i1 %153, label %155, label %154

154:                                              ; preds = %150
  store i32 16, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %174

155:                                              ; preds = %150
  %156 = load i64, ptr %18, align 8, !tbaa !5
  %157 = load i64, ptr %15, align 8, !tbaa !5
  %158 = icmp eq i64 %156, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %155
  br label %171

160:                                              ; preds = %155
  %161 = load i64, ptr %18, align 8, !tbaa !5
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %161) #6
  %163 = load i64, ptr %162, align 8, !tbaa !5
  %164 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %163)
          to label %165 unwind label %166

165:                                              ; preds = %160
  br label %170

166:                                              ; preds = %160
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %6, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %178

170:                                              ; preds = %165
  br label %171

171:                                              ; preds = %170, %159
  %172 = load i64, ptr %18, align 8, !tbaa !5
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %18, align 8, !tbaa !5
  br label %150, !llvm.loop !14

174:                                              ; preds = %154
  %175 = invoke i32 @puts(ptr noundef @.str.2)
          to label %176 unwind label %145

176:                                              ; preds = %174
  br label %177

177:                                              ; preds = %176, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %179

178:                                              ; preds = %166, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %180

179:                                              ; preds = %177, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %20, !llvm.loop !15

180:                                              ; preds = %178, %107, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %181

181:                                              ; preds = %180, %66, %47
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %182

182:                                              ; preds = %181, %35
  call void @llvm.lifetime.end.p0(i64 24, 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 %185

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

185:                                              ; preds = %182
  %186 = load ptr, ptr %6, align 8
  %187 = load i32, ptr %7, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

; 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

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 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 [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 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) #6
  %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
  %.not61 = icmp eq i64 %6, 0
  br i1 %.not61, label %._crit_edge64, label %.lr.ph63

.lr.ph63:                                         ; preds = %0, %._crit_edge60
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %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) #6
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = add nsw i64 %9, 2
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %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 %10, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %11 unwind label %18

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

._crit_edge:                                      ; preds = %.lr.ph, %11
  %14 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %15 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %14, ptr %15)
          to label %.preheader41 unwind label %29

.preheader41:                                     ; preds = %._crit_edge
  %16 = load i64, ptr %2, align 8, !tbaa !5
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph46, label %._crit_edge47

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

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

._crit_edge47:                                    ; preds = %.lr.ph46, %.preheader41
  %.032.lcssa = phi i64 [ 0, %.preheader41 ], [ %33, %.lr.ph46 ]
  %.lcssa = phi i64 [ %16, %.preheader41 ], [ %35, %.lr.ph46 ]
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.lcssa) #6
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = icmp eq i64 %.032.lcssa, %25
  %27 = load i64, ptr %2, align 8, !tbaa !5
  br i1 %26, label %.preheader, label %43

.preheader:                                       ; preds = %._crit_edge47
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph59, label %._crit_edge60

29:                                               ; preds = %._crit_edge
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %70

.lr.ph46:                                         ; preds = %.preheader41, %.lr.ph46
  %.03145 = phi i64 [ %34, %.lr.ph46 ], [ 0, %.preheader41 ]
  %.03244 = phi i64 [ %33, %.lr.ph46 ], [ 0, %.preheader41 ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03145) #6
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = add nsw i64 %32, %.03244
  %34 = add nuw nsw i64 %.03145, 1
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph46, label %._crit_edge47, !llvm.loop !11

.lr.ph59:                                         ; preds = %.preheader, %.lr.ph59
  %.03058 = phi i64 [ %40, %.lr.ph59 ], [ 0, %.preheader ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03058) #6
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %38)
  %40 = add nuw nsw i64 %.03058, 1
  %41 = load i64, ptr %2, align 8, !tbaa !5
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph59, label %._crit_edge60, !llvm.loop !12

43:                                               ; preds = %._crit_edge47
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %27) #6
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = add nsw i64 %45, %.032.lcssa
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = load i64, ptr %2, align 8, !tbaa !5
  %.not3749 = icmp slt i64 %49, 0
  br i1 %.not3749, label %._crit_edge60, label %.lr.ph52

.lr.ph52:                                         ; preds = %43, %55
  %.02750 = phi i64 [ %56, %55 ], [ 0, %43 ]
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02750) #6
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = add nsw i64 %51, %48
  %53 = icmp eq i64 %52, %46
  br i1 %53, label %.preheader40, label %55

.preheader40:                                     ; preds = %.lr.ph52
  %54 = load i64, ptr %2, align 8, !tbaa !5
  %.not3854 = icmp slt i64 %54, 0
  br i1 %.not3854, label %._crit_edge60, label %.lr.ph56

55:                                               ; preds = %.lr.ph52
  %56 = add nuw nsw i64 %.02750, 1
  %57 = load i64, ptr %2, align 8, !tbaa !5
  %.not37.not = icmp slt i64 %.02750, %57
  br i1 %.not37.not, label %.lr.ph52, label %._crit_edge60, !llvm.loop !13

.lr.ph56:                                         ; preds = %.preheader40, %64
  %58 = phi i64 [ %65, %64 ], [ %54, %.preheader40 ]
  %.055 = phi i64 [ %66, %64 ], [ 0, %.preheader40 ]
  %59 = icmp eq i64 %.055, %.02750
  br i1 %59, label %64, label %60

60:                                               ; preds = %.lr.ph56
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.055) #6
  %62 = load i64, ptr %61, align 8, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %62)
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %.lr.ph56, %60
  %65 = phi i64 [ %58, %.lr.ph56 ], [ %.pre, %60 ]
  %66 = add nuw nsw i64 %.055, 1
  %.not38.not = icmp slt i64 %.055, %65
  br i1 %.not38.not, label %.lr.ph56, label %._crit_edge60, !llvm.loop !14

._crit_edge60:                                    ; preds = %55, %64, %.lr.ph59, %.preheader40, %43, %.preheader
  %.str.3.sink = phi ptr [ @.str.2, %.preheader ], [ @.str.3, %43 ], [ @.str.2, %.preheader40 ], [ @.str.2, %.lr.ph59 ], [ @.str.2, %64 ], [ @.str.3, %55 ]
  %67 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %68 = load i64, ptr %1, align 8, !tbaa !5
  %69 = add nsw i64 %68, -1
  store i64 %69, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %68, 0
  br i1 %.not, label %._crit_edge64, label %.lr.ph63, !llvm.loop !15

70:                                               ; preds = %29, %18
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, 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

._crit_edge64:                                    ; preds = %._crit_edge60, %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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass