; LLVM IR from tangjz/acm-icpc :: lydsy (1573)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%struct.Line = type { i32, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@toSort = external dso_local global %"class.std::vector", align 8
@n = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@visited = external dso_local global [50000 x i32], align 16
@ans = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5queryi(i32 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 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 @_Z3addii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.Line, align 8
  %15 = alloca %struct.Line, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %19 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @d)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %105, %0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %108

26:                                               ; preds = %22
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %30 = load i64, ptr %3, align 8, !tbaa !9
  %31 = load i64, ptr %3, align 8, !tbaa !9
  %32 = mul nsw i64 %30, %31
  %33 = load i64, ptr %4, align 8, !tbaa !9
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %35 = mul nsw i64 %33, %34
  %36 = add nsw i64 %32, %35
  store i64 %36, ptr %6, align 8, !tbaa !9
  %37 = load i32, ptr @d, align 4, !tbaa !5
  %38 = load i32, ptr @d, align 4, !tbaa !5
  %39 = mul nsw i32 %37, %38
  %40 = sext i32 %39 to i64
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = mul nsw i64 %40, %41
  %43 = load i64, ptr %5, align 8, !tbaa !9
  %44 = load i64, ptr %5, align 8, !tbaa !9
  %45 = mul nsw i64 %43, %44
  %46 = sub nsw i64 %42, %45
  store i64 %46, ptr %7, align 8, !tbaa !9
  %47 = load i64, ptr %7, align 8, !tbaa !9
  %48 = icmp sgt i64 %47, 0
  br i1 %48, label %49, label %104

49:                                               ; preds = %26
  %50 = load i64, ptr %7, align 8, !tbaa !9
  %51 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %50)
  store double %51, ptr %9, align 8, !tbaa !11
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = sitofp i64 %52 to double
  store double %53, ptr %8, align 8, !tbaa !11
  %54 = load i64, ptr %3, align 8, !tbaa !9
  %55 = load i64, ptr %5, align 8, !tbaa !9
  %56 = mul nsw i64 %54, %55
  %57 = sitofp i64 %56 to double
  %58 = load i64, ptr %4, align 8, !tbaa !9
  %59 = sitofp i64 %58 to double
  %60 = load double, ptr %9, align 8, !tbaa !11
  %61 = call double @llvm.fmuladd.f64(double %59, double %60, double %57)
  %62 = load double, ptr %8, align 8, !tbaa !11
  %63 = fdiv double %61, %62
  store double %63, ptr %10, align 8, !tbaa !11
  %64 = load i64, ptr %3, align 8, !tbaa !9
  %65 = load i64, ptr %5, align 8, !tbaa !9
  %66 = mul nsw i64 %64, %65
  %67 = sitofp i64 %66 to double
  %68 = load i64, ptr %4, align 8, !tbaa !9
  %69 = sitofp i64 %68 to double
  %70 = load double, ptr %9, align 8, !tbaa !11
  %71 = fneg double %69
  %72 = call double @llvm.fmuladd.f64(double %71, double %70, double %67)
  %73 = load double, ptr %8, align 8, !tbaa !11
  %74 = fdiv double %72, %73
  store double %74, ptr %11, align 8, !tbaa !11
  %75 = load i64, ptr %4, align 8, !tbaa !9
  %76 = load i64, ptr %5, align 8, !tbaa !9
  %77 = mul nsw i64 %75, %76
  %78 = sitofp i64 %77 to double
  %79 = load i64, ptr %3, align 8, !tbaa !9
  %80 = sitofp i64 %79 to double
  %81 = load double, ptr %9, align 8, !tbaa !11
  %82 = fneg double %80
  %83 = call double @llvm.fmuladd.f64(double %82, double %81, double %78)
  %84 = load double, ptr %8, align 8, !tbaa !11
  %85 = fdiv double %83, %84
  store double %85, ptr %12, align 8, !tbaa !11
  %86 = load i64, ptr %4, align 8, !tbaa !9
  %87 = load i64, ptr %5, align 8, !tbaa !9
  %88 = mul nsw i64 %86, %87
  %89 = sitofp i64 %88 to double
  %90 = load i64, ptr %3, align 8, !tbaa !9
  %91 = sitofp i64 %90 to double
  %92 = load double, ptr %9, align 8, !tbaa !11
  %93 = call double @llvm.fmuladd.f64(double %91, double %92, double %89)
  %94 = load double, ptr %8, align 8, !tbaa !11
  %95 = fdiv double %93, %94
  store double %95, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #9
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = load double, ptr %12, align 8, !tbaa !11
  %98 = load double, ptr %10, align 8, !tbaa !11
  %99 = call double @atan2(double noundef %97, double noundef %98) #9
  call void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef %96, double noundef %99)
  call void @_ZNSt6vectorI4LineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @toSort, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #9
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = load double, ptr %13, align 8, !tbaa !11
  %102 = load double, ptr %11, align 8, !tbaa !11
  %103 = call double @atan2(double noundef %101, double noundef %102) #9
  call void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16) %15, i32 noundef %100, double noundef %103)
  call void @_ZNSt6vectorI4LineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @toSort, ptr noundef nonnull align 8 dereferenceable(16) %15)
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #9
  br label %104

104:                                              ; preds = %49, %26
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !13

108:                                              ; preds = %22
  %109 = call ptr @_ZNSt6vectorI4LineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = call ptr @_ZNSt6vectorI4LineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4LineSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %114, ptr %116)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  store i64 0, ptr %18, align 8, !tbaa !15
  br label %117

117:                                              ; preds = %170, %108
  %118 = load i64, ptr %18, align 8, !tbaa !15
  %119 = call noundef i64 @_ZNKSt6vectorI4LineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %120 = icmp ult i64 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  br label %173

122:                                              ; preds = %117
  %123 = load i64, ptr %18, align 8, !tbaa !15
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %123) #9
  %125 = getelementptr inbounds %struct.Line, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 8, !tbaa !17
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %157

131:                                              ; preds = %122
  %132 = load i64, ptr %18, align 8, !tbaa !15
  %133 = add i64 %132, 1
  %134 = trunc i64 %133 to i32
  %135 = call noundef i32 @_Z5queryi(i32 noundef %134)
  %136 = load i64, ptr %18, align 8, !tbaa !15
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %136) #9
  %138 = getelementptr inbounds %struct.Line, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 8, !tbaa !17
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = call noundef i32 @_Z5queryi(i32 noundef %143)
  %145 = sub nsw i32 %135, %144
  %146 = sext i32 %145 to i64
  %147 = load i64, ptr @ans, align 8, !tbaa !9
  %148 = add nsw i64 %147, %146
  store i64 %148, ptr @ans, align 8, !tbaa !9
  %149 = load i64, ptr %18, align 8, !tbaa !15
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %149) #9
  %151 = getelementptr inbounds %struct.Line, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 8, !tbaa !17
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  call void @_Z3addii(i32 noundef %156, i32 noundef -1)
  br label %169

157:                                              ; preds = %122
  %158 = load i64, ptr %18, align 8, !tbaa !15
  %159 = trunc i64 %158 to i32
  %160 = load i64, ptr %18, align 8, !tbaa !15
  %161 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %160) #9
  %162 = getelementptr inbounds %struct.Line, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !17
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %164
  store i32 %159, ptr %165, align 4, !tbaa !5
  %166 = load i64, ptr %18, align 8, !tbaa !15
  %167 = add i64 %166, 1
  %168 = trunc i64 %167 to i32
  call void @_Z3addii(i32 noundef %168, i32 noundef 1)
  br label %169

169:                                              ; preds = %157, %131
  br label %170

170:                                              ; preds = %169
  %171 = load i64, ptr %18, align 8, !tbaa !15
  %172 = add i64 %171, 1
  store i64 %172, ptr %18, align 8, !tbaa !15
  br label %117, !llvm.loop !19

173:                                              ; preds = %121
  %174 = load i64, ptr @ans, align 8, !tbaa !9
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %174)
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

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

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4LineSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr, ptr) #8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #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) #4 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)) #8

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%struct.Line = type { i32, double }

@toSort = external dso_local global %"class.std::vector", align 8
@n = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@visited = external dso_local local_unnamed_addr global [50000 x i32], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5queryi(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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 @_Z3addii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %struct.Line, align 8
  %5 = alloca %struct.Line, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @d)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %51
  %.02931 = phi i32 [ %52, %51 ], [ 0, %0 ]
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %14 = load i64, ptr %1, align 8, !tbaa !9
  %15 = mul nsw i64 %14, %14
  %16 = load i64, ptr %2, align 8, !tbaa !9
  %17 = mul nsw i64 %16, %16
  %18 = add nuw nsw i64 %17, %15
  %19 = load i32, ptr @d, align 4, !tbaa !5
  %20 = mul nsw i32 %19, %19
  %21 = zext nneg i32 %20 to i64
  %22 = mul nuw nsw i64 %18, %21
  %23 = load i64, ptr %3, align 8, !tbaa !9
  %24 = mul nsw i64 %23, %23
  %25 = sub nsw i64 %22, %24
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %27, label %51

27:                                               ; preds = %.lr.ph
  %28 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %25)
  %29 = uitofp nneg i64 %18 to double
  %30 = load i64, ptr %1, align 8, !tbaa !9
  %31 = load i64, ptr %3, align 8, !tbaa !9
  %32 = mul nsw i64 %31, %30
  %33 = sitofp i64 %32 to double
  %34 = load i64, ptr %2, align 8, !tbaa !9
  %35 = sitofp i64 %34 to double
  %36 = call double @llvm.fmuladd.f64(double %35, double %28, double %33)
  %37 = fdiv double %36, %29
  %38 = fneg double %35
  %39 = call double @llvm.fmuladd.f64(double %38, double %28, double %33)
  %40 = fdiv double %39, %29
  %41 = mul nsw i64 %34, %31
  %42 = sitofp i64 %41 to double
  %43 = sitofp i64 %30 to double
  %44 = fneg double %43
  %45 = call double @llvm.fmuladd.f64(double %44, double %28, double %42)
  %46 = fdiv double %45, %29
  %47 = call double @llvm.fmuladd.f64(double %43, double %28, double %42)
  %48 = fdiv double %47, %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %49 = call double @atan2(double noundef %46, double noundef %37) #9
  call void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.02931, double noundef %49)
  call void @_ZNSt6vectorI4LineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @toSort, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  %50 = call double @atan2(double noundef %48, double noundef %40) #9
  call void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.02931, double noundef %50)
  call void @_ZNSt6vectorI4LineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @toSort, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  br label %51

51:                                               ; preds = %.lr.ph, %27
  %52 = add nuw nsw i32 %.02931, 1
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %51, %0
  %55 = call ptr @_ZNSt6vectorI4LineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %56 = call ptr @_ZNSt6vectorI4LineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4LineSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %55, ptr %56)
  %57 = call noundef i64 @_ZNKSt6vectorI4LineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %.not36 = icmp eq i64 %57, 0
  br i1 %.not36, label %._crit_edge35, label %.lr.ph34

._crit_edge35:                                    ; preds = %91, %._crit_edge
  %58 = load i64, ptr @ans, align 8, !tbaa !9
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %58)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 0

.lr.ph34:                                         ; preds = %._crit_edge, %91
  %.032 = phi i64 [ %93, %91 ], [ 0, %._crit_edge ]
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %.032) #9
  %62 = load i32, ptr %61, align 8, !tbaa !13
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %.not = icmp eq i32 %65, 0
  %66 = trunc i64 %.032 to i32
  br i1 %.not, label %86, label %67

67:                                               ; preds = %.lr.ph34
  %68 = add i32 %66, 1
  %69 = call noundef i32 @_Z5queryi(i32 noundef %68)
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %.032) #9
  %71 = load i32, ptr %70, align 8, !tbaa !13
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = call noundef i32 @_Z5queryi(i32 noundef %75)
  %77 = sub nsw i32 %69, %76
  %78 = sext i32 %77 to i64
  %79 = load i64, ptr @ans, align 8, !tbaa !9
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr @ans, align 8, !tbaa !9
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %.032) #9
  %82 = load i32, ptr %81, align 8, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  br label %91

86:                                               ; preds = %.lr.ph34
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4LineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @toSort, i64 noundef %.032) #9
  %88 = load i32, ptr %87, align 8, !tbaa !13
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [50000 x i32], ptr @visited, i64 0, i64 %89
  store i32 %66, ptr %90, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %67, %86
  %.sink38 = phi i32 [ %85, %67 ], [ %66, %86 ]
  %.sink37 = phi i32 [ -1, %67 ], [ 1, %86 ]
  %92 = add i32 %.sink38, 1
  call void @_Z3addii(i32 noundef %92, i32 noundef %.sink37)
  %93 = add nuw i64 %.032, 1
  %94 = call noundef i64 @_ZNKSt6vectorI4LineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @toSort) #9
  %95 = icmp ult i64 %93, %94
  br i1 %95, label %.lr.ph34, label %._crit_edge35, !llvm.loop !16
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4LineC2Eid(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4LineSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr, ptr) local_unnamed_addr #8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) 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 #4 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)) #8

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 #9 = { nounwind }

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

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


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