; LLVM IR from cvxpy/cvxpy :: cvxpy/cvxcore/src/LinOpOperations.ll (Z13lin_to_tensorRK5LinOp)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(193), i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13lin_to_tensorRK5LinOp(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector.4", align 8
  %6 = alloca i1, align 1
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector.4", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::map", align 8
  %12 = alloca %"class.std::map", align 8
  %13 = alloca %"class.std::vector.4", align 8
  %14 = alloca %"class.std::map", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #4
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind writable sret(%"class.std::vector.4") align 8 %5, ptr noundef nonnull align 8 dereferenceable(193) %15)
  %16 = call noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %17 = icmp eq i64 %16, 0
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  br i1 %17, label %18, label %20

18:                                               ; preds = %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %19, i32 noundef 0)
  br label %78

20:                                               ; preds = %2
  store i1 false, ptr %6, align 1
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %46, %20
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind writable sret(%"class.std::vector.4") align 8 %8, ptr noundef nonnull align 8 dereferenceable(193) %24)
          to label %25 unwind label %29

25:                                               ; preds = %21
  %26 = call noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %27 = icmp ult i64 %23, %26
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  br i1 %27, label %33, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %74

29:                                               ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  br label %73

33:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #4
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %11, ptr noundef nonnull align 8 dereferenceable(193) %34, i32 noundef %35)
          to label %36 unwind label %49

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind writable sret(%"class.std::vector.4") align 8 %13, ptr noundef nonnull align 8 dereferenceable(193) %37)
          to label %38 unwind label %53

38:                                               ; preds = %36
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %40) #4
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  invoke void @_Z13lin_to_tensorRK5LinOp(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %12, ptr noundef nonnull align 8 dereferenceable(193) %42)
          to label %43 unwind label %57

43:                                               ; preds = %38
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #4
  invoke void @_Z10tensor_mulRKSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEESH_(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %14, ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %12)
          to label %44 unwind label %62

44:                                               ; preds = %43
  invoke void @_Z10acc_tensorRSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEERKSF_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %14)
          to label %45 unwind label %66

45:                                               ; preds = %44
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #4
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = add i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !9
  br label %21, !llvm.loop !11

49:                                               ; preds = %33
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %9, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %10, align 4
  br label %72

53:                                               ; preds = %36
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %9, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %10, align 4
  br label %61

57:                                               ; preds = %38
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %9, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %10, align 4
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  br label %61

61:                                               ; preds = %57, %53
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  br label %71

62:                                               ; preds = %43
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  br label %70

66:                                               ; preds = %44
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %9, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %10, align 4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #4
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  br label %71

71:                                               ; preds = %70, %61
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #4
  br label %72

72:                                               ; preds = %71, %49
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #4
  br label %73

73:                                               ; preds = %72, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  br label %79

74:                                               ; preds = %28
  store i1 true, ptr %6, align 1
  %75 = load i1, ptr %6, align 1
  br i1 %75, label %77, label %76

76:                                               ; preds = %74
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  br label %77

77:                                               ; preds = %76, %74
  br label %78

78:                                               ; preds = %77, %18
  ret void

79:                                               ; preds = %73
  %80 = load ptr, ptr %9, align 8
  %81 = load i32, ptr %10, align 4
  %82 = insertvalue { ptr, i32 } poison, ptr %80, 0
  %83 = insertvalue { ptr, i32 } %82, i32 %81, 1
  resume { ptr, i32 } %83
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.4") align 8, ptr noundef nonnull align 8 dereferenceable(193)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

declare void @_Z10tensor_mulRKSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEESH_(ptr dead_on_unwind writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #3

declare void @_Z10acc_tensorRSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEERKSF_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #3

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" }
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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(193), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13lin_to_tensorRK5LinOp(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.4", align 8
  %4 = alloca %"class.std::vector.4", align 8
  %5 = alloca %"class.std::map", align 8
  %6 = alloca %"class.std::map", align 8
  %7 = alloca %"class.std::vector.4", align 8
  %8 = alloca %"class.std::map", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.4") align 8 %3, ptr noundef nonnull align 8 dereferenceable(193) %1)
  %9 = call noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %10 = icmp eq i64 %9, 0
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  call void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %1, i32 noundef 0)
  br label %.loopexit

12:                                               ; preds = %2
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  br label %13

13:                                               ; preds = %27, %12
  %.016 = phi i32 [ 0, %12 ], [ %28, %27 ]
  %14 = zext i32 %.016 to i64
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  invoke void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.4") align 8 %4, ptr noundef nonnull align 8 dereferenceable(193) %1)
          to label %15 unwind label %18

15:                                               ; preds = %13
  %16 = call noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %17 = icmp ugt i64 %16, %14
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br i1 %17, label %20, label %.loopexit

18:                                               ; preds = %13
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %43

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #4
  invoke void @_Z15get_node_coeffsRK5LinOpi(ptr dead_on_unwind nonnull writable sret(%"class.std::map") align 8 %5, ptr noundef nonnull align 8 dereferenceable(193) %1, i32 noundef %.016)
          to label %21 unwind label %29

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  invoke void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.4") align 8 %7, ptr noundef nonnull align 8 dereferenceable(193) %1)
          to label %22 unwind label %31

22:                                               ; preds = %21
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %14) #4
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  invoke void @_Z13lin_to_tensorRK5LinOp(ptr dead_on_unwind nonnull writable sret(%"class.std::map") align 8 %6, ptr noundef nonnull align 8 dereferenceable(193) %24)
          to label %25 unwind label %33

25:                                               ; preds = %22
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #4
  invoke void @_Z10tensor_mulRKSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEESH_(ptr dead_on_unwind nonnull writable sret(%"class.std::map") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(48) %6)
          to label %26 unwind label %36

26:                                               ; preds = %25
  invoke void @_Z10acc_tensorRSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEERKSF_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %8)
          to label %27 unwind label %38

27:                                               ; preds = %26
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  %28 = add i32 %.016, 1
  br label %13, !llvm.loop !9

29:                                               ; preds = %20
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %42

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %22
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  br label %41

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #4
  br label %40

40:                                               ; preds = %38, %36
  %.pn19 = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #4
  br label %41

41:                                               ; preds = %40, %35
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %40 ], [ %.pn, %35 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #4
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  br label %42

42:                                               ; preds = %41, %29
  %.pn19.pn.pn = phi { ptr, i32 } [ %.pn19.pn, %41 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  br label %43

43:                                               ; preds = %42, %18
  %.pn19.pn.pn.pn = phi { ptr, i32 } [ %.pn19.pn.pn, %42 ], [ %19, %18 ]
  call void @_ZNSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  resume { ptr, i32 } %.pn19.pn.pn.pn

.loopexit:                                        ; preds = %15, %11
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.4") align 8, ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPK5LinOpSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

declare void @_Z10tensor_mulRKSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEESH_(ptr dead_on_unwind writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3

declare void @_Z10acc_tensorRSt3mapIiS_IiSt6vectorIN5Eigen12SparseMatrixIdLi0EiEESaIS3_EESt4lessIiESaISt4pairIKiS5_EEES7_SaIS8_IS9_SC_EEERKSF_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3

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" }
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass