; LLVM IR from QUILL-PIC/Quill :: src/maxwell.ll (ZN14maxwell_solverC2ER7field3dI5celleERS0_I5cellbERS0_I5celljEdddd)

; 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.maxwell_solver = type { ptr, ptr, ptr, ptr, double, double, double, double, double, double }

@_ZTV14maxwell_solver = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN14maxwell_solverC2ER7field3dI5celleERS0_I5cellbERS0_I5celljEdddd(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 1 %1, ptr noundef nonnull align 1 %2, ptr noundef nonnull align 1 %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) unnamed_addr #0 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store double %4, ptr %13, align 8, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !9
  store double %6, ptr %15, align 8, !tbaa !9
  store double %7, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %9, align 8
  store ptr getelementptr inbounds inrange(-16, 64) ({ [10 x ptr] }, ptr @_ZTV14maxwell_solver, i32 0, i32 0, i32 2), ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %19, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 2
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %21, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 3
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %23, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 4
  %25 = load double, ptr %14, align 8, !tbaa !9
  store double %25, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 5
  %27 = load double, ptr %15, align 8, !tbaa !9
  store double %27, ptr %26, align 8, !tbaa !15
  %28 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 6
  %29 = load double, ptr %16, align 8, !tbaa !9
  store double %29, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 7
  %31 = load double, ptr %13, align 8, !tbaa !9
  %32 = load double, ptr %14, align 8, !tbaa !9
  %33 = fdiv double %31, %32
  store double %33, ptr %30, align 8, !tbaa !17
  %34 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 8
  %35 = load double, ptr %13, align 8, !tbaa !9
  %36 = load double, ptr %15, align 8, !tbaa !9
  %37 = fdiv double %35, %36
  store double %37, ptr %34, align 8, !tbaa !18
  %38 = getelementptr inbounds %class.maxwell_solver, ptr %17, i32 0, i32 9
  %39 = load double, ptr %13, align 8, !tbaa !9
  %40 = load double, ptr %16, align 8, !tbaa !9
  %41 = fdiv double %39, %40
  store double %41, ptr %38, align 8, !tbaa !19
  ret void
}

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

!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, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 32}
!14 = !{!"_ZTS14maxwell_solver", !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!15 = !{!14, !10, i64 40}
!16 = !{!14, !10, i64 48}
!17 = !{!14, !10, i64 56}
!18 = !{!14, !10, i64 64}
!19 = !{!14, !10, i64 72}


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

@_ZTV14maxwell_solver = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN14maxwell_solverC2ER7field3dI5celleERS0_I5cellbERS0_I5celljEdddd(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(80) %0, ptr noundef nonnull align 1 %1, ptr noundef nonnull align 1 %2, ptr noundef nonnull align 1 %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 64) (i8, ptr @_ZTV14maxwell_solver, i64 16), ptr %0, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %9, align 8, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %10, align 8, !tbaa !8
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %3, ptr %11, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  store double %5, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  store double %6, ptr %13, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store double %7, ptr %14, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  %16 = insertelement <2 x double> poison, double %4, i64 0
  %17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
  %18 = insertelement <2 x double> poison, double %5, i64 0
  %19 = insertelement <2 x double> %18, double %6, i64 1
  %20 = fdiv <2 x double> %17, %19
  store <2 x double> %20, ptr %15, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %0, i64 72
  %22 = fdiv double %4, %7
  store double %22, ptr %21, align 8, !tbaa !17
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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" }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !13, i64 32}
!12 = !{!"_ZTS14maxwell_solver", !9, i64 8, !9, i64 16, !9, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72}
!13 = !{!"double", !10, i64 0}
!14 = !{!12, !13, i64 40}
!15 = !{!12, !13, i64 48}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !13, i64 72}


; Effective O3 passes: InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass