; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (ap)

; 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.alglib_impl::ae_complex" = type { double, double }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon = type { ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl20_ialglib_cmatrixgemmElllNS_10ae_complexEPS0_llS1_llS0_S1_l(i64 noundef, i64 noundef, i64 noundef, double, double, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, double, double, ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11alglib_impl23_ialglib_i_cmatrixgemmfElllNS_10ae_complexEPNS_9ae_matrixElllS2_lllS0_S2_ll(i64 noundef %0, i64 noundef %1, i64 noundef %2, double %3, double %4, ptr noundef %5, i64 noundef %6, i64 noundef %7, i64 noundef %8, ptr noundef %9, i64 noundef %10, i64 noundef %11, i64 noundef %12, double %13, double %14, ptr noundef %15, i64 noundef %16, i64 noundef %17) #1 {
  %19 = alloca i1, align 1
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  %21 = alloca %"struct.alglib_impl::ae_complex", align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca %"struct.alglib_impl::ae_complex", align 8
  %37 = alloca %"struct.alglib_impl::ae_complex", align 8
  %38 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  store double %3, ptr %38, align 8
  %39 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  store double %4, ptr %39, align 8
  %40 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  store double %13, ptr %40, align 8
  %41 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  store double %14, ptr %41, align 8
  store i64 %0, ptr %22, align 8, !tbaa !5
  store i64 %1, ptr %23, align 8, !tbaa !5
  store i64 %2, ptr %24, align 8, !tbaa !5
  store ptr %5, ptr %25, align 8, !tbaa !9
  store i64 %6, ptr %26, align 8, !tbaa !5
  store i64 %7, ptr %27, align 8, !tbaa !5
  store i64 %8, ptr %28, align 8, !tbaa !5
  store ptr %9, ptr %29, align 8, !tbaa !9
  store i64 %10, ptr %30, align 8, !tbaa !5
  store i64 %11, ptr %31, align 8, !tbaa !5
  store i64 %12, ptr %32, align 8, !tbaa !5
  store ptr %15, ptr %33, align 8, !tbaa !9
  store i64 %16, ptr %34, align 8, !tbaa !5
  store i64 %17, ptr %35, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %20, i32 0, i32 0
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = fcmp oeq double %43, 0.000000e+00
  br i1 %44, label %45, label %49

45:                                               ; preds = %18
  %46 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %20, i32 0, i32 1
  %47 = load double, ptr %46, align 8, !tbaa !14
  %48 = fcmp oeq double %47, 0.000000e+00
  br i1 %48, label %58, label %49

49:                                               ; preds = %45, %18
  %50 = load i64, ptr %24, align 8, !tbaa !5
  %51 = icmp eq i64 %50, 0
  br i1 %51, label %58, label %52

52:                                               ; preds = %49
  %53 = load i64, ptr %23, align 8, !tbaa !5
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %58, label %55

55:                                               ; preds = %52
  %56 = load i64, ptr %22, align 8, !tbaa !5
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %55, %52, %49, %45
  store i1 false, ptr %19, align 1
  br label %107

59:                                               ; preds = %55
  %60 = load i64, ptr %22, align 8, !tbaa !5
  %61 = load i64, ptr %23, align 8, !tbaa !5
  %62 = load i64, ptr %24, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !15
  %63 = load ptr, ptr %25, align 8, !tbaa !9
  %64 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %63, i32 0, i32 6
  %65 = load ptr, ptr %64, align 8, !tbaa !17
  %66 = load i64, ptr %26, align 8, !tbaa !5
  %67 = getelementptr inbounds ptr, ptr %65, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = load i64, ptr %27, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %68, i64 %69
  %71 = load ptr, ptr %25, align 8, !tbaa !9
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !18
  %74 = load i64, ptr %28, align 8, !tbaa !5
  %75 = load ptr, ptr %29, align 8, !tbaa !9
  %76 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %75, i32 0, i32 6
  %77 = load ptr, ptr %76, align 8, !tbaa !17
  %78 = load i64, ptr %30, align 8, !tbaa !5
  %79 = getelementptr inbounds ptr, ptr %77, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = load i64, ptr %31, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %80, i64 %81
  %83 = load ptr, ptr %29, align 8, !tbaa !9
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %83, i32 0, i32 2
  %85 = load i64, ptr %84, align 8, !tbaa !18
  %86 = load i64, ptr %32, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !15
  %87 = load ptr, ptr %33, align 8, !tbaa !9
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %87, i32 0, i32 6
  %89 = load ptr, ptr %88, align 8, !tbaa !17
  %90 = load i64, ptr %34, align 8, !tbaa !5
  %91 = getelementptr inbounds ptr, ptr %89, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = load i64, ptr %35, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %92, i64 %93
  %95 = load ptr, ptr %33, align 8, !tbaa !9
  %96 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %95, i32 0, i32 2
  %97 = load i64, ptr %96, align 8, !tbaa !18
  %98 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %99 = load double, ptr %98, align 8
  %100 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %101 = load double, ptr %100, align 8
  %102 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %103 = load double, ptr %102, align 8
  %104 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %105 = load double, ptr %104, align 8
  %106 = call noundef zeroext i1 @_ZN11alglib_impl20_ialglib_cmatrixgemmElllNS_10ae_complexEPS0_llS1_llS0_S1_l(i64 noundef %60, i64 noundef %61, i64 noundef %62, double %99, double %101, ptr noundef %70, i64 noundef %73, i64 noundef %74, ptr noundef %82, i64 noundef %85, i64 noundef %86, double %103, double %105, ptr noundef %94, i64 noundef %97)
  store i1 %106, ptr %19, align 1
  br label %107

107:                                              ; preds = %59, %58
  %108 = load i1, ptr %19, align 1
  ret i1 %108
}

attributes #0 = { nocallback nofree 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" }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN11alglib_impl10ae_complexE", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{i64 0, i64 8, !16, i64 8, i64 8, !16}
!16 = !{!13, !13, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"_ZTSN11alglib_impl9ae_matrixE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !20, i64 32, !21, i64 40, !7, i64 72}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}


; 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.alglib_impl::ae_complex" = type { double, double }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl20_ialglib_cmatrixgemmElllNS_10ae_complexEPS0_llS1_llS0_S1_l(i64 noundef, i64 noundef, i64 noundef, double, double, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, double, double, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11alglib_impl23_ialglib_i_cmatrixgemmfElllNS_10ae_complexEPNS_9ae_matrixElllS2_lllS0_S2_ll(i64 noundef %0, i64 noundef %1, i64 noundef %2, double %3, double %4, ptr nocapture noundef readonly %5, i64 noundef %6, i64 noundef %7, i64 noundef %8, ptr nocapture noundef readonly %9, i64 noundef %10, i64 noundef %11, i64 noundef %12, double %13, double %14, ptr nocapture noundef readonly %15, i64 noundef %16, i64 noundef %17) local_unnamed_addr #0 {
  %19 = fcmp oeq double %3, 0.000000e+00
  %20 = fcmp oeq double %4, 0.000000e+00
  %or.cond = select i1 %19, i1 %20, i1 false
  %21 = icmp eq i64 %2, 0
  %or.cond4 = or i1 %21, %or.cond
  %22 = icmp eq i64 %1, 0
  %or.cond6 = or i1 %22, %or.cond4
  %23 = icmp eq i64 %0, 0
  %or.cond8 = or i1 %23, %or.cond6
  br i1 %or.cond8, label %47, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds i8, ptr %5, i64 72
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds ptr, ptr %26, i64 %6
  %28 = load ptr, ptr %27, align 8, !tbaa !8
  %29 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %28, i64 %7
  %30 = getelementptr inbounds i8, ptr %5, i64 16
  %31 = load i64, ptr %30, align 8, !tbaa !10
  %32 = getelementptr inbounds i8, ptr %9, i64 72
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds ptr, ptr %33, i64 %10
  %35 = load ptr, ptr %34, align 8, !tbaa !8
  %36 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %35, i64 %11
  %37 = getelementptr inbounds i8, ptr %9, i64 16
  %38 = load i64, ptr %37, align 8, !tbaa !10
  %39 = getelementptr inbounds i8, ptr %15, i64 72
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds ptr, ptr %40, i64 %16
  %42 = load ptr, ptr %41, align 8, !tbaa !8
  %43 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %42, i64 %17
  %44 = getelementptr inbounds i8, ptr %15, i64 16
  %45 = load i64, ptr %44, align 8, !tbaa !10
  %46 = tail call noundef zeroext i1 @_ZN11alglib_impl20_ialglib_cmatrixgemmElllNS_10ae_complexEPS0_llS1_llS0_S1_l(i64 noundef %0, i64 noundef %1, i64 noundef %2, double %3, double %4, ptr noundef %29, i64 noundef %31, i64 noundef %8, ptr noundef %36, i64 noundef %38, i64 noundef %12, double %13, double %14, ptr noundef %43, i64 noundef %45)
  br label %47

47:                                               ; preds = %18, %24
  %.0 = phi i1 [ %46, %24 ], [ false, %18 ]
  ret i1 %.0
}

attributes #0 = { 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !12, i64 16}
!11 = !{!"_ZTSN11alglib_impl9ae_matrixE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !14, i64 40, !6, i64 72}
!12 = !{!"long", !6, i64 0}
!13 = !{!"bool", !6, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}


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