+static cpu_type_t
+process_cpu_type(proc_t core_proc)
+{
+ cpu_type_t what_we_think;
+#if defined (__i386__) || defined (__x86_64__)
+ if (IS_64BIT_PROCESS(core_proc)) {
+ what_we_think = CPU_TYPE_X86_64;
+ } else {
+ what_we_think = CPU_TYPE_I386;
+ }
+#elif defined (__arm__) || defined(__arm64__)
+ if (IS_64BIT_PROCESS(core_proc)) {
+ what_we_think = CPU_TYPE_ARM64;
+ } else {
+ what_we_think = CPU_TYPE_ARM;
+ }
+#endif
+
+ return what_we_think;
+}
+
+static cpu_type_t
+process_cpu_subtype(proc_t core_proc)
+{
+ cpu_type_t what_we_think;
+#if defined (__i386__) || defined (__x86_64__)
+ if (IS_64BIT_PROCESS(core_proc)) {
+ what_we_think = CPU_SUBTYPE_X86_64_ALL;
+ } else {
+ what_we_think = CPU_SUBTYPE_I386_ALL;
+ }
+#elif defined (__arm__) || defined(__arm64__)
+ if (IS_64BIT_PROCESS(core_proc)) {
+ what_we_think = CPU_SUBTYPE_ARM64_ALL;
+ } else {
+ what_we_think = CPU_SUBTYPE_ARM_ALL;
+ }
+#endif
+ return what_we_think;
+}
+
+static void