; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2017.03 (where)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl" }
%"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl" = type { %"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl_data" }
%"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.rect = type { i32, i32, i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5worksiRA20_A20_c4rect(i32 noundef, ptr noundef nonnull align 1 dereferenceable(400), i64, i64) #0

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [20 x [20 x i8]], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %struct.rect, align 4
  %20 = alloca %struct.rect, align 4
  %21 = alloca %struct.rect, align 4
  store i32 0, ptr %1, align 4
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = load ptr, ptr @stdin, align 8, !tbaa !8
  %29 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %28)
  %30 = load ptr, ptr @stdout, align 8, !tbaa !8
  %31 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 400, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %70, %0
  %34 = load i32, ptr %4, align 4, !tbaa !11
  %35 = load i32, ptr %2, align 4, !tbaa !11
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %74

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %40 unwind label %46

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %62, %40
  %42 = load i32, ptr %9, align 4, !tbaa !11
  %43 = load i32, ptr %2, align 4, !tbaa !11
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %50, label %45

45:                                               ; preds = %41
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %69

46:                                               ; preds = %38
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  br label %73

50:                                               ; preds = %41
  %51 = load i32, ptr %9, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %52)
          to label %54 unwind label %65

54:                                               ; preds = %50
  %55 = load i8, ptr %53, align 1, !tbaa !13
  %56 = load i32, ptr %4, align 4, !tbaa !11
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [20 x [20 x i8]], ptr %3, i64 0, i64 %57
  %59 = load i32, ptr %9, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [20 x i8], ptr %58, i64 0, i64 %60
  store i8 %55, ptr %61, align 1, !tbaa !13
  br label %62

62:                                               ; preds = %54
  %63 = load i32, ptr %9, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %9, align 4, !tbaa !11
  br label %41, !llvm.loop !14

65:                                               ; preds = %50
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %7, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %73

69:                                               ; preds = %45
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #8
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %4, align 4, !tbaa !11
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %4, align 4, !tbaa !11
  br label %33, !llvm.loop !16

73:                                               ; preds = %65, %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %196

74:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #8
  call void @_ZNSt6vectorI4rectSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %75

75:                                               ; preds = %181, %74
  %76 = load i32, ptr %11, align 4, !tbaa !11
  %77 = load i32, ptr %2, align 4, !tbaa !11
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %184

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %81

81:                                               ; preds = %177, %80
  %82 = load i32, ptr %12, align 4, !tbaa !11
  %83 = load i32, ptr %2, align 4, !tbaa !11
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %180

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %87 = load i32, ptr %2, align 4, !tbaa !11
  %88 = sub nsw i32 %87, 1
  store i32 %88, ptr %13, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %173, %86
  %90 = load i32, ptr %13, align 4, !tbaa !11
  %91 = icmp sge i32 %90, 0
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %176

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %94 = load i32, ptr %2, align 4, !tbaa !11
  %95 = sub nsw i32 %94, 1
  store i32 %95, ptr %14, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %169, %93
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = icmp sge i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %172

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 1, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store ptr %10, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %101 = load ptr, ptr %16, align 8, !tbaa !8
  %102 = call ptr @_ZNSt6vectorI4rectSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %102, ptr %103, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %104 = load ptr, ptr %16, align 8, !tbaa !8
  %105 = call ptr @_ZNSt6vectorI4rectSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #8
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %105, ptr %106, align 8
  br label %107

107:                                              ; preds = %136, %100
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4rectSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br i1 %108, label %110, label %109

109:                                              ; preds = %107
  store i32 20, ptr %5, align 4
  br label %138

110:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %111 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4rectSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %111, i64 16, i1 false), !tbaa.struct !17
  %112 = load i32, ptr %11, align 4, !tbaa !11
  %113 = getelementptr inbounds %struct.rect, ptr %19, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !18
  %115 = icmp sge i32 %112, %114
  br i1 %115, label %116, label %132

116:                                              ; preds = %110
  %117 = load i32, ptr %12, align 4, !tbaa !11
  %118 = getelementptr inbounds %struct.rect, ptr %19, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !20
  %120 = icmp sge i32 %117, %119
  br i1 %120, label %121, label %132

121:                                              ; preds = %116
  %122 = load i32, ptr %13, align 4, !tbaa !11
  %123 = getelementptr inbounds %struct.rect, ptr %19, i32 0, i32 2
  %124 = load i32, ptr %123, align 4, !tbaa !21
  %125 = icmp sle i32 %122, %124
  br i1 %125, label %126, label %132

126:                                              ; preds = %121
  %127 = load i32, ptr %14, align 4, !tbaa !11
  %128 = getelementptr inbounds %struct.rect, ptr %19, i32 0, i32 3
  %129 = load i32, ptr %128, align 4, !tbaa !22
  %130 = icmp sle i32 %127, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %126
  store i32 0, ptr %15, align 4, !tbaa !11
  store i32 20, ptr %5, align 4
  br label %133

132:                                              ; preds = %126, %121, %116, %110
  store i32 0, ptr %5, align 4
  br label %133

133:                                              ; preds = %132, %131
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  %134 = load i32, ptr %5, align 4
  switch i32 %134, label %138 [
    i32 0, label %135
  ]

135:                                              ; preds = %133
  br label %136

136:                                              ; preds = %135
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4rectSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  br label %107

138:                                              ; preds = %133, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %15, align 4, !tbaa !11
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %143, label %142

142:                                              ; preds = %139
  store i32 19, ptr %5, align 4
  br label %166

143:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  %144 = getelementptr inbounds %struct.rect, ptr %20, i32 0, i32 0
  %145 = load i32, ptr %11, align 4, !tbaa !11
  store i32 %145, ptr %144, align 4, !tbaa !18
  %146 = getelementptr inbounds %struct.rect, ptr %20, i32 0, i32 1
  %147 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %147, ptr %146, align 4, !tbaa !20
  %148 = getelementptr inbounds %struct.rect, ptr %20, i32 0, i32 2
  %149 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %149, ptr %148, align 4, !tbaa !21
  %150 = getelementptr inbounds %struct.rect, ptr %20, i32 0, i32 3
  %151 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %151, ptr %150, align 4, !tbaa !22
  %152 = load i32, ptr %2, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !17
  %153 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %154 = load i64, ptr %153, align 4
  %155 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %156 = load i64, ptr %155, align 4
  %157 = invoke noundef zeroext i1 @_Z5worksiRA20_A20_c4rect(i32 noundef %152, ptr noundef nonnull align 1 dereferenceable(400) %3, i64 %154, i64 %156)
          to label %158 unwind label %161

158:                                              ; preds = %143
  br i1 %157, label %159, label %165

159:                                              ; preds = %158
  invoke void @_ZNSt6vectorI4rectSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(16) %20)
          to label %160 unwind label %161

160:                                              ; preds = %159
  br label %165

161:                                              ; preds = %159, %143
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %7, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %195

165:                                              ; preds = %160, %158
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  store i32 0, ptr %5, align 4
  br label %166

166:                                              ; preds = %165, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  %167 = load i32, ptr %5, align 4
  switch i32 %167, label %202 [
    i32 0, label %168
    i32 19, label %169
  ]

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168, %166
  %170 = load i32, ptr %14, align 4, !tbaa !11
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %14, align 4, !tbaa !11
  br label %96, !llvm.loop !23

172:                                              ; preds = %99
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %13, align 4, !tbaa !11
  %175 = add nsw i32 %174, -1
  store i32 %175, ptr %13, align 4, !tbaa !11
  br label %89, !llvm.loop !24

176:                                              ; preds = %92
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %12, align 4, !tbaa !11
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %12, align 4, !tbaa !11
  br label %81, !llvm.loop !25

180:                                              ; preds = %85
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %11, align 4, !tbaa !11
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %11, align 4, !tbaa !11
  br label %75, !llvm.loop !26

184:                                              ; preds = %79
  %185 = call noundef i64 @_ZNKSt6vectorI4rectSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  %186 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %185)
          to label %187 unwind label %191

187:                                              ; preds = %184
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %189 unwind label %191

189:                                              ; preds = %187
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @_ZNSt6vectorI4rectSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 400, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %190 = load i32, ptr %1, align 4
  ret i32 %190

191:                                              ; preds = %187, %184
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %7, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %8, align 4
  br label %195

195:                                              ; preds = %191, %161
  call void @_ZNSt6vectorI4rectSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  br label %196

196:                                              ; preds = %195, %73
  call void @llvm.lifetime.end.p0(i64 400, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %7, align 8
  %199 = load i32, ptr %8, align 4
  %200 = insertvalue { ptr, i32 } poison, ptr %198, 0
  %201 = insertvalue { ptr, i32 } %200, i32 %199, 1
  resume { ptr, i32 } %201

202:                                              ; preds = %166
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #4 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4rectSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; 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) #6

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

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

attributes #0 = { 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 #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 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS4rect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!20 = !{!19, !12, i64 4}
!21 = !{!19, !12, i64 8}
!22 = !{!19, !12, i64 12}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl" }
%"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl" = type { %"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl_data" }
%"struct.std::_Vector_base<rect, std::allocator<rect>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.rect = type { i32, i32, i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5worksiRA20_A20_c4rect(i32 noundef, ptr noundef nonnull align 1 dereferenceable(400), i64, i64) 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca [20 x [20 x i8]], align 16
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %struct.rect, align 8
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = load ptr, ptr @stdin, align 8, !tbaa !8
  %15 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %14)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !8
  %17 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %2) #7
  %19 = load i32, ptr %1, align 4, !tbaa !11
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph57, label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorI4rectSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %21 = load i32, ptr %1, align 4, !tbaa !11
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.preheader51.preheader, label %._crit_edge73

.preheader51.preheader:                           ; preds = %._crit_edge58
  %23 = getelementptr inbounds i8, ptr %7, i64 4
  %24 = getelementptr inbounds i8, ptr %7, i64 8
  %25 = getelementptr inbounds i8, ptr %7, i64 12
  br label %.preheader51

.lr.ph57:                                         ; preds = %0, %._crit_edge
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %.preheader52 unwind label %32

.preheader52:                                     ; preds = %.lr.ph57
  %27 = load i32, ptr %1, align 4, !tbaa !11
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader52
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %29 = load i32, ptr %1, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next79, %30
  br i1 %31, label %.lr.ph57, label %._crit_edge58, !llvm.loop !13

32:                                               ; preds = %.lr.ph57
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %80

.lr.ph:                                           ; preds = %.preheader52, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader52 ]
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv)
  %35 = load i8, ptr %34, align 1, !tbaa !15
  %36 = getelementptr inbounds [20 x [20 x i8]], ptr %2, i64 0, i64 %indvars.iv78, i64 %indvars.iv
  store i8 %35, ptr %36, align 1, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr %1, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next, %38
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !16

.preheader51:                                     ; preds = %.preheader51.preheader, %._crit_edge71
  %40 = phi i32 [ %47, %._crit_edge71 ], [ %21, %.preheader51.preheader ]
  %.03572 = phi i32 [ %48, %._crit_edge71 ], [ 0, %.preheader51.preheader ]
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.preheader, label %._crit_edge71

._crit_edge73:                                    ; preds = %._crit_edge71, %._crit_edge58
  %42 = call noundef i64 @_ZNKSt6vectorI4rectSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %42)
          to label %74 unwind label %77

.preheader:                                       ; preds = %.preheader51, %._crit_edge68
  %44 = phi i32 [ %51, %._crit_edge68 ], [ %40, %.preheader51 ]
  %45 = phi i32 [ %52, %._crit_edge68 ], [ %40, %.preheader51 ]
  %.04069 = phi i32 [ %53, %._crit_edge68 ], [ 0, %.preheader51 ]
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph67.split, label %._crit_edge68

._crit_edge71:                                    ; preds = %._crit_edge68, %.preheader51
  %47 = phi i32 [ %40, %.preheader51 ], [ %51, %._crit_edge68 ]
  %48 = add nuw nsw i32 %.03572, 1
  %49 = icmp slt i32 %48, %47
  br i1 %49, label %.preheader51, label %._crit_edge73, !llvm.loop !17

.loopexit:                                        ; preds = %72, %.lr.ph67.split
  %50 = icmp sgt i32 %.03966.in, 1
  br i1 %50, label %.lr.ph67.split, label %._crit_edge68.loopexit, !llvm.loop !19

._crit_edge68.loopexit:                           ; preds = %.loopexit
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  br label %._crit_edge68

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit, %.preheader
  %51 = phi i32 [ %.pre, %._crit_edge68.loopexit ], [ %44, %.preheader ]
  %52 = phi i32 [ %.pre, %._crit_edge68.loopexit ], [ %45, %.preheader ]
  %53 = add nuw nsw i32 %.04069, 1
  %54 = icmp slt i32 %53, %52
  br i1 %54, label %.preheader, label %._crit_edge71, !llvm.loop !20

.lr.ph67.split:                                   ; preds = %.preheader, %.loopexit
  %.03966.in = phi i32 [ %.03966, %.loopexit ], [ %45, %.preheader ]
  %.03966 = add nsw i32 %.03966.in, -1
  %55 = load i32, ptr %1, align 4, !tbaa !11
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph64, label %.loopexit

.lr.ph64:                                         ; preds = %.lr.ph67.split, %72
  %.03862.in = phi i32 [ %.03862, %72 ], [ %55, %.lr.ph67.split ]
  %.03862 = add nsw i32 %.03862.in, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %57 = call ptr @_ZNSt6vectorI4rectSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  store ptr %57, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %58 = call ptr @_ZNSt6vectorI4rectSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  store ptr %58, ptr %6, align 8
  %59 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4rectSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %59, label %.lr.ph60, label %.loopexit82

.lr.ph60:                                         ; preds = %.lr.ph64, %61
  %60 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4rectSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %.sroa.01.0.copyload = load i32, ptr %60, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 8
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !11
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 12
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !11
  %.not = icmp slt i32 %.03572, %.sroa.01.0.copyload
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  %.not42 = icmp slt i32 %.04069, %.sroa.4.0.copyload
  %or.cond = select i1 %.not, i1 true, i1 %.not42
  %.not43 = icmp sgt i32 %.03966, %.sroa.5.0.copyload
  %or.cond49 = select i1 %or.cond, i1 true, i1 %.not43
  %.not44 = icmp sgt i32 %.03862, %.sroa.6.0.copyload
  %or.cond50 = select i1 %or.cond49, i1 true, i1 %.not44
  br i1 %or.cond50, label %61, label %64

61:                                               ; preds = %.lr.ph60
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4rectSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %63 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4rectSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %63, label %.lr.ph60, label %.loopexit82

64:                                               ; preds = %.lr.ph60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %72

.loopexit82:                                      ; preds = %61, %.lr.ph64
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  store i32 %.03572, ptr %7, align 8, !tbaa !21
  store i32 %.04069, ptr %23, align 4, !tbaa !23
  store i32 %.03966, ptr %24, align 8, !tbaa !24
  store i32 %.03862, ptr %25, align 4, !tbaa !25
  %65 = load i32, ptr %1, align 4, !tbaa !11
  %.sroa.0.0.copyload = load i64, ptr %7, align 8
  %.sroa.2.0.copyload = load i64, ptr %24, align 8
  %66 = invoke noundef zeroext i1 @_Z5worksiRA20_A20_c4rect(i32 noundef %65, ptr noundef nonnull align 1 dereferenceable(400) %2, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
          to label %67 unwind label %69

67:                                               ; preds = %.loopexit82
  br i1 %66, label %68, label %71

68:                                               ; preds = %67
  invoke void @_ZNSt6vectorI4rectSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %71 unwind label %69

69:                                               ; preds = %68, %.loopexit82
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %79

71:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %72

72:                                               ; preds = %64, %71
  %73 = icmp sgt i32 %.03862.in, 1
  br i1 %73, label %.lr.ph64, label %.loopexit, !llvm.loop !26

74:                                               ; preds = %._crit_edge73
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %76 unwind label %77

76:                                               ; preds = %74
  call void @_ZNSt6vectorI4rectSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

77:                                               ; preds = %74, %._crit_edge73
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %79

79:                                               ; preds = %77, %69
  %.pn = phi { ptr, i32 } [ %70, %69 ], [ %78, %77 ]
  call void @_ZNSt6vectorI4rectSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %80

80:                                               ; preds = %79, %32
  %.pn47 = phi { ptr, i32 } [ %33, %32 ], [ %.pn, %79 ]
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn47
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #4 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4rectSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

attributes #0 = { 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 #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 = { "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 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 #5 = { 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 #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !14, !18}
!20 = distinct !{!20, !14}
!21 = !{!22, !12, i64 0}
!22 = !{!"_ZTS4rect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!23 = !{!22, !12, i64 4}
!24 = !{!22, !12, i64 8}
!25 = !{!22, !12, i64 12}
!26 = distinct !{!26, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass