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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z2eqee(x86_fp80 noundef, x86_fp80 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z5cross2ptS_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #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 uwtable
declare dso_local void @_ZNK2ptmiES_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptdvEe(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptmlEe(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z20lineLineIntersection4LineS_R2pt(ptr noundef byval(%struct.Line) align 16 %0, ptr noundef byval(%struct.Line) align 16 %1, ptr noundef nonnull align 16 dereferenceable(32) %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca x86_fp80, 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 i32, align 4
  %12 = alloca %struct.pt, align 16
  %13 = alloca %struct.pt, align 16
  %14 = alloca %struct.pt, align 16
  %15 = alloca %struct.pt, align 16
  store ptr %2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  %16 = getelementptr inbounds %struct.Line, ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %16, i64 32, i1 false), !tbaa.struct !9
  %17 = getelementptr inbounds %struct.Line, ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %17, i64 32, i1 false), !tbaa.struct !9
  %18 = call noundef x86_fp80 @_Z5cross2ptS_(ptr noundef byval(%struct.pt) align 16 %7, ptr noundef byval(%struct.pt) align 16 %8)
  store x86_fp80 %18, ptr %6, align 16, !tbaa !10
  %19 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %20 = call noundef zeroext i1 @_Z2eqee(x86_fp80 noundef %19, x86_fp80 noundef 0xK00000000000000000000)
  br i1 %20, label %21, label %31

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %22 = getelementptr inbounds %struct.Line, ptr %1, i32 0, i32 0
  %23 = getelementptr inbounds %struct.Line, ptr %0, i32 0, i32 1
  %24 = load x86_fp80, ptr %23, align 16, !tbaa !12
  call void @_ZNK2ptmlEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %9, ptr noundef nonnull align 16 dereferenceable(32) %22, x86_fp80 noundef %24)
  %25 = getelementptr inbounds %struct.Line, ptr %0, i32 0, i32 0
  %26 = getelementptr inbounds %struct.Line, ptr %1, i32 0, i32 1
  %27 = load x86_fp80, ptr %26, align 16, !tbaa !12
  call void @_ZNK2ptmlEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %10, ptr noundef nonnull align 16 dereferenceable(32) %25, x86_fp80 noundef %27)
  %28 = call noundef zeroext i1 @_ZNK2pteqES_(ptr noundef nonnull align 16 dereferenceable(32) %9, ptr noundef byval(%struct.pt) align 16 %10)
  %29 = zext i1 %28 to i64
  %30 = select i1 %28, i32 2, i32 0
  store i32 %30, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  store i32 1, ptr %11, align 4
  br label %40

31:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  %32 = getelementptr inbounds %struct.Line, ptr %1, i32 0, i32 0
  %33 = getelementptr inbounds %struct.Line, ptr %0, i32 0, i32 1
  %34 = load x86_fp80, ptr %33, align 16, !tbaa !12
  call void @_ZNK2ptmlEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %14, ptr noundef nonnull align 16 dereferenceable(32) %32, x86_fp80 noundef %34)
  %35 = getelementptr inbounds %struct.Line, ptr %0, i32 0, i32 0
  %36 = getelementptr inbounds %struct.Line, ptr %1, i32 0, i32 1
  %37 = load x86_fp80, ptr %36, align 16, !tbaa !12
  call void @_ZNK2ptmlEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %15, ptr noundef nonnull align 16 dereferenceable(32) %35, x86_fp80 noundef %37)
  call void @_ZNK2ptmiES_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %13, ptr noundef nonnull align 16 dereferenceable(32) %14, ptr noundef byval(%struct.pt) align 16 %15)
  %38 = load x86_fp80, ptr %6, align 16, !tbaa !10
  call void @_ZNK2ptdvEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %12, ptr noundef nonnull align 16 dereferenceable(32) %13, x86_fp80 noundef %38)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %39, ptr align 16 %12, i64 32, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %40

40:                                               ; preds = %31, %21
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  %41 = load i32, ptr %4, align 4
  ret i32 %41
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK2pteqES_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) #2 align 2

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) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 16, !10, i64 16, i64 16, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"long double", !7, i64 0}
!12 = !{!13, !11, i64 32}
!13 = !{!"_ZTS4Line", !14, i64 0, !11, i64 32}
!14 = !{!"_ZTS2pt", !11, i64 0, !11, i64 16}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z2eqee(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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 uwtable
declare dso_local void @_ZNK2ptmiES_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptdvEe(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptmlEe(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z20lineLineIntersection4LineS_R2pt(ptr noundef byval(%struct.Line) align 16 %0, ptr noundef byval(%struct.Line) align 16 %1, ptr nocapture noundef nonnull writeonly align 16 dereferenceable(32) %2) local_unnamed_addr #2 {
  %4 = alloca %struct.pt, align 16
  %5 = alloca %struct.pt, align 16
  %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 = tail call noundef x86_fp80 @_Z5cross2ptS_(ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  %11 = tail call noundef zeroext i1 @_Z2eqee(x86_fp80 noundef %10, x86_fp80 noundef 0xK00000000000000000000)
  br i1 %11, label %12, label %19

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load x86_fp80, ptr %13, align 16, !tbaa !5
  call void @_ZNK2ptmlEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %4, ptr noundef nonnull align 16 dereferenceable(32) %1, x86_fp80 noundef %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 32
  %16 = load x86_fp80, ptr %15, align 16, !tbaa !5
  call void @_ZNK2ptmlEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %5, ptr noundef nonnull align 16 dereferenceable(32) %0, x86_fp80 noundef %16)
  %17 = call noundef zeroext i1 @_ZNK2pteqES_(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull byval(%struct.pt) align 16 %5)
  %18 = select i1 %17, i32 2, i32 0
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %24

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = load x86_fp80, ptr %20, align 16, !tbaa !5
  call void @_ZNK2ptmlEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %8, ptr noundef nonnull align 16 dereferenceable(32) %1, x86_fp80 noundef %21)
  %22 = getelementptr inbounds i8, ptr %1, i64 32
  %23 = load x86_fp80, ptr %22, align 16, !tbaa !5
  call void @_ZNK2ptmlEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %9, ptr noundef nonnull align 16 dereferenceable(32) %0, x86_fp80 noundef %23)
  call void @_ZNK2ptmiES_(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %7, ptr noundef nonnull align 16 dereferenceable(32) %8, ptr noundef nonnull byval(%struct.pt) align 16 %9)
  call void @_ZNK2ptdvEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %6, ptr noundef nonnull align 16 dereferenceable(32) %7, x86_fp80 noundef %10)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %2, ptr noundef nonnull align 16 dereferenceable(32) %6, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  br label %24

24:                                               ; preds = %19, %12
  %.0 = phi i32 [ %18, %12 ], [ 1, %19 ]
  ret i32 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK2pteqES_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #2 align 2

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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !8, i64 32}
!6 = !{!"_ZTS4Line", !7, i64 0, !8, i64 32}
!7 = !{!"_ZTS2pt", !8, i64 0, !8, i64 16}
!8 = !{!"long double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!12 = !{!8, !8, i64 0}


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