; LLVM IR from o0o0o0o0o0o0o/image-processing-from-scratch :: ImageMatting/Eigen/blas (complex_double)

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

%"class.Eigen::Map.9" = type { %"class.Eigen::MapBase.base.19", [7 x i8] }
%"class.Eigen::MapBase.base.19" = type { %"class.Eigen::MapBase.base.18" }
%"class.Eigen::MapBase.base.18" = type <{ ptr, %"class.Eigen::internal::variable_if_dynamic", i8 }>
%"class.Eigen::internal::variable_if_dynamic" = type { i64 }
%"class.Eigen::Map.36" = type { %"class.Eigen::MapBase.base.46", %"class.Eigen::InnerStride" }
%"class.Eigen::MapBase.base.46" = type { %"class.Eigen::MapBase.base.45" }
%"class.Eigen::MapBase.base.45" = type <{ ptr, %"class.Eigen::internal::variable_if_dynamic", i8 }>
%"class.Eigen::InnerStride" = type { %"class.Eigen::Stride" }
%"class.Eigen::Stride" = type { [8 x i8], %"class.Eigen::internal::variable_if_dynamic" }
%"class.std::complex" = type { { double, double } }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Map.9") align 8, ptr noundef, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_11InnerStrideILin1EEEEEPS5_ii(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Map.36") align 8, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local i32 @zscal_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::complex", align 8
  %12 = alloca %"class.Eigen::Map.9", align 8
  %13 = alloca %"class.Eigen::Map.36", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = icmp sle i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %4
  store i32 0, ptr %5, align 4
  br label %38

18:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %19, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !11
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %29

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load i32, ptr %26, align 4, !tbaa !9
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind writable sret(%"class.Eigen::Map.9") align 8 %12, ptr noundef %25, i32 noundef %27)
  %28 = call noundef nonnull align 8 dereferenceable(19) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1) %12, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %37

29:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #5
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = call i32 @llvm.abs.i32(i32 %34, i1 true)
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_11InnerStrideILin1EEEEEPS5_ii(ptr dead_on_unwind writable sret(%"class.Eigen::Map.36") align 8 %13, ptr noundef %30, i32 noundef %32, i32 noundef %35)
  %36 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1) %13, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #5
  br label %37

37:                                               ; preds = %29, %24
  store i32 0, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %38

38:                                               ; preds = %37, %17
  %39 = load i32, ptr %5, align 4
  ret i32 %39
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(19) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint mustprogress 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 #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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !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"

%"class.Eigen::Map.9" = type { %"class.Eigen::MapBase.base.19", [7 x i8] }
%"class.Eigen::MapBase.base.19" = type { %"class.Eigen::MapBase.base.18" }
%"class.Eigen::MapBase.base.18" = type <{ ptr, %"class.Eigen::internal::variable_if_dynamic", i8 }>
%"class.Eigen::internal::variable_if_dynamic" = type { i64 }
%"class.Eigen::Map.36" = type { %"class.Eigen::MapBase.base.46", %"class.Eigen::InnerStride" }
%"class.Eigen::MapBase.base.46" = type { %"class.Eigen::MapBase.base.45" }
%"class.Eigen::MapBase.base.45" = type <{ ptr, %"class.Eigen::internal::variable_if_dynamic", i8 }>
%"class.Eigen::InnerStride" = type { %"class.Eigen::Stride" }
%"class.Eigen::Stride" = type { [8 x i8], %"class.Eigen::internal::variable_if_dynamic" }
%"class.std::complex" = type { { double, double } }

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Map.9") align 8, ptr noundef, i32 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) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_11InnerStrideILin1EEEEEPS5_ii(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Map.36") align 8, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @zscal_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #2 {
  %5 = alloca %"class.std::complex", align 8
  %6 = alloca %"class.Eigen::Map.9", align 8
  %7 = alloca %"class.Eigen::Map.36", align 8
  %8 = load i32, ptr %0, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 1
  br i1 %9, label %19, label %10

10:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !9
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %13, label %15

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Map.9") align 8 %6, ptr noundef %2, i32 noundef %8)
  %14 = call noundef nonnull align 8 dereferenceable(19) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %18

15:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #5
  %16 = tail call i32 @llvm.abs.i32(i32 %11, i1 true)
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_11InnerStrideILin1EEEEEPS5_ii(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Map.36") align 8 %7, ptr noundef %2, i32 noundef %8, i32 noundef %16)
  %17 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #5
  br label %18

18:                                               ; preds = %15, %13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %19

19:                                               ; preds = %4, %18
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(19) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZN5Eigen9DenseBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEmLERKS4_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint mustprogress 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 16, !10}
!10 = !{!7, !7, i64 0}


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