; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/LAPACK (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 i32 @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
  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) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #3
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = call double @z_abs(ptr noundef %22)
  %24 = fcmp oeq double %23, 0.000000e+00
  br i1 %24, label %25, label %28

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

28:                                               ; preds = %7
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  call void @d_cnjg(ptr noundef %19, ptr noundef %29)
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call double @z_abs(ptr noundef %30)
  store double %31, ptr %15, align 8, !tbaa !13
  %32 = getelementptr inbounds %struct.doublecomplex, ptr %19, i32 0, i32 0
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = load double, ptr %15, align 8, !tbaa !13
  %35 = fdiv double %33, %34
  %36 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  store double %35, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.doublecomplex, ptr %19, i32 0, i32 1
  %38 = load double, ptr %37, align 8, !tbaa !12
  %39 = load double, ptr %15, align 8, !tbaa !13
  %40 = fdiv double %38, %39
  %41 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  store double %40, ptr %41, align 8, !tbaa !12
  %42 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 0
  store double %43, ptr %44, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  %46 = load double, ptr %45, align 8, !tbaa !12
  %47 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 1
  store double %46, ptr %47, align 8, !tbaa !12
  br label %48

48:                                               ; preds = %28, %25
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.doublecomplex, ptr %49, i32 0, i32 0
  %51 = load double, ptr %50, align 8, !tbaa !9
  store double %51, ptr %15, align 8, !tbaa !13
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = call double @z_abs(ptr noundef %52)
  store double %53, ptr %16, align 8, !tbaa !13
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.doublecomplex, ptr %54, i32 0, i32 0
  %56 = load double, ptr %55, align 8, !tbaa !9
  store double %56, ptr %17, align 8, !tbaa !13
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = call i32 @dlaev2_(ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef %20)
  %61 = load double, ptr %20, align 8, !tbaa !13
  %62 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = fmul double %61, %63
  %65 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  store double %64, ptr %65, align 8, !tbaa !9
  %66 = load double, ptr %20, align 8, !tbaa !13
  %67 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !12
  %69 = fmul double %66, %68
  %70 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  store double %69, ptr %70, align 8, !tbaa !12
  %71 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 0
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.doublecomplex, ptr %73, i32 0, i32 0
  store double %72, ptr %74, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct.doublecomplex, ptr %18, i32 0, i32 1
  %76 = load double, ptr %75, align 8, !tbaa !12
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.doublecomplex, ptr %77, i32 0, i32 1
  store double %76, ptr %78, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  ret i32 0
}

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

declare double @z_abs(ptr noundef) #2

declare void @d_cnjg(ptr noundef, ptr noundef) #2

declare i32 @dlaev2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; 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 = { "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, !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 noundef i32 @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) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %13 = tail call double @z_abs(ptr noundef %1) #3
  %14 = fcmp oeq double %13, 0.000000e+00
  br i1 %14, label %21, label %15

15:                                               ; preds = %7
  call void @d_cnjg(ptr noundef nonnull %11, ptr noundef %1) #3
  %16 = call double @z_abs(ptr noundef %1) #3
  %17 = load <2 x double>, ptr %11, align 16, !tbaa !5
  %18 = insertelement <2 x double> poison, double %16, i64 0
  %19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
  %20 = fdiv <2 x double> %17, %19
  br label %21

21:                                               ; preds = %7, %15
  %22 = phi <2 x double> [ %20, %15 ], [ <double 1.000000e+00, double 0.000000e+00>, %7 ]
  %23 = load double, ptr %0, align 8, !tbaa !9
  store double %23, ptr %8, align 8, !tbaa !5
  %24 = call double @z_abs(ptr noundef %1) #3
  store double %24, ptr %9, align 8, !tbaa !5
  %25 = load double, ptr %2, align 8, !tbaa !9
  store double %25, ptr %10, align 8, !tbaa !5
  %26 = call i32 @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) #3
  %27 = load double, ptr %12, align 8, !tbaa !5
  %28 = insertelement <2 x double> poison, double %27, i64 0
  %29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
  %30 = fmul <2 x double> %22, %29
  store <2 x double> %30, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  ret i32 0
}

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

declare double @z_abs(ptr noundef) local_unnamed_addr #2

declare void @d_cnjg(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @dlaev2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; 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 = { "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 = !{!"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