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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB18setupSubjectToTypeEPKdS2_(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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
  store ptr %2, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %10 = call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %9)
  store i32 %10, ptr %8, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  call void @_ZN7qpOASES9SubjectTo10setNoLowerENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %11, i32 noundef 1)
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %33

14:                                               ; preds = %3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %29, %14
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %19, label %32

19:                                               ; preds = %15
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds double, ptr %20, i64 %22
  %24 = load double, ptr %23, align 8, !tbaa !11
  %25 = fcmp ogt double %24, -1.000000e+20
  br i1 %25, label %26, label %28

26:                                               ; preds = %19
  %27 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  call void @_ZN7qpOASES9SubjectTo10setNoLowerENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %27, i32 noundef 0)
  br label %32

28:                                               ; preds = %19
  br label %29

29:                                               ; preds = %28
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %7, align 4, !tbaa !9
  br label %15, !llvm.loop !13

32:                                               ; preds = %26, %15
  br label %33

33:                                               ; preds = %32, %3
  %34 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  call void @_ZN7qpOASES9SubjectTo10setNoUpperENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %34, i32 noundef 1)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %56

37:                                               ; preds = %33
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %52, %37
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %55

42:                                               ; preds = %38
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = fcmp olt double %47, 1.000000e+20
  br i1 %48, label %49, label %51

49:                                               ; preds = %42
  %50 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  call void @_ZN7qpOASES9SubjectTo10setNoUpperENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %50, i32 noundef 0)
  br label %55

51:                                               ; preds = %42
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %7, align 4, !tbaa !9
  br label %38, !llvm.loop !15

55:                                               ; preds = %49, %38
  br label %56

56:                                               ; preds = %55, %33
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %151

59:                                               ; preds = %56
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %151

62:                                               ; preds = %59
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %147, %62
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %150

67:                                               ; preds = %63
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds double, ptr %68, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %74 = getelementptr inbounds %"class.qpOASES::Options", ptr %73, i32 0, i32 11
  %75 = load double, ptr %74, align 8, !tbaa !16
  %76 = fadd double -1.000000e+20, %75
  %77 = fcmp olt double %72, %76
  br i1 %77, label %78, label %98

78:                                               ; preds = %67
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %85 = getelementptr inbounds %"class.qpOASES::Options", ptr %84, i32 0, i32 11
  %86 = load double, ptr %85, align 8, !tbaa !16
  %87 = fsub double 1.000000e+20, %86
  %88 = fcmp ogt double %83, %87
  br i1 %88, label %89, label %98

89:                                               ; preds = %78
  %90 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %91 = getelementptr inbounds %"class.qpOASES::Options", ptr %90, i32 0, i32 2
  %92 = load i32, ptr %91, align 8, !tbaa !30
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %98

94:                                               ; preds = %89
  %95 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %95, i32 noundef %96, i32 noundef 0)
  br label %146

98:                                               ; preds = %89, %78, %67
  %99 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %100 = getelementptr inbounds %"class.qpOASES::Options", ptr %99, i32 0, i32 9
  %101 = load i32, ptr %100, align 4, !tbaa !31
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %141

103:                                              ; preds = %98
  %104 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !32
  %106 = load i32, ptr %7, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %105, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !11
  %110 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 5
  %111 = load ptr, ptr %110, align 8, !tbaa !33
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %111, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %117 = getelementptr inbounds %"class.qpOASES::Options", ptr %116, i32 0, i32 11
  %118 = load double, ptr %117, align 8, !tbaa !16
  %119 = fsub double %115, %118
  %120 = fcmp ogt double %109, %119
  br i1 %120, label %121, label %141

121:                                              ; preds = %103
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %122, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 23
  %133 = getelementptr inbounds %"class.qpOASES::Options", ptr %132, i32 0, i32 11
  %134 = load double, ptr %133, align 8, !tbaa !16
  %135 = fsub double %131, %134
  %136 = fcmp ogt double %126, %135
  br i1 %136, label %137, label %141

137:                                              ; preds = %121
  %138 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %138, i32 noundef %139, i32 noundef 2)
  br label %145

141:                                              ; preds = %121, %103, %98
  %142 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %143 = load i32, ptr %7, align 4, !tbaa !9
  %144 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %142, i32 noundef %143, i32 noundef 1)
  br label %145

145:                                              ; preds = %141, %137
  br label %146

146:                                              ; preds = %145, %94
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %7, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %7, align 4, !tbaa !9
  br label %63, !llvm.loop !34

150:                                              ; preds = %63
  br label %184

151:                                              ; preds = %59, %56
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = icmp eq ptr %152, null
  br i1 %153, label %154, label %170

154:                                              ; preds = %151
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %170

157:                                              ; preds = %154
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %166, %157
  %159 = load i32, ptr %7, align 4, !tbaa !9
  %160 = load i32, ptr %8, align 4, !tbaa !9
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %169

162:                                              ; preds = %158
  %163 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %164 = load i32, ptr %7, align 4, !tbaa !9
  %165 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %163, i32 noundef %164, i32 noundef 0)
  br label %166

166:                                              ; preds = %162
  %167 = load i32, ptr %7, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %7, align 4, !tbaa !9
  br label %158, !llvm.loop !35

169:                                              ; preds = %158
  br label %183

170:                                              ; preds = %154, %151
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %179, %170
  %172 = load i32, ptr %7, align 4, !tbaa !9
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %175, label %182

175:                                              ; preds = %171
  %176 = getelementptr inbounds %"class.qpOASES::QProblemB", ptr %9, i32 0, i32 6
  %177 = load i32, ptr %7, align 4, !tbaa !9
  %178 = call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %176, i32 noundef %177, i32 noundef 1)
  br label %179

179:                                              ; preds = %175
  %180 = load i32, ptr %7, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %7, align 4, !tbaa !9
  br label %171, !llvm.loop !36

182:                                              ; preds = %171
  br label %183

183:                                              ; preds = %182, %169
  br label %184

184:                                              ; preds = %183, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret i32 0
}

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

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

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

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


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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7qpOASES9QProblemB18setupSubjectToTypeEPKdS2_(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef readonly %1, ptr noundef readonly %2) unnamed_addr #1 align 2 {
  %4 = tail call noundef i32 @_ZNK7qpOASES9QProblemB5getNVEv(ptr noundef nonnull align 8 dereferenceable(800) %0)
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZN7qpOASES9SubjectTo10setNoLowerENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 1)
  %6 = icmp ne ptr %1, null
  %7 = icmp sgt i32 %4, 0
  %or.cond69 = and i1 %6, %7
  br i1 %or.cond69, label %.lr.ph.preheader, label %.loopexit58

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %.lr.ph

8:                                                ; preds = %.lr.ph
  %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 %.loopexit58, label %.lr.ph, !llvm.loop !5

.lr.ph:                                           ; preds = %.lr.ph.preheader, %8
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %8 ]
  %9 = getelementptr inbounds double, ptr %1, i64 %indvars.iv
  %10 = load double, ptr %9, align 8, !tbaa !7
  %11 = fcmp ogt double %10, -1.000000e+20
  br i1 %11, label %12, label %8

12:                                               ; preds = %.lr.ph
  tail call void @_ZN7qpOASES9SubjectTo10setNoLowerENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0)
  br label %.loopexit58

.loopexit58:                                      ; preds = %8, %12, %3
  tail call void @_ZN7qpOASES9SubjectTo10setNoUpperENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 1)
  %.not70 = icmp eq ptr %2, null
  br i1 %.not70, label %.thread, label %.preheader55

.preheader55:                                     ; preds = %.loopexit58
  br i1 %7, label %.lr.ph61.preheader, label %.loopexit

.lr.ph61.preheader:                               ; preds = %.preheader55
  %wide.trip.count77 = zext nneg i32 %4 to i64
  br label %.lr.ph61

13:                                               ; preds = %.lr.ph61
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %.loopexit56, label %.lr.ph61, !llvm.loop !11

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %13
  %indvars.iv74 = phi i64 [ 0, %.lr.ph61.preheader ], [ %indvars.iv.next75, %13 ]
  %14 = getelementptr inbounds double, ptr %2, i64 %indvars.iv74
  %15 = load double, ptr %14, align 8, !tbaa !7
  %16 = fcmp olt double %15, 1.000000e+20
  br i1 %16, label %17, label %13

17:                                               ; preds = %.lr.ph61
  tail call void @_ZN7qpOASES9SubjectTo10setNoUpperENS_11BooleanTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0)
  br label %.loopexit56

.loopexit56:                                      ; preds = %13, %17
  br i1 %6, label %.preheader, label %.preheader53

.preheader:                                       ; preds = %.loopexit56
  br i1 %7, label %.lr.ph68, label %.loopexit

.lr.ph68:                                         ; preds = %.preheader
  %18 = getelementptr inbounds i8, ptr %0, i64 320
  %19 = getelementptr inbounds i8, ptr %0, i64 280
  %20 = getelementptr inbounds i8, ptr %0, i64 308
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %wide.trip.count82 = zext nneg i32 %4 to i64
  br label %23

23:                                               ; preds = %.lr.ph68, %53
  %indvars.iv79 = phi i64 [ 0, %.lr.ph68 ], [ %indvars.iv.next80, %53 ]
  %24 = getelementptr inbounds double, ptr %1, i64 %indvars.iv79
  %25 = load double, ptr %24, align 8, !tbaa !7
  %26 = load double, ptr %18, align 8, !tbaa !12
  %27 = fadd double %26, -1.000000e+20
  %28 = fcmp olt double %25, %27
  br i1 %28, label %29, label %36

29:                                               ; preds = %23
  %30 = getelementptr inbounds double, ptr %2, i64 %indvars.iv79
  %31 = load double, ptr %30, align 8, !tbaa !7
  %32 = fsub double 1.000000e+20, %26
  %33 = fcmp ogt double %31, %32
  %34 = load i32, ptr %19, align 8
  %35 = icmp eq i32 %34, 0
  %or.cond49 = select i1 %33, i1 %35, i1 false
  br i1 %or.cond49, label %53, label %36

36:                                               ; preds = %29, %23
  %37 = load i32, ptr %20, align 4, !tbaa !28
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %52, label %38

38:                                               ; preds = %36
  %39 = load ptr, ptr %21, align 8, !tbaa !29
  %40 = getelementptr inbounds double, ptr %39, i64 %indvars.iv79
  %41 = load double, ptr %40, align 8, !tbaa !7
  %42 = load ptr, ptr %22, align 8, !tbaa !30
  %43 = getelementptr inbounds double, ptr %42, i64 %indvars.iv79
  %44 = load double, ptr %43, align 8, !tbaa !7
  %45 = fsub double %44, %26
  %46 = fcmp ogt double %41, %45
  br i1 %46, label %47, label %52

47:                                               ; preds = %38
  %48 = getelementptr inbounds double, ptr %2, i64 %indvars.iv79
  %49 = load double, ptr %48, align 8, !tbaa !7
  %50 = fsub double %49, %26
  %51 = fcmp ogt double %25, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47, %38, %36
  br label %53

53:                                               ; preds = %47, %29, %52
  %.sink89 = phi i32 [ 1, %52 ], [ 0, %29 ], [ 2, %47 ]
  %54 = trunc nuw nsw i64 %indvars.iv79 to i32
  %55 = tail call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %54, i32 noundef %.sink89)
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %.loopexit, label %23, !llvm.loop !31

.thread:                                          ; preds = %.loopexit58
  %56 = icmp eq ptr %1, null
  %or.cond3 = and i1 %56, %.not70
  br i1 %or.cond3, label %.preheader51, label %.preheader53

.preheader53:                                     ; preds = %.loopexit56, %.thread
  br i1 %7, label %.lr.ph63, label %.loopexit

.preheader51:                                     ; preds = %.thread
  br i1 %7, label %.lr.ph65, label %.loopexit

.lr.ph65:                                         ; preds = %.preheader51, %.lr.ph65
  %.364 = phi i32 [ %58, %.lr.ph65 ], [ 0, %.preheader51 ]
  %57 = tail call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %.364, i32 noundef 0)
  %58 = add nuw nsw i32 %.364, 1
  %exitcond85.not = icmp eq i32 %58, %4
  br i1 %exitcond85.not, label %.loopexit, label %.lr.ph65, !llvm.loop !32

.lr.ph63:                                         ; preds = %.preheader53, %.lr.ph63
  %.462 = phi i32 [ %60, %.lr.ph63 ], [ 0, %.preheader53 ]
  %59 = tail call noundef i32 @_ZN7qpOASES9SubjectTo7setTypeEiNS_13SubjectToTypeE(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %.462, i32 noundef 1)
  %60 = add nuw nsw i32 %.462, 1
  %exitcond84.not = icmp eq i32 %60, %4
  br i1 %exitcond84.not, label %.loopexit, label %.lr.ph63, !llvm.loop !33

.loopexit:                                        ; preds = %53, %.lr.ph63, %.lr.ph65, %.preheader55, %.preheader53, %.preheader51, %.preheader
  ret i32 0
}

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

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

; 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 #0 align 2

attributes #0 = { 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 #1 = { 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" }

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


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