; LLVM IR from DionysiosB/CodeForces :: CodeforcesEDU (BinarySearch2D-ChildrenHoliday)

; 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<assistant, std::allocator<assistant>>::_Vector_impl" }
%"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl" = type { %"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl_data" }
%"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.assistant = type { i64, i64, i64 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkRKSt6vectorI9assistantSaIS0_EExx(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI9assistantSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 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 norecurse uwtable
define dso_local noundef i32 @main() #2 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 i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = 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
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %20 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @_ZNSaI9assistantEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorI9assistantSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %20, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %21 unwind label %27

21:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI9assistantED2Ev(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 %22

22:                                               ; preds = %43, %21
  %23 = load i64, ptr %8, align 8, !tbaa !5
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %31, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %50

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %7, align 4
  call void @_ZNSt15__new_allocatorI9assistantED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  br label %177

31:                                               ; preds = %22
  %32 = load i64, ptr %8, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %32) #5
  %34 = getelementptr inbounds %struct.assistant, ptr %33, i32 0, i32 0
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %35) #5
  %37 = getelementptr inbounds %struct.assistant, ptr %36, i32 0, i32 1
  %38 = load i64, ptr %8, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %38) #5
  %40 = getelementptr inbounds %struct.assistant, ptr %39, i32 0, i32 2
  %41 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %34, ptr noundef %37, ptr noundef %40)
          to label %42 unwind label %46

42:                                               ; preds = %31
  br label %43

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

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

50:                                               ; preds = %26
  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 1000000000000000000, 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
  br label %51

51:                                               ; preds = %70, %50
  %52 = load i64, ptr %9, align 8, !tbaa !5
  %53 = load i64, ptr %10, align 8, !tbaa !5
  %54 = icmp sle i64 %52, %53
  br i1 %54, label %55, label %71

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = load i64, ptr %9, align 8, !tbaa !5
  %57 = load i64, ptr %10, align 8, !tbaa !5
  %58 = add nsw i64 %56, %57
  %59 = sdiv i64 %58, 2
  store i64 %59, ptr %12, align 8, !tbaa !5
  %60 = load i64, ptr %2, align 8, !tbaa !5
  %61 = load i64, ptr %12, align 8, !tbaa !5
  %62 = call noundef zeroext i1 @_Z5checkRKSt6vectorI9assistantSaIS0_EExx(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %60, i64 noundef %61)
  br i1 %62, label %63, label %67

63:                                               ; preds = %55
  %64 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %64, ptr %11, align 8, !tbaa !5
  %65 = load i64, ptr %12, align 8, !tbaa !5
  %66 = sub nsw i64 %65, 1
  store i64 %66, ptr %10, align 8, !tbaa !5
  br label %70

67:                                               ; preds = %55
  %68 = load i64, ptr %12, align 8, !tbaa !5
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %9, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %51, !llvm.loop !11

71:                                               ; preds = %51
  %72 = load i64, ptr %11, align 8, !tbaa !5
  %73 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %72)
          to label %74 unwind label %81

74:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %75 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %75, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !12
  br label %76

76:                                               ; preds = %159, %74
  %77 = load i64, ptr %14, align 8, !tbaa !12
  %78 = call noundef i64 @_ZNKSt6vectorI9assistantSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %85, label %80

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

81:                                               ; preds = %71
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %6, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %7, align 4
  br label %175

85:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %86 = load i64, ptr %14, align 8, !tbaa !12
  %87 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %86) #5
  %88 = getelementptr inbounds %struct.assistant, ptr %87, i32 0, i32 0
  %89 = load i64, ptr %88, align 8, !tbaa !14
  %90 = load i64, ptr %14, align 8, !tbaa !12
  %91 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %90) #5
  %92 = getelementptr inbounds %struct.assistant, ptr %91, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !16
  %94 = mul nsw i64 %89, %93
  %95 = load i64, ptr %14, align 8, !tbaa !12
  %96 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %95) #5
  %97 = getelementptr inbounds %struct.assistant, ptr %96, i32 0, i32 2
  %98 = load i64, ptr %97, align 8, !tbaa !17
  %99 = add nsw i64 %94, %98
  store i64 %99, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %100 = load i64, ptr %11, align 8, !tbaa !5
  %101 = load i64, ptr %15, align 8, !tbaa !5
  %102 = sdiv i64 %100, %101
  store i64 %102, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %103 = load i64, ptr %11, align 8, !tbaa !5
  %104 = load i64, ptr %15, align 8, !tbaa !5
  %105 = srem i64 %103, %104
  store i64 %105, ptr %17, align 8, !tbaa !5
  %106 = load i64, ptr %17, align 8, !tbaa !5
  %107 = load i64, ptr %14, align 8, !tbaa !12
  %108 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %107) #5
  %109 = getelementptr inbounds %struct.assistant, ptr %108, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !14
  %111 = load i64, ptr %14, align 8, !tbaa !12
  %112 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %111) #5
  %113 = getelementptr inbounds %struct.assistant, ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !16
  %115 = mul nsw i64 %110, %114
  %116 = icmp slt i64 %106, %115
  br i1 %116, label %117, label %119

117:                                              ; preds = %85
  %118 = load i64, ptr %17, align 8, !tbaa !5
  br label %129

119:                                              ; preds = %85
  %120 = load i64, ptr %14, align 8, !tbaa !12
  %121 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %120) #5
  %122 = getelementptr inbounds %struct.assistant, ptr %121, i32 0, i32 0
  %123 = load i64, ptr %122, align 8, !tbaa !14
  %124 = load i64, ptr %14, align 8, !tbaa !12
  %125 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %124) #5
  %126 = getelementptr inbounds %struct.assistant, ptr %125, i32 0, i32 1
  %127 = load i64, ptr %126, align 8, !tbaa !16
  %128 = mul nsw i64 %123, %127
  br label %129

129:                                              ; preds = %119, %117
  %130 = phi i64 [ %118, %117 ], [ %128, %119 ]
  store i64 %130, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %131 = load i64, ptr %16, align 8, !tbaa !5
  %132 = load i64, ptr %14, align 8, !tbaa !12
  %133 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %132) #5
  %134 = getelementptr inbounds %struct.assistant, ptr %133, i32 0, i32 1
  %135 = load i64, ptr %134, align 8, !tbaa !16
  %136 = mul nsw i64 %131, %135
  %137 = load i64, ptr %17, align 8, !tbaa !5
  %138 = load i64, ptr %14, align 8, !tbaa !12
  %139 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %138) #5
  %140 = getelementptr inbounds %struct.assistant, ptr %139, i32 0, i32 0
  %141 = load i64, ptr %140, align 8, !tbaa !14
  %142 = sdiv i64 %137, %141
  %143 = add nsw i64 %136, %142
  store i64 %143, ptr %18, align 8, !tbaa !5
  %144 = load i64, ptr %18, align 8, !tbaa !5
  %145 = load i64, ptr %13, align 8, !tbaa !5
  %146 = icmp slt i64 %144, %145
  br i1 %146, label %147, label %149

147:                                              ; preds = %129
  %148 = load i64, ptr %18, align 8, !tbaa !5
  br label %151

149:                                              ; preds = %129
  %150 = load i64, ptr %13, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %149, %147
  %152 = phi i64 [ %148, %147 ], [ %150, %149 ]
  store i64 %152, ptr %18, align 8, !tbaa !5
  %153 = load i64, ptr %18, align 8, !tbaa !5
  %154 = load i64, ptr %13, align 8, !tbaa !5
  %155 = sub nsw i64 %154, %153
  store i64 %155, ptr %13, align 8, !tbaa !5
  %156 = load i64, ptr %18, align 8, !tbaa !5
  %157 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %156)
          to label %158 unwind label %162

158:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  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 %159

159:                                              ; preds = %158
  %160 = load i64, ptr %14, align 8, !tbaa !12
  %161 = add nsw i64 %160, 1
  store i64 %161, ptr %14, align 8, !tbaa !12
  br label %76, !llvm.loop !18

162:                                              ; preds = %151
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %6, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %174

166:                                              ; preds = %80
  %167 = invoke i32 @puts(ptr noundef @.str.4)
          to label %168 unwind label %170

168:                                              ; preds = %166
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #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 @_ZNSt6vectorI9assistantSaIS0_EED2Ev(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
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %169 = load i32, ptr %1, align 4
  ret i32 %169

170:                                              ; preds = %166
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %6, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %7, align 4
  br label %174

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

175:                                              ; preds = %174, %81
  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 %176

176:                                              ; preds = %175, %46
  call void @_ZNSt6vectorI9assistantSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %177

177:                                              ; preds = %176, %27
  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 %178

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

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

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

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

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

declare i32 @puts(ptr noundef) #3

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS9assistant", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!15, !6, i64 16}
!18 = distinct !{!18, !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<assistant, std::allocator<assistant>>::_Vector_impl" }
%"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl" = type { %"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl_data" }
%"struct.std::_Vector_base<assistant, std::allocator<assistant>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkRKSt6vectorI9assistantSaIS0_EExx(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI9assistantSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %6 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaI9assistantEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorI9assistantSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %6, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %7 unwind label %10

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

10:                                               ; preds = %0
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI9assistantED2Ev(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 } %11

.lr.ph:                                           ; preds = %7, %.lr.ph
  %.050 = phi i64 [ %18, %.lr.ph ], [ 0, %7 ]
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.050) #6
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.050) #6
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.050) #6
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12, ptr noundef nonnull %14, ptr noundef nonnull %16)
  %18 = add nuw nsw i64 %.050, 1
  %19 = load i64, ptr %2, align 8, !tbaa !5
  %20 = icmp slt i64 %18, %19
  br i1 %20, label %.lr.ph, label %.preheader.preheader, !llvm.loop !9

.preheader.preheader:                             ; preds = %.lr.ph, %7
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.04253 = phi i64 [ %.1, %.preheader ], [ 0, %.preheader.preheader ]
  %.04552 = phi i64 [ %.146, %.preheader ], [ 1000000000000000000, %.preheader.preheader ]
  %.04751 = phi i64 [ %.148, %.preheader ], [ 0, %.preheader.preheader ]
  %21 = add nsw i64 %.04253, %.04552
  %22 = sdiv i64 %21, 2
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_Z5checkRKSt6vectorI9assistantSaIS0_EExx(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %23, i64 noundef %22)
  %25 = add nsw i64 %22, -1
  %26 = add nsw i64 %22, 1
  %.148 = select i1 %24, i64 %22, i64 %.04751
  %.146 = select i1 %24, i64 %25, i64 %.04552
  %.1 = select i1 %24, i64 %.04253, i64 %26
  %.not = icmp sgt i64 %.1, %.146
  br i1 %.not, label %27, label %.preheader, !llvm.loop !11

27:                                               ; preds = %.preheader
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.148)
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNKSt6vectorI9assistantSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.not57 = icmp eq i64 %30, 0
  br i1 %.not57, label %._crit_edge, label %.lr.ph56

._crit_edge:                                      ; preds = %58, %27
  %31 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @_ZNSt6vectorI9assistantSaIS0_EED2Ev(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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph56:                                         ; preds = %27, %58
  %.04355 = phi i64 [ %71, %58 ], [ 0, %27 ]
  %.04454 = phi i64 [ %69, %58 ], [ %29, %27 ]
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %33 = load i64, ptr %32, align 8, !tbaa !12
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !14
  %37 = mul nsw i64 %36, %33
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load i64, ptr %39, align 8, !tbaa !15
  %41 = add nsw i64 %40, %37
  %42 = sdiv i64 %.148, %41
  %43 = srem i64 %.148, %41
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %45 = load i64, ptr %44, align 8, !tbaa !12
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %48 = load i64, ptr %47, align 8, !tbaa !14
  %49 = mul nsw i64 %48, %45
  %50 = icmp slt i64 %43, %49
  br i1 %50, label %58, label %51

51:                                               ; preds = %.lr.ph56
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %53 = load i64, ptr %52, align 8, !tbaa !12
  %54 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load i64, ptr %55, align 8, !tbaa !14
  %57 = mul nsw i64 %56, %53
  br label %58

58:                                               ; preds = %.lr.ph56, %51
  %59 = phi i64 [ %57, %51 ], [ %43, %.lr.ph56 ]
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  %62 = load i64, ptr %61, align 8, !tbaa !14
  %63 = mul nsw i64 %62, %42
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04355) #6
  %65 = load i64, ptr %64, align 8, !tbaa !12
  %66 = sdiv i64 %59, %65
  %67 = add nsw i64 %66, %63
  %68 = call i64 @llvm.smin.i64(i64 %67, i64 %.04454)
  %69 = sub nsw i64 %.04454, %68
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %68)
  %71 = add nuw nsw i64 %.04355, 1
  %72 = call noundef i64 @_ZNKSt6vectorI9assistantSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %73 = icmp ult i64 %71, %72
  br i1 %73, label %.lr.ph56, label %._crit_edge, !llvm.loop !16
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI9assistantSaIS0_EEC2EmRKS1_(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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI9assistantSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 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 = !{!13, !6, i64 0}
!13 = !{!"_ZTS9assistant", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!13, !6, i64 8}
!15 = !{!13, !6, i64 16}
!16 = distinct !{!16, !10}


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