; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800)) #0 align 2

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() #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) #1

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

declare noundef double @_ZN7qpOASES10getCPUtimeEv() #1

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) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9SQProblem8hotstartEPKdS2_S2_S2_S2_S2_S2_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) #3 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 i32, align 4
  %28 = 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
  %29 = load ptr, ptr %14, align 8
  %30 = call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %29)
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %38, label %32

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

35:                                               ; preds = %32
  %36 = call noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800) %29)
  %37 = icmp eq i32 %36, 3
  br i1 %37, label %38, label %41

38:                                               ; preds = %35, %32, %12
  %39 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %40 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %39, i32 noundef 54, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 164, i32 noundef 1)
  store i32 %40, ptr %13, align 4
  br label %92

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

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

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

58:                                               ; preds = %46
  %59 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %60 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %59, i32 noundef 43, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 176, i32 noundef 1)
  store i32 %60, ptr %13, align 4
  store i32 1, ptr %27, align 4
  br label %91

61:                                               ; preds = %46
  %62 = load ptr, ptr %23, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %71

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

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

84:                                               ; preds = %71
  %85 = call noundef double @_ZN7qpOASES10getCPUtimeEv()
  %86 = load double, ptr %26, align 8, !tbaa !9
  %87 = fsub double %85, %86
  %88 = load ptr, ptr %23, align 8, !tbaa !5
  store double %87, ptr %88, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %84, %71
  %90 = load i32, ptr %28, align 4, !tbaa !13
  store i32 %90, ptr %13, align 4
  store i32 1, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  br label %91

91:                                               ; preds = %89, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %92

92:                                               ; preds = %91, %38
  %93 = load i32, ptr %13, align 4
  ret i32 %93
}

attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7qpOASES9QProblemB9getStatusEv(ptr noundef nonnull align 8 dereferenceable(800)) local_unnamed_addr #0 align 2

declare noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv() local_unnamed_addr #1

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

declare noundef double @_ZN7qpOASES10getCPUtimeEv() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9SQProblem8hotstartEPKdS2_S2_S2_S2_S2_S2_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 #2 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 164, 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
  %.024 = phi double [ %26, %25 ], [ 0.000000e+00, %24 ]
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 304
  %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)
  %.not27 = icmp eq i32 %31, 0
  br i1 %.not27, 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 176, 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, %.024
  %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 = tail call noundef double @_ZN7qpOASES10getCPUtimeEv()
  %44 = fsub double %43, %.024
  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
}

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


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