; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (231B-MagicWizardryAndWonders)

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

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

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, 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 i64, align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = add nsw i64 %26, 1
  %28 = sdiv i64 %27, 2
  store i64 %28, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = sdiv i64 %29, 2
  store i64 %30, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %31 = load i64, ptr %5, align 8, !tbaa !5
  %32 = mul nsw i64 %31, 1
  %33 = load i64, ptr %6, align 8, !tbaa !5
  %34 = load i64, ptr %4, align 8, !tbaa !5
  %35 = mul nsw i64 %33, %34
  %36 = sub nsw i64 %32, %35
  store i64 %36, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %37 = load i64, ptr %5, align 8, !tbaa !5
  %38 = load i64, ptr %4, align 8, !tbaa !5
  %39 = mul nsw i64 %37, %38
  %40 = load i64, ptr %6, align 8, !tbaa !5
  %41 = mul nsw i64 %40, 1
  %42 = sub nsw i64 %39, %41
  store i64 %42, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %43 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %43, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %44 unwind label %55

44:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %45 = load i64, ptr %3, align 8, !tbaa !5
  %46 = load i64, ptr %7, align 8, !tbaa !5
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %52, label %48

48:                                               ; preds = %44
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = load i64, ptr %8, align 8, !tbaa !5
  %51 = icmp sgt i64 %49, %50
  br i1 %51, label %52, label %63

52:                                               ; preds = %48, %44
  %53 = invoke i32 @puts(ptr noundef @.str.1)
          to label %54 unwind label %59

54:                                               ; preds = %52
  br label %188

55:                                               ; preds = %0
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %12, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %13, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %191

59:                                               ; preds = %185, %52
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %12, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %13, align 4
  br label %190

63:                                               ; preds = %48
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = icmp sgt i64 %64, 0
  br i1 %65, label %66, label %117

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 1, ptr %14, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %75, %66
  %68 = load i64, ptr %14, align 8, !tbaa !5
  %69 = load i64, ptr %2, align 8, !tbaa !5
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

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

72:                                               ; preds = %67
  %73 = load i64, ptr %14, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %73) #5
  store i64 1, ptr %74, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %72
  %76 = load i64, ptr %14, align 8, !tbaa !5
  %77 = add nsw i64 %76, 2
  store i64 %77, ptr %14, align 8, !tbaa !5
  br label %67, !llvm.loop !9

78:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %79 = load i64, ptr %3, align 8, !tbaa !5
  %80 = load i64, ptr %6, align 8, !tbaa !5
  %81 = add nsw i64 %79, %80
  store i64 %81, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %82 = load i64, ptr %15, align 8, !tbaa !5
  %83 = load i64, ptr %5, align 8, !tbaa !5
  %84 = sdiv i64 %82, %83
  store i64 %84, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %85 = load i64, ptr %15, align 8, !tbaa !5
  %86 = load i64, ptr %5, align 8, !tbaa !5
  %87 = srem i64 %85, %86
  store i64 %87, ptr %17, align 8, !tbaa !5
  %88 = load i64, ptr %16, align 8, !tbaa !5
  %89 = icmp eq i64 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %78
  store i64 1, ptr %16, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 1) #5
  store i64 2, ptr %91, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %90, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %113, %92
  %94 = load i64, ptr %18, align 8, !tbaa !5
  %95 = load i64, ptr %5, align 8, !tbaa !5
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %116

98:                                               ; preds = %93
  %99 = load i64, ptr %16, align 8, !tbaa !5
  %100 = load i64, ptr %18, align 8, !tbaa !5
  %101 = mul nsw i64 2, %100
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %101) #5
  store i64 %99, ptr %102, align 8, !tbaa !5
  %103 = load i64, ptr %18, align 8, !tbaa !5
  %104 = load i64, ptr %17, align 8, !tbaa !5
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %106, label %112

106:                                              ; preds = %98
  %107 = load i64, ptr %18, align 8, !tbaa !5
  %108 = mul nsw i64 2, %107
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %108) #5
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %109, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %106, %98
  br label %113

113:                                              ; preds = %112
  %114 = load i64, ptr %18, align 8, !tbaa !5
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %18, align 8, !tbaa !5
  br label %93, !llvm.loop !11

116:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %166

117:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %126, %117
  %119 = load i64, ptr %19, align 8, !tbaa !5
  %120 = load i64, ptr %2, align 8, !tbaa !5
  %121 = icmp slt i64 %119, %120
  br i1 %121, label %123, label %122

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

123:                                              ; preds = %118
  %124 = load i64, ptr %19, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %124) #5
  store i64 1, ptr %125, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %123
  %127 = load i64, ptr %19, align 8, !tbaa !5
  %128 = add nsw i64 %127, 2
  store i64 %128, ptr %19, align 8, !tbaa !5
  br label %118, !llvm.loop !12

129:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %130 = load i64, ptr %3, align 8, !tbaa !5
  %131 = sub nsw i64 0, %130
  %132 = load i64, ptr %5, align 8, !tbaa !5
  %133 = add nsw i64 %131, %132
  store i64 %133, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %134 = load i64, ptr %20, align 8, !tbaa !5
  %135 = load i64, ptr %6, align 8, !tbaa !5
  %136 = sdiv i64 %134, %135
  store i64 %136, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %137 = load i64, ptr %20, align 8, !tbaa !5
  %138 = load i64, ptr %6, align 8, !tbaa !5
  %139 = srem i64 %137, %138
  store i64 %139, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store i64 0, ptr %23, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %162, %129
  %141 = load i64, ptr %23, align 8, !tbaa !5
  %142 = load i64, ptr %6, align 8, !tbaa !5
  %143 = icmp slt i64 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %165

145:                                              ; preds = %140
  %146 = load i64, ptr %21, align 8, !tbaa !5
  %147 = load i64, ptr %23, align 8, !tbaa !5
  %148 = mul nsw i64 2, %147
  %149 = add nsw i64 %148, 1
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %149) #5
  store i64 %146, ptr %150, align 8, !tbaa !5
  %151 = load i64, ptr %23, align 8, !tbaa !5
  %152 = load i64, ptr %22, align 8, !tbaa !5
  %153 = icmp slt i64 %151, %152
  br i1 %153, label %154, label %161

154:                                              ; preds = %145
  %155 = load i64, ptr %23, align 8, !tbaa !5
  %156 = mul nsw i64 2, %155
  %157 = add nsw i64 %156, 1
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %157) #5
  %159 = load i64, ptr %158, align 8, !tbaa !5
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %158, align 8, !tbaa !5
  br label %161

161:                                              ; preds = %154, %145
  br label %162

162:                                              ; preds = %161
  %163 = load i64, ptr %23, align 8, !tbaa !5
  %164 = add nsw i64 %163, 1
  store i64 %164, ptr %23, align 8, !tbaa !5
  br label %140, !llvm.loop !13

165:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %166

166:                                              ; preds = %165, %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store i64 0, ptr %24, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %178, %166
  %168 = load i64, ptr %24, align 8, !tbaa !5
  %169 = load i64, ptr %2, align 8, !tbaa !5
  %170 = icmp slt i64 %168, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %185

172:                                              ; preds = %167
  %173 = load i64, ptr %24, align 8, !tbaa !5
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %173) #5
  %175 = load i64, ptr %174, align 8, !tbaa !5
  %176 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %175)
          to label %177 unwind label %181

177:                                              ; preds = %172
  br label %178

178:                                              ; preds = %177
  %179 = load i64, ptr %24, align 8, !tbaa !5
  %180 = add nsw i64 %179, 1
  store i64 %180, ptr %24, align 8, !tbaa !5
  br label %167, !llvm.loop !14

181:                                              ; preds = %172
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %12, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %190

185:                                              ; preds = %171
  %186 = invoke i32 @puts(ptr noundef @.str.3)
          to label %187 unwind label %59

187:                                              ; preds = %185
  br label %188

188:                                              ; preds = %187, %54
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  %189 = load i32, ptr %1, align 4
  ret i32 %189

190:                                              ; preds = %181, %59
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %191

191:                                              ; preds = %190, %55
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 %192

192:                                              ; preds = %191
  %193 = load ptr, ptr %12, align 8
  %194 = load i32, ptr %13, align 4
  %195 = insertvalue { ptr, i32 } poison, ptr %193, 0
  %196 = insertvalue { ptr, i32 } %195, i32 %194, 1
  resume { ptr, i32 } %196
}

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

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

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

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

declare i32 @puts(ptr noundef) #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

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

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

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

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

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

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

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 i64, align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 0, ptr %3, align 8, !tbaa !5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = add nsw i64 %8, 1
  %10 = sdiv i64 %9, 2
  %11 = sdiv i64 %8, 2
  %12 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %8, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %13 unwind label %21

13:                                               ; preds = %0
  %14 = mul nsw i64 %10, %12
  %15 = sub nsw i64 %14, %11
  %16 = mul nsw i64 %11, %12
  %17 = sub nsw i64 %10, %16
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = icmp slt i64 %18, %17
  %20 = icmp sgt i64 %18, %15
  %or.cond = select i1 %19, i1 true, i1 %20
  br i1 %or.cond, label %._crit_edge67, label %23

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

23:                                               ; preds = %13
  %24 = icmp sgt i64 %18, 0
  %25 = load i64, ptr %1, align 8, !tbaa !5
  br i1 %24, label %.preheader, label %.preheader53

.preheader53:                                     ; preds = %23
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %23
  %27 = icmp sgt i64 %25, 1
  br i1 %27, label %.lr.ph59, label %._crit_edge60

._crit_edge60.loopexit:                           ; preds = %.lr.ph59
  %.pre70 = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %._crit_edge60.loopexit, %.preheader
  %28 = phi i64 [ %.pre70, %._crit_edge60.loopexit ], [ %18, %.preheader ]
  %29 = add nsw i64 %28, %11
  %30 = sdiv i64 %29, %10
  %31 = srem i64 %29, %10
  %32 = icmp eq i64 %30, 0
  br i1 %32, label %37, label %39

.lr.ph59:                                         ; preds = %.preheader, %.lr.ph59
  %.04558 = phi i64 [ %34, %.lr.ph59 ], [ 1, %.preheader ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04558) #6
  store i64 1, ptr %33, align 8, !tbaa !5
  %34 = add nuw nsw i64 %.04558, 2
  %35 = load i64, ptr %1, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph59, label %._crit_edge60.loopexit, !llvm.loop !9

37:                                               ; preds = %._crit_edge60
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 1) #6
  store i64 2, ptr %38, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %37, %._crit_edge60
  %.049 = phi i64 [ 0, %37 ], [ %31, %._crit_edge60 ]
  %.046 = phi i64 [ 1, %37 ], [ %30, %._crit_edge60 ]
  %40 = icmp sgt i64 %8, 0
  br i1 %40, label %.lr.ph63.preheader, label %.loopexit

.lr.ph63.preheader:                               ; preds = %39
  %smax = call i64 @llvm.smax.i64(i64 %10, i64 1)
  br label %.lr.ph63

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %48
  %.04861 = phi i64 [ %49, %48 ], [ 0, %.lr.ph63.preheader ]
  %41 = shl nuw nsw i64 %.04861, 1
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %41) #6
  store i64 %.046, ptr %42, align 8, !tbaa !5
  %43 = icmp slt i64 %.04861, %.049
  br i1 %43, label %44, label %48

44:                                               ; preds = %.lr.ph63
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %41) #6
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %.lr.ph63, %44
  %49 = add nuw nsw i64 %.04861, 1
  %exitcond69.not = icmp eq i64 %49, %smax
  br i1 %exitcond69.not, label %.loopexit, label %.lr.ph63, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader53
  %50 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %18, %.preheader53 ]
  %51 = sub i64 %10, %50
  %52 = sdiv i64 %51, %11
  %53 = srem i64 %51, %11
  %54 = icmp sgt i64 %8, 1
  br i1 %54, label %.lr.ph57, label %.loopexit

.lr.ph:                                           ; preds = %.preheader53, %.lr.ph
  %.04754 = phi i64 [ %56, %.lr.ph ], [ 0, %.preheader53 ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04754) #6
  store i64 1, ptr %55, align 8, !tbaa !5
  %56 = add nuw nsw i64 %.04754, 2
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

.lr.ph57:                                         ; preds = %._crit_edge, %67
  %.04455 = phi i64 [ %68, %67 ], [ 0, %._crit_edge ]
  %59 = shl nuw nsw i64 %.04455, 1
  %60 = or disjoint i64 %59, 1
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %60) #6
  store i64 %52, ptr %61, align 8, !tbaa !5
  %62 = icmp slt i64 %.04455, %53
  br i1 %62, label %63, label %67

63:                                               ; preds = %.lr.ph57
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %60) #6
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %64, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %.lr.ph57, %63
  %68 = add nuw nsw i64 %.04455, 1
  %exitcond.not = icmp eq i64 %68, %11
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph57, !llvm.loop !13

.loopexit:                                        ; preds = %67, %48, %._crit_edge, %39
  %69 = load i64, ptr %1, align 8, !tbaa !5
  %70 = icmp sgt i64 %69, 0
  br i1 %70, label %.lr.ph66, label %._crit_edge67

.lr.ph66:                                         ; preds = %.loopexit, %.lr.ph66
  %.064 = phi i64 [ %74, %.lr.ph66 ], [ 0, %.loopexit ]
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.064) #6
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %72)
  %74 = add nuw nsw i64 %.064, 1
  %75 = load i64, ptr %1, align 8, !tbaa !5
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %.lr.ph66, label %._crit_edge67, !llvm.loop !14

._crit_edge67:                                    ; preds = %.lr.ph66, %.loopexit, %13
  %.str.3.sink = phi ptr [ @.str.1, %13 ], [ @.str.3, %.loopexit ], [ @.str.3, %.lr.ph66 ]
  %77 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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", !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,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass