; 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

declare noundef i32 @_ZN7qpOASES6Bounds4initEi(ptr noundef nonnull align 8 dereferenceable(120), 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: mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryQPgradientEv(ptr noundef nonnull align 8 dereferenceable(800)) #4 align 2

declare noundef i32 @_ZN7qpOASES6Bounds12setupAllFreeEv(ptr noundef nonnull align 8 dereferenceable(120)) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB16setupAuxiliaryQPEPKNS_6BoundsE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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 ptr %1, ptr %5, align 8, !tbaa !5
  %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 !9
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %13 = icmp eq ptr %11, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %97

15:                                               ; preds = %2
  %16 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 12
  store i32 1, ptr %16, align 8, !tbaa !11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noundef i32 @_ZNK7qpOASES9QProblemB16shallRefactoriseEPKNS_6BoundsE(ptr noundef nonnull align 8 dereferenceable(800) %9, ptr noundef %17)
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %56

20:                                               ; preds = %15
  %21 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = call noundef i32 @_ZN7qpOASES6Bounds4initEi(ptr noundef nonnull align 8 dereferenceable(120) %21, i32 noundef %22)
  %24 = load ptr, ptr %9, align 8, !tbaa !26
  %25 = getelementptr inbounds ptr, ptr %24, i64 10
  %26 = load ptr, ptr %25, align 8
  %27 = call noundef i32 %26(ptr noundef nonnull align 8 dereferenceable(800) %9)
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %20
  %30 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %31 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %30, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3001, i32 noundef 1)
  store i32 %31, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %97

32:                                               ; preds = %20
  %33 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %34 = call noundef i32 @_ZN7qpOASES6Bounds12setupAllFreeEv(ptr noundef nonnull align 8 dereferenceable(120) %33)
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %38 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %37, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3004, i32 noundef 1)
  store i32 %38, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %97

39:                                               ; preds = %32
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryWorkingSetEPKNS_6BoundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %9, ptr noundef %40, i32 noundef 1)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %45 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %44, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3008, i32 noundef 1)
  br label %46

46:                                               ; preds = %43, %39
  %47 = load ptr, ptr %9, align 8, !tbaa !26
  %48 = getelementptr inbounds ptr, ptr %47, i64 12
  %49 = load ptr, ptr %48, align 8
  %50 = call noundef i32 %49(ptr noundef nonnull align 8 dereferenceable(800) %9)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %46
  %53 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %54 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %53, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3012, i32 noundef 1)
  store i32 %54, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %97

55:                                               ; preds = %46
  br label %64

56:                                               ; preds = %15
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryWorkingSetEPKNS_6BoundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %9, ptr noundef %57, i32 noundef 0)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %56
  %61 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %62 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %61, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3018, i32 noundef 1)
  br label %63

63:                                               ; preds = %60, %56
  br label %64

64:                                               ; preds = %63, %55
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %81, %64
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %84

69:                                               ; preds = %65
  %70 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %70, i32 noundef %71)
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %80

74:                                               ; preds = %69
  %75 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 10
  %76 = load ptr, ptr %75, align 8, !tbaa !28
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds double, ptr %76, i64 %78
  store double 0.000000e+00, ptr %79, align 8, !tbaa !29
  br label %80

80:                                               ; preds = %74, %69
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %6, align 4, !tbaa !9
  br label %65, !llvm.loop !30

84:                                               ; preds = %65
  %85 = call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryQPgradientEv(ptr noundef nonnull align 8 dereferenceable(800) %9)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %89 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %88, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3030, i32 noundef 1)
  br label %90

90:                                               ; preds = %87, %84
  %91 = call noundef i32 @_ZN7qpOASES9QProblemB22setupAuxiliaryQPboundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %9, i32 noundef 0)
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %95 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %94, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 3033, i32 noundef 1)
  br label %96

96:                                               ; preds = %93, %90
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %97

97:                                               ; preds = %96, %52, %36, %29, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %98 = load i32, ptr %3, align 4
  ret i32 %98
}

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

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

declare noundef i32 @_ZN7qpOASES6Bounds4initEi(ptr noundef nonnull align 8 dereferenceable(120), 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: mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryQPgradientEv(ptr noundef nonnull align 8 dereferenceable(800)) local_unnamed_addr #3 align 2

declare noundef i32 @_ZN7qpOASES6Bounds12setupAllFreeEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryWorkingSetEPKNS_6BoundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800), ptr noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9QProblemB22setupAuxiliaryQPboundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB16setupAuxiliaryQPEPKNS_6BoundsE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1) unnamed_addr #3 align 2 {
  %3 = tail call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = icmp eq ptr %4, %1
  br i1 %5, label %62, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 1, ptr %7, align 8, !tbaa !5
  %8 = tail call noundef i32 @_ZNK7qpOASES9QProblemB16shallRefactoriseEPKNS_6BoundsE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1)
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %10, label %37

10:                                               ; preds = %6
  %11 = tail call noundef i32 @_ZN7qpOASES6Bounds4initEi(ptr noundef nonnull align 8 dereferenceable(120) %4, i32 noundef %3)
  %12 = load ptr, ptr %0, align 8, !tbaa !24
  %13 = getelementptr inbounds i8, ptr %12, i64 80
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef i32 %14(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %.not14 = icmp eq i32 %15, 0
  br i1 %.not14, label %19, label %16

16:                                               ; preds = %10
  %17 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %18 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %17, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3001, i32 noundef 1)
  br label %62

19:                                               ; preds = %10
  %20 = tail call noundef i32 @_ZN7qpOASES6Bounds12setupAllFreeEv(ptr noundef nonnull align 8 dereferenceable(120) %4)
  %.not15 = icmp eq i32 %20, 0
  br i1 %.not15, label %24, label %21

21:                                               ; preds = %19
  %22 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %23 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %22, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3004, i32 noundef 1)
  br label %62

24:                                               ; preds = %19
  %25 = tail call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryWorkingSetEPKNS_6BoundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1, i32 noundef 1)
  %.not16 = icmp eq i32 %25, 0
  br i1 %.not16, label %29, label %26

26:                                               ; preds = %24
  %27 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %28 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %27, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3008, i32 noundef 1)
  br label %29

29:                                               ; preds = %26, %24
  %30 = load ptr, ptr %0, align 8, !tbaa !24
  %31 = getelementptr inbounds i8, ptr %30, i64 96
  %32 = load ptr, ptr %31, align 8
  %33 = tail call noundef i32 %32(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %.not17 = icmp eq i32 %33, 0
  br i1 %.not17, label %42, label %34

34:                                               ; preds = %29
  %35 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %36 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %35, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3012, i32 noundef 1)
  br label %62

37:                                               ; preds = %6
  %38 = tail call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryWorkingSetEPKNS_6BoundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1, i32 noundef 0)
  %.not = icmp eq i32 %38, 0
  br i1 %.not, label %42, label %39

39:                                               ; preds = %37
  %40 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %41 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %40, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3018, i32 noundef 1)
  br label %42

42:                                               ; preds = %37, %39, %29
  %43 = icmp sgt i32 %3, 0
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %42
  %44 = getelementptr inbounds i8, ptr %0, i64 192
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %45

45:                                               ; preds = %.lr.ph, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %46 = trunc nuw nsw i64 %indvars.iv to i32
  %47 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %4, i32 noundef %46)
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %45
  %50 = load ptr, ptr %44, align 8, !tbaa !26
  %51 = getelementptr inbounds double, ptr %50, i64 %indvars.iv
  store double 0.000000e+00, ptr %51, align 8, !tbaa !27
  br label %52

52:                                               ; preds = %45, %49
  %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 %._crit_edge, label %45, !llvm.loop !28

._crit_edge:                                      ; preds = %52, %42
  %53 = tail call noundef i32 @_ZN7qpOASES9QProblemB24setupAuxiliaryQPgradientEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %.not18 = icmp eq i32 %53, 0
  br i1 %.not18, label %57, label %54

54:                                               ; preds = %._crit_edge
  %55 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %56 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %55, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3030, i32 noundef 1)
  br label %57

57:                                               ; preds = %54, %._crit_edge
  %58 = tail call noundef i32 @_ZN7qpOASES9QProblemB22setupAuxiliaryQPboundsENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(800) %0, i32 noundef 0)
  %.not19 = icmp eq i32 %58, 0
  br i1 %.not19, label %62, label %59

59:                                               ; preds = %57
  %60 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %61 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %60, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 3033, i32 noundef 1)
  br label %62

62:                                               ; preds = %57, %59, %2, %34, %21, %16
  %.0 = phi i32 [ %18, %16 ], [ %23, %21 ], [ %36, %34 ], [ 0, %2 ], [ 0, %59 ], [ 0, %57 ]
  ret i32 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9QProblemB16shallRefactoriseEPKNS_6BoundsE(ptr noundef nonnull align 8 dereferenceable(800), ptr noundef) local_unnamed_addr #3 align 2

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, !16, i64 208}
!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 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !9, i64 0}
!26 = !{!6, !10, i64 192}
!27 = !{!15, !15, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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