; 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.std::complex" = type { { double, double } }
%"class.Eigen::CwiseUnaryView" = type { %"class.Eigen::Diagonal", [8 x i8] }
%"class.Eigen::Diagonal" = type <{ %"class.Eigen::Map.204", [8 x i8] }>
%"class.Eigen::Map.204" = type { %"class.Eigen::MapBase.205", %"class.Eigen::OuterStride" }
%"class.Eigen::MapBase.205" = type { %"class.Eigen::MapBase.206" }
%"class.Eigen::MapBase.206" = type { ptr, %"class.Eigen::internal::variable_if_dynamic", %"class.Eigen::internal::variable_if_dynamic" }
%"class.Eigen::internal::variable_if_dynamic" = type { i64 }
%"class.Eigen::OuterStride" = type { %"class.Eigen::Stride.base", [7 x i8] }
%"class.Eigen::Stride.base" = type <{ %"class.Eigen::internal::variable_if_dynamic", i8 }>

@_ZZ5zher_E4func = external hidden constant [2 x ptr], align 16
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1

; 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
declare dso_local void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

declare i32 @xerbla_(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z18get_compact_vectorISt7complexIdEEPT_S3_ii(ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local i32 @zher_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #4 {
  %8 = alloca i32, align 4
  %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 ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::complex", align 8
  %25 = alloca %"class.Eigen::CwiseUnaryView", align 8
  %26 = alloca %"class.Eigen::Diagonal", align 8
  %27 = alloca %"class.Eigen::Map.204", align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %28, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %29 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %29, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load double, ptr %30, align 8, !tbaa !9
  store double %31, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !11
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i8, ptr %32, align 1, !tbaa !13
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, 85
  br i1 %35, label %41, label %36

36:                                               ; preds = %7
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i8, ptr %37, align 1, !tbaa !13
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 117
  br i1 %40, label %41, label %42

41:                                               ; preds = %36, %7
  br label %56

42:                                               ; preds = %36
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 76
  br i1 %46, label %52, label %47

47:                                               ; preds = %42
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !13
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %50, 108
  br label %52

52:                                               ; preds = %47, %42
  %53 = phi i1 [ true, %42 ], [ %51, %47 ]
  %54 = zext i1 %53 to i64
  %55 = select i1 %53, i32 1, i32 255
  br label %56

56:                                               ; preds = %52, %41
  %57 = phi i32 [ 0, %41 ], [ %55, %52 ]
  %58 = icmp eq i32 %57, 255
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i32 1, ptr %19, align 4, !tbaa !11
  br label %81

60:                                               ; preds = %56
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  store i32 2, ptr %19, align 4, !tbaa !11
  br label %80

65:                                               ; preds = %60
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  store i32 5, ptr %19, align 4, !tbaa !11
  br label %79

70:                                               ; preds = %65
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load i32, ptr %71, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !11
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %73)
  %75 = load i32, ptr %74, align 4, !tbaa !11
  %76 = icmp slt i32 %72, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br i1 %76, label %77, label %78

77:                                               ; preds = %70
  store i32 7, ptr %19, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %77, %70
  br label %79

79:                                               ; preds = %78, %69
  br label %80

80:                                               ; preds = %79, %64
  br label %81

81:                                               ; preds = %80, %59
  %82 = load i32, ptr %19, align 4, !tbaa !11
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = call i32 @xerbla_(ptr noundef @.str.10, ptr noundef %19, i32 noundef 6)
  store i32 %85, ptr %8, align 4
  store i32 1, ptr %21, align 4
  br label %163

86:                                               ; preds = %81
  %87 = load double, ptr %18, align 8, !tbaa !9
  %88 = fcmp oeq double %87, 0.000000e+00
  br i1 %88, label %89, label %90

89:                                               ; preds = %86
  store i32 1, ptr %8, align 4
  store i32 1, ptr %21, align 4
  br label %163

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %91 = load ptr, ptr %16, align 8, !tbaa !5
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load i32, ptr %92, align 4, !tbaa !11
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = load i32, ptr %94, align 4, !tbaa !11
  %96 = call noundef ptr @_Z18get_compact_vectorISt7complexIdEEPT_S3_ii(ptr noundef %91, i32 noundef %93, i32 noundef %95)
  store ptr %96, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load i8, ptr %97, align 1, !tbaa !13
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 85
  br i1 %100, label %106, label %101

101:                                              ; preds = %90
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 117
  br i1 %105, label %106, label %107

106:                                              ; preds = %101, %90
  br label %121

107:                                              ; preds = %101
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = load i8, ptr %108, align 1, !tbaa !13
  %110 = sext i8 %109 to i32
  %111 = icmp eq i32 %110, 76
  br i1 %111, label %117, label %112

112:                                              ; preds = %107
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %115, 108
  br label %117

117:                                              ; preds = %112, %107
  %118 = phi i1 [ true, %107 ], [ %116, %112 ]
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, i32 1, i32 255
  br label %121

121:                                              ; preds = %117, %106
  %122 = phi i32 [ 0, %106 ], [ %120, %117 ]
  store i32 %122, ptr %23, align 4, !tbaa !11
  %123 = load i32, ptr %23, align 4, !tbaa !11
  %124 = icmp sge i32 %123, 2
  br i1 %124, label %131, label %125

125:                                              ; preds = %121
  %126 = load i32, ptr %23, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [2 x ptr], ptr @_ZZ5zher_E4func, i64 0, i64 %127
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = icmp eq ptr %129, null
  br i1 %130, label %131, label %132

131:                                              ; preds = %125, %121
  store i32 0, ptr %8, align 4
  store i32 1, ptr %21, align 4
  br label %162

132:                                              ; preds = %125
  %133 = load i32, ptr %23, align 4, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2 x ptr], ptr @_ZZ5zher_E4func, i64 0, i64 %134
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = load i32, ptr %137, align 4, !tbaa !11
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = load ptr, ptr %15, align 8, !tbaa !5
  %141 = load i32, ptr %140, align 4, !tbaa !11
  %142 = load ptr, ptr %22, align 8, !tbaa !5
  %143 = load ptr, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %144 = load double, ptr %18, align 8, !tbaa !9
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %24, double noundef %144, double noundef 0.000000e+00)
  call void %136(i32 noundef %138, ptr noundef %139, i32 noundef %141, ptr noundef %142, ptr noundef %143, ptr noundef nonnull align 8 dereferenceable(16) %24)
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %27) #7
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load i32, ptr %146, align 4, !tbaa !11
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = load i32, ptr %148, align 4, !tbaa !11
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = load i32, ptr %150, align 4, !tbaa !11
  call void @_Z6matrixISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELin1ELi0ELin1ELin1EEELi0ENS2_11OuterStrideILin1EEEEEPS5_iii(ptr dead_on_unwind writable sret(%"class.Eigen::Map.204") align 8 %27, ptr noundef %145, i32 noundef %147, i32 noundef %149, i32 noundef %151)
  call void @_ZN5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEEE8diagonalEv(ptr dead_on_unwind writable sret(%"class.Eigen::Diagonal") align 8 %26, ptr noundef nonnull align 1 dereferenceable(1) %27)
  call void @_ZN5Eigen10MatrixBaseINS_8DiagonalINS_3MapINS_6MatrixISt7complexIdELin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEE4imagEv(ptr dead_on_unwind writable sret(%"class.Eigen::CwiseUnaryView") align 8 %25, ptr noundef nonnull align 1 dereferenceable(1) %26)
  %152 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZN5Eigen9DenseBaseINS_14CwiseUnaryViewINS_8internal18scalar_imag_ref_opISt7complexIdEEENS_8DiagonalINS_3MapINS_6MatrixIS5_Lin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) %25)
  call void @llvm.lifetime.end.p0(i64 40, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %25) #7
  %153 = load ptr, ptr %22, align 8, !tbaa !5
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = icmp ne ptr %153, %154
  br i1 %155, label %156, label %161

156:                                              ; preds = %132
  %157 = load ptr, ptr %22, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  call void @_ZdaPv(ptr noundef %157) #8
  br label %160

160:                                              ; preds = %159, %156
  br label %161

161:                                              ; preds = %160, %132
  store i32 1, ptr %8, align 4
  store i32 1, ptr %21, align 4
  br label %162

162:                                              ; preds = %161, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %163

163:                                              ; preds = %162, %89, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %164 = load i32, ptr %8, align 4
  ret i32 %164
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZN5Eigen9DenseBaseINS_14CwiseUnaryViewINS_8internal18scalar_imag_ref_opISt7complexIdEEENS_8DiagonalINS_3MapINS_6MatrixIS5_Lin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

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 = { inlinehint 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 #3 = { "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 = { 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 = { nobuiltin 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!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.std::complex" = type { { double, double } }
%"class.Eigen::CwiseUnaryView" = type { %"class.Eigen::Diagonal", [8 x i8] }
%"class.Eigen::Diagonal" = type <{ %"class.Eigen::Map.204", [8 x i8] }>
%"class.Eigen::Map.204" = type { %"class.Eigen::MapBase.205", %"class.Eigen::OuterStride" }
%"class.Eigen::MapBase.205" = type { %"class.Eigen::MapBase.206" }
%"class.Eigen::MapBase.206" = type { ptr, %"class.Eigen::internal::variable_if_dynamic", %"class.Eigen::internal::variable_if_dynamic" }
%"class.Eigen::internal::variable_if_dynamic" = type { i64 }
%"class.Eigen::OuterStride" = type { %"class.Eigen::Stride.base", [7 x i8] }
%"class.Eigen::Stride.base" = type <{ %"class.Eigen::internal::variable_if_dynamic", i8 }>

@_ZZ5zher_E4func = external hidden local_unnamed_addr constant [2 x ptr], align 16
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

declare i32 @xerbla_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z18get_compact_vectorISt7complexIdEEPT_S3_ii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local i32 @zher_(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, ptr nocapture noundef readonly %4, ptr noundef %5, ptr nocapture noundef readonly %6) local_unnamed_addr #4 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::complex", align 8
  %11 = alloca %"class.Eigen::CwiseUnaryView", align 8
  %12 = alloca %"class.Eigen::Diagonal", align 8
  %13 = alloca %"class.Eigen::Map.204", align 8
  %14 = load double, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %15 = load i8, ptr %0, align 1, !tbaa !9
  switch i8 %15, label %16 [
    i8 85, label %.critedge
    i8 117, label %.critedge
    i8 76, label %.critedge
    i8 108, label %.critedge
  ]

16:                                               ; preds = %7
  store i32 1, ptr %8, align 4, !tbaa !10
  br label %.thread

.critedge:                                        ; preds = %7, %7, %7, %7
  %17 = load i32, ptr %1, align 4, !tbaa !10
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %.critedge
  store i32 2, ptr %8, align 4, !tbaa !10
  br label %.thread

20:                                               ; preds = %.critedge
  %21 = load i32, ptr %4, align 4, !tbaa !10
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  store i32 5, ptr %8, align 4, !tbaa !10
  br label %.thread

24:                                               ; preds = %20
  %25 = load i32, ptr %6, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1, ptr %9, align 4, !tbaa !10
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = load i32, ptr %26, align 4, !tbaa !10
  %28 = icmp slt i32 %25, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  store i32 7, ptr %8, align 4, !tbaa !10
  br label %.thread

.thread:                                          ; preds = %16, %23, %29, %19
  %30 = call i32 @xerbla_(ptr noundef nonnull @.str.10, ptr noundef nonnull %8, i32 noundef 6)
  br label %50

31:                                               ; preds = %24
  %32 = fcmp oeq double %14, 0.000000e+00
  br i1 %32, label %50, label %33

33:                                               ; preds = %31
  %34 = load i32, ptr %1, align 4, !tbaa !10
  %35 = load i32, ptr %4, align 4, !tbaa !10
  %36 = call noundef ptr @_Z18get_compact_vectorISt7complexIdEEPT_S3_ii(ptr noundef %3, i32 noundef %34, i32 noundef %35)
  %37 = load i8, ptr %0, align 1, !tbaa !9
  switch i8 %37, label %50 [
    i8 85, label %select.unfold
    i8 117, label %select.unfold
    i8 76, label %38
    i8 108, label %select.unfold.fold.split
  ]

38:                                               ; preds = %33
  br label %select.unfold

select.unfold.fold.split:                         ; preds = %33
  br label %select.unfold

select.unfold:                                    ; preds = %33, %33, %select.unfold.fold.split, %38
  %.ph = phi i64 [ 1, %38 ], [ 0, %33 ], [ 0, %33 ], [ 1, %select.unfold.fold.split ]
  %39 = getelementptr inbounds [2 x ptr], ptr @_ZZ5zher_E4func, i64 0, i64 %.ph
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %41 = icmp eq ptr %40, null
  br i1 %41, label %50, label %42

42:                                               ; preds = %select.unfold
  %43 = load i32, ptr %1, align 4, !tbaa !10
  %44 = load i32, ptr %6, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %14, double noundef 0.000000e+00)
  call void %40(i32 noundef %43, ptr noundef %5, i32 noundef %44, ptr noundef %36, ptr noundef %36, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %13) #7
  %45 = load i32, ptr %1, align 4, !tbaa !10
  %46 = load i32, ptr %6, align 4, !tbaa !10
  call void @_Z6matrixISt7complexIdEEN5Eigen3MapINS2_6MatrixIT_Lin1ELin1ELi0ELin1ELin1EEELi0ENS2_11OuterStrideILin1EEEEEPS5_iii(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Map.204") align 8 %13, ptr noundef %5, i32 noundef %45, i32 noundef %45, i32 noundef %46)
  call void @_ZN5Eigen10MatrixBaseINS_3MapINS_6MatrixISt7complexIdELin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEEE8diagonalEv(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Diagonal") align 8 %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
  call void @_ZN5Eigen10MatrixBaseINS_8DiagonalINS_3MapINS_6MatrixISt7complexIdELin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEE4imagEv(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::CwiseUnaryView") align 8 %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
  %47 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZN5Eigen9DenseBaseINS_14CwiseUnaryViewINS_8internal18scalar_imag_ref_opISt7complexIdEEENS_8DiagonalINS_3MapINS_6MatrixIS5_Lin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) %11)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #7
  %.not41 = icmp eq ptr %36, %3
  %48 = icmp eq ptr %36, null
  %or.cond = or i1 %.not41, %48
  br i1 %or.cond, label %50, label %49

49:                                               ; preds = %42
  call void @_ZdaPv(ptr noundef nonnull %36) #8
  br label %50

50:                                               ; preds = %33, %select.unfold, %49, %42, %31, %.thread
  %.1 = phi i32 [ %30, %.thread ], [ 1, %31 ], [ 0, %select.unfold ], [ 1, %49 ], [ 1, %42 ], [ 0, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  ret i32 %.1
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZN5Eigen9DenseBaseINS_14CwiseUnaryViewINS_8internal18scalar_imag_ref_opISt7complexIdEEENS_8DiagonalINS_3MapINS_6MatrixIS5_Lin1ELin1ELi0ELin1ELin1EEELi0ENS_11OuterStrideILin1EEEEELi0EEEEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

attributes #0 = { mustprogress 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 = { inlinehint 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 #3 = { "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 = { 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 = { nobuiltin 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin 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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass