; LLVM IR from Tencent-RoboticsX/jbdl :: src/jbdl/experimental/qpoases/src (QProblemB)

; 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::QProblemB" = type { ptr, i32, ptr, ptr, ptr, ptr, %"class.qpOASES::Bounds", ptr, i32, ptr, ptr, double, i32, i32, i32, i32, double, i32, ptr, double, double, i32, [4 x i8], %"class.qpOASES::Options", %"class.qpOASES::Flipper", %"struct.qpOASES::TabularOutput" }
%"class.qpOASES::Bounds" = type { %"class.qpOASES::SubjectTo", %"class.qpOASES::Indexlist", %"class.qpOASES::Indexlist" }
%"class.qpOASES::SubjectTo" = type { ptr, i32, ptr, ptr, i32, i32 }
%"class.qpOASES::Indexlist" = type <{ ptr, ptr, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.qpOASES::Options" = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, double, double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, double, double, double, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.qpOASES::Flipper" = type { i32, i32, %"class.qpOASES::Bounds", %"class.qpOASES::Constraints", ptr, ptr, ptr }
%"class.qpOASES::Constraints" = type { %"class.qpOASES::SubjectTo", %"class.qpOASES::Indexlist", %"class.qpOASES::Indexlist" }
%"struct.qpOASES::TabularOutput" = type { i32, i32, i32, i32, i32, i32, i32, i32 }

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

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7qpOASES9QProblemB10backsolveREPKdNS_11BooleanTypeES3_Pd(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) unnamed_addr #5 align 2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %19 = call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %18)
  store i32 %19, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %20 = load ptr, ptr %18, align 8, !tbaa !13
  %21 = getelementptr inbounds ptr, ptr %20, i64 7
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(800) %18)
  store i32 %23, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %29

26:                                               ; preds = %5
  %27 = load i32, ptr %15, align 4, !tbaa !11
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %15, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %26, %5
  %30 = load i32, ptr %15, align 4, !tbaa !11
  %31 = icmp sle i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %196

33:                                               ; preds = %29
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %117

36:                                               ; preds = %33
  %37 = load i32, ptr %15, align 4, !tbaa !11
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr %12, align 4, !tbaa !11
  br label %39

39:                                               ; preds = %113, %36
  %40 = load i32, ptr %12, align 4, !tbaa !11
  %41 = icmp sge i32 %40, 0
  br i1 %41, label %42, label %116

42:                                               ; preds = %39
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !15
  store double %47, ptr %16, align 8, !tbaa !15
  %48 = load i32, ptr %12, align 4, !tbaa !11
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %13, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %73, %42
  %51 = load i32, ptr %13, align 4, !tbaa !11
  %52 = load i32, ptr %15, align 4, !tbaa !11
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %76

54:                                               ; preds = %50
  %55 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = load i32, ptr %12, align 4, !tbaa !11
  %58 = load i32, ptr %14, align 4, !tbaa !11
  %59 = load i32, ptr %13, align 4, !tbaa !11
  %60 = mul nsw i32 %58, %59
  %61 = add nsw i32 %57, %60
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %56, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !15
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load i32, ptr %13, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !15
  %70 = load double, ptr %16, align 8, !tbaa !15
  %71 = fneg double %64
  %72 = call double @llvm.fmuladd.f64(double %71, double %69, double %70)
  store double %72, ptr %16, align 8, !tbaa !15
  br label %73

73:                                               ; preds = %54
  %74 = load i32, ptr %13, align 4, !tbaa !11
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %13, align 4, !tbaa !11
  br label %50, !llvm.loop !30

76:                                               ; preds = %50
  %77 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %79 = load i32, ptr %12, align 4, !tbaa !11
  %80 = load i32, ptr %14, align 4, !tbaa !11
  %81 = load i32, ptr %12, align 4, !tbaa !11
  %82 = mul nsw i32 %80, %81
  %83 = add nsw i32 %79, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %78, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !15
  %87 = call noundef double @_ZN7qpOASES6getAbsEd(double noundef %86)
  %88 = load double, ptr %16, align 8, !tbaa !15
  %89 = call noundef double @_ZN7qpOASES6getAbsEd(double noundef %88)
  %90 = fmul double 1.000000e-25, %89
  %91 = fcmp oge double %87, %90
  br i1 %91, label %92, label %109

92:                                               ; preds = %76
  %93 = load double, ptr %16, align 8, !tbaa !15
  %94 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  %96 = load i32, ptr %12, align 4, !tbaa !11
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = load i32, ptr %12, align 4, !tbaa !11
  %99 = mul nsw i32 %97, %98
  %100 = add nsw i32 %96, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds double, ptr %95, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !15
  %104 = fdiv double %93, %103
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load i32, ptr %12, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %105, i64 %107
  store double %104, ptr %108, align 8, !tbaa !15
  br label %112

109:                                              ; preds = %76
  %110 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %111 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %110, i32 noundef 1, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 1668, i32 noundef 1)
  store i32 %111, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %196

112:                                              ; preds = %92
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %12, align 4, !tbaa !11
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %12, align 4, !tbaa !11
  br label %39, !llvm.loop !32

116:                                              ; preds = %39
  br label %195

117:                                              ; preds = %33
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %118

118:                                              ; preds = %191, %117
  %119 = load i32, ptr %12, align 4, !tbaa !11
  %120 = load i32, ptr %15, align 4, !tbaa !11
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %122, label %194

122:                                              ; preds = %118
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !15
  store double %127, ptr %16, align 8, !tbaa !15
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %128

128:                                              ; preds = %151, %122
  %129 = load i32, ptr %13, align 4, !tbaa !11
  %130 = load i32, ptr %12, align 4, !tbaa !11
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %154

132:                                              ; preds = %128
  %133 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %134 = load ptr, ptr %133, align 8, !tbaa !17
  %135 = load i32, ptr %13, align 4, !tbaa !11
  %136 = load i32, ptr %14, align 4, !tbaa !11
  %137 = load i32, ptr %12, align 4, !tbaa !11
  %138 = mul nsw i32 %136, %137
  %139 = add nsw i32 %135, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %134, i64 %140
  %142 = load double, ptr %141, align 8, !tbaa !15
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = load i32, ptr %13, align 4, !tbaa !11
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %143, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !15
  %148 = load double, ptr %16, align 8, !tbaa !15
  %149 = fneg double %142
  %150 = call double @llvm.fmuladd.f64(double %149, double %147, double %148)
  store double %150, ptr %16, align 8, !tbaa !15
  br label %151

151:                                              ; preds = %132
  %152 = load i32, ptr %13, align 4, !tbaa !11
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %13, align 4, !tbaa !11
  br label %128, !llvm.loop !33

154:                                              ; preds = %128
  %155 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %156 = load ptr, ptr %155, align 8, !tbaa !17
  %157 = load i32, ptr %12, align 4, !tbaa !11
  %158 = load i32, ptr %14, align 4, !tbaa !11
  %159 = load i32, ptr %12, align 4, !tbaa !11
  %160 = mul nsw i32 %158, %159
  %161 = add nsw i32 %157, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %156, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !15
  %165 = call noundef double @_ZN7qpOASES6getAbsEd(double noundef %164)
  %166 = load double, ptr %16, align 8, !tbaa !15
  %167 = call noundef double @_ZN7qpOASES6getAbsEd(double noundef %166)
  %168 = fmul double 1.000000e-25, %167
  %169 = fcmp oge double %165, %168
  br i1 %169, label %170, label %187

170:                                              ; preds = %154
  %171 = load double, ptr %16, align 8, !tbaa !15
  %172 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %18, i32 0, i32 7
  %173 = load ptr, ptr %172, align 8, !tbaa !17
  %174 = load i32, ptr %12, align 4, !tbaa !11
  %175 = load i32, ptr %14, align 4, !tbaa !11
  %176 = load i32, ptr %12, align 4, !tbaa !11
  %177 = mul nsw i32 %175, %176
  %178 = add nsw i32 %174, %177
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds double, ptr %173, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !15
  %182 = fdiv double %171, %181
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !11
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %183, i64 %185
  store double %182, ptr %186, align 8, !tbaa !15
  br label %190

187:                                              ; preds = %154
  %188 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %189 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %188, i32 noundef 1, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 1683, i32 noundef 1)
  store i32 %189, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %196

190:                                              ; preds = %170
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %12, align 4, !tbaa !11
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %12, align 4, !tbaa !11
  br label %118, !llvm.loop !34

194:                                              ; preds = %118
  br label %195

195:                                              ; preds = %194, %116
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %196

196:                                              ; preds = %195, %187, %109, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %197 = load i32, ptr %6, align 4
  ret i32 %197
}

attributes #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 = { inlinehint 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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 }

!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 = !{!"_ZTSN7qpOASES11BooleanTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !6, i64 168}
!18 = !{!"_ZTSN7qpOASES9QProblemBE", !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !19, i64 48, !6, i64 168, !10, i64 176, !6, i64 184, !6, i64 192, !16, i64 200, !22, i64 208, !10, i64 212, !10, i64 216, !23, i64 220, !16, i64 224, !12, i64 232, !6, i64 240, !16, i64 248, !16, i64 256, !12, i64 264, !24, i64 272, !27, i64 496, !29, i64 768}
!19 = !{!"_ZTSN7qpOASES6BoundsE", !20, i64 0, !21, i64 40, !21, i64 80}
!20 = !{!"_ZTSN7qpOASES9SubjectToE", !12, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36}
!21 = !{!"_ZTSN7qpOASES9IndexlistE", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!22 = !{!"_ZTSN7qpOASES14QProblemStatusE", !7, i64 0}
!23 = !{!"_ZTSN7qpOASES11HessianTypeE", !7, i64 0}
!24 = !{!"_ZTSN7qpOASES7OptionsE", !25, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !12, i64 28, !12, i64 32, !10, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !26, i64 128, !16, i64 136, !12, i64 144, !16, i64 152, !12, i64 160, !16, i64 168, !16, i64 176, !16, i64 184, !16, i64 192, !10, i64 200, !10, i64 204, !12, i64 208, !12, i64 212, !12, i64 216}
!25 = !{!"_ZTSN7qpOASES10PrintLevelE", !7, i64 0}
!26 = !{!"_ZTSN7qpOASES15SubjectToStatusE", !7, i64 0}
!27 = !{!"_ZTSN7qpOASES7FlipperE", !12, i64 0, !12, i64 4, !19, i64 8, !28, i64 128, !6, i64 248, !6, i64 256, !6, i64 264}
!28 = !{!"_ZTSN7qpOASES11ConstraintsE", !20, i64 0, !21, i64 40, !21, i64 80}
!29 = !{!"_ZTSN7qpOASES13TabularOutputE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}


; 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 [104 x i8], align 1

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() local_unnamed_addr #0

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 #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress 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 i32 @_ZNK7qpOASES9QProblemB10backsolveREPKdNS_11BooleanTypeES3_Pd(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef %4) unnamed_addr #4 align 2 {
  %6 = tail call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 56
  %9 = load ptr, ptr %8, align 8
  %10 = tail call noundef i32 %9(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %11 = icmp eq i32 %3, 1
  %12 = sext i1 %11 to i32
  %spec.select = add nsw i32 %10, %12
  %13 = icmp slt i32 %spec.select, 1
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %5
  %15 = icmp eq i32 %2, 0
  %16 = getelementptr inbounds i8, ptr %0, i64 168
  %17 = add i32 %6, 1
  br i1 %15, label %.lr.ph75, label %.lr.ph65

.lr.ph65:                                         ; preds = %14
  %18 = sext i32 %6 to i64
  %wide.trip.count82 = zext nneg i32 %spec.select to i64
  %.pre.pre = load ptr, ptr %16, align 8, !tbaa !8
  br label %69

.lr.ph75:                                         ; preds = %14
  %19 = sext i32 %10 to i64
  %20 = sext i1 %11 to i64
  %21 = add nsw i64 %19, %20
  %22 = sext i32 %6 to i64
  %23 = zext nneg i32 %spec.select to i64
  %.pre91.pre = load ptr, ptr %16, align 8, !tbaa !8
  br label %24

24:                                               ; preds = %.lr.ph75, %62
  %indvar = phi i32 [ 0, %.lr.ph75 ], [ %indvar.next, %62 ]
  %.pre91 = phi ptr [ %.pre91.pre, %.lr.ph75 ], [ %63, %62 ]
  %indvars.iv84 = phi i64 [ %21, %.lr.ph75 ], [ %indvars.iv.next85, %62 ]
  %indvars.iv.next85 = add nsw i64 %indvars.iv84, -1
  %25 = getelementptr inbounds double, ptr %1, i64 %indvars.iv.next85
  %26 = load double, ptr %25, align 8, !tbaa !26
  %27 = icmp slt i64 %indvars.iv84, %23
  br i1 %27, label %.lr.ph69.preheader, label %._crit_edge70

.lr.ph69.preheader:                               ; preds = %24
  %xtraiter104 = and i32 %indvar, 1
  %lcmp.mod105.not = icmp eq i32 %xtraiter104, 0
  br i1 %lcmp.mod105.not, label %.lr.ph69.prol.loopexit, label %.lr.ph69.prol

.lr.ph69.prol:                                    ; preds = %.lr.ph69.preheader
  %28 = mul nsw i64 %indvars.iv84, %22
  %29 = add nsw i64 %28, %indvars.iv.next85
  %30 = getelementptr inbounds double, ptr %.pre91, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !26
  %32 = getelementptr inbounds double, ptr %4, i64 %indvars.iv84
  %33 = load double, ptr %32, align 8, !tbaa !26
  %34 = fneg double %31
  %35 = tail call double @llvm.fmuladd.f64(double %34, double %33, double %26)
  %indvars.iv.next87.prol = add nsw i64 %indvars.iv84, 1
  br label %.lr.ph69.prol.loopexit

.lr.ph69.prol.loopexit:                           ; preds = %.lr.ph69.prol, %.lr.ph69.preheader
  %.lcssa.unr = phi double [ poison, %.lr.ph69.preheader ], [ %35, %.lr.ph69.prol ]
  %indvars.iv86.unr = phi i64 [ %indvars.iv84, %.lr.ph69.preheader ], [ %indvars.iv.next87.prol, %.lr.ph69.prol ]
  %.067.unr = phi double [ %26, %.lr.ph69.preheader ], [ %35, %.lr.ph69.prol ]
  %36 = icmp eq i32 %indvar, 1
  br i1 %36, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %.lr.ph69.prol.loopexit, %.lr.ph69
  %indvars.iv86 = phi i64 [ %indvars.iv.next87.1, %.lr.ph69 ], [ %indvars.iv86.unr, %.lr.ph69.prol.loopexit ]
  %.067 = phi double [ %52, %.lr.ph69 ], [ %.067.unr, %.lr.ph69.prol.loopexit ]
  %37 = mul nsw i64 %indvars.iv86, %22
  %38 = add nsw i64 %37, %indvars.iv.next85
  %39 = getelementptr inbounds double, ptr %.pre91, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !26
  %41 = getelementptr inbounds double, ptr %4, i64 %indvars.iv86
  %42 = load double, ptr %41, align 8, !tbaa !26
  %43 = fneg double %40
  %44 = tail call double @llvm.fmuladd.f64(double %43, double %42, double %.067)
  %indvars.iv.next87 = add nsw i64 %indvars.iv86, 1
  %45 = mul nsw i64 %indvars.iv.next87, %22
  %46 = add nsw i64 %45, %indvars.iv.next85
  %47 = getelementptr inbounds double, ptr %.pre91, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !26
  %49 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next87
  %50 = load double, ptr %49, align 8, !tbaa !26
  %51 = fneg double %48
  %52 = tail call double @llvm.fmuladd.f64(double %51, double %50, double %44)
  %indvars.iv.next87.1 = add nsw i64 %indvars.iv86, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next87.1 to i32
  %exitcond89.not.1 = icmp eq i32 %spec.select, %lftr.wideiv.1
  br i1 %exitcond89.not.1, label %._crit_edge70, label %.lr.ph69, !llvm.loop !27

._crit_edge70:                                    ; preds = %.lr.ph69.prol.loopexit, %.lr.ph69, %24
  %.0.lcssa = phi double [ %26, %24 ], [ %.lcssa.unr, %.lr.ph69.prol.loopexit ], [ %52, %.lr.ph69 ]
  %53 = trunc nsw i64 %indvars.iv.next85 to i32
  %54 = mul i32 %17, %53
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds double, ptr %.pre91, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !26
  %58 = tail call noundef double @_ZN7qpOASES6getAbsEd(double noundef %57)
  %59 = tail call noundef double @_ZN7qpOASES6getAbsEd(double noundef %.0.lcssa)
  %60 = fmul double %59, 1.000000e-25
  %61 = fcmp ult double %58, %60
  br i1 %61, label %.loopexit.sink.split, label %62

62:                                               ; preds = %._crit_edge70
  %63 = load ptr, ptr %16, align 8, !tbaa !8
  %64 = getelementptr inbounds double, ptr %63, i64 %55
  %65 = load double, ptr %64, align 8, !tbaa !26
  %66 = fdiv double %.0.lcssa, %65
  %67 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next85
  store double %66, ptr %67, align 8, !tbaa !26
  %68 = icmp sgt i64 %indvars.iv84, 1
  %indvar.next = add i32 %indvar, 1
  br i1 %68, label %24, label %.loopexit, !llvm.loop !29

69:                                               ; preds = %.lr.ph65, %105
  %.pre = phi ptr [ %.pre.pre, %.lr.ph65 ], [ %106, %105 ]
  %indvars.iv79 = phi i64 [ 0, %.lr.ph65 ], [ %indvars.iv.next80, %105 ]
  %70 = getelementptr inbounds double, ptr %1, i64 %indvars.iv79
  %71 = load double, ptr %70, align 8, !tbaa !26
  %.not = icmp eq i64 %indvars.iv79, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %69
  %72 = mul nsw i64 %indvars.iv79, %18
  %xtraiter = and i64 %indvars.iv79, 1
  %73 = icmp eq i64 %indvars.iv79, 1
  br i1 %73, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %indvars.iv79, 9223372036854775806
  br label %74

74:                                               ; preds = %74, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %74 ]
  %.163 = phi double [ %71, %.lr.ph.new ], [ %88, %74 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %74 ]
  %75 = add nsw i64 %indvars.iv, %72
  %76 = getelementptr inbounds double, ptr %.pre, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !26
  %78 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  %79 = load double, ptr %78, align 8, !tbaa !26
  %80 = fneg double %77
  %81 = tail call double @llvm.fmuladd.f64(double %80, double %79, double %.163)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %82 = add nsw i64 %indvars.iv.next, %72
  %83 = getelementptr inbounds double, ptr %.pre, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !26
  %85 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next
  %86 = load double, ptr %85, align 8, !tbaa !26
  %87 = fneg double %84
  %88 = tail call double @llvm.fmuladd.f64(double %87, double %86, double %81)
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %74, !llvm.loop !30

._crit_edge.loopexit.unr-lcssa:                   ; preds = %74, %.lr.ph
  %.lcssa102.ph = phi double [ poison, %.lr.ph ], [ %88, %74 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %74 ]
  %.163.unr = phi double [ %71, %.lr.ph ], [ %88, %74 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %89 = add nsw i64 %indvars.iv.unr, %72
  %90 = getelementptr inbounds double, ptr %.pre, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !26
  %92 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.unr
  %93 = load double, ptr %92, align 8, !tbaa !26
  %94 = fneg double %91
  %95 = tail call double @llvm.fmuladd.f64(double %94, double %93, double %.163.unr)
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %69
  %.1.lcssa = phi double [ %71, %69 ], [ %.lcssa102.ph, %._crit_edge.loopexit.unr-lcssa ], [ %95, %._crit_edge.loopexit.epilog-lcssa ]
  %96 = trunc nuw nsw i64 %indvars.iv79 to i32
  %97 = mul i32 %17, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds double, ptr %.pre, i64 %98
  %100 = load double, ptr %99, align 8, !tbaa !26
  %101 = tail call noundef double @_ZN7qpOASES6getAbsEd(double noundef %100)
  %102 = tail call noundef double @_ZN7qpOASES6getAbsEd(double noundef %.1.lcssa)
  %103 = fmul double %102, 1.000000e-25
  %104 = fcmp ult double %101, %103
  br i1 %104, label %.loopexit.sink.split, label %105

105:                                              ; preds = %._crit_edge
  %106 = load ptr, ptr %16, align 8, !tbaa !8
  %107 = getelementptr inbounds double, ptr %106, i64 %98
  %108 = load double, ptr %107, align 8, !tbaa !26
  %109 = fdiv double %.1.lcssa, %108
  %110 = getelementptr inbounds double, ptr %4, i64 %indvars.iv79
  store double %109, ptr %110, align 8, !tbaa !26
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %.loopexit, label %69, !llvm.loop !31

.loopexit.sink.split:                             ; preds = %._crit_edge, %._crit_edge70
  %.sink96 = phi i64 [ 1668, %._crit_edge70 ], [ 1683, %._crit_edge ]
  %111 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %112 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %111, i32 noundef 1, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef %.sink96, i32 noundef 1)
  br label %.loopexit

.loopexit:                                        ; preds = %105, %62, %.loopexit.sink.split, %5
  %.055 = phi i32 [ 0, %5 ], [ %112, %.loopexit.sink.split ], [ 0, %62 ], [ 0, %105 ]
  ret i32 %.055
}

attributes #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 = { inlinehint 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 = { 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 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" }

!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, !12, i64 168}
!9 = !{!"_ZTSN7qpOASES9QProblemBE", !10, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !13, i64 48, !12, i64 168, !10, i64 176, !12, i64 184, !12, i64 192, !17, i64 200, !18, i64 208, !10, i64 212, !10, i64 216, !19, i64 220, !17, i64 224, !15, i64 232, !12, i64 240, !17, i64 248, !17, i64 256, !15, i64 264, !20, i64 272, !23, i64 496, !25, i64 768}
!10 = !{!"_ZTSN7qpOASES11BooleanTypeE", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"any pointer", !11, i64 0}
!13 = !{!"_ZTSN7qpOASES6BoundsE", !14, i64 0, !16, i64 40, !16, i64 80}
!14 = !{!"_ZTSN7qpOASES9SubjectToE", !15, i64 8, !12, i64 16, !12, i64 24, !10, i64 32, !10, i64 36}
!15 = !{!"int", !11, i64 0}
!16 = !{!"_ZTSN7qpOASES9IndexlistE", !12, i64 0, !12, i64 8, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32}
!17 = !{!"double", !11, i64 0}
!18 = !{!"_ZTSN7qpOASES14QProblemStatusE", !11, i64 0}
!19 = !{!"_ZTSN7qpOASES11HessianTypeE", !11, i64 0}
!20 = !{!"_ZTSN7qpOASES7OptionsE", !21, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !15, i64 28, !15, i64 32, !10, i64 36, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !17, i64 104, !17, i64 112, !17, i64 120, !22, i64 128, !17, i64 136, !15, i64 144, !17, i64 152, !15, i64 160, !17, i64 168, !17, i64 176, !17, i64 184, !17, i64 192, !10, i64 200, !10, i64 204, !15, i64 208, !15, i64 212, !15, i64 216}
!21 = !{!"_ZTSN7qpOASES10PrintLevelE", !11, i64 0}
!22 = !{!"_ZTSN7qpOASES15SubjectToStatusE", !11, i64 0}
!23 = !{!"_ZTSN7qpOASES7FlipperE", !15, i64 0, !15, i64 4, !13, i64 8, !24, i64 128, !12, i64 248, !12, i64 256, !12, i64 264}
!24 = !{!"_ZTSN7qpOASES11ConstraintsE", !14, i64 0, !16, i64 40, !16, i64 80}
!25 = !{!"_ZTSN7qpOASES13TabularOutputE", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28}
!26 = !{!17, !17, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}
!31 = distinct !{!31, !28}


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