; LLVM IR from cvanaret/Uno :: uno/model (HomogeneousEqualityConstrainedModel)

; 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.uno::SparseVector<unsigned long>::iterator" = type { ptr, i64 }
%"struct.std::pair" = type { i64, i64 }
%"class.uno::HomogeneousEqualityConstrainedModel" = type { %"class.uno::Model", %"class.std::unique_ptr", %"class.std::vector", %"class.std::vector", %"class.uno::Range", %"class.uno::Range", %"class.uno::SparseVector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.uno::Concatenation", %"class.uno::Concatenation", %"class.uno::Concatenation", %"class.uno::Concatenation" }
%"class.uno::Model" = type { ptr, %"class.std::__cxx11::basic_string", i64, i64, double }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.uno::Range" = type { %"class.uno::Collection", i64, i64 }
%"class.uno::Collection" = type { ptr }
%"class.uno::SparseVector" = type { %"class.std::vector", %"class.std::vector", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.uno::Concatenation" = type { %"class.uno::Collection", ptr, %"class.uno::CollectionAdapter" }
%"class.uno::CollectionAdapter" = type { %"class.uno::Collection", ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrIN3uno5ModelESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno12SparseVectorImE5beginEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno12SparseVectorImE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3unoneERKNS_12SparseVectorImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK3uno12SparseVectorImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno12SparseVectorImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3uno35HomogeneousEqualityConstrainedModel20initial_primal_pointERNS_6VectorIdEE(ptr noundef nonnull align 8 dereferenceable(448) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.uno::SparseVector<unsigned long>::iterator", align 8
  %7 = alloca %"class.uno::SparseVector<unsigned long>::iterator", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  %12 = getelementptr inbounds %"class.uno::HomogeneousEqualityConstrainedModel", ptr %11, i32 0, i32 1
  %13 = call noundef ptr @_ZNKSt10unique_ptrIN3uno5ModelESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %13, align 8, !tbaa !9
  %16 = getelementptr inbounds ptr, ptr %15, i64 25
  %17 = load ptr, ptr %16, align 8
  call void %17(ptr noundef nonnull align 8 dereferenceable(64) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %18 = load ptr, ptr %11, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 14
  %20 = load ptr, ptr %19, align 8
  %21 = call noundef nonnull align 8 dereferenceable(56) ptr %20(ptr noundef nonnull align 8 dereferenceable(448) %11)
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call { ptr, i64 } @_ZNK3uno12SparseVectorImE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %22)
  %24 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  %25 = extractvalue { ptr, i64 } %23, 0
  store ptr %25, ptr %24, align 8
  %26 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  %27 = extractvalue { ptr, i64 } %23, 1
  store i64 %27, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call { ptr, i64 } @_ZNK3uno12SparseVectorImE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %28)
  %30 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %31 = extractvalue { ptr, i64 } %29, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %33 = extractvalue { ptr, i64 } %29, 1
  store i64 %33, ptr %32, align 8
  br label %34

34:                                               ; preds = %49, %2
  %35 = call noundef zeroext i1 @_ZN3unoneERKNS_12SparseVectorImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %51

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %38 = call { i64, i64 } @_ZNK3uno12SparseVectorImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %39 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 0
  %40 = extractvalue { i64, i64 } %38, 0
  store i64 %40, ptr %39, align 8
  %41 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 1
  %42 = extractvalue { i64, i64 } %38, 1
  store i64 %42, ptr %41, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  store ptr %43, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  store ptr %44, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3uno6VectorIdEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47)
  store double 0.000000e+00, ptr %48, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  br label %49

49:                                               ; preds = %37
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno12SparseVectorImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  br label %34

51:                                               ; preds = %36
  ret void
}

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

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !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.uno::SparseVector<unsigned long>::iterator" = type { ptr, i64 }
%"struct.std::pair" = type { i64, i64 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrIN3uno5ModelESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno12SparseVectorImE5beginEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno12SparseVectorImE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3unoneERKNS_12SparseVectorImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK3uno12SparseVectorImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno12SparseVectorImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3uno35HomogeneousEqualityConstrainedModel20initial_primal_pointERNS_6VectorIdEE(ptr noundef nonnull align 8 dereferenceable(448) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #2 align 2 {
  %3 = alloca %"class.uno::SparseVector<unsigned long>::iterator", align 8
  %4 = alloca %"class.uno::SparseVector<unsigned long>::iterator", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 64
  %7 = tail call noundef ptr @_ZNKSt10unique_ptrIN3uno5ModelESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 200
  %10 = load ptr, ptr %9, align 8
  tail call void %10(ptr noundef nonnull align 8 dereferenceable(64) %7, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 112
  %13 = load ptr, ptr %12, align 8
  %14 = tail call noundef nonnull align 8 dereferenceable(56) ptr %13(ptr noundef nonnull align 8 dereferenceable(448) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %15 = tail call { ptr, i64 } @_ZNK3uno12SparseVectorImE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %14)
  %16 = extractvalue { ptr, i64 } %15, 0
  store ptr %16, ptr %3, align 8
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  %18 = extractvalue { ptr, i64 } %15, 1
  store i64 %18, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %19 = tail call { ptr, i64 } @_ZNK3uno12SparseVectorImE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %14)
  %20 = extractvalue { ptr, i64 } %19, 0
  store ptr %20, ptr %4, align 8
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = extractvalue { ptr, i64 } %19, 1
  store i64 %22, ptr %21, align 8
  %23 = call noundef zeroext i1 @_ZN3unoneERKNS_12SparseVectorImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %23, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  br label %25

._crit_edge:                                      ; preds = %25, %2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret void

25:                                               ; preds = %.lr.ph, %25
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %26 = call { i64, i64 } @_ZNK3uno12SparseVectorImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %27 = extractvalue { i64, i64 } %26, 0
  store i64 %27, ptr %5, align 8
  %28 = extractvalue { i64, i64 } %26, 1
  store i64 %28, ptr %24, align 8
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EmmEOKNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOKS4_(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3uno6VectorIdEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31)
  store double 0.000000e+00, ptr %32, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno12SparseVectorImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %34 = call noundef zeroext i1 @_ZN3unoneERKNS_12SparseVectorImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %34, label %25, label %._crit_edge
}

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass