; 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 i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB22setupAuxiliaryQPboundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %0, i32 noundef %1) #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %10 = call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %9)
  store i32 %10, ptr %7, align 4, !tbaa !11
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %11

11:                                               ; preds = %186, %2
  %12 = load i32, ptr %6, align 4, !tbaa !11
  %13 = load i32, ptr %7, align 4, !tbaa !11
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %15, label %189

15:                                               ; preds = %11
  %16 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %17 = load i32, ptr %6, align 4, !tbaa !11
  %18 = call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %16, i32 noundef %17)
  switch i32 %18, label %182 [
    i32 0, label %19
    i32 -1, label %83
    i32 1, label %132
    i32 2, label %181
    i32 3, label %181
  ]

19:                                               ; preds = %15
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %82

22:                                               ; preds = %19
  %23 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %24 = load i32, ptr %6, align 4, !tbaa !11
  %25 = call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %23, i32 noundef %24)
  %26 = icmp eq i32 %25, 2
  br i1 %26, label %27, label %50

27:                                               ; preds = %22
  %28 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = load i32, ptr %6, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds double, ptr %29, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !27
  %34 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !28
  %36 = load i32, ptr %6, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds double, ptr %35, i64 %37
  store double %33, ptr %38, align 8, !tbaa !27
  %39 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = load i32, ptr %6, align 4, !tbaa !11
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %40, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !27
  %45 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %46 = load ptr, ptr %45, align 8, !tbaa !29
  %47 = load i32, ptr %6, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds double, ptr %46, i64 %48
  store double %44, ptr %49, align 8, !tbaa !27
  br label %81

50:                                               ; preds = %22
  %51 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = load i32, ptr %6, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !27
  %57 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %58 = getelementptr inbounds %"class.qpOASES::Options", ptr %57, i32 0, i32 12
  %59 = load double, ptr %58, align 8, !tbaa !30
  %60 = fsub double %56, %59
  %61 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %63 = load i32, ptr %6, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  store double %60, ptr %65, align 8, !tbaa !27
  %66 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = load i32, ptr %6, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !27
  %72 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %73 = getelementptr inbounds %"class.qpOASES::Options", ptr %72, i32 0, i32 12
  %74 = load double, ptr %73, align 8, !tbaa !30
  %75 = fadd double %71, %74
  %76 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %77 = load ptr, ptr %76, align 8, !tbaa !29
  %78 = load i32, ptr %6, align 4, !tbaa !11
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  store double %75, ptr %80, align 8, !tbaa !27
  br label %81

81:                                               ; preds = %50, %27
  br label %82

82:                                               ; preds = %81, %19
  br label %185

83:                                               ; preds = %15
  %84 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %85 = load ptr, ptr %84, align 8, !tbaa !13
  %86 = load i32, ptr %6, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !27
  %90 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !28
  %92 = load i32, ptr %6, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %91, i64 %93
  store double %89, ptr %94, align 8, !tbaa !27
  %95 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %96 = load i32, ptr %6, align 4, !tbaa !11
  %97 = call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %95, i32 noundef %96)
  %98 = icmp eq i32 %97, 2
  br i1 %98, label %99, label %111

99:                                               ; preds = %83
  %100 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %101 = load ptr, ptr %100, align 8, !tbaa !13
  %102 = load i32, ptr %6, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %101, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !27
  %106 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %107 = load ptr, ptr %106, align 8, !tbaa !29
  %108 = load i32, ptr %6, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %107, i64 %109
  store double %105, ptr %110, align 8, !tbaa !27
  br label %131

111:                                              ; preds = %83
  %112 = load i32, ptr %5, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %130

114:                                              ; preds = %111
  %115 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %116 = load ptr, ptr %115, align 8, !tbaa !13
  %117 = load i32, ptr %6, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds double, ptr %116, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !27
  %121 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %122 = getelementptr inbounds %"class.qpOASES::Options", ptr %121, i32 0, i32 12
  %123 = load double, ptr %122, align 8, !tbaa !30
  %124 = fadd double %120, %123
  %125 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  %127 = load i32, ptr %6, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  store double %124, ptr %129, align 8, !tbaa !27
  br label %130

130:                                              ; preds = %114, %111
  br label %131

131:                                              ; preds = %130, %99
  br label %185

132:                                              ; preds = %15
  %133 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %134 = load ptr, ptr %133, align 8, !tbaa !13
  %135 = load i32, ptr %6, align 4, !tbaa !11
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %134, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !27
  %139 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %140 = load ptr, ptr %139, align 8, !tbaa !29
  %141 = load i32, ptr %6, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %140, i64 %142
  store double %138, ptr %143, align 8, !tbaa !27
  %144 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %145 = load i32, ptr %6, align 4, !tbaa !11
  %146 = call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %144, i32 noundef %145)
  %147 = icmp eq i32 %146, 2
  br i1 %147, label %148, label %160

148:                                              ; preds = %132
  %149 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %150 = load ptr, ptr %149, align 8, !tbaa !13
  %151 = load i32, ptr %6, align 4, !tbaa !11
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %150, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !27
  %155 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %156 = load ptr, ptr %155, align 8, !tbaa !28
  %157 = load i32, ptr %6, align 4, !tbaa !11
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds double, ptr %156, i64 %158
  store double %154, ptr %159, align 8, !tbaa !27
  br label %180

160:                                              ; preds = %132
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = icmp eq i32 %161, 1
  br i1 %162, label %163, label %179

163:                                              ; preds = %160
  %164 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 9
  %165 = load ptr, ptr %164, align 8, !tbaa !13
  %166 = load i32, ptr %6, align 4, !tbaa !11
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %165, i64 %167
  %169 = load double, ptr %168, align 8, !tbaa !27
  %170 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %171 = getelementptr inbounds %"class.qpOASES::Options", ptr %170, i32 0, i32 12
  %172 = load double, ptr %171, align 8, !tbaa !30
  %173 = fsub double %169, %172
  %174 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !28
  %176 = load i32, ptr %6, align 4, !tbaa !11
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds double, ptr %175, i64 %177
  store double %173, ptr %178, align 8, !tbaa !27
  br label %179

179:                                              ; preds = %163, %160
  br label %180

180:                                              ; preds = %179, %148
  br label %185

181:                                              ; preds = %15, %15
  br label %185

182:                                              ; preds = %15
  %183 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %184 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %183, i32 noundef 9, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 2969, i32 noundef 1)
  store i32 %184, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %190

185:                                              ; preds = %181, %180, %131, %82
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %6, align 4, !tbaa !11
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %6, align 4, !tbaa !11
  br label %11, !llvm.loop !31

189:                                              ; preds = %11
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %190

190:                                              ; preds = %189, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %191 = load i32, ptr %3, align 4
  ret i32 %191
}

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


; 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 i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB22setupAuxiliaryQPboundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = tail call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = getelementptr inbounds i8, ptr %0, i64 184
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = icmp eq i32 %1, 1
  %9 = getelementptr inbounds i8, ptr %0, i64 328
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %11

11:                                               ; preds = %.lr.ph, %75
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %75 ]
  %12 = trunc nuw nsw i64 %indvars.iv to i32
  %13 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %12)
  switch i32 %13, label %70 [
    i32 0, label %14
    i32 -1, label %32
    i32 1, label %51
    i32 2, label %75
    i32 3, label %75
  ]

14:                                               ; preds = %11
  br i1 %8, label %15, label %75

15:                                               ; preds = %14
  %16 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %12)
  %17 = icmp eq i32 %16, 2
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds double, ptr %18, i64 %indvars.iv
  %20 = load double, ptr %19, align 8, !tbaa !24
  br i1 %17, label %21, label %24

21:                                               ; preds = %15
  %22 = load ptr, ptr %10, align 8, !tbaa !25
  %23 = getelementptr inbounds double, ptr %22, i64 %indvars.iv
  store double %20, ptr %23, align 8, !tbaa !24
  br label %.sink.split

24:                                               ; preds = %15
  %25 = load double, ptr %9, align 8, !tbaa !26
  %26 = fsub double %20, %25
  %27 = load ptr, ptr %10, align 8, !tbaa !25
  %28 = getelementptr inbounds double, ptr %27, i64 %indvars.iv
  store double %26, ptr %28, align 8, !tbaa !24
  %29 = load double, ptr %19, align 8, !tbaa !24
  %30 = load double, ptr %9, align 8, !tbaa !26
  %31 = fadd double %29, %30
  br label %.sink.split

32:                                               ; preds = %11
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %33, i64 %indvars.iv
  %35 = load double, ptr %34, align 8, !tbaa !24
  %36 = load ptr, ptr %10, align 8, !tbaa !25
  %37 = getelementptr inbounds double, ptr %36, i64 %indvars.iv
  store double %35, ptr %37, align 8, !tbaa !24
  %38 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %12)
  %39 = icmp eq i32 %38, 2
  br i1 %39, label %40, label %44

40:                                               ; preds = %32
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 %indvars.iv
  %43 = load double, ptr %42, align 8, !tbaa !24
  br label %.sink.split

44:                                               ; preds = %32
  br i1 %8, label %45, label %75

45:                                               ; preds = %44
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv
  %48 = load double, ptr %47, align 8, !tbaa !24
  %49 = load double, ptr %9, align 8, !tbaa !26
  %50 = fadd double %48, %49
  br label %.sink.split

51:                                               ; preds = %11
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds double, ptr %52, i64 %indvars.iv
  %54 = load double, ptr %53, align 8, !tbaa !24
  %55 = load ptr, ptr %7, align 8, !tbaa !27
  %56 = getelementptr inbounds double, ptr %55, i64 %indvars.iv
  store double %54, ptr %56, align 8, !tbaa !24
  %57 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %12)
  %58 = icmp eq i32 %57, 2
  br i1 %58, label %59, label %63

59:                                               ; preds = %51
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds double, ptr %60, i64 %indvars.iv
  %62 = load double, ptr %61, align 8, !tbaa !24
  br label %.sink.split

63:                                               ; preds = %51
  br i1 %8, label %64, label %75

64:                                               ; preds = %63
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv
  %67 = load double, ptr %66, align 8, !tbaa !24
  %68 = load double, ptr %9, align 8, !tbaa !26
  %69 = fsub double %67, %68
  br label %.sink.split

70:                                               ; preds = %11
  %71 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %72 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %71, i32 noundef 9, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 2969, i32 noundef 1)
  br label %.loopexit

.sink.split:                                      ; preds = %59, %64, %40, %45, %24, %21
  %.sink36 = phi ptr [ %7, %21 ], [ %7, %24 ], [ %7, %45 ], [ %7, %40 ], [ %10, %64 ], [ %10, %59 ]
  %.sink = phi double [ %20, %21 ], [ %31, %24 ], [ %50, %45 ], [ %43, %40 ], [ %69, %64 ], [ %62, %59 ]
  %73 = load ptr, ptr %.sink36, align 8, !tbaa !28
  %74 = getelementptr inbounds double, ptr %73, i64 %indvars.iv
  store double %.sink, ptr %74, align 8, !tbaa !24
  br label %75

75:                                               ; preds = %.sink.split, %14, %44, %63, %11, %11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %11, !llvm.loop !29

.loopexit:                                        ; preds = %75, %2, %70
  %.0 = phi i32 [ %72, %70 ], [ 0, %2 ], [ 0, %75 ]
  ret i32 %.0
}

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


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