; LLVM IR from dtecta/motion-toolkit :: jointlimits/EulerAnglesJointLimits.ll (ZN2ik22EulerAnglesJointLimitsC2Effffff)

; 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.ik::EulerAnglesJointLimits" = type { %"class.ik::JointLimits", [3 x %"class.mt::Interval"] }
%"class.ik::JointLimits" = type { ptr }
%"class.mt::Interval" = type { float, float }

@_ZTVN2ik22EulerAnglesJointLimitsE = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2ik22EulerAnglesJointLimitsC2Effffff(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store float %1, ptr %9, align 4, !tbaa !9
  store float %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !9
  store float %6, ptr %14, align 4, !tbaa !9
  %17 = load ptr, ptr %8, align 8
  call void @_ZN2ik11JointLimitsC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN2ik22EulerAnglesJointLimitsE, i32 0, i32 0, i32 2), ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.ik::EulerAnglesJointLimits", ptr %17, i32 0, i32 1
  %19 = getelementptr inbounds [3 x %"class.mt::Interval"], ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %"class.mt::Interval", ptr %19, i64 3
  br label %21

21:                                               ; preds = %23, %7
  %22 = phi ptr [ %19, %7 ], [ %24, %23 ]
  invoke void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %23 unwind label %34

23:                                               ; preds = %21
  %24 = getelementptr inbounds %"class.mt::Interval", ptr %22, i64 1
  %25 = icmp eq ptr %24, %20
  br i1 %25, label %26, label %21

26:                                               ; preds = %23
  %27 = load float, ptr %9, align 4, !tbaa !9
  %28 = load float, ptr %10, align 4, !tbaa !9
  %29 = load float, ptr %11, align 4, !tbaa !9
  %30 = load float, ptr %12, align 4, !tbaa !9
  %31 = load float, ptr %13, align 4, !tbaa !9
  %32 = load float, ptr %14, align 4, !tbaa !9
  invoke void @_ZN2ik22EulerAnglesJointLimits19setLocalJointLimitsEffffff(ptr noundef nonnull align 8 dereferenceable(32) %17, float noundef %27, float noundef %28, float noundef %29, float noundef %30, float noundef %31, float noundef %32)
          to label %33 unwind label %34

33:                                               ; preds = %26
  ret void

34:                                               ; preds = %26, %21
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %15, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %16, align 4
  call void @_ZN2ik11JointLimitsD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br label %38

38:                                               ; preds = %34
  %39 = load ptr, ptr %15, align 8
  %40 = load i32, ptr %16, align 4
  %41 = insertvalue { ptr, i32 } poison, ptr %39, 0
  %42 = insertvalue { ptr, i32 } %41, i32 %40, 1
  resume { ptr, i32 } %42
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2ik11JointLimitsC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ik22EulerAnglesJointLimits19setLocalJointLimitsEffffff(ptr noundef nonnull align 8 dereferenceable(32), float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ik11JointLimitsD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

@_ZTVN2ik22EulerAnglesJointLimitsE = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2ik22EulerAnglesJointLimitsC2Effffff(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN2ik11JointLimitsC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  store ptr getelementptr inbounds inrange(-16, 24) (i8, ptr @_ZTVN2ik22EulerAnglesJointLimitsE, i64 16), ptr %0, align 8, !tbaa !5
  %.ptr = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %.ptr)
  %.ptr.1 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %.ptr.2)
  invoke void @_ZN2ik22EulerAnglesJointLimits19setLocalJointLimitsEffffff(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6)
          to label %8 unwind label %9

8:                                                ; preds = %7
  ret void

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2ik11JointLimitsC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN2mt8IntervalIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2ik22EulerAnglesJointLimits19setLocalJointLimitsEffffff(ptr noundef nonnull align 8 dereferenceable(32), float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ik11JointLimitsD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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


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