; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (439C-DevuAndPartitioningTheArray)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [1 x i8], align 1

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

16:                                               ; preds = %36, %0
  %17 = load i64, ptr %7, align 8, !tbaa !5
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = icmp slt i64 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %39

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8)
          to label %23 unwind label %29

23:                                               ; preds = %21
  %24 = load i64, ptr %8, align 8, !tbaa !5
  %25 = and i64 %24, 1
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %23
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %28 unwind label %29

28:                                               ; preds = %27
  br label %35

29:                                               ; preds = %33, %27, %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %176

33:                                               ; preds = %23
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %34 unwind label %29

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %36

36:                                               ; preds = %35
  %37 = load i64, ptr %7, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  store i64 %38, ptr %7, align 8, !tbaa !5
  br label %16, !llvm.loop !9

39:                                               ; preds = %20
  %40 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %41 = load i64, ptr %3, align 8, !tbaa !5
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %43 = sub nsw i64 %41, %42
  %44 = icmp ult i64 %40, %43
  br i1 %44, label %64, label %45

45:                                               ; preds = %39
  %46 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %47 = load i64, ptr %3, align 8, !tbaa !5
  %48 = load i64, ptr %4, align 8, !tbaa !5
  %49 = sub nsw i64 %47, %48
  %50 = sub i64 %46, %49
  %51 = and i64 %50, 1
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %64, label %53

53:                                               ; preds = %45
  %54 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %55 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %56 = load i64, ptr %3, align 8, !tbaa !5
  %57 = load i64, ptr %4, align 8, !tbaa !5
  %58 = sub nsw i64 %56, %57
  %59 = sub i64 %55, %58
  %60 = udiv i64 %59, 2
  %61 = add i64 %54, %60
  %62 = load i64, ptr %4, align 8, !tbaa !5
  %63 = icmp ult i64 %61, %62
  br i1 %63, label %64, label %71

64:                                               ; preds = %53, %45, %39
  %65 = invoke i32 @puts(ptr noundef @.str.2)
          to label %66 unwind label %67

66:                                               ; preds = %64
  br label %174

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

71:                                               ; preds = %53
  %72 = invoke i32 @puts(ptr noundef @.str.3)
          to label %73 unwind label %67

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %74 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %74, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %75 = load i64, ptr %3, align 8, !tbaa !5
  %76 = load i64, ptr %4, align 8, !tbaa !5
  %77 = sub nsw i64 %75, %76
  store i64 %77, ptr %12, align 8, !tbaa !5
  %78 = load i64, ptr %11, align 8, !tbaa !5
  %79 = icmp sgt i64 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %73
  %81 = load i64, ptr %11, align 8, !tbaa !5
  %82 = add nsw i64 %81, -1
  store i64 %82, ptr %11, align 8, !tbaa !5
  br label %86

83:                                               ; preds = %73
  %84 = load i64, ptr %12, align 8, !tbaa !5
  %85 = add nsw i64 %84, -1
  store i64 %85, ptr %12, align 8, !tbaa !5
  br label %86

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

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

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %121

92:                                               ; preds = %87
  %93 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %94 = icmp ne i64 %93, 0
  br i1 %94, label %95, label %104

95:                                               ; preds = %92
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %97)
          to label %99 unwind label %100

99:                                               ; preds = %95
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %117

100:                                              ; preds = %107, %95
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %9, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %173

104:                                              ; preds = %92
  %105 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %106 = icmp ugt i64 %105, 1
  br i1 %106, label %107, label %116

107:                                              ; preds = %104
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %111 = sub i64 %110, 2
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %111) #5
  %113 = load i64, ptr %112, align 8, !tbaa !5
  %114 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %109, i64 noundef %113)
          to label %115 unwind label %100

115:                                              ; preds = %107
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %116

116:                                              ; preds = %115, %104
  br label %117

117:                                              ; preds = %116, %99
  br label %118

118:                                              ; preds = %117
  %119 = load i64, ptr %13, align 8, !tbaa !5
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %13, align 8, !tbaa !5
  br label %87, !llvm.loop !11

121:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %140, %121
  %123 = load i64, ptr %14, align 8, !tbaa !5
  %124 = load i64, ptr %12, align 8, !tbaa !5
  %125 = icmp slt i64 %123, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %143

127:                                              ; preds = %122
  %128 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %129 = icmp ne i64 %128, 0
  br i1 %129, label %130, label %139

130:                                              ; preds = %127
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %132)
          to label %134 unwind label %135

134:                                              ; preds = %130
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %139

135:                                              ; preds = %130
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %9, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %173

139:                                              ; preds = %134, %127
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %14, align 8, !tbaa !5
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %14, align 8, !tbaa !5
  br label %122, !llvm.loop !12

143:                                              ; preds = %126
  %144 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %145 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %146 = add i64 %144, %145
  %147 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %146)
          to label %148 unwind label %157

148:                                              ; preds = %143
  br label %149

149:                                              ; preds = %156, %148
  %150 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %152, label %161

152:                                              ; preds = %149
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %154 = load i64, ptr %153, align 8, !tbaa !5
  %155 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %154)
          to label %156 unwind label %157

156:                                              ; preds = %152
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %149, !llvm.loop !13

157:                                              ; preds = %170, %165, %152, %143
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %9, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %10, align 4
  br label %173

161:                                              ; preds = %149
  br label %162

162:                                              ; preds = %169, %161
  %163 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %164 = icmp ne i64 %163, 0
  br i1 %164, label %165, label %170

165:                                              ; preds = %162
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %167 = load i64, ptr %166, align 8, !tbaa !5
  %168 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %167)
          to label %169 unwind label %157

169:                                              ; preds = %165
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %162, !llvm.loop !14

170:                                              ; preds = %162
  %171 = invoke i32 @puts(ptr noundef @.str.7)
          to label %172 unwind label %157

172:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %174

173:                                              ; preds = %157, %135, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %176

174:                                              ; preds = %172, %66
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %175 = load i32, ptr %1, align 4
  ret i32 %175

176:                                              ; preds = %173, %67, %29
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr %9, align 8
  %179 = load i32, ptr %10, align 4
  %180 = insertvalue { ptr, i32 } poison, ptr %178, 0
  %181 = insertvalue { ptr, i32 } %180, i32 %179, 1
  resume { ptr, i32 } %181
}

; 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 @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare i32 @puts(ptr noundef) #2

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [1 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 %"class.std::vector", align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %21, %0
  %10 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = load i64, ptr %3, align 8, !tbaa !5
  %13 = sub nsw i64 %11, %12
  %14 = icmp ult i64 %10, %13
  br i1 %14, label %._crit_edge40, label %25

.lr.ph:                                           ; preds = %0, %21
  %.01628 = phi i64 [ %22, %21 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %16 = load i64, ptr %6, align 8, !tbaa !5
  %17 = and i64 %16, 1
  %.not23 = icmp eq i64 %17, 0
  %18 = select i1 %.not23, ptr %4, ptr %5
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %21 unwind label %19

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

21:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %22 = add nuw nsw i64 %.01628, 1
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !9

25:                                               ; preds = %._crit_edge
  %26 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %.neg = sub i64 %26, %27
  %29 = add i64 %.neg, %28
  %30 = and i64 %29, 1
  %.not = icmp eq i64 %30, 0
  br i1 %.not, label %31, label %._crit_edge40

31:                                               ; preds = %25
  %32 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %33 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %.neg18 = sub i64 %33, %34
  %36 = add i64 %.neg18, %35
  %37 = lshr i64 %36, 1
  %38 = add i64 %37, %32
  %39 = icmp ult i64 %38, %35
  br i1 %39, label %._crit_edge40, label %40

40:                                               ; preds = %31
  %41 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %42 = load i64, ptr %3, align 8, !tbaa !5
  %43 = load i64, ptr %2, align 8, !tbaa !5
  %44 = sub i64 %43, %42
  %45 = icmp sgt i64 %42, 0
  %46 = sext i1 %45 to i64
  %.015 = add nsw i64 %42, %46
  %not. = xor i1 %45, true
  %47 = sext i1 %not. to i64
  %.014 = add nsw i64 %44, %47
  %48 = icmp sgt i64 %.015, 0
  br i1 %48, label %.lr.ph31, label %.preheader27

.preheader27:                                     ; preds = %66, %40
  %49 = icmp sgt i64 %.014, 0
  br i1 %49, label %.lr.ph33, label %._crit_edge34

.lr.ph31:                                         ; preds = %40, %66
  %.01329 = phi i64 [ %67, %66 ], [ 0, %40 ]
  %50 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not22 = icmp eq i64 %50, 0
  br i1 %.not22, label %55, label %51

51:                                               ; preds = %.lr.ph31
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %53)
  br label %.sink.split

55:                                               ; preds = %.lr.ph31
  %56 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %57 = icmp ugt i64 %56, 1
  br i1 %57, label %58, label %66

58:                                               ; preds = %55
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %62 = add i64 %61, -2
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %62) #5
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %60, i64 noundef %64)
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %.sink.split

.sink.split:                                      ; preds = %58, %51
  %.sink = phi ptr [ %4, %51 ], [ %5, %58 ]
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %.sink) #5
  br label %66

66:                                               ; preds = %.sink.split, %55
  %67 = add nuw nsw i64 %.01329, 1
  %exitcond.not = icmp eq i64 %67, %.015
  br i1 %exitcond.not, label %.preheader27, label %.lr.ph31, !llvm.loop !11

._crit_edge34:                                    ; preds = %78, %.preheader27
  %68 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %69 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %70 = add i64 %69, %68
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %70)
  %72 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %.not1935 = icmp eq i64 %72, 0
  br i1 %.not1935, label %.preheader, label %.lr.ph37

.lr.ph33:                                         ; preds = %.preheader27, %78
  %.032 = phi i64 [ %79, %78 ], [ 0, %.preheader27 ]
  %73 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %.not21 = icmp eq i64 %73, 0
  br i1 %.not21, label %78, label %74

74:                                               ; preds = %.lr.ph33
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %76)
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %78

78:                                               ; preds = %.lr.ph33, %74
  %79 = add nuw nsw i64 %.032, 1
  %80 = icmp slt i64 %79, %.014
  br i1 %80, label %.lr.ph33, label %._crit_edge34, !llvm.loop !12

.preheader:                                       ; preds = %.lr.ph37, %._crit_edge34
  %81 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not2038 = icmp eq i64 %81, 0
  br i1 %.not2038, label %._crit_edge40, label %.lr.ph39

.lr.ph37:                                         ; preds = %._crit_edge34, %.lr.ph37
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %83)
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %85 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %.not19 = icmp eq i64 %85, 0
  br i1 %.not19, label %.preheader, label %.lr.ph37, !llvm.loop !13

.lr.ph39:                                         ; preds = %.preheader, %.lr.ph39
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %87)
  call void @_ZNSt6vectorIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %89 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not20 = icmp eq i64 %89, 0
  br i1 %.not20, label %._crit_edge40, label %.lr.ph39, !llvm.loop !14

._crit_edge40:                                    ; preds = %.lr.ph39, %.preheader, %._crit_edge, %25, %31
  %.str.7.sink = phi ptr [ @.str.2, %31 ], [ @.str.2, %25 ], [ @.str.2, %._crit_edge ], [ @.str.7, %.preheader ], [ @.str.7, %.lr.ph39 ]
  %90 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.7.sink)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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 @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass