; LLVM IR from dtecta/motion-toolkit :: curve/CubicBezierSplineCurve.ll (ZNK2cv22CubicBezierSplineCurve4evalEf)

; 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.mt::Vector3" = type { %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual" }
%"class.mt::Dual" = type { float, float }
%"class.cv::SplineCurve" = type { %"class.cv::Curve", %"class.std::vector" }
%"class.cv::Curve" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mt::Vector3<float>, std::allocator<mt::Vector3<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<mt::Vector3<float>, std::allocator<mt::Vector3<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<mt::Vector3<float>, std::allocator<mt::Vector3<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mt::Vector3<float>, std::allocator<mt::Vector3<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.mt::Vector3.0" = type { float, float, float }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf = external hidden unnamed_addr constant [67 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK2cv22CubicBezierSplineCurve4evalEf(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, float noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.mt::Dual", align 4
  %12 = alloca %"class.mt::Dual", align 4
  %13 = alloca %"class.mt::Dual", align 4
  %14 = alloca %"class.mt::Dual", align 4
  %15 = alloca %"class.mt::Dual", align 4
  %16 = alloca %"class.mt::Dual", align 4
  %17 = alloca %"class.mt::Dual", align 4
  %18 = alloca %"class.mt::Dual", align 4
  %19 = alloca %"class.mt::Vector3", align 4
  %20 = alloca %"class.mt::Vector3", align 4
  %21 = alloca %"class.mt::Vector3", align 4
  %22 = alloca %"class.mt::Dual", align 4
  %23 = alloca %"class.mt::Vector3", align 4
  %24 = alloca %"class.mt::Dual", align 4
  %25 = alloca %"class.mt::Dual", align 4
  %26 = alloca %"class.mt::Vector3", align 4
  %27 = alloca %"class.mt::Dual", align 4
  %28 = alloca %"class.mt::Dual", align 4
  %29 = alloca %"class.mt::Vector3", align 4
  %30 = alloca %"class.mt::Dual", align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  store float %2, ptr %5, align 4, !tbaa !9
  %31 = load ptr, ptr %4, align 8
  %32 = load float, ptr %5, align 4, !tbaa !9
  %33 = fcmp ole float 0.000000e+00, %32
  br i1 %33, label %34, label %37

34:                                               ; preds = %3
  %35 = load float, ptr %5, align 4, !tbaa !9
  %36 = fcmp ole float %35, 1.000000e+00
  br label %37

37:                                               ; preds = %34, %3
  %38 = phi i1 [ false, %3 ], [ %36, %34 ]
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  br label %42

40:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 17, ptr noundef @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #8
  unreachable

41:                                               ; No predecessors!
  br label %42

42:                                               ; preds = %41, %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %43 = getelementptr inbounds %"class.cv::SplineCurve", ptr %31, i32 0, i32 1
  %44 = call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #9
  %45 = sub i64 %44, 1
  %46 = udiv i64 %45, 3
  %47 = uitofp i64 %46 to float
  store float %47, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %48 = load float, ptr %5, align 4, !tbaa !9
  %49 = load float, ptr %6, align 4, !tbaa !9
  %50 = fmul float %48, %49
  %51 = call noundef float @_ZSt4modffPf(float noundef %50, ptr noundef %7)
  store float %51, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %52 = load float, ptr %7, align 4, !tbaa !9
  %53 = fptosi float %52 to i32
  %54 = mul nsw i32 %53, 3
  store i32 %54, ptr %9, align 4, !tbaa !11
  %55 = load i32, ptr %9, align 4, !tbaa !11
  %56 = add nsw i32 %55, 1
  %57 = getelementptr inbounds %"class.cv::SplineCurve", ptr %31, i32 0, i32 1
  %58 = call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #9
  %59 = trunc i64 %58 to i32
  %60 = icmp eq i32 %56, %59
  br i1 %60, label %61, label %66

61:                                               ; preds = %42
  %62 = load float, ptr %8, align 4, !tbaa !9
  %63 = fadd float %62, 1.000000e+00
  store float %63, ptr %8, align 4, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !11
  %65 = sub nsw i32 %64, 3
  store i32 %65, ptr %9, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %61, %42
  %67 = load float, ptr %8, align 4, !tbaa !9
  %68 = fcmp ole float 0.000000e+00, %67
  br i1 %68, label %69, label %72

69:                                               ; preds = %66
  %70 = load float, ptr %8, align 4, !tbaa !9
  %71 = fcmp ole float %70, 1.000000e+00
  br label %72

72:                                               ; preds = %69, %66
  %73 = phi i1 [ false, %66 ], [ %71, %69 ]
  br i1 %73, label %74, label %75

74:                                               ; preds = %72
  br label %77

75:                                               ; preds = %72
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 30, ptr noundef @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #8
  unreachable

76:                                               ; No predecessors!
  br label %77

77:                                               ; preds = %76, %74
  %78 = load i32, ptr %9, align 4, !tbaa !11
  %79 = icmp sle i32 0, %78
  br i1 %79, label %80, label %87

80:                                               ; preds = %77
  %81 = load i32, ptr %9, align 4, !tbaa !11
  %82 = add nsw i32 %81, 3
  %83 = getelementptr inbounds %"class.cv::SplineCurve", ptr %31, i32 0, i32 1
  %84 = call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #9
  %85 = trunc i64 %84 to i32
  %86 = icmp slt i32 %82, %85
  br label %87

87:                                               ; preds = %80, %77
  %88 = phi i1 [ false, %77 ], [ %86, %80 ]
  br i1 %88, label %89, label %90

89:                                               ; preds = %87
  br label %92

90:                                               ; preds = %87
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 31, ptr noundef @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #8
  unreachable

91:                                               ; No predecessors!
  br label %92

92:                                               ; preds = %91, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %93 = getelementptr inbounds %"class.cv::SplineCurve", ptr %31, i32 0, i32 1
  %94 = load i32, ptr %9, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #9
  store ptr %96, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %97 = load float, ptr %8, align 4, !tbaa !9
  call void @_ZN2mt4DualIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %97, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %98 = call <2 x float> @_ZN2mtmiIfEENS_4DualIT_EES2_RKS3_(float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %98, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !13
  %99 = load <2 x float>, ptr %14, align 4
  %100 = call <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float> %99)
  store <2 x float> %100, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %101 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %101, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !13
  %102 = load <2 x float>, ptr %17, align 4
  %103 = call <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float> %102)
  store <2 x float> %103, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %104 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %104, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #9
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.mt::Vector3.0", ptr %105, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !13
  %107 = load <2 x float>, ptr %22, align 4
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %21, ptr noundef nonnull align 4 dereferenceable(12) %106, <2 x float> %107)
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #9
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.mt::Vector3.0", ptr %108, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %110 = call <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store <2 x float> %110, ptr %25, align 4
  %111 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %111, ptr %24, align 4
  %112 = load <2 x float>, ptr %24, align 4
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %109, <2 x float> %112)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(24) %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #9
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.mt::Vector3.0", ptr %113, i64 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %115 = call <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %115, ptr %28, align 4
  %116 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %16)
  store <2 x float> %116, ptr %27, align 4
  %117 = load <2 x float>, ptr %27, align 4
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %26, ptr noundef nonnull align 4 dereferenceable(12) %114, <2 x float> %117)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(24) %26)
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #9
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.mt::Vector3.0", ptr %118, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !13
  %120 = load <2 x float>, ptr %30, align 4
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %119, <2 x float> %120)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4modffPf(float noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmiIfEENS_4DualIT_EES2_RKS3_(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float>) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24)) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), <2 x float>) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #6

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { noreturn 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="64" "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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}


; 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.mt::Vector3" = type { %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual" }
%"class.mt::Dual" = type { float, float }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf = external hidden unnamed_addr constant [67 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK2cv22CubicBezierSplineCurve4evalEf(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, float noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca float, align 4
  %5 = alloca %"class.mt::Dual", align 8
  %6 = alloca %"class.mt::Dual", align 8
  %7 = alloca %"class.mt::Dual", align 8
  %8 = alloca %"class.mt::Dual", align 8
  %9 = alloca %"class.mt::Vector3", align 4
  %10 = alloca %"class.mt::Vector3", align 4
  %11 = alloca %"class.mt::Vector3", align 4
  %12 = alloca %"class.mt::Vector3", align 4
  %13 = alloca %"class.mt::Dual", align 8
  %14 = alloca %"class.mt::Vector3", align 4
  %15 = alloca %"class.mt::Dual", align 8
  %16 = alloca %"class.mt::Vector3", align 4
  %17 = fcmp oge float %2, 0.000000e+00
  %18 = fcmp ole float %2, 1.000000e+00
  %19 = and i1 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 17, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #7
  unreachable

21:                                               ; preds = %3
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  %23 = tail call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #8
  %24 = add i64 %23, -1
  %25 = udiv i64 %24, 3
  %26 = uitofp nneg i64 %25 to float
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %27 = fmul float %26, %2
  %28 = call noundef float @_ZSt4modffPf(float noundef %27, ptr noundef nonnull %4)
  %29 = load float, ptr %4, align 4, !tbaa !5
  %30 = fptosi float %29 to i32
  %31 = mul nsw i32 %30, 3
  %32 = add nsw i32 %31, 1
  %33 = call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #8
  %34 = trunc i64 %33 to i32
  %35 = icmp eq i32 %32, %34
  %36 = fadd float %28, 1.000000e+00
  %37 = add nsw i32 %31, -3
  %.024 = select i1 %35, i32 %37, i32 %31
  %.0 = select i1 %35, float %36, float %28
  %38 = fcmp oge float %.0, 0.000000e+00
  %39 = fcmp ole float %.0, 1.000000e+00
  %40 = and i1 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %21
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 30, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #7
  unreachable

42:                                               ; preds = %21
  %43 = icmp sgt i32 %.024, -1
  br i1 %43, label %44, label %.critedge

44:                                               ; preds = %42
  %45 = add nuw nsw i32 %.024, 3
  %46 = call noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #8
  %47 = trunc i64 %46 to i32
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %49, label %.critedge

.critedge:                                        ; preds = %42, %44
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 31, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK2cv22CubicBezierSplineCurve4evalEf) #7
  unreachable

49:                                               ; preds = %44
  %50 = zext nneg i32 %.024 to i64
  %51 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %50) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @_ZN2mt4DualIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %.0, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %52 = call <2 x float> @_ZN2mtmiIfEENS_4DualIT_EES2_RKS3_(float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %52, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %53 = call <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float> %52)
  store <2 x float> %53, ptr %7, align 8
  %54 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %.sroa.05.0.copyload = load <2 x float>, ptr %5, align 8
  %55 = call <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float> %.sroa.05.0.copyload)
  store <2 x float> %55, ptr %8, align 8
  %56 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #8
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %51, <2 x float> %54)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #8
  %57 = getelementptr inbounds i8, ptr %51, i64 12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %58 = call <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %58, ptr %13, align 8
  %59 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %57, <2 x float> %59)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %10, ptr noundef nonnull align 4 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #8
  %60 = getelementptr inbounds i8, ptr %51, i64 24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %61 = call <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %61, ptr %15, align 8
  %62 = call <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %60, <2 x float> %62)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(24) %14)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #8
  %63 = getelementptr inbounds i8, ptr %51, i64 36
  call void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %63, <2 x float> %56)
  call void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind writable sret(%"class.mt::Vector3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(24) %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4modffPf(float noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt6vectorIN2mt7Vector3IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmiIfEENS_4DualIT_EES2_RKS3_(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mt6squareINS_4DualIfEEEET_S3_(<2 x float>) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmlIffEENS_4DualINS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mtplINS_4DualIfEES2_EENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EERKNS3_IS6_EE(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mtmlIfNS_4DualIfEEEENS_7Vector3INS_7PromoteIT_T0_E2RTEEERKNS3_IS5_EES6_(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), <2 x float>) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local <2 x float> @_ZN2mtmlIfEENS_4DualIT_EES2_RKS3_(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { noreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="64" "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 #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass