; LLVM IR from SciCompMod/GMGPolar :: src/InputFunctions/SourceTerms (polarR6_Poisson_CircularGeometry)

; 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"

%class.PolarR6_Poisson_CircularGeometry = type { %class.SourceTerm, double }
%class.SourceTerm = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK32PolarR6_Poisson_CircularGeometry5rhs_fERKdS1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) unnamed_addr #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %11 = load ptr, ptr %6, align 8
  %12 = load ptr, ptr %7, align 8, !tbaa !5
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %15 = load double, ptr %14, align 8, !tbaa !11
  %16 = fdiv double %13, %15
  %17 = call double @pow(double noundef %16, double noundef 4.000000e+00) #3
  %18 = fneg double %17
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %22 = load double, ptr %21, align 8, !tbaa !11
  %23 = fdiv double %20, %22
  %24 = fmul double 1.474560e+01, %23
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load double, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %28 = load double, ptr %27, align 8, !tbaa !11
  %29 = fdiv double %26, %28
  %30 = fsub double %29, 1.000000e+00
  %31 = call double @pow(double noundef %30, double noundef 5.000000e+00) #3
  %32 = fmul double %24, %31
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = fmul double 1.100000e+01, %34
  %36 = call double @cos(double noundef %35) #3
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = fdiv double %38, %40
  %42 = fmul double 1.000000e+00, %41
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fdiv double %44, %46
  %48 = fmul double 1.228800e+01, %47
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %52 = load double, ptr %51, align 8, !tbaa !11
  %53 = fdiv double %50, %52
  %54 = fsub double %53, 1.000000e+00
  %55 = call double @pow(double noundef %54, double noundef 4.000000e+00) #3
  %56 = fmul double %48, %55
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = fmul double 1.100000e+01, %58
  %60 = call double @cos(double noundef %59) #3
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fdiv double %62, %64
  %66 = fsub double %65, 1.000000e+00
  %67 = call double @pow(double noundef %66, double noundef 5.000000e+00) #3
  %68 = fmul double 1.720320e+01, %67
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = fmul double 1.100000e+01, %70
  %72 = call double @cos(double noundef %71) #3
  %73 = fmul double %68, %72
  %74 = call double @llvm.fmuladd.f64(double %56, double %60, double %73)
  %75 = fmul double %42, %74
  %76 = call double @llvm.fmuladd.f64(double %32, double %36, double %75)
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds %class.PolarR6_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = fdiv double %78, %80
  %82 = fsub double %81, 1.000000e+00
  %83 = call double @pow(double noundef %82, double noundef 6.000000e+00) #3
  %84 = fmul double 3.481600e+01, %83
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fmul double 1.100000e+01, %86
  %88 = call double @cos(double noundef %87) #3
  %89 = fneg double %84
  %90 = call double @llvm.fmuladd.f64(double %89, double %88, double %76)
  %91 = fmul double %18, %90
  ret double %91
}

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

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

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

attributes #0 = { 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 #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 = !{!"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}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS32PolarR6_Poisson_CircularGeometry", !13, i64 0, !10, i64 8}
!13 = !{!"_ZTS10SourceTerm"}


; 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, argmem: readwrite) uwtable
define dso_local noundef double @_ZNK32PolarR6_Poisson_CircularGeometry5rhs_fERKdS1_S1_S1_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %4) unnamed_addr #0 align 2 {
  %6 = load double, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load double, ptr %7, align 8, !tbaa !9
  %9 = fdiv double %6, %8
  %10 = tail call double @pow(double noundef %9, double noundef 4.000000e+00) #3
  %11 = fneg double %10
  %12 = load double, ptr %1, align 8, !tbaa !5
  %13 = load double, ptr %7, align 8, !tbaa !9
  %14 = fdiv double %12, %13
  %15 = fmul double %14, 1.474560e+01
  %16 = fadd double %14, -1.000000e+00
  %17 = tail call double @pow(double noundef %16, double noundef 5.000000e+00) #3
  %18 = fmul double %17, %15
  %19 = load double, ptr %2, align 8, !tbaa !5
  %20 = fmul double %19, 1.100000e+01
  %21 = tail call double @cos(double noundef %20) #3
  %22 = load double, ptr %1, align 8, !tbaa !5
  %23 = load double, ptr %7, align 8, !tbaa !9
  %24 = fdiv double %22, %23
  %25 = fmul double %24, 1.228800e+01
  %26 = fadd double %24, -1.000000e+00
  %27 = tail call double @pow(double noundef %26, double noundef 4.000000e+00) #3
  %28 = fmul double %27, %25
  %29 = load double, ptr %2, align 8, !tbaa !5
  %30 = fmul double %29, 1.100000e+01
  %31 = tail call double @cos(double noundef %30) #3
  %32 = load double, ptr %1, align 8, !tbaa !5
  %33 = load double, ptr %7, align 8, !tbaa !9
  %34 = fdiv double %32, %33
  %35 = fadd double %34, -1.000000e+00
  %36 = tail call double @pow(double noundef %35, double noundef 5.000000e+00) #3
  %37 = fmul double %36, 1.720320e+01
  %38 = load double, ptr %2, align 8, !tbaa !5
  %39 = fmul double %38, 1.100000e+01
  %40 = tail call double @cos(double noundef %39) #3
  %41 = fmul double %37, %40
  %42 = tail call double @llvm.fmuladd.f64(double %28, double %31, double %41)
  %43 = fmul double %24, %42
  %44 = tail call double @llvm.fmuladd.f64(double %18, double %21, double %43)
  %45 = load double, ptr %1, align 8, !tbaa !5
  %46 = load double, ptr %7, align 8, !tbaa !9
  %47 = fdiv double %45, %46
  %48 = fadd double %47, -1.000000e+00
  %49 = tail call double @pow(double noundef %48, double noundef 6.000000e+00) #3
  %50 = load double, ptr %2, align 8, !tbaa !5
  %51 = fmul double %50, 1.100000e+01
  %52 = tail call double @cos(double noundef %51) #3
  %53 = fmul double %49, -3.481600e+01
  %54 = tail call double @llvm.fmuladd.f64(double %53, double %52, double %44)
  %55 = fmul double %54, %11
  ret double %55
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(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, argmem: readwrite) 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS32PolarR6_Poisson_CircularGeometry", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS10SourceTerm"}


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