; LLVM IR from lzyrapx/Competitive-Programming :: 51Nod/1264（计算几何）（线段相交）.ll (Z13opposite_side5pointS_4line)

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

%struct.line = type { %struct.point, %struct.point }
%struct.point = type { double, double }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5xmult5pointS_S_(double, double, double, double, double, double) #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z13opposite_side5pointS_4line(double %0, double %1, double %2, double %3, ptr noundef byval(%struct.line) align 8 %4) #0 {
  %6 = alloca %struct.point, align 8
  %7 = alloca %struct.point, align 8
  %8 = alloca %struct.point, align 8
  %9 = alloca %struct.point, align 8
  %10 = alloca %struct.point, align 8
  %11 = alloca %struct.point, align 8
  %12 = alloca %struct.point, align 8
  %13 = alloca %struct.point, align 8
  %14 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  store double %0, ptr %14, align 8
  %15 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  store double %1, ptr %15, align 8
  %16 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %2, ptr %16, align 8
  %17 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %3, ptr %17, align 8
  %18 = getelementptr inbounds %struct.line, ptr %4, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !5
  %19 = getelementptr inbounds %struct.line, ptr %4, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !5
  %20 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %21 = load double, ptr %20, align 8
  %22 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %23 = load double, ptr %22, align 8
  %24 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %25 = load double, ptr %24, align 8
  %26 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %27 = load double, ptr %26, align 8
  %28 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %29 = load double, ptr %28, align 8
  %30 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %31 = load double, ptr %30, align 8
  %32 = call noundef double @_Z5xmult5pointS_S_(double %21, double %23, double %25, double %27, double %29, double %31)
  %33 = getelementptr inbounds %struct.line, ptr %4, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %33, i64 16, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !5
  %34 = getelementptr inbounds %struct.line, ptr %4, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %34, i64 16, i1 false), !tbaa.struct !5
  %35 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %36 = load double, ptr %35, align 8
  %37 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %38 = load double, ptr %37, align 8
  %39 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %40 = load double, ptr %39, align 8
  %41 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %42 = load double, ptr %41, align 8
  %43 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %44 = load double, ptr %43, align 8
  %45 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %46 = load double, ptr %45, align 8
  %47 = call noundef double @_Z5xmult5pointS_S_(double %36, double %38, double %40, double %42, double %44, double %46)
  %48 = fmul double %32, %47
  %49 = fcmp olt double %48, -1.000000e-08
  %50 = zext i1 %49 to i32
  ret i32 %50
}

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 nounwind willreturn memory(argmem: readwrite) }

!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 = !{i64 0, i64 8, !6, i64 8, i64 8, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


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

%struct.line = type { %struct.point, %struct.point }
%struct.point = type { double, double }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5xmult5pointS_S_(double, double, double, double, double, double) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z13opposite_side5pointS_4line(double %0, double %1, double %2, double %3, ptr nocapture noundef readonly byval(%struct.line) align 8 %4) local_unnamed_addr #0 {
  %.sroa.09.0.copyload = load double, ptr %4, align 8, !tbaa !5
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.210.0.copyload = load double, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 16
  %.sroa.05.0.copyload = load double, ptr %6, align 8, !tbaa !5
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 24
  %.sroa.26.0.copyload = load double, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !5
  %7 = tail call noundef double @_Z5xmult5pointS_S_(double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, double %0, double %1, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload)
  %8 = tail call noundef double @_Z5xmult5pointS_S_(double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, double %2, double %3, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload)
  %9 = fmul double %7, %8
  %10 = fcmp olt double %9, -1.000000e-08
  %11 = zext i1 %10 to i32
  ret i32 %11
}

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

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass