; LLVM IR from SciCompMod/GMGPolar :: src/InputFunctions/BoundaryConditions (refined_Boundary_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.Refined_Boundary_CircularGeometry = type { %class.BoundaryConditions, double }
%class.BoundaryConditions = type { ptr }

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK33Refined_Boundary_CircularGeometry12u_D_InteriorERKdS1_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 #2 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.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %15 = load double, ptr %14, align 8, !tbaa !11
  %16 = fdiv double %13, %15
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = load double, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %20 = load double, ptr %19, align 8, !tbaa !11
  %21 = fdiv double %18, %20
  %22 = fmul double %16, %21
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %26 = load double, ptr %25, align 8, !tbaa !11
  %27 = fdiv double %24, %26
  %28 = fmul double 0.000000e+00, %27
  %29 = fneg double %28
  %30 = call double @llvm.fmuladd.f64(double 0xBCEE1173C8DA9136, double %22, double %29)
  %31 = fsub double %30, 0.000000e+00
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = fdiv double %33, %35
  %37 = fsub double %36, 9.000000e-01
  %38 = call double @pow(double noundef %37, double noundef 2.000000e+00) #3
  %39 = fmul double 0xC0AA0AAAAAAAAAA3, %38
  %40 = call double @exp(double noundef %39) #3
  %41 = fadd double %31, %40
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = fmul double 2.100000e+01, %43
  %45 = call double @cos(double noundef %44) #3
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %49 = load double, ptr %48, align 8, !tbaa !11
  %50 = fdiv double %47, %49
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %54 = load double, ptr %53, align 8, !tbaa !11
  %55 = fdiv double %52, %54
  %56 = fmul double %50, %55
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %60 = load double, ptr %59, align 8, !tbaa !11
  %61 = fdiv double %58, %60
  %62 = fmul double 0x3F5D8A1258FB18E4, %61
  %63 = fneg double %62
  %64 = call double @llvm.fmuladd.f64(double 0x3F5E30FC449ED59D, double %56, double %63)
  %65 = fsub double %64, 0x3F05017922D4B0FC
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds %class.Refined_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = fdiv double %67, %69
  %71 = fsub double %70, 4.500000e-01
  %72 = call double @pow(double noundef %71, double noundef 2.000000e+00) #3
  %73 = fmul double -5.000000e+01, %72
  %74 = call double @exp(double noundef %73) #3
  %75 = fadd double %65, %74
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fmul double 9.000000e+00, %77
  %79 = call double @cos(double noundef %78) #3
  %80 = fmul double %75, %79
  %81 = call double @llvm.fmuladd.f64(double %41, double %45, double %80)
  ret double %81
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { 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 = !{!"_ZTS33Refined_Boundary_CircularGeometry", !13, i64 0, !10, i64 8}
!13 = !{!"_ZTS18BoundaryConditions"}


; 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 double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(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 nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local noundef double @_ZNK33Refined_Boundary_CircularGeometry12u_D_InteriorERKdS1_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 #2 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 = fmul double %9, %9
  %11 = fmul double %9, -0.000000e+00
  %12 = tail call double @llvm.fmuladd.f64(double %10, double 0xBCEE1173C8DA9136, double %11)
  %13 = fadd double %9, -9.000000e-01
  %square = fmul double %13, %13
  %14 = fmul double %square, 0xC0AA0AAAAAAAAAA3
  %15 = tail call double @exp(double noundef %14) #3
  %16 = fadd double %15, %12
  %17 = load double, ptr %2, align 8, !tbaa !5
  %18 = fmul double %17, 2.100000e+01
  %19 = tail call double @cos(double noundef %18) #3
  %20 = load double, ptr %1, align 8, !tbaa !5
  %21 = load double, ptr %7, align 8, !tbaa !9
  %22 = fdiv double %20, %21
  %23 = fmul double %22, %22
  %24 = fmul double %22, 0xBF5D8A1258FB18E4
  %25 = tail call double @llvm.fmuladd.f64(double %23, double 0x3F5E30FC449ED59D, double %24)
  %26 = fadd double %25, 0xBF05017922D4B0FC
  %27 = fadd double %22, -4.500000e-01
  %square11 = fmul double %27, %27
  %28 = fmul double %square11, -5.000000e+01
  %29 = tail call double @exp(double noundef %28) #3
  %30 = fadd double %29, %26
  %31 = load double, ptr %2, align 8, !tbaa !5
  %32 = fmul double %31, 9.000000e+00
  %33 = tail call double @cos(double noundef %32) #3
  %34 = fmul double %33, %30
  %35 = tail call double @llvm.fmuladd.f64(double %16, double %19, double %34)
  ret double %35
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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 #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 = !{!"_ZTS33Refined_Boundary_CircularGeometry", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS18BoundaryConditions"}


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