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

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

; Function Attrs: nounwind
declare double @sin(double noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK37CartesianR6_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 #1 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.CartesianR6_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %15 = load double, ptr %14, align 8, !tbaa !11
  %16 = fdiv double %13, %15
  %17 = fsub double %16, 1.000000e+00
  %18 = call double @pow(double noundef %17, double noundef 6.000000e+00) #2
  %19 = fmul double 4.096000e-01, %18
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load double, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds %class.CartesianR6_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = fdiv double %21, %23
  %25 = fadd double %24, 1.000000e+00
  %26 = call double @pow(double noundef %25, double noundef 6.000000e+00) #2
  %27 = fmul double %19, %26
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds %class.CartesianR6_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %31 = load double, ptr %30, align 8, !tbaa !11
  %32 = fdiv double %29, %31
  %33 = fmul double 0x401921FB54442D18, %32
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = fmul double %33, %35
  %37 = call double @sin(double noundef %36) #2
  %38 = fmul double %27, %37
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds %class.CartesianR6_Boundary_CircularGeometry, ptr %11, i32 0, i32 1
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = fdiv double %40, %42
  %44 = fmul double 0x401921FB54442D18, %43
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = fmul double %44, %46
  %48 = call double @cos(double noundef %47) #2
  %49 = fmul double %38, %48
  ret double %49
}

attributes #0 = { 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 #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 }

!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 = !{!"_ZTS37CartesianR6_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 nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local noundef double @_ZNK37CartesianR6_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 readnone align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %4) unnamed_addr #1 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 = fadd double %9, -1.000000e+00
  %11 = tail call double @pow(double noundef %10, double noundef 6.000000e+00) #2
  %12 = fmul double %11, 4.096000e-01
  %13 = load double, ptr %1, align 8, !tbaa !5
  %14 = load double, ptr %7, align 8, !tbaa !9
  %15 = fdiv double %13, %14
  %16 = fadd double %15, 1.000000e+00
  %17 = tail call double @pow(double noundef %16, double noundef 6.000000e+00) #2
  %18 = fmul double %12, %17
  %19 = load double, ptr %1, align 8, !tbaa !5
  %20 = load double, ptr %7, align 8, !tbaa !9
  %21 = fdiv double %19, %20
  %22 = fmul double %21, 0x401921FB54442D18
  %23 = load double, ptr %3, align 8, !tbaa !5
  %24 = fmul double %23, %22
  %25 = tail call double @sin(double noundef %24) #2
  %26 = fmul double %18, %25
  %27 = load double, ptr %1, align 8, !tbaa !5
  %28 = load double, ptr %7, align 8, !tbaa !9
  %29 = fdiv double %27, %28
  %30 = fmul double %29, 0x401921FB54442D18
  %31 = load double, ptr %4, align 8, !tbaa !5
  %32 = fmul double %31, %30
  %33 = tail call double @cos(double noundef %32) #2
  %34 = fmul double %26, %33
  ret double %34
}

attributes #0 = { 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 #1 = { 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 #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)"}
!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 = !{!"_ZTS37CartesianR6_Boundary_CircularGeometry", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS18BoundaryConditions"}


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