; LLVM IR from USDA-ARS-ACSL/MAIZSIM :: Crop source/Development.ll (ZN12CDevelopment7beta_fnEdddd)

; 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: mustprogress nounwind uwtable
define dso_local noundef double @_ZN12CDevelopment7beta_fnEdddd(ptr noundef nonnull align 8 dereferenceable(1352) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) #1 align 2 {
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !9
  %18 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  store double 1.000000e+00, ptr %16, align 8, !tbaa !9
  %19 = load double, ptr %8, align 8, !tbaa !9
  %20 = fcmp ole double %19, 0.000000e+00
  br i1 %20, label %25, label %21

21:                                               ; preds = %5
  %22 = load double, ptr %8, align 8, !tbaa !9
  %23 = load double, ptr %11, align 8, !tbaa !9
  %24 = fcmp oge double %22, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %21, %5
  store double 0.000000e+00, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %62

26:                                               ; preds = %21
  %27 = load double, ptr %11, align 8, !tbaa !9
  %28 = load double, ptr %10, align 8, !tbaa !9
  %29 = fcmp ole double %27, %28
  br i1 %29, label %33, label %30

30:                                               ; preds = %26
  %31 = load double, ptr %10, align 8, !tbaa !9
  %32 = fcmp ole double %31, 0.000000e+00
  br i1 %32, label %33, label %34

33:                                               ; preds = %30, %26
  store double 0.000000e+00, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %62

34:                                               ; preds = %30
  %35 = load double, ptr %8, align 8, !tbaa !9
  %36 = fsub double %35, 0.000000e+00
  %37 = load double, ptr %10, align 8, !tbaa !9
  %38 = fsub double %37, 0.000000e+00
  %39 = fdiv double %36, %38
  store double %39, ptr %12, align 8, !tbaa !9
  %40 = load double, ptr %11, align 8, !tbaa !9
  %41 = load double, ptr %8, align 8, !tbaa !9
  %42 = fsub double %40, %41
  %43 = load double, ptr %11, align 8, !tbaa !9
  %44 = load double, ptr %10, align 8, !tbaa !9
  %45 = fsub double %43, %44
  %46 = fdiv double %42, %45
  store double %46, ptr %13, align 8, !tbaa !9
  %47 = load double, ptr %10, align 8, !tbaa !9
  %48 = fsub double %47, 0.000000e+00
  %49 = fmul double 1.000000e+00, %48
  %50 = load double, ptr %11, align 8, !tbaa !9
  %51 = load double, ptr %10, align 8, !tbaa !9
  %52 = fsub double %50, %51
  %53 = fdiv double %49, %52
  store double %53, ptr %14, align 8, !tbaa !9
  %54 = load double, ptr %9, align 8, !tbaa !9
  %55 = load double, ptr %12, align 8, !tbaa !9
  %56 = load double, ptr %14, align 8, !tbaa !9
  %57 = call double @pow(double noundef %55, double noundef %56) #3
  %58 = fmul double %54, %57
  %59 = load double, ptr %13, align 8, !tbaa !9
  %60 = call double @pow(double noundef %59, double noundef 1.000000e+00) #3
  %61 = fmul double %58, %60
  store double %61, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %62

62:                                               ; preds = %34, %33, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %63 = load double, ptr %6, align 8
  ret double %63
}

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #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++ 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 nofree nounwind willreturn memory(write) uwtable
define dso_local noundef double @_ZN12CDevelopment7beta_fnEdddd(ptr nocapture noundef nonnull readnone align 8 dereferenceable(1352) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #0 align 2 {
  %6 = fcmp ugt double %1, 0.000000e+00
  %7 = fcmp ult double %1, %4
  %or.cond25 = and i1 %6, %7
  br i1 %or.cond25, label %8, label %20

8:                                                ; preds = %5
  %9 = fcmp ole double %4, %3
  %10 = fcmp ole double %3, 0.000000e+00
  %or.cond = or i1 %10, %9
  br i1 %or.cond, label %20, label %11

11:                                               ; preds = %8
  %12 = fdiv double %1, %3
  %13 = fsub double %4, %1
  %14 = fsub double %4, %3
  %15 = fdiv double %13, %14
  %16 = fdiv double %3, %14
  %17 = tail call double @pow(double noundef %12, double noundef %16) #2
  %18 = fmul double %17, %2
  %19 = fmul double %15, %18
  br label %20

20:                                               ; preds = %8, %5, %11
  %.0 = phi double [ %19, %11 ], [ 0.000000e+00, %5 ], [ 0.000000e+00, %8 ]
  ret double %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) 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 nofree nounwind willreturn memory(write) "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 = { 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)"}


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