; LLVM IR from Derek-TH-Wang/quadruped_ctrl :: src/MPC_Ctrl/SparseCMPC.ll (ZN10SparseCMPC22addFrictionConstraintsEv)

; 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.SparseCMPC = type <{ %"class.Eigen::Matrix", [8 x i8], %"class.Eigen::Matrix.3", double, double, double, double, %"class.Eigen::Matrix.13", %"class.Eigen::Matrix.13", %"class.Eigen::Matrix.13", %"class.Eigen::Matrix.13", %"class.Eigen::Matrix.23", %"class.Eigen::Matrix.3", %"class.Eigen::Matrix.3", %"class.Eigen::Matrix.3", %"class.std::vector", %"class.std::vector.33", %"class.std::vector.38", %"class.std::vector.43", %"class.std::vector.49", %"class.std::vector.54", %"class.std::vector.60", %"class.std::vector.60", %"class.std::vector.65", %"class.std::vector.65", %"class.std::vector.38", %"class.std::vector.38", %"class.std::vector.38", %"class.Eigen::Matrix.70", i32, i32, i32, [12 x i8] }>
%"class.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [9 x double] }
%"class.Eigen::Matrix.13" = type { %"class.Eigen::PlainObjectBase.14" }
%"class.Eigen::PlainObjectBase.14" = type { %"class.Eigen::DenseStorage.21" }
%"class.Eigen::DenseStorage.21" = type { %"struct.Eigen::internal::plain_array.22" }
%"struct.Eigen::internal::plain_array.22" = type { [3 x double] }
%"class.Eigen::Matrix.23" = type { %"class.Eigen::PlainObjectBase.24" }
%"class.Eigen::PlainObjectBase.24" = type { %"class.Eigen::DenseStorage.31" }
%"class.Eigen::DenseStorage.31" = type { %"struct.Eigen::internal::plain_array.32" }
%"struct.Eigen::internal::plain_array.32" = type { [4 x double] }
%"class.Eigen::Matrix.3" = type { %"class.Eigen::PlainObjectBase.4" }
%"class.Eigen::PlainObjectBase.4" = type { %"class.Eigen::DenseStorage.11" }
%"class.Eigen::DenseStorage.11" = type { %"struct.Eigen::internal::plain_array.12" }
%"struct.Eigen::internal::plain_array.12" = type { [12 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ContactState, std::allocator<ContactState>>::_Vector_impl" }
%"struct.std::_Vector_base<ContactState, std::allocator<ContactState>>::_Vector_impl" = type { %"struct.std::_Vector_base<ContactState, std::allocator<ContactState>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ContactState, std::allocator<ContactState>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 1>>>::_Vector_impl" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 1>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 1>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 1>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.43" = type { %"struct.std::_Vector_base.44" }
%"struct.std::_Vector_base.44" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 12>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 12>>>::_Vector_impl" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 12>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 12>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 12>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 12>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 12>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 12>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.49" = type { %"struct.std::_Vector_base.50" }
%"struct.std::_Vector_base.50" = type { %"struct.std::_Vector_base<BblockID, std::allocator<BblockID>>::_Vector_impl" }
%"struct.std::_Vector_base<BblockID, std::allocator<BblockID>>::_Vector_impl" = type { %"struct.std::_Vector_base<BblockID, std::allocator<BblockID>>::_Vector_impl_data" }
%"struct.std::_Vector_base<BblockID, std::allocator<BblockID>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.54" = type { %"struct.std::_Vector_base.55" }
%"struct.std::_Vector_base.55" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 3>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 3>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eigen::Matrix<double, 12, 3>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eigen::Matrix<double, 12, 3>, Eigen::aligned_allocator<Eigen::Matrix<double, 12, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.60" = type { %"struct.std::_Vector_base.61" }
%"struct.std::_Vector_base.61" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.65" = type { %"struct.std::_Vector_base.66" }
%"struct.std::_Vector_base.66" = type { %"struct.std::_Vector_base<SparseTriple<double>, std::allocator<SparseTriple<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<SparseTriple<double>, std::allocator<SparseTriple<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<SparseTriple<double>, std::allocator<SparseTriple<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SparseTriple<double>, std::allocator<SparseTriple<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.38" = type { %"struct.std::_Vector_base.39" }
%"struct.std::_Vector_base.39" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::Matrix.70" = type { %"class.Eigen::PlainObjectBase.71" }
%"class.Eigen::PlainObjectBase.71" = type { %"class.Eigen::DenseStorage.78" }
%"class.Eigen::DenseStorage.78" = type { ptr, i64 }

; 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
define dso_local void @_ZN10SparseCMPC22addFrictionConstraintsEv(ptr noundef nonnull align 16 dereferenceable(964) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %12 = getelementptr inbounds %class.SparseCMPC, ptr %11, i32 0, i32 5
  %13 = load double, ptr %12, align 16, !tbaa !9
  %14 = fdiv double 1.000000e+00, %13
  store double %14, ptr %3, align 8, !tbaa !65
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !66
  br label %15

15:                                               ; preds = %74, %1
  %16 = load i32, ptr %4, align 4, !tbaa !66
  %17 = getelementptr inbounds %class.SparseCMPC, ptr %11, i32 0, i32 30
  %18 = load i32, ptr %17, align 4, !tbaa !67
  %19 = icmp ult i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %77

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %22 = call noundef i32 @_ZN10SparseCMPC13addConstraintEj(ptr noundef nonnull align 16 dereferenceable(964) %11, i32 noundef 4)
  store i32 %22, ptr %6, align 4, !tbaa !66
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %23 = load i32, ptr %4, align 4, !tbaa !66
  %24 = call noundef i32 @_ZN10SparseCMPC15getControlIndexEj(ptr noundef nonnull align 16 dereferenceable(964) %11, i32 noundef %23)
  store i32 %24, ptr %7, align 4, !tbaa !66
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !66
  br label %25

25:                                               ; preds = %32, %21
  %26 = load i32, ptr %8, align 4, !tbaa !66
  %27 = icmp ult i32 %26, 4
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %35

29:                                               ; preds = %25
  %30 = getelementptr inbounds %class.SparseCMPC, ptr %11, i32 0, i32 25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store double 0.000000e+00, ptr %9, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %31 = getelementptr inbounds %class.SparseCMPC, ptr %11, i32 0, i32 26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store double 1.000000e+15, ptr %10, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %32

32:                                               ; preds = %29
  %33 = load i32, ptr %8, align 4, !tbaa !66
  %34 = add i32 %33, 1
  store i32 %34, ptr %8, align 4, !tbaa !66
  br label %25, !llvm.loop !68

35:                                               ; preds = %28
  %36 = load double, ptr %3, align 8, !tbaa !65
  %37 = load i32, ptr %6, align 4, !tbaa !66
  %38 = add i32 %37, 0
  %39 = load i32, ptr %7, align 4, !tbaa !66
  %40 = add i32 %39, 0
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef %36, i32 noundef %38, i32 noundef %40)
  %41 = load i32, ptr %6, align 4, !tbaa !66
  %42 = add i32 %41, 0
  %43 = load i32, ptr %7, align 4, !tbaa !66
  %44 = add i32 %43, 2
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef 1.000000e+00, i32 noundef %42, i32 noundef %44)
  %45 = load double, ptr %3, align 8, !tbaa !65
  %46 = fneg double %45
  %47 = load i32, ptr %6, align 4, !tbaa !66
  %48 = add i32 %47, 1
  %49 = load i32, ptr %7, align 4, !tbaa !66
  %50 = add i32 %49, 0
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef %46, i32 noundef %48, i32 noundef %50)
  %51 = load i32, ptr %6, align 4, !tbaa !66
  %52 = add i32 %51, 1
  %53 = load i32, ptr %7, align 4, !tbaa !66
  %54 = add i32 %53, 2
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef 1.000000e+00, i32 noundef %52, i32 noundef %54)
  %55 = load double, ptr %3, align 8, !tbaa !65
  %56 = load i32, ptr %6, align 4, !tbaa !66
  %57 = add i32 %56, 2
  %58 = load i32, ptr %7, align 4, !tbaa !66
  %59 = add i32 %58, 1
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef %55, i32 noundef %57, i32 noundef %59)
  %60 = load i32, ptr %6, align 4, !tbaa !66
  %61 = add i32 %60, 2
  %62 = load i32, ptr %7, align 4, !tbaa !66
  %63 = add i32 %62, 2
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef 1.000000e+00, i32 noundef %61, i32 noundef %63)
  %64 = load double, ptr %3, align 8, !tbaa !65
  %65 = fneg double %64
  %66 = load i32, ptr %6, align 4, !tbaa !66
  %67 = add i32 %66, 3
  %68 = load i32, ptr %7, align 4, !tbaa !66
  %69 = add i32 %68, 1
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef %65, i32 noundef %67, i32 noundef %69)
  %70 = load i32, ptr %6, align 4, !tbaa !66
  %71 = add i32 %70, 3
  %72 = load i32, ptr %7, align 4, !tbaa !66
  %73 = add i32 %72, 2
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %11, double noundef 1.000000e+00, i32 noundef %71, i32 noundef %73)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %74

74:                                               ; preds = %35
  %75 = load i32, ptr %4, align 4, !tbaa !66
  %76 = add i32 %75, 1
  store i32 %76, ptr %4, align 4, !tbaa !66
  br label %15, !llvm.loop !70

77:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

; 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 noundef i32 @_ZN10SparseCMPC15getControlIndexEj(ptr noundef nonnull align 16 dereferenceable(964), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10SparseCMPC13addConstraintEj(ptr noundef nonnull align 16 dereferenceable(964), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964), double noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 = { 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, !19, i64 192}
!10 = !{!"_ZTS10SparseCMPC", !11, i64 0, !15, i64 80, !19, i64 176, !19, i64 184, !19, i64 192, !19, i64 200, !20, i64 208, !20, i64 232, !20, i64 256, !20, i64 280, !24, i64 304, !15, i64 336, !15, i64 432, !15, i64 528, !28, i64 624, !32, i64 648, !36, i64 672, !40, i64 696, !44, i64 720, !48, i64 744, !52, i64 768, !52, i64 792, !56, i64 816, !56, i64 840, !36, i64 864, !36, i64 888, !36, i64 912, !60, i64 936, !64, i64 952, !64, i64 956, !64, i64 960}
!11 = !{!"_ZTSN5Eigen6MatrixIdLi3ELi3ELi0ELi3ELi3EEE", !12, i64 0}
!12 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi3ELi3ELi0ELi3ELi3EEEEE", !13, i64 0}
!13 = !{!"_ZTSN5Eigen12DenseStorageIdLi9ELi3ELi3ELi0EEE", !14, i64 0}
!14 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi9ELi0ELi0EEE", !7, i64 0}
!15 = !{!"_ZTSN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEE", !16, i64 0}
!16 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi12ELi1ELi0ELi12ELi1EEEEE", !17, i64 0}
!17 = !{!"_ZTSN5Eigen12DenseStorageIdLi12ELi12ELi1ELi0EEE", !18, i64 0}
!18 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi12ELi0ELi16EEE", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSN5Eigen6MatrixIdLi3ELi1ELi0ELi3ELi1EEE", !21, i64 0}
!21 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi3ELi1ELi0ELi3ELi1EEEEE", !22, i64 0}
!22 = !{!"_ZTSN5Eigen12DenseStorageIdLi3ELi3ELi1ELi0EEE", !23, i64 0}
!23 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi3ELi0ELi0EEE", !7, i64 0}
!24 = !{!"_ZTSN5Eigen6MatrixIdLi4ELi1ELi0ELi4ELi1EEE", !25, i64 0}
!25 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi4ELi1ELi0ELi4ELi1EEEEE", !26, i64 0}
!26 = !{!"_ZTSN5Eigen12DenseStorageIdLi4ELi4ELi1ELi0EEE", !27, i64 0}
!27 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi4ELi0ELi16EEE", !7, i64 0}
!28 = !{!"_ZTSSt6vectorI12ContactStateSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseI12ContactStateSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI12ContactStateSaIS0_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI12ContactStateSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSSt6vectorIdSaIdEE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE", !41, i64 0}
!41 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!44 = !{!"_ZTSSt6vectorI8BblockIDSaIS0_EE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseI8BblockIDSaIS0_EE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseI8BblockIDSaIS0_EE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseI8BblockIDSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!48 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!52 = !{!"_ZTSSt6vectorIjSaIjEE", !53, i64 0}
!53 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!"_ZTSSt6vectorI12SparseTripleIdESaIS1_EE", !57, i64 0}
!57 = !{!"_ZTSSt12_Vector_baseI12SparseTripleIdESaIS1_EE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseI12SparseTripleIdESaIS1_EE12_Vector_implE", !59, i64 0}
!59 = !{!"_ZTSNSt12_Vector_baseI12SparseTripleIdESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!60 = !{!"_ZTSN5Eigen6MatrixIfLin1ELi1ELi0ELin1ELi1EEE", !61, i64 0}
!61 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEEE", !62, i64 0}
!62 = !{!"_ZTSN5Eigen12DenseStorageIfLin1ELin1ELi1ELi0EEE", !6, i64 0, !63, i64 8}
!63 = !{!"long", !7, i64 0}
!64 = !{!"int", !7, i64 0}
!65 = !{!19, !19, i64 0}
!66 = !{!64, !64, i64 0}
!67 = !{!10, !64, i64 956}
!68 = distinct !{!68, !69}
!69 = !{!"llvm.loop.mustprogress"}
!70 = distinct !{!70, !69}


; 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"

; 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
define dso_local void @_ZN10SparseCMPC22addFrictionConstraintsEv(ptr noundef nonnull align 16 dereferenceable(964) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 192
  %5 = load double, ptr %4, align 16, !tbaa !5
  %6 = fdiv double 1.000000e+00, %5
  %7 = getelementptr inbounds i8, ptr %0, i64 956
  %8 = load i32, ptr %7, align 4, !tbaa !64
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 864
  %10 = getelementptr inbounds i8, ptr %0, i64 888
  %11 = fneg double %6
  br label %12

._crit_edge:                                      ; preds = %12, %1
  ret void

12:                                               ; preds = %.lr.ph, %12
  %.02527 = phi i32 [ 0, %.lr.ph ], [ %20, %12 ]
  %13 = call noundef i32 @_ZN10SparseCMPC13addConstraintEj(ptr noundef nonnull align 16 dereferenceable(964) %0, i32 noundef 4)
  %14 = call noundef i32 @_ZN10SparseCMPC15getControlIndexEj(ptr noundef nonnull align 16 dereferenceable(964) %0, i32 noundef %.02527)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store double 0.000000e+00, ptr %2, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store double 1.000000e+15, ptr %3, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store double 0.000000e+00, ptr %2, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store double 1.000000e+15, ptr %3, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store double 0.000000e+00, ptr %2, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store double 1.000000e+15, ptr %3, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store double 0.000000e+00, ptr %2, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store double 1.000000e+15, ptr %3, align 8, !tbaa !65
  call void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef %6, i32 noundef %13, i32 noundef %14)
  %15 = add i32 %14, 2
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef 1.000000e+00, i32 noundef %13, i32 noundef %15)
  %16 = add i32 %13, 1
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef %11, i32 noundef %16, i32 noundef %14)
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef 1.000000e+00, i32 noundef %16, i32 noundef %15)
  %17 = add i32 %13, 2
  %18 = add i32 %14, 1
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef %6, i32 noundef %17, i32 noundef %18)
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef 1.000000e+00, i32 noundef %17, i32 noundef %15)
  %19 = add i32 %13, 3
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef %11, i32 noundef %19, i32 noundef %18)
  call void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964) %0, double noundef 1.000000e+00, i32 noundef %19, i32 noundef %15)
  %20 = add nuw i32 %.02527, 1
  %21 = load i32, ptr %7, align 4, !tbaa !64
  %22 = icmp ult i32 %20, %21
  br i1 %22, label %12, label %._crit_edge, !llvm.loop !66
}

; 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 noundef i32 @_ZN10SparseCMPC15getControlIndexEj(ptr noundef nonnull align 16 dereferenceable(964), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10SparseCMPC13addConstraintEj(ptr noundef nonnull align 16 dereferenceable(964), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SparseCMPC19addConstraintTripleEdjj(ptr noundef nonnull align 16 dereferenceable(964), double noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) 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 = { 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 = { 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, !17, i64 192}
!6 = !{!"_ZTS10SparseCMPC", !7, i64 0, !13, i64 80, !17, i64 176, !17, i64 184, !17, i64 192, !17, i64 200, !18, i64 208, !18, i64 232, !18, i64 256, !18, i64 280, !22, i64 304, !13, i64 336, !13, i64 432, !13, i64 528, !26, i64 624, !31, i64 648, !35, i64 672, !39, i64 696, !43, i64 720, !47, i64 744, !51, i64 768, !51, i64 792, !55, i64 816, !55, i64 840, !35, i64 864, !35, i64 888, !35, i64 912, !59, i64 936, !63, i64 952, !63, i64 956, !63, i64 960}
!7 = !{!"_ZTSN5Eigen6MatrixIdLi3ELi3ELi0ELi3ELi3EEE", !8, i64 0}
!8 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi3ELi3ELi0ELi3ELi3EEEEE", !9, i64 0}
!9 = !{!"_ZTSN5Eigen12DenseStorageIdLi9ELi3ELi3ELi0EEE", !10, i64 0}
!10 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi9ELi0ELi0EEE", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEE", !14, i64 0}
!14 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi12ELi1ELi0ELi12ELi1EEEEE", !15, i64 0}
!15 = !{!"_ZTSN5Eigen12DenseStorageIdLi12ELi12ELi1ELi0EEE", !16, i64 0}
!16 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi12ELi0ELi16EEE", !11, i64 0}
!17 = !{!"double", !11, i64 0}
!18 = !{!"_ZTSN5Eigen6MatrixIdLi3ELi1ELi0ELi3ELi1EEE", !19, i64 0}
!19 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi3ELi1ELi0ELi3ELi1EEEEE", !20, i64 0}
!20 = !{!"_ZTSN5Eigen12DenseStorageIdLi3ELi3ELi1ELi0EEE", !21, i64 0}
!21 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi3ELi0ELi0EEE", !11, i64 0}
!22 = !{!"_ZTSN5Eigen6MatrixIdLi4ELi1ELi0ELi4ELi1EEE", !23, i64 0}
!23 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLi4ELi1ELi0ELi4ELi1EEEEE", !24, i64 0}
!24 = !{!"_ZTSN5Eigen12DenseStorageIdLi4ELi4ELi1ELi0EEE", !25, i64 0}
!25 = !{!"_ZTSN5Eigen8internal11plain_arrayIdLi4ELi0ELi16EEE", !11, i64 0}
!26 = !{!"_ZTSSt6vectorI12ContactStateSaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseI12ContactStateSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI12ContactStateSaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI12ContactStateSaIS0_EE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!30 = !{!"any pointer", !11, i64 0}
!31 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi1ELi0ELi12ELi1EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!35 = !{!"_ZTSSt6vectorIdSaIdEE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!39 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi12ELi0ELi12ELi12EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!43 = !{!"_ZTSSt6vectorI8BblockIDSaIS0_EE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseI8BblockIDSaIS0_EE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseI8BblockIDSaIS0_EE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseI8BblockIDSaIS0_EE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!47 = !{!"_ZTSSt6vectorIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIN5Eigen6MatrixIdLi12ELi3ELi0ELi12ELi3EEENS0_17aligned_allocatorIS2_EEE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!51 = !{!"_ZTSSt6vectorIjSaIjEE", !52, i64 0}
!52 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!55 = !{!"_ZTSSt6vectorI12SparseTripleIdESaIS1_EE", !56, i64 0}
!56 = !{!"_ZTSSt12_Vector_baseI12SparseTripleIdESaIS1_EE", !57, i64 0}
!57 = !{!"_ZTSNSt12_Vector_baseI12SparseTripleIdESaIS1_EE12_Vector_implE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseI12SparseTripleIdESaIS1_EE17_Vector_impl_dataE", !30, i64 0, !30, i64 8, !30, i64 16}
!59 = !{!"_ZTSN5Eigen6MatrixIfLin1ELi1ELi0ELin1ELi1EEE", !60, i64 0}
!60 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEEE", !61, i64 0}
!61 = !{!"_ZTSN5Eigen12DenseStorageIfLin1ELin1ELi1ELi0EEE", !30, i64 0, !62, i64 8}
!62 = !{!"long", !11, i64 0}
!63 = !{!"int", !11, i64 0}
!64 = !{!6, !63, i64 956}
!65 = !{!17, !17, i64 0}
!66 = distinct !{!66, !67}
!67 = !{!"llvm.loop.mustprogress"}


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