; LLVM IR from wesley-a-leung/Resources :: Tests/C++/geometry/2d/BentleyOttmannFuzzTest.ll (Z16segSegIntersects2ptS_S_S_)

; 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.pt = type { x86_fp80, x86_fp80 }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z16segSegIntersects2ptS_S_S_(ptr noundef byval(%struct.pt) align 16 %0, ptr noundef byval(%struct.pt) align 16 %1, ptr noundef byval(%struct.pt) align 16 %2, ptr noundef byval(%struct.pt) align 16 %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca %struct.pt, align 16
  %7 = alloca %struct.pt, align 16
  %8 = alloca %struct.pt, align 16
  %9 = alloca %struct.pt, align 16
  %10 = alloca %struct.pt, align 16
  %11 = alloca %struct.pt, align 16
  %12 = alloca %struct.pt, align 16
  %13 = alloca %struct.pt, align 16
  %14 = alloca %struct.pt, align 16
  %15 = alloca %struct.pt, align 16
  %16 = alloca %struct.pt, align 16
  %17 = alloca %struct.pt, align 16
  %18 = alloca %struct.pt, align 16
  %19 = alloca %struct.pt, align 16
  %20 = alloca %struct.pt, align 16
  %21 = alloca %struct.pt, align 16
  %22 = alloca %struct.pt, align 16
  %23 = alloca %struct.pt, align 16
  %24 = alloca %struct.pt, align 16
  %25 = alloca %struct.pt, align 16
  %26 = alloca %struct.pt, align 16
  %27 = alloca %struct.pt, align 16
  %28 = alloca %struct.pt, align 16
  %29 = alloca %struct.pt, align 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  %30 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16 %6, ptr noundef byval(%struct.pt) align 16 %7, ptr noundef byval(%struct.pt) align 16 %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  %31 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16 %9, ptr noundef byval(%struct.pt) align 16 %10, ptr noundef byval(%struct.pt) align 16 %11)
  %32 = mul nsw i32 %30, %31
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %40

34:                                               ; preds = %4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  %35 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16 %12, ptr noundef byval(%struct.pt) align 16 %13, ptr noundef byval(%struct.pt) align 16 %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  %36 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16 %15, ptr noundef byval(%struct.pt) align 16 %16, ptr noundef byval(%struct.pt) align 16 %17)
  %37 = mul nsw i32 %35, %36
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %34
  store i32 1, ptr %5, align 4
  br label %50

40:                                               ; preds = %34, %4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  %41 = call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16 %18, ptr noundef byval(%struct.pt) align 16 %19, ptr noundef byval(%struct.pt) align 16 %20)
  br i1 %41, label %48, label %42

42:                                               ; preds = %40
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  %43 = call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16 %21, ptr noundef byval(%struct.pt) align 16 %22, ptr noundef byval(%struct.pt) align 16 %23)
  br i1 %43, label %48, label %44

44:                                               ; preds = %42
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %0, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  %45 = call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16 %24, ptr noundef byval(%struct.pt) align 16 %25, ptr noundef byval(%struct.pt) align 16 %26)
  br i1 %45, label %48, label %46

46:                                               ; preds = %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !5
  %47 = call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16 %27, ptr noundef byval(%struct.pt) align 16 %28, ptr noundef byval(%struct.pt) align 16 %29)
  br i1 %47, label %48, label %49

48:                                               ; preds = %46, %44, %42, %40
  store i32 2, ptr %5, align 4
  br label %50

49:                                               ; preds = %46
  store i32 0, ptr %5, align 4
  br label %50

50:                                               ; preds = %49, %48, %39
  %51 = load i32, ptr %5, align 4
  ret i32 %51
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }

!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 16, !6, i64 16, i64 16, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"long 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.pt = type { x86_fp80, x86_fp80 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z16segSegIntersects2ptS_S_S_(ptr nocapture noundef readonly byval(%struct.pt) align 16 %0, ptr nocapture noundef readonly byval(%struct.pt) align 16 %1, ptr nocapture noundef readonly byval(%struct.pt) align 16 %2, ptr nocapture noundef readonly byval(%struct.pt) align 16 %3) local_unnamed_addr #0 {
  %5 = tail call noundef i32 @_Z3ccw2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1, ptr noundef nonnull byval(%struct.pt) align 16 %2)
  %6 = tail call noundef i32 @_Z3ccw2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1, ptr noundef nonnull byval(%struct.pt) align 16 %3)
  %7 = mul nsw i32 %6, %5
  %8 = icmp slt i32 %7, 0
  br i1 %8, label %9, label %14

9:                                                ; preds = %4
  %10 = tail call noundef i32 @_Z3ccw2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %2, ptr noundef nonnull byval(%struct.pt) align 16 %3, ptr noundef nonnull byval(%struct.pt) align 16 %0)
  %11 = tail call noundef i32 @_Z3ccw2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %2, ptr noundef nonnull byval(%struct.pt) align 16 %3, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  %12 = mul nsw i32 %11, %10
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %22, label %14

14:                                               ; preds = %9, %4
  %15 = tail call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %2, ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  br i1 %15, label %22, label %16

16:                                               ; preds = %14
  %17 = tail call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %3, ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  br i1 %17, label %22, label %18

18:                                               ; preds = %16
  %19 = tail call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %2, ptr noundef nonnull byval(%struct.pt) align 16 %3)
  br i1 %19, label %22, label %20

20:                                               ; preds = %18
  %21 = tail call noundef zeroext i1 @_Z5onSeg2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %1, ptr noundef nonnull byval(%struct.pt) align 16 %2, ptr noundef nonnull byval(%struct.pt) align 16 %3)
  %spec.select = select i1 %21, i32 2, i32 0
  br label %22

22:                                               ; preds = %20, %14, %16, %18, %9
  %.0 = phi i32 [ 1, %9 ], [ 2, %18 ], [ 2, %16 ], [ 2, %14 ], [ %spec.select, %20 ]
  ret i32 %.0
}

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

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


; Effective O3 passes: DSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass