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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9SQProblem8hotstartEPNS_15SymmetricMatrixEPKdPNS_6MatrixES4_S4_S4_S4_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) #0 align 2 {
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store ptr %0, ptr %14, align 8, !tbaa !5
  store ptr %1, ptr %15, align 8, !tbaa !5
  store ptr %2, ptr %16, align 8, !tbaa !5
  store ptr %3, ptr %17, align 8, !tbaa !5
  store ptr %4, ptr %18, align 8, !tbaa !5
  store ptr %5, ptr %19, align 8, !tbaa !5
  store ptr %6, ptr %20, align 8, !tbaa !5
  store ptr %7, ptr %21, align 8, !tbaa !5
  store ptr %8, ptr %22, align 8, !tbaa !5
  store ptr %9, ptr %23, align 8, !tbaa !5
  store ptr %10, ptr %24, align 8, !tbaa !5
  store ptr %11, ptr %25, align 8, !tbaa !5
  %30 = load ptr, ptr %14, align 8
  %31 = call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %30)
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %39, label %33

33:                                               ; preds = %12
  %34 = call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %30)
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %30)
  %38 = icmp eq i32 %37, 3
  br i1 %38, label %39, label %42

39:                                               ; preds = %36, %33, %12
  %40 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %41 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %40, i32 noundef 54, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 110, i32 noundef 1)
  store i32 %41, ptr %13, align 4
  br label %94

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store double 0.000000e+00, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  store double 0.000000e+00, ptr %27, align 8, !tbaa !9
  %43 = load ptr, ptr %23, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = call noundef double @_ZN7qpOASES10getCPUtimeEv()
  store double %46, ptr %26, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %45, %42
  %48 = load ptr, ptr %15, align 8, !tbaa !5
  %49 = load ptr, ptr %17, align 8, !tbaa !5
  %50 = load ptr, ptr %18, align 8, !tbaa !5
  %51 = load ptr, ptr %19, align 8, !tbaa !5
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = load ptr, ptr %21, align 8, !tbaa !5
  %54 = load ptr, ptr %30, align 8, !tbaa !11
  %55 = getelementptr inbounds ptr, ptr %54, i64 37
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef i32 %56(ptr noundef nonnull align 8 dereferenceable(1064) %30, ptr noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52, ptr noundef %53)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %47
  %60 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %61 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %60, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 124, i32 noundef 1)
  store i32 %61, ptr %13, align 4
  store i32 1, ptr %28, align 4
  br label %93

62:                                               ; preds = %47
  %63 = load ptr, ptr %23, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %73

65:                                               ; preds = %62
  %66 = call noundef double @_ZN7qpOASES10getCPUtimeEv()
  %67 = load double, ptr %26, align 8, !tbaa !9
  %68 = fsub double %66, %67
  store double %68, ptr %27, align 8, !tbaa !9
  %69 = load double, ptr %27, align 8, !tbaa !9
  %70 = load ptr, ptr %23, align 8, !tbaa !5
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = fsub double %71, %69
  store double %72, ptr %70, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %65, %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load ptr, ptr %18, align 8, !tbaa !5
  %76 = load ptr, ptr %19, align 8, !tbaa !5
  %77 = load ptr, ptr %20, align 8, !tbaa !5
  %78 = load ptr, ptr %21, align 8, !tbaa !5
  %79 = load ptr, ptr %22, align 8, !tbaa !5
  %80 = load ptr, ptr %23, align 8, !tbaa !5
  %81 = load ptr, ptr %24, align 8, !tbaa !5
  %82 = load ptr, ptr %25, align 8, !tbaa !5
  %83 = call noundef i32 @_ZN7qpOASES8QProblem8hotstartEPKdS2_S2_S2_S2_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064) %30, ptr noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef %80, ptr noundef %81, ptr noundef %82)
  store i32 %83, ptr %29, align 4, !tbaa !13
  %84 = load ptr, ptr %23, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %91

86:                                               ; preds = %73
  %87 = load double, ptr %27, align 8, !tbaa !9
  %88 = load ptr, ptr %23, align 8, !tbaa !5
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = fadd double %89, %87
  store double %90, ptr %88, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %86, %73
  %92 = load i32, ptr %29, align 4, !tbaa !13
  store i32 %92, ptr %13, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  br label %93

93:                                               ; preds = %91, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %94

94:                                               ; preds = %93, %39
  %95 = load i32, ptr %13, align 4
  ret i32 %95
}

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

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() #2

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

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

declare noundef double @_ZN7qpOASES10getCPUtimeEv() #2

declare noundef i32 @_ZN7qpOASES8QProblem8hotstartEPKdS2_S2_S2_S2_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064), ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef) #2

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

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN7qpOASES11returnValueE", !7, i64 0}


; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9SQProblem8hotstartEPNS_15SymmetricMatrixEPKdPNS_6MatrixES4_S4_S4_S4_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) local_unnamed_addr #0 align 2 {
  %13 = tail call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %21, label %15

15:                                               ; preds = %12
  %16 = tail call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %21, label %18

18:                                               ; preds = %15
  %19 = tail call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %20 = icmp eq i32 %19, 3
  br i1 %20, label %21, label %24

21:                                               ; preds = %18, %15, %12
  %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 54, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 110, i32 noundef 1)
  br label %45

24:                                               ; preds = %18
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %27, label %25

25:                                               ; preds = %24
  %26 = tail call noundef double @_ZN7qpOASES10getCPUtimeEv()
  br label %27

27:                                               ; preds = %25, %24
  %.026 = phi double [ %26, %25 ], [ 0.000000e+00, %24 ]
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 296
  %30 = load ptr, ptr %29, align 8
  %31 = tail call noundef i32 %30(ptr noundef nonnull align 8 dereferenceable(1064) %0, ptr noundef %1, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %.not29 = icmp eq i32 %31, 0
  br i1 %.not29, label %35, label %32

32:                                               ; preds = %27
  %33 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %34 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %33, i32 noundef 43, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 124, i32 noundef 1)
  br label %45

35:                                               ; preds = %27
  br i1 %.not, label %.thread, label %37

.thread:                                          ; preds = %35
  %36 = tail call noundef i32 @_ZN7qpOASES8QProblem8hotstartEPKdS2_S2_S2_S2_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064) %0, ptr noundef %2, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef null, ptr noundef %10, ptr noundef %11)
  br label %45

37:                                               ; preds = %35
  %38 = tail call noundef double @_ZN7qpOASES10getCPUtimeEv()
  %39 = fsub double %38, %.026
  %40 = load double, ptr %9, align 8, !tbaa !8
  %41 = fsub double %40, %39
  store double %41, ptr %9, align 8, !tbaa !8
  %42 = tail call noundef i32 @_ZN7qpOASES8QProblem8hotstartEPKdS2_S2_S2_S2_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064) %0, ptr noundef %2, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull %9, ptr noundef %10, ptr noundef %11)
  %43 = load double, ptr %9, align 8, !tbaa !8
  %44 = fadd double %39, %43
  store double %44, ptr %9, align 8, !tbaa !8
  br label %45

45:                                               ; preds = %.thread, %32, %37, %21
  %.1 = phi i32 [ %23, %21 ], [ %34, %32 ], [ %42, %37 ], [ %36, %.thread ]
  ret i32 %.1
}

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

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() local_unnamed_addr #2

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

declare noundef double @_ZN7qpOASES10getCPUtimeEv() local_unnamed_addr #2

declare noundef i32 @_ZN7qpOASES8QProblem8hotstartEPKdS2_S2_S2_S2_RiPdPKNS_6BoundsEPKNS_11ConstraintsE(ptr noundef nonnull align 8 dereferenceable(1064), ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass