; 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.Eigen::CwiseUnaryOp" = type { %"class.Eigen::Map.9", [8 x i8] }
%"class.Eigen::CwiseUnaryOp.68" = type <{ %"class.Eigen::Map.36", [8 x i8] }>

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

; 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) #1

; 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) #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @izamax_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.Eigen::CwiseUnaryOp", align 8
  %11 = alloca %"class.Eigen::Map.9", align 8
  %12 = alloca %"class.Eigen::CwiseUnaryOp.68", align 8
  %13 = alloca %"class.Eigen::Map.36", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, 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 = %3
  store i32 0, ptr %4, align 4
  br label %40

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %19, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %23, label %28

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind writable sret(%"class.Eigen::Map.9") align 8 %11, ptr noundef %24, i32 noundef %26)
  call void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE8cwiseAbsEv(ptr dead_on_unwind writable sret(%"class.Eigen::CwiseUnaryOp") align 8 %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
  %27 = call noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %36

28:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #4
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call i32 @llvm.abs.i32(i32 %33, 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 %29, i32 noundef %31, i32 noundef %34)
  call void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEE8cwiseAbsEv(ptr dead_on_unwind writable sret(%"class.Eigen::CwiseUnaryOp.68") align 8 %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
  %35 = call noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1) %12, ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  br label %36

36:                                               ; preds = %28, %23
  %37 = load i64, ptr %9, align 8, !tbaa !11
  %38 = trunc i64 %37 to i32
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %40

40:                                               ; preds = %36, %17
  %41 = load i32, ptr %4, align 4
  ret i32 %41
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE8cwiseAbsEv(ptr dead_on_unwind noalias writable sret(%"class.Eigen::CwiseUnaryOp") align 8, ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEE8cwiseAbsEv(ptr dead_on_unwind noalias writable sret(%"class.Eigen::CwiseUnaryOp.68") align 8, ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"long", !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.Eigen::CwiseUnaryOp" = type { %"class.Eigen::Map.9", [8 x i8] }
%"class.Eigen::CwiseUnaryOp.68" = type <{ %"class.Eigen::Map.36", [8 x i8] }>

; 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 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 #1

; 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 #1

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -2147483647, -2147483648) i32 @izamax_(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #1 {
  %4 = alloca i64, align 8
  %5 = alloca %"class.Eigen::CwiseUnaryOp", align 8
  %6 = alloca %"class.Eigen::Map.9", align 8
  %7 = alloca %"class.Eigen::CwiseUnaryOp.68", align 8
  %8 = alloca %"class.Eigen::Map.36", align 8
  %9 = load i32, ptr %0, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 1
  br i1 %10, label %23, label %11

11:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %16

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_6StrideILi0ELi0EEEEEPS5_i(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Map.9") align 8 %6, ptr noundef %1, i32 noundef %9)
  call void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE8cwiseAbsEv(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::CwiseUnaryOp") align 8 %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %15 = call noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %19

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  %17 = tail call i32 @llvm.abs.i32(i32 %12, i1 true)
  call void @_Z11make_vectorISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELi1ELi0ELin1ELi1EEELi0ENS2_11InnerStrideILin1EEEEEPS5_ii(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Map.36") align 8 %8, ptr noundef %1, i32 noundef %9, i32 noundef %17)
  call void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEE8cwiseAbsEv(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::CwiseUnaryOp.68") align 8 %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %18 = call noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #4
  br label %19

19:                                               ; preds = %16, %14
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = trunc i64 %20 to i32
  %22 = add nsw i32 %21, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %23

23:                                               ; preds = %3, %19
  %.0 = phi i32 [ %22, %19 ], [ 0, %3 ]
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEE8cwiseAbsEv(ptr dead_on_unwind noalias writable sret(%"class.Eigen::CwiseUnaryOp") align 8, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_6StrideILi0ELi0EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEE8cwiseAbsEv(ptr dead_on_unwind noalias writable sret(%"class.Eigen::CwiseUnaryOp.68") align 8, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5Eigen9DenseBaseINS_12CwiseUnaryOpINS_8internal13scalar_abs_opISt7complexIdEEEKNS_3MapINS_6MatrixIS5_Lin1ELi1ELi0ELin1ELi1EEELi0ENS_11InnerStrideILin1EEEEEEEE8maxCoeffIlEEdPT_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) local_unnamed_addr #1 align 2

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


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