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

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

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7qpOASES6getAbsEd(double noundef) #1

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() #2

declare noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK7qpOASES12SparseMatrix10getRowNormEii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #4 align 2 {
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store double 0.000000e+00, ptr %10, align 8, !tbaa !11
  %13 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %13, label %166 [
    i32 2, label %14
    i32 1, label %93
  ]

14:                                               ; preds = %3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %87, %14
  %16 = load i32, ptr %9, align 4, !tbaa !9
  %17 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %20, label %90

20:                                               ; preds = %15
  %21 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr %22, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %8, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %49, %20
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr %30, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp slt i32 %28, %35
  br i1 %36, label %37, label %46

37:                                               ; preds = %27
  %38 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = icmp slt i32 %43, %44
  br label %46

46:                                               ; preds = %37, %27
  %47 = phi i1 [ false, %27 ], [ %45, %37 ]
  br i1 %47, label %48, label %52

48:                                               ; preds = %46
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %8, align 4, !tbaa !9
  br label %27, !llvm.loop !17

52:                                               ; preds = %46
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %55, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = icmp slt i32 %53, %60
  br i1 %61, label %62, label %86

62:                                               ; preds = %52
  %63 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %86

71:                                               ; preds = %62
  %72 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 6
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds double, ptr %73, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 6
  %79 = load ptr, ptr %78, align 8, !tbaa !19
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = load double, ptr %10, align 8, !tbaa !11
  %85 = call double @llvm.fmuladd.f64(double %77, double %83, double %84)
  store double %85, ptr %10, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %71, %62, %52
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !9
  br label %15, !llvm.loop !20

90:                                               ; preds = %15
  %91 = load double, ptr %10, align 8, !tbaa !11
  %92 = call noundef double @_ZN7qpOASES7getSqrtEd(double noundef %91)
  store double %92, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %169

93:                                               ; preds = %3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %161, %93
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 2
  %97 = load i32, ptr %96, align 4, !tbaa !13
  %98 = icmp slt i32 %95, %97
  br i1 %98, label %99, label %164

99:                                               ; preds = %94
  %100 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  store i32 %105, ptr %8, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %128, %99
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !15
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %109, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = icmp slt i32 %107, %114
  br i1 %115, label %116, label %125

116:                                              ; preds = %106
  %117 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 3
  %118 = load ptr, ptr %117, align 8, !tbaa !16
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = load i32, ptr %6, align 4, !tbaa !9
  %124 = icmp slt i32 %122, %123
  br label %125

125:                                              ; preds = %116, %106
  %126 = phi i1 [ false, %106 ], [ %124, %116 ]
  br i1 %126, label %127, label %131

127:                                              ; preds = %125
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %8, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !9
  br label %106, !llvm.loop !21

131:                                              ; preds = %125
  %132 = load i32, ptr %8, align 4, !tbaa !9
  %133 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !15
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %134, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = icmp slt i32 %132, %139
  br i1 %140, label %141, label %160

141:                                              ; preds = %131
  %142 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !16
  %144 = load i32, ptr %8, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds i32, ptr %143, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = load i32, ptr %6, align 4, !tbaa !9
  %149 = icmp eq i32 %147, %148
  br i1 %149, label %150, label %160

150:                                              ; preds = %141
  %151 = getelementptr inbounds %"class.qpOASES::SparseMatrix", ptr %12, i32 0, i32 6
  %152 = load ptr, ptr %151, align 8, !tbaa !19
  %153 = load i32, ptr %8, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds double, ptr %152, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = call noundef double @_ZN7qpOASES6getAbsEd(double noundef %156)
  %158 = load double, ptr %10, align 8, !tbaa !11
  %159 = fadd double %158, %157
  store double %159, ptr %10, align 8, !tbaa !11
  br label %160

160:                                              ; preds = %150, %141, %131
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %9, align 4, !tbaa !9
  br label %94, !llvm.loop !22

164:                                              ; preds = %94
  %165 = load double, ptr %10, align 8, !tbaa !11
  store double %165, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %169

166:                                              ; preds = %3
  %167 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %168 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %167, i32 noundef 3, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 831, i32 noundef 1)
  store double -1.000000e+20, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %169

169:                                              ; preds = %166, %164, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %170 = load double, ptr %4, align 8
  ret double %170
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7qpOASES7getSqrtEd(double noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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 = !{!"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 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 12}
!14 = !{!"_ZTSN7qpOASES12SparseMatrixE", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!14, !6, i64 24}
!16 = !{!14, !6, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!14, !6, i64 40}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7qpOASES6getAbsEd(double noundef) local_unnamed_addr #0

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() local_unnamed_addr #1

declare noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK7qpOASES12SparseMatrix10getRowNormEii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(48) %0, i32 noundef %1, i32 noundef %2) unnamed_addr #3 align 2 {
  switch i32 %2, label %68 [
    i32 2, label %.preheader
    i32 1, label %.preheader40
  ]

.preheader40:                                     ; preds = %3
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %.preheader40
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  br label %39

.preheader:                                       ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph55, label %._crit_edge

.lr.ph55:                                         ; preds = %.preheader
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load ptr, ptr %17, align 8
  %wide.trip.count = zext nneg i32 %11 to i64
  %.pre72 = load i32, ptr %14, align 4, !tbaa !12
  br label %19

19:                                               ; preds = %.lr.ph55, %.critedge
  %20 = phi i32 [ %.pre72, %.lr.ph55 ], [ %22, %.critedge ]
  %indvars.iv68 = phi i64 [ 0, %.lr.ph55 ], [ %indvars.iv.next69, %.critedge ]
  %.054 = phi double [ 0.000000e+00, %.lr.ph55 ], [ %.1, %.critedge ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %21 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next69
  %22 = load i32, ptr %21, align 4, !tbaa !12
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %.lr.ph51.preheader, label %.critedge

.lr.ph51.preheader:                               ; preds = %19
  %24 = sext i32 %20 to i64
  br label %.lr.ph51

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %28
  %indvars.iv63 = phi i64 [ %24, %.lr.ph51.preheader ], [ %indvars.iv.next64, %28 ]
  %25 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv63
  %26 = load i32, ptr %25, align 4, !tbaa !12
  %27 = icmp slt i32 %26, %1
  br i1 %27, label %28, label %29

28:                                               ; preds = %.lr.ph51
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, 1
  %lftr.wideiv66 = trunc i64 %indvars.iv.next64 to i32
  %exitcond67.not = icmp eq i32 %22, %lftr.wideiv66
  br i1 %exitcond67.not, label %.critedge, label %.lr.ph51, !llvm.loop !13

29:                                               ; preds = %.lr.ph51
  %sext73 = shl i64 %indvars.iv63, 32
  %30 = ashr exact i64 %sext73, 32
  %31 = getelementptr inbounds i32, ptr %16, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !12
  %33 = icmp eq i32 %32, %1
  br i1 %33, label %34, label %.critedge

34:                                               ; preds = %29
  %35 = getelementptr inbounds double, ptr %18, i64 %30
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = tail call double @llvm.fmuladd.f64(double %36, double %36, double %.054)
  br label %.critedge

.critedge:                                        ; preds = %28, %19, %29, %34
  %.1 = phi double [ %37, %34 ], [ %.054, %29 ], [ %.054, %19 ], [ %.054, %28 ]
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
  br i1 %exitcond71.not, label %._crit_edge, label %19, !llvm.loop !17

._crit_edge:                                      ; preds = %.critedge, %.preheader
  %.0.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %.1, %.critedge ]
  %38 = tail call noundef double @_ZN7qpOASES7getSqrtEd(double noundef %.0.lcssa)
  br label %.loopexit

39:                                               ; preds = %.lr.ph49, %.critedge2
  %40 = phi i32 [ %5, %.lr.ph49 ], [ %65, %.critedge2 ]
  %indvars.iv60 = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next61, %.critedge2 ]
  %.248 = phi double [ 0.000000e+00, %.lr.ph49 ], [ %.3, %.critedge2 ]
  %41 = load ptr, ptr %7, align 8, !tbaa !11
  %42 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv60
  %43 = load i32, ptr %42, align 4, !tbaa !12
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %44 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv.next61
  %45 = load i32, ptr %44, align 4, !tbaa !12
  %46 = icmp slt i32 %43, %45
  br i1 %46, label %.lr.ph, label %.critedge2

.lr.ph:                                           ; preds = %39
  %47 = load ptr, ptr %8, align 8, !tbaa !18
  %48 = sext i32 %43 to i64
  br label %49

49:                                               ; preds = %.lr.ph, %53
  %indvars.iv = phi i64 [ %48, %.lr.ph ], [ %indvars.iv.next, %53 ]
  %50 = getelementptr inbounds i32, ptr %47, i64 %indvars.iv
  %51 = load i32, ptr %50, align 4, !tbaa !12
  %52 = icmp slt i32 %51, %1
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %45, %lftr.wideiv
  br i1 %exitcond.not, label %.critedge2, label %49, !llvm.loop !19

54:                                               ; preds = %49
  %sext = shl i64 %indvars.iv, 32
  %55 = ashr exact i64 %sext, 32
  %56 = getelementptr inbounds i32, ptr %47, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !12
  %58 = icmp eq i32 %57, %1
  br i1 %58, label %59, label %.critedge2

59:                                               ; preds = %54
  %60 = load ptr, ptr %9, align 8, !tbaa !20
  %61 = getelementptr inbounds double, ptr %60, i64 %55
  %62 = load double, ptr %61, align 8, !tbaa !15
  %63 = tail call noundef double @_ZN7qpOASES6getAbsEd(double noundef %62)
  %64 = fadd double %.248, %63
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %.critedge2

.critedge2:                                       ; preds = %53, %39, %54, %59
  %65 = phi i32 [ %.pre, %59 ], [ %40, %54 ], [ %40, %39 ], [ %40, %53 ]
  %.3 = phi double [ %64, %59 ], [ %.248, %54 ], [ %.248, %39 ], [ %.248, %53 ]
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next61, %66
  br i1 %67, label %39, label %.loopexit, !llvm.loop !21

68:                                               ; preds = %3
  %69 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %70 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %69, i32 noundef 3, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 831, i32 noundef 1)
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge2, %.preheader40, %68, %._crit_edge
  %.039 = phi double [ -1.000000e+20, %68 ], [ %38, %._crit_edge ], [ 0.000000e+00, %.preheader40 ], [ %.3, %.critedge2 ]
  ret double %.039
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7qpOASES7getSqrtEd(double noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { "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 speculatable willreturn memory(none) }
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" }

!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, !7, i64 12}
!6 = !{!"_ZTSN7qpOASES12SparseMatrixE", !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 24}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!6, !10, i64 16}
!19 = distinct !{!19, !14}
!20 = !{!6, !10, i64 40}
!21 = distinct !{!21, !14}


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