; LLVM IR from DionysiosB/CodeForces :: 1989C-TwoMovies (main)

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

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

@.str = external hidden unnamed_addr constant [4 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

; 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 i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %19

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

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %25 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %32

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

27:                                               ; preds = %41, %26
  %28 = load i64, ptr %8, align 8, !tbaa !5
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %48

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

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

40:                                               ; preds = %36
  br label %41

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

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

48:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, 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 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %108, %48
  %50 = load i64, ptr %13, align 8, !tbaa !5
  %51 = load i64, ptr %3, align 8, !tbaa !5
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %55 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
          to label %56 unwind label %67

56:                                               ; preds = %54
  %57 = load i64, ptr %13, align 8, !tbaa !5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %57) #5
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %71

61:                                               ; preds = %56
  %62 = load i32, ptr %14, align 4, !tbaa !11
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %71

64:                                               ; preds = %61
  %65 = load i64, ptr %11, align 8, !tbaa !5
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %11, align 8, !tbaa !5
  br label %107

67:                                               ; preds = %54
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %6, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %203

71:                                               ; preds = %61, %56
  %72 = load i64, ptr %13, align 8, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %72) #5
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %71
  %77 = load i32, ptr %14, align 4, !tbaa !11
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  %80 = load i64, ptr %12, align 8, !tbaa !5
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %12, align 8, !tbaa !5
  br label %106

82:                                               ; preds = %76, %71
  %83 = load i64, ptr %13, align 8, !tbaa !5
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %83) #5
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %87, label %93

87:                                               ; preds = %82
  %88 = load i32, ptr %14, align 4, !tbaa !11
  %89 = icmp sle i32 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  %91 = load i64, ptr %9, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %9, align 8, !tbaa !5
  br label %105

93:                                               ; preds = %87, %82
  %94 = load i64, ptr %13, align 8, !tbaa !5
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %94) #5
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = icmp sle i32 %96, 0
  br i1 %97, label %98, label %104

98:                                               ; preds = %93
  %99 = load i32, ptr %14, align 4, !tbaa !11
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %101, label %104

101:                                              ; preds = %98
  %102 = load i64, ptr %10, align 8, !tbaa !5
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %10, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %101, %98, %93
  br label %105

105:                                              ; preds = %104, %90
  br label %106

106:                                              ; preds = %105, %79
  br label %107

107:                                              ; preds = %106, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %108

108:                                              ; preds = %107
  %109 = load i64, ptr %13, align 8, !tbaa !5
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %13, align 8, !tbaa !5
  br label %49, !llvm.loop !13

111:                                              ; preds = %53
  %112 = load i64, ptr %9, align 8, !tbaa !5
  %113 = load i64, ptr %10, align 8, !tbaa !5
  %114 = icmp sgt i64 %112, %113
  br i1 %114, label %115, label %119

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %116 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %116, ptr %15, align 8, !tbaa !5
  %117 = load i64, ptr %10, align 8, !tbaa !5
  store i64 %117, ptr %9, align 8, !tbaa !5
  %118 = load i64, ptr %15, align 8, !tbaa !5
  store i64 %118, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %119

119:                                              ; preds = %115, %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %120 = load i64, ptr %10, align 8, !tbaa !5
  %121 = load i64, ptr %9, align 8, !tbaa !5
  %122 = sub nsw i64 %120, %121
  store i64 %122, ptr %16, align 8, !tbaa !5
  %123 = load i64, ptr %16, align 8, !tbaa !5
  %124 = load i64, ptr %11, align 8, !tbaa !5
  %125 = icmp slt i64 %123, %124
  br i1 %125, label %126, label %128

126:                                              ; preds = %119
  %127 = load i64, ptr %16, align 8, !tbaa !5
  br label %130

128:                                              ; preds = %119
  %129 = load i64, ptr %11, align 8, !tbaa !5
  br label %130

130:                                              ; preds = %128, %126
  %131 = phi i64 [ %127, %126 ], [ %129, %128 ]
  store i64 %131, ptr %16, align 8, !tbaa !5
  %132 = load i64, ptr %16, align 8, !tbaa !5
  %133 = load i64, ptr %10, align 8, !tbaa !5
  %134 = sub nsw i64 %133, %132
  store i64 %134, ptr %10, align 8, !tbaa !5
  %135 = load i64, ptr %16, align 8, !tbaa !5
  %136 = load i64, ptr %11, align 8, !tbaa !5
  %137 = sub nsw i64 %136, %135
  store i64 %137, ptr %11, align 8, !tbaa !5
  %138 = load i64, ptr %10, align 8, !tbaa !5
  %139 = load i64, ptr %9, align 8, !tbaa !5
  %140 = sub nsw i64 %138, %139
  store i64 %140, ptr %16, align 8, !tbaa !5
  %141 = load i64, ptr %16, align 8, !tbaa !5
  %142 = load i64, ptr %12, align 8, !tbaa !5
  %143 = icmp slt i64 %141, %142
  br i1 %143, label %144, label %146

144:                                              ; preds = %130
  %145 = load i64, ptr %16, align 8, !tbaa !5
  br label %148

146:                                              ; preds = %130
  %147 = load i64, ptr %12, align 8, !tbaa !5
  br label %148

148:                                              ; preds = %146, %144
  %149 = phi i64 [ %145, %144 ], [ %147, %146 ]
  store i64 %149, ptr %16, align 8, !tbaa !5
  %150 = load i64, ptr %16, align 8, !tbaa !5
  %151 = load i64, ptr %9, align 8, !tbaa !5
  %152 = add nsw i64 %151, %150
  store i64 %152, ptr %9, align 8, !tbaa !5
  %153 = load i64, ptr %16, align 8, !tbaa !5
  %154 = load i64, ptr %12, align 8, !tbaa !5
  %155 = sub nsw i64 %154, %153
  store i64 %155, ptr %12, align 8, !tbaa !5
  %156 = load i64, ptr %11, align 8, !tbaa !5
  %157 = icmp ne i64 %156, 0
  br i1 %157, label %158, label %177

158:                                              ; preds = %148
  %159 = load i64, ptr %12, align 8, !tbaa !5
  %160 = icmp ne i64 %159, 0
  br i1 %160, label %161, label %177

161:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %162 = load i64, ptr %11, align 8, !tbaa !5
  %163 = load i64, ptr %12, align 8, !tbaa !5
  %164 = icmp slt i64 %162, %163
  br i1 %164, label %165, label %167

165:                                              ; preds = %161
  %166 = load i64, ptr %11, align 8, !tbaa !5
  br label %169

167:                                              ; preds = %161
  %168 = load i64, ptr %12, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %167, %165
  %170 = phi i64 [ %166, %165 ], [ %168, %167 ]
  store i64 %170, ptr %17, align 8, !tbaa !5
  %171 = load i64, ptr %17, align 8, !tbaa !5
  %172 = load i64, ptr %11, align 8, !tbaa !5
  %173 = sub nsw i64 %172, %171
  store i64 %173, ptr %11, align 8, !tbaa !5
  %174 = load i64, ptr %17, align 8, !tbaa !5
  %175 = load i64, ptr %12, align 8, !tbaa !5
  %176 = sub nsw i64 %175, %174
  store i64 %176, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %177

177:                                              ; preds = %169, %158, %148
  %178 = load i64, ptr %11, align 8, !tbaa !5
  %179 = icmp ne i64 %178, 0
  br i1 %179, label %180, label %186

180:                                              ; preds = %177
  %181 = load i64, ptr %11, align 8, !tbaa !5
  %182 = add nsw i64 %181, 1
  %183 = sdiv i64 %182, 2
  %184 = load i64, ptr %9, align 8, !tbaa !5
  %185 = sub nsw i64 %184, %183
  store i64 %185, ptr %9, align 8, !tbaa !5
  br label %195

186:                                              ; preds = %177
  %187 = load i64, ptr %12, align 8, !tbaa !5
  %188 = icmp ne i64 %187, 0
  br i1 %188, label %189, label %194

189:                                              ; preds = %186
  %190 = load i64, ptr %12, align 8, !tbaa !5
  %191 = sdiv i64 %190, 2
  %192 = load i64, ptr %9, align 8, !tbaa !5
  %193 = add nsw i64 %192, %191
  store i64 %193, ptr %9, align 8, !tbaa !5
  br label %194

194:                                              ; preds = %189, %186
  br label %195

195:                                              ; preds = %194, %180
  %196 = load i64, ptr %9, align 8, !tbaa !5
  %197 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %196)
          to label %198 unwind label %199

198:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %19, !llvm.loop !14

199:                                              ; preds = %195
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %6, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %203

203:                                              ; preds = %199, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %204

204:                                              ; preds = %203, %44
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %205

205:                                              ; preds = %204, %32
  call void @llvm.lifetime.end.p0(i64 24, 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 %208

206:                                              ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %207 = load i32, ptr %1, align 4
  ret i32 %207

208:                                              ; preds = %205
  %209 = load ptr, ptr %6, align 8
  %210 = load i32, ptr %7, align 4
  %211 = insertvalue { ptr, i32 } poison, ptr %209, 0
  %212 = insertvalue { ptr, i32 } %211, i32 %210, 1
  resume { ptr, i32 } %212
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(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 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(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 @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 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

; 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
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = add nsw i64 %7, -1
  store i64 %8, ptr %1, align 8, !tbaa !5
  %.not95 = icmp eq i64 %7, 0
  br i1 %.not95, label %._crit_edge98, label %.lr.ph97

.lr.ph97:                                         ; preds = %0, %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %9 = 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
  %10 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %10, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %11 unwind label %15

11:                                               ; preds = %.lr.ph97
  call void @_ZNSt15__new_allocatorIiED2Ev(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, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %14 = icmp sgt i64 %20, 0
  br i1 %14, label %.lr.ph91, label %._crit_edge

15:                                               ; preds = %.lr.ph97
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %16

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.085 = phi i64 [ %19, %.lr.ph ], [ 0, %11 ]
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.085) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %17)
  %19 = add nuw nsw i64 %.085, 1
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %63, %11, %.preheader
  %.074.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.175, %63 ]
  %.071.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.172, %63 ]
  %.067.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.168, %63 ]
  %.066.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.1, %63 ]
  %spec.select = call i64 @llvm.smax.i64(i64 %.066.lcssa, i64 %.067.lcssa)
  %spec.select81 = call i64 @llvm.smin.i64(i64 %.066.lcssa, i64 %.067.lcssa)
  %22 = sub nsw i64 %spec.select, %spec.select81
  %23 = call i64 @llvm.smin.i64(i64 %22, i64 %.074.lcssa)
  %24 = sub nsw i64 %.074.lcssa, %23
  %25 = add i64 %spec.select81, %23
  %26 = sub i64 %spec.select, %25
  %27 = call i64 @llvm.smin.i64(i64 %26, i64 %.071.lcssa)
  %28 = add nsw i64 %27, %spec.select81
  %29 = sub nsw i64 %.071.lcssa, %27
  %30 = icmp ne i64 %24, 0
  %31 = icmp ne i64 %29, 0
  %or.cond9 = select i1 %30, i1 %31, i1 false
  br i1 %or.cond9, label %67, label %71

.lr.ph91:                                         ; preds = %.preheader, %63
  %.06690 = phi i64 [ %.1, %63 ], [ 0, %.preheader ]
  %.06789 = phi i64 [ %.168, %63 ], [ 0, %.preheader ]
  %.07088 = phi i64 [ %64, %63 ], [ 0, %.preheader ]
  %.07187 = phi i64 [ %.172, %63 ], [ 0, %.preheader ]
  %.07486 = phi i64 [ %.175, %63 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.07088) #6
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp slt i32 %34, 0
  %36 = load i32, ptr %5, align 4
  %37 = icmp slt i32 %36, 0
  %or.cond = select i1 %35, i1 %37, i1 false
  br i1 %or.cond, label %38, label %40

38:                                               ; preds = %.lr.ph91
  %39 = add nsw i64 %.07486, 1
  br label %63

40:                                               ; preds = %.lr.ph91
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.07088) #6
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = icmp sgt i32 %42, 0
  %44 = load i32, ptr %5, align 4
  %45 = icmp sgt i32 %44, 0
  %or.cond3 = select i1 %43, i1 %45, i1 false
  br i1 %or.cond3, label %46, label %48

46:                                               ; preds = %40
  %47 = add nsw i64 %.07187, 1
  br label %63

48:                                               ; preds = %40
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.07088) #6
  %50 = load i32, ptr %49, align 4, !tbaa !11
  %51 = icmp sgt i32 %50, 0
  %52 = load i32, ptr %5, align 4
  %53 = icmp slt i32 %52, 1
  %or.cond5 = select i1 %51, i1 %53, i1 false
  br i1 %or.cond5, label %54, label %56

54:                                               ; preds = %48
  %55 = add nsw i64 %.06690, 1
  br label %63

56:                                               ; preds = %48
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.07088) #6
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = icmp slt i32 %58, 1
  %60 = load i32, ptr %5, align 4
  %61 = icmp sgt i32 %60, 0
  %or.cond7 = select i1 %59, i1 %61, i1 false
  %62 = zext i1 %or.cond7 to i64
  %spec.select82 = add nsw i64 %.06789, %62
  br label %63

63:                                               ; preds = %56, %46, %54, %38
  %.175 = phi i64 [ %39, %38 ], [ %.07486, %46 ], [ %.07486, %54 ], [ %.07486, %56 ]
  %.172 = phi i64 [ %.07187, %38 ], [ %47, %46 ], [ %.07187, %54 ], [ %.07187, %56 ]
  %.168 = phi i64 [ %.06789, %38 ], [ %.06789, %46 ], [ %.06789, %54 ], [ %spec.select82, %56 ]
  %.1 = phi i64 [ %.06690, %38 ], [ %.06690, %46 ], [ %55, %54 ], [ %.06690, %56 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %64 = add nuw nsw i64 %.07088, 1
  %65 = load i64, ptr %2, align 8, !tbaa !5
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %.lr.ph91, label %._crit_edge, !llvm.loop !13

67:                                               ; preds = %._crit_edge
  %68 = call i64 @llvm.smin.i64(i64 %24, i64 %29)
  %69 = sub nsw i64 %24, %68
  %70 = sub nsw i64 %29, %68
  br label %71

71:                                               ; preds = %67, %._crit_edge
  %.276 = phi i64 [ %69, %67 ], [ %24, %._crit_edge ]
  %.273 = phi i64 [ %70, %67 ], [ %29, %._crit_edge ]
  %.not79 = icmp eq i64 %.276, 0
  br i1 %.not79, label %75, label %72

72:                                               ; preds = %71
  %73 = add nsw i64 %.276, 1
  %.neg = sdiv i64 %73, -2
  %74 = add i64 %.neg, %28
  br label %79

75:                                               ; preds = %71
  %.not80 = icmp eq i64 %.273, 0
  br i1 %.not80, label %79, label %76

76:                                               ; preds = %75
  %77 = sdiv i64 %.273, 2
  %78 = add nsw i64 %77, %28
  br label %79

79:                                               ; preds = %75, %76, %72
  %.3 = phi i64 [ %74, %72 ], [ %78, %76 ], [ %28, %75 ]
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.3)
  call void @_ZNSt6vectorIiSaIiEED2Ev(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
  %81 = load i64, ptr %1, align 8, !tbaa !5
  %82 = add nsw i64 %81, -1
  store i64 %82, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %81, 0
  br i1 %.not, label %._crit_edge98, label %.lr.ph97, !llvm.loop !14

._crit_edge98:                                    ; preds = %79, %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 @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(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 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(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 @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(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.smin.i64(i64, i64) #5

; 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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass