; LLVM IR from Tencent-RoboticsX/jbdl :: src/jbdl/experimental/qpoases/src/Matrices.ll (ZN7qpOASES12SparseMatrixC1EiiiPKd)

; 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.qpOASES::SparseMatrix" = type { ptr, i32, i32, ptr, ptr, ptr, ptr, %"class.qpOASES::Matrix.base" }
%"class.qpOASES::Matrix.base" = type <{ ptr, i32 }>

@_ZTVN7qpOASES12SparseMatrixE = external dso_local unnamed_addr constant { [24 x ptr], [47 x ptr] }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7qpOASES6Matrix12doFreeMemoryEv(ptr noundef nonnull align 8 dereferenceable(12)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7qpOASES6isZeroEdd(double noundef, double noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7qpOASES6MatrixC2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7qpOASES12SparseMatrixC1EiiiPKd(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8
  %17 = getelementptr inbounds i8, ptr %16, i64 48
  call void @_ZN7qpOASES6MatrixC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %17)
  store ptr getelementptr inbounds inrange(-24, 168) ({ [24 x ptr], [47 x ptr] }, ptr @_ZTVN7qpOASES12SparseMatrixE, i32 0, i32 0, i32 3), ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %16, i64 48
  store ptr getelementptr inbounds inrange(-192, 184) ({ [24 x ptr], [47 x ptr] }, ptr @_ZTVN7qpOASES12SparseMatrixE, i32 0, i32 1, i32 24), ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 1
  %20 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %20, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 2
  %22 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %22, ptr %21, align 4, !tbaa !15
  %23 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 5
  store ptr null, ptr %23, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %26, i64 4)
  %28 = extractvalue { i64, i1 } %27, 1
  %29 = extractvalue { i64, i1 } %27, 0
  %30 = select i1 %28, i64 -1, i64 %29
  %31 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %30) #7
          to label %32 unwind label %112

32:                                               ; preds = %5
  %33 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 4
  store ptr %31, ptr %33, align 8, !tbaa !17
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = mul nsw i32 %34, %35
  %37 = sext i32 %36 to i64
  %38 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 4)
  %39 = extractvalue { i64, i1 } %38, 1
  %40 = extractvalue { i64, i1 } %38, 0
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %41) #7
          to label %43 unwind label %112

43:                                               ; preds = %32
  %44 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 3
  store ptr %42, ptr %44, align 8, !tbaa !18
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = mul nsw i32 %45, %46
  %48 = sext i32 %47 to i64
  %49 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %48, i64 8)
  %50 = extractvalue { i64, i1 } %49, 1
  %51 = extractvalue { i64, i1 } %49, 0
  %52 = select i1 %50, i64 -1, i64 %51
  %53 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %52) #7
          to label %54 unwind label %112

54:                                               ; preds = %43
  %55 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 6
  store ptr %53, ptr %55, align 8, !tbaa !19
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %122, %54
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 2
  %59 = load i32, ptr %58, align 4, !tbaa !15
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %61, label %125

61:                                               ; preds = %56
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  store i32 %62, ptr %67, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %118, %61
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !13
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %73, label %121

73:                                               ; preds = %68
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = mul nsw i32 %75, %76
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = add nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %74, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !20
  %83 = invoke noundef i32 @_ZN7qpOASES6isZeroEdd(double noundef %82, double noundef 0.000000e+00)
          to label %84 unwind label %112

84:                                               ; preds = %73
  %85 = icmp eq i32 %83, 0
  br i1 %85, label %90, label %86

86:                                               ; preds = %84
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = icmp eq i32 %87, %88
  br i1 %89, label %90, label %117

90:                                               ; preds = %86, %84
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 3
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  store i32 %91, ptr %96, align 4, !tbaa !9
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = mul nsw i32 %98, %99
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = add nsw i32 %100, %101
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %97, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !20
  %106 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 6
  %107 = load ptr, ptr %106, align 8, !tbaa !19
  %108 = load i32, ptr %13, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %13, align 4, !tbaa !9
  %110 = sext i32 %108 to i64
  %111 = getelementptr inbounds double, ptr %107, i64 %110
  store double %105, ptr %111, align 8, !tbaa !20
  br label %117

112:                                              ; preds = %125, %73, %43, %32, %5
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %14, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %116 = getelementptr inbounds i8, ptr %16, i64 48
  call void @_ZN7qpOASES6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %116) #6
  br label %138

117:                                              ; preds = %90, %86
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !9
  br label %68, !llvm.loop !22

121:                                              ; preds = %68
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !9
  br label %56, !llvm.loop !24

125:                                              ; preds = %56
  %126 = load i32, ptr %13, align 4, !tbaa !9
  %127 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %129 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %16, i32 0, i32 2
  %130 = load i32, ptr %129, align 4, !tbaa !15
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %128, i64 %131
  store i32 %126, ptr %132, align 4, !tbaa !9
  %133 = load ptr, ptr %16, align 8, !tbaa !11
  %134 = getelementptr i8, ptr %133, i64 -24
  %135 = load i64, ptr %134, align 8
  %136 = getelementptr inbounds i8, ptr %16, i64 %135
  invoke void @_ZN7qpOASES6Matrix12doFreeMemoryEv(ptr noundef nonnull align 8 dereferenceable(12) %136)
          to label %137 unwind label %112

137:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void

138:                                              ; preds = %112
  %139 = load ptr, ptr %14, align 8
  %140 = load i32, ptr %15, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7qpOASES6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTSN7qpOASES12SparseMatrixE", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!14, !10, i64 12}
!16 = !{!14, !6, i64 32}
!17 = !{!14, !6, i64 24}
!18 = !{!14, !6, i64 16}
!19 = !{!14, !6, i64 40}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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

@_ZTVN7qpOASES12SparseMatrixE = external dso_local unnamed_addr constant { [24 x ptr], [47 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7qpOASES6Matrix12doFreeMemoryEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7qpOASES6isZeroEdd(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7qpOASES6MatrixC2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7qpOASES12SparseMatrixC1EiiiPKd(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef readonly %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZN7qpOASES6MatrixC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6)
  store ptr getelementptr inbounds inrange(-24, 168) (i8, ptr @_ZTVN7qpOASES12SparseMatrixE, i64 24), ptr %0, align 8, !tbaa !5
  store ptr getelementptr inbounds inrange(-192, 184) (i8, ptr @_ZTVN7qpOASES12SparseMatrixE, i64 384), ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %7, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %8, align 4, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr null, ptr %9, align 8, !tbaa !14
  %10 = add nsw i32 %2, 1
  %11 = zext nneg i32 %10 to i64
  %12 = icmp slt i32 %2, -1
  %13 = shl nuw nsw i64 %11, 2
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %14) #4
          to label %16 unwind label %51

16:                                               ; preds = %5
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %15, ptr %17, align 8, !tbaa !15
  %18 = mul nsw i32 %2, %1
  %19 = sext i32 %18 to i64
  %20 = icmp slt i32 %18, 0
  %21 = shl nsw i64 %19, 2
  %22 = select i1 %20, i64 -1, i64 %21
  %23 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %22) #4
          to label %24 unwind label %51

24:                                               ; preds = %16
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %23, ptr %25, align 8, !tbaa !16
  %26 = shl nsw i64 %19, 3
  %27 = select i1 %20, i64 -1, i64 %26
  %28 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %27) #4
          to label %29 unwind label %51

29:                                               ; preds = %24
  %30 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %28, ptr %30, align 8, !tbaa !17
  %31 = icmp sgt i32 %2, 0
  br i1 %31, label %.lr.ph37.preheader, label %._crit_edge38

.lr.ph37.preheader:                               ; preds = %29
  %32 = sext i32 %3 to i64
  br label %.lr.ph37

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %._crit_edge
  %indvars.iv43 = phi i64 [ 0, %.lr.ph37.preheader ], [ %indvars.iv.next44, %._crit_edge ]
  %.03034 = phi i32 [ 0, %.lr.ph37.preheader ], [ %.1.lcssa, %._crit_edge ]
  %33 = load ptr, ptr %17, align 8, !tbaa !15
  %34 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv43
  store i32 %.03034, ptr %34, align 4, !tbaa !18
  %35 = load i32, ptr %7, align 8, !tbaa !8
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph37
  %invariant.gep = getelementptr double, ptr %4, i64 %indvars.iv43
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %53
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %53 ]
  %.132 = phi i32 [ %.03034, %.lr.ph.preheader ], [ %.2, %53 ]
  %37 = mul nsw i64 %indvars.iv, %32
  %gep = getelementptr double, ptr %invariant.gep, i64 %37
  %38 = load double, ptr %gep, align 8, !tbaa !19
  %39 = tail call noundef i32 @_ZN7qpOASES6isZeroEdd(double noundef %38, double noundef 0.000000e+00)
  %40 = icmp eq i32 %39, 0
  %41 = icmp eq i64 %indvars.iv, %indvars.iv43
  %or.cond = or i1 %41, %40
  br i1 %or.cond, label %42, label %53

42:                                               ; preds = %.lr.ph
  %43 = load ptr, ptr %25, align 8, !tbaa !16
  %44 = sext i32 %.132 to i64
  %45 = getelementptr inbounds i32, ptr %43, i64 %44
  %46 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %46, ptr %45, align 4, !tbaa !18
  %47 = load double, ptr %gep, align 8, !tbaa !19
  %48 = load ptr, ptr %30, align 8, !tbaa !17
  %49 = add nsw i32 %.132, 1
  %50 = getelementptr inbounds double, ptr %48, i64 %44
  store double %47, ptr %50, align 8, !tbaa !19
  br label %53

51:                                               ; preds = %24, %16, %5
  %52 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN7qpOASES6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6) #5
  resume { ptr, i32 } %52

53:                                               ; preds = %.lr.ph, %42
  %.2 = phi i32 [ %49, %42 ], [ %.132, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = load i32, ptr %7, align 8, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next, %55
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %53, %.lr.ph37
  %.1.lcssa = phi i32 [ %.03034, %.lr.ph37 ], [ %.2, %53 ]
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %57 = load i32, ptr %8, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next44, %58
  br i1 %59, label %.lr.ph37, label %._crit_edge38.loopexit, !llvm.loop !23

._crit_edge38.loopexit:                           ; preds = %._crit_edge
  %.pre = load ptr, ptr %17, align 8, !tbaa !15
  %.pre46 = load ptr, ptr %0, align 8, !tbaa !5
  br label %._crit_edge38

._crit_edge38:                                    ; preds = %29, %._crit_edge38.loopexit
  %60 = phi ptr [ %.pre46, %._crit_edge38.loopexit ], [ getelementptr inbounds inrange(-24, 168) (i8, ptr @_ZTVN7qpOASES12SparseMatrixE, i64 24), %29 ]
  %61 = phi ptr [ %.pre, %._crit_edge38.loopexit ], [ %15, %29 ]
  %.030.lcssa = phi i32 [ %.1.lcssa, %._crit_edge38.loopexit ], [ 0, %29 ]
  %.lcssa = phi i32 [ %57, %._crit_edge38.loopexit ], [ %2, %29 ]
  %62 = sext i32 %.lcssa to i64
  %63 = getelementptr inbounds i32, ptr %61, i64 %62
  store i32 %.030.lcssa, ptr %63, align 4, !tbaa !18
  %64 = getelementptr i8, ptr %60, i64 -24
  %65 = load i64, ptr %64, align 8
  %66 = getelementptr inbounds i8, ptr %0, i64 %65
  tail call void @_ZN7qpOASES6Matrix12doFreeMemoryEv(ptr noundef nonnull align 8 dereferenceable(12) %66)
  ret void
}

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

attributes #0 = { nobuiltin allocsize(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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { builtin allocsize(0) }
attributes #5 = { 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, !10, i64 8}
!9 = !{!"_ZTSN7qpOASES12SparseMatrixE", !10, i64 8, !10, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"any pointer", !11, i64 0}
!13 = !{!9, !10, i64 12}
!14 = !{!9, !12, i64 32}
!15 = !{!9, !12, i64 24}
!16 = !{!9, !12, i64 16}
!17 = !{!9, !12, i64 40}
!18 = !{!10, !10, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !11, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass