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

; 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 @jacobian_dxdh_no_contact(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) #0 {
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  store double %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !5
  store double %3, ptr %9, align 8, !tbaa !5
  store double %4, ptr %10, align 8, !tbaa !5
  %11 = load double, ptr %6, align 8, !tbaa !5
  %12 = load double, ptr %7, align 8, !tbaa !5
  %13 = fdiv double %11, %12
  %14 = load double, ptr %6, align 8, !tbaa !5
  %15 = load double, ptr %7, align 8, !tbaa !5
  %16 = fdiv double %14, %15
  %17 = load double, ptr %6, align 8, !tbaa !5
  %18 = fmul double %16, %17
  %19 = load double, ptr %7, align 8, !tbaa !5
  %20 = fdiv double %18, %19
  %21 = fadd double 1.000000e+00, %20
  %22 = call double @sqrt(double noundef %21) #3
  %23 = fadd double %13, %22
  %24 = call double @log(double noundef %23) #3
  %25 = load double, ptr %6, align 8, !tbaa !5
  %26 = load double, ptr %8, align 8, !tbaa !5
  %27 = load double, ptr %9, align 8, !tbaa !5
  %28 = fneg double %26
  %29 = call double @llvm.fmuladd.f64(double %28, double %27, double %25)
  %30 = load double, ptr %7, align 8, !tbaa !5
  %31 = fdiv double %29, %30
  %32 = load double, ptr %6, align 8, !tbaa !5
  %33 = load double, ptr %8, align 8, !tbaa !5
  %34 = load double, ptr %9, align 8, !tbaa !5
  %35 = fneg double %33
  %36 = call double @llvm.fmuladd.f64(double %35, double %34, double %32)
  %37 = load double, ptr %7, align 8, !tbaa !5
  %38 = fdiv double %36, %37
  %39 = load double, ptr %6, align 8, !tbaa !5
  %40 = load double, ptr %8, align 8, !tbaa !5
  %41 = load double, ptr %9, align 8, !tbaa !5
  %42 = fneg double %40
  %43 = call double @llvm.fmuladd.f64(double %42, double %41, double %39)
  %44 = fmul double %38, %43
  %45 = load double, ptr %7, align 8, !tbaa !5
  %46 = fdiv double %44, %45
  %47 = fadd double 1.000000e+00, %46
  %48 = call double @sqrt(double noundef %47) #3
  %49 = fadd double %31, %48
  %50 = call double @log(double noundef %49) #3
  %51 = fsub double %24, %50
  %52 = load double, ptr %8, align 8, !tbaa !5
  %53 = fdiv double %51, %52
  %54 = load double, ptr %6, align 8, !tbaa !5
  %55 = load double, ptr %7, align 8, !tbaa !5
  %56 = fdiv double %54, %55
  %57 = load double, ptr %6, align 8, !tbaa !5
  %58 = load double, ptr %7, align 8, !tbaa !5
  %59 = fdiv double %57, %58
  %60 = call double @pow(double noundef %59, double noundef 2.000000e+00) #3
  %61 = load double, ptr %6, align 8, !tbaa !5
  %62 = load double, ptr %7, align 8, !tbaa !5
  %63 = fdiv double %61, %62
  %64 = call double @pow(double noundef %63, double noundef 2.000000e+00) #3
  %65 = fadd double 1.000000e+00, %64
  %66 = call double @sqrt(double noundef %65) #3
  %67 = fdiv double %60, %66
  %68 = fadd double %56, %67
  %69 = load double, ptr %6, align 8, !tbaa !5
  %70 = load double, ptr %7, align 8, !tbaa !5
  %71 = fdiv double %69, %70
  %72 = load double, ptr %6, align 8, !tbaa !5
  %73 = load double, ptr %7, align 8, !tbaa !5
  %74 = fdiv double %72, %73
  %75 = call double @pow(double noundef %74, double noundef 2.000000e+00) #3
  %76 = fadd double 1.000000e+00, %75
  %77 = call double @sqrt(double noundef %76) #3
  %78 = fadd double %71, %77
  %79 = fdiv double %68, %78
  %80 = load double, ptr %6, align 8, !tbaa !5
  %81 = load double, ptr %8, align 8, !tbaa !5
  %82 = load double, ptr %9, align 8, !tbaa !5
  %83 = fneg double %81
  %84 = call double @llvm.fmuladd.f64(double %83, double %82, double %80)
  %85 = load double, ptr %7, align 8, !tbaa !5
  %86 = fdiv double %84, %85
  %87 = load double, ptr %6, align 8, !tbaa !5
  %88 = load double, ptr %8, align 8, !tbaa !5
  %89 = load double, ptr %9, align 8, !tbaa !5
  %90 = fneg double %88
  %91 = call double @llvm.fmuladd.f64(double %90, double %89, double %87)
  %92 = load double, ptr %7, align 8, !tbaa !5
  %93 = fdiv double %91, %92
  %94 = call double @pow(double noundef %93, double noundef 2.000000e+00) #3
  %95 = load double, ptr %6, align 8, !tbaa !5
  %96 = load double, ptr %8, align 8, !tbaa !5
  %97 = load double, ptr %9, align 8, !tbaa !5
  %98 = fneg double %96
  %99 = call double @llvm.fmuladd.f64(double %98, double %97, double %95)
  %100 = load double, ptr %7, align 8, !tbaa !5
  %101 = fdiv double %99, %100
  %102 = call double @pow(double noundef %101, double noundef 2.000000e+00) #3
  %103 = fadd double 1.000000e+00, %102
  %104 = call double @sqrt(double noundef %103) #3
  %105 = fdiv double %94, %104
  %106 = fadd double %86, %105
  %107 = load double, ptr %6, align 8, !tbaa !5
  %108 = load double, ptr %8, align 8, !tbaa !5
  %109 = load double, ptr %9, align 8, !tbaa !5
  %110 = fneg double %108
  %111 = call double @llvm.fmuladd.f64(double %110, double %109, double %107)
  %112 = load double, ptr %7, align 8, !tbaa !5
  %113 = fdiv double %111, %112
  %114 = load double, ptr %6, align 8, !tbaa !5
  %115 = load double, ptr %8, align 8, !tbaa !5
  %116 = load double, ptr %9, align 8, !tbaa !5
  %117 = fneg double %115
  %118 = call double @llvm.fmuladd.f64(double %117, double %116, double %114)
  %119 = load double, ptr %7, align 8, !tbaa !5
  %120 = fdiv double %118, %119
  %121 = call double @pow(double noundef %120, double noundef 2.000000e+00) #3
  %122 = fadd double 1.000000e+00, %121
  %123 = call double @sqrt(double noundef %122) #3
  %124 = fadd double %113, %123
  %125 = fdiv double %106, %124
  %126 = fsub double %79, %125
  %127 = load double, ptr %8, align 8, !tbaa !5
  %128 = fdiv double %126, %127
  %129 = fsub double %53, %128
  %130 = load double, ptr %9, align 8, !tbaa !5
  %131 = load double, ptr %10, align 8, !tbaa !5
  %132 = fdiv double %130, %131
  %133 = fadd double %129, %132
  ret double %133
}

; 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

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

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 @jacobian_dxdh_no_contact(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #0 {
  %6 = fneg double %2
  %7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %0)
  %8 = insertelement <2 x double> poison, double %0, i64 0
  %9 = insertelement <2 x double> %8, double %7, i64 1
  %10 = insertelement <2 x double> poison, double %1, i64 0
  %11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
  %12 = fdiv <2 x double> %9, %11
  %13 = extractelement <2 x double> %12, i64 0
  %14 = fmul double %13, %0
  %15 = fdiv double %14, %1
  %16 = fadd double %15, 1.000000e+00
  %17 = tail call double @sqrt(double noundef %16) #4
  %18 = fadd double %13, %17
  %19 = tail call double @log(double noundef %18) #4
  %20 = extractelement <2 x double> %12, i64 1
  %21 = fmul double %7, %20
  %22 = fdiv double %21, %1
  %23 = fadd double %22, 1.000000e+00
  %24 = tail call double @sqrt(double noundef %23) #4
  %25 = fadd double %20, %24
  %26 = tail call double @log(double noundef %25) #4
  %27 = fsub double %19, %26
  %28 = fmul <2 x double> %12, %12
  %29 = fadd <2 x double> %28, <double 1.000000e+00, double 1.000000e+00>
  %30 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %29)
  %31 = fdiv <2 x double> %28, %30
  %32 = fadd <2 x double> %12, %31
  %33 = fadd <2 x double> %12, %30
  %34 = fdiv <2 x double> %32, %33
  %shift = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %35 = fsub <2 x double> %34, %shift
  %36 = extractelement <2 x double> %35, i64 0
  %37 = fdiv double %36, %2
  %38 = insertelement <2 x double> poison, double %3, i64 0
  %39 = insertelement <2 x double> %38, double %27, i64 1
  %40 = insertelement <2 x double> poison, double %4, i64 0
  %41 = insertelement <2 x double> %40, double %2, i64 1
  %42 = fdiv <2 x double> %39, %41
  %43 = extractelement <2 x double> %42, i64 1
  %44 = fsub double %43, %37
  %45 = extractelement <2 x double> %42, i64 0
  %46 = fadd double %45, %44
  ret double %46
}

; 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass