; LLVM IR from OpenMathLib/OpenBLAS :: lapack-netlib/SRC (dladiv)

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @dladiv2_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %15 = load ptr, ptr %11, align 8, !tbaa !5
  %16 = load double, ptr %15, align 8, !tbaa !9
  %17 = fcmp une double %16, 0.000000e+00
  br i1 %17, label %18, label %49

18:                                               ; preds = %6
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = fmul double %20, %22
  store double %23, ptr %14, align 8, !tbaa !9
  %24 = load double, ptr %14, align 8, !tbaa !9
  %25 = fcmp une double %24, 0.000000e+00
  br i1 %25, label %26, label %34

26:                                               ; preds = %18
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = load double, ptr %14, align 8, !tbaa !9
  %30 = fadd double %28, %29
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = fmul double %30, %32
  store double %33, ptr %13, align 8, !tbaa !9
  br label %48

34:                                               ; preds = %18
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load double, ptr %35, align 8, !tbaa !9
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = fmul double %40, %42
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = fmul double %43, %45
  %47 = call double @llvm.fmuladd.f64(double %36, double %38, double %46)
  store double %47, ptr %13, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %34, %26
  br label %63

49:                                               ; preds = %6
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = fdiv double %55, %57
  %59 = call double @llvm.fmuladd.f64(double %53, double %58, double %51)
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fmul double %59, %61
  store double %62, ptr %13, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %49, %48
  %64 = load double, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret double %64
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


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

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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local double @dladiv2_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5) local_unnamed_addr #1 {
  %7 = load double, ptr %4, align 8, !tbaa !5
  %8 = fcmp une double %7, 0.000000e+00
  br i1 %8, label %9, label %23

9:                                                ; preds = %6
  %10 = load double, ptr %1, align 8, !tbaa !5
  %11 = fmul double %7, %10
  %12 = fcmp une double %11, 0.000000e+00
  %13 = load double, ptr %0, align 8, !tbaa !5
  br i1 %12, label %14, label %18

14:                                               ; preds = %9
  %15 = fadd double %11, %13
  %16 = load double, ptr %5, align 8, !tbaa !5
  %17 = fmul double %15, %16
  br label %32

18:                                               ; preds = %9
  %19 = load double, ptr %5, align 8, !tbaa !5
  %20 = fmul double %10, %19
  %21 = fmul double %7, %20
  %22 = tail call double @llvm.fmuladd.f64(double %13, double %19, double %21)
  br label %32

23:                                               ; preds = %6
  %24 = load double, ptr %0, align 8, !tbaa !5
  %25 = load double, ptr %3, align 8, !tbaa !5
  %26 = load double, ptr %1, align 8, !tbaa !5
  %27 = load double, ptr %2, align 8, !tbaa !5
  %28 = fdiv double %26, %27
  %29 = tail call double @llvm.fmuladd.f64(double %25, double %28, double %24)
  %30 = load double, ptr %5, align 8, !tbaa !5
  %31 = fmul double %30, %29
  br label %32

32:                                               ; preds = %14, %18, %23
  %.0 = phi double [ %17, %14 ], [ %22, %18 ], [ %31, %23 ]
  ret double %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass