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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK36CartesianR2_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.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %15 = load double, ptr %14, align 8, !tbaa !11
  %16 = fdiv double %13, %15
  %17 = fmul double 0x403921FB54442D18, %16
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = fmul double %17, %19
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %24 = load double, ptr %23, align 8, !tbaa !11
  %25 = fdiv double %22, %24
  %26 = fmul double 0x401921FB54442D18, %25
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = fmul double %26, %28
  %30 = call double @cos(double noundef %29) #3
  %31 = fmul double %20, %30
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = fdiv double %33, %35
  %37 = fmul double 0x401921FB54442D18, %36
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = fmul double %37, %39
  %41 = call double @cos(double noundef %40) #3
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %45 = load double, ptr %44, align 8, !tbaa !11
  %46 = fdiv double %43, %45
  %47 = fmul double 0x403921FB54442D18, %46
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = fdiv double %49, %51
  %53 = fmul double 0x401921FB54442D18, %52
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = fmul double %53, %55
  %57 = call double @sin(double noundef %56) #3
  %58 = fmul double %47, %57
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = fdiv double %60, %62
  %64 = fmul double 0x401921FB54442D18, %63
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = load double, ptr %65, align 8, !tbaa !9
  %67 = fmul double %64, %66
  %68 = call double @sin(double noundef %67) #3
  %69 = fmul double %58, %68
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = fmul double %69, %71
  %73 = fneg double %72
  %74 = call double @llvm.fmuladd.f64(double %31, double %41, double %73)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fdiv double %76, %78
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = fdiv double %81, %83
  %85 = fneg double %79
  %86 = call double @llvm.fmuladd.f64(double %85, double %84, double 1.000000e+00)
  %87 = fmul double 0x4053BD3CC9BE45DE, %86
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = call double @pow(double noundef %89, double noundef 2.000000e+00) #3
  %91 = fmul double %87, %90
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %95 = load double, ptr %94, align 8, !tbaa !11
  %96 = fdiv double %93, %95
  %97 = fmul double 0x401921FB54442D18, %96
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fmul double %97, %99
  %101 = call double @sin(double noundef %100) #3
  %102 = fmul double %91, %101
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load double, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = fdiv double %104, %106
  %108 = fmul double 0x401921FB54442D18, %107
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load double, ptr %109, align 8, !tbaa !9
  %111 = fmul double %108, %110
  %112 = call double @cos(double noundef %111) #3
  %113 = call double @llvm.fmuladd.f64(double %102, double %112, double %74)
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load double, ptr %114, align 8, !tbaa !9
  %116 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %117 = load double, ptr %116, align 8, !tbaa !11
  %118 = fdiv double %115, %117
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load double, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %122 = load double, ptr %121, align 8, !tbaa !11
  %123 = fdiv double %120, %122
  %124 = fneg double %118
  %125 = call double @llvm.fmuladd.f64(double %124, double %123, double 1.000000e+00)
  %126 = fmul double 0x4053BD3CC9BE45DE, %125
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = fdiv double %128, %130
  %132 = fmul double 0x401921FB54442D18, %131
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = fmul double %132, %134
  %136 = call double @sin(double noundef %135) #3
  %137 = fmul double %126, %136
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = load double, ptr %138, align 8, !tbaa !9
  %140 = call double @pow(double noundef %139, double noundef 2.000000e+00) #3
  %141 = fmul double %137, %140
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load double, ptr %142, align 8, !tbaa !9
  %144 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = fdiv double %143, %145
  %147 = fmul double 0x401921FB54442D18, %146
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = fmul double %147, %149
  %151 = call double @cos(double noundef %150) #3
  %152 = call double @llvm.fmuladd.f64(double %141, double %151, double %113)
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = load double, ptr %153, align 8, !tbaa !9
  %155 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = fdiv double %154, %156
  %158 = fmul double 0x401921FB54442D18, %157
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = load double, ptr %159, align 8, !tbaa !9
  %161 = fmul double %158, %160
  %162 = call double @sin(double noundef %161) #3
  %163 = fmul double 4.000000e+00, %162
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load double, ptr %164, align 8, !tbaa !9
  %166 = getelementptr inbounds %class.CartesianR2_Poisson_CircularGeometry, ptr %11, i32 0, i32 1
  %167 = load double, ptr %166, align 8, !tbaa !11
  %168 = fdiv double %165, %167
  %169 = fmul double 0x401921FB54442D18, %168
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = load double, ptr %170, align 8, !tbaa !9
  %172 = fmul double %169, %171
  %173 = call double @cos(double noundef %172) #3
  %174 = call double @llvm.fmuladd.f64(double %163, double %173, double %152)
  ret double %174
}

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

; Function Attrs: nounwind
declare double @sin(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 = { 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 = !{!"_ZTS36CartesianR2_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 @_ZNK36CartesianR2_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 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 #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 = fmul double %9, 0x403921FB54442D18
  %11 = load double, ptr %3, align 8, !tbaa !5
  %12 = fmul double %11, %10
  %13 = fmul double %9, 0x401921FB54442D18
  %14 = fmul double %11, %13
  %15 = tail call double @cos(double noundef %14) #3
  %16 = fmul double %15, %12
  %17 = load double, ptr %1, align 8, !tbaa !5
  %18 = load double, ptr %7, align 8, !tbaa !9
  %19 = fdiv double %17, %18
  %20 = fmul double %19, 0x401921FB54442D18
  %21 = load double, ptr %4, align 8, !tbaa !5
  %22 = fmul double %21, %20
  %23 = tail call double @cos(double noundef %22) #3
  %24 = load double, ptr %1, align 8, !tbaa !5
  %25 = load double, ptr %7, align 8, !tbaa !9
  %26 = fdiv double %24, %25
  %27 = fmul double %26, 0x401921FB54442D18
  %28 = load double, ptr %3, align 8, !tbaa !5
  %29 = fmul double %28, %27
  %30 = tail call double @sin(double noundef %29) #3
  %31 = load double, ptr %1, align 8, !tbaa !5
  %32 = load double, ptr %7, align 8, !tbaa !9
  %33 = fdiv double %31, %32
  %34 = fmul double %33, 0x401921FB54442D18
  %35 = load double, ptr %4, align 8, !tbaa !5
  %36 = fmul double %35, %34
  %37 = tail call double @sin(double noundef %36) #3
  %38 = load double, ptr %4, align 8, !tbaa !5
  %39 = fmul double %26, 0xC03921FB54442D18
  %40 = fmul double %39, %30
  %41 = fmul double %40, %37
  %42 = fmul double %41, %38
  %43 = tail call double @llvm.fmuladd.f64(double %16, double %23, double %42)
  %44 = load double, ptr %1, align 8, !tbaa !5
  %45 = load double, ptr %7, align 8, !tbaa !9
  %46 = fdiv double %44, %45
  %47 = fneg double %46
  %48 = tail call double @llvm.fmuladd.f64(double %47, double %46, double 1.000000e+00)
  %49 = fmul double %48, 0x4053BD3CC9BE45DE
  %50 = load double, ptr %3, align 8, !tbaa !5
  %square = fmul double %50, %50
  %51 = fmul double %square, %49
  %52 = fmul double %46, 0x401921FB54442D18
  %53 = fmul double %50, %52
  %54 = tail call double @sin(double noundef %53) #3
  %55 = fmul double %54, %51
  %56 = load double, ptr %1, align 8, !tbaa !5
  %57 = load double, ptr %7, align 8, !tbaa !9
  %58 = fdiv double %56, %57
  %59 = fmul double %58, 0x401921FB54442D18
  %60 = load double, ptr %4, align 8, !tbaa !5
  %61 = fmul double %60, %59
  %62 = tail call double @cos(double noundef %61) #3
  %63 = tail call double @llvm.fmuladd.f64(double %55, double %62, double %43)
  %64 = load double, ptr %1, align 8, !tbaa !5
  %65 = load double, ptr %7, align 8, !tbaa !9
  %66 = fdiv double %64, %65
  %67 = fneg double %66
  %68 = tail call double @llvm.fmuladd.f64(double %67, double %66, double 1.000000e+00)
  %69 = fmul double %68, 0x4053BD3CC9BE45DE
  %70 = fmul double %66, 0x401921FB54442D18
  %71 = load double, ptr %3, align 8, !tbaa !5
  %72 = fmul double %71, %70
  %73 = tail call double @sin(double noundef %72) #3
  %74 = fmul double %73, %69
  %75 = load double, ptr %4, align 8, !tbaa !5
  %square31 = fmul double %75, %75
  %76 = fmul double %74, %square31
  %77 = load double, ptr %1, align 8, !tbaa !5
  %78 = load double, ptr %7, align 8, !tbaa !9
  %79 = fdiv double %77, %78
  %80 = fmul double %79, 0x401921FB54442D18
  %81 = fmul double %75, %80
  %82 = tail call double @cos(double noundef %81) #3
  %83 = tail call double @llvm.fmuladd.f64(double %76, double %82, double %63)
  %84 = load double, ptr %1, align 8, !tbaa !5
  %85 = load double, ptr %7, align 8, !tbaa !9
  %86 = fdiv double %84, %85
  %87 = fmul double %86, 0x401921FB54442D18
  %88 = load double, ptr %3, align 8, !tbaa !5
  %89 = fmul double %88, %87
  %90 = tail call double @sin(double noundef %89) #3
  %91 = fmul double %90, 4.000000e+00
  %92 = load double, ptr %1, align 8, !tbaa !5
  %93 = load double, ptr %7, align 8, !tbaa !9
  %94 = fdiv double %92, %93
  %95 = fmul double %94, 0x401921FB54442D18
  %96 = load double, ptr %4, align 8, !tbaa !5
  %97 = fmul double %96, %95
  %98 = tail call double @cos(double noundef %97) #3
  %99 = tail call double @llvm.fmuladd.f64(double %91, double %98, double %83)
  ret double %99
}

; 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)
declare double @sin(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 = !{!"_ZTS36CartesianR2_Poisson_CircularGeometry", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS10SourceTerm"}


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