+void*
+dtrace_ptrauth_strip(void *ptr, uint64_t key)
+{
+#pragma unused(key)
+#if __has_feature(ptrauth_calls)
+ /*
+ * The key argument to ptrauth_strip needs to be a compile-time
+ * constant
+ */
+ switch (key) {
+ case ptrauth_key_asia:
+ return ptrauth_strip(ptr, ptrauth_key_asia);
+ case ptrauth_key_asib:
+ return ptrauth_strip(ptr, ptrauth_key_asib);
+ case ptrauth_key_asda:
+ return ptrauth_strip(ptr, ptrauth_key_asda);
+ case ptrauth_key_asdb:
+ return ptrauth_strip(ptr, ptrauth_key_asdb);
+ default:
+ return ptr;
+ }
+#else
+ return ptr;
+#endif // __has_feature(ptrauth_calls)
+}
+
+int
+dtrace_is_valid_ptrauth_key(uint64_t key)
+{
+#pragma unused(key)
+#if __has_feature(ptrauth_calls)
+ return (key == ptrauth_key_asia) || (key == ptrauth_key_asib) ||
+ (key == ptrauth_key_asda) || (key == ptrauth_key_asdb);
+#else
+ return (0);
+#endif /* __has_feature(ptrauth_calls) */
+}
+