; LLVM IR from sp-nitech/SPTK :: third_party/WORLD/fft_world.ll (ZN4sptk5world7cftf040EPd)

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

; 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: mustprogress nounwind uwtable
define dso_local void @_ZN4sptk5world7cftf040EPd(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds double, ptr %11, i64 0
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds double, ptr %14, i64 4
  %16 = load double, ptr %15, align 8, !tbaa !9
  %17 = fadd double %13, %16
  store double %17, ptr %3, align 8, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds double, ptr %18, i64 1
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds double, ptr %21, i64 5
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = fadd double %20, %23
  store double %24, ptr %4, align 8, !tbaa !9
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds double, ptr %25, i64 0
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 4
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = fsub double %27, %30
  store double %31, ptr %5, align 8, !tbaa !9
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds double, ptr %32, i64 1
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds double, ptr %35, i64 5
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = fsub double %34, %37
  store double %38, ptr %6, align 8, !tbaa !9
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i64 2
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds double, ptr %42, i64 6
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = fadd double %41, %44
  store double %45, ptr %7, align 8, !tbaa !9
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i64 3
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i64 7
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = fadd double %48, %51
  store double %52, ptr %8, align 8, !tbaa !9
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds double, ptr %53, i64 2
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %56, i64 6
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = fsub double %55, %58
  store double %59, ptr %9, align 8, !tbaa !9
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds double, ptr %60, i64 3
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds double, ptr %63, i64 7
  %65 = load double, ptr %64, align 8, !tbaa !9
  %66 = fsub double %62, %65
  store double %66, ptr %10, align 8, !tbaa !9
  %67 = load double, ptr %3, align 8, !tbaa !9
  %68 = load double, ptr %7, align 8, !tbaa !9
  %69 = fadd double %67, %68
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %70, i64 0
  store double %69, ptr %71, align 8, !tbaa !9
  %72 = load double, ptr %4, align 8, !tbaa !9
  %73 = load double, ptr %8, align 8, !tbaa !9
  %74 = fadd double %72, %73
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds double, ptr %75, i64 1
  store double %74, ptr %76, align 8, !tbaa !9
  %77 = load double, ptr %5, align 8, !tbaa !9
  %78 = load double, ptr %10, align 8, !tbaa !9
  %79 = fsub double %77, %78
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds double, ptr %80, i64 2
  store double %79, ptr %81, align 8, !tbaa !9
  %82 = load double, ptr %6, align 8, !tbaa !9
  %83 = load double, ptr %9, align 8, !tbaa !9
  %84 = fadd double %82, %83
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds double, ptr %85, i64 3
  store double %84, ptr %86, align 8, !tbaa !9
  %87 = load double, ptr %3, align 8, !tbaa !9
  %88 = load double, ptr %7, align 8, !tbaa !9
  %89 = fsub double %87, %88
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds double, ptr %90, i64 4
  store double %89, ptr %91, align 8, !tbaa !9
  %92 = load double, ptr %4, align 8, !tbaa !9
  %93 = load double, ptr %8, align 8, !tbaa !9
  %94 = fsub double %92, %93
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds double, ptr %95, i64 5
  store double %94, ptr %96, align 8, !tbaa !9
  %97 = load double, ptr %5, align 8, !tbaa !9
  %98 = load double, ptr %10, align 8, !tbaa !9
  %99 = fadd double %97, %98
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds double, ptr %100, i64 6
  store double %99, ptr %101, align 8, !tbaa !9
  %102 = load double, ptr %6, align 8, !tbaa !9
  %103 = load double, ptr %9, align 8, !tbaa !9
  %104 = fsub double %102, %103
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds double, ptr %105, i64 7
  store double %104, ptr %106, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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}


; 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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN4sptk5world7cftf040EPd(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load <2 x double>, ptr %0, align 8, !tbaa !5
  %6 = load <2 x double>, ptr %2, align 8, !tbaa !5
  %7 = fadd <2 x double> %5, %6
  %8 = load <2 x double>, ptr %3, align 8, !tbaa !5
  %9 = load <2 x double>, ptr %4, align 8, !tbaa !5
  %10 = fadd <2 x double> %8, %9
  %11 = fadd <2 x double> %7, %10
  store <2 x double> %11, ptr %0, align 8, !tbaa !5
  %12 = fsub <2 x double> %5, %6
  %13 = fsub <2 x double> %8, %9
  %14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 0>
  %15 = fsub <2 x double> %12, %14
  %16 = fadd <2 x double> %12, %14
  %17 = shufflevector <2 x double> %15, <2 x double> %16, <2 x i32> <i32 0, i32 3>
  store <2 x double> %17, ptr %3, align 8, !tbaa !5
  %18 = fsub <2 x double> %7, %10
  store <2 x double> %18, ptr %2, align 8, !tbaa !5
  %19 = shufflevector <2 x double> %16, <2 x double> %15, <2 x i32> <i32 0, i32 3>
  store <2 x double> %19, ptr %4, align 8, !tbaa !5
  ret void
}

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


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