; LLVM IR from OpenFAST/openfast :: modules/map/src (residual)

; 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: nounwind uwtable
define dso_local double @residual_function_length_no_contact(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) #0 {
  %7 = alloca double, 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
  store double %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !5
  store double %2, ptr %9, align 8, !tbaa !5
  store double %3, ptr %10, align 8, !tbaa !5
  store double %4, ptr %11, align 8, !tbaa !5
  store double %5, ptr %12, align 8, !tbaa !5
  %13 = load double, ptr %8, align 8, !tbaa !5
  %14 = load double, ptr %9, align 8, !tbaa !5
  %15 = fdiv double %13, %14
  %16 = load double, ptr %7, align 8, !tbaa !5
  %17 = load double, ptr %8, align 8, !tbaa !5
  %18 = fdiv double %16, %17
  %19 = load double, ptr %7, align 8, !tbaa !5
  %20 = load double, ptr %8, align 8, !tbaa !5
  %21 = fdiv double %19, %20
  %22 = load double, ptr %7, align 8, !tbaa !5
  %23 = fmul double %21, %22
  %24 = load double, ptr %8, align 8, !tbaa !5
  %25 = fdiv double %23, %24
  %26 = fadd double 1.000000e+00, %25
  %27 = call double @sqrt(double noundef %26) #3
  %28 = fadd double %18, %27
  %29 = call double @log(double noundef %28) #3
  %30 = load double, ptr %8, align 8, !tbaa !5
  %31 = load double, ptr %9, align 8, !tbaa !5
  %32 = fdiv double %30, %31
  %33 = load double, ptr %7, align 8, !tbaa !5
  %34 = load double, ptr %9, align 8, !tbaa !5
  %35 = load double, ptr %10, align 8, !tbaa !5
  %36 = fneg double %34
  %37 = call double @llvm.fmuladd.f64(double %36, double %35, double %33)
  %38 = load double, ptr %8, align 8, !tbaa !5
  %39 = fdiv double %37, %38
  %40 = load double, ptr %7, align 8, !tbaa !5
  %41 = load double, ptr %9, align 8, !tbaa !5
  %42 = load double, ptr %10, align 8, !tbaa !5
  %43 = fneg double %41
  %44 = call double @llvm.fmuladd.f64(double %43, double %42, double %40)
  %45 = load double, ptr %8, align 8, !tbaa !5
  %46 = fdiv double %44, %45
  %47 = load double, ptr %7, align 8, !tbaa !5
  %48 = load double, ptr %9, align 8, !tbaa !5
  %49 = load double, ptr %10, align 8, !tbaa !5
  %50 = fneg double %48
  %51 = call double @llvm.fmuladd.f64(double %50, double %49, double %47)
  %52 = fmul double %46, %51
  %53 = load double, ptr %8, align 8, !tbaa !5
  %54 = fdiv double %52, %53
  %55 = fadd double 1.000000e+00, %54
  %56 = call double @sqrt(double noundef %55) #3
  %57 = fadd double %39, %56
  %58 = call double @log(double noundef %57) #3
  %59 = fmul double %32, %58
  %60 = fneg double %59
  %61 = call double @llvm.fmuladd.f64(double %15, double %29, double %60)
  %62 = load double, ptr %8, align 8, !tbaa !5
  %63 = load double, ptr %10, align 8, !tbaa !5
  %64 = fmul double %62, %63
  %65 = load double, ptr %11, align 8, !tbaa !5
  %66 = fdiv double %64, %65
  %67 = fadd double %61, %66
  %68 = load double, ptr %12, align 8, !tbaa !5
  %69 = fsub double %67, %68
  ret double %69
}

; Function Attrs: nounwind
declare double @log(double noundef) #1

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

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

attributes #0 = { 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 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; 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 double @residual_function_length_no_contact(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) local_unnamed_addr #0 {
  %7 = fdiv double %1, %2
  %8 = fdiv double %0, %1
  %9 = fmul double %8, %0
  %10 = fdiv double %9, %1
  %11 = fadd double %10, 1.000000e+00
  %12 = tail call double @sqrt(double noundef %11) #3
  %13 = fadd double %8, %12
  %14 = tail call double @log(double noundef %13) #3
  %15 = fneg double %2
  %16 = tail call double @llvm.fmuladd.f64(double %15, double %3, double %0)
  %17 = fdiv double %16, %1
  %18 = fmul double %16, %17
  %19 = fdiv double %18, %1
  %20 = fadd double %19, 1.000000e+00
  %21 = tail call double @sqrt(double noundef %20) #3
  %22 = fadd double %17, %21
  %23 = tail call double @log(double noundef %22) #3
  %24 = fneg double %7
  %25 = fmul double %23, %24
  %26 = tail call double @llvm.fmuladd.f64(double %7, double %14, double %25)
  %27 = fmul double %1, %3
  %28 = fdiv double %27, %4
  %29 = fadd double %28, %26
  %30 = fsub double %29, %5
  ret double %30
}

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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)"}


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