; LLVM IR from VT-ICAM/cfem :: cfem (cf_init_element_data)

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

%struct.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @cf_init_element_data(ptr dead_on_unwind noalias writable sret(%struct.cf_local_element_s) align 8 %0, ptr noundef align 8 dereferenceable(24) %1, ptr noundef align 8 dereferenceable(24) %2, double noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store double %3, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds double, ptr %12, i64 1
  %14 = load double, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds double, ptr %15, i64 0
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = fsub double %14, %17
  store double %18, ptr %8, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds double, ptr %19, i64 2
  %21 = load double, ptr %20, align 8, !tbaa !9
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds double, ptr %22, i64 0
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = fsub double %21, %24
  store double %25, ptr %9, align 8, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds double, ptr %26, i64 1
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %29, i64 0
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = fsub double %28, %31
  store double %32, ptr %10, align 8, !tbaa !9
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %33, i64 2
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds double, ptr %36, i64 0
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = fsub double %35, %38
  store double %39, ptr %11, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 0
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 0
  %43 = load double, ptr %42, align 8, !tbaa !9
  store double %43, ptr %40, align 8, !tbaa !9
  %44 = getelementptr inbounds double, ptr %40, i64 1
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 1
  %47 = load double, ptr %46, align 8, !tbaa !9
  store double %47, ptr %44, align 8, !tbaa !9
  %48 = getelementptr inbounds double, ptr %40, i64 2
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i64 2
  %51 = load double, ptr %50, align 8, !tbaa !9
  store double %51, ptr %48, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 1
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds double, ptr %53, i64 0
  %55 = load double, ptr %54, align 8, !tbaa !9
  store double %55, ptr %52, align 8, !tbaa !9
  %56 = getelementptr inbounds double, ptr %52, i64 1
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 1
  %59 = load double, ptr %58, align 8, !tbaa !9
  store double %59, ptr %56, align 8, !tbaa !9
  %60 = getelementptr inbounds double, ptr %52, i64 2
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds double, ptr %61, i64 2
  %63 = load double, ptr %62, align 8, !tbaa !9
  store double %63, ptr %60, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 2
  %65 = load double, ptr %8, align 8, !tbaa !9
  store double %65, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds double, ptr %64, i64 1
  %67 = load double, ptr %9, align 8, !tbaa !9
  store double %67, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds double, ptr %64, i64 2
  %69 = load double, ptr %10, align 8, !tbaa !9
  store double %69, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds double, ptr %64, i64 3
  %71 = load double, ptr %11, align 8, !tbaa !9
  store double %71, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 3
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %73, i64 0
  %75 = load double, ptr %74, align 8, !tbaa !9
  store double %75, ptr %72, align 8, !tbaa !9
  %76 = getelementptr inbounds double, ptr %72, i64 1
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds double, ptr %77, i64 0
  %79 = load double, ptr %78, align 8, !tbaa !9
  store double %79, ptr %76, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 4
  %81 = load double, ptr %8, align 8, !tbaa !9
  %82 = load double, ptr %11, align 8, !tbaa !9
  %83 = load double, ptr %9, align 8, !tbaa !9
  %84 = load double, ptr %10, align 8, !tbaa !9
  %85 = fmul double %83, %84
  %86 = fneg double %85
  %87 = call double @llvm.fmuladd.f64(double %81, double %82, double %86)
  %88 = call double @llvm.fabs.f64(double %87)
  store double %88, ptr %80, align 8, !tbaa !11
  %89 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 5
  %90 = load double, ptr %7, align 8, !tbaa !9
  store double %90, ptr %89, align 8, !tbaa !13
  %91 = getelementptr inbounds %struct.cf_local_element_s, ptr %0, i32 0, i32 6
  store ptr null, ptr %91, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 96}
!12 = !{!"", !7, i64 0, !7, i64 24, !7, i64 48, !7, i64 80, !10, i64 96, !10, i64 104, !6, i64 112}
!13 = !{!12, !10, i64 104}
!14 = !{!12, !6, i64 112}


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

%struct.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }

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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @cf_init_element_data(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.cf_local_element_s) align 8 %0, ptr nocapture noundef readonly align 8 dereferenceable(24) %1, ptr nocapture noundef readonly align 8 dereferenceable(24) %2, double noundef %3) local_unnamed_addr #1 {
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load double, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = load double, ptr %2, align 8, !tbaa !5
  store double %6, ptr %0, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  store double %8, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = load <2 x double>, ptr %5, align 8, !tbaa !5
  %14 = insertelement <2 x double> poison, double %6, i64 0
  %15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
  %16 = fsub <2 x double> %13, %15
  store <2 x double> %13, ptr %9, align 8, !tbaa !5
  store <2 x double> %16, ptr %12, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = load <2 x double>, ptr %7, align 8, !tbaa !5
  %19 = insertelement <2 x double> poison, double %8, i64 0
  %20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
  %21 = fsub <2 x double> %18, %20
  store <2 x double> %18, ptr %11, align 8, !tbaa !5
  store <2 x double> %21, ptr %17, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 80
  store double %6, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 88
  store double %8, ptr %23, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 96
  %25 = extractelement <2 x double> %16, i64 1
  %26 = fneg double %25
  %27 = extractelement <2 x double> %21, i64 0
  %28 = fmul double %27, %26
  %29 = extractelement <2 x double> %16, i64 0
  %30 = extractelement <2 x double> %21, i64 1
  %31 = tail call double @llvm.fmuladd.f64(double %29, double %30, double %28)
  %32 = tail call double @llvm.fabs.f64(double %31)
  store double %32, ptr %24, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %0, i64 104
  store double %3, ptr %33, align 8, !tbaa !12
  %34 = getelementptr inbounds i8, ptr %0, i64 112
  store ptr null, ptr %34, align 8, !tbaa !13
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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" }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 96}
!10 = !{!"", !7, i64 0, !7, i64 24, !7, i64 48, !7, i64 80, !6, i64 96, !6, i64 104, !11, i64 112}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 104}
!13 = !{!10, !11, i64 112}


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