; LLVM IR from nubot-nudt/simatch :: src/auto_referee/src/Quaternion.ll (ZN6gazebo4math10Quaternion5SlerpEdRKS1_S3_b)

; 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.gazebo::math::Quaternion" = type { double, double, double, double }

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #1

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

; Function Attrs: nounwind
declare double @sin(double noundef) #3

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6gazebo4math10Quaternion9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionngEv(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK6gazebo4math10Quaternion3DotERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6gazebo4math10Quaternion5SlerpEdRKS1_S3_b(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8 %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i1 noundef zeroext %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca double, align 8
  %12 = alloca %"class.gazebo::math::Quaternion", align 8
  %13 = alloca %"class.gazebo::math::Quaternion", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca %"class.gazebo::math::Quaternion", align 8
  %22 = alloca %"class.gazebo::math::Quaternion", align 8
  %23 = alloca i32, align 4
  %24 = alloca i1, align 1
  %25 = alloca %"class.gazebo::math::Quaternion", align 8
  %26 = alloca double, align 8
  %27 = alloca %"class.gazebo::math::Quaternion", align 8
  store ptr %0, ptr %6, align 8
  store double %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  %28 = zext i1 %4 to i8
  store i8 %28, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %29 = load ptr, ptr %8, align 8, !tbaa !9
  %30 = load ptr, ptr %9, align 8, !tbaa !9
  %31 = call noundef double @_ZNK6gazebo4math10Quaternion3DotERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull align 8 dereferenceable(32) %30)
  store double %31, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @_ZN6gazebo4math10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12)
  %32 = load double, ptr %11, align 8, !tbaa !5
  %33 = fcmp olt double %32, 0.000000e+00
  br i1 %33, label %34, label %47

34:                                               ; preds = %5
  %35 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %36 = trunc i8 %35 to i1
  br i1 %36, label %37, label %47

37:                                               ; preds = %34
  %38 = load double, ptr %11, align 8, !tbaa !5
  %39 = fneg double %38
  store double %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZNK6gazebo4math10QuaternionngEv(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %40)
          to label %41 unwind label %43

41:                                               ; preds = %37
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6gazebo4math10QuaternionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %13)
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %50

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %14, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %126

47:                                               ; preds = %34, %5
  %48 = load ptr, ptr %9, align 8, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6gazebo4math10QuaternionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %48)
  br label %50

50:                                               ; preds = %47, %41
  %51 = load double, ptr %11, align 8, !tbaa !5
  %52 = call double @llvm.fabs.f64(double %51)
  %53 = fcmp olt double %52, 0x3FEFF7CED916872B
  br i1 %53, label %54, label %96

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %55 = load double, ptr %11, align 8, !tbaa !5
  %56 = load double, ptr %11, align 8, !tbaa !5
  %57 = fneg double %55
  %58 = call double @llvm.fmuladd.f64(double %57, double %56, double 1.000000e+00)
  %59 = call double @sqrt(double noundef %58) #5
  store double %59, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %60 = load double, ptr %16, align 8, !tbaa !5
  %61 = load double, ptr %11, align 8, !tbaa !5
  %62 = call double @atan2(double noundef %60, double noundef %61) #5
  store double %62, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %63 = load double, ptr %16, align 8, !tbaa !5
  %64 = fdiv double 1.000000e+00, %63
  store double %64, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %65 = load double, ptr %7, align 8, !tbaa !5
  %66 = fsub double 1.000000e+00, %65
  %67 = load double, ptr %17, align 8, !tbaa !5
  %68 = fmul double %66, %67
  %69 = call double @sin(double noundef %68) #5
  %70 = load double, ptr %18, align 8, !tbaa !5
  %71 = fmul double %69, %70
  store double %71, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %72 = load double, ptr %7, align 8, !tbaa !5
  %73 = load double, ptr %17, align 8, !tbaa !5
  %74 = fmul double %72, %73
  %75 = call double @sin(double noundef %74) #5
  %76 = load double, ptr %18, align 8, !tbaa !5
  %77 = fmul double %75, %76
  store double %77, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  %78 = load ptr, ptr %8, align 8, !tbaa !9
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %21, ptr noundef nonnull align 8 dereferenceable(32) %78, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %79 unwind label %82

79:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %22, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %80 unwind label %86

80:                                               ; preds = %79
  invoke void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %81 unwind label %90

81:                                               ; preds = %80
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %125

82:                                               ; preds = %54
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %14, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %15, align 4
  br label %95

86:                                               ; preds = %79
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %14, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %15, align 4
  br label %94

90:                                               ; preds = %80
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %14, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %15, align 4
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  br label %94

94:                                               ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  br label %95

95:                                               ; preds = %94, %82
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %126

96:                                               ; preds = %50
  store i1 false, ptr %24, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #5
  %97 = load ptr, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %98 = load double, ptr %7, align 8, !tbaa !5
  %99 = fsub double 1.000000e+00, %98
  store double %99, ptr %26, align 8, !tbaa !5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %25, ptr noundef nonnull align 8 dereferenceable(32) %97, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %100 unwind label %105

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %27, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %101 unwind label %109

101:                                              ; preds = %100
  invoke void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %102 unwind label %113

102:                                              ; preds = %101
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  invoke void @_ZN6gazebo4math10Quaternion9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %103 unwind label %119

103:                                              ; preds = %102
  store i1 true, ptr %24, align 1
  store i32 1, ptr %23, align 4
  %104 = load i1, ptr %24, align 1
  br i1 %104, label %124, label %123

105:                                              ; preds = %96
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %14, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %15, align 4
  br label %118

109:                                              ; preds = %100
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  br label %117

113:                                              ; preds = %101
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %14, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %15, align 4
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #5
  br label %117

117:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  br label %118

118:                                              ; preds = %117, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  br label %126

119:                                              ; preds = %102
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %14, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %15, align 4
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %126

123:                                              ; preds = %103
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %124

124:                                              ; preds = %123, %103
  br label %125

125:                                              ; preds = %124, %81
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

126:                                              ; preds = %119, %118, %95, %43
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %14, align 8
  %129 = load i32, ptr %15, align 4
  %130 = insertvalue { ptr, i32 } poison, ptr %128, 0
  %131 = insertvalue { ptr, i32 } %130, i32 %129, 1
  resume { ptr, i32 } %131
}

declare void @_ZN6gazebo4math10QuaternionC1Ev(ptr)

declare void @_ZN6gazebo4math10QuaternionD1Ev(ptr)

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!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"

%"class.gazebo::math::Quaternion" = type { double, double, double, double }

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #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 nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6gazebo4math10Quaternion9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6gazebo4math10QuaternionngEv(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK6gazebo4math10Quaternion3DotERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6gazebo4math10Quaternion5SlerpEdRKS1_S3_b(ptr dead_on_unwind noalias writable sret(%"class.gazebo::math::Quaternion") align 8 %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i1 noundef zeroext %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca double, align 8
  %7 = alloca %"class.gazebo::math::Quaternion", align 8
  %8 = alloca %"class.gazebo::math::Quaternion", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %"class.gazebo::math::Quaternion", align 8
  %12 = alloca %"class.gazebo::math::Quaternion", align 8
  %13 = alloca %"class.gazebo::math::Quaternion", align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.gazebo::math::Quaternion", align 8
  store double %1, ptr %6, align 8, !tbaa !5
  %16 = tail call noundef double @_ZNK6gazebo4math10Quaternion3DotERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN6gazebo4math10QuaternionC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %17 = fcmp olt double %16, 0.000000e+00
  %brmerge.not = and i1 %17, %4
  br i1 %brmerge.not, label %18, label %24

18:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  invoke void @_ZNK6gazebo4math10QuaternionngEv(ptr dead_on_unwind nonnull writable sret(%"class.gazebo::math::Quaternion") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %19 unwind label %22

19:                                               ; preds = %18
  %20 = fneg double %16
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6gazebo4math10QuaternionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %26

22:                                               ; preds = %18
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %69

24:                                               ; preds = %5
  %25 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6gazebo4math10QuaternionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %3)
  br label %26

26:                                               ; preds = %24, %19
  %.0 = phi double [ %20, %19 ], [ %16, %24 ]
  %27 = call double @llvm.fabs.f64(double %.0)
  %28 = fcmp olt double %27, 0x3FEFF7CED916872B
  br i1 %28, label %29, label %53

29:                                               ; preds = %26
  %30 = fneg double %.0
  %31 = call double @llvm.fmuladd.f64(double %30, double %.0, double 1.000000e+00)
  %32 = call double @sqrt(double noundef %31) #5
  %33 = call double @atan2(double noundef %32, double noundef %.0) #5
  %34 = fdiv double 1.000000e+00, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %35 = fsub double 1.000000e+00, %1
  %36 = fmul double %33, %35
  %37 = call double @sin(double noundef %36) #5
  %38 = fmul double %34, %37
  store double %38, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %39 = fmul double %33, %1
  %40 = call double @sin(double noundef %39) #5
  %41 = fmul double %34, %40
  store double %41, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind nonnull writable sret(%"class.gazebo::math::Quaternion") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %42 unwind label %45

42:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind nonnull writable sret(%"class.gazebo::math::Quaternion") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %43 unwind label %47

43:                                               ; preds = %42
  invoke void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %44 unwind label %49

44:                                               ; preds = %43
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %68

45:                                               ; preds = %29
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %52

47:                                               ; preds = %42
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %43
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %51

51:                                               ; preds = %49, %47
  %.pn30 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  br label %52

52:                                               ; preds = %51, %45
  %.pn30.pn = phi { ptr, i32 } [ %.pn30, %51 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %69

53:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %54 = fsub double 1.000000e+00, %1
  store double %54, ptr %14, align 8, !tbaa !5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind nonnull writable sret(%"class.gazebo::math::Quaternion") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %55 unwind label %58

55:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #5
  invoke void @_ZNK6gazebo4math10QuaternionmlERKd(ptr dead_on_unwind nonnull writable sret(%"class.gazebo::math::Quaternion") align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %56 unwind label %60

56:                                               ; preds = %55
  invoke void @_ZNK6gazebo4math10QuaternionplERKS1_(ptr dead_on_unwind writable sret(%"class.gazebo::math::Quaternion") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %57 unwind label %62

57:                                               ; preds = %56
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  invoke void @_ZN6gazebo4math10Quaternion9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %68 unwind label %66

58:                                               ; preds = %53
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %65

60:                                               ; preds = %55
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %64

62:                                               ; preds = %56
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  br label %64

64:                                               ; preds = %62, %60
  %.pn = phi { ptr, i32 } [ %63, %62 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #5
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %65

65:                                               ; preds = %64, %58
  %.pn.pn = phi { ptr, i32 } [ %.pn, %64 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br label %69

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %69

68:                                               ; preds = %57, %44
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  ret void

69:                                               ; preds = %66, %65, %52, %22
  %.pn30.pn.pn = phi { ptr, i32 } [ %.pn30.pn, %52 ], [ %67, %66 ], [ %.pn.pn, %65 ], [ %23, %22 ]
  call void @_ZN6gazebo4math10QuaternionD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn30.pn.pn
}

declare void @_ZN6gazebo4math10QuaternionC1Ev(ptr) local_unnamed_addr

declare void @_ZN6gazebo4math10QuaternionD1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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