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

; 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::QProblem" = type { %"class.qpOASES::QProblemB", i32, ptr, ptr, ptr, %"class.qpOASES::Constraints", ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"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 }
%"struct.qpOASES::TabularOutput" = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.qpOASES::Constraints" = type { %"class.qpOASES::SubjectTo", %"class.qpOASES::Indexlist", %"class.qpOASES::Indexlist" }

@_ZTVN7qpOASES8QProblemE = external dso_local unnamed_addr constant { [38 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7qpOASES8QProblemC2Ev(ptr noundef nonnull align 8 dereferenceable(1064) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN7qpOASES9QProblemBC2Ev(ptr noundef nonnull align 8 dereferenceable(800) %5)
  store ptr getelementptr inbounds inrange(-16, 288) ({ [38 x ptr] }, ptr @_ZTVN7qpOASES8QProblemE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 5
  invoke void @_ZN7qpOASES11ConstraintsC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %6)
          to label %7 unwind label %26

7:                                                ; preds = %1
  %8 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 1
  store i32 0, ptr %8, align 8, !tbaa !11
  %9 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 2
  store ptr null, ptr %9, align 8, !tbaa !28
  %10 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 3
  store ptr null, ptr %10, align 8, !tbaa !29
  %11 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 4
  store ptr null, ptr %11, align 8, !tbaa !30
  %12 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 8
  store i32 0, ptr %12, align 8, !tbaa !31
  %13 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 6
  store ptr null, ptr %13, align 8, !tbaa !32
  %14 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 7
  store ptr null, ptr %14, align 8, !tbaa !33
  %15 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 9
  store ptr null, ptr %15, align 8, !tbaa !34
  %16 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 10
  store ptr null, ptr %16, align 8, !tbaa !35
  %17 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 11
  store ptr null, ptr %17, align 8, !tbaa !36
  %18 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 12
  store ptr null, ptr %18, align 8, !tbaa !37
  %19 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 13
  store ptr null, ptr %19, align 8, !tbaa !38
  %20 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 15
  store ptr null, ptr %20, align 8, !tbaa !39
  %21 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 16
  store ptr null, ptr %21, align 8, !tbaa !40
  %22 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 17
  store ptr null, ptr %22, align 8, !tbaa !41
  %23 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 14
  store ptr null, ptr %23, align 8, !tbaa !42
  %24 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 18
  store ptr null, ptr %24, align 8, !tbaa !43
  %25 = getelementptr inbounds %"class.qpOASES::QProblem", ptr %5, i32 0, i32 19
  store ptr null, ptr %25, align 8, !tbaa !44
  ret void

26:                                               ; preds = %1
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %3, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %4, align 4
  call void @_ZN7qpOASES9QProblemBD2Ev(ptr noundef nonnull align 8 dereferenceable(800) %5) #3
  br label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr %3, align 8
  %32 = load i32, ptr %4, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

declare void @_ZN7qpOASES9QProblemBC2Ev(ptr noundef nonnull align 8 dereferenceable(800)) unnamed_addr #1

declare void @_ZN7qpOASES11ConstraintsC1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7qpOASES9QProblemBD2Ev(ptr noundef nonnull align 8 dereferenceable(800)) 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 = { "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 = { 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 #3 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !14, i64 800}
!12 = !{!"_ZTSN7qpOASES8QProblemE", !13, i64 0, !14, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !26, i64 832, !6, i64 952, !6, i64 960, !17, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !6, i64 1048, !6, i64 1056}
!13 = !{!"_ZTSN7qpOASES9QProblemBE", !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !15, i64 48, !6, i64 168, !14, i64 176, !6, i64 184, !6, i64 192, !19, i64 200, !20, i64 208, !14, i64 212, !14, i64 216, !21, i64 220, !19, i64 224, !17, i64 232, !6, i64 240, !19, i64 248, !19, i64 256, !17, i64 264, !22, i64 272, !25, i64 496, !27, i64 768}
!14 = !{!"_ZTSN7qpOASES11BooleanTypeE", !7, i64 0}
!15 = !{!"_ZTSN7qpOASES6BoundsE", !16, i64 0, !18, i64 40, !18, i64 80}
!16 = !{!"_ZTSN7qpOASES9SubjectToE", !17, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN7qpOASES9IndexlistE", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !17, i64 32}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSN7qpOASES14QProblemStatusE", !7, i64 0}
!21 = !{!"_ZTSN7qpOASES11HessianTypeE", !7, 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, !17, i64 28, !17, i64 32, !14, i64 36, !19, i64 40, !19, i64 48, !19, i64 56, !19, i64 64, !19, i64 72, !19, i64 80, !19, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !19, i64 120, !24, i64 128, !19, i64 136, !17, i64 144, !19, i64 152, !17, i64 160, !19, i64 168, !19, i64 176, !19, i64 184, !19, i64 192, !14, i64 200, !14, i64 204, !17, i64 208, !17, i64 212, !17, i64 216}
!23 = !{!"_ZTSN7qpOASES10PrintLevelE", !7, i64 0}
!24 = !{!"_ZTSN7qpOASES15SubjectToStatusE", !7, i64 0}
!25 = !{!"_ZTSN7qpOASES7FlipperE", !17, i64 0, !17, i64 4, !15, i64 8, !26, i64 128, !6, i64 248, !6, i64 256, !6, i64 264}
!26 = !{!"_ZTSN7qpOASES11ConstraintsE", !16, i64 0, !18, i64 40, !18, i64 80}
!27 = !{!"_ZTSN7qpOASES13TabularOutputE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28}
!28 = !{!12, !6, i64 808}
!29 = !{!12, !6, i64 816}
!30 = !{!12, !6, i64 824}
!31 = !{!12, !17, i64 968}
!32 = !{!12, !6, i64 952}
!33 = !{!12, !6, i64 960}
!34 = !{!12, !6, i64 976}
!35 = !{!12, !6, i64 984}
!36 = !{!12, !6, i64 992}
!37 = !{!12, !6, i64 1000}
!38 = !{!12, !6, i64 1008}
!39 = !{!12, !6, i64 1024}
!40 = !{!12, !6, i64 1032}
!41 = !{!12, !6, i64 1040}
!42 = !{!12, !6, i64 1016}
!43 = !{!12, !6, i64 1048}
!44 = !{!12, !6, i64 1056}


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

@_ZTVN7qpOASES8QProblemE = external dso_local unnamed_addr constant { [38 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7qpOASES8QProblemC2Ev(ptr noundef nonnull align 8 dereferenceable(1064) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN7qpOASES9QProblemBC2Ev(ptr noundef nonnull align 8 dereferenceable(800) %0)
  store ptr getelementptr inbounds inrange(-16, 288) (i8, ptr @_ZTVN7qpOASES8QProblemE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 832
  invoke void @_ZN7qpOASES11ConstraintsC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %2)
          to label %3 unwind label %8

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 800
  store i32 0, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 808
  %6 = getelementptr inbounds i8, ptr %0, i64 952
  %7 = getelementptr inbounds i8, ptr %0, i64 976
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %6, i8 0, i64 20, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %7, i8 0, i64 88, i1 false)
  ret void

8:                                                ; preds = %1
  %9 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN7qpOASES9QProblemBD2Ev(ptr noundef nonnull align 8 dereferenceable(800) %0) #4
  resume { ptr, i32 } %9
}

declare void @_ZN7qpOASES9QProblemBC2Ev(ptr noundef nonnull align 8 dereferenceable(800)) unnamed_addr #1

declare void @_ZN7qpOASES11ConstraintsC1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7qpOASES9QProblemBD2Ev(ptr noundef nonnull align 8 dereferenceable(800)) unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { "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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 800}
!9 = !{!"_ZTSN7qpOASES8QProblemE", !10, i64 0, !11, i64 800, !13, i64 808, !13, i64 816, !13, i64 824, !25, i64 832, !13, i64 952, !13, i64 960, !16, i64 968, !13, i64 976, !13, i64 984, !13, i64 992, !13, i64 1000, !13, i64 1008, !13, i64 1016, !13, i64 1024, !13, i64 1032, !13, i64 1040, !13, i64 1048, !13, i64 1056}
!10 = !{!"_ZTSN7qpOASES9QProblemBE", !11, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !14, i64 48, !13, i64 168, !11, i64 176, !13, i64 184, !13, i64 192, !18, i64 200, !19, i64 208, !11, i64 212, !11, i64 216, !20, i64 220, !18, i64 224, !16, i64 232, !13, i64 240, !18, i64 248, !18, i64 256, !16, i64 264, !21, i64 272, !24, i64 496, !26, i64 768}
!11 = !{!"_ZTSN7qpOASES11BooleanTypeE", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"_ZTSN7qpOASES6BoundsE", !15, i64 0, !17, i64 40, !17, i64 80}
!15 = !{!"_ZTSN7qpOASES9SubjectToE", !16, i64 8, !13, i64 16, !13, i64 24, !11, i64 32, !11, i64 36}
!16 = !{!"int", !12, i64 0}
!17 = !{!"_ZTSN7qpOASES9IndexlistE", !13, i64 0, !13, i64 8, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32}
!18 = !{!"double", !12, i64 0}
!19 = !{!"_ZTSN7qpOASES14QProblemStatusE", !12, i64 0}
!20 = !{!"_ZTSN7qpOASES11HessianTypeE", !12, i64 0}
!21 = !{!"_ZTSN7qpOASES7OptionsE", !22, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !16, i64 28, !16, i64 32, !11, i64 36, !18, i64 40, !18, i64 48, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !23, i64 128, !18, i64 136, !16, i64 144, !18, i64 152, !16, i64 160, !18, i64 168, !18, i64 176, !18, i64 184, !18, i64 192, !11, i64 200, !11, i64 204, !16, i64 208, !16, i64 212, !16, i64 216}
!22 = !{!"_ZTSN7qpOASES10PrintLevelE", !12, i64 0}
!23 = !{!"_ZTSN7qpOASES15SubjectToStatusE", !12, i64 0}
!24 = !{!"_ZTSN7qpOASES7FlipperE", !16, i64 0, !16, i64 4, !14, i64 8, !25, i64 128, !13, i64 248, !13, i64 256, !13, i64 264}
!25 = !{!"_ZTSN7qpOASES11ConstraintsE", !15, i64 0, !17, i64 40, !17, i64 80}
!26 = !{!"_ZTSN7qpOASES13TabularOutputE", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28}


; Effective O3 passes: EarlyCSEPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass