; LLVM IR from viveakrt/Competitive-programing :: Codeforces (1083E_The_Fair_Nut_and_Rectangles)

; 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"

%struct.Rectangle = type { i64, i64, i64 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl" }
%"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl" = type { %"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%struct.Line = type { i64, i64 }
%"class.std::allocator" = type { i8 }

@arr = external dso_local global [1000005 x %struct.Rectangle], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z9IntersecX4LineS_(i64, i64, i64, i64) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %struct.Rectangle, align 8
  %8 = alloca %"class.std::deque", align 8
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [1 x %struct.Line], align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %struct.Line, align 8
  %19 = alloca %struct.Line, align 8
  %20 = alloca %struct.Line, align 8
  %21 = alloca %struct.Line, align 8
  %22 = alloca %struct.Line, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %40, %0
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %43

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #8
  %31 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  %32 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %32, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  %34 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %34, ptr %33, align 8, !tbaa !13
  %35 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %36 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %36, ptr %35, align 8, !tbaa !14
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %7, i64 24, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %40

40:                                               ; preds = %29
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %3, align 4, !tbaa !5
  br label %24, !llvm.loop !16

43:                                               ; preds = %28
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.Rectangle, ptr @arr, i64 %45
  %47 = getelementptr inbounds %struct.Rectangle, ptr %46, i64 1
  call void @_ZSt4sortIP9RectangleEvT_S2_(ptr noundef getelementptr inbounds (%struct.Rectangle, ptr @arr, i64 1), ptr noundef %47)
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  %48 = getelementptr inbounds %struct.Line, ptr %10, i32 0, i32 0
  store i64 0, ptr %48, align 8, !tbaa !18
  %49 = getelementptr inbounds %struct.Line, ptr %10, i32 0, i32 1
  store i64 0, ptr %49, align 8, !tbaa !20
  %50 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %50, align 8, !tbaa !21
  %51 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 1, ptr %51, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  call void @_ZNSaI4LineEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  %52 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %55 = load i64, ptr %54, align 8
  invoke void @_ZNSt5dequeI4LineSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr %53, i64 %55, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %56 unwind label %62

56:                                               ; preds = %43
  call void @_ZNSt15__new_allocatorI4LineED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %181, %56
  %58 = load i32, ptr %16, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %66, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %190

62:                                               ; preds = %43
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %13, align 4
  call void @_ZNSt15__new_allocatorI4LineED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  br label %200

66:                                               ; preds = %57
  br label %67

67:                                               ; preds = %96, %66
  %68 = load i32, ptr %14, align 4, !tbaa !5
  %69 = icmp sge i32 %68, 2
  br i1 %69, label %70, label %94

70:                                               ; preds = %67
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %8, i64 noundef %73) #8
  %75 = load i32, ptr %16, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.Rectangle, ptr %77, i32 0, i32 1
  %79 = load i64, ptr %78, align 8, !tbaa !13
  %80 = invoke noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %74, i64 noundef %79)
          to label %81 unwind label %99

81:                                               ; preds = %70
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 2
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %8, i64 noundef %84) #8
  %86 = load i32, ptr %16, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.Rectangle, ptr %88, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = invoke noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %85, i64 noundef %90)
          to label %92 unwind label %99

92:                                               ; preds = %81
  %93 = icmp sle i64 %80, %91
  br label %94

94:                                               ; preds = %92, %67
  %95 = phi i1 [ false, %67 ], [ %93, %92 ]
  br i1 %95, label %96, label %103

96:                                               ; preds = %94
  call void @_ZNSt5dequeI4LineSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %14, align 4, !tbaa !5
  br label %67, !llvm.loop !26

99:                                               ; preds = %81, %70
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %12, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %13, align 4
  br label %189

103:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.Rectangle, ptr %107, i32 0, i32 1
  %109 = load i64, ptr %108, align 8, !tbaa !13
  %110 = invoke noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %104, i64 noundef %109)
          to label %111 unwind label %173

111:                                              ; preds = %103
  %112 = load i32, ptr %16, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.Rectangle, ptr %114, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !11
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.Rectangle, ptr %119, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !13
  %122 = mul nsw i64 %116, %121
  %123 = add nsw i64 %110, %122
  %124 = load i32, ptr %16, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.Rectangle, ptr %126, i32 0, i32 2
  %128 = load i64, ptr %127, align 8, !tbaa !14
  %129 = sub nsw i64 %123, %128
  store i64 %129, ptr %17, align 8, !tbaa !9
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %131 unwind label %173

131:                                              ; preds = %111
  %132 = load i64, ptr %130, align 8, !tbaa !9
  store i64 %132, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  %133 = getelementptr inbounds %struct.Line, ptr %18, i32 0, i32 0
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %135
  %137 = getelementptr inbounds %struct.Rectangle, ptr %136, i32 0, i32 0
  %138 = load i64, ptr %137, align 8, !tbaa !11
  %139 = sub nsw i64 0, %138
  store i64 %139, ptr %133, align 8, !tbaa !18
  %140 = getelementptr inbounds %struct.Line, ptr %18, i32 0, i32 1
  %141 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %141, ptr %140, align 8, !tbaa !20
  br label %142

142:                                              ; preds = %170, %131
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = icmp sge i32 %143, 2
  br i1 %144, label %145, label %168

145:                                              ; preds = %142
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !27
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %8, i64 noundef 0) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %146, i64 16, i1 false), !tbaa.struct !27
  %147 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %148 = load i64, ptr %147, align 8
  %149 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %150 = load i64, ptr %149, align 8
  %151 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %152 = load i64, ptr %151, align 8
  %153 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %154 = load i64, ptr %153, align 8
  %155 = call noundef x86_fp80 @_Z9IntersecX4LineS_(i64 %148, i64 %150, i64 %152, i64 %154)
  %156 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %8, i64 noundef 0) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %156, i64 16, i1 false), !tbaa.struct !27
  %157 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %8, i64 noundef 1) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %157, i64 16, i1 false), !tbaa.struct !27
  %158 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %159 = load i64, ptr %158, align 8
  %160 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %161 = load i64, ptr %160, align 8
  %162 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 0
  %163 = load i64, ptr %162, align 8
  %164 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 1
  %165 = load i64, ptr %164, align 8
  %166 = call noundef x86_fp80 @_Z9IntersecX4LineS_(i64 %159, i64 %161, i64 %163, i64 %165)
  %167 = fcmp oge x86_fp80 %155, %166
  br label %168

168:                                              ; preds = %145, %142
  %169 = phi i1 [ false, %142 ], [ %167, %145 ]
  br i1 %169, label %170, label %177

170:                                              ; preds = %168
  call void @_ZNSt5dequeI4LineSaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = add nsw i32 %171, -1
  store i32 %172, ptr %14, align 4, !tbaa !5
  br label %142, !llvm.loop !28

173:                                              ; preds = %111, %103
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %12, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %13, align 4
  br label %188

177:                                              ; preds = %168
  invoke void @_ZNSt5dequeI4LineSaIS0_EE10push_frontERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %178 unwind label %184

178:                                              ; preds = %177
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %181

181:                                              ; preds = %178
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !5
  br label %57, !llvm.loop !29

184:                                              ; preds = %177
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %12, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  br label %188

188:                                              ; preds = %184, %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %189

189:                                              ; preds = %188, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %199

190:                                              ; preds = %61
  %191 = load i64, ptr %15, align 8, !tbaa !9
  %192 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %191)
          to label %193 unwind label %195

193:                                              ; preds = %190
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @_ZNSt5dequeI4LineSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %194 = load i32, ptr %1, align 4
  ret i32 %194

195:                                              ; preds = %190
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %12, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %13, align 4
  br label %199

199:                                              ; preds = %195, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @_ZNSt5dequeI4LineSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  br label %200

200:                                              ; preds = %199, %62
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %201

201:                                              ; preds = %200
  %202 = load ptr, ptr %12, align 8
  %203 = load i32, ptr %13, align 4
  %204 = insertvalue { ptr, i32 } poison, ptr %202, 0
  %205 = insertvalue { ptr, i32 } %204, i32 %203, 1
  resume { ptr, i32 } %205
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP9RectangleEvT_S2_(ptr noundef, ptr noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EE10push_frontERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI4LineED2Ev(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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { inlinehint 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 #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS9Rectangle", !10, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTS4Line", !10, i64 0, !10, i64 8}
!20 = !{!19, !10, i64 8}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTSSt16initializer_listI4LineE", !23, i64 0, !24, i64 8}
!23 = !{!"any pointer", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!22, !24, i64 8}
!26 = distinct !{!26, !17}
!27 = !{i64 0, i64 8, !9, i64 8, i64 8, !9}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}


; 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"

%struct.Rectangle = type { i64, i64, i64 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl" }
%"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl" = type { %"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Line, std::allocator<Line>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.Line = type { i64, i64 }
%"class.std::allocator" = type { i8 }

@arr = external dso_local global [1000005 x %struct.Rectangle], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z9IntersecX4LineS_(i64, i64, i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::deque", align 8
  %6 = alloca [1 x %struct.Line], align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.Line, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %.not40 = icmp slt i32 %12, 1
  br i1 %.not40, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre64 = sext i32 %12 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre64, %.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %13 = getelementptr inbounds %struct.Rectangle, ptr @arr, i64 %.pre-phi
  %14 = getelementptr inbounds i8, ptr %13, i64 24
  call void @_ZSt4sortIP9RectangleEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @arr, i64 24), ptr noundef nonnull %14)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @_ZNSaI4LineEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt5dequeI4LineSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr nonnull %6, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %22 unwind label %30

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %16 = load i64, ptr %2, align 8, !tbaa !9
  %17 = load i64, ptr %3, align 8, !tbaa !9
  %18 = load i64, ptr %4, align 8, !tbaa !9
  %19 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %indvars.iv
  store i64 %16, ptr %19, align 8, !tbaa !9
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  store i64 %17, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !9
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 16
  store i64 %18, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %.not.not = icmp slt i64 %indvars.iv, %21
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

22:                                               ; preds = %._crit_edge
  call void @_ZNSt15__new_allocatorI4LineED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  store i64 0, ptr %8, align 8, !tbaa !9
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %.not3752 = icmp slt i32 %23, 1
  br i1 %.not3752, label %._crit_edge55, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %22
  %24 = getelementptr inbounds i8, ptr %10, i64 8
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %70
  %indvars.iv61 = phi i64 [ 1, %.preheader.lr.ph ], [ %indvars.iv.next62, %70 ]
  %.03454 = phi i32 [ 1, %.preheader.lr.ph ], [ %71, %70 ]
  %25 = icmp sgt i32 %.03454, 1
  br i1 %25, label %.lr.ph43, label %.critedge

.lr.ph43:                                         ; preds = %.preheader
  %26 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %indvars.iv61, i32 1
  %27 = zext nneg i32 %.03454 to i64
  br label %32

._crit_edge55.loopexit:                           ; preds = %70
  %.pre = load i64, ptr %8, align 8, !tbaa !9
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %._crit_edge55.loopexit, %22
  %28 = phi i64 [ %.pre, %._crit_edge55.loopexit ], [ 0, %22 ]
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %28)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @_ZNSt5dequeI4LineSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

30:                                               ; preds = %._crit_edge
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI4LineED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  br label %76

32:                                               ; preds = %.lr.ph43, %40
  %indvars.iv58 = phi i64 [ %27, %.lr.ph43 ], [ %indvars.iv.next59, %40 ]
  %indvars.iv.next59 = add nsw i64 %indvars.iv58, -1
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %indvars.iv.next59) #8
  %34 = load i64, ptr %26, align 8, !tbaa !13
  %35 = call noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %33, i64 noundef %34)
  %36 = add nsw i64 %indvars.iv58, -2
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef %36) #8
  %38 = load i64, ptr %26, align 8, !tbaa !13
  %39 = call noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %37, i64 noundef %38)
  %.not38 = icmp sgt i64 %35, %39
  br i1 %.not38, label %.critedge.loopexit.split.loop.exit65, label %40

40:                                               ; preds = %32
  call void @_ZNSt5dequeI4LineSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  %41 = icmp ugt i64 %indvars.iv58, 2
  br i1 %41, label %32, label %.critedge, !llvm.loop !15

.critedge.loopexit.split.loop.exit65:             ; preds = %32
  %42 = trunc nuw nsw i64 %indvars.iv58 to i32
  br label %.critedge

.critedge:                                        ; preds = %40, %.critedge.loopexit.split.loop.exit65, %.preheader
  %.1.lcssa = phi i32 [ %.03454, %.preheader ], [ %42, %.critedge.loopexit.split.loop.exit65 ], [ 1, %40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  %44 = getelementptr inbounds [1000005 x %struct.Rectangle], ptr @arr, i64 0, i64 %indvars.iv61
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i64, ptr %45, align 8, !tbaa !13
  %47 = call noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16) %43, i64 noundef %46)
  %48 = load i64, ptr %44, align 8, !tbaa !16
  %49 = load i64, ptr %45, align 8, !tbaa !13
  %50 = mul nsw i64 %49, %48
  %51 = add nsw i64 %50, %47
  %52 = getelementptr inbounds i8, ptr %44, i64 16
  %53 = load i64, ptr %52, align 8, !tbaa !17
  %54 = sub i64 %51, %53
  store i64 %54, ptr %9, align 8, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %56 = load i64, ptr %55, align 8, !tbaa !9
  store i64 %56, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %57 = load i64, ptr %44, align 8, !tbaa !16
  %58 = sub nsw i64 0, %57
  store i64 %58, ptr %10, align 8, !tbaa !18
  %59 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %59, ptr %24, align 8, !tbaa !20
  %60 = icmp sgt i32 %.1.lcssa, 1
  br i1 %60, label %.lr.ph48, label %.critedge2

.lr.ph48:                                         ; preds = %.critedge, %67
  %.247 = phi i32 [ %68, %67 ], [ %.1.lcssa, %.critedge ]
  %.sroa.07.0.copyload = load i64, ptr %10, align 8, !tbaa !9
  %.sroa.28.0.copyload = load i64, ptr %24, align 8, !tbaa !9
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef 0) #8
  %.sroa.05.0.copyload = load i64, ptr %61, align 8, !tbaa !9
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %61, i64 8
  %.sroa.26.0.copyload = load i64, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !9
  %62 = call noundef x86_fp80 @_Z9IntersecX4LineS_(i64 %.sroa.07.0.copyload, i64 %.sroa.28.0.copyload, i64 %.sroa.05.0.copyload, i64 %.sroa.26.0.copyload)
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef 0) #8
  %.sroa.03.0.copyload = load i64, ptr %63, align 8, !tbaa !9
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 8
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !9
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %5, i64 noundef 1) #8
  %.sroa.0.0.copyload = load i64, ptr %64, align 8, !tbaa !9
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %64, i64 8
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !9
  %65 = call noundef x86_fp80 @_Z9IntersecX4LineS_(i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  %66 = fcmp ult x86_fp80 %62, %65
  br i1 %66, label %.critedge2, label %67

67:                                               ; preds = %.lr.ph48
  call void @_ZNSt5dequeI4LineSaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  %68 = add nsw i32 %.247, -1
  %69 = icmp sgt i32 %.247, 2
  br i1 %69, label %.lr.ph48, label %.critedge2, !llvm.loop !21

.critedge2:                                       ; preds = %.lr.ph48, %67, %.critedge
  %.2.lcssa = phi i32 [ %.1.lcssa, %.critedge ], [ 1, %67 ], [ %.247, %.lr.ph48 ]
  invoke void @_ZNSt5dequeI4LineSaIS0_EE10push_frontERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %70 unwind label %74

70:                                               ; preds = %.critedge2
  %71 = add nsw i32 %.2.lcssa, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %72 = load i32, ptr %1, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %.not37.not = icmp slt i64 %indvars.iv61, %73
  br i1 %.not37.not, label %.preheader, label %._crit_edge55.loopexit, !llvm.loop !22

74:                                               ; preds = %.critedge2
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @_ZNSt5dequeI4LineSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  br label %76

76:                                               ; preds = %74, %30
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP9RectangleEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Line1fEx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeI4LineSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeI4LineSaIS0_EE10push_frontERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS9Rectangle", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = distinct !{!15, !12}
!16 = !{!14, !10, i64 0}
!17 = !{!14, !10, i64 16}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTS4Line", !10, i64 0, !10, i64 8}
!20 = !{!19, !10, i64 8}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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