; LLVM IR from moarseniy/CudaFEMproject :: FEMproject/fem_utils/src/fem_utils.ll (ZN12ElementsData7BerlageEfff)

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN12ElementsData7BerlageEfff(ptr noundef nonnull align 8 dereferenceable(336) %0, float noundef %1, float noundef %2, float noundef %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %13 = load float, ptr %8, align 4, !tbaa !9
  %14 = fpext float %13 to double
  %15 = fmul double 0x401921FB54442D18, %14
  %16 = fptrunc double %15 to float
  store float %16, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %17 = load float, ptr %9, align 4, !tbaa !9
  %18 = call float @sqrtf(float noundef 3.000000e+00) #5
  %19 = fdiv float %17, %18
  store float %19, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %20 = load float, ptr %7, align 4, !tbaa !9
  %21 = load float, ptr %10, align 4, !tbaa !9
  %22 = fmul float %20, %21
  %23 = load float, ptr %10, align 4, !tbaa !9
  %24 = fmul float %22, %23
  %25 = fdiv float %24, 4.000000e+00
  %26 = load float, ptr %10, align 4, !tbaa !9
  %27 = fmul float -1.000000e+00, %26
  %28 = load float, ptr %6, align 4, !tbaa !9
  %29 = fmul float %27, %28
  %30 = call noundef float @_ZSt3expf(float noundef %29)
  %31 = fmul float %25, %30
  %32 = load float, ptr %9, align 4, !tbaa !9
  %33 = load float, ptr %6, align 4, !tbaa !9
  %34 = fmul float %32, %33
  %35 = call noundef float @_ZSt3sinf(float noundef %34)
  %36 = load float, ptr %10, align 4, !tbaa !9
  %37 = load float, ptr %10, align 4, !tbaa !9
  %38 = fmul float %36, %37
  %39 = load float, ptr %10, align 4, !tbaa !9
  %40 = fmul float %38, %39
  %41 = fdiv float 1.000000e+00, %40
  %42 = load float, ptr %6, align 4, !tbaa !9
  %43 = load float, ptr %10, align 4, !tbaa !9
  %44 = load float, ptr %10, align 4, !tbaa !9
  %45 = fmul float %43, %44
  %46 = fdiv float %42, %45
  %47 = fadd float %41, %46
  %48 = load float, ptr %6, align 4, !tbaa !9
  %49 = load float, ptr %6, align 4, !tbaa !9
  %50 = fmul float %48, %49
  %51 = load float, ptr %10, align 4, !tbaa !9
  %52 = fdiv float %50, %51
  %53 = fsub float %47, %52
  %54 = load float, ptr %9, align 4, !tbaa !9
  %55 = load float, ptr %6, align 4, !tbaa !9
  %56 = fmul float %54, %55
  %57 = call noundef float @_ZSt3cosf(float noundef %56)
  %58 = call float @sqrtf(float noundef 3.000000e+00) #5
  %59 = fmul float %57, %58
  %60 = load float, ptr %6, align 4, !tbaa !9
  %61 = load float, ptr %6, align 4, !tbaa !9
  %62 = fmul float %60, %61
  %63 = load float, ptr %10, align 4, !tbaa !9
  %64 = fdiv float %62, %63
  %65 = load float, ptr %6, align 4, !tbaa !9
  %66 = load float, ptr %10, align 4, !tbaa !9
  %67 = load float, ptr %10, align 4, !tbaa !9
  %68 = fmul float %66, %67
  %69 = fdiv float %65, %68
  %70 = fadd float %64, %69
  %71 = fmul float %59, %70
  %72 = fneg float %71
  %73 = call float @llvm.fmuladd.f32(float %35, float %53, float %72)
  %74 = fmul float %31, %73
  store float %74, ptr %11, align 4, !tbaa !9
  %75 = load float, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret float %75
}

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { inlinehint 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 #3 = { 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 #4 = { nounwind "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 #5 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_ZN12ElementsData7BerlageEfff(ptr nocapture noundef nonnull readnone align 8 dereferenceable(336) %0, float noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #2 align 2 {
  %5 = fpext float %3 to double
  %6 = fmul double %5, 0x401921FB54442D18
  %7 = fptrunc double %6 to float
  %8 = fdiv float %7, 0x3FFBB67AE0000000
  %9 = fmul float %8, %2
  %10 = fmul float %8, %9
  %11 = fmul float %10, 2.500000e-01
  %12 = fneg float %8
  %13 = fmul float %12, %1
  %14 = tail call noundef float @_ZSt3expf(float noundef %13)
  %15 = fmul float %11, %14
  %16 = fmul float %7, %1
  %17 = tail call noundef float @_ZSt3sinf(float noundef %16)
  %18 = fmul float %8, %8
  %19 = fmul float %8, %18
  %20 = insertelement <2 x float> <float poison, float 1.000000e+00>, float %1, i64 0
  %21 = insertelement <2 x float> poison, float %18, i64 0
  %22 = insertelement <2 x float> %21, float %19, i64 1
  %23 = fdiv <2 x float> %20, %22
  %24 = extractelement <2 x float> %23, i64 0
  %shift = shufflevector <2 x float> %23, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %25 = fadd <2 x float> %23, %shift
  %26 = extractelement <2 x float> %25, i64 0
  %27 = fmul float %1, %1
  %28 = fdiv float %27, %8
  %29 = fsub float %26, %28
  %30 = tail call noundef float @_ZSt3cosf(float noundef %16)
  %31 = fadd float %28, %24
  %32 = fmul float %30, 0xBFFBB67AE0000000
  %33 = fmul float %31, %32
  %34 = tail call float @llvm.fmuladd.f32(float %17, float %29, float %33)
  %35 = fmul float %15, %34
  ret float %35
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { inlinehint 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 #2 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass