; LLVM IR from OpenMathLib/OpenBLAS :: lapack-netlib/SRC (zlaev2)

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

; Function Attrs: nounwind uwtable
define dso_local void @zlaev2_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca %struct.doublecomplex, align 8
  %19 = alloca %struct.doublecomplex, align 8
  %20 = alloca double, align 8
  %21 = alloca %struct.doublecomplex, align 8
  %22 = alloca { double, double }, align 8
  %23 = alloca { double, double }, align 8
  %24 = alloca { double, double }, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = call { double, double } @Cd(ptr noundef %25)
  %27 = extractvalue { double, double } %26, 0
  %28 = extractvalue { double, double } %26, 1
  %29 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %30 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  store double %27, ptr %29, align 8
  store double %28, ptr %30, align 8
  %31 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %32 = load double, ptr %31, align 8
  %33 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %34 = load double, ptr %33, align 8
  %35 = call double @cabs(double noundef %32, double noundef %34) #5
  %36 = fcmp oeq double %35, 0.000000e+00
  br i1 %36, label %37, label %40

37:                                               ; preds = %7
  %38 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 0
  store double 1.000000e+00, ptr %38, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 1
  store double 0.000000e+00, ptr %39, align 8, !tbaa !12
  br label %76

40:                                               ; preds = %7
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = call { double, double } @Cd(ptr noundef %41)
  %43 = extractvalue { double, double } %42, 0
  %44 = extractvalue { double, double } %42, 1
  %45 = fneg double %44
  %46 = call ptr @_pCd(ptr noundef %19)
  %47 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 1
  store double %43, ptr %47, align 8
  store double %45, ptr %48, align 8
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = call { double, double } @Cd(ptr noundef %49)
  %51 = extractvalue { double, double } %50, 0
  %52 = extractvalue { double, double } %50, 1
  %53 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %54 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  store double %51, ptr %53, align 8
  store double %52, ptr %54, align 8
  %55 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %56 = load double, ptr %55, align 8
  %57 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call double @cabs(double noundef %56, double noundef %58) #5
  store double %59, ptr %15, align 8, !tbaa !13
  %60 = getelementptr inbounds %struct.doublecomplex, ptr %19, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = load double, ptr %15, align 8, !tbaa !13
  %63 = fdiv double %61, %62
  %64 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  store double %63, ptr %64, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.doublecomplex, ptr %19, i32 0, i32 1
  %66 = load double, ptr %65, align 8, !tbaa !12
  %67 = load double, ptr %15, align 8, !tbaa !13
  %68 = fdiv double %66, %67
  %69 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  store double %68, ptr %69, align 8, !tbaa !12
  %70 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 0
  store double %71, ptr %72, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !12
  %75 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 1
  store double %74, ptr %75, align 8, !tbaa !12
  br label %76

76:                                               ; preds = %40, %37
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.doublecomplex, ptr %77, i32 0, i32 0
  %79 = load double, ptr %78, align 8, !tbaa !9
  store double %79, ptr %15, align 8, !tbaa !13
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = call { double, double } @Cd(ptr noundef %80)
  %82 = extractvalue { double, double } %81, 0
  %83 = extractvalue { double, double } %81, 1
  %84 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %85 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  store double %82, ptr %84, align 8
  store double %83, ptr %85, align 8
  %86 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %87 = load double, ptr %86, align 8
  %88 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %89 = load double, ptr %88, align 8
  %90 = call double @cabs(double noundef %87, double noundef %89) #5
  store double %90, ptr %16, align 8, !tbaa !13
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.doublecomplex, ptr %91, i32 0, i32 0
  %93 = load double, ptr %92, align 8, !tbaa !9
  store double %93, ptr %17, align 8, !tbaa !13
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  call void @dlaev2_(ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %20)
  %97 = load double, ptr %20, align 8, !tbaa !13
  %98 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 0
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fmul double %97, %99
  %101 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  store double %100, ptr %101, align 8, !tbaa !9
  %102 = load double, ptr %20, align 8, !tbaa !13
  %103 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 1
  %104 = load double, ptr %103, align 8, !tbaa !12
  %105 = fmul double %102, %104
  %106 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  store double %105, ptr %106, align 8, !tbaa !12
  %107 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.doublecomplex, ptr %109, i32 0, i32 0
  store double %108, ptr %110, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  %112 = load double, ptr %111, align 8, !tbaa !12
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.doublecomplex, ptr %113, i32 0, i32 1
  store double %112, ptr %114, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  ret void
}

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

; Function Attrs: nounwind
declare double @cabs(double noundef, double noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden { double, double } @Cd(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @_pCd(ptr noundef) #3

declare void @dlaev2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint 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 #4 = { "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 #5 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!11, !11, 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"

%struct.doublecomplex = type { double, double }

; Function Attrs: nounwind uwtable
define dso_local void @zlaev2_(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #0 {
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %struct.doublecomplex, align 16
  %12 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %13 = tail call { double, double } @Cd(ptr noundef %1)
  %14 = extractvalue { double, double } %13, 0
  %15 = extractvalue { double, double } %13, 1
  %16 = tail call double @cabs(double noundef %14, double noundef %15) #5
  %17 = fcmp oeq double %16, 0.000000e+00
  br i1 %17, label %33, label %18

18:                                               ; preds = %7
  %19 = tail call { double, double } @Cd(ptr noundef %1)
  %20 = extractvalue { double, double } %19, 0
  %21 = extractvalue { double, double } %19, 1
  %22 = fneg double %21
  %23 = call ptr @_pCd(ptr noundef nonnull %11)
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  store double %20, ptr %23, align 8
  store double %22, ptr %24, align 8
  %25 = call { double, double } @Cd(ptr noundef %1)
  %26 = extractvalue { double, double } %25, 0
  %27 = extractvalue { double, double } %25, 1
  %28 = call double @cabs(double noundef %26, double noundef %27) #5
  %29 = load <2 x double>, ptr %11, align 16, !tbaa !5
  %30 = insertelement <2 x double> poison, double %28, i64 0
  %31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
  %32 = fdiv <2 x double> %29, %31
  br label %33

33:                                               ; preds = %7, %18
  %34 = phi <2 x double> [ %32, %18 ], [ <double 1.000000e+00, double 0.000000e+00>, %7 ]
  %35 = load double, ptr %0, align 8, !tbaa !9
  store double %35, ptr %8, align 8, !tbaa !5
  %36 = call { double, double } @Cd(ptr noundef %1)
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  %39 = call double @cabs(double noundef %37, double noundef %38) #5
  store double %39, ptr %9, align 8, !tbaa !5
  %40 = load double, ptr %2, align 8, !tbaa !9
  store double %40, ptr %10, align 8, !tbaa !5
  call void @dlaev2_(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef nonnull %12) #5
  %41 = load double, ptr %12, align 8, !tbaa !5
  %42 = insertelement <2 x double> poison, double %41, i64 0
  %43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
  %44 = fmul <2 x double> %34, %43
  store <2 x double> %44, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  ret void
}

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

; Function Attrs: nofree nounwind
declare double @cabs(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden { double, double } @Cd(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @_pCd(ptr noundef) local_unnamed_addr #3

declare void @dlaev2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

attributes #0 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { inlinehint 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 #4 = { "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 #5 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 8}


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