; LLVM IR from atlantis13579/Riemann :: Src/Solver/NewtonRaphsonIteration.ll (Z10DerivativeRKSt8functionIFffEEf)

; 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: mustprogress uwtable
define dso_local noundef float @_Z10DerivativeRKSt8functionIFffEEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store float 0x3F847AE140000000, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = load float, ptr %4, align 4, !tbaa !9
  %10 = fadd float %9, 0x3F847AE140000000
  %11 = call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %8, float noundef %10)
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load float, ptr %4, align 4, !tbaa !9
  %14 = call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %12, float noundef %13)
  %15 = fsub float %11, %14
  %16 = fdiv float %15, 0x3F847AE140000000
  store float %16, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = load float, ptr %4, align 4, !tbaa !9
  %19 = call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %17, float noundef %18)
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = load float, ptr %4, align 4, !tbaa !9
  %22 = fsub float %21, 0x3F847AE140000000
  %23 = call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %20, float noundef %22)
  %24 = fsub float %19, %23
  %25 = fdiv float %24, 0x3F847AE140000000
  store float %25, ptr %7, align 4, !tbaa !9
  %26 = load float, ptr %6, align 4, !tbaa !9
  %27 = load float, ptr %7, align 4, !tbaa !9
  %28 = fadd float %26, %27
  %29 = fmul float %28, 5.000000e-01
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  ret float %29
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32), float noundef) #0 align 2

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

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!10, !10, i64 0}
!10 = !{!"float", !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 uwtable
define dso_local noundef float @_Z10DerivativeRKSt8functionIFffEEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1) local_unnamed_addr #0 {
  %3 = fadd float %1, 0x3F847AE140000000
  %4 = tail call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %3)
  %5 = tail call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1)
  %6 = tail call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1)
  %7 = fadd float %1, 0xBF847AE140000000
  %8 = tail call noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %7)
  %9 = insertelement <2 x float> poison, float %4, i64 0
  %10 = insertelement <2 x float> %9, float %6, i64 1
  %11 = insertelement <2 x float> poison, float %5, i64 0
  %12 = insertelement <2 x float> %11, float %8, i64 1
  %13 = fsub <2 x float> %10, %12
  %14 = fdiv <2 x float> %13, <float 0x3F847AE140000000, float 0x3F847AE140000000>
  %shift = shufflevector <2 x float> %14, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %15 = fadd <2 x float> %14, %shift
  %16 = extractelement <2 x float> %15, i64 0
  %17 = fmul float %16, 5.000000e-01
  ret float %17
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNKSt8functionIFffEEclEf(ptr noundef nonnull align 8 dereferenceable(32), float noundef) local_unnamed_addr #0 align 2

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: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass