; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Open 2014/14 Open G2.ll (Z5solvev)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.15" = type { %"class.std::vector.8", %"class.std::vector.8" }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@Bx = external dso_local global i32, align 4
@By = external dso_local global i32, align 4
@xval = external dso_local global %"class.std::map", align 8
@yval = external dso_local global %"class.std::map", align 8
@ans = external dso_local global i64, align 8
@point = external dso_local global %"class.std::vector.17", align 8
@done = external dso_local global [4 x i8], align 1
@__const._Z5solvev.dir = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef, ptr noundef) #0

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

; Function Attrs: 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) #2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.15") align 8, ptr noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3getiic(i32 noundef, i32 noundef, i8 noundef signext) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector.17", align 8
  %4 = alloca %"struct.std::pair.15", align 8
  %5 = alloca %"class.std::vector.17", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [4 x i8], align 1
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector.17", align 8
  %11 = alloca %"struct.std::pair.15", align 8
  %12 = alloca %"class.std::vector.17", align 8
  %13 = alloca %"class.std::vector.8", align 8
  %14 = alloca %"class.std::vector.8", align 8
  %15 = alloca %"class.std::vector.8", align 8
  %16 = alloca %"class.std::vector.8", align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  call void @_Z3getiic(i32 noundef %18, i32 noundef %20, i8 noundef signext 78)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) @point)
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #5
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %21 unwind label %27

21:                                               ; preds = %0
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind writable sret(%"struct.std::pair.15") align 8 %4, ptr noundef %5)
          to label %22 unwind label %31

22:                                               ; preds = %21
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %8, ptr align 1 @__const._Z5solvev.dir, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %110, %22
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 4
  br i1 %25, label %35, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %114

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %7, align 4
  br label %115

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %115

35:                                               ; preds = %23
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [4 x i8], ptr @done, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !9, !range !11, !noundef !12
  %40 = trunc i8 %39 to i1
  br i1 %40, label %109, label %41

41:                                               ; preds = %35
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #5
  %42 = load i32, ptr @Bx, align 4, !tbaa !5
  %43 = load i32, ptr @By, align 4, !tbaa !5
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !13
  invoke void @_Z3getiic(i32 noundef %42, i32 noundef %43, i8 noundef signext %47)
          to label %48 unwind label %68

48:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) @point)
          to label %49 unwind label %72

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #5
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %50 unwind label %76

50:                                               ; preds = %49
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind writable sret(%"struct.std::pair.15") align 8 %11, ptr noundef %12)
          to label %51 unwind label %80

51:                                               ; preds = %50
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %52 = getelementptr inbounds %"struct.std::pair.15", ptr %4, i32 0, i32 0
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %52)
          to label %53 unwind label %84

53:                                               ; preds = %51
  %54 = getelementptr inbounds %"struct.std::pair.15", ptr %11, i32 0, i32 1
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %54)
          to label %55 unwind label %88

55:                                               ; preds = %53
  %56 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef %13, ptr noundef %14)
          to label %57 unwind label %92

57:                                               ; preds = %55
  %58 = load i64, ptr @ans, align 8, !tbaa !14
  %59 = add nsw i64 %58, %56
  store i64 %59, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %60 = getelementptr inbounds %"struct.std::pair.15", ptr %4, i32 0, i32 1
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %60)
          to label %61 unwind label %84

61:                                               ; preds = %57
  %62 = getelementptr inbounds %"struct.std::pair.15", ptr %11, i32 0, i32 0
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %62)
          to label %63 unwind label %97

63:                                               ; preds = %61
  %64 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef %15, ptr noundef %16)
          to label %65 unwind label %101

65:                                               ; preds = %63
  %66 = load i64, ptr @ans, align 8, !tbaa !14
  %67 = add nsw i64 %66, %64
  store i64 %67, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %109

68:                                               ; preds = %41
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %6, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %7, align 4
  br label %113

72:                                               ; preds = %48
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  br label %108

76:                                               ; preds = %49
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  br label %107

80:                                               ; preds = %50
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %6, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  br label %107

84:                                               ; preds = %57, %51
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %6, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %7, align 4
  br label %106

88:                                               ; preds = %53
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %6, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %7, align 4
  br label %96

92:                                               ; preds = %55
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %6, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  br label %96

96:                                               ; preds = %92, %88
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %106

97:                                               ; preds = %61
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %6, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %7, align 4
  br label %105

101:                                              ; preds = %63
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %6, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %105

105:                                              ; preds = %101, %97
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  br label %106

106:                                              ; preds = %105, %96, %84
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #5
  br label %107

107:                                              ; preds = %106, %80, %76
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  br label %108

108:                                              ; preds = %107, %72
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %113

109:                                              ; preds = %65, %35
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %23, !llvm.loop !16

113:                                              ; preds = %108, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  br label %115

114:                                              ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

115:                                              ; preds = %113, %31, %27
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %6, align 8
  %118 = load i32, ptr %7, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.15" = type { %"class.std::vector.8", %"class.std::vector.8" }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@Bx = external dso_local local_unnamed_addr global i32, align 4
@By = external dso_local local_unnamed_addr global i32, align 4
@xval = external dso_local global %"class.std::map", align 8
@yval = external dso_local global %"class.std::map", align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@point = external dso_local global %"class.std::vector.17", align 8
@done = external dso_local local_unnamed_addr global [4 x i8], align 1
@__const._Z5solvev.dir = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.15") align 8, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3getiic(i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector.17", align 8
  %4 = alloca %"struct.std::pair.15", align 8
  %5 = alloca %"class.std::vector.17", align 8
  %6 = alloca %"class.std::vector.17", align 8
  %7 = alloca %"struct.std::pair.15", align 8
  %8 = alloca %"class.std::vector.17", align 8
  %9 = alloca %"class.std::vector.8", align 8
  %10 = alloca %"class.std::vector.8", align 8
  %11 = alloca %"class.std::vector.8", align 8
  %12 = alloca %"class.std::vector.8", align 8
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  call void @_Z3getiic(i32 noundef %14, i32 noundef %16, i8 noundef signext 78)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) @point)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %17 unwind label %23

17:                                               ; preds = %0
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.15") align 8 %4, ptr noundef nonnull %5)
          to label %18 unwind label %25

18:                                               ; preds = %17
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %19 = getelementptr inbounds i8, ptr %7, i64 24
  %20 = getelementptr inbounds i8, ptr %4, i64 24
  %21 = load i8, ptr @done, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %70, label %27

23:                                               ; preds = %0
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %141

25:                                               ; preds = %17
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  br label %141

27:                                               ; preds = %18
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #4
  %28 = load i32, ptr @Bx, align 4, !tbaa !5
  %29 = load i32, ptr @By, align 4, !tbaa !5
  %30 = load i8, ptr @__const._Z5solvev.dir, align 1, !tbaa !13
  invoke void @_Z3getiic(i32 noundef %28, i32 noundef %29, i8 noundef signext %30)
          to label %31 unwind label %47

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @point)
          to label %32 unwind label %49

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %33 unwind label %51

33:                                               ; preds = %32
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.15") align 8 %7, ptr noundef nonnull %8)
          to label %34 unwind label %53

34:                                               ; preds = %33
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %35 unwind label %55

35:                                               ; preds = %34
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %36 unwind label %57

36:                                               ; preds = %35
  %37 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %38 unwind label %59

38:                                               ; preds = %36
  %39 = load i64, ptr @ans, align 8, !tbaa !14
  %40 = add nsw i64 %39, %37
  store i64 %40, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %41 unwind label %55

41:                                               ; preds = %38
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %42 unwind label %62

42:                                               ; preds = %41
  %43 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %11, ptr noundef nonnull %12)
          to label %44 unwind label %64

44:                                               ; preds = %42
  %45 = load i64, ptr @ans, align 8, !tbaa !14
  %46 = add nsw i64 %45, %43
  store i64 %46, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %70

47:                                               ; preds = %119, %96, %73, %27
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %140

49:                                               ; preds = %123, %100, %77, %31
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %69

51:                                               ; preds = %124, %101, %78, %32
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %68

53:                                               ; preds = %125, %102, %79, %33
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  br label %68

55:                                               ; preds = %130, %126, %107, %103, %84, %80, %38, %34
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %67

57:                                               ; preds = %127, %104, %81, %35
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %61

59:                                               ; preds = %128, %105, %82, %36
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  br label %61

61:                                               ; preds = %59, %57
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ]
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %67

62:                                               ; preds = %133, %110, %87, %41
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %66

64:                                               ; preds = %134, %111, %88, %42
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  br label %66

66:                                               ; preds = %64, %62
  %.pn14 = phi { ptr, i32 } [ %65, %64 ], [ %63, %62 ]
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  br label %67

67:                                               ; preds = %66, %61, %55
  %.pn14.pn = phi { ptr, i32 } [ %.pn14, %66 ], [ %56, %55 ], [ %.pn, %61 ]
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  br label %68

68:                                               ; preds = %67, %53, %51
  %.pn14.pn.pn = phi { ptr, i32 } [ %.pn14.pn, %67 ], [ %54, %53 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  br label %69

69:                                               ; preds = %68, %49
  %.pn14.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn, %68 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %140

70:                                               ; preds = %18, %44
  %71 = load i8, ptr getelementptr inbounds (i8, ptr @done, i64 1), align 1, !tbaa !9, !range !11, !noundef !12
  %72 = trunc nuw i8 %71 to i1
  br i1 %72, label %93, label %73

73:                                               ; preds = %70
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #4
  %74 = load i32, ptr @Bx, align 4, !tbaa !5
  %75 = load i32, ptr @By, align 4, !tbaa !5
  %76 = load i8, ptr getelementptr inbounds (i8, ptr @__const._Z5solvev.dir, i64 1), align 1, !tbaa !13
  invoke void @_Z3getiic(i32 noundef %74, i32 noundef %75, i8 noundef signext %76)
          to label %77 unwind label %47

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @point)
          to label %78 unwind label %49

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %79 unwind label %51

79:                                               ; preds = %78
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.15") align 8 %7, ptr noundef nonnull %8)
          to label %80 unwind label %53

80:                                               ; preds = %79
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %81 unwind label %55

81:                                               ; preds = %80
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %82 unwind label %57

82:                                               ; preds = %81
  %83 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %84 unwind label %59

84:                                               ; preds = %82
  %85 = load i64, ptr @ans, align 8, !tbaa !14
  %86 = add nsw i64 %85, %83
  store i64 %86, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %87 unwind label %55

87:                                               ; preds = %84
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %88 unwind label %62

88:                                               ; preds = %87
  %89 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %11, ptr noundef nonnull %12)
          to label %90 unwind label %64

90:                                               ; preds = %88
  %91 = load i64, ptr @ans, align 8, !tbaa !14
  %92 = add nsw i64 %91, %89
  store i64 %92, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %93

93:                                               ; preds = %90, %70
  %94 = load i8, ptr getelementptr inbounds (i8, ptr @done, i64 2), align 1, !tbaa !9, !range !11, !noundef !12
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %116, label %96

96:                                               ; preds = %93
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #4
  %97 = load i32, ptr @Bx, align 4, !tbaa !5
  %98 = load i32, ptr @By, align 4, !tbaa !5
  %99 = load i8, ptr getelementptr inbounds (i8, ptr @__const._Z5solvev.dir, i64 2), align 1, !tbaa !13
  invoke void @_Z3getiic(i32 noundef %97, i32 noundef %98, i8 noundef signext %99)
          to label %100 unwind label %47

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @point)
          to label %101 unwind label %49

101:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %102 unwind label %51

102:                                              ; preds = %101
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.15") align 8 %7, ptr noundef nonnull %8)
          to label %103 unwind label %53

103:                                              ; preds = %102
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %104 unwind label %55

104:                                              ; preds = %103
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %105 unwind label %57

105:                                              ; preds = %104
  %106 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %107 unwind label %59

107:                                              ; preds = %105
  %108 = load i64, ptr @ans, align 8, !tbaa !14
  %109 = add nsw i64 %108, %106
  store i64 %109, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %110 unwind label %55

110:                                              ; preds = %107
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %111 unwind label %62

111:                                              ; preds = %110
  %112 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %11, ptr noundef nonnull %12)
          to label %113 unwind label %64

113:                                              ; preds = %111
  %114 = load i64, ptr @ans, align 8, !tbaa !14
  %115 = add nsw i64 %114, %112
  store i64 %115, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %116

116:                                              ; preds = %113, %93
  %117 = load i8, ptr getelementptr inbounds (i8, ptr @done, i64 3), align 1, !tbaa !9, !range !11, !noundef !12
  %118 = trunc nuw i8 %117 to i1
  br i1 %118, label %139, label %119

119:                                              ; preds = %116
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @point) #4
  %120 = load i32, ptr @Bx, align 4, !tbaa !5
  %121 = load i32, ptr @By, align 4, !tbaa !5
  %122 = load i8, ptr getelementptr inbounds (i8, ptr @__const._Z5solvev.dir, i64 3), align 1, !tbaa !13
  invoke void @_Z3getiic(i32 noundef %120, i32 noundef %121, i8 noundef signext %122)
          to label %123 unwind label %47

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @point)
          to label %124 unwind label %49

124:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %125 unwind label %51

125:                                              ; preds = %124
  invoke void @_Z3genSt6vectorISt4pairIiiESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.15") align 8 %7, ptr noundef nonnull %8)
          to label %126 unwind label %53

126:                                              ; preds = %125
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %127 unwind label %55

127:                                              ; preds = %126
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %128 unwind label %57

128:                                              ; preds = %127
  %129 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %130 unwind label %59

130:                                              ; preds = %128
  %131 = load i64, ptr @ans, align 8, !tbaa !14
  %132 = add nsw i64 %131, %129
  store i64 %132, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %133 unwind label %55

133:                                              ; preds = %130
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %134 unwind label %62

134:                                              ; preds = %133
  %135 = invoke noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef nonnull %11, ptr noundef nonnull %12)
          to label %136 unwind label %64

136:                                              ; preds = %134
  %137 = load i64, ptr @ans, align 8, !tbaa !14
  %138 = add nsw i64 %137, %135
  store i64 %138, ptr @ans, align 8, !tbaa !14
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %139

139:                                              ; preds = %136, %116
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret void

140:                                              ; preds = %69, %47
  %.pn14.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn.pn, %69 ], [ %48, %47 ]
  call void @_ZNSt4pairISt6vectorIS_IiS_IiiEESaIS2_EES4_ED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #4
  br label %141

141:                                              ; preds = %140, %25, %23
  %.pn14.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn.pn.pn, %140 ], [ %26, %25 ], [ %24, %23 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn14.pn.pn.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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 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 #3 = { 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 #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass