; LLVM IR from Tencent-RoboticsX/jbdl :: src/jbdl/experimental/qpoases/src/Bounds.ll (ZN7qpOASES6Bounds5shiftEi)

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0

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: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES6Bounds5shiftEi(ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %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 %"class.qpOASES::Indexlist", align 8
  %9 = alloca %"class.qpOASES::Indexlist", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %19, label %15

15:                                               ; preds = %2
  %16 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp sle i32 %17, 1
  br i1 %18, label %19, label %20

19:                                               ; preds = %15, %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %139

20:                                               ; preds = %15
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %29, label %23

23:                                               ; preds = %20
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = sdiv i32 %26, 2
  %28 = icmp sgt i32 %24, %27
  br i1 %28, label %29, label %32

29:                                               ; preds = %23, %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 2, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 273, i32 noundef 1)
  store i32 %31, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %139

32:                                               ; preds = %23
  %33 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %34 = load i32, ptr %33, align 8, !tbaa !11
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = srem i32 %34, %35
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %32
  %39 = call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %40 = call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %39, i32 noundef 3, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 276, i32 noundef 1)
  store i32 %40, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %139

41:                                               ; preds = %32
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %62, %41
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !11
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = sub nsw i32 %45, %46
  %48 = icmp slt i32 %43, %47
  br i1 %48, label %49, label %65

49:                                               ; preds = %42
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = add nsw i32 %51, %52
  %54 = call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef %53)
  %55 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef %50, i32 noundef %54)
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef %59)
  %61 = call noundef i32 @_ZN7qpOASES9SubjectTo9setStatusEiNS_15SubjectToStatusE(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef %56, i32 noundef %60)
  br label %62

62:                                               ; preds = %49
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %6, align 4, !tbaa !9
  br label %42, !llvm.loop !14

65:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #6
  %66 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !11
  call void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36) %8, i32 noundef %67)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #6
  %68 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %69 = load i32, ptr %68, align 8, !tbaa !11
  invoke void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %69)
          to label %70 unwind label %80

70:                                               ; preds = %65
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %127, %70
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = getelementptr inbounds %"class.qpOASES::SubjectTo", ptr %12, i32 0, i32 1
  %74 = load i32, ptr %73, align 8, !tbaa !11
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %76, label %130

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = invoke noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef %77)
          to label %79 unwind label %84

79:                                               ; preds = %76
  switch i32 %78, label %121 [
    i32 0, label %88
    i32 -1, label %99
    i32 1, label %110
  ]

80:                                               ; preds = %65
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %10, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %11, align 4
  br label %138

84:                                               ; preds = %133, %130, %123, %121, %117, %115, %110, %106, %104, %99, %95, %93, %88, %76
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #6
  br label %138

88:                                               ; preds = %79
  %89 = load i32, ptr %6, align 4, !tbaa !9
  %90 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %8, i32 noundef %89)
          to label %91 unwind label %84

91:                                               ; preds = %88
  %92 = icmp ne i32 %90, 0
  br i1 %92, label %93, label %98

93:                                               ; preds = %91
  %94 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %95 unwind label %84

95:                                               ; preds = %93
  %96 = invoke noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %94, i32 noundef 27, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 296, i32 noundef 1)
          to label %97 unwind label %84

97:                                               ; preds = %95
  store i32 %96, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

98:                                               ; preds = %91
  br label %126

99:                                               ; preds = %79
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %100)
          to label %102 unwind label %84

102:                                              ; preds = %99
  %103 = icmp ne i32 %101, 0
  br i1 %103, label %104, label %109

104:                                              ; preds = %102
  %105 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %106 unwind label %84

106:                                              ; preds = %104
  %107 = invoke noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %105, i32 noundef 27, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 301, i32 noundef 1)
          to label %108 unwind label %84

108:                                              ; preds = %106
  store i32 %107, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

109:                                              ; preds = %102
  br label %126

110:                                              ; preds = %79
  %111 = load i32, ptr %6, align 4, !tbaa !9
  %112 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %111)
          to label %113 unwind label %84

113:                                              ; preds = %110
  %114 = icmp ne i32 %112, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %113
  %116 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %117 unwind label %84

117:                                              ; preds = %115
  %118 = invoke noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %116, i32 noundef 27, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 306, i32 noundef 1)
          to label %119 unwind label %84

119:                                              ; preds = %117
  store i32 %118, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

120:                                              ; preds = %113
  br label %126

121:                                              ; preds = %79
  %122 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %123 unwind label %84

123:                                              ; preds = %121
  %124 = invoke noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %122, i32 noundef 27, ptr noundef null, ptr noundef @.str, ptr noundef @.str.1, i64 noundef 310, i32 noundef 1)
          to label %125 unwind label %84

125:                                              ; preds = %123
  store i32 %124, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

126:                                              ; preds = %120, %109, %98
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %6, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %6, align 4, !tbaa !9
  br label %71, !llvm.loop !16

130:                                              ; preds = %71
  %131 = getelementptr inbounds %"class.qpOASES::Bounds", ptr %12, i32 0, i32 1
  %132 = invoke noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %131, ptr noundef nonnull align 8 dereferenceable(36) %8)
          to label %133 unwind label %84

133:                                              ; preds = %130
  %134 = getelementptr inbounds %"class.qpOASES::Bounds", ptr %12, i32 0, i32 2
  %135 = invoke noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %134, ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %136 unwind label %84

136:                                              ; preds = %133
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

137:                                              ; preds = %136, %125, %119, %108, %97
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  br label %139

138:                                              ; preds = %84, %80
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %141

139:                                              ; preds = %137, %38, %29, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %140 = load i32, ptr %3, align 4
  ret i32 %140

141:                                              ; preds = %138
  %142 = load ptr, ptr %10, align 8
  %143 = load i32, ptr %11, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

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

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

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

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

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

declare void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) unnamed_addr #1

declare noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) #1

declare noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) #1

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

attributes #0 = { nounwind "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" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN7qpOASES9SubjectToE", !10, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36}
!13 = !{!"_ZTSN7qpOASES11BooleanTypeE", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

%"class.qpOASES::Indexlist" = type <{ ptr, ptr, i32, i32, i32, i32, i32, [4 x i8] }>

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES6Bounds5shiftEi(ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.qpOASES::Indexlist", align 8
  %4 = alloca %"class.qpOASES::Indexlist", align 8
  %5 = icmp eq i32 %1, 0
  br i1 %5, label %68, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp slt i32 %8, 2
  br i1 %9, label %68, label %10

10:                                               ; preds = %6
  %11 = lshr i32 %8, 1
  %or.cond = icmp ult i32 %11, %1
  br i1 %or.cond, label %12, label %15

12:                                               ; preds = %10
  %13 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %14 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %13, i32 noundef 2, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 273, i32 noundef 1)
  br label %68

15:                                               ; preds = %10
  %16 = urem i32 %8, %1
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %.preheader33, label %18

.preheader33:                                     ; preds = %15
  %17 = icmp ugt i32 %8, %1
  br i1 %17, label %.lr.ph, label %._crit_edge

18:                                               ; preds = %15
  %19 = tail call noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
  %20 = tail call noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %19, i32 noundef 3, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 276, i32 noundef 1)
  br label %68

.lr.ph:                                           ; preds = %.preheader33, %.lr.ph
  %.02334 = phi i32 [ %26, %.lr.ph ], [ 0, %.preheader33 ]
  %21 = add nuw nsw i32 %.02334, %1
  %22 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo7getTypeEi(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %21)
  %23 = tail call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %.02334, i32 noundef %22)
  %24 = tail call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %21)
  %25 = tail call noundef i32 @_ZN7qpOASES9SubjectTo9setStatusEiNS_15SubjectToStatusE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %.02334, i32 noundef %24)
  %26 = add nuw nsw i32 %.02334, 1
  %27 = load i32, ptr %7, align 8, !tbaa !5
  %28 = sub nsw i32 %27, %1
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %.preheader33
  %.lcssa = phi i32 [ %8, %.preheader33 ], [ %27, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #6
  call void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36) %3, i32 noundef %.lcssa)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  %30 = load i32, ptr %7, align 8, !tbaa !5
  invoke void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef %30)
          to label %.preheader unwind label %34

.preheader:                                       ; preds = %._crit_edge
  %31 = load i32, ptr %7, align 8, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph36, label %._crit_edge37

.lr.ph36:                                         ; preds = %.preheader, %57
  %.135 = phi i32 [ %58, %57 ], [ 0, %.preheader ]
  %33 = call noundef i32 @_ZNK7qpOASES9SubjectTo9getStatusEi(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %.135)
  switch i32 %33, label %55 [
    i32 0, label %37
    i32 -1, label %45
    i32 1, label %50
  ]

34:                                               ; preds = %._crit_edge
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %67

.loopexit:                                        ; preds = %37, %45, %50
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %36

.loopexit.split-lp:                               ; preds = %.invoke, %40, %48, %53, %55, %._crit_edge37, %63
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %36

36:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #6
  br label %67

37:                                               ; preds = %.lr.ph36
  %38 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %3, i32 noundef %.135)
          to label %39 unwind label %.loopexit

39:                                               ; preds = %37
  %.not30 = icmp eq i32 %38, 0
  br i1 %.not30, label %57, label %40

40:                                               ; preds = %39
  %41 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %.invoke unwind label %.loopexit.split-lp

.invoke:                                          ; preds = %55, %53, %48, %40
  %42 = phi ptr [ %41, %40 ], [ %49, %48 ], [ %54, %53 ], [ %56, %55 ]
  %43 = phi i64 [ 296, %40 ], [ 301, %48 ], [ 306, %53 ], [ 310, %55 ]
  %44 = invoke noundef i32 @_ZN7qpOASES15MessageHandling10throwErrorENS_11returnValueEPKcS3_S3_mNS_16VisibilityStatusE(ptr noundef nonnull align 8 dereferenceable(28) %42, i32 noundef 27, ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef %43, i32 noundef 1)
          to label %66 unwind label %.loopexit.split-lp

45:                                               ; preds = %.lr.ph36
  %46 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef %.135)
          to label %47 unwind label %.loopexit

47:                                               ; preds = %45
  %.not29 = icmp eq i32 %46, 0
  br i1 %.not29, label %57, label %48

48:                                               ; preds = %47
  %49 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %.invoke unwind label %.loopexit.split-lp

50:                                               ; preds = %.lr.ph36
  %51 = invoke noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36) %4, i32 noundef %.135)
          to label %52 unwind label %.loopexit

52:                                               ; preds = %50
  %.not28 = icmp eq i32 %51, 0
  br i1 %.not28, label %57, label %53

53:                                               ; preds = %52
  %54 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %.invoke unwind label %.loopexit.split-lp

55:                                               ; preds = %.lr.ph36
  %56 = invoke noundef ptr @_ZN7qpOASES23getGlobalMessageHandlerEv()
          to label %.invoke unwind label %.loopexit.split-lp

57:                                               ; preds = %39, %47, %52
  %58 = add nuw nsw i32 %.135, 1
  %59 = load i32, ptr %7, align 8, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %.lr.ph36, label %._crit_edge37, !llvm.loop !14

._crit_edge37:                                    ; preds = %57, %.preheader
  %61 = getelementptr inbounds i8, ptr %0, i64 40
  %62 = invoke noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %61, ptr noundef nonnull align 8 dereferenceable(36) %3)
          to label %63 unwind label %.loopexit.split-lp

63:                                               ; preds = %._crit_edge37
  %64 = getelementptr inbounds i8, ptr %0, i64 80
  %65 = invoke noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %64, ptr noundef nonnull align 8 dereferenceable(36) %4)
          to label %66 unwind label %.loopexit.split-lp

66:                                               ; preds = %.invoke, %63
  %.024 = phi i32 [ 0, %63 ], [ %44, %.invoke ]
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #6
  br label %68

67:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %lpad.phi, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  call void @_ZN7qpOASES9IndexlistD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn

68:                                               ; preds = %2, %6, %66, %18, %12
  %.125 = phi i32 [ %14, %12 ], [ %20, %18 ], [ %.024, %66 ], [ 0, %6 ], [ 0, %2 ]
  ret i32 %.125
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef) local_unnamed_addr #4 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 #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7qpOASES9SubjectTo9setStatusEiNS_15SubjectToStatusE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef) local_unnamed_addr #4 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 #5 align 2

declare void @_ZN7qpOASES9IndexlistC1Ei(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) unnamed_addr #1

declare noundef i32 @_ZN7qpOASES9Indexlist9addNumberEi(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(36) ptr @_ZN7qpOASES9IndexlistaSERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1

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

attributes #0 = { nounwind "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" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN7qpOASES9SubjectToE", !7, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 36}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN7qpOASES11BooleanTypeE", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass