; LLVM IR from BigdogManLuo/DSPLibrary :: Example/Inversion_3Phase_1.5/empty_sysconfig_337zwt (transform)

; 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.dq = type { double, double }
%struct.Phase2 = type { double, double }

@Ts = external dso_local global float, align 4

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: nounwind uwtable
define dso_local { double, double } @parkTransformation(double %0, double %1, i32 noundef %2, float noundef %3) #2 {
  %5 = alloca %struct.dq, align 8
  %6 = alloca %struct.Phase2, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  store double %0, ptr %11, align 8
  %12 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  store double %1, ptr %12, align 8
  store i32 %2, ptr %7, align 4, !tbaa !5
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %13 = load float, ptr %8, align 4, !tbaa !9
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = sitofp i32 %14 to float
  %16 = fmul float %13, %15
  %17 = load float, ptr @Ts, align 4, !tbaa !9
  %18 = fmul float %16, %17
  %19 = call float @cosf(float noundef %18) #4
  %20 = fpext float %19 to double
  %21 = getelementptr inbounds %struct.Phase2, ptr %6, i32 0, i32 0
  %22 = load double, ptr %21, align 8, !tbaa !11
  %23 = load float, ptr %8, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = sitofp i32 %24 to float
  %26 = fmul float %23, %25
  %27 = load float, ptr @Ts, align 4, !tbaa !9
  %28 = fmul float %26, %27
  %29 = call float @sinf(float noundef %28) #4
  %30 = fpext float %29 to double
  %31 = getelementptr inbounds %struct.Phase2, ptr %6, i32 0, i32 1
  %32 = load double, ptr %31, align 8, !tbaa !14
  %33 = fmul double %30, %32
  %34 = call double @llvm.fmuladd.f64(double %20, double %22, double %33)
  %35 = fptrunc double %34 to float
  store float %35, ptr %9, align 4, !tbaa !9
  %36 = load float, ptr %8, align 4, !tbaa !9
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = sitofp i32 %37 to float
  %39 = fmul float %36, %38
  %40 = load float, ptr @Ts, align 4, !tbaa !9
  %41 = fmul float %39, %40
  %42 = call float @sinf(float noundef %41) #4
  %43 = fneg float %42
  %44 = fpext float %43 to double
  %45 = getelementptr inbounds %struct.Phase2, ptr %6, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = load float, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sitofp i32 %48 to float
  %50 = fmul float %47, %49
  %51 = load float, ptr @Ts, align 4, !tbaa !9
  %52 = fmul float %50, %51
  %53 = call float @cosf(float noundef %52) #4
  %54 = fpext float %53 to double
  %55 = getelementptr inbounds %struct.Phase2, ptr %6, i32 0, i32 1
  %56 = load double, ptr %55, align 8, !tbaa !14
  %57 = fmul double %54, %56
  %58 = call double @llvm.fmuladd.f64(double %44, double %46, double %57)
  %59 = fptrunc double %58 to float
  store float %59, ptr %10, align 4, !tbaa !9
  %60 = load float, ptr %9, align 4, !tbaa !9
  %61 = fpext float %60 to double
  %62 = getelementptr inbounds %struct.dq, ptr %5, i32 0, i32 0
  store double %61, ptr %62, align 8, !tbaa !15
  %63 = load float, ptr %10, align 4, !tbaa !9
  %64 = fpext float %63 to double
  %65 = getelementptr inbounds %struct.dq, ptr %5, i32 0, i32 1
  store double %64, ptr %65, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %66 = load { double, double }, ptr %5, align 8
  ret { double, double } %66
}

; Function Attrs: nounwind
declare float @cosf(float noundef) #3

; Function Attrs: nounwind
declare float @sinf(float noundef) #3

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 "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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"Phase2", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!16, !13, i64 0}
!16 = !{!"dq", !13, i64 0, !13, i64 8}
!17 = !{!16, !13, i64 8}


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

@Ts = external dso_local local_unnamed_addr global float, align 4

; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: write) uwtable
define dso_local { double, double } @parkTransformation(double %0, double %1, i32 noundef %2, float noundef %3) local_unnamed_addr #0 {
  %5 = sitofp i32 %2 to float
  %6 = fmul float %5, %3
  %7 = load float, ptr @Ts, align 4, !tbaa !5
  %8 = fmul float %6, %7
  %9 = tail call float @cosf(float noundef %8) #3
  %10 = load float, ptr @Ts, align 4, !tbaa !5
  %11 = fmul float %6, %10
  %12 = tail call float @sinf(float noundef %11) #3
  %13 = load float, ptr @Ts, align 4, !tbaa !5
  %14 = fmul float %6, %13
  %15 = tail call float @sinf(float noundef %14) #3
  %16 = fneg float %15
  %17 = load float, ptr @Ts, align 4, !tbaa !5
  %18 = fmul float %6, %17
  %19 = tail call float @cosf(float noundef %18) #3
  %20 = insertelement <2 x float> poison, float %9, i64 0
  %21 = insertelement <2 x float> %20, float %16, i64 1
  %22 = fpext <2 x float> %21 to <2 x double>
  %23 = insertelement <2 x float> poison, float %12, i64 0
  %24 = insertelement <2 x float> %23, float %19, i64 1
  %25 = fpext <2 x float> %24 to <2 x double>
  %26 = insertelement <2 x double> poison, double %1, i64 0
  %27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
  %28 = fmul <2 x double> %27, %25
  %29 = insertelement <2 x double> poison, double %0, i64 0
  %30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
  %31 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %22, <2 x double> %30, <2 x double> %28)
  %32 = fptrunc <2 x double> %31 to <2 x float>
  %33 = fpext <2 x float> %32 to <2 x double>
  %34 = extractelement <2 x double> %33, i64 0
  %.fca.0.insert = insertvalue { double, double } poison, double %34, 0
  %35 = extractelement <2 x double> %33, i64 1
  %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %35, 1
  ret { double, double } %.fca.1.insert
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sinf(float noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

attributes #0 = { mustprogress nofree nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: 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" }
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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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