#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 4
#define __GNUC_MINOR__ 6
#define __GNUC_PATCHLEVEL__ 3
#define __VERSION__ "4.6.3"
#define __FINITE_MATH_ONLY__ 0
#define _LP64 1
#define __LP64__ 1
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG__ 8
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_LONG_DOUBLE__ 16
#define __SIZEOF_SIZE_T__ 8
#define __CHAR_BIT__ 8
#define __BIGGEST_ALIGNMENT__ 16
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_PDP_ENDIAN__ 3412
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __SIZEOF_POINTER__ 8
#define __SIZE_TYPE__ long unsigned int
#define __PTRDIFF_TYPE__ long int
#define __WCHAR_TYPE__ int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long int
#define __UINTMAX_TYPE__ long unsigned int
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __SIG_ATOMIC_TYPE__ int
#define __INT8_TYPE__ signed char
#define __INT16_TYPE__ short int
#define __INT32_TYPE__ int
#define __INT64_TYPE__ long int
#define __UINT8_TYPE__ unsigned char
#define __UINT16_TYPE__ short unsigned int
#define __UINT32_TYPE__ unsigned int
#define __UINT64_TYPE__ long unsigned int
#define __INT_LEAST8_TYPE__ signed char
#define __INT_LEAST16_TYPE__ short int
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_TYPE__ long int
#define __UINT_LEAST8_TYPE__ unsigned char
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __UINT_LEAST64_TYPE__ long unsigned int
#define __INT_FAST8_TYPE__ signed char
#define __INT_FAST16_TYPE__ long int
#define __INT_FAST32_TYPE__ long int
#define __INT_FAST64_TYPE__ long int
#define __UINT_FAST8_TYPE__ unsigned char
#define __UINT_FAST16_TYPE__ long unsigned int
#define __UINT_FAST32_TYPE__ long unsigned int
#define __UINT_FAST64_TYPE__ long unsigned int
#define __INTPTR_TYPE__ long int
#define __UINTPTR_TYPE__ long unsigned int
#define __GXX_ABI_VERSION 1002
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __INT_MAX__ 2147483647
#define __LONG_MAX__ 9223372036854775807L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __WCHAR_MAX__ 2147483647
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __WINT_MAX__ 4294967295U
#define __WINT_MIN__ 0U
#define __PTRDIFF_MAX__ 9223372036854775807L
#define __SIZE_MAX__ 18446744073709551615UL
#define __INTMAX_MAX__ 9223372036854775807L
#define __INTMAX_C(c) c ## L
#define __UINTMAX_MAX__ 18446744073709551615UL
#define __UINTMAX_C(c) c ## UL
#define __SIG_ATOMIC_MAX__ 2147483647
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __INT8_MAX__ 127
#define __INT16_MAX__ 32767
#define __INT32_MAX__ 2147483647
#define __INT64_MAX__ 9223372036854775807L
#define __UINT8_MAX__ 255
#define __UINT16_MAX__ 65535
#define __UINT32_MAX__ 4294967295U
#define __UINT64_MAX__ 18446744073709551615UL
#define __INT_LEAST8_MAX__ 127
#define __INT8_C(c) c
#define __INT_LEAST16_MAX__ 32767
#define __INT16_C(c) c
#define __INT_LEAST32_MAX__ 2147483647
#define __INT32_C(c) c
#define __INT_LEAST64_MAX__ 9223372036854775807L
#define __INT64_C(c) c ## L
#define __UINT_LEAST8_MAX__ 255
#define __UINT8_C(c) c
#define __UINT_LEAST16_MAX__ 65535
#define __UINT16_C(c) c
#define __UINT_LEAST32_MAX__ 4294967295U
#define __UINT32_C(c) c ## U
#define __UINT_LEAST64_MAX__ 18446744073709551615UL
#define __UINT64_C(c) c ## UL
#define __INT_FAST8_MAX__ 127
#define __INT_FAST16_MAX__ 9223372036854775807L
#define __INT_FAST32_MAX__ 9223372036854775807L
#define __INT_FAST64_MAX__ 9223372036854775807L
#define __UINT_FAST8_MAX__ 255
#define __UINT_FAST16_MAX__ 18446744073709551615UL
#define __UINT_FAST32_MAX__ 18446744073709551615UL
#define __UINT_FAST64_MAX__ 18446744073709551615UL
#define __INTPTR_MAX__ 9223372036854775807L
#define __UINTPTR_MAX__ 18446744073709551615UL
#define __FLT_EVAL_METHOD__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_MAX__ 3.40282346638528859812e+38F
#define __FLT_MIN__ 1.17549435082228750797e-38F
#define __FLT_EPSILON__ 1.19209289550781250000e-7F
#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_MAX__ ((double)1.79769313486231570815e+308L)
#define __DBL_MIN__ ((double)2.22507385850720138309e-308L)
#define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
#define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 64
#define __LDBL_DIG__ 18
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_MAX_EXP__ 16384
#define __LDBL_MAX_10_EXP__ 4932
#define __DECIMAL_DIG__ 21
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MIN_EXP__ (-94)
#define __DEC32_MAX_EXP__ 97
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MIN_EXP__ (-382)
#define __DEC64_MAX_EXP__ 385
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_MAX_EXP__ 6145
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __REGISTER_PREFIX__ 
#define __USER_LABEL_PREFIX__ 
#define _FORTIFY_SOURCE 2
#define __GNUC_GNU_INLINE__ 1
#define __NO_INLINE__ 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __SSP__ 1
#define __SIZEOF_INT128__ 16
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZEOF_PTRDIFF_T__ 8
#define __amd64 1
#define __amd64__ 1
#define __x86_64 1
#define __x86_64__ 1
#define __k8 1
#define __k8__ 1
#define __MMX__ 1
#define __SSE__ 1
#define __SSE2__ 1
#define __SSE_MATH__ 1
#define __SSE2_MATH__ 1
#define __gnu_linux__ 1
#define __linux 1
#define __linux__ 1
#define linux 1
#define __unix 1
#define __unix__ 1
#define unix 1
#define __ELF__ 1
#define __DECIMAL_BID_FORMAT__ 1
#define _DARWIN_C_SOURCE 1
#define KERNEL 1
#define XNU_KERNEL_PRIVATE 1
#define __LITTLE_ENDIAN__ 1
#define BSD_KERNEL_PRIVATE 1
#define KERNEL_PRIVATE 1

#define __private_extern__ 
#define _KERNEL_STDINT_H_ 
#define _BSD_MACHINE_TYPES_H_ 
#define _MACHTYPES_H_ 
#define _BSD_I386__TYPES_H_ 
typedef __signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
typedef int __darwin_ct_rune_t;
typedef union {
 char __mbstate8[128];
 long long _mbstateL;
} __mbstate_t;
typedef __mbstate_t __darwin_mbstate_t;
typedef long int __darwin_ptrdiff_t;
typedef long unsigned int __darwin_size_t;
typedef __builtin_va_list __darwin_va_list;
typedef int __darwin_wchar_t;
typedef __darwin_wchar_t __darwin_rune_t;
typedef unsigned int __darwin_wint_t;
typedef unsigned long __darwin_clock_t;
typedef __uint32_t __darwin_socklen_t;
typedef long __darwin_ssize_t;
typedef long __darwin_time_t;
#define _CDEFS_H_ 
#define __BEGIN_DECLS 
#define __END_DECLS 
#define __P(protos) protos
#define __CONCAT(x,y) x ## y
#define __STRING(x) #x
#define __const const
#define __signed signed
#define __volatile volatile
#define __dead2 __attribute__((noreturn))
#define __pure2 __attribute__((const))
#define __unused __attribute__((unused))
#define __used __attribute__((used))
#define __deprecated __attribute__((deprecated))
#define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
#define __deprecated_enum_msg(_msg) 
#define __unavailable __attribute__((unavailable))
#define __dead 
#define __pure 
#define __restrict 
#define __header_inline extern __inline
#define __header_always_inline __header_inline __attribute__ ((__always_inline__))
#define __printflike(fmtarg,firstvararg) __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg,firstvararg) __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __IDSTRING(name,string) static const char name[] __used = string
#define __COPYRIGHT(s) __IDSTRING(copyright,s)
#define __RCSID(s) __IDSTRING(rcsid,s)
#define __SCCSID(s) __IDSTRING(sccsid,s)
#define __PROJECT_VERSION(s) __IDSTRING(project_version,s)
#define __FBSDID(s) 
#define __DECONST(type,var) __CAST_AWAY_QUALIFIER(var, const, type)
#define __DEVOLATILE(type,var) __CAST_AWAY_QUALIFIER(var, volatile, type)
#define __DEQUALIFY(type,var) __CAST_AWAY_QUALIFIER(var, const volatile, type)
#define __DARWIN_ONLY_64_BIT_INO_T 0
#define __DARWIN_ONLY_UNIX_CONFORMANCE 0
#define __DARWIN_ONLY_VERS_1050 0
#define __DARWIN_SUF_DARWIN10 "_darwin10"
#define __DARWIN10_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_DARWIN10)
#define __DARWIN_UNIX03 0
#define __DARWIN_64_BIT_INO_T 0
#define __DARWIN_VERS_1050 0
#define __DARWIN_NON_CANCELABLE 0
#define __DARWIN_SUF_UNIX03 
#define __DARWIN_SUF_64_BIT_INO_T 
#define __DARWIN_SUF_NON_CANCELABLE 
#define __DARWIN_SUF_1050 
#define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN"
#define __DARWIN_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03)
#define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
#define __DARWIN_ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
#define __DARWIN_INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T)
#define __DARWIN_1050(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050)
#define __DARWIN_1050ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03)
#define __DARWIN_1050ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
#define __DARWIN_1050ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
#define __DARWIN_1050INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T)
#define __DARWIN_EXTSN(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN)
#define __DARWIN_EXTSN_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE)
#define __DARWIN_ALIAS_STARTING(_mac,_iphone,x) 
#define __POSIX_C_DEPRECATED(ver) 
#define __DARWIN_C_ANSI 010000L
#define __DARWIN_C_FULL 900000L
#define __DARWIN_C_LEVEL __DARWIN_C_FULL
#define __STDC_WANT_LIB_EXT1__ 1
#define __DARWIN_NO_LONG_LONG (defined(__STRICT_ANSI__) && (__STDC_VERSION__-0 < 199901L) && !defined(__GNUG__))
#define __CAST_AWAY_QUALIFIER(variable,qualifier,type) (type) (long)(variable)
#define __XNU_PRIVATE_EXTERN __attribute__((visibility("hidden")))
#define _INT8_T 
typedef signed char int8_t;
#define _INT16_T 
typedef short int16_t;
#define _INT32_T 
typedef int int32_t;
#define _INT64_T 
typedef long long int64_t;
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned long long u_int64_t;
typedef int64_t register_t;
#define _INTPTR_T 
typedef __darwin_intptr_t intptr_t;
#define _UINTPTR_T 
typedef unsigned long uintptr_t;
typedef u_int64_t user_addr_t;
typedef u_int64_t user_size_t;
typedef int64_t user_ssize_t;
typedef int64_t user_long_t;
typedef u_int64_t user_ulong_t;
typedef int64_t user_time_t;
typedef int64_t user_off_t;
#define USER_ADDR_NULL ((user_addr_t) 0)
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
typedef __uint64_t user64_addr_t __attribute__((aligned(8)));
typedef __uint64_t user64_size_t __attribute__((aligned(8)));
typedef __int64_t user64_ssize_t __attribute__((aligned(8)));
typedef __int64_t user64_long_t __attribute__((aligned(8)));
typedef __uint64_t user64_ulong_t __attribute__((aligned(8)));
typedef __int64_t user64_time_t __attribute__((aligned(8)));
typedef __int64_t user64_off_t __attribute__((aligned(8)));
typedef __uint32_t user32_addr_t;
typedef __uint32_t user32_size_t;
typedef __int32_t user32_ssize_t;
typedef __int32_t user32_long_t;
typedef __uint32_t user32_ulong_t;
typedef __int32_t user32_time_t;
typedef __int64_t user32_off_t __attribute__((aligned(4)));
typedef u_int64_t syscall_arg_t;
#define __offsetof(type,field) ((size_t)(&((type *)0)->field))
#define __WORDSIZE 64
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
typedef u_int64_t uint64_t;
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
#define INT8_MAX 127
#define INT16_MAX 32767
#define INT32_MAX 2147483647
#define INT64_MAX 9223372036854775807LL
#define INT8_MIN -128
#define INT16_MIN -32768
#define INT32_MIN (-INT32_MAX-1)
#define INT64_MIN (-INT64_MAX-1)
#define UINT8_MAX 255
#define UINT16_MAX 65535
#define UINT32_MAX 4294967295U
#define UINT64_MAX 18446744073709551615ULL
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
#define RSIZE_MAX (SIZE_MAX >> 1)
#define WCHAR_MAX __WCHAR_MAX__
#define WCHAR_MIN (-WCHAR_MAX-1)
#define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
#define INT8_C(v) (v)
#define INT16_C(v) (v)
#define INT32_C(v) (v)
#define INT64_C(v) (v ## LL)
#define UINT8_C(v) (v ## U)
#define UINT16_C(v) (v ## U)
#define UINT32_C(v) (v ## U)
#define UINT64_C(v) (v ## ULL)
#define INTMAX_C(v) (v ## LL)
#define UINTMAX_C(v) (v ## ULL)
#define _SYS_SELECT_H_ 
#define __SYS_APPLEAPIOPTS_H__ 
#define __APPLE_API_STANDARD 
#define __APPLE_API_STABLE 
#define __APPLE_API_EVOLVING 
#define __APPLE_API_UNSTABLE 
#define __APPLE_API_PRIVATE 
#define __APPLE_API_OBSOLETE 
#define _SYS__TYPES_H_ 
#define _BSD_MACHINE__TYPES_H_ 
#define __PTHREAD_SIZE__ 1168
#define __PTHREAD_ATTR_SIZE__ 56
#define __PTHREAD_MUTEXATTR_SIZE__ 8
#define __PTHREAD_MUTEX_SIZE__ 56
#define __PTHREAD_CONDATTR_SIZE__ 8
#define __PTHREAD_COND_SIZE__ 40
#define __PTHREAD_ONCE_SIZE__ 8
#define __PTHREAD_RWLOCK_SIZE__ 192
#define __PTHREAD_RWLOCKATTR_SIZE__ 16
struct __darwin_pthread_handler_rec
{
 void (*__routine)(void *);
 void *__arg;
 struct __darwin_pthread_handler_rec *__next;
};
struct _opaque_pthread_attr_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_cond_t { long __sig; char __opaque[40]; };
struct _opaque_pthread_condattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_mutex_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_once_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_rwlock_t { long __sig; char __opaque[192]; };
struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[16]; };
struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[1168]; };
#define __DARWIN_NULL ((void *)0)
typedef __int64_t __darwin_blkcnt_t;
typedef __int32_t __darwin_blksize_t;
typedef __int32_t __darwin_dev_t;
typedef unsigned int __darwin_fsblkcnt_t;
typedef unsigned int __darwin_fsfilcnt_t;
typedef __uint32_t __darwin_gid_t;
typedef __uint32_t __darwin_id_t;
typedef __uint64_t __darwin_ino64_t;
typedef __uint32_t __darwin_ino_t;
typedef __darwin_natural_t __darwin_mach_port_name_t;
typedef __darwin_mach_port_name_t __darwin_mach_port_t;
typedef __uint16_t __darwin_mode_t;
typedef __int64_t __darwin_off_t;
typedef __int32_t __darwin_pid_t;
typedef struct _opaque_pthread_attr_t
   __darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t
   __darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t
   __darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t
   __darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t
   __darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t
   __darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t
   __darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t
   __darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t
   *__darwin_pthread_t;
typedef __uint32_t __darwin_sigset_t;
typedef __int32_t __darwin_suseconds_t;
typedef __uint32_t __darwin_uid_t;
typedef __uint32_t __darwin_useconds_t;
typedef unsigned char __darwin_uuid_t[16];
typedef char __darwin_uuid_string_t[37];
#define offsetof(type,member) ((size_t)(&((type *)0)->member))
#define _FD_SET 
#define __DARWIN_FD_SETSIZE 1024
#define __DARWIN_NBBY 8
#define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY)
#define __DARWIN_howmany(x,y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1))

typedef struct fd_set {
 __int32_t fds_bits[((((1024) % ((sizeof(__int32_t) * 8))) == 0) ? ((1024) / ((sizeof(__int32_t) * 8))) : (((1024) / ((sizeof(__int32_t) * 8))) + 1))];
} fd_set;

static __inline int
__darwin_fd_isset(int _n, const struct fd_set *_p)
{
 return (_p->fds_bits[(unsigned long)_n/(sizeof(__int32_t) * 8)] & ((__int32_t)(1<<((unsigned long)_n % (sizeof(__int32_t) * 8)))));
}
#define __DARWIN_FD_SET(n,p) do { int __fd = (n); ((p)->fds_bits[(unsigned long)__fd/__DARWIN_NFDBITS] |= ((__int32_t)(1<<((unsigned long)__fd % __DARWIN_NFDBITS)))); } while(0)
#define __DARWIN_FD_CLR(n,p) do { int __fd = (n); ((p)->fds_bits[(unsigned long)__fd/__DARWIN_NFDBITS] &= ~((__int32_t)(1<<((unsigned long)__fd % __DARWIN_NFDBITS)))); } while(0)
#define __DARWIN_FD_ISSET(n,p) __darwin_fd_isset((n), (p))
#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p)))
#define __DARWIN_FD_COPY(f,t) bcopy(f, t, sizeof(*(f)))
#define _STRUCT_TIMESPEC struct timespec
struct timespec
{
 __darwin_time_t tv_sec;
 long tv_nsec;
};
#define _STRUCT_TIMEVAL struct timeval
struct timeval
{
 __darwin_time_t tv_sec;
 __darwin_suseconds_t tv_usec;
};
#define _TIME_T 
typedef __darwin_time_t time_t;
#define _SUSECONDS_T 
typedef __darwin_suseconds_t suseconds_t;
#define _SIGSET_T 
typedef __darwin_sigset_t sigset_t;
#define FD_SETSIZE __DARWIN_FD_SETSIZE
#define FD_SET(n,p) __DARWIN_FD_SET(n, p)
#define FD_CLR(n,p) __DARWIN_FD_CLR(n, p)
#define FD_ISSET(n,p) __DARWIN_FD_ISSET(n, p)
#define FD_ZERO(p) __DARWIN_FD_ZERO(p)
#define FD_COPY(f,t) __DARWIN_FD_COPY(f, t)
#define _KERN_WAIT_QUEUE_H_ 
#define _MACH_MACH_TYPES_H_ 
#define _MACH_HOST_INFO_H_ 
#define _MACH_MESSAGE_H_ 
#define _MACH_PORT_H_ 
#define _MACH_BOOLEAN_H_ 
#define _MACH_MACHINE_BOOLEAN_H_ 
#define _MACH_I386_BOOLEAN_H_ 
typedef int boolean_t;
#define TRUE 1
#define FALSE 0
#define _MACH_MACHINE_VM_TYPES_H_ 
#define _MACH_I386_VM_TYPES_H_ 
#define _MACH_I386_VM_PARAM_H_ 
#define BYTE_SIZE 8
#define I386_PGBYTES 4096
#define I386_PGSHIFT 12
#define PAGE_SIZE I386_PGBYTES
#define PAGE_SHIFT I386_PGSHIFT
#define PAGE_MASK (PAGE_SIZE - 1)
#define I386_LPGBYTES 2*1024*1024
#define I386_LPGSHIFT 21
#define I386_LPGMASK (I386_LPGBYTES-1)
#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT))
#define machine_btop(x) i386_btop(x)
#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT)
#define machine_ptob(x) i386_ptob(x)
#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & ~(I386_PGBYTES-1))
#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1))
#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL)
#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL)
#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL)
#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL)
#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL)
#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL)
#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL)
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS)
#define VM_MIN_ADDRESS ((vm_offset_t) 0)
#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000)
#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000)
#define KB (1024ULL)
#define MB (1024*KB)
#define GB (1024*MB)
#define K32_MAXMEM (32*GB)
#define K64_MAXMEM (128*GB)
#define KERNEL_MAXMEM K64_MAXMEM
#define KERNEL_IMAGE_TO_PHYS(x) (x)
#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t) 0xFFFFFF8000000000UL)
#define VM_MIN_KERNEL_PAGE ((ppnum_t)0)
#define VM_MIN_KERNEL_AND_KEXT_ADDRESS (VM_MIN_KERNEL_ADDRESS - 0x80000000ULL)
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t) 0xFFFFFFFFFFFFEFFFUL)
#define VM_MAX_KERNEL_ADDRESS_EFI32 ((vm_offset_t) 0xFFFFFF80FFFFEFFFUL)
#define KEXT_ALLOC_MAX_OFFSET (2 * 1024 * 1024 * 1024UL)
#define KEXT_ALLOC_BASE(x) ((x) - KEXT_ALLOC_MAX_OFFSET)
#define KEXT_ALLOC_SIZE(x) (KEXT_ALLOC_MAX_OFFSET - (x))
#define KERNEL_STACK_SIZE (I386_PGBYTES*4)
#define VM_MAP_MIN_ADDRESS MACH_VM_MIN_ADDRESS
#define VM_MAP_MAX_ADDRESS MACH_VM_MAX_ADDRESS
#define INTSTACK_SIZE (I386_PGBYTES*4)
typedef __darwin_natural_t natural_t;
typedef int integer_t;
typedef uintptr_t vm_offset_t;
typedef uintptr_t vm_size_t;
typedef uint64_t mach_vm_address_t;
typedef uint64_t mach_vm_offset_t;
typedef uint64_t mach_vm_size_t;
typedef uint64_t vm_map_offset_t;
typedef uint64_t vm_map_address_t;
typedef uint64_t vm_map_size_t;
typedef mach_vm_address_t mach_port_context_t;
#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
typedef natural_t mach_port_name_t;
typedef mach_port_name_t *mach_port_name_array_t;
struct ipc_port ;
typedef struct ipc_port *ipc_port_t;
#define IPC_PORT_NULL ((ipc_port_t) 0UL)
#define IPC_PORT_DEAD ((ipc_port_t)~0UL)
#define IPC_PORT_VALID(port) ((port) != IPC_PORT_NULL && (port) != IPC_PORT_DEAD)
typedef ipc_port_t mach_port_t;
#define CAST_MACH_PORT_TO_NAME(x) ((mach_port_name_t)(uintptr_t)(x))
#define CAST_MACH_NAME_TO_PORT(x) ((x) == MACH_PORT_DEAD ? (mach_port_t)IPC_PORT_DEAD : (mach_port_t)(uintptr_t)(x))
typedef mach_port_t *mach_port_array_t;
#define MACH_PORT_NULL 0
#define MACH_PORT_DEAD ((mach_port_name_t) ~0)
#define MACH_PORT_VALID(name) (((name) != MACH_PORT_NULL) && ((name) != MACH_PORT_DEAD))
#define MACH_PORT_INDEX(name) ((name) >> 8)
#define MACH_PORT_GEN(name) (((name) & 0xff) << 24)
#define MACH_PORT_MAKE(index,gen) (((index) << 8) | (gen) >> 24)
typedef natural_t mach_port_right_t;
#define MACH_PORT_RIGHT_SEND ((mach_port_right_t) 0)
#define MACH_PORT_RIGHT_RECEIVE ((mach_port_right_t) 1)
#define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2)
#define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3)
#define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4)
#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5)
#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6)
typedef natural_t mach_port_type_t;
typedef mach_port_type_t *mach_port_type_array_t;
#define MACH_PORT_TYPE(right) ((mach_port_type_t)(((mach_port_type_t) 1) << ((right) + ((mach_port_right_t) 16))))
#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH)
#define MACH_PORT_TYPE_SEND_RECEIVE (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
#define MACH_PORT_TYPE_SEND_RIGHTS (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
#define MACH_PORT_TYPE_PORT_RIGHTS (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
#define MACH_PORT_TYPE_PORT_OR_DEAD (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
#define MACH_PORT_TYPE_ALL_RIGHTS (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
#define MACH_PORT_TYPE_DNREQUEST 0x80000000
#define MACH_PORT_TYPE_SPREQUEST 0x40000000
#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
typedef natural_t mach_port_urefs_t;
typedef integer_t mach_port_delta_t;
typedef natural_t mach_port_seqno_t;
typedef natural_t mach_port_mscount_t;
typedef natural_t mach_port_msgcount_t;
typedef natural_t mach_port_rights_t;
#define MACH_PORT_SRIGHTS_NONE 0
#define MACH_PORT_SRIGHTS_PRESENT 1
typedef unsigned int mach_port_srights_t;
typedef struct mach_port_status {
 mach_port_rights_t mps_pset;
 mach_port_seqno_t mps_seqno;
 mach_port_mscount_t mps_mscount;
 mach_port_msgcount_t mps_qlimit;
 mach_port_msgcount_t mps_msgcount;
 mach_port_rights_t mps_sorights;
 boolean_t mps_srights;
 boolean_t mps_pdrequest;
 boolean_t mps_nsrequest;
 natural_t mps_flags;
} mach_port_status_t;
#define MACH_PORT_QLIMIT_ZERO ((mach_port_msgcount_t) 0)
#define MACH_PORT_QLIMIT_BASIC ((mach_port_msgcount_t) 5)
#define MACH_PORT_QLIMIT_SMALL ((mach_port_msgcount_t) 16)
#define MACH_PORT_QLIMIT_LARGE ((mach_port_msgcount_t) 1024)
#define MACH_PORT_QLIMIT_KERNEL ((mach_port_msgcount_t) 65536)
#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO
#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC
#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE
typedef struct mach_port_limits {
 mach_port_msgcount_t mpl_qlimit;
} mach_port_limits_t;
#define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01
#define MACH_PORT_STATUS_FLAG_GUARDED 0x02
#define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04
#define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08
#define MACH_PORT_STATUS_FLAG_REVIVE 0x10
#define MACH_PORT_STATUS_FLAG_TASKPTR 0x20
typedef struct mach_port_info_ext {
 mach_port_status_t mpie_status;
 mach_port_msgcount_t mpie_boost_cnt;
 uint32_t reserved[6];
} mach_port_info_ext_t;
typedef integer_t *mach_port_info_t;
typedef int mach_port_flavor_t;
#define MACH_PORT_LIMITS_INFO 1
#define MACH_PORT_RECEIVE_STATUS 2
#define MACH_PORT_DNREQUESTS_SIZE 3
#define MACH_PORT_TEMPOWNER 4
#define MACH_PORT_IMPORTANCE_RECEIVER 5
#define MACH_PORT_INFO_EXT 7
#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) (sizeof(mach_port_limits_t)/sizeof(natural_t)))
#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) (sizeof(mach_port_status_t)/sizeof(natural_t)))
#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1
#define MACH_PORT_INFO_EXT_COUNT ((natural_t) (sizeof(mach_port_info_ext_t)/sizeof(natural_t)))
typedef struct mach_port_qos {
 unsigned int name:1;
 unsigned int prealloc:1;
 boolean_t pad1:30;
 natural_t len;
} mach_port_qos_t;
#define MPO_CONTEXT_AS_GUARD 0x01
#define MPO_QLIMIT 0x02
#define MPO_TEMPOWNER 0x04
#define MPO_IMPORTANCE_RECEIVER 0x08
#define MPO_INSERT_SEND_RIGHT 0x10
#define MPO_STRICT 0x20
typedef struct mach_port_options {
 uint32_t flags;
 mach_port_limits_t mpl;
 uint64_t reserved[2];
}mach_port_options_t;
typedef mach_port_options_t *mach_port_options_ptr_t;
#define GUARD_TYPE_MACH_PORT 0x1
enum mach_port_guard_exception_codes {
 kGUARD_EXC_DESTROY = 1u << 0,
 kGUARD_EXC_MOD_REFS = 1u << 1,
 kGUARD_EXC_SET_CONTEXT = 1u << 2,
 kGUARD_EXC_UNGUARDED = 1u << 3,
 kGUARD_EXC_INCORRECT_GUARD = 1u << 4
};
typedef mach_port_t port_t;
typedef mach_port_name_t port_name_t;
typedef mach_port_name_t *port_name_array_t;
#define PORT_NULL ((port_t) 0)
#define PORT_DEAD ((port_t) ~0)
#define PORT_VALID(name) ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)
#define _MACH_KERN_RETURN_H_ 
#define _MACH_MACHINE_KERN_RETURN_H_ 
#define _MACH_I386_KERN_RETURN_H_ 
typedef int kern_return_t;
#define KERN_SUCCESS 0
#define KERN_INVALID_ADDRESS 1
#define KERN_PROTECTION_FAILURE 2
#define KERN_NO_SPACE 3
#define KERN_INVALID_ARGUMENT 4
#define KERN_FAILURE 5
#define KERN_RESOURCE_SHORTAGE 6
#define KERN_NOT_RECEIVER 7
#define KERN_NO_ACCESS 8
#define KERN_MEMORY_FAILURE 9
#define KERN_MEMORY_ERROR 10
#define KERN_ALREADY_IN_SET 11
#define KERN_NOT_IN_SET 12
#define KERN_NAME_EXISTS 13
#define KERN_ABORTED 14
#define KERN_INVALID_NAME 15
#define KERN_INVALID_TASK 16
#define KERN_INVALID_RIGHT 17
#define KERN_INVALID_VALUE 18
#define KERN_UREFS_OVERFLOW 19
#define KERN_INVALID_CAPABILITY 20
#define KERN_RIGHT_EXISTS 21
#define KERN_INVALID_HOST 22
#define KERN_MEMORY_PRESENT 23
#define KERN_MEMORY_DATA_MOVED 24
#define KERN_MEMORY_RESTART_COPY 25
#define KERN_INVALID_PROCESSOR_SET 26
#define KERN_POLICY_LIMIT 27
#define KERN_INVALID_POLICY 28
#define KERN_INVALID_OBJECT 29
#define KERN_ALREADY_WAITING 30
#define KERN_DEFAULT_SET 31
#define KERN_EXCEPTION_PROTECTED 32
#define KERN_INVALID_LEDGER 33
#define KERN_INVALID_MEMORY_CONTROL 34
#define KERN_INVALID_SECURITY 35
#define KERN_NOT_DEPRESSED 36
#define KERN_TERMINATED 37
#define KERN_LOCK_SET_DESTROYED 38
#define KERN_LOCK_UNSTABLE 39
#define KERN_LOCK_OWNED 40
#define KERN_LOCK_OWNED_SELF 41
#define KERN_SEMAPHORE_DESTROYED 42
#define KERN_RPC_SERVER_TERMINATED 43
#define KERN_RPC_TERMINATE_ORPHAN 44
#define KERN_RPC_CONTINUE_ORPHAN 45
#define KERN_NOT_SUPPORTED 46
#define KERN_NODE_DOWN 47
#define KERN_NOT_WAITING 48
#define KERN_OPERATION_TIMED_OUT 49
#define KERN_CODESIGN_ERROR 50
#define KERN_RETURN_MAX 0x100
typedef natural_t mach_msg_timeout_t;
#define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0)
#define MACH_MSGH_BITS_ZERO 0x00000000
#define MACH_MSGH_BITS_REMOTE_MASK 0x000000ff
#define MACH_MSGH_BITS_LOCAL_MASK 0x0000ff00
#define MACH_MSGH_BITS_COMPLEX 0x80000000U
#define MACH_MSGH_BITS_USER 0x8000ffffU
#define MACH_MSGH_BITS_CIRCULAR 0x40000000
#define MACH_MSGH_BITS_RAISEIMP 0x20000000
#define MACH_MSGH_BITS_IMPHOLDASRT 0x10000000
#define MACH_MSGH_BITS_USED 0xf000ffffU
#define MACH_MSGH_BITS_PORTS_MASK (MACH_MSGH_BITS_REMOTE_MASK|MACH_MSGH_BITS_LOCAL_MASK)
#define MACH_MSGH_BITS(remote,local) ((remote) | ((local) << 8))
#define MACH_MSGH_BITS_REMOTE(bits) ((bits) & MACH_MSGH_BITS_REMOTE_MASK)
#define MACH_MSGH_BITS_LOCAL(bits) (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8)
#define MACH_MSGH_BITS_PORTS(bits) ((bits) & MACH_MSGH_BITS_PORTS_MASK)
#define MACH_MSGH_BITS_OTHER(bits) ((bits) &~ MACH_MSGH_BITS_PORTS_MASK)
typedef unsigned int mach_msg_bits_t;
typedef natural_t mach_msg_size_t;
typedef integer_t mach_msg_id_t;
#define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0
typedef unsigned int mach_msg_type_name_t;
#define MACH_MSG_TYPE_MOVE_RECEIVE 16
#define MACH_MSG_TYPE_MOVE_SEND 17
#define MACH_MSG_TYPE_MOVE_SEND_ONCE 18
#define MACH_MSG_TYPE_COPY_SEND 19
#define MACH_MSG_TYPE_MAKE_SEND 20
#define MACH_MSG_TYPE_MAKE_SEND_ONCE 21
#define MACH_MSG_TYPE_COPY_RECEIVE 22
typedef unsigned int mach_msg_copy_options_t;
#define MACH_MSG_PHYSICAL_COPY 0
#define MACH_MSG_VIRTUAL_COPY 1
#define MACH_MSG_ALLOCATE 2
#define MACH_MSG_OVERWRITE 3
typedef unsigned int mach_msg_descriptor_type_t;
#define MACH_MSG_PORT_DESCRIPTOR 0
#define MACH_MSG_OOL_DESCRIPTOR 1
#define MACH_MSG_OOL_PORTS_DESCRIPTOR 2
#define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3
#pragma pack(4)
typedef struct
{
  natural_t pad1;
  mach_msg_size_t pad2;
  unsigned int pad3 : 24;
  mach_msg_descriptor_type_t type : 8;
} mach_msg_type_descriptor_t;
typedef struct
{
  mach_port_t name;
  unsigned int pad2 : 16;
  mach_msg_type_name_t disposition : 8;
  mach_msg_descriptor_type_t type : 8;
  uint32_t pad_end;
} mach_msg_port_descriptor_t;
typedef struct
{
  uint32_t address;
  mach_msg_size_t size;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  unsigned int pad1: 8;
  mach_msg_descriptor_type_t type: 8;
} mach_msg_ool_descriptor32_t;
typedef struct
{
  uint64_t address;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  unsigned int pad1: 8;
  mach_msg_descriptor_type_t type: 8;
  mach_msg_size_t size;
} mach_msg_ool_descriptor64_t;
typedef struct
{
  void* address;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  unsigned int pad1: 8;
  mach_msg_descriptor_type_t type: 8;
  mach_msg_size_t size;
} mach_msg_ool_descriptor_t;
typedef struct
{
  uint32_t address;
  mach_msg_size_t count;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  mach_msg_type_name_t disposition : 8;
  mach_msg_descriptor_type_t type : 8;
} mach_msg_ool_ports_descriptor32_t;
typedef struct
{
  uint64_t address;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  mach_msg_type_name_t disposition : 8;
  mach_msg_descriptor_type_t type : 8;
  mach_msg_size_t count;
} mach_msg_ool_ports_descriptor64_t;
typedef struct
{
  void* address;
  boolean_t deallocate: 8;
  mach_msg_copy_options_t copy: 8;
  mach_msg_type_name_t disposition : 8;
  mach_msg_descriptor_type_t type : 8;
  mach_msg_size_t count;
} mach_msg_ool_ports_descriptor_t;
typedef union
{
  mach_msg_port_descriptor_t port;
  mach_msg_ool_descriptor32_t out_of_line;
  mach_msg_ool_ports_descriptor32_t ool_ports;
  mach_msg_type_descriptor_t type;
} mach_msg_descriptor_t;
typedef struct
{
        mach_msg_size_t msgh_descriptor_count;
} mach_msg_body_t;
#define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0
#define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0
typedef struct
{
  mach_msg_bits_t msgh_bits;
  mach_msg_size_t msgh_size;
  mach_port_t msgh_remote_port;
  mach_port_t msgh_local_port;
  mach_msg_size_t msgh_reserved;
  mach_msg_id_t msgh_id;
} mach_msg_header_t;
#define MACH_MSG_NULL (mach_msg_header_t *) 0
typedef struct
{
        mach_msg_header_t header;
        mach_msg_body_t body;
} mach_msg_base_t;
typedef unsigned int mach_msg_trailer_type_t;
#define MACH_MSG_TRAILER_FORMAT_0 0
typedef unsigned int mach_msg_trailer_size_t;
typedef char *mach_msg_trailer_info_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
} mach_msg_trailer_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
  mach_port_seqno_t msgh_seqno;
} mach_msg_seqno_trailer_t;
typedef struct
{
  unsigned int val[2];
} security_token_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
  mach_port_seqno_t msgh_seqno;
  security_token_t msgh_sender;
} mach_msg_security_trailer_t;
typedef struct
{
  unsigned int val[8];
} audit_token_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
  mach_port_seqno_t msgh_seqno;
  security_token_t msgh_sender;
  audit_token_t msgh_audit;
} mach_msg_audit_trailer_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
  mach_port_seqno_t msgh_seqno;
  security_token_t msgh_sender;
  audit_token_t msgh_audit;
  mach_port_context_t msgh_context;
} mach_msg_context_trailer_t;
typedef struct
{
  mach_port_name_t sender;
} msg_labels_t;
typedef struct
{
  mach_msg_trailer_type_t msgh_trailer_type;
  mach_msg_trailer_size_t msgh_trailer_size;
  mach_port_seqno_t msgh_seqno;
  security_token_t msgh_sender;
  audit_token_t msgh_audit;
  mach_port_context_t msgh_context;
  int msgh_ad;
  msg_labels_t msgh_labels;
} mach_msg_mac_trailer_t;
#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t)
typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t;
#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t))
typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t;
#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t)
#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} }
extern security_token_t KERNEL_SECURITY_TOKEN;
#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} }
extern audit_token_t KERNEL_AUDIT_TOKEN;
typedef integer_t mach_msg_options_t;
typedef struct
{
  mach_msg_header_t header;
} mach_msg_empty_send_t;
typedef struct
{
  mach_msg_header_t header;
  mach_msg_trailer_t trailer;
} mach_msg_empty_rcv_t;
typedef union
{
  mach_msg_empty_send_t send;
  mach_msg_empty_rcv_t rcv;
} mach_msg_empty_t;
#pragma pack()
#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & ~(sizeof (natural_t) - 1))
#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0)
#define MACH_MSG_SIZE_RELIABLE ((mach_msg_size_t) 256 * 1024)
#define MACH_MSGH_KIND_NORMAL 0x00000000
#define MACH_MSGH_KIND_NOTIFICATION 0x00000001
#define msgh_kind msgh_seqno
#define mach_msg_kind_t mach_port_seqno_t
typedef natural_t mach_msg_type_size_t;
typedef natural_t mach_msg_type_number_t;
#define MACH_MSG_TYPE_PORT_NONE 0
#define MACH_MSG_TYPE_PORT_NAME 15
#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE
#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND
#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE
#define MACH_MSG_TYPE_LAST 22
#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1)
#define MACH_MSG_TYPE_PORT_ANY(x) (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
#define MACH_MSG_TYPE_PORT_ANY_SEND(x) (((x) >= MACH_MSG_TYPE_MOVE_SEND) && ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
typedef integer_t mach_msg_option_t;
#define MACH_MSG_OPTION_NONE 0x00000000
#define MACH_SEND_MSG 0x00000001
#define MACH_RCV_MSG 0x00000002
#define MACH_RCV_LARGE 0x00000004
#define MACH_RCV_LARGE_IDENTITY 0x00000008
#define MACH_SEND_TIMEOUT 0x00000010
#define MACH_SEND_INTERRUPT 0x00000040
#define MACH_SEND_NOTIFY 0x00000080
#define MACH_SEND_ALWAYS 0x00010000
#define MACH_SEND_TRAILER 0x00020000
#define MACH_SEND_NOIMPORTANCE 0x00040000
#define MACH_SEND_IMPORTANCE 0x00080000
#define MACH_RCV_TIMEOUT 0x00000100
#define MACH_RCV_NOTIFY 0x00000200
#define MACH_RCV_INTERRUPT 0x00000400
#define MACH_RCV_OVERWRITE 0x00001000
#define MACH_RCV_TRAILER_NULL 0
#define MACH_RCV_TRAILER_SEQNO 1
#define MACH_RCV_TRAILER_SENDER 2
#define MACH_RCV_TRAILER_AUDIT 3
#define MACH_RCV_TRAILER_CTX 4
#define MACH_RCV_TRAILER_AV 7
#define MACH_RCV_TRAILER_LABELS 8
#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28)
#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24)
#define MACH_RCV_TRAILER_MASK ((0xf << 24))
#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf)
#define REQUESTED_TRAILER_SIZE_NATIVE(y) ((mach_msg_trailer_size_t) ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? sizeof(mach_msg_trailer_t) : ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? sizeof(mach_msg_seqno_trailer_t) : ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? sizeof(mach_msg_security_trailer_t) : ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? sizeof(mach_msg_audit_trailer_t) : ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? sizeof(mach_msg_context_trailer_t) : ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? sizeof(mach_msg_mac_trailer_t) : sizeof(mach_msg_max_trailer_t))))))))
#define REQUESTED_TRAILER_SIZE(is64,y) REQUESTED_TRAILER_SIZE_NATIVE(y)
typedef kern_return_t mach_msg_return_t;
#define MACH_MSG_SUCCESS 0x00000000
#define MACH_MSG_MASK 0x00003e00
#define MACH_MSG_IPC_SPACE 0x00002000
#define MACH_MSG_VM_SPACE 0x00001000
#define MACH_MSG_IPC_KERNEL 0x00000800
#define MACH_MSG_VM_KERNEL 0x00000400
#define MACH_SEND_IN_PROGRESS 0x10000001
#define MACH_SEND_INVALID_DATA 0x10000002
#define MACH_SEND_INVALID_DEST 0x10000003
#define MACH_SEND_TIMED_OUT 0x10000004
#define MACH_SEND_INTERRUPTED 0x10000007
#define MACH_SEND_MSG_TOO_SMALL 0x10000008
#define MACH_SEND_INVALID_REPLY 0x10000009
#define MACH_SEND_INVALID_RIGHT 0x1000000a
#define MACH_SEND_INVALID_NOTIFY 0x1000000b
#define MACH_SEND_INVALID_MEMORY 0x1000000c
#define MACH_SEND_NO_BUFFER 0x1000000d
#define MACH_SEND_TOO_LARGE 0x1000000e
#define MACH_SEND_INVALID_TYPE 0x1000000f
#define MACH_SEND_INVALID_HEADER 0x10000010
#define MACH_SEND_INVALID_TRAILER 0x10000011
#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015
#define MACH_RCV_IN_PROGRESS 0x10004001
#define MACH_RCV_INVALID_NAME 0x10004002
#define MACH_RCV_TIMED_OUT 0x10004003
#define MACH_RCV_TOO_LARGE 0x10004004
#define MACH_RCV_INTERRUPTED 0x10004005
#define MACH_RCV_PORT_CHANGED 0x10004006
#define MACH_RCV_INVALID_NOTIFY 0x10004007
#define MACH_RCV_INVALID_DATA 0x10004008
#define MACH_RCV_PORT_DIED 0x10004009
#define MACH_RCV_IN_SET 0x1000400a
#define MACH_RCV_HEADER_ERROR 0x1000400b
#define MACH_RCV_BODY_ERROR 0x1000400c
#define MACH_RCV_INVALID_TYPE 0x1000400d
#define MACH_RCV_SCATTER_SMALL 0x1000400e
#define MACH_RCV_INVALID_TRAILER 0x1000400f
#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011

extern mach_msg_return_t mach_msg_overwrite(
     mach_msg_header_t *msg,
     mach_msg_option_t option,
     mach_msg_size_t send_size,
     mach_msg_size_t rcv_size,
     mach_port_name_t rcv_name,
     mach_msg_timeout_t timeout,
     mach_port_name_t notify,
     mach_msg_header_t *rcv_msg,
     mach_msg_size_t rcv_limit);

#define _MACH_VM_STATISTICS_H_ 
struct vm_statistics {
 natural_t free_count;
 natural_t active_count;
 natural_t inactive_count;
 natural_t wire_count;
 natural_t zero_fill_count;
 natural_t reactivations;
 natural_t pageins;
 natural_t pageouts;
 natural_t faults;
 natural_t cow_faults;
 natural_t lookups;
 natural_t hits;
 natural_t purgeable_count;
 natural_t purges;
 natural_t speculative_count;
};
typedef struct vm_statistics *vm_statistics_t;
typedef struct vm_statistics vm_statistics_data_t;
struct vm_statistics64 {
 natural_t free_count;
 natural_t active_count;
 natural_t inactive_count;
 natural_t wire_count;
 uint64_t zero_fill_count;
 uint64_t reactivations;
 uint64_t pageins;
 uint64_t pageouts;
 uint64_t faults;
 uint64_t cow_faults;
 uint64_t lookups;
 uint64_t hits;
 uint64_t purges;
 natural_t purgeable_count;
 natural_t speculative_count;
 uint64_t decompressions;
 uint64_t compressions;
 uint64_t swapins;
 uint64_t swapouts;
 natural_t compressor_page_count;
 natural_t throttled_count;
 natural_t external_page_count;
 natural_t internal_page_count;
 uint64_t total_uncompressed_pages_in_compressor;
} __attribute__((aligned(8)));
typedef struct vm_statistics64 *vm_statistics64_t;
typedef struct vm_statistics64 vm_statistics64_data_t;
#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value)))
struct vm_extmod_statistics {
 int64_t task_for_pid_count;
 int64_t task_for_pid_caller_count;
 int64_t thread_creation_count;
 int64_t thread_creation_caller_count;
 int64_t thread_set_state_count;
 int64_t thread_set_state_caller_count;
} __attribute__((aligned(8)));
typedef struct vm_extmod_statistics *vm_extmod_statistics_t;
typedef struct vm_extmod_statistics vm_extmod_statistics_data_t;
typedef struct vm_purgeable_stat {
 uint64_t count;
 uint64_t size;
}vm_purgeable_stat_t;
struct vm_purgeable_info {
 vm_purgeable_stat_t fifo_data[8];
 vm_purgeable_stat_t obsolete_data;
 vm_purgeable_stat_t lifo_data[8];
};
typedef struct vm_purgeable_info *vm_purgeable_info_t;
#define VM_PAGE_QUERY_PAGE_PRESENT 0x1
#define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2
#define VM_PAGE_QUERY_PAGE_REF 0x4
#define VM_PAGE_QUERY_PAGE_DIRTY 0x8
#define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10
#define VM_PAGE_QUERY_PAGE_COPIED 0x20
#define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40
#define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80
#define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100
#define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200
#define VM_FLAGS_FIXED 0x0000
#define VM_FLAGS_ANYWHERE 0x0001
#define VM_FLAGS_PURGABLE 0x0002
#define VM_FLAGS_NO_CACHE 0x0010
#define VM_FLAGS_PERMANENT 0x0100
#define VM_FLAGS_GUARD_AFTER 0x0200
#define VM_FLAGS_GUARD_BEFORE 0x0400
#define VM_FLAGS_SUBMAP 0x0800
#define VM_FLAGS_ALREADY 0x1000
#define VM_FLAGS_BEYOND_MAX 0x2000
#define VM_FLAGS_OVERWRITE 0x4000
#define VM_FLAGS_NO_PMAP_CHECK 0x8000
#define VM_FLAGS_MAP_JIT 0x80000
#define VM_FLAGS_RETURN_DATA_ADDR 0x100000
#define VM_FLAGS_SUPERPAGE_MASK 0x70000
#define VM_FLAGS_SUPERPAGE_SHIFT 16
#define SUPERPAGE_NONE 0
#define SUPERPAGE_SIZE_ANY 1
#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT)
#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
#define SUPERPAGE_SIZE_2MB 2
#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
#define VM_FLAGS_ALIAS_MASK 0xFF000000
#define VM_GET_FLAGS_ALIAS(flags,alias) (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24
#define VM_SET_FLAGS_ALIAS(flags,alias) (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | VM_FLAGS_PURGABLE | VM_FLAGS_NO_CACHE | VM_FLAGS_OVERWRITE | VM_FLAGS_SUPERPAGE_MASK | VM_FLAGS_ALIAS_MASK)
#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | VM_FLAGS_RETURN_DATA_ADDR)
#define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | VM_FLAGS_OVERWRITE| VM_FLAGS_RETURN_DATA_ADDR)
#define VM_MEMORY_MALLOC 1
#define VM_MEMORY_MALLOC_SMALL 2
#define VM_MEMORY_MALLOC_LARGE 3
#define VM_MEMORY_MALLOC_HUGE 4
#define VM_MEMORY_SBRK 5
#define VM_MEMORY_REALLOC 6
#define VM_MEMORY_MALLOC_TINY 7
#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
#define VM_MEMORY_MALLOC_LARGE_REUSED 9
#define VM_MEMORY_ANALYSIS_TOOL 10
#define VM_MEMORY_MALLOC_NANO 11
#define VM_MEMORY_MACH_MSG 20
#define VM_MEMORY_IOKIT 21
#define VM_MEMORY_STACK 30
#define VM_MEMORY_GUARD 31
#define VM_MEMORY_SHARED_PMAP 32
#define VM_MEMORY_DYLIB 33
#define VM_MEMORY_OBJC_DISPATCHERS 34
#define VM_MEMORY_UNSHARED_PMAP 35
#define VM_MEMORY_APPKIT 40
#define VM_MEMORY_FOUNDATION 41
#define VM_MEMORY_COREGRAPHICS 42
#define VM_MEMORY_CORESERVICES 43
#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
#define VM_MEMORY_JAVA 44
#define VM_MEMORY_COREDATA 45
#define VM_MEMORY_COREDATA_OBJECTIDS 46
#define VM_MEMORY_ATS 50
#define VM_MEMORY_LAYERKIT 51
#define VM_MEMORY_CGIMAGE 52
#define VM_MEMORY_TCMALLOC 53
#define VM_MEMORY_COREGRAPHICS_DATA 54
#define VM_MEMORY_COREGRAPHICS_SHARED 55
#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56
#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57
#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
#define VM_MEMORY_DYLD 60
#define VM_MEMORY_DYLD_MALLOC 61
#define VM_MEMORY_SQLITE 62
#define VM_MEMORY_JAVASCRIPT_CORE 63
#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
#define VM_MEMORY_GLSL 66
#define VM_MEMORY_OPENCL 67
#define VM_MEMORY_COREIMAGE 68
#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
#define VM_MEMORY_IMAGEIO 70
#define VM_MEMORY_COREPROFILE 71
#define VM_MEMORY_ASSETSD 72
#define VM_MEMORY_OS_ALLOC_ONCE 73
#define VM_MEMORY_LIBDISPATCH 74
#define VM_MEMORY_ACCELERATE 75
#define VM_MEMORY_COREUI 76
#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
#define VM_MAKE_TAG(tag) ((tag) << 24)
#define _MACH_MACHINE_H_ 
typedef integer_t cpu_type_t;
typedef integer_t cpu_subtype_t;
typedef integer_t cpu_threadtype_t;
#define CPU_STATE_MAX 4
#define CPU_STATE_USER 0
#define CPU_STATE_SYSTEM 1
#define CPU_STATE_IDLE 2
#define CPU_STATE_NICE 3

cpu_type_t cpu_type(void);
cpu_subtype_t cpu_subtype(void);
cpu_threadtype_t cpu_threadtype(void);

#define CPU_ARCH_MASK 0xff000000
#define CPU_ARCH_ABI64 0x01000000
#define CPU_TYPE_ANY ((cpu_type_t) -1)
#define CPU_TYPE_VAX ((cpu_type_t) 1)
#define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
#define CPU_TYPE_X86 ((cpu_type_t) 7)
#define CPU_TYPE_I386 CPU_TYPE_X86
#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64)
#define CPU_TYPE_MC98000 ((cpu_type_t) 10)
#define CPU_TYPE_HPPA ((cpu_type_t) 11)
#define CPU_TYPE_ARM ((cpu_type_t) 12)
#define CPU_TYPE_MC88000 ((cpu_type_t) 13)
#define CPU_TYPE_SPARC ((cpu_type_t) 14)
#define CPU_TYPE_I860 ((cpu_type_t) 15)
#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
#define CPU_SUBTYPE_MASK 0xff000000
#define CPU_SUBTYPE_LIB64 0x80000000
#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0)
#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_INTEL(f,m) ((cpu_subtype_t) (f) + ((m) << 4))
#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0)
#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0)
#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0)
#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8)
#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0)
#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6)
#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7)
#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0)
#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1)
#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2)
#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0)
#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1)
#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0)
#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1)
#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0)
#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1)
#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
#define CPU_SUBTYPE_INTEL_MODEL_ALL 0
#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3)
#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3)
#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4)
#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1)
#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12)
#define CPU_SUBTYPE_ARM_V6M ((cpu_subtype_t) 14)
#define CPU_SUBTYPE_ARM_V7M ((cpu_subtype_t) 15)
#define CPU_SUBTYPE_ARM_V7EM ((cpu_subtype_t) 16)
#define CPUFAMILY_UNKNOWN 0
#define CPUFAMILY_POWERPC_G3 0xcee41549
#define CPUFAMILY_POWERPC_G4 0x77c184ae
#define CPUFAMILY_POWERPC_G5 0xed76d8aa
#define CPUFAMILY_INTEL_6_13 0xaa33392b
#define CPUFAMILY_INTEL_YONAH 0x73d67300
#define CPUFAMILY_INTEL_MEROM 0x426f69ef
#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc
#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2
#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec
#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c
#define CPUFAMILY_INTEL_IVYBRIDGE 0x1f65e835
#define CPUFAMILY_INTEL_HASWELL 0x10b282dc
#define CPUFAMILY_ARM_9 0xe73283ae
#define CPUFAMILY_ARM_11 0x8ff620d8
#define CPUFAMILY_ARM_XSCALE 0x53b005f5
#define CPUFAMILY_ARM_12 0xbd1b0ae9
#define CPUFAMILY_ARM_13 0x0cc90e64
#define CPUFAMILY_ARM_14 0x96077ef1
#define CPUFAMILY_ARM_SWIFT 0x1e2d6381
#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH
#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM
#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH
#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM
#define _MACH_TIME_VALUE_H_ 
struct time_value {
 integer_t seconds;
 integer_t microseconds;
};
typedef struct time_value time_value_t;
#define TIME_MICROS_MAX (1000000)
#define time_value_add_usec(val,micros) { if (((val)->microseconds += (micros)) >= TIME_MICROS_MAX) { (val)->microseconds -= TIME_MICROS_MAX; (val)->seconds++; } }
#define time_value_add(result,addend) { (result)->microseconds += (addend)->microseconds; (result)->seconds += (addend)->seconds; if ((result)->microseconds >= TIME_MICROS_MAX) { (result)->microseconds -= TIME_MICROS_MAX; (result)->seconds++; } }
typedef integer_t *host_info_t;
typedef integer_t *host_info64_t;
#define HOST_INFO_MAX (1024)
typedef integer_t host_info_data_t[(1024)];
#define KERNEL_VERSION_MAX (512)
typedef char kernel_version_t[(512)];
#define KERNEL_BOOT_INFO_MAX (4096)
typedef char kernel_boot_info_t[(4096)];
typedef integer_t host_flavor_t;
#define HOST_BASIC_INFO 1
#define HOST_SCHED_INFO 3
#define HOST_RESOURCE_SIZES 4
#define HOST_PRIORITY_INFO 5
#define HOST_SEMAPHORE_TRAPS 7
#define HOST_MACH_MSG_TRAP 8
#define HOST_VM_PURGABLE 9
#pragma pack(4)
struct host_basic_info {
 integer_t max_cpus;
 integer_t avail_cpus;
 natural_t memory_size;
 cpu_type_t cpu_type;
 cpu_subtype_t cpu_subtype;
 cpu_threadtype_t cpu_threadtype;
 integer_t physical_cpu;
 integer_t physical_cpu_max;
 integer_t logical_cpu;
 integer_t logical_cpu_max;
 uint64_t max_mem;
};
#pragma pack()
typedef struct host_basic_info host_basic_info_data_t;
typedef struct host_basic_info *host_basic_info_t;
#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) (sizeof(host_basic_info_data_t)/sizeof(integer_t)))
struct host_sched_info {
 integer_t min_timeout;
 integer_t min_quantum;
};
typedef struct host_sched_info host_sched_info_data_t;
typedef struct host_sched_info *host_sched_info_t;
#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) (sizeof(host_sched_info_data_t)/sizeof(integer_t)))
struct kernel_resource_sizes {
 natural_t task;
        natural_t thread;
        natural_t port;
        natural_t memory_region;
        natural_t memory_object;
};
typedef struct kernel_resource_sizes kernel_resource_sizes_data_t;
typedef struct kernel_resource_sizes *kernel_resource_sizes_t;
#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t)))
struct host_priority_info {
     integer_t kernel_priority;
     integer_t system_priority;
     integer_t server_priority;
     integer_t user_priority;
     integer_t depress_priority;
     integer_t idle_priority;
     integer_t minimum_priority;
 integer_t maximum_priority;
};
typedef struct host_priority_info host_priority_info_data_t;
typedef struct host_priority_info *host_priority_info_t;
#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) (sizeof(host_priority_info_data_t)/sizeof(integer_t)))
#define HOST_LOAD_INFO 1
#define HOST_VM_INFO 2
#define HOST_CPU_LOAD_INFO 3
#define HOST_VM_INFO64 4
#define HOST_EXTMOD_INFO64 5
#define HOST_EXPIRED_TASK_INFO 6
struct host_load_info {
 integer_t avenrun[3];
 integer_t mach_factor[3];
};
typedef struct host_load_info host_load_info_data_t;
typedef struct host_load_info *host_load_info_t;
#define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) (sizeof(host_load_info_data_t)/sizeof(integer_t)))
typedef struct vm_purgeable_info host_purgable_info_data_t;
typedef struct vm_purgeable_info *host_purgable_info_t;
#define HOST_VM_PURGABLE_COUNT ((mach_msg_type_number_t) (sizeof(host_purgable_info_data_t)/sizeof(integer_t)))
#define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) (sizeof(vm_statistics64_data_t)/sizeof(integer_t)))
#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT
#define HOST_VM_INFO64_REV1_COUNT HOST_VM_INFO64_LATEST_COUNT
#define HOST_VM_INFO64_REV0_COUNT ((mach_msg_type_number_t) (HOST_VM_INFO64_REV1_COUNT - 14))
#define HOST_EXTMOD_INFO64_COUNT ((mach_msg_type_number_t) (sizeof(vm_extmod_statistics_data_t)/sizeof(integer_t)))
#define HOST_EXTMOD_INFO64_LATEST_COUNT HOST_EXTMOD_INFO64_COUNT
#define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) (sizeof(vm_statistics_data_t)/sizeof(integer_t)))
#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT
#define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT
#define HOST_VM_INFO_REV1_COUNT ((mach_msg_type_number_t) (HOST_VM_INFO_REV2_COUNT - 1))
#define HOST_VM_INFO_REV0_COUNT ((mach_msg_type_number_t) (HOST_VM_INFO_REV1_COUNT - 2))
struct host_cpu_load_info {
 natural_t cpu_ticks[4];
};
typedef struct host_cpu_load_info host_cpu_load_info_data_t;
typedef struct host_cpu_load_info *host_cpu_load_info_t;
#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t)))
extern kern_return_t set_sched_stats_active(
     boolean_t active);
extern kern_return_t get_sched_statistics(
     struct _processor_statistics_np *out,
     uint32_t *count);
#define _MACH_HOST_NOTIFY_H_ 
#define HOST_NOTIFY_CALENDAR_CHANGE 0
#define HOST_NOTIFY_TYPE_MAX 0
#define HOST_CALENDAR_CHANGED_REPLYID 950
#define _MACH_HOST_SPECIAL_PORTS_H_ 
#define HOST_SECURITY_PORT 0
#define HOST_PORT 1
#define HOST_PRIV_PORT 2
#define HOST_IO_MASTER_PORT 3
#define HOST_MAX_SPECIAL_KERNEL_PORT 7
#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_CHUD_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_GSSD_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_TELEMETRY_PORT (13 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_MAX_SPECIAL_PORT (14 + HOST_MAX_SPECIAL_KERNEL_PORT)
#define HOST_LOCAL_NODE -1
#define host_get_host_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_PORT, (port)))
#define host_set_host_port(host,port) (KERN_INVALID_ARGUMENT)
#define host_get_host_priv_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_PRIV_PORT, (port)))
#define host_set_host_priv_port(host,port) (KERN_INVALID_ARGUMENT)
#define host_get_io_master_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port)))
#define host_set_io_master_port(host,port) (KERN_INVALID_ARGUMENT)
#define host_get_dynamic_pager_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port)))
#define host_set_dynamic_pager_port(host,port) (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port)))
#define host_get_audit_control_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port)))
#define host_set_audit_control_port(host,port) (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port)))
#define host_get_user_notification_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port)))
#define host_set_user_notification_port(host,port) (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port)))
#define host_get_automountd_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port)))
#define host_set_automountd_port(host,port) (host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port)))
#define host_get_lockd_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port)))
#define host_set_lockd_port(host,port) (host_set_special_port((host), HOST_LOCKD_PORT, (port)))
#define host_get_kextd_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port)))
#define host_set_kextd_port(host,port) (host_set_special_port((host), HOST_KEXTD_PORT, (port)))
#define host_get_chud_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_CHUD_PORT, (port)))
#define host_set_chud_port(host,port) (host_set_special_port((host), HOST_CHUD_PORT, (port)))
#define host_get_unfreed_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port)))
#define host_set_unfreed_port(host,port) (host_set_special_port((host), HOST_UNFREED_PORT, (port)))
#define host_get_amfid_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_AMFID_PORT, (port)))
#define host_set_amfid_port(host,port) (host_set_special_port((host), HOST_AMFID_PORT, (port)))
#define host_get_gssd_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_GSSD_PORT, (port)))
#define host_set_gssd_port(host,port) (host_set_special_port((host), HOST_GSSD_PORT, (port)))
#define host_get_telemetry_port(host,port) (host_get_special_port((host), HOST_LOCAL_NODE, HOST_TELEMETRY_PORT, (port)))
#define host_set_telemetry_port(host,port) (host_set_special_port((host), HOST_TELEMETRY_PORT, (port)))
#define _MACH_MEMORY_OBJECT_TYPES_H_ 
#define _MACH_VM_PROT_H_ 
typedef int vm_prot_t;
#define VM_PROT_NONE ((vm_prot_t) 0x00)
#define VM_PROT_READ ((vm_prot_t) 0x01)
#define VM_PROT_WRITE ((vm_prot_t) 0x02)
#define VM_PROT_EXECUTE ((vm_prot_t) 0x04)
#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE)
#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08)
#define VM_PROT_COPY ((vm_prot_t) 0x10)
#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)
#define _MACH_VM_SYNC_H_ 
typedef unsigned vm_sync_t;
#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01)
#define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02)
#define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04)
#define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08)
#define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10)
#define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20)
#define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40)
#define _MACH_VM_TYPES_H_ 
typedef vm_offset_t pointer_t;
typedef vm_offset_t vm_address_t;
typedef uint64_t addr64_t;
typedef uint32_t reg64_t;
typedef uint32_t ppnum_t;
#define PPNUM_MAX UINT32_MAX

struct pmap ;
struct _vm_map ;
struct vm_object ;

typedef struct pmap *pmap_t;
typedef struct _vm_map *vm_map_t;
typedef struct vm_object *vm_object_t;
typedef struct vm_object_fault_info *vm_object_fault_info_t;
#define PMAP_NULL ((pmap_t) 0)
#define VM_OBJECT_NULL ((vm_object_t) 0)
#define VM_MAP_NULL ((vm_map_t) 0)
typedef uint64_t vm_object_offset_t;
typedef uint64_t vm_object_size_t;

struct upl ;
struct vm_map_copy ;
struct vm_named_entry ;

typedef struct upl *upl_t;
typedef struct vm_map_copy *vm_map_copy_t;
typedef struct vm_named_entry *vm_named_entry_t;
#define VM_MAP_COPY_NULL ((vm_map_copy_t) 0)
#define UPL_NULL ((upl_t) 0)
#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
#define VM_64_BIT_DATA_OBJECTS 
typedef unsigned long long memory_object_offset_t;
typedef unsigned long long memory_object_size_t;
typedef natural_t memory_object_cluster_size_t;
typedef natural_t * memory_object_fault_info_t;
typedef unsigned long long vm_object_id_t;
struct memory_object_pager_ops;
typedef struct memory_object {
 unsigned int _pad1;
 unsigned int _pad2;
 const struct memory_object_pager_ops *mo_pager_ops;
} *memory_object_t;
typedef struct memory_object_control {
 unsigned int moc_ikot;
 unsigned int _pad;
 struct vm_object *moc_object;
} *memory_object_control_t;
typedef const struct memory_object_pager_ops {
 void (*memory_object_reference)(
  memory_object_t mem_obj);
 void (*memory_object_deallocate)(
  memory_object_t mem_obj);
 kern_return_t (*memory_object_init)(
  memory_object_t mem_obj,
  memory_object_control_t mem_control,
  memory_object_cluster_size_t size);
 kern_return_t (*memory_object_terminate)(
  memory_object_t mem_obj);
 kern_return_t (*memory_object_data_request)(
  memory_object_t mem_obj,
  memory_object_offset_t offset,
  memory_object_cluster_size_t length,
  vm_prot_t desired_access,
  memory_object_fault_info_t fault_info);
 kern_return_t (*memory_object_data_return)(
  memory_object_t mem_obj,
  memory_object_offset_t offset,
  memory_object_cluster_size_t size,
  memory_object_offset_t *resid_offset,
  int *io_error,
  boolean_t dirty,
  boolean_t kernel_copy,
  int upl_flags);
 kern_return_t (*memory_object_data_initialize)(
  memory_object_t mem_obj,
  memory_object_offset_t offset,
  memory_object_cluster_size_t size);
 kern_return_t (*memory_object_data_unlock)(
  memory_object_t mem_obj,
  memory_object_offset_t offset,
  memory_object_size_t size,
  vm_prot_t desired_access);
 kern_return_t (*memory_object_synchronize)(
  memory_object_t mem_obj,
  memory_object_offset_t offset,
  memory_object_size_t size,
  vm_sync_t sync_flags);
 kern_return_t (*memory_object_map)(
  memory_object_t mem_obj,
  vm_prot_t prot);
 kern_return_t (*memory_object_last_unmap)(
  memory_object_t mem_obj);
 kern_return_t (*memory_object_data_reclaim)(
  memory_object_t mem_obj,
  boolean_t reclaim_backing_store);
 const char *memory_object_pager_name;
} * memory_object_pager_ops_t;
typedef memory_object_t *memory_object_array_t;
typedef mach_port_t memory_object_name_t;
typedef mach_port_t memory_object_default_t;
#define MEMORY_OBJECT_NULL ((memory_object_t) 0)
#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0)
#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0)
#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0)
typedef int memory_object_copy_strategy_t;
#define MEMORY_OBJECT_COPY_NONE 0
#define MEMORY_OBJECT_COPY_CALL 1
#define MEMORY_OBJECT_COPY_DELAY 2
#define MEMORY_OBJECT_COPY_TEMPORARY 3
#define MEMORY_OBJECT_COPY_SYMMETRIC 4
#define MEMORY_OBJECT_COPY_INVALID 5
typedef int memory_object_return_t;
#define MEMORY_OBJECT_RETURN_NONE 0
#define MEMORY_OBJECT_RETURN_DIRTY 1
#define MEMORY_OBJECT_RETURN_ALL 2
#define MEMORY_OBJECT_RETURN_ANYTHING 3
#define MEMORY_OBJECT_DATA_FLUSH 0x1
#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2
#define MEMORY_OBJECT_DATA_PURGE 0x4
#define MEMORY_OBJECT_COPY_SYNC 0x8
#define MEMORY_OBJECT_DATA_SYNC 0x10
#define MEMORY_OBJECT_IO_SYNC 0x20
#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40
#define MEMORY_OBJECT_INFO_MAX (1024)
typedef int *memory_object_info_t;
typedef int memory_object_flavor_t;
typedef int memory_object_info_data_t[(1024)];
#define MEMORY_OBJECT_PERFORMANCE_INFO 11
#define MEMORY_OBJECT_ATTRIBUTE_INFO 14
#define MEMORY_OBJECT_BEHAVIOR_INFO 15
struct memory_object_perf_info {
 memory_object_cluster_size_t cluster_size;
 boolean_t may_cache;
};
struct memory_object_attr_info {
 memory_object_copy_strategy_t copy_strategy;
 memory_object_cluster_size_t cluster_size;
 boolean_t may_cache_object;
 boolean_t temporary;
};
struct memory_object_behave_info {
 memory_object_copy_strategy_t copy_strategy;
 boolean_t temporary;
 boolean_t invalidate;
 boolean_t silent_overwrite;
 boolean_t advisory_pageout;
};
typedef struct memory_object_behave_info *memory_object_behave_info_t;
typedef struct memory_object_behave_info memory_object_behave_info_data_t;
typedef struct memory_object_perf_info *memory_object_perf_info_t;
typedef struct memory_object_perf_info memory_object_perf_info_data_t;
typedef struct memory_object_attr_info *memory_object_attr_info_t;
typedef struct memory_object_attr_info memory_object_attr_info_data_t;
#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) (sizeof(memory_object_behave_info_data_t)/sizeof(int)))
#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) (sizeof(memory_object_perf_info_data_t)/sizeof(int)))
#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) (sizeof(memory_object_attr_info_data_t)/sizeof(int)))
#define invalid_memory_object_flavor(f) (f != MEMORY_OBJECT_ATTRIBUTE_INFO && f != MEMORY_OBJECT_PERFORMANCE_INFO && f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && f != MEMORY_OBJECT_BEHAVIOR_INFO && f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO)
#define MEMORY_OBJECT_TERMINATE_IDLE 0x1
#define MEMORY_OBJECT_RESPECT_CACHE 0x2
#define MEMORY_OBJECT_RELEASE_NO_OP 0x4
#define MAP_MEM_NOOP 0
#define MAP_MEM_COPYBACK 1
#define MAP_MEM_IO 2
#define MAP_MEM_WTHRU 3
#define MAP_MEM_WCOMB 4
#define MAP_MEM_INNERWBACK 5
#define GET_MAP_MEM(flags) ((((unsigned int)(flags)) >> 24) & 0xFF)
#define SET_MAP_MEM(caching,flags) ((flags) = ((((unsigned int)(caching)) << 24) & 0xFF000000) | ((flags) & 0xFFFFFF));
#define MAP_MEM_ONLY 0x010000
#define MAP_MEM_NAMED_CREATE 0x020000
#define MAP_MEM_PURGABLE 0x040000
#define MAP_MEM_NAMED_REUSE 0x080000
#define MAP_MEM_USE_DATA_ADDR 0x100000
#define MAP_MEM_VM_COPY 0x200000
#define MAP_MEM_VM_SHARE 0x400000
struct upl_page_info {
 unsigned int opaque[2];
};
typedef struct upl_page_info upl_page_info_t;
typedef upl_page_info_t *upl_page_info_array_t;
typedef upl_page_info_array_t upl_page_list_ptr_t;
typedef uint32_t upl_offset_t;
typedef uint32_t upl_size_t;
#define UPL_FLAGS_NONE 0x00000000
#define UPL_COPYOUT_FROM 0x00000001
#define UPL_PRECIOUS 0x00000002
#define UPL_NO_SYNC 0x00000004
#define UPL_CLEAN_IN_PLACE 0x00000008
#define UPL_NOBLOCK 0x00000010
#define UPL_RET_ONLY_DIRTY 0x00000020
#define UPL_SET_INTERNAL 0x00000040
#define UPL_QUERY_OBJECT_TYPE 0x00000080
#define UPL_RET_ONLY_ABSENT 0x00000100
#define UPL_FILE_IO 0x00000200
#define UPL_SET_LITE 0x00000400
#define UPL_SET_INTERRUPTIBLE 0x00000800
#define UPL_SET_IO_WIRE 0x00001000
#define UPL_FOR_PAGEOUT 0x00002000
#define UPL_WILL_BE_DUMPED 0x00004000
#define UPL_FORCE_DATA_SYNC 0x00008000
#define UPL_PAGE_TICKET_MASK 0x000F0000
#define UPL_PAGE_TICKET_SHIFT 16
#define UPL_BLOCK_ACCESS 0x00100000
#define UPL_ENCRYPT 0x00200000
#define UPL_NOZEROFILL 0x00400000
#define UPL_WILL_MODIFY 0x00800000
#define UPL_NEED_32BIT_ADDR 0x01000000
#define UPL_UBC_MSYNC 0x02000000
#define UPL_UBC_PAGEOUT 0x04000000
#define UPL_UBC_PAGEIN 0x08000000
#define UPL_REQUEST_SET_DIRTY 0x10000000
#define UPL_REQUEST_NO_FAULT 0x20000000
#define UPL_NOZEROFILLIO 0x40000000
#define UPL_VALID_FLAGS 0x7FFFFFFF
#define UPL_ABORT_RESTART 0x1
#define UPL_ABORT_UNAVAILABLE 0x2
#define UPL_ABORT_ERROR 0x4
#define UPL_ABORT_FREE_ON_EMPTY 0x8
#define UPL_ABORT_DUMP_PAGES 0x10
#define UPL_ABORT_NOTIFY_EMPTY 0x20
#define UPL_ABORT_REFERENCE 0x80
#define UPL_CHECK_DIRTY 0x1
#define UPL_IOSYNC 0x1
#define UPL_NOCOMMIT 0x2
#define UPL_NORDAHEAD 0x4
#define UPL_VNODE_PAGER 0x8
#define UPL_MSYNC 0x10
#define UPL_PAGING_ENCRYPTED 0x20
#define UPL_KEEPCACHED 0x40
#define UPL_NESTED_PAGEOUT 0x80
#define UPL_IOSTREAMING 0x100
#define UPL_IGNORE_VALID_PAGE_CHECK 0x200
#define UPL_COMMIT_FREE_ON_EMPTY 0x1
#define UPL_COMMIT_CLEAR_DIRTY 0x2
#define UPL_COMMIT_SET_DIRTY 0x4
#define UPL_COMMIT_INACTIVATE 0x8
#define UPL_COMMIT_NOTIFY_EMPTY 0x10
#define UPL_COMMIT_CS_VALIDATED 0x40
#define UPL_COMMIT_CLEAR_PRECIOUS 0x80
#define UPL_COMMIT_SPECULATE 0x100
#define UPL_COMMIT_FREE_ABSENT 0x200
#define UPL_COMMIT_KERNEL_ONLY_FLAGS (UPL_COMMIT_CS_VALIDATED | UPL_COMMIT_FREE_ABSENT)
#define UPL_DEV_MEMORY 0x1
#define UPL_PHYS_CONTIG 0x2
#define UPL_POP_DIRTY 0x1
#define UPL_POP_PAGEOUT 0x2
#define UPL_POP_PRECIOUS 0x4
#define UPL_POP_ABSENT 0x8
#define UPL_POP_BUSY 0x10
#define UPL_POP_PHYSICAL 0x10000000
#define UPL_POP_DUMP 0x20000000
#define UPL_POP_SET 0x40000000
#define UPL_POP_CLR 0x80000000
#define UPL_ROP_ABSENT 0x01
#define UPL_ROP_PRESENT 0x02
#define UPL_ROP_DUMP 0x04

extern boolean_t upl_page_present(upl_page_info_t *upl, int index);
extern boolean_t upl_dirty_page(upl_page_info_t *upl, int index);
extern boolean_t upl_valid_page(upl_page_info_t *upl, int index);
extern void upl_deallocate(upl_t upl);

#define _MACH_EXCEPTION_TYPES_H_ 
#define _MACH_MACHINE_EXCEPTION_H_ 
#define _MACH_I386_EXCEPTION_H_ 
#define EXC_TYPES_COUNT 13
#define EXCEPTION_CODE_MAX 2
#define EXC_I386_INVOP 1
#define EXC_I386_DIV 1
#define EXC_I386_INTO 2
#define EXC_I386_NOEXT 3
#define EXC_I386_EXTOVR 4
#define EXC_I386_EXTERR 5
#define EXC_I386_EMERR 6
#define EXC_I386_BOUND 7
#define EXC_I386_SSEEXTERR 8
#define EXC_I386_SGL 1
#define EXC_I386_BPT 2
#define EXC_I386_DIVERR 0
#define EXC_I386_SGLSTP 1
#define EXC_I386_NMIFLT 2
#define EXC_I386_BPTFLT 3
#define EXC_I386_INTOFLT 4
#define EXC_I386_BOUNDFLT 5
#define EXC_I386_INVOPFLT 6
#define EXC_I386_NOEXTFLT 7
#define EXC_I386_DBLFLT 8
#define EXC_I386_EXTOVRFLT 9
#define EXC_I386_INVTSSFLT 10
#define EXC_I386_SEGNPFLT 11
#define EXC_I386_STKFLT 12
#define EXC_I386_GPFLT 13
#define EXC_I386_PGFLT 14
#define EXC_I386_EXTERRFLT 16
#define EXC_I386_ALIGNFLT 17
#define EXC_I386_ENDPERR 33
#define EXC_I386_ENOEXTFLT 32
#define EXC_MASK_MACHINE 0
#define EXC_BAD_ACCESS 1
#define EXC_BAD_INSTRUCTION 2
#define EXC_ARITHMETIC 3
#define EXC_EMULATION 4
#define EXC_SOFTWARE 5
#define EXC_BREAKPOINT 6
#define EXC_SYSCALL 7
#define EXC_MACH_SYSCALL 8
#define EXC_RPC_ALERT 9
#define EXC_CRASH 10
#define EXC_RESOURCE 11
#define EXC_GUARD 12
#define EXCEPTION_DEFAULT 1
#define EXCEPTION_STATE 2
#define EXCEPTION_STATE_IDENTITY 3
#define MACH_EXCEPTION_CODES 0x80000000
#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS)
#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION)
#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC)
#define EXC_MASK_EMULATION (1 << EXC_EMULATION)
#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE)
#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT)
#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL)
#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL)
#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT)
#define EXC_MASK_CRASH (1 << EXC_CRASH)
#define EXC_MASK_RESOURCE (1 << EXC_RESOURCE)
#define EXC_MASK_GUARD (1 << EXC_GUARD)
#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC | EXC_MASK_EMULATION | EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT | EXC_MASK_SYSCALL | EXC_MASK_MACH_SYSCALL | EXC_MASK_RPC_ALERT | EXC_MASK_RESOURCE | EXC_MASK_GUARD | EXC_MASK_MACHINE)
#define EXC_MASK_VALID (EXC_MASK_ALL | EXC_MASK_CRASH)
#define FIRST_EXCEPTION 1
#define EXC_SOFT_SIGNAL 0x10003
#define EXC_MACF_MIN 0x20000
#define EXC_MACF_MAX 0x2FFFF
#define _MACH_THREAD_STATUS_H_ 
#define _MACH_MACHINE_THREAD_STATUS_H_ 
#define _MACH_I386_THREAD_STATUS_H_ 
#define _MACH_I386__STRUCTS_H_ 
#define _STRUCT_X86_THREAD_STATE32 struct i386_thread_state
struct i386_thread_state
{
    unsigned int eax;
    unsigned int ebx;
    unsigned int ecx;
    unsigned int edx;
    unsigned int edi;
    unsigned int esi;
    unsigned int ebp;
    unsigned int esp;
    unsigned int ss;
    unsigned int eflags;
    unsigned int eip;
    unsigned int cs;
    unsigned int ds;
    unsigned int es;
    unsigned int fs;
    unsigned int gs;
};
#define _STRUCT_FP_CONTROL struct fp_control
struct fp_control
{
    unsigned short invalid :1,
        denorm :1,
    zdiv :1,
    ovrfl :1,
    undfl :1,
    precis :1,
     :2,
    pc :2,
#define FP_PREC_24B 0
#define FP_PREC_53B 2
#define FP_PREC_64B 3
    rc :2,
#define FP_RND_NEAR 0
#define FP_RND_DOWN 1
#define FP_RND_UP 2
#define FP_CHOP 3
            :1,
     :3;
};
typedef struct fp_control fp_control_t;
#define _STRUCT_FP_STATUS struct fp_status
struct fp_status
{
    unsigned short invalid :1,
        denorm :1,
    zdiv :1,
    ovrfl :1,
    undfl :1,
    precis :1,
    stkflt :1,
    errsumm :1,
    c0 :1,
    c1 :1,
    c2 :1,
    tos :3,
    c3 :1,
    busy :1;
};
typedef struct fp_status fp_status_t;
#define _STRUCT_MMST_REG struct mmst_reg
struct mmst_reg
{
 char mmst_reg[10];
 char mmst_rsrv[6];
};
#define _STRUCT_XMM_REG struct xmm_reg
struct xmm_reg
{
 char xmm_reg[16];
};
#define FP_STATE_BYTES 512
#define _STRUCT_X86_FLOAT_STATE32 struct i386_float_state
struct i386_float_state
{
 int fpu_reserved[2];
 struct fp_control fpu_fcw;
 struct fp_status fpu_fsw;
 __uint8_t fpu_ftw;
 __uint8_t fpu_rsrv1;
 __uint16_t fpu_fop;
 __uint32_t fpu_ip;
 __uint16_t fpu_cs;
 __uint16_t fpu_rsrv2;
 __uint32_t fpu_dp;
 __uint16_t fpu_ds;
 __uint16_t fpu_rsrv3;
 __uint32_t fpu_mxcsr;
 __uint32_t fpu_mxcsrmask;
 struct mmst_reg fpu_stmm0;
 struct mmst_reg fpu_stmm1;
 struct mmst_reg fpu_stmm2;
 struct mmst_reg fpu_stmm3;
 struct mmst_reg fpu_stmm4;
 struct mmst_reg fpu_stmm5;
 struct mmst_reg fpu_stmm6;
 struct mmst_reg fpu_stmm7;
 struct xmm_reg fpu_xmm0;
 struct xmm_reg fpu_xmm1;
 struct xmm_reg fpu_xmm2;
 struct xmm_reg fpu_xmm3;
 struct xmm_reg fpu_xmm4;
 struct xmm_reg fpu_xmm5;
 struct xmm_reg fpu_xmm6;
 struct xmm_reg fpu_xmm7;
 char fpu_rsrv4[14*16];
 int fpu_reserved1;
};
#define _STRUCT_X86_AVX_STATE32 struct i386_avx_state
struct i386_avx_state
{
 int fpu_reserved[2];
 struct fp_control fpu_fcw;
 struct fp_status fpu_fsw;
 __uint8_t fpu_ftw;
 __uint8_t fpu_rsrv1;
 __uint16_t fpu_fop;
 __uint32_t fpu_ip;
 __uint16_t fpu_cs;
 __uint16_t fpu_rsrv2;
 __uint32_t fpu_dp;
 __uint16_t fpu_ds;
 __uint16_t fpu_rsrv3;
 __uint32_t fpu_mxcsr;
 __uint32_t fpu_mxcsrmask;
 struct mmst_reg fpu_stmm0;
 struct mmst_reg fpu_stmm1;
 struct mmst_reg fpu_stmm2;
 struct mmst_reg fpu_stmm3;
 struct mmst_reg fpu_stmm4;
 struct mmst_reg fpu_stmm5;
 struct mmst_reg fpu_stmm6;
 struct mmst_reg fpu_stmm7;
 struct xmm_reg fpu_xmm0;
 struct xmm_reg fpu_xmm1;
 struct xmm_reg fpu_xmm2;
 struct xmm_reg fpu_xmm3;
 struct xmm_reg fpu_xmm4;
 struct xmm_reg fpu_xmm5;
 struct xmm_reg fpu_xmm6;
 struct xmm_reg fpu_xmm7;
 char fpu_rsrv4[14*16];
 int fpu_reserved1;
 char __avx_reserved1[64];
 struct xmm_reg __fpu_ymmh0;
 struct xmm_reg __fpu_ymmh1;
 struct xmm_reg __fpu_ymmh2;
 struct xmm_reg __fpu_ymmh3;
 struct xmm_reg __fpu_ymmh4;
 struct xmm_reg __fpu_ymmh5;
 struct xmm_reg __fpu_ymmh6;
 struct xmm_reg __fpu_ymmh7;
};
#define _STRUCT_X86_EXCEPTION_STATE32 struct i386_exception_state
struct i386_exception_state
{
 __uint16_t trapno;
 __uint16_t cpu;
 __uint32_t err;
 __uint32_t faultvaddr;
};
#define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32
struct x86_debug_state32
{
 unsigned int dr0;
 unsigned int dr1;
 unsigned int dr2;
 unsigned int dr3;
 unsigned int dr4;
 unsigned int dr5;
 unsigned int dr6;
 unsigned int dr7;
};
#define _STRUCT_X86_THREAD_STATE64 struct x86_thread_state64
struct x86_thread_state64
{
 __uint64_t rax;
 __uint64_t rbx;
 __uint64_t rcx;
 __uint64_t rdx;
 __uint64_t rdi;
 __uint64_t rsi;
 __uint64_t rbp;
 __uint64_t rsp;
 __uint64_t r8;
 __uint64_t r9;
 __uint64_t r10;
 __uint64_t r11;
 __uint64_t r12;
 __uint64_t r13;
 __uint64_t r14;
 __uint64_t r15;
 __uint64_t rip;
 __uint64_t rflags;
 __uint64_t cs;
 __uint64_t fs;
 __uint64_t gs;
};
#define _STRUCT_X86_FLOAT_STATE64 struct x86_float_state64
struct x86_float_state64
{
 int fpu_reserved[2];
 struct fp_control fpu_fcw;
 struct fp_status fpu_fsw;
 __uint8_t fpu_ftw;
 __uint8_t fpu_rsrv1;
 __uint16_t fpu_fop;
 __uint32_t fpu_ip;
 __uint16_t fpu_cs;
 __uint16_t fpu_rsrv2;
 __uint32_t fpu_dp;
 __uint16_t fpu_ds;
 __uint16_t fpu_rsrv3;
 __uint32_t fpu_mxcsr;
 __uint32_t fpu_mxcsrmask;
 struct mmst_reg fpu_stmm0;
 struct mmst_reg fpu_stmm1;
 struct mmst_reg fpu_stmm2;
 struct mmst_reg fpu_stmm3;
 struct mmst_reg fpu_stmm4;
 struct mmst_reg fpu_stmm5;
 struct mmst_reg fpu_stmm6;
 struct mmst_reg fpu_stmm7;
 struct xmm_reg fpu_xmm0;
 struct xmm_reg fpu_xmm1;
 struct xmm_reg fpu_xmm2;
 struct xmm_reg fpu_xmm3;
 struct xmm_reg fpu_xmm4;
 struct xmm_reg fpu_xmm5;
 struct xmm_reg fpu_xmm6;
 struct xmm_reg fpu_xmm7;
 struct xmm_reg fpu_xmm8;
 struct xmm_reg fpu_xmm9;
 struct xmm_reg fpu_xmm10;
 struct xmm_reg fpu_xmm11;
 struct xmm_reg fpu_xmm12;
 struct xmm_reg fpu_xmm13;
 struct xmm_reg fpu_xmm14;
 struct xmm_reg fpu_xmm15;
 char fpu_rsrv4[6*16];
 int fpu_reserved1;
};
#define _STRUCT_X86_AVX_STATE64 struct x86_avx_state64
struct x86_avx_state64
{
 int fpu_reserved[2];
 struct fp_control fpu_fcw;
 struct fp_status fpu_fsw;
 __uint8_t fpu_ftw;
 __uint8_t fpu_rsrv1;
 __uint16_t fpu_fop;
 __uint32_t fpu_ip;
 __uint16_t fpu_cs;
 __uint16_t fpu_rsrv2;
 __uint32_t fpu_dp;
 __uint16_t fpu_ds;
 __uint16_t fpu_rsrv3;
 __uint32_t fpu_mxcsr;
 __uint32_t fpu_mxcsrmask;
 struct mmst_reg fpu_stmm0;
 struct mmst_reg fpu_stmm1;
 struct mmst_reg fpu_stmm2;
 struct mmst_reg fpu_stmm3;
 struct mmst_reg fpu_stmm4;
 struct mmst_reg fpu_stmm5;
 struct mmst_reg fpu_stmm6;
 struct mmst_reg fpu_stmm7;
 struct xmm_reg fpu_xmm0;
 struct xmm_reg fpu_xmm1;
 struct xmm_reg fpu_xmm2;
 struct xmm_reg fpu_xmm3;
 struct xmm_reg fpu_xmm4;
 struct xmm_reg fpu_xmm5;
 struct xmm_reg fpu_xmm6;
 struct xmm_reg fpu_xmm7;
 struct xmm_reg fpu_xmm8;
 struct xmm_reg fpu_xmm9;
 struct xmm_reg fpu_xmm10;
 struct xmm_reg fpu_xmm11;
 struct xmm_reg fpu_xmm12;
 struct xmm_reg fpu_xmm13;
 struct xmm_reg fpu_xmm14;
 struct xmm_reg fpu_xmm15;
 char fpu_rsrv4[6*16];
 int fpu_reserved1;
 char __avx_reserved1[64];
 struct xmm_reg __fpu_ymmh0;
 struct xmm_reg __fpu_ymmh1;
 struct xmm_reg __fpu_ymmh2;
 struct xmm_reg __fpu_ymmh3;
 struct xmm_reg __fpu_ymmh4;
 struct xmm_reg __fpu_ymmh5;
 struct xmm_reg __fpu_ymmh6;
 struct xmm_reg __fpu_ymmh7;
 struct xmm_reg __fpu_ymmh8;
 struct xmm_reg __fpu_ymmh9;
 struct xmm_reg __fpu_ymmh10;
 struct xmm_reg __fpu_ymmh11;
 struct xmm_reg __fpu_ymmh12;
 struct xmm_reg __fpu_ymmh13;
 struct xmm_reg __fpu_ymmh14;
 struct xmm_reg __fpu_ymmh15;
};
#define _STRUCT_X86_EXCEPTION_STATE64 struct x86_exception_state64
struct x86_exception_state64
{
    __uint16_t trapno;
    __uint16_t cpu;
    __uint32_t err;
    __uint64_t faultvaddr;
};
#define _STRUCT_X86_DEBUG_STATE64 struct x86_debug_state64
struct x86_debug_state64
{
 __uint64_t dr0;
 __uint64_t dr1;
 __uint64_t dr2;
 __uint64_t dr3;
 __uint64_t dr4;
 __uint64_t dr5;
 __uint64_t dr6;
 __uint64_t dr7;
};
#define _I386_FP_SAVE_H_ 
#define FPC_IE 0x0001
#define FPC_IM FPC_IE
#define FPC_DE 0x0002
#define FPC_DM FPC_DE
#define FPC_ZE 0x0004
#define FPC_ZM FPC_ZE
#define FPC_OE 0x0008
#define FPC_OM FPC_OE
#define FPC_UE 0x0010
#define FPC_PE 0x0020
#define FPC_PC 0x0300
#define FPC_PC_24 0x0000
#define FPC_PC_53 0x0200
#define FPC_PC_64 0x0300
#define FPC_RC 0x0c00
#define FPC_RC_RN 0x0000
#define FPC_RC_RD 0x0400
#define FPC_RC_RU 0x0800
#define FPC_RC_CHOP 0x0c00
#define FPC_IC 0x1000
#define FPC_IC_PROJ 0x0000
#define FPC_IC_AFF 0x1000
#define FPS_IE 0x0001
#define FPS_DE 0x0002
#define FPS_ZE 0x0004
#define FPS_OE 0x0008
#define FPS_UE 0x0010
#define FPS_PE 0x0020
#define FPS_SF 0x0040
#define FPS_ES 0x0080
#define FPS_C0 0x0100
#define FPS_C1 0x0200
#define FPS_C2 0x0400
#define FPS_TOS 0x3800
#define FPS_TOS_SHIFT 11
#define FPS_C3 0x4000
#define FPS_BUSY 0x8000
#define FP_NO 0
#define FP_SOFT 1
#define FP_287 2
#define FP_387 3
#define FP_FXSR 4
#define _MACH_I386_THREAD_STATE_H_ 
#define I386_THREAD_STATE_MAX (224)
#define THREAD_STATE_MAX I386_THREAD_STATE_MAX
#define _I386_EFLAGS_H_ 
#define EFL_CF 0x00000001
#define EFL_PF 0x00000004
#define EFL_AF 0x00000010
#define EFL_ZF 0x00000040
#define EFL_SF 0x00000080
#define EFL_TF 0x00000100
#define EFL_IF 0x00000200
#define EFL_DF 0x00000400
#define EFL_OF 0x00000800
#define EFL_IOPL 0x00003000
#define EFL_IOPL_KERNEL 0x00000000
#define EFL_IOPL_USER 0x00003000
#define EFL_NT 0x00004000
#define EFL_RF 0x00010000
#define EFL_VM 0x00020000
#define EFL_AC 0x00040000
#define EFL_VIF 0x00080000
#define EFL_VIP 0x00100000
#define EFL_ID 0x00200000
#define EFL_CLR 0xfff88028
#define EFL_SET 0x00000002
#define EFL_USER_SET (EFL_IF)
#define EFL_USER_CLEAR (EFL_IOPL|EFL_NT|EFL_RF)
#define i386_THREAD_STATE 1
#define i386_FLOAT_STATE 2
#define i386_EXCEPTION_STATE 3
#define x86_THREAD_STATE32 1
#define x86_FLOAT_STATE32 2
#define x86_EXCEPTION_STATE32 3
#define x86_THREAD_STATE64 4
#define x86_FLOAT_STATE64 5
#define x86_EXCEPTION_STATE64 6
#define x86_THREAD_STATE 7
#define x86_FLOAT_STATE 8
#define x86_EXCEPTION_STATE 9
#define x86_DEBUG_STATE32 10
#define x86_DEBUG_STATE64 11
#define x86_DEBUG_STATE 12
#define THREAD_STATE_NONE 13
#define x86_AVX_STATE32 16
#define x86_AVX_STATE64 17
#define x86_AVX_STATE 18
#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
#define VALID_THREAD_STATE_FLAVOR(x) ((x == x86_THREAD_STATE32) || (x == x86_FLOAT_STATE32) || (x == x86_EXCEPTION_STATE32) || (x == x86_DEBUG_STATE32) || (x == x86_THREAD_STATE64) || (x == x86_FLOAT_STATE64) || (x == x86_EXCEPTION_STATE64) || (x == x86_DEBUG_STATE64) || (x == x86_THREAD_STATE) || (x == x86_FLOAT_STATE) || (x == x86_EXCEPTION_STATE) || (x == x86_DEBUG_STATE) || (x == x86_AVX_STATE32) || (x == x86_AVX_STATE64) || (x == x86_AVX_STATE) || (x == THREAD_STATE_NONE))
struct x86_state_hdr {
 int flavor;
 int count;
};
typedef struct x86_state_hdr x86_state_hdr_t;
#define USER_CODE_SELECTOR 0x0017
#define USER_DATA_SELECTOR 0x001f
#define KERN_CODE_SELECTOR 0x0008
#define KERN_DATA_SELECTOR 0x0010
typedef struct i386_thread_state i386_thread_state_t;
#define i386_THREAD_STATE_COUNT ((mach_msg_type_number_t) ( sizeof (i386_thread_state_t) / sizeof (int) ))
typedef struct i386_thread_state x86_thread_state32_t;
#define x86_THREAD_STATE32_COUNT ((mach_msg_type_number_t) ( sizeof (x86_thread_state32_t) / sizeof (int) ))
typedef struct i386_float_state i386_float_state_t;
#define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) (sizeof(i386_float_state_t)/sizeof(unsigned int)))
typedef struct i386_float_state x86_float_state32_t;
#define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) (sizeof(x86_float_state32_t)/sizeof(unsigned int)))
typedef struct i386_avx_state x86_avx_state32_t;
#define x86_AVX_STATE32_COUNT ((mach_msg_type_number_t) (sizeof(x86_avx_state32_t)/sizeof(unsigned int)))
typedef struct i386_exception_state i386_exception_state_t;
#define i386_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) ( sizeof (i386_exception_state_t) / sizeof (int) ))
typedef struct i386_exception_state x86_exception_state32_t;
#define x86_EXCEPTION_STATE32_COUNT ((mach_msg_type_number_t) ( sizeof (x86_exception_state32_t) / sizeof (int) ))
#define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT
typedef struct x86_debug_state32 x86_debug_state32_t;
#define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) ( sizeof (x86_debug_state32_t) / sizeof (int) ))
#define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT
typedef struct x86_thread_state64 x86_thread_state64_t;
#define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) ( sizeof (x86_thread_state64_t) / sizeof (int) ))
typedef struct x86_float_state64 x86_float_state64_t;
#define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) (sizeof(x86_float_state64_t)/sizeof(unsigned int)))
typedef struct x86_avx_state64 x86_avx_state64_t;
#define x86_AVX_STATE64_COUNT ((mach_msg_type_number_t) (sizeof(x86_avx_state64_t)/sizeof(unsigned int)))
typedef struct x86_exception_state64 x86_exception_state64_t;
#define x86_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) ( sizeof (x86_exception_state64_t) / sizeof (int) ))
#define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT
typedef struct x86_debug_state64 x86_debug_state64_t;
#define x86_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) ( sizeof (x86_debug_state64_t) / sizeof (int) ))
#define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT
struct x86_thread_state {
 x86_state_hdr_t tsh;
 union {
     x86_thread_state32_t ts32;
     x86_thread_state64_t ts64;
 } uts;
};
struct x86_float_state {
 x86_state_hdr_t fsh;
 union {
  x86_float_state32_t fs32;
  x86_float_state64_t fs64;
 } ufs;
};
struct x86_exception_state {
 x86_state_hdr_t esh;
 union {
  x86_exception_state32_t es32;
  x86_exception_state64_t es64;
 } ues;
};
struct x86_debug_state {
 x86_state_hdr_t dsh;
 union {
  x86_debug_state32_t ds32;
  x86_debug_state64_t ds64;
 } uds;
};
struct x86_avx_state {
 x86_state_hdr_t ash;
 union {
  x86_avx_state32_t as32;
  x86_avx_state64_t as64;
 } ufs;
};
typedef struct x86_thread_state x86_thread_state_t;
#define x86_THREAD_STATE_COUNT ((mach_msg_type_number_t) ( sizeof (x86_thread_state_t) / sizeof (int) ))
typedef struct x86_float_state x86_float_state_t;
#define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) (sizeof(x86_float_state_t)/sizeof(unsigned int)))
typedef struct x86_exception_state x86_exception_state_t;
#define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) (sizeof(x86_exception_state_t)/sizeof(unsigned int)))
typedef struct x86_debug_state x86_debug_state_t;
#define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) (sizeof(x86_debug_state_t)/sizeof(unsigned int)))
typedef struct x86_avx_state x86_avx_state_t;
#define x86_AVX_STATE_COUNT ((mach_msg_type_number_t) (sizeof(x86_avx_state_t)/sizeof(unsigned int)))
#define MACHINE_THREAD_STATE x86_THREAD_STATE
#define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT
#define x86_SAVED_STATE32 THREAD_STATE_NONE + 1
#define x86_SAVED_STATE64 THREAD_STATE_NONE + 2
struct x86_saved_state32 {
 uint32_t gs;
 uint32_t fs;
 uint32_t es;
 uint32_t ds;
 uint32_t edi;
 uint32_t esi;
 uint32_t ebp;
 uint32_t cr2;
 uint32_t ebx;
 uint32_t edx;
 uint32_t ecx;
 uint32_t eax;
 uint16_t trapno;
 uint16_t cpu;
 uint32_t err;
 uint32_t eip;
 uint32_t cs;
 uint32_t efl;
 uint32_t uesp;
 uint32_t ss;
};
typedef struct x86_saved_state32 x86_saved_state32_t;
#define x86_SAVED_STATE32_COUNT ((mach_msg_type_number_t) (sizeof (x86_saved_state32_t)/sizeof(unsigned int)))
#pragma pack(4)
struct x86_64_intr_stack_frame {
 uint16_t trapno;
 uint16_t cpu;
 uint32_t _pad;
 uint64_t trapfn;
 uint64_t err;
 uint64_t rip;
 uint64_t cs;
 uint64_t rflags;
 uint64_t rsp;
 uint64_t ss;
};
typedef struct x86_64_intr_stack_frame x86_64_intr_stack_frame_t;
struct x86_saved_state64 {
 uint64_t rdi;
 uint64_t rsi;
 uint64_t rdx;
 uint64_t r10;
 uint64_t r8;
 uint64_t r9;
 uint64_t v_arg6;
 uint64_t v_arg7;
 uint64_t v_arg8;
        uint64_t cr2;
        uint64_t r15;
        uint64_t r14;
        uint64_t r13;
        uint64_t r12;
        uint64_t r11;
 uint64_t rbp;
 uint64_t rbx;
 uint64_t rcx;
 uint64_t rax;
 uint32_t gs;
 uint32_t fs;
 struct x86_64_intr_stack_frame isf;
};
typedef struct x86_saved_state64 x86_saved_state64_t;
#define x86_SAVED_STATE64_COUNT ((mach_msg_type_number_t) (sizeof (struct x86_saved_state64)/sizeof(unsigned int)))
extern uint32_t get_eflags_exportmask(void);
typedef struct {
 uint32_t flavor;
 uint32_t _pad_for_16byte_alignment[3];
 union {
  x86_saved_state32_t ss_32;
  x86_saved_state64_t ss_64;
 } uss;
} x86_saved_state_t;
#define ss_32 uss.ss_32
#define ss_64 uss.ss_64
#pragma pack()
static inline boolean_t
is_saved_state64(x86_saved_state_t *iss)
{
 return (iss->flavor == 13 + 2);
}
static inline boolean_t
is_saved_state32(x86_saved_state_t *iss)
{
 return (iss->flavor == 13 + 1);
}
static inline x86_saved_state32_t *
saved_state32(x86_saved_state_t *iss)
{
 return &iss->uss.ss_32;
}
static inline x86_saved_state64_t *
saved_state64(x86_saved_state_t *iss)
{
 return &iss->uss.ss_64;
}
#define _MACH_MACHINE_THREAD_STATE_H_ 
typedef natural_t *thread_state_t;
typedef natural_t thread_state_data_t[(224)];
#define THREAD_STATE_FLAVOR_LIST 0
#define THREAD_STATE_FLAVOR_LIST_NEW 128
#define THREAD_STATE_FLAVOR_LIST_10_9 129
typedef int thread_state_flavor_t;
typedef thread_state_flavor_t *thread_state_flavor_array_t;
typedef int exception_type_t;
typedef integer_t exception_data_type_t;
typedef int64_t mach_exception_data_type_t;
typedef int exception_behavior_t;
typedef exception_data_type_t *exception_data_t;
typedef mach_exception_data_type_t *mach_exception_data_t;
typedef unsigned int exception_mask_t;
typedef exception_mask_t *exception_mask_array_t;
typedef exception_behavior_t *exception_behavior_array_t;
typedef thread_state_flavor_t *exception_flavor_array_t;
typedef mach_port_t *exception_port_array_t;
typedef mach_exception_data_type_t mach_exception_code_t;
typedef mach_exception_data_type_t mach_exception_subcode_t;
#define _MACH_PROCESSOR_INFO_H_ 
#define _MACH_MACHINE_PROCESSOR_INFO_H_ 
#define _MACH_I386_PROCESSOR_INFO_H_ 
typedef integer_t *processor_info_t;
typedef integer_t *processor_info_array_t;
#define PROCESSOR_INFO_MAX (1024)
typedef integer_t processor_info_data_t[(1024)];
typedef integer_t *processor_set_info_t;
#define PROCESSOR_SET_INFO_MAX (1024)
typedef integer_t processor_set_info_data_t[(1024)];
typedef int processor_flavor_t;
#define PROCESSOR_BASIC_INFO 1
#define PROCESSOR_CPU_LOAD_INFO 2
#define PROCESSOR_PM_REGS_INFO 0x10000001
#define PROCESSOR_TEMPERATURE 0x10000002
struct processor_basic_info {
 cpu_type_t cpu_type;
 cpu_subtype_t cpu_subtype;
 boolean_t running;
 int slot_num;
 boolean_t is_master;
};
typedef struct processor_basic_info processor_basic_info_data_t;
typedef struct processor_basic_info *processor_basic_info_t;
#define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) (sizeof(processor_basic_info_data_t)/sizeof(natural_t)))
struct processor_cpu_load_info {
        unsigned int cpu_ticks[4];
};
typedef struct processor_cpu_load_info processor_cpu_load_info_data_t;
typedef struct processor_cpu_load_info *processor_cpu_load_info_t;
#define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t)))
#define LOAD_SCALE 1000
typedef int processor_set_flavor_t;
#define PROCESSOR_SET_BASIC_INFO 5
struct processor_set_basic_info {
 int processor_count;
 int default_policy;
};
typedef struct processor_set_basic_info processor_set_basic_info_data_t;
typedef struct processor_set_basic_info *processor_set_basic_info_t;
#define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t)))
#define PROCESSOR_SET_LOAD_INFO 4
struct processor_set_load_info {
        int task_count;
        int thread_count;
        integer_t load_average;
        integer_t mach_factor;
};
typedef struct processor_set_load_info processor_set_load_info_data_t;
typedef struct processor_set_load_info *processor_set_load_info_t;
#define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) (sizeof(processor_set_load_info_data_t)/sizeof(natural_t)))
#define _MACH_TASK_INFO_H_ 
#define _MACH_POLICY_H_ 
typedef int policy_t;
typedef integer_t *policy_info_t;
typedef integer_t *policy_base_t;
typedef integer_t *policy_limit_t;
#define POLICY_NULL 0
#define POLICY_TIMESHARE 1
#define POLICY_RR 2
#define POLICY_FIFO 4
#define __NEW_SCHEDULING_FRAMEWORK__ 
#define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO)
#define invalid_policy(policy) ((policy) != POLICY_TIMESHARE && (policy) != POLICY_RR && (policy) != POLICY_FIFO)
struct policy_timeshare_base {
 integer_t base_priority;
};
struct policy_timeshare_limit {
 integer_t max_priority;
};
struct policy_timeshare_info {
 integer_t max_priority;
 integer_t base_priority;
 integer_t cur_priority;
 boolean_t depressed;
 integer_t depress_priority;
};
typedef struct policy_timeshare_base *policy_timeshare_base_t;
typedef struct policy_timeshare_limit *policy_timeshare_limit_t;
typedef struct policy_timeshare_info *policy_timeshare_info_t;
typedef struct policy_timeshare_base policy_timeshare_base_data_t;
typedef struct policy_timeshare_limit policy_timeshare_limit_data_t;
typedef struct policy_timeshare_info policy_timeshare_info_data_t;
#define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_timeshare_base)/sizeof(integer_t)))
#define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_timeshare_limit)/sizeof(integer_t)))
#define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_timeshare_info)/sizeof(integer_t)))
struct policy_rr_base {
 integer_t base_priority;
 integer_t quantum;
};
struct policy_rr_limit {
 integer_t max_priority;
};
struct policy_rr_info {
 integer_t max_priority;
 integer_t base_priority;
 integer_t quantum;
 boolean_t depressed;
 integer_t depress_priority;
};
typedef struct policy_rr_base *policy_rr_base_t;
typedef struct policy_rr_limit *policy_rr_limit_t;
typedef struct policy_rr_info *policy_rr_info_t;
typedef struct policy_rr_base policy_rr_base_data_t;
typedef struct policy_rr_limit policy_rr_limit_data_t;
typedef struct policy_rr_info policy_rr_info_data_t;
#define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_rr_base)/sizeof(integer_t)))
#define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_rr_limit)/sizeof(integer_t)))
#define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_rr_info)/sizeof(integer_t)))
struct policy_fifo_base {
 integer_t base_priority;
};
struct policy_fifo_limit {
 integer_t max_priority;
};
struct policy_fifo_info {
 integer_t max_priority;
 integer_t base_priority;
 boolean_t depressed;
 integer_t depress_priority;
};
typedef struct policy_fifo_base *policy_fifo_base_t;
typedef struct policy_fifo_limit *policy_fifo_limit_t;
typedef struct policy_fifo_info *policy_fifo_info_t;
typedef struct policy_fifo_base policy_fifo_base_data_t;
typedef struct policy_fifo_limit policy_fifo_limit_data_t;
typedef struct policy_fifo_info policy_fifo_info_data_t;
#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_fifo_base)/sizeof(integer_t)))
#define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_fifo_limit)/sizeof(integer_t)))
#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) (sizeof(struct policy_fifo_info)/sizeof(integer_t)))
struct policy_bases {
 policy_timeshare_base_data_t ts;
 policy_rr_base_data_t rr;
 policy_fifo_base_data_t fifo;
};
struct policy_limits {
 policy_timeshare_limit_data_t ts;
 policy_rr_limit_data_t rr;
 policy_fifo_limit_data_t fifo;
};
struct policy_infos {
 policy_timeshare_info_data_t ts;
 policy_rr_info_data_t rr;
 policy_fifo_info_data_t fifo;
};
typedef struct policy_bases policy_base_data_t;
typedef struct policy_limits policy_limit_data_t;
typedef struct policy_infos policy_info_data_t;
#define __AVAILABILITY__ 
#define __MAC_10_0 1000
#define __MAC_10_1 1010
#define __MAC_10_2 1020
#define __MAC_10_3 1030
#define __MAC_10_4 1040
#define __MAC_10_5 1050
#define __MAC_10_6 1060
#define __MAC_10_7 1070
#define __MAC_10_8 1080
#define __MAC_10_9 1090
#define __MAC_NA 9999
#define __IPHONE_2_0 20000
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000
#define __IPHONE_3_1 30100
#define __IPHONE_3_2 30200
#define __IPHONE_4_0 40000
#define __IPHONE_4_1 40100
#define __IPHONE_4_2 40200
#define __IPHONE_4_3 40300
#define __IPHONE_5_0 50000
#define __IPHONE_5_1 50100
#define __IPHONE_6_0 60000
#define __IPHONE_6_1 60100
#define __IPHONE_7_0 70000
#define __IPHONE_NA 99999
#define __AVAILABILITY_INTERNAL__ 
#define __AVAILABILITY_INTERNAL_DEPRECATED __attribute__((deprecated))
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
#define __AVAILABILITY_INTERNAL_UNAVAILABLE __attribute__((unavailable))
#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
#define __AVAILABILITY_INTERNAL_REGULAR 
#define __OSX_AVAILABLE_STARTING(_osx,_ios) 
#define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro,_osxDep,_iosIntro,_iosDep) 
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro,_osxDep,_iosIntro,_iosDep,_msg) 
typedef natural_t task_flavor_t;
typedef integer_t *task_info_t;
#define TASK_INFO_MAX (1024)
typedef integer_t task_info_data_t[(1024)];
#pragma pack(4)
#define TASK_BASIC_INFO_32 4
#define TASK_BASIC2_INFO_32 6
struct task_basic_info_32 {
        integer_t suspend_count;
        natural_t virtual_size;
        natural_t resident_size;
        time_value_t user_time;
        time_value_t system_time;
 policy_t policy;
};
typedef struct task_basic_info_32 task_basic_info_32_data_t;
typedef struct task_basic_info_32 *task_basic_info_32_t;
#define TASK_BASIC_INFO_32_COUNT (sizeof(task_basic_info_32_data_t) / sizeof(natural_t))
struct task_basic_info_64 {
        integer_t suspend_count;
        mach_vm_size_t virtual_size;
        mach_vm_size_t resident_size;
        time_value_t user_time;
        time_value_t system_time;
 policy_t policy;
};
typedef struct task_basic_info_64 task_basic_info_64_data_t;
typedef struct task_basic_info_64 *task_basic_info_64_t;
#define TASK_BASIC_INFO_64 5
#define TASK_BASIC_INFO_64_COUNT (sizeof(task_basic_info_64_data_t) / sizeof(natural_t))
struct task_basic_info {
        integer_t suspend_count;
        vm_size_t virtual_size;
        vm_size_t resident_size;
        time_value_t user_time;
        time_value_t system_time;
 policy_t policy;
};
typedef struct task_basic_info task_basic_info_data_t;
typedef struct task_basic_info *task_basic_info_t;
#define TASK_BASIC_INFO_COUNT (sizeof(task_basic_info_data_t) / sizeof(natural_t))
#define TASK_BASIC_INFO TASK_BASIC_INFO_64
#define TASK_EVENTS_INFO 2
struct task_events_info {
 integer_t faults;
 integer_t pageins;
 integer_t cow_faults;
 integer_t messages_sent;
 integer_t messages_received;
        integer_t syscalls_mach;
 integer_t syscalls_unix;
 integer_t csw;
};
typedef struct task_events_info task_events_info_data_t;
typedef struct task_events_info *task_events_info_t;
#define TASK_EVENTS_INFO_COUNT ((mach_msg_type_number_t) (sizeof(task_events_info_data_t) / sizeof(natural_t)))
#define TASK_THREAD_TIMES_INFO 3
struct task_thread_times_info {
 time_value_t user_time;
 time_value_t system_time;
};
typedef struct task_thread_times_info task_thread_times_info_data_t;
typedef struct task_thread_times_info *task_thread_times_info_t;
#define TASK_THREAD_TIMES_INFO_COUNT ((mach_msg_type_number_t) (sizeof(task_thread_times_info_data_t) / sizeof(natural_t)))
#define TASK_ABSOLUTETIME_INFO 1
struct task_absolutetime_info {
 uint64_t total_user;
 uint64_t total_system;
 uint64_t threads_user;
 uint64_t threads_system;
};
typedef struct task_absolutetime_info task_absolutetime_info_data_t;
typedef struct task_absolutetime_info *task_absolutetime_info_t;
#define TASK_ABSOLUTETIME_INFO_COUNT ((mach_msg_type_number_t) (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t)))
#define TASK_KERNELMEMORY_INFO 7
struct task_kernelmemory_info {
 uint64_t total_palloc;
 uint64_t total_pfree;
 uint64_t total_salloc;
 uint64_t total_sfree;
};
typedef struct task_kernelmemory_info task_kernelmemory_info_data_t;
typedef struct task_kernelmemory_info *task_kernelmemory_info_t;
#define TASK_KERNELMEMORY_INFO_COUNT ((mach_msg_type_number_t) (sizeof (task_kernelmemory_info_data_t) / sizeof (natural_t)))
#define TASK_SECURITY_TOKEN 13
#define TASK_SECURITY_TOKEN_COUNT ((mach_msg_type_number_t) (sizeof(security_token_t) / sizeof(natural_t)))
#define TASK_AUDIT_TOKEN 15
#define TASK_AUDIT_TOKEN_COUNT (sizeof(audit_token_t) / sizeof(natural_t))
#define TASK_AFFINITY_TAG_INFO 16
struct task_affinity_tag_info {
 integer_t set_count;
 integer_t min;
 integer_t max;
 integer_t task_count;
};
typedef struct task_affinity_tag_info task_affinity_tag_info_data_t;
typedef struct task_affinity_tag_info *task_affinity_tag_info_t;
#define TASK_AFFINITY_TAG_INFO_COUNT (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t))
#define TASK_DYLD_INFO 17
struct task_dyld_info {
 mach_vm_address_t all_image_info_addr;
 mach_vm_size_t all_image_info_size;
 integer_t all_image_info_format;
};
typedef struct task_dyld_info task_dyld_info_data_t;
typedef struct task_dyld_info *task_dyld_info_t;
#define TASK_DYLD_INFO_COUNT (sizeof(task_dyld_info_data_t) / sizeof(natural_t))
#define TASK_DYLD_ALL_IMAGE_INFO_32 0
#define TASK_DYLD_ALL_IMAGE_INFO_64 1
#define TASK_EXTMOD_INFO 19
struct task_extmod_info {
 unsigned char task_uuid[16];
 vm_extmod_statistics_data_t extmod_statistics;
};
typedef struct task_extmod_info task_extmod_info_data_t;
typedef struct task_extmod_info *task_extmod_info_t;
#define TASK_EXTMOD_INFO_COUNT (sizeof(task_extmod_info_data_t) / sizeof(natural_t))
#define MACH_TASK_BASIC_INFO 20
struct mach_task_basic_info {
        mach_vm_size_t virtual_size;
        mach_vm_size_t resident_size;
        mach_vm_size_t resident_size_max;
        time_value_t user_time;
        time_value_t system_time;
        policy_t policy;
        integer_t suspend_count;
};
typedef struct mach_task_basic_info mach_task_basic_info_data_t;
typedef struct mach_task_basic_info *mach_task_basic_info_t;
#define MACH_TASK_BASIC_INFO_COUNT (sizeof(mach_task_basic_info_data_t) / sizeof(natural_t))
#define TASK_POWER_INFO 21
struct task_power_info {
 uint64_t total_user;
 uint64_t total_system;
 uint64_t task_interrupt_wakeups;
 uint64_t task_platform_idle_wakeups;
 uint64_t task_timer_wakeups_bin_1;
 uint64_t task_timer_wakeups_bin_2;
};
typedef struct task_power_info task_power_info_data_t;
typedef struct task_power_info *task_power_info_t;
#define TASK_POWER_INFO_COUNT ((mach_msg_type_number_t) (sizeof (task_power_info_data_t) / sizeof (natural_t)))
#define TASK_VM_INFO 22
#define TASK_VM_INFO_PURGEABLE 23
struct task_vm_info {
        mach_vm_size_t virtual_size;
 integer_t region_count;
 integer_t page_size;
        mach_vm_size_t resident_size;
        mach_vm_size_t resident_size_peak;
 mach_vm_size_t device;
 mach_vm_size_t device_peak;
 mach_vm_size_t internal;
 mach_vm_size_t internal_peak;
 mach_vm_size_t external;
 mach_vm_size_t external_peak;
 mach_vm_size_t reusable;
 mach_vm_size_t reusable_peak;
 mach_vm_size_t purgeable_volatile_pmap;
 mach_vm_size_t purgeable_volatile_resident;
 mach_vm_size_t purgeable_volatile_virtual;
 mach_vm_size_t compressed;
 mach_vm_size_t compressed_peak;
 mach_vm_size_t compressed_lifetime;
};
typedef struct task_vm_info task_vm_info_data_t;
typedef struct task_vm_info *task_vm_info_t;
#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) (sizeof (task_vm_info_data_t) / sizeof (natural_t)))
typedef struct vm_purgeable_info task_purgable_info_t;
#define TASK_SCHED_TIMESHARE_INFO 10
#define TASK_SCHED_RR_INFO 11
#define TASK_SCHED_FIFO_INFO 12
#define TASK_SCHED_INFO 14
#pragma pack()
#define _MACH_TASK_POLICY_H_ 
typedef natural_t task_policy_flavor_t;
typedef integer_t *task_policy_t;
#define TASK_CATEGORY_POLICY 1
#define TASK_SUPPRESSION_POLICY 3
#define TASK_POLICY_STATE 4
#define TASK_BASE_QOS_POLICY 8
#define TASK_OVERRIDE_QOS_POLICY 9
enum task_role {
 TASK_RENICED = -1,
 TASK_UNSPECIFIED = 0,
 TASK_FOREGROUND_APPLICATION,
 TASK_BACKGROUND_APPLICATION,
 TASK_CONTROL_APPLICATION,
 TASK_GRAPHICS_SERVER,
 TASK_THROTTLE_APPLICATION,
 TASK_NONUI_APPLICATION,
 TASK_DEFAULT_APPLICATION
};
typedef integer_t task_role_t;
struct task_category_policy {
 task_role_t role;
};
typedef struct task_category_policy task_category_policy_data_t;
typedef struct task_category_policy *task_category_policy_t;
#define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (task_category_policy_data_t) / sizeof (integer_t)))
enum task_latency_qos {
 LATENCY_QOS_TIER_UNSPECIFIED = 0x0,
 LATENCY_QOS_TIER_0 = ((0xFF<<16) | 1),
 LATENCY_QOS_TIER_1 = ((0xFF<<16) | 2),
 LATENCY_QOS_TIER_2 = ((0xFF<<16) | 3),
 LATENCY_QOS_TIER_3 = ((0xFF<<16) | 4),
 LATENCY_QOS_TIER_4 = ((0xFF<<16) | 5),
 LATENCY_QOS_TIER_5 = ((0xFF<<16) | 6)
};
typedef integer_t task_latency_qos_t;
enum task_throughput_qos {
 THROUGHPUT_QOS_TIER_UNSPECIFIED = 0x0,
 THROUGHPUT_QOS_TIER_0 = ((0xFE<<16) | 1),
 THROUGHPUT_QOS_TIER_1 = ((0xFE<<16) | 2),
 THROUGHPUT_QOS_TIER_2 = ((0xFE<<16) | 3),
 THROUGHPUT_QOS_TIER_3 = ((0xFE<<16) | 4),
 THROUGHPUT_QOS_TIER_4 = ((0xFE<<16) | 5),
 THROUGHPUT_QOS_TIER_5 = ((0xFE<<16) | 6),
};
#define LATENCY_QOS_LAUNCH_DEFAULT_TIER LATENCY_QOS_TIER_3
#define THROUGHPUT_QOS_LAUNCH_DEFAULT_TIER THROUGHPUT_QOS_TIER_3
typedef integer_t task_throughput_qos_t;
struct task_qos_policy {
 task_latency_qos_t task_latency_qos_tier;
 task_throughput_qos_t task_throughput_qos_tier;
};
typedef struct task_qos_policy *task_qos_policy_t;
#define TASK_QOS_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (struct task_qos_policy) / sizeof (integer_t)))
#define PROC_FLAG_DARWINBG 0x8000
#define PROC_FLAG_EXT_DARWINBG 0x10000
#define PROC_FLAG_IOS_APPLEDAEMON 0x20000
#define PROC_FLAG_IOS_IMPPROMOTION 0x80000
#define PROC_FLAG_ADAPTIVE 0x100000
#define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000
#define PROC_FLAG_IMPORTANCE_DONOR 0x400000
#define PROC_FLAG_SUPPRESSED 0x800000
#define PROC_FLAG_IOS_APPLICATION 0x1000000
#define _MACH_TASK_SPECIAL_PORTS_H_ 
typedef int task_special_port_t;
#define TASK_KERNEL_PORT 1
#define TASK_HOST_PORT 2
#define TASK_NAME_PORT 3
#define TASK_BOOTSTRAP_PORT 4
#define TASK_SEATBELT_PORT 7
#define TASK_ACCESS_PORT 9
#define task_get_kernel_port(task,port) (task_get_special_port((task), TASK_KERNEL_PORT, (port)))
#define task_set_kernel_port(task,port) (task_set_special_port((task), TASK_KERNEL_PORT, (port)))
#define task_get_host_port(task,port) (task_get_special_port((task), TASK_HOST_PORT, (port)))
#define task_set_host_port(task,port) (task_set_special_port((task), TASK_HOST_PORT, (port)))
#define task_get_bootstrap_port(task,port) (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
#define task_set_bootstrap_port(task,port) (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
#define task_get_task_access_port(task,port) (task_get_special_port((task), TASK_ACCESS_PORT, (port)))
#define task_set_task_access_port(task,port) (task_set_special_port((task), TASK_ACCESS_PORT, (port)))
#define _MACH_THREAD_INFO_H_ 
typedef natural_t thread_flavor_t;
typedef integer_t *thread_info_t;
#define THREAD_INFO_MAX (1024)
typedef integer_t thread_info_data_t[(1024)];
#define THREAD_BASIC_INFO 3
struct thread_basic_info {
        time_value_t user_time;
        time_value_t system_time;
        integer_t cpu_usage;
 policy_t policy;
        integer_t run_state;
        integer_t flags;
        integer_t suspend_count;
        integer_t sleep_time;
};
typedef struct thread_basic_info thread_basic_info_data_t;
typedef struct thread_basic_info *thread_basic_info_t;
#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) (sizeof(thread_basic_info_data_t) / sizeof(natural_t)))
#define THREAD_IDENTIFIER_INFO 4
struct thread_identifier_info {
 uint64_t thread_id;
 uint64_t thread_handle;
 uint64_t dispatch_qaddr;
};
typedef struct thread_identifier_info thread_identifier_info_data_t;
typedef struct thread_identifier_info *thread_identifier_info_t;
#define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) (sizeof(thread_identifier_info_data_t) / sizeof(natural_t)))
#define TH_USAGE_SCALE 1000
#define TH_STATE_RUNNING 1
#define TH_STATE_STOPPED 2
#define TH_STATE_WAITING 3
#define TH_STATE_UNINTERRUPTIBLE 4
#define TH_STATE_HALTED 5
#define TH_FLAGS_SWAPPED 0x1
#define TH_FLAGS_IDLE 0x2
#define THREAD_SCHED_TIMESHARE_INFO 10
#define THREAD_SCHED_RR_INFO 11
#define THREAD_SCHED_FIFO_INFO 12
#define _MACH_THREAD_POLICY_H_ 
typedef natural_t thread_policy_flavor_t;
typedef integer_t *thread_policy_t;
#define THREAD_STANDARD_POLICY 1
struct thread_standard_policy {
 natural_t no_data;
};
typedef struct thread_standard_policy thread_standard_policy_data_t;
typedef struct thread_standard_policy *thread_standard_policy_t;
#define THREAD_STANDARD_POLICY_COUNT 0
#define THREAD_EXTENDED_POLICY 1
struct thread_extended_policy {
 boolean_t timeshare;
};
typedef struct thread_extended_policy thread_extended_policy_data_t;
typedef struct thread_extended_policy *thread_extended_policy_t;
#define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (thread_extended_policy_data_t) / sizeof (integer_t)))
#define THREAD_TIME_CONSTRAINT_POLICY 2
struct thread_time_constraint_policy {
 uint32_t period;
 uint32_t computation;
 uint32_t constraint;
 boolean_t preemptible;
};
typedef struct thread_time_constraint_policy thread_time_constraint_policy_data_t;
typedef struct thread_time_constraint_policy *thread_time_constraint_policy_t;
#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t)))
#define THREAD_PRECEDENCE_POLICY 3
struct thread_precedence_policy {
 integer_t importance;
};
typedef struct thread_precedence_policy thread_precedence_policy_data_t;
typedef struct thread_precedence_policy *thread_precedence_policy_t;
#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t)))
#define THREAD_AFFINITY_POLICY 4
struct thread_affinity_policy {
 integer_t affinity_tag;
};
#define THREAD_AFFINITY_TAG_NULL 0
typedef struct thread_affinity_policy thread_affinity_policy_data_t;
typedef struct thread_affinity_policy *thread_affinity_policy_t;
#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))
#define THREAD_BACKGROUND_POLICY 5
struct thread_background_policy {
 integer_t priority;
};
typedef struct thread_background_policy thread_background_policy_data_t;
typedef struct thread_background_policy *thread_background_policy_t;
#define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) (sizeof (thread_background_policy_data_t) / sizeof (integer_t)))
#define _MACH_THREAD_SPECIAL_PORTS_H_ 
#define THREAD_KERNEL_PORT 1
#define thread_get_kernel_port(thread,port) (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port)))
#define thread_set_kernel_port(thread,port) (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port)))
#define _MACH_CLOCK_TYPES_H_ 
typedef int alarm_type_t;
typedef int sleep_type_t;
typedef int clock_id_t;
typedef int clock_flavor_t;
typedef int *clock_attr_t;
typedef int clock_res_t;
struct mach_timespec {
 unsigned int tv_sec;
 clock_res_t tv_nsec;
};
typedef struct mach_timespec mach_timespec_t;
#define SYSTEM_CLOCK 0
#define CALENDAR_CLOCK 1
#define REALTIME_CLOCK 0
#define CLOCK_GET_TIME_RES 1
#define CLOCK_ALARM_CURRES 3
#define CLOCK_ALARM_MINRES 4
#define CLOCK_ALARM_MAXRES 5
#define NSEC_PER_USEC 1000ull
#define USEC_PER_SEC 1000000ull
#define NSEC_PER_SEC 1000000000ull
#define NSEC_PER_MSEC 1000000ull
#define BAD_MACH_TIMESPEC(t) ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
#define CMP_MACH_TIMESPEC(t1,t2) ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : (t1)->tv_nsec - (t2)->tv_nsec))
#define ADD_MACH_TIMESPEC(t1,t2) do { if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { (t1)->tv_nsec -= (long) NSEC_PER_SEC; (t1)->tv_sec += 1; } (t1)->tv_sec += (t2)->tv_sec; } while (0)
#define SUB_MACH_TIMESPEC(t1,t2) do { if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { (t1)->tv_nsec += (long) NSEC_PER_SEC; (t1)->tv_sec -= 1; } (t1)->tv_sec -= (t2)->tv_sec; } while (0)
#define ALRMTYPE 0xff
#define TIME_ABSOLUTE 0x00
#define TIME_RELATIVE 0x01
#define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0)
#define _MACH_VM_ATTRIBUTES_H_ 
typedef unsigned int vm_machine_attribute_t;
#define MATTR_CACHE 1
#define MATTR_MIGRATE 2
#define MATTR_REPLICATE 4
typedef int vm_machine_attribute_val_t;
#define MATTR_VAL_OFF 0
#define MATTR_VAL_ON 1
#define MATTR_VAL_GET 2
#define MATTR_VAL_CACHE_FLUSH 6
#define MATTR_VAL_DCACHE_FLUSH 7
#define MATTR_VAL_ICACHE_FLUSH 8
#define MATTR_VAL_CACHE_SYNC 9
#define MATTR_VAL_CACHE_SYNC 9
#define MATTR_VAL_GET_INFO 10
#define _MACH_VM_INHERIT_H_ 
typedef unsigned int vm_inherit_t;
#define VM_INHERIT_SHARE ((vm_inherit_t) 0)
#define VM_INHERIT_COPY ((vm_inherit_t) 1)
#define VM_INHERIT_NONE ((vm_inherit_t) 2)
#define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3)
#define VM_INHERIT_DEFAULT VM_INHERIT_COPY
#define VM_INHERIT_LAST_VALID VM_INHERIT_NONE
#define _MACH_VM_PURGABLE_H_ 
typedef int vm_purgable_t;
#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0)
#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1)
#define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2)
#define VM_PURGABLE_NO_AGING_SHIFT 16
#define VM_PURGABLE_NO_AGING_MASK (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
#define VM_PURGABLE_NO_AGING (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
#define VM_PURGABLE_DEBUG_SHIFT 12
#define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT)
#define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT)
#define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT)
#define VM_VOLATILE_GROUP_SHIFT 8
#define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_0
#define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT)
#define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT)
#define VM_PURGABLE_BEHAVIOR_SHIFT 6
#define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
#define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT)
#define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
#define VM_PURGABLE_ORDERING_SHIFT 5
#define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT)
#define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT)
#define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT)
#define VM_VOLATILE_ORDER_SHIFT 4
#define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT)
#define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT)
#define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT)
#define VM_PURGABLE_STATE_MIN 0
#define VM_PURGABLE_STATE_MAX 3
#define VM_PURGABLE_STATE_MASK 3
#define VM_PURGABLE_NONVOLATILE 0
#define VM_PURGABLE_VOLATILE 1
#define VM_PURGABLE_EMPTY 2
#define VM_PURGABLE_DENY 3
#define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | VM_VOLATILE_ORDER_MASK | VM_PURGABLE_ORDERING_MASK | VM_PURGABLE_BEHAVIOR_MASK | VM_VOLATILE_GROUP_MASK | VM_PURGABLE_DEBUG_MASK | VM_PURGABLE_NO_AGING_MASK)
#define _MACH_VM_BEHAVIOR_H_ 
typedef int vm_behavior_t;
#define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0)
#define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1)
#define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2)
#define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3)
#define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4)
#define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5)
#define VM_BEHAVIOR_FREE ((vm_behavior_t) 6)
#define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7)
#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8)
#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
#define _MACH_VM_REGION_H_ 
#define _MACH_MACHINE_VM_PARAM_H_ 
#pragma pack(4)
typedef uint32_t vm32_object_id_t;
#define VM_REGION_INFO_MAX (1024)
typedef int *vm_region_info_t;
typedef int *vm_region_info_64_t;
typedef int *vm_region_recurse_info_t;
typedef int *vm_region_recurse_info_64_t;
typedef int vm_region_flavor_t;
typedef int vm_region_info_data_t[(1024)];
#define VM_REGION_BASIC_INFO_64 9
struct vm_region_basic_info_64 {
 vm_prot_t protection;
 vm_prot_t max_protection;
 vm_inherit_t inheritance;
 boolean_t shared;
 boolean_t reserved;
 memory_object_offset_t offset;
 vm_behavior_t behavior;
 unsigned short user_wired_count;
};
typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t;
typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t;
#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) (sizeof(vm_region_basic_info_data_64_t)/sizeof(int)))
#define VM_REGION_BASIC_INFO 10
struct vm_region_basic_info {
 vm_prot_t protection;
 vm_prot_t max_protection;
 vm_inherit_t inheritance;
 boolean_t shared;
 boolean_t reserved;
 uint32_t offset;
 vm_behavior_t behavior;
 unsigned short user_wired_count;
};
typedef struct vm_region_basic_info *vm_region_basic_info_t;
typedef struct vm_region_basic_info vm_region_basic_info_data_t;
#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) (sizeof(vm_region_basic_info_data_t)/sizeof(int)))
#define SM_COW 1
#define SM_PRIVATE 2
#define SM_EMPTY 3
#define SM_SHARED 4
#define SM_TRUESHARED 5
#define SM_PRIVATE_ALIASED 6
#define SM_SHARED_ALIASED 7
#define SM_LARGE_PAGE 8
#define VM_REGION_EXTENDED_INFO 13
struct vm_region_extended_info {
 vm_prot_t protection;
        unsigned int user_tag;
        unsigned int pages_resident;
        unsigned int pages_shared_now_private;
        unsigned int pages_swapped_out;
        unsigned int pages_dirtied;
        unsigned int ref_count;
        unsigned short shadow_depth;
        unsigned char external_pager;
        unsigned char share_mode;
 unsigned int pages_reusable;
};
typedef struct vm_region_extended_info *vm_region_extended_info_t;
typedef struct vm_region_extended_info vm_region_extended_info_data_t;
#define VM_REGION_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t)))
#define VM_REGION_TOP_INFO 12
struct vm_region_top_info {
        unsigned int obj_id;
        unsigned int ref_count;
        unsigned int private_pages_resident;
        unsigned int shared_pages_resident;
        unsigned char share_mode;
};
typedef struct vm_region_top_info *vm_region_top_info_t;
typedef struct vm_region_top_info vm_region_top_info_data_t;
#define VM_REGION_TOP_INFO_COUNT ((mach_msg_type_number_t) (sizeof(vm_region_top_info_data_t) / sizeof(natural_t)))
struct vm_region_submap_info {
 vm_prot_t protection;
 vm_prot_t max_protection;
 vm_inherit_t inheritance;
 uint32_t offset;
        unsigned int user_tag;
        unsigned int pages_resident;
        unsigned int pages_shared_now_private;
        unsigned int pages_swapped_out;
        unsigned int pages_dirtied;
        unsigned int ref_count;
        unsigned short shadow_depth;
        unsigned char external_pager;
        unsigned char share_mode;
 boolean_t is_submap;
 vm_behavior_t behavior;
 vm32_object_id_t object_id;
 unsigned short user_wired_count;
};
typedef struct vm_region_submap_info *vm_region_submap_info_t;
typedef struct vm_region_submap_info vm_region_submap_info_data_t;
#define VM_REGION_SUBMAP_INFO_COUNT ((mach_msg_type_number_t) (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t)))
struct vm_region_submap_info_64 {
 vm_prot_t protection;
 vm_prot_t max_protection;
 vm_inherit_t inheritance;
 memory_object_offset_t offset;
        unsigned int user_tag;
        unsigned int pages_resident;
        unsigned int pages_shared_now_private;
        unsigned int pages_swapped_out;
        unsigned int pages_dirtied;
        unsigned int ref_count;
        unsigned short shadow_depth;
        unsigned char external_pager;
        unsigned char share_mode;
 boolean_t is_submap;
 vm_behavior_t behavior;
 vm32_object_id_t object_id;
 unsigned short user_wired_count;
 unsigned int pages_reusable;
};
typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t;
typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t;
#define VM_REGION_SUBMAP_INFO_V1_SIZE (sizeof (vm_region_submap_info_data_64_t))
#define VM_REGION_SUBMAP_INFO_V0_SIZE (VM_REGION_SUBMAP_INFO_V1_SIZE - sizeof (unsigned int) )
#define VM_REGION_SUBMAP_INFO_V1_COUNT_64 ((mach_msg_type_number_t) (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t)))
#define VM_REGION_SUBMAP_INFO_V0_COUNT_64 ((mach_msg_type_number_t) (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t)))
#define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V1_COUNT_64
struct vm_region_submap_short_info_64 {
 vm_prot_t protection;
 vm_prot_t max_protection;
 vm_inherit_t inheritance;
 memory_object_offset_t offset;
        unsigned int user_tag;
        unsigned int ref_count;
        unsigned short shadow_depth;
        unsigned char external_pager;
        unsigned char share_mode;
 boolean_t is_submap;
 vm_behavior_t behavior;
 vm32_object_id_t object_id;
 unsigned short user_wired_count;
};
typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t;
typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t;
#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t) (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t)))
struct mach_vm_read_entry {
 mach_vm_address_t address;
 mach_vm_size_t size;
};
struct vm_read_entry {
 vm_address_t address;
 vm_size_t size;
};
#define VM_MAP_ENTRY_MAX (256)
typedef struct mach_vm_read_entry mach_vm_read_entry_t[(256)];
typedef struct vm_read_entry vm_read_entry_t[(256)];
#pragma pack()
#define VM_PAGE_INFO_MAX 
typedef int *vm_page_info_t;
typedef int vm_page_info_data_t[];
typedef int vm_page_info_flavor_t;
#define VM_PAGE_INFO_BASIC 1
struct vm_page_info_basic {
 int disposition;
 int ref_count;
 vm_object_id_t object_id;
 memory_object_offset_t offset;
 int depth;
 int __pad;
};
typedef struct vm_page_info_basic *vm_page_info_basic_t;
typedef struct vm_page_info_basic vm_page_info_basic_data_t;
#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) (sizeof(vm_page_info_basic_data_t)/sizeof(int)))
#define _MACH_KMOD_H_ 

#define KMOD_MAX_NAME 64
#define KMOD_RETURN_SUCCESS KERN_SUCCESS
#define KMOD_RETURN_FAILURE KERN_FAILURE
typedef int kmod_t;
struct kmod_info;
typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data);
typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data);
#pragma pack(4)
typedef struct kmod_reference {
    struct kmod_reference * next;
    struct kmod_info * info;
} kmod_reference_t;
typedef struct kmod_info {
    struct kmod_info * next;
    int32_t info_version;
    uint32_t id;
    char name[64];
    char version[64];
    int32_t reference_count;
    kmod_reference_t * reference_list;
    vm_address_t address;
    vm_size_t size;
    vm_size_t hdr_size;
    kmod_start_func_t * start;
    kmod_stop_func_t * stop;
} kmod_info_t;
typedef struct kmod_info_32_v1 {
    uint32_t next_addr;
    int32_t info_version;
    uint32_t id;
    uint8_t name[64];
    uint8_t version[64];
    int32_t reference_count;
    uint32_t reference_list_addr;
    uint32_t address;
    uint32_t size;
    uint32_t hdr_size;
    uint32_t start_addr;
    uint32_t stop_addr;
} kmod_info_32_v1_t;
typedef struct kmod_info_64_v1 {
    uint64_t next_addr;
    int32_t info_version;
    uint32_t id;
    uint8_t name[64];
    uint8_t version[64];
    int32_t reference_count;
    uint64_t reference_list_addr;
    uint64_t address;
    uint64_t size;
    uint64_t hdr_size;
    uint64_t start_addr;
    uint64_t stop_addr;
} kmod_info_64_v1_t;
#pragma pack()
#define KMOD_INFO_NAME kmod_info
#define KMOD_INFO_VERSION 1
#define KMOD_DECL(name,version) static kmod_start_func_t name ## _module_start; static kmod_stop_func_t name ## _module_stop; kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, { #name }, { version }, -1, 0, 0, 0, 0, name ## _module_start, name ## _module_stop };
#define KMOD_EXPLICIT_DECL(name,version,start,stop) kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, { #name }, { version }, -1, 0, 0, 0, 0, start, stop };
extern void kmod_panic_dump(vm_offset_t * addr, unsigned int dump_cnt);
typedef void * kmod_args_t;
typedef int kmod_control_flavor_t;
typedef kmod_info_t * kmod_info_array_t;

#define _MACH_VM_PARAM_H_ 
#define PAGE_SIZE_64 (unsigned long long)PAGE_SIZE
#define PAGE_MASK_64 (unsigned long long)PAGE_MASK
#define atop_32(x) ((uint32_t)(x) >> PAGE_SHIFT)
#define ptoa_32(x) ((uint32_t)(x) << PAGE_SHIFT)
#define atop_64(x) ((uint64_t)(x) >> PAGE_SHIFT)
#define ptoa_64(x) ((uint64_t)(x) << PAGE_SHIFT)
#define atop_kernel(x) ((vm_address_t)(x) >> PAGE_SHIFT)
#define ptoa_kernel(x) ((vm_address_t)(x) << PAGE_SHIFT)
#define atop(x) ((vm_address_t)(x) >> PAGE_SHIFT)
#define ptoa(x) ((vm_address_t)(x) << PAGE_SHIFT)
#define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK))
#define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)PAGE_MASK))
#define memory_object_round_page(x) (((memory_object_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK))
#define memory_object_trunc_page(x) ((memory_object_offset_t)(x) & ~((signed)PAGE_MASK))
#define round_page(x) (((vm_offset_t)(x) + PAGE_MASK) & ~((vm_offset_t)PAGE_MASK))
#define trunc_page(x) ((vm_offset_t)(x) & ~((vm_offset_t)PAGE_MASK))
#define round_page_32(x) (((uint32_t)(x) + PAGE_MASK) & ~((uint32_t)PAGE_MASK))
#define trunc_page_32(x) ((uint32_t)(x) & ~((uint32_t)PAGE_MASK))
#define round_page_64(x) (((uint64_t)(x) + PAGE_MASK_64) & ~((uint64_t)PAGE_MASK_64))
#define trunc_page_64(x) ((uint64_t)(x) & ~((uint64_t)PAGE_MASK_64))
#define page_aligned(x) (((x) & PAGE_MASK) == 0)
extern vm_size_t mem_size;
extern uint64_t max_mem;
#define ANON_MAX_SIZE 0xFFFFF000ULL
#define ANON_CHUNK_SIZE (128ULL * 1024 * 1024)
extern uint64_t mem_actual;
extern uint64_t sane_size;
extern addr64_t vm_last_addr;
extern const vm_offset_t vm_min_kernel_address;
extern const vm_offset_t vm_max_kernel_address;
extern vm_offset_t vm_kernel_stext;
extern vm_offset_t vm_kernel_etext;
extern vm_offset_t vm_kernel_base;
extern vm_offset_t vm_kernel_top;
extern vm_offset_t vm_kernel_slide;
extern vm_offset_t vm_kernel_addrperm;
extern vm_offset_t vm_kext_base;
extern vm_offset_t vm_kext_top;
#define VM_KERNEL_IS_SLID(_o) (((vm_offset_t)(_o) >= vm_kernel_base) && ((vm_offset_t)(_o) < vm_kernel_top))
#define VM_KERNEL_IS_KEXT(_o) (((vm_offset_t)(_o) >= vm_kext_base) && ((vm_offset_t)(_o) < vm_kext_top))
#define VM_KERNEL_UNSLIDE(_v) ((VM_KERNEL_IS_SLID(_v) || VM_KERNEL_IS_KEXT(_v)) ? (vm_offset_t)(_v) - vm_kernel_slide : (vm_offset_t)(_v))
#define VM_KERNEL_SLIDE(_u) ((vm_offset_t)(_u) + vm_kernel_slide)
#define VM_KERNEL_ADDRPERM(_v) (((vm_offset_t)(_v) == 0) ? (vm_offset_t)(0) : (vm_offset_t)(_v) + vm_kernel_addrperm)
extern vm_size_t page_size;
extern vm_size_t page_mask;
extern int page_shift;
#define __CAST_DOWN_CHECK 
#define CAST_DOWN(type,addr) ( ((type)((uintptr_t) (addr)/(sizeof(type) < sizeof(uintptr_t) ? 0 : 1))) )
#define CAST_DOWN_EXPLICIT(type,addr) ( ((type)((uintptr_t) (addr))) )
typedef struct task *task_t, *task_name_t, *task_suspension_token_t;
typedef struct thread *thread_t, *thread_act_t;
typedef struct ipc_space *ipc_space_t;
typedef struct host *host_t;
typedef struct host *host_priv_t;
typedef struct host *host_security_t;
typedef struct processor *processor_t;
typedef struct processor_set *processor_set_t;
typedef struct processor_set *processor_set_control_t;
typedef struct semaphore *semaphore_t;
typedef struct ledger *ledger_t;
typedef struct alarm *alarm_t;
typedef struct clock *clock_serv_t;
typedef struct clock *clock_ctrl_t;
typedef struct lock_set *lock_set_t;
struct lock_set ;

struct task ;
struct thread ;
struct host ;
struct processor ;
struct processor_set ;
struct semaphore ;
struct ledger ;
struct alarm ;
struct clock ;

typedef processor_set_t processor_set_name_t;
typedef mach_port_t clock_reply_t;
typedef mach_port_t bootstrap_t;
typedef mach_port_t mem_entry_name_port_t;
typedef mach_port_t exception_handler_t;
typedef exception_handler_t *exception_handler_array_t;
typedef mach_port_t vm_task_entry_t;
typedef mach_port_t io_master_t;
typedef mach_port_t UNDServerRef;
typedef task_t *task_array_t;
typedef thread_t *thread_array_t;
typedef processor_set_t *processor_set_array_t;
typedef processor_set_t *processor_set_name_array_t;
typedef processor_t *processor_array_t;
typedef thread_act_t *thread_act_array_t;
typedef ledger_t *ledger_array_t;
typedef task_t task_port_t;
typedef task_array_t task_port_array_t;
typedef thread_t thread_port_t;
typedef thread_array_t thread_port_array_t;
typedef ipc_space_t ipc_space_port_t;
typedef host_t host_name_t;
typedef host_t host_name_port_t;
typedef processor_set_t processor_set_port_t;
typedef processor_set_t processor_set_name_port_t;
typedef processor_set_array_t processor_set_name_port_array_t;
typedef processor_set_t processor_set_control_port_t;
typedef processor_t processor_port_t;
typedef processor_array_t processor_port_array_t;
typedef thread_act_t thread_act_port_t;
typedef thread_act_array_t thread_act_port_array_t;
typedef semaphore_t semaphore_port_t;
typedef lock_set_t lock_set_port_t;
typedef ledger_t ledger_port_t;
typedef ledger_array_t ledger_port_array_t;
typedef alarm_t alarm_port_t;
typedef clock_serv_t clock_serv_port_t;
typedef clock_ctrl_t clock_ctrl_port_t;
typedef exception_handler_t exception_port_t;
typedef exception_handler_array_t exception_port_arrary_t;
#define TASK_NULL ((task_t) 0)
#define TASK_NAME_NULL ((task_name_t) 0)
#define THREAD_NULL ((thread_t) 0)
#define TID_NULL ((uint64_t) 0)
#define THR_ACT_NULL ((thread_act_t) 0)
#define IPC_SPACE_NULL ((ipc_space_t) 0)
#define HOST_NULL ((host_t) 0)
#define HOST_PRIV_NULL ((host_priv_t)0)
#define HOST_SECURITY_NULL ((host_security_t)0)
#define PROCESSOR_SET_NULL ((processor_set_t) 0)
#define PROCESSOR_NULL ((processor_t) 0)
#define SEMAPHORE_NULL ((semaphore_t) 0)
#define LOCK_SET_NULL ((lock_set_t) 0)
#define LEDGER_NULL ((ledger_t) 0)
#define ALARM_NULL ((alarm_t) 0)
#define CLOCK_NULL ((clock_t) 0)
#define UND_SERVER_NULL ((UNDServerRef) 0)
typedef natural_t ledger_item_t;
#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
typedef int64_t ledger_amount_t;
#define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1))
typedef mach_vm_offset_t *emulation_vector_t;
typedef char *user_subsystem_t;
typedef char *labelstr_t;
#define _MACH_STD_TYPES_H_ 
#define _MACH_SYNC_POLICY_H_ 
typedef int sync_policy_t;
#define SYNC_POLICY_FIFO 0x0
#define SYNC_POLICY_FIXED_PRIORITY 0x1
#define SYNC_POLICY_REVERSED 0x2
#define SYNC_POLICY_ORDER_MASK 0x3
#define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED)
#define SYNC_POLICY_PREPOST 0x4
#define SYNC_POLICY_MAX 0x7
#define _KERN_KERN_TYPES_H_ 
struct zone ;
struct wait_queue { unsigned char opaque[32]; };
typedef struct zone *zone_t;
#define ZONE_NULL ((zone_t) 0)
typedef struct wait_queue *wait_queue_t;
#define WAIT_QUEUE_NULL ((wait_queue_t) 0)
#define SIZEOF_WAITQUEUE sizeof(struct wait_queue)
typedef vm_offset_t ipc_kobject_t;
#define IKO_NULL ((ipc_kobject_t) 0)
typedef void *event_t;
#define NO_EVENT ((event_t) 0)
typedef uint64_t event64_t;
#define NO_EVENT64 ((event64_t) 0)
#define CAST_EVENT64_T(a_ptr) ((event64_t)((uintptr_t)(a_ptr)))
typedef int wait_result_t;
#define THREAD_WAITING -1
#define THREAD_AWAKENED 0
#define THREAD_TIMED_OUT 1
#define THREAD_INTERRUPTED 2
#define THREAD_RESTART 3
#define THREAD_NOT_WAITING 10
typedef void (*thread_continue_t)(void *, wait_result_t);
#define THREAD_CONTINUE_NULL ((thread_continue_t) 0)
typedef int wait_interrupt_t;
#define THREAD_UNINT 0
#define THREAD_INTERRUPTIBLE 1
#define THREAD_ABORTSAFE 2
typedef int wait_timeout_urgency_t;
#define TIMEOUT_URGENCY_SYS_NORMAL 0x00
#define TIMEOUT_URGENCY_SYS_CRITICAL 0x01
#define TIMEOUT_URGENCY_SYS_BACKGROUND 0x02
#define TIMEOUT_URGENCY_USER_MASK 0x10
#define TIMEOUT_URGENCY_USER_NORMAL 0x10
#define TIMEOUT_URGENCY_USER_CRITICAL 0x11
#define TIMEOUT_URGENCY_USER_BACKGROUND 0x12
#define TIMEOUT_URGENCY_MASK 0x13
#define TIMEOUT_URGENCY_LEEWAY 0x20
#define TIMEOUT_URGENCY_FIRST_AVAIL 0x40
struct wait_queue_set ;
struct _wait_queue_link ;
typedef struct wait_queue_set *wait_queue_set_t;
#define WAIT_QUEUE_SET_NULL ((wait_queue_set_t)0)
#define SIZEOF_WAITQUEUE_SET wait_queue_set_size()
typedef struct _wait_queue_link *wait_queue_link_t;
#define WAIT_QUEUE_LINK_NULL ((wait_queue_link_t)0)
#define SIZEOF_WAITQUEUE_LINK wait_queue_link_size()
struct wait_queue_sub ;
typedef struct wait_queue_sub *wait_queue_sub_t;
#define WAIT_QUEUE_SUB_NULL ((wait_queue_sub_t)0)
#define SIZEOF_WAITQUEUE_SUB wait_queue_set_size()
#define _KERN_QUEUE_H_ 
#define _KERN_MACRO_HELP_H_ 
#define NEVER FALSE
#define ALWAYS TRUE
#define MACRO_BEGIN do {
#define MACRO_END } while (NEVER)
#define MACRO_RETURN if (ALWAYS) return
struct queue_entry {
 struct queue_entry *next;
 struct queue_entry *prev;
};
typedef struct queue_entry *queue_t;
typedef struct queue_entry queue_head_t;
typedef struct queue_entry queue_chain_t;
typedef struct queue_entry *queue_entry_t;
#define enqueue(queue,elt) enqueue_tail(queue, elt)
#define dequeue(queue) dequeue_head(queue)
#define __DEQUEUE_ELT_CLEANUP(elt) do { (elt)->next = (queue_entry_t) 0; (elt)->prev = (queue_entry_t) 0; } while (0)
static __inline__ void
enqueue_head(
 queue_t que,
 queue_entry_t elt)
{
 elt->next = que->next;
 elt->prev = que;
 elt->next->prev = elt;
 que->next = elt;
}
static __inline__ void
enqueue_tail(
  queue_t que,
  queue_entry_t elt)
{
 elt->next = que;
 elt->prev = que->prev;
 elt->prev->next = elt;
 que->prev = elt;
}
static __inline__ queue_entry_t
dequeue_head(
 queue_t que)
{
 register queue_entry_t elt = (queue_entry_t) 0;
 if (que->next != que) {
  elt = que->next;
  elt->next->prev = que;
  que->next = elt->next;
  do { (elt)->next = (queue_entry_t) 0; (elt)->prev = (queue_entry_t) 0; } while (0);
 }
 return (elt);
}
static __inline__ queue_entry_t
dequeue_tail(
 queue_t que)
{
 register queue_entry_t elt = (queue_entry_t) 0;
 if (que->prev != que) {
  elt = que->prev;
  elt->prev->next = que;
  que->prev = elt->prev;
  do { (elt)->next = (queue_entry_t) 0; (elt)->prev = (queue_entry_t) 0; } while (0);
 }
 return (elt);
}
static __inline__ void
remqueue(
 queue_entry_t elt)
{
 elt->next->prev = elt->prev;
 elt->prev->next = elt->next;
 do { (elt)->next = (queue_entry_t) 0; (elt)->prev = (queue_entry_t) 0; } while (0);
}
static __inline__ void
insque(
 queue_entry_t entry,
 queue_entry_t pred)
{
 entry->next = pred->next;
 entry->prev = pred;
 (pred->next)->prev = entry;
 pred->next = entry;
}
static __inline__ void
remque(
 register queue_entry_t elt)
{
 (elt->next)->prev = elt->prev;
 (elt->prev)->next = elt->next;
 do { (elt)->next = (queue_entry_t) 0; (elt)->prev = (queue_entry_t) 0; } while (0);
}
#define queue_init(q) MACRO_BEGIN (q)->next = (q); (q)->prev = (q);MACRO_END
#define queue_first(q) ((q)->next)
#define queue_next(qc) ((qc)->next)
#define queue_last(q) ((q)->prev)
#define queue_prev(qc) ((qc)->prev)
#define queue_end(q,qe) ((q) == (qe))
#define queue_empty(q) queue_end((q), queue_first(q))
#define queue_enter(head,elt,type,field) MACRO_BEGIN register queue_entry_t __prev; __prev = (head)->prev; if ((head) == __prev) { (head)->next = (queue_entry_t) (elt); } else { ((type)(void *)__prev)->field.next = (queue_entry_t)(elt); } (elt)->field.prev = __prev; (elt)->field.next = head; (head)->prev = (queue_entry_t) elt; MACRO_END
#define queue_enter_first(head,elt,type,field) MACRO_BEGIN register queue_entry_t __next; __next = (head)->next; if ((head) == __next) { (head)->prev = (queue_entry_t) (elt); } else { ((type)(void *)__next)->field.prev = (queue_entry_t)(elt); } (elt)->field.next = __next; (elt)->field.prev = head; (head)->next = (queue_entry_t) elt; MACRO_END
#define queue_insert_before(head,elt,cur,type,field) MACRO_BEGIN register queue_entry_t __prev; if ((head) == (queue_entry_t)(cur)) { (elt)->field.next = (head); if ((head)->next == (head)) { (elt)->field.prev = (head); (head)->next = (queue_entry_t)(elt); } else { __prev = (elt)->field.prev = (head)->prev; ((type)(void *)__prev)->field.next = (queue_entry_t)(elt); } (head)->prev = (queue_entry_t)(elt); } else { (elt)->field.next = (queue_entry_t)(cur); if ((head)->next == (queue_entry_t)(cur)) { (elt)->field.prev = (head); (head)->next = (queue_entry_t)(elt); } else { __prev = (elt)->field.prev = (cur)->field.prev; ((type)(void *)__prev)->field.next = (queue_entry_t)(elt); } (cur)->field.prev = (queue_entry_t)(elt); } MACRO_END
#define queue_insert_after(head,elt,cur,type,field) MACRO_BEGIN register queue_entry_t __next; if ((head) == (queue_entry_t)(cur)) { (elt)->field.prev = (head); if ((head)->next == (head)) { (elt)->field.next = (head); (head)->prev = (queue_entry_t)(elt); } else { __next = (elt)->field.next = (head)->next; ((type)(void *)__next)->field.prev = (queue_entry_t)(elt); } (head)->next = (queue_entry_t)(elt); } else { (elt)->field.prev = (queue_entry_t)(cur); if ((head)->prev == (queue_entry_t)(cur)) { (elt)->field.next = (head); (head)->prev = (queue_entry_t)(elt); } else { __next = (elt)->field.next = (cur)->field.next; ((type)(void *)__next)->field.prev = (queue_entry_t)(elt); } (cur)->field.next = (queue_entry_t)(elt); } MACRO_END
#define queue_field(head,thing,type,field) (((head) == (thing)) ? (head) : &((type)(void *)(thing))->field)
#define queue_remove(head,elt,type,field) MACRO_BEGIN register queue_entry_t __next, __prev; __next = (elt)->field.next; __prev = (elt)->field.prev; if ((head) == __next) (head)->prev = __prev; else ((type)(void *)__next)->field.prev = __prev; if ((head) == __prev) (head)->next = __next; else ((type)(void *)__prev)->field.next = __next; (elt)->field.next = NULL; (elt)->field.prev = NULL; MACRO_END
#define queue_remove_first(head,entry,type,field) MACRO_BEGIN register queue_entry_t __next; (entry) = (type)(void *) ((head)->next); __next = (entry)->field.next; if ((head) == __next) (head)->prev = (head); else ((type)(void *)(__next))->field.prev = (head); (head)->next = __next; (entry)->field.next = NULL; (entry)->field.prev = NULL; MACRO_END
#define queue_remove_last(head,entry,type,field) MACRO_BEGIN register queue_entry_t __prev; (entry) = (type)(void *) ((head)->prev); __prev = (entry)->field.prev; if ((head) == __prev) (head)->next = (head); else ((type)(void *)(__prev))->field.next = (head); (head)->prev = __prev; (entry)->field.next = NULL; (entry)->field.prev = NULL; MACRO_END
#define queue_assign(to,from,type,field) MACRO_BEGIN ((type)(void *)((from)->prev))->field.next = (to); ((type)(void *)((from)->next))->field.prev = (to); *to = *from; MACRO_END
#define queue_new_head(old,new,type,field) MACRO_BEGIN if (!queue_empty(old)) { *(new) = *(old); ((type)(void *)((new)->next))->field.prev = (new); ((type)(void *)((new)->prev))->field.next = (new); } else { queue_init(new); } MACRO_END
#define queue_iterate(head,elt,type,field) for ((elt) = (type)(void *) queue_first(head); !queue_end((head), (queue_entry_t)(elt)); (elt) = (type)(void *) queue_next(&(elt)->field))

extern unsigned int wait_queue_set_size(void);
extern unsigned int wait_queue_link_size(void);
extern kern_return_t wait_queue_init(
   wait_queue_t wait_queue,
   int policy);
extern wait_queue_set_t wait_queue_set_alloc(
   int policy);
extern kern_return_t wait_queue_set_init(
   wait_queue_set_t set_queue,
   int policy);
extern kern_return_t wait_queue_set_free(
   wait_queue_set_t set_queue);
extern wait_queue_link_t wait_queue_link_alloc(
   int policy);
extern kern_return_t wait_queue_link_free(
   wait_queue_link_t link_element);
extern kern_return_t wait_queue_link(
   wait_queue_t wait_queue,
   wait_queue_set_t set_queue);
extern kern_return_t wait_queue_link_noalloc(
   wait_queue_t wait_queue,
   wait_queue_set_t set_queue,
   wait_queue_link_t link);
extern boolean_t wait_queue_member(
   wait_queue_t wait_queue,
   wait_queue_set_t set_queue);
extern kern_return_t wait_queue_unlink(
   wait_queue_t wait_queue,
   wait_queue_set_t set_queue);
extern kern_return_t wait_queue_unlink_all(
   wait_queue_t wait_queue);
extern kern_return_t wait_queue_set_unlink_all(
   wait_queue_set_t set_queue);
extern kern_return_t wait_queue_set_unlink_one(
   wait_queue_set_t set_queue,
   wait_queue_link_t link);
extern kern_return_t wait_queue_unlink_nofree(
   wait_queue_t wait_queue,
   wait_queue_set_t set_queue,
   wait_queue_link_t *wqlp);
extern kern_return_t wait_queue_unlink_all_nofree(
   wait_queue_t wait_queue,
   queue_t links);
extern kern_return_t wait_queue_set_unlink_all_nofree(
   wait_queue_set_t set_queue,
   queue_t links);
extern wait_queue_link_t wait_queue_link_allocate(void);
kern_return_t wait_queue_sub_init(
   wait_queue_set_t set_queue,
   int policy);
kern_return_t wait_queue_sub_clearrefs(
   wait_queue_set_t wq_set);
extern kern_return_t wait_subqueue_unlink_all(
   wait_queue_set_t set_queue);
extern wait_queue_t wait_queue_alloc(
   int policy);
extern kern_return_t wait_queue_free(
   wait_queue_t wait_queue);
extern wait_result_t wait_queue_assert_wait64(
   wait_queue_t wait_queue,
   event64_t wait_event,
   wait_interrupt_t interruptible,
   uint64_t deadline);
extern wait_result_t wait_queue_assert_wait64_with_leeway(
   wait_queue_t wait_queue,
   event64_t wait_event,
   wait_interrupt_t interruptible,
   wait_timeout_urgency_t urgency,
   uint64_t deadline,
   uint64_t leeway);
extern kern_return_t wait_queue_wakeup64_one(
   wait_queue_t wait_queue,
   event64_t wake_event,
   wait_result_t result);
extern kern_return_t wait_queue_wakeup64_all(
   wait_queue_t wait_queue,
   event64_t wake_event,
   wait_result_t result);
extern kern_return_t wait_queue_wakeup64_thread(
   wait_queue_t wait_queue,
   event64_t wake_event,
   thread_t thread,
   wait_result_t result);
extern wait_result_t wait_queue_assert_wait(
   wait_queue_t wait_queue,
   event_t wait_event,
   wait_interrupt_t interruptible,
   uint64_t deadline);
extern wait_result_t wait_queue_assert_wait_with_leeway(
   wait_queue_t wait_queue,
   event_t wait_event,
   wait_interrupt_t interruptible,
   wait_timeout_urgency_t urgency,
   uint64_t deadline,
   uint64_t leeway);
extern kern_return_t wait_queue_wakeup_one(
   wait_queue_t wait_queue,
   event_t wake_event,
   wait_result_t result,
                 int priority);
extern kern_return_t wait_queue_wakeup_all(
   wait_queue_t wait_queue,
   event_t wake_event,
   wait_result_t result);
extern kern_return_t wait_queue_wakeup_thread(
   wait_queue_t wait_queue,
   event_t wake_event,
   thread_t thread,
   wait_result_t result);

#define _KERN_SYS_KERNELTYPES_H_ 
#define _SYS_TYPES_H_ 
#define _BSD_MACHINE_ENDIAN_H_ 
#define _I386__ENDIAN_H_ 
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
#define __DARWIN_LITTLE_ENDIAN 1234
#define __DARWIN_BIG_ENDIAN 4321
#define __DARWIN_PDP_ENDIAN 3412
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
#define BYTE_ORDER __DARWIN_BYTE_ORDER
#define _SYS__ENDIAN_H_ 
#define _OS__OSBYTEORDER_H 
#define __DARWIN_OSSwapConstInt16(x) ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | (((__uint16_t)(x) & 0x00ff) << 8)))
#define __DARWIN_OSSwapConstInt32(x) ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | (((__uint32_t)(x) & 0x00ff0000) >> 8) | (((__uint32_t)(x) & 0x0000ff00) << 8) | (((__uint32_t)(x) & 0x000000ff) << 24)))
#define __DARWIN_OSSwapConstInt64(x) ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)(x) & 0x00000000000000ffULL) << 56)))
#define _OS__OSBYTEORDERI386_H 
#define __DARWIN_OS_INLINE static __inline__
static __inline__
__uint16_t
_OSSwapInt16(
    __uint16_t _data
)
{
    return ((__uint16_t)((_data << 8) | (_data >> 8)));
}
static __inline__
__uint32_t
_OSSwapInt32(
    __uint32_t _data
)
{
    __asm__ ("bswap   %0" : "+r" (_data));
    return _data;
}
static __inline__
__uint64_t
_OSSwapInt64(
    __uint64_t _data
)
{
    __asm__ ("bswap   %0" : "+r" (_data));
    return _data;
}
#define __DARWIN_OSSwapInt16(x) ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
#define __DARWIN_OSSwapInt32(x) (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x))
#define __DARWIN_OSSwapInt64(x) (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
#define ntohs(x) __DARWIN_OSSwapInt16(x)
#define htons(x) __DARWIN_OSSwapInt16(x)
#define ntohl(x) __DARWIN_OSSwapInt32(x)
#define htonl(x) __DARWIN_OSSwapInt32(x)
#define NTOHL(x) (x) = ntohl((__uint32_t)x)
#define NTOHS(x) (x) = ntohs((__uint16_t)x)
#define HTONL(x) (x) = htonl((__uint32_t)x)
#define HTONS(x) (x) = htons((__uint16_t)x)
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#define _U_LONG 
typedef unsigned short ushort;
typedef unsigned int uint;
typedef u_int64_t u_quad_t;
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t;
typedef int32_t daddr_t;
#define _DEV_T 
typedef __darwin_dev_t dev_t;
typedef u_int32_t fixpt_t;
#define _BLKCNT_T 
typedef __darwin_blkcnt_t blkcnt_t;
#define _BLKSIZE_T 
typedef __darwin_blksize_t blksize_t;
#define _GID_T 
typedef __darwin_gid_t gid_t;
#define _IN_ADDR_T 
typedef __uint32_t in_addr_t;
#define _IN_PORT_T 
typedef __uint16_t in_port_t;
#define _INO_T 
typedef __darwin_ino_t ino_t;
#define _INO64_T 
typedef __darwin_ino64_t ino64_t;
#define _KEY_T 
typedef __int32_t key_t;
#define _MODE_T 
typedef __darwin_mode_t mode_t;
#define _NLINK_T 
typedef __uint16_t nlink_t;
#define _ID_T 
typedef __darwin_id_t id_t;
#define _PID_T 
typedef __darwin_pid_t pid_t;
#define _OFF_T 
typedef __darwin_off_t off_t;
typedef int32_t segsz_t;
typedef int32_t swblk_t;
#define _UID_T 
typedef __darwin_uid_t uid_t;
#define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff))
#define minor(x) ((int32_t)((x) & 0xffffff))
#define makedev(x,y) ((dev_t)(((x) << 24) | (y)))
#define _CLOCK_T 
typedef __darwin_clock_t clock_t;
#define _SIZE_T 
typedef __darwin_size_t size_t;
#define _SSIZE_T 
typedef __darwin_ssize_t ssize_t;
#define _USECONDS_T 
typedef __darwin_useconds_t useconds_t;
#define _RSIZE_T 
typedef __darwin_size_t rsize_t;
#define _ERRNO_T 
typedef int errno_t;
#define NBBY __DARWIN_NBBY
#define NFDBITS __DARWIN_NFDBITS
#define howmany(x,y) __DARWIN_howmany(x, y)
typedef __int32_t fd_mask;
struct proc;
struct pgrp;
struct ucred;
struct rusage;
struct file;
struct buf;
struct tty;
struct uio;
#define _PTHREAD_ATTR_T 
typedef __darwin_pthread_attr_t pthread_attr_t;
#define _PTHREAD_COND_T 
typedef __darwin_pthread_cond_t pthread_cond_t;
#define _PTHREAD_CONDATTR_T 
typedef __darwin_pthread_condattr_t pthread_condattr_t;
#define _PTHREAD_MUTEX_T 
typedef __darwin_pthread_mutex_t pthread_mutex_t;
#define _PTHREAD_MUTEXATTR_T 
typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t;
#define _PTHREAD_ONCE_T 
typedef __darwin_pthread_once_t pthread_once_t;
#define _PTHREAD_RWLOCK_T 
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
#define _PTHREAD_RWLOCKATTR_T 
typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t;
#define _PTHREAD_T 
typedef __darwin_pthread_t pthread_t;
#define _PTHREAD_KEY_T 
typedef __darwin_pthread_key_t pthread_key_t;
#define _FSBLKCNT_T 
typedef __darwin_fsblkcnt_t fsblkcnt_t;
#define _FSFILCNT_T 
typedef __darwin_fsfilcnt_t fsfilcnt_t;
typedef int64_t daddr64_t;
struct buf;
typedef struct buf * buf_t;
struct file;
typedef struct file * file_t;
struct mount;
typedef struct mount * mount_t;
struct vnode;
typedef struct vnode * vnode_t;
struct proc;
typedef struct proc * proc_t;
struct uio;
typedef struct uio * uio_t;
struct vfs_context;
typedef struct vfs_context * vfs_context_t;
struct vfstable;
typedef struct vfstable * vfstable_t;
struct __ifnet;
struct __mbuf;
struct __pkthdr;
struct __socket;
struct __sockopt;
struct __ifaddr;
struct __ifmultiaddr;
struct __ifnet_filter;
struct __rtentry;
struct __if_clone;
struct __bufattr;
typedef struct __ifnet* ifnet_t;
typedef struct __mbuf* mbuf_t;
typedef struct __pkthdr* pkthdr_t;
typedef struct __socket* socket_t;
typedef struct __sockopt* sockopt_t;
typedef struct __ifaddr* ifaddr_t;
typedef struct __ifmultiaddr* ifmultiaddr_t;
typedef struct __ifnet_filter* interface_filter_t;
typedef struct __rtentry* route_t;
typedef struct __if_clone* if_clone_t;
typedef struct __bufattr* bufattr_t;
#define _KAUTH_GUID 
typedef struct {
#define KAUTH_GUID_SIZE 16
 unsigned char g_guid[16];
} guid_t;
#define _GUID_T 
#define _KAUTH_ACE 
struct kauth_ace;
typedef struct kauth_ace * kauth_ace_t;
#define _KAUTH_ACL 
struct kauth_acl;
typedef struct kauth_acl * kauth_acl_t;
#define _KAUTH_FILESEC 
struct kauth_filesec;
typedef struct kauth_filesec * kauth_filesec_t;
#define _SYS_EVENT_H_ 
#define EVFILT_READ (-1)
#define EVFILT_WRITE (-2)
#define EVFILT_AIO (-3)
#define EVFILT_VNODE (-4)
#define EVFILT_PROC (-5)
#define EVFILT_SIGNAL (-6)
#define EVFILT_TIMER (-7)
#define EVFILT_MACHPORT (-8)
#define EVFILT_FS (-9)
#define EVFILT_USER (-10)
#define EVFILT_VM (-12)
#define EVFILT_SYSCOUNT 14
#define EVFILT_THREADMARKER EVFILT_SYSCOUNT
#pragma pack(4)
struct kevent {
 uintptr_t ident;
 int16_t filter;
 uint16_t flags;
 uint32_t fflags;
 intptr_t data;
 void *udata;
};
struct user64_kevent {
 uint64_t ident;
 int16_t filter;
 uint16_t flags;
 uint32_t fflags;
 int64_t data;
 user_addr_t udata;
};
struct user32_kevent {
 uint32_t ident;
 int16_t filter;
 uint16_t flags;
 uint32_t fflags;
 int32_t data;
 user32_addr_t udata;
};
#pragma pack()
struct kevent64_s {
 uint64_t ident;
 int16_t filter;
 uint16_t flags;
 uint32_t fflags;
 int64_t data;
 uint64_t udata;
 uint64_t ext[2];
};
#define EV_SET(kevp,a,b,c,d,e,f) do { struct kevent *__kevp__ = (kevp); __kevp__->ident = (a); __kevp__->filter = (b); __kevp__->flags = (c); __kevp__->fflags = (d); __kevp__->data = (e); __kevp__->udata = (f); } while(0)
#define EV_SET64(kevp,a,b,c,d,e,f,g,h) do { struct kevent64_s *__kevp__ = (kevp); __kevp__->ident = (a); __kevp__->filter = (b); __kevp__->flags = (c); __kevp__->fflags = (d); __kevp__->data = (e); __kevp__->udata = (f); __kevp__->ext[0] = (g); __kevp__->ext[1] = (h); } while(0)
#define EV_ADD 0x0001
#define EV_DELETE 0x0002
#define EV_ENABLE 0x0004
#define EV_DISABLE 0x0008
#define EV_RECEIPT 0x0040
#define EV_ONESHOT 0x0010
#define EV_CLEAR 0x0020
#define EV_DISPATCH 0x0080
#define EV_SYSFLAGS 0xF000
#define EV_FLAG0 0x1000
#define EV_FLAG1 0x2000
#define EV_EOF 0x8000
#define EV_ERROR 0x4000
#define EV_POLL EV_FLAG0
#define EV_OOBAND EV_FLAG1
#define NOTE_TRIGGER 0x01000000
#define NOTE_FFNOP 0x00000000
#define NOTE_FFAND 0x40000000
#define NOTE_FFOR 0x80000000
#define NOTE_FFCOPY 0xc0000000
#define NOTE_FFCTRLMASK 0xc0000000
#define NOTE_FFLAGSMASK 0x00ffffff
#define NOTE_LOWAT 0x00000001
#define NOTE_DELETE 0x00000001
#define NOTE_WRITE 0x00000002
#define NOTE_EXTEND 0x00000004
#define NOTE_ATTRIB 0x00000008
#define NOTE_LINK 0x00000010
#define NOTE_RENAME 0x00000020
#define NOTE_REVOKE 0x00000040
#define NOTE_NONE 0x00000080
enum {
 eNoteReapDeprecated = 0x10000000
};
#define NOTE_EXIT 0x80000000
#define NOTE_FORK 0x40000000
#define NOTE_EXEC 0x20000000
#define NOTE_REAP ((unsigned int)eNoteReapDeprecated )
#define NOTE_SIGNAL 0x08000000
#define NOTE_EXITSTATUS 0x04000000
#define NOTE_EXIT_DETAIL 0x02000000
#define NOTE_PDATAMASK 0x000fffff
#define NOTE_PCTRLMASK (~NOTE_PDATAMASK)
enum {
 eNoteExitReparentedDeprecated = 0x00080000
};
#define NOTE_EXIT_REPARENTED ((unsigned int)eNoteExitReparentedDeprecated)
#define NOTE_EXIT_DETAIL_MASK 0x00070000
#define NOTE_EXIT_DECRYPTFAIL 0x00010000
#define NOTE_EXIT_MEMORY 0x00020000
#define NOTE_EXIT_CSERROR 0x00040000
#define NOTE_VM_PRESSURE 0x80000000
#define NOTE_VM_PRESSURE_TERMINATE 0x40000000
#define NOTE_VM_PRESSURE_SUDDEN_TERMINATE 0x20000000
#define NOTE_VM_ERROR 0x10000000
#define NOTE_SECONDS 0x00000001
#define NOTE_USECONDS 0x00000002
#define NOTE_NSECONDS 0x00000004
#define NOTE_ABSOLUTE 0x00000008
#define NOTE_LEEWAY 0x00000010
#define NOTE_CRITICAL 0x00000020
#define NOTE_BACKGROUND 0x00000040
#define NOTE_TRACK 0x00000001
#define NOTE_TRACKERR 0x00000002
#define NOTE_CHILD 0x00000004
#define _SYS_QUEUE_H_ 
#define QMD_TRACE_ELEM(elem) 
#define QMD_TRACE_HEAD(head) 
#define TRACEBUF 
#define TRASHIT(x) 
#define __MISMATCH_TAGS_PUSH 
#define __MISMATCH_TAGS_POP 
#define SLIST_HEAD(name,type) __MISMATCH_TAGS_PUSH struct name { struct type *slh_first; } __MISMATCH_TAGS_POP
#define SLIST_HEAD_INITIALIZER(head) { NULL }
#define SLIST_ENTRY(type) __MISMATCH_TAGS_PUSH struct { struct type *sle_next; } __MISMATCH_TAGS_POP
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
#define SLIST_FIRST(head) ((head)->slh_first)
#define SLIST_FOREACH(var,head,field) for ((var) = SLIST_FIRST((head)); (var); (var) = SLIST_NEXT((var), field))
#define SLIST_FOREACH_SAFE(var,head,field,tvar) for ((var) = SLIST_FIRST((head)); (var) && ((tvar) = SLIST_NEXT((var), field), 1); (var) = (tvar))
#define SLIST_FOREACH_PREVPTR(var,varp,head,field) for ((varp) = &SLIST_FIRST((head)); ((var) = *(varp)) != NULL; (varp) = &SLIST_NEXT((var), field))
#define SLIST_INIT(head) do { SLIST_FIRST((head)) = NULL; } while (0)
#define SLIST_INSERT_AFTER(slistelm,elm,field) do { SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); SLIST_NEXT((slistelm), field) = (elm); } while (0)
#define SLIST_INSERT_HEAD(head,elm,field) do { SLIST_NEXT((elm), field) = SLIST_FIRST((head)); SLIST_FIRST((head)) = (elm); } while (0)
#define SLIST_NEXT(elm,field) ((elm)->field.sle_next)
#define SLIST_REMOVE(head,elm,type,field) __MISMATCH_TAGS_PUSH do { if (SLIST_FIRST((head)) == (elm)) { SLIST_REMOVE_HEAD((head), field); } else { struct type *curelm = SLIST_FIRST((head)); while (SLIST_NEXT(curelm, field) != (elm)) curelm = SLIST_NEXT(curelm, field); SLIST_REMOVE_AFTER(curelm, field); } TRASHIT((elm)->field.sle_next); } while (0) __MISMATCH_TAGS_POP
#define SLIST_REMOVE_AFTER(elm,field) do { SLIST_NEXT(elm, field) = SLIST_NEXT(SLIST_NEXT(elm, field), field); } while (0)
#define SLIST_REMOVE_HEAD(head,field) do { SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); } while (0)
#define STAILQ_HEAD(name,type) __MISMATCH_TAGS_PUSH struct name { struct type *stqh_first; struct type **stqh_last; } __MISMATCH_TAGS_POP
#define STAILQ_HEAD_INITIALIZER(head) { NULL, &(head).stqh_first }
#define STAILQ_ENTRY(type) __MISMATCH_TAGS_PUSH struct { struct type *stqe_next; } __MISMATCH_TAGS_POP
#define STAILQ_CONCAT(head1,head2) do { if (!STAILQ_EMPTY((head2))) { *(head1)->stqh_last = (head2)->stqh_first; (head1)->stqh_last = (head2)->stqh_last; STAILQ_INIT((head2)); } } while (0)
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
#define STAILQ_FIRST(head) ((head)->stqh_first)
#define STAILQ_FOREACH(var,head,field) for((var) = STAILQ_FIRST((head)); (var); (var) = STAILQ_NEXT((var), field))
#define STAILQ_FOREACH_SAFE(var,head,field,tvar) for ((var) = STAILQ_FIRST((head)); (var) && ((tvar) = STAILQ_NEXT((var), field), 1); (var) = (tvar))
#define STAILQ_INIT(head) do { STAILQ_FIRST((head)) = NULL; (head)->stqh_last = &STAILQ_FIRST((head)); } while (0)
#define STAILQ_INSERT_AFTER(head,tqelm,elm,field) do { if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) (head)->stqh_last = &STAILQ_NEXT((elm), field); STAILQ_NEXT((tqelm), field) = (elm); } while (0)
#define STAILQ_INSERT_HEAD(head,elm,field) do { if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) (head)->stqh_last = &STAILQ_NEXT((elm), field); STAILQ_FIRST((head)) = (elm); } while (0)
#define STAILQ_INSERT_TAIL(head,elm,field) do { STAILQ_NEXT((elm), field) = NULL; *(head)->stqh_last = (elm); (head)->stqh_last = &STAILQ_NEXT((elm), field); } while (0)
#define STAILQ_LAST(head,type,field) __MISMATCH_TAGS_PUSH (STAILQ_EMPTY((head)) ? NULL : ((struct type *)(void *) ((char *)((head)->stqh_last) - __offsetof(struct type, field))))__MISMATCH_TAGS_POP
#define STAILQ_NEXT(elm,field) ((elm)->field.stqe_next)
#define STAILQ_REMOVE(head,elm,type,field) __MISMATCH_TAGS_PUSH do { if (STAILQ_FIRST((head)) == (elm)) { STAILQ_REMOVE_HEAD((head), field); } else { struct type *curelm = STAILQ_FIRST((head)); while (STAILQ_NEXT(curelm, field) != (elm)) curelm = STAILQ_NEXT(curelm, field); STAILQ_REMOVE_AFTER(head, curelm, field); } TRASHIT((elm)->field.stqe_next); } while (0) __MISMATCH_TAGS_POP
#define STAILQ_REMOVE_HEAD(head,field) do { if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) (head)->stqh_last = &STAILQ_FIRST((head)); } while (0)
#define STAILQ_REMOVE_HEAD_UNTIL(head,elm,field) do { if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) (head)->stqh_last = &STAILQ_FIRST((head)); } while (0)
#define STAILQ_REMOVE_AFTER(head,elm,field) do { if ((STAILQ_NEXT(elm, field) = STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) (head)->stqh_last = &STAILQ_NEXT((elm), field); } while (0)
#define STAILQ_SWAP(head1,head2,type) __MISMATCH_TAGS_PUSH do { struct type *swap_first = STAILQ_FIRST(head1); struct type **swap_last = (head1)->stqh_last; STAILQ_FIRST(head1) = STAILQ_FIRST(head2); (head1)->stqh_last = (head2)->stqh_last; STAILQ_FIRST(head2) = swap_first; (head2)->stqh_last = swap_last; if (STAILQ_EMPTY(head1)) (head1)->stqh_last = &STAILQ_FIRST(head1); if (STAILQ_EMPTY(head2)) (head2)->stqh_last = &STAILQ_FIRST(head2); } while (0) __MISMATCH_TAGS_POP
#define LIST_HEAD(name,type) __MISMATCH_TAGS_PUSH struct name { struct type *lh_first; } __MISMATCH_TAGS_POP
#define LIST_HEAD_INITIALIZER(head) { NULL }
#define LIST_ENTRY(type) __MISMATCH_TAGS_PUSH struct { struct type *le_next; struct type **le_prev; } __MISMATCH_TAGS_POP
#define QMD_LIST_CHECK_HEAD(head,field) 
#define QMD_LIST_CHECK_NEXT(elm,field) 
#define QMD_LIST_CHECK_PREV(elm,field) 
#define LIST_EMPTY(head) ((head)->lh_first == NULL)
#define LIST_FIRST(head) ((head)->lh_first)
#define LIST_FOREACH(var,head,field) for ((var) = LIST_FIRST((head)); (var); (var) = LIST_NEXT((var), field))
#define LIST_FOREACH_SAFE(var,head,field,tvar) for ((var) = LIST_FIRST((head)); (var) && ((tvar) = LIST_NEXT((var), field), 1); (var) = (tvar))
#define LIST_INIT(head) do { LIST_FIRST((head)) = NULL; } while (0)
#define LIST_INSERT_AFTER(listelm,elm,field) do { QMD_LIST_CHECK_NEXT(listelm, field); if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL) LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); LIST_NEXT((listelm), field) = (elm); (elm)->field.le_prev = &LIST_NEXT((listelm), field); } while (0)
#define LIST_INSERT_BEFORE(listelm,elm,field) do { QMD_LIST_CHECK_PREV(listelm, field); (elm)->field.le_prev = (listelm)->field.le_prev; LIST_NEXT((elm), field) = (listelm); *(listelm)->field.le_prev = (elm); (listelm)->field.le_prev = &LIST_NEXT((elm), field); } while (0)
#define LIST_INSERT_HEAD(head,elm,field) do { QMD_LIST_CHECK_HEAD((head), field); if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); LIST_FIRST((head)) = (elm); (elm)->field.le_prev = &LIST_FIRST((head)); } while (0)
#define LIST_NEXT(elm,field) ((elm)->field.le_next)
#define LIST_REMOVE(elm,field) do { QMD_LIST_CHECK_NEXT(elm, field); QMD_LIST_CHECK_PREV(elm, field); if (LIST_NEXT((elm), field) != NULL) LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev; *(elm)->field.le_prev = LIST_NEXT((elm), field); TRASHIT((elm)->field.le_next); TRASHIT((elm)->field.le_prev); } while (0)
#define LIST_SWAP(head1,head2,type,field) __MISMATCH_TAGS_PUSH do { struct type *swap_tmp = LIST_FIRST((head1)); LIST_FIRST((head1)) = LIST_FIRST((head2)); LIST_FIRST((head2)) = swap_tmp; if ((swap_tmp = LIST_FIRST((head1))) != NULL) swap_tmp->field.le_prev = &LIST_FIRST((head1)); if ((swap_tmp = LIST_FIRST((head2))) != NULL) swap_tmp->field.le_prev = &LIST_FIRST((head2)); } while (0) __MISMATCH_TAGS_POP
#define TAILQ_HEAD(name,type) __MISMATCH_TAGS_PUSH struct name { struct type *tqh_first; struct type **tqh_last; TRACEBUF } __MISMATCH_TAGS_POP
#define TAILQ_HEAD_INITIALIZER(head) { NULL, &(head).tqh_first }
#define TAILQ_ENTRY(type) __MISMATCH_TAGS_PUSH struct { struct type *tqe_next; struct type **tqe_prev; TRACEBUF } __MISMATCH_TAGS_POP
#define TAILQ_CONCAT(head1,head2,field) do { if (!TAILQ_EMPTY(head2)) { *(head1)->tqh_last = (head2)->tqh_first; (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; (head1)->tqh_last = (head2)->tqh_last; TAILQ_INIT((head2)); QMD_TRACE_HEAD(head1); QMD_TRACE_HEAD(head2); } } while (0)
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
#define TAILQ_FIRST(head) ((head)->tqh_first)
#define TAILQ_FOREACH(var,head,field) for ((var) = TAILQ_FIRST((head)); (var); (var) = TAILQ_NEXT((var), field))
#define TAILQ_FOREACH_SAFE(var,head,field,tvar) for ((var) = TAILQ_FIRST((head)); (var) && ((tvar) = TAILQ_NEXT((var), field), 1); (var) = (tvar))
#define TAILQ_FOREACH_REVERSE(var,head,headname,field) for ((var) = TAILQ_LAST((head), headname); (var); (var) = TAILQ_PREV((var), headname, field))
#define TAILQ_FOREACH_REVERSE_SAFE(var,head,headname,field,tvar) for ((var) = TAILQ_LAST((head), headname); (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); (var) = (tvar))
#define TAILQ_INIT(head) do { TAILQ_FIRST((head)) = NULL; (head)->tqh_last = &TAILQ_FIRST((head)); QMD_TRACE_HEAD(head); } while (0)
#define TAILQ_INSERT_AFTER(head,listelm,elm,field) do { if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL) TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field); else { (head)->tqh_last = &TAILQ_NEXT((elm), field); QMD_TRACE_HEAD(head); } TAILQ_NEXT((listelm), field) = (elm); (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); QMD_TRACE_ELEM(&(elm)->field); QMD_TRACE_ELEM(&listelm->field); } while (0)
#define TAILQ_INSERT_BEFORE(listelm,elm,field) do { (elm)->field.tqe_prev = (listelm)->field.tqe_prev; TAILQ_NEXT((elm), field) = (listelm); *(listelm)->field.tqe_prev = (elm); (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); QMD_TRACE_ELEM(&(elm)->field); QMD_TRACE_ELEM(&listelm->field); } while (0)
#define TAILQ_INSERT_HEAD(head,elm,field) do { if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); else (head)->tqh_last = &TAILQ_NEXT((elm), field); TAILQ_FIRST((head)) = (elm); (elm)->field.tqe_prev = &TAILQ_FIRST((head)); QMD_TRACE_HEAD(head); QMD_TRACE_ELEM(&(elm)->field); } while (0)
#define TAILQ_INSERT_TAIL(head,elm,field) do { TAILQ_NEXT((elm), field) = NULL; (elm)->field.tqe_prev = (head)->tqh_last; *(head)->tqh_last = (elm); (head)->tqh_last = &TAILQ_NEXT((elm), field); QMD_TRACE_HEAD(head); QMD_TRACE_ELEM(&(elm)->field); } while (0)
#define TAILQ_LAST(head,headname) __MISMATCH_TAGS_PUSH (*(((struct headname *)((head)->tqh_last))->tqh_last)) __MISMATCH_TAGS_POP
#define TAILQ_NEXT(elm,field) ((elm)->field.tqe_next)
#define TAILQ_PREV(elm,headname,field) __MISMATCH_TAGS_PUSH (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) __MISMATCH_TAGS_POP
#define TAILQ_REMOVE(head,elm,field) do { if ((TAILQ_NEXT((elm), field)) != NULL) TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev; else { (head)->tqh_last = (elm)->field.tqe_prev; QMD_TRACE_HEAD(head); } *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); TRASHIT((elm)->field.tqe_next); TRASHIT((elm)->field.tqe_prev); QMD_TRACE_ELEM(&(elm)->field); } while (0)
#define TAILQ_SWAP(head1,head2,type,field) __MISMATCH_TAGS_PUSH do { struct type *swap_first = (head1)->tqh_first; struct type **swap_last = (head1)->tqh_last; (head1)->tqh_first = (head2)->tqh_first; (head1)->tqh_last = (head2)->tqh_last; (head2)->tqh_first = swap_first; (head2)->tqh_last = swap_last; if ((swap_first = (head1)->tqh_first) != NULL) swap_first->field.tqe_prev = &(head1)->tqh_first; else (head1)->tqh_last = &(head1)->tqh_first; if ((swap_first = (head2)->tqh_first) != NULL) swap_first->field.tqe_prev = &(head2)->tqh_first; else (head2)->tqh_last = &(head2)->tqh_first; } while (0) __MISMATCH_TAGS_POP
#define CIRCLEQ_HEAD(name,type) __MISMATCH_TAGS_PUSH struct name { struct type *cqh_first; struct type *cqh_last; } __MISMATCH_TAGS_POP
#define CIRCLEQ_ENTRY(type) __MISMATCH_TAGS_PUSH struct { struct type *cqe_next; struct type *cqe_prev; } __MISMATCH_TAGS_POP
#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
#define CIRCLEQ_FOREACH(var,head,field) for((var) = (head)->cqh_first; (var) != (void *)(head); (var) = (var)->field.cqe_next)
#define CIRCLEQ_INIT(head) do { (head)->cqh_first = (void *)(head); (head)->cqh_last = (void *)(head); } while (0)
#define CIRCLEQ_INSERT_AFTER(head,listelm,elm,field) do { (elm)->field.cqe_next = (listelm)->field.cqe_next; (elm)->field.cqe_prev = (listelm); if ((listelm)->field.cqe_next == (void *)(head)) (head)->cqh_last = (elm); else (listelm)->field.cqe_next->field.cqe_prev = (elm); (listelm)->field.cqe_next = (elm); } while (0)
#define CIRCLEQ_INSERT_BEFORE(head,listelm,elm,field) do { (elm)->field.cqe_next = (listelm); (elm)->field.cqe_prev = (listelm)->field.cqe_prev; if ((listelm)->field.cqe_prev == (void *)(head)) (head)->cqh_first = (elm); else (listelm)->field.cqe_prev->field.cqe_next = (elm); (listelm)->field.cqe_prev = (elm); } while (0)
#define CIRCLEQ_INSERT_HEAD(head,elm,field) do { (elm)->field.cqe_next = (head)->cqh_first; (elm)->field.cqe_prev = (void *)(head); if ((head)->cqh_last == (void *)(head)) (head)->cqh_last = (elm); else (head)->cqh_first->field.cqe_prev = (elm); (head)->cqh_first = (elm); } while (0)
#define CIRCLEQ_INSERT_TAIL(head,elm,field) do { (elm)->field.cqe_next = (void *)(head); (elm)->field.cqe_prev = (head)->cqh_last; if ((head)->cqh_first == (void *)(head)) (head)->cqh_first = (elm); else (head)->cqh_last->field.cqe_next = (elm); (head)->cqh_last = (elm); } while (0)
#define CIRCLEQ_LAST(head) ((head)->cqh_last)
#define CIRCLEQ_NEXT(elm,field) ((elm)->field.cqe_next)
#define CIRCLEQ_PREV(elm,field) ((elm)->field.cqe_prev)
#define CIRCLEQ_REMOVE(head,elm,field) do { if ((elm)->field.cqe_next == (void *)(head)) (head)->cqh_last = (elm)->field.cqe_prev; else (elm)->field.cqe_next->field.cqe_prev = (elm)->field.cqe_prev; if ((elm)->field.cqe_prev == (void *)(head)) (head)->cqh_first = (elm)->field.cqe_next; else (elm)->field.cqe_prev->field.cqe_next = (elm)->field.cqe_next; } while (0)
 struct kqtailq { struct knote *tqh_first; struct knote **tqh_last; } ;
struct knote {
 int kn_inuse;
 struct kqtailq *kn_tq;
 struct { struct knote *tqe_next; struct knote **tqe_prev; } kn_tqe;
 struct kqueue *kn_kq;
 struct { struct knote *sle_next; } kn_link;
 struct { struct knote *sle_next; } kn_selnext;
 union {
  struct fileproc *p_fp;
  struct proc *p_proc;
  struct ipc_pset *p_pset;
 } kn_ptr;
 struct filterops *kn_fop;
 int kn_status;
 int kn_sfflags;
 struct kevent64_s kn_kevent;
 void *kn_hook;
 int kn_hookid;
 int64_t kn_sdata;
#define KN_ACTIVE 0x01
#define KN_QUEUED 0x02
#define KN_DISABLED 0x04
#define KN_DROPPING 0x08
#define KN_USEWAIT 0x10
#define KN_ATTACHING 0x20
#define KN_STAYQUEUED 0x40
#define kn_id kn_kevent.ident
#define kn_filter kn_kevent.filter
#define kn_flags kn_kevent.flags
#define kn_fflags kn_kevent.fflags
#define kn_data kn_kevent.data
#define kn_udata kn_kevent.udata
#define kn_ext kn_kevent.ext
#define kn_fp kn_ptr.p_fp
};
#define EVENT_REGISTER 1
#define EVENT_PROCESS 2
struct filterops {
 int f_isfd;
 int (*f_attach)(struct knote *kn);
 void (*f_detach)(struct knote *kn);
 int (*f_event)(struct knote *kn, long hint);
 void (*f_touch)(struct knote *kn, struct kevent64_s *kev, long type);
 unsigned (*f_peek)(struct knote *kn);
};
struct proc;
struct wait_queue;
 struct klist { struct knote *slh_first; } ;
extern void knote_init(void);
extern void klist_init(struct klist *list);
#define KNOTE(list,hint) knote(list, hint)
#define KNOTE_ATTACH(list,kn) knote_attach(list, kn)
#define KNOTE_DETACH(list,kn) knote_detach(list, kn)
extern void knote(struct klist *list, long hint);
extern int knote_attach(struct klist *list, struct knote *kn);
extern int knote_detach(struct klist *list, struct knote *kn);
extern int knote_link_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t wql);
extern int knote_unlink_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t *wqlp);
extern void knote_fdclose(struct proc *p, int fd);
extern void knote_markstayqueued(struct knote *kn);
struct selinfo {
 struct wait_queue si_wait_queue;
 struct klist si_note;
 u_int si_flags;
};
#define SI_COLL 0x0001
#define SI_RECORDED 0x0004
#define SI_INITED 0x0008
#define SI_CLEAR 0x0010

extern int selwait;
void selrecord(proc_t selector, struct selinfo *, void *);
void selwakeup(struct selinfo *);
void selthreadclear(struct selinfo *);

#define _SYS_SOCKET_H_ 
#define _I386__PARAM_H_ 
#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1)
#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
#define _SA_FAMILY_T 
typedef __uint8_t sa_family_t;
#define _SOCKLEN_T 
typedef __darwin_socklen_t socklen_t;
#define _STRUCT_IOVEC 
struct iovec {
 void * iov_base;
 size_t iov_len;
};
#define SOCK_STREAM 1
#define SOCK_DGRAM 2
#define SOCK_RAW 3
#define SOCK_RDM 4
#define SOCK_SEQPACKET 5
#define SO_DEBUG 0x0001
#define SO_ACCEPTCONN 0x0002
#define SO_REUSEADDR 0x0004
#define SO_KEEPALIVE 0x0008
#define SO_DONTROUTE 0x0010
#define SO_BROADCAST 0x0020
#define SO_USELOOPBACK 0x0040
#define SO_LINGER 0x0080
#define SO_OOBINLINE 0x0100
#define SO_REUSEPORT 0x0200
#define SO_TIMESTAMP 0x0400
#define SO_TIMESTAMP_MONOTONIC 0x0800
#define SO_ACCEPTFILTER 0x1000
#define SO_SNDBUF 0x1001
#define SO_RCVBUF 0x1002
#define SO_SNDLOWAT 0x1003
#define SO_RCVLOWAT 0x1004
#define SO_SNDTIMEO 0x1005
#define SO_RCVTIMEO 0x1006
#define SO_ERROR 0x1007
#define SO_TYPE 0x1008
#define SO_LABEL 0x1010
#define SO_PEERLABEL 0x1011
struct linger {
 int l_onoff;
 int l_linger;
};
struct accept_filter_arg {
 char af_name[16];
 char af_arg[256-16];
};
#define SOL_SOCKET 0xffff
#define AF_UNSPEC 0
#define AF_UNIX 1
#define AF_LOCAL AF_UNIX
#define AF_INET 2
#define AF_IMPLINK 3
#define AF_PUP 4
#define AF_CHAOS 5
#define AF_NS 6
#define AF_ISO 7
#define AF_OSI AF_ISO
#define AF_ECMA 8
#define AF_DATAKIT 9
#define AF_CCITT 10
#define AF_SNA 11
#define AF_DECnet 12
#define AF_DLI 13
#define AF_LAT 14
#define AF_HYLINK 15
#define AF_APPLETALK 16
#define AF_ROUTE 17
#define AF_LINK 18
#define pseudo_AF_XTP 19
#define AF_COIP 20
#define AF_CNT 21
#define pseudo_AF_RTIP 22
#define AF_IPX 23
#define AF_SIP 24
#define pseudo_AF_PIP 25
#define AF_NDRV 27
#define AF_ISDN 28
#define AF_E164 AF_ISDN
#define pseudo_AF_KEY 29
#define AF_INET6 30
#define AF_NATM 31
#define AF_SYSTEM 32
#define AF_NETBIOS 33
#define AF_PPP 34
#define pseudo_AF_HDRCMPLT 35
#define AF_RESERVED_36 36
#define AF_IEEE80211 37
#define AF_UTUN 38
#define AF_MAX 40
struct sockaddr {
 __uint8_t sa_len;
 sa_family_t sa_family;
 char sa_data[14];
};
#define SOCK_MAXADDRLEN 255
struct sockproto {
 __uint16_t sp_family;
 __uint16_t sp_protocol;
};
#define _SS_MAXSIZE 128
#define _SS_ALIGNSIZE (sizeof(__int64_t))
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t))
#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
struct sockaddr_storage {
 __uint8_t ss_len;
 sa_family_t ss_family;
 char __ss_pad1[((sizeof(__int64_t)) - sizeof(__uint8_t) - sizeof(sa_family_t))];
 __int64_t __ss_align;
 char __ss_pad2[(128 - sizeof(__uint8_t) - sizeof(sa_family_t) - ((sizeof(__int64_t)) - sizeof(__uint8_t) - sizeof(sa_family_t)) - (sizeof(__int64_t)))];
};
struct sockaddr_entry {
 struct { struct sockaddr_entry *tqe_next; struct sockaddr_entry **tqe_prev; } se_link;
 struct sockaddr *se_addr;
 uint32_t se_flags;
};
#define SEF_ATTACHED 1
struct sockaddr_list {
 struct { struct sockaddr_entry *tqh_first; struct sockaddr_entry **tqh_last; } sl_head;
 uint32_t sl_cnt;
};
#define PF_UNSPEC AF_UNSPEC
#define PF_LOCAL AF_LOCAL
#define PF_UNIX PF_LOCAL
#define PF_INET AF_INET
#define PF_IMPLINK AF_IMPLINK
#define PF_PUP AF_PUP
#define PF_CHAOS AF_CHAOS
#define PF_NS AF_NS
#define PF_ISO AF_ISO
#define PF_OSI AF_ISO
#define PF_ECMA AF_ECMA
#define PF_DATAKIT AF_DATAKIT
#define PF_CCITT AF_CCITT
#define PF_SNA AF_SNA
#define PF_DECnet AF_DECnet
#define PF_DLI AF_DLI
#define PF_LAT AF_LAT
#define PF_HYLINK AF_HYLINK
#define PF_APPLETALK AF_APPLETALK
#define PF_ROUTE AF_ROUTE
#define PF_LINK AF_LINK
#define PF_XTP pseudo_AF_XTP
#define PF_COIP AF_COIP
#define PF_CNT AF_CNT
#define PF_SIP AF_SIP
#define PF_IPX AF_IPX
#define PF_RTIP pseudo_AF_RTIP
#define PF_PIP pseudo_AF_PIP
#define PF_NDRV AF_NDRV
#define PF_ISDN AF_ISDN
#define PF_KEY pseudo_AF_KEY
#define PF_INET6 AF_INET6
#define PF_NATM AF_NATM
#define PF_SYSTEM AF_SYSTEM
#define PF_NETBIOS AF_NETBIOS
#define PF_PPP AF_PPP
#define PF_RESERVED_36 AF_RESERVED_36
#define PF_UTUN AF_UTUN
#define PF_MAX AF_MAX
#define PF_VLAN ((uint32_t)0x766c616e)
#define PF_BOND ((uint32_t)0x626f6e64)
#define PF_BRIDGE ((uint32_t)0x62726467)
#define NET_MAXID AF_MAX
#define CTL_NET_NAMES { { 0, 0 }, { "local", CTLTYPE_NODE }, { "inet", CTLTYPE_NODE }, { "implink", CTLTYPE_NODE }, { "pup", CTLTYPE_NODE }, { "chaos", CTLTYPE_NODE }, { "xerox_ns", CTLTYPE_NODE }, { "iso", CTLTYPE_NODE }, { "emca", CTLTYPE_NODE }, { "datakit", CTLTYPE_NODE }, { "ccitt", CTLTYPE_NODE }, { "ibm_sna", CTLTYPE_NODE }, { "decnet", CTLTYPE_NODE }, { "dec_dli", CTLTYPE_NODE }, { "lat", CTLTYPE_NODE }, { "hylink", CTLTYPE_NODE }, { "appletalk", CTLTYPE_NODE }, { "route", CTLTYPE_NODE }, { "link_layer", CTLTYPE_NODE }, { "xtp", CTLTYPE_NODE }, { "coip", CTLTYPE_NODE }, { "cnt", CTLTYPE_NODE }, { "rtip", CTLTYPE_NODE }, { "ipx", CTLTYPE_NODE }, { "sip", CTLTYPE_NODE }, { "pip", CTLTYPE_NODE }, { 0, 0 }, { "ndrv", CTLTYPE_NODE }, { "isdn", CTLTYPE_NODE }, { "key", CTLTYPE_NODE }, { "inet6", CTLTYPE_NODE }, { "natm", CTLTYPE_NODE }, { "sys", CTLTYPE_NODE }, { "netbios", CTLTYPE_NODE }, { "ppp", CTLTYPE_NODE }, { "hdrcomplete", CTLTYPE_NODE }, }
#define NET_RT_DUMP 1
#define NET_RT_FLAGS 2
#define NET_RT_IFLIST 3
#define NET_RT_STAT 4
#define NET_RT_TRASH 5
#define NET_RT_IFLIST2 6
#define NET_RT_DUMP2 7
#define NET_RT_MAXID 10
#define CTL_NET_RT_NAMES { { 0, 0 }, { "dump", CTLTYPE_STRUCT }, { "flags", CTLTYPE_STRUCT }, { "iflist", CTLTYPE_STRUCT }, { "stat", CTLTYPE_STRUCT }, { "trash", CTLTYPE_INT }, { "iflist2", CTLTYPE_STRUCT }, { "dump2", CTLTYPE_STRUCT }, { "dumpx", CTLTYPE_STRUCT }, { "dumpx_flags", CTLTYPE_STRUCT }, }
#define SOMAXCONN 128
struct msghdr {
 void *msg_name;
 socklen_t msg_namelen;
 struct iovec *msg_iov;
 int msg_iovlen;
 void *msg_control;
 socklen_t msg_controllen;
 int msg_flags;
};
struct user_msghdr {
 user_addr_t msg_name;
 socklen_t msg_namelen;
 user_addr_t msg_iov;
 int msg_iovlen;
 user_addr_t msg_control;
 socklen_t msg_controllen;
 int msg_flags;
};
struct user64_msghdr {
 user64_addr_t msg_name;
 socklen_t msg_namelen;
 user64_addr_t msg_iov;
 int msg_iovlen;
 user64_addr_t msg_control;
 socklen_t msg_controllen;
 int msg_flags;
};
struct user32_msghdr {
 user32_addr_t msg_name;
 socklen_t msg_namelen;
 user32_addr_t msg_iov;
 int msg_iovlen;
 user32_addr_t msg_control;
 socklen_t msg_controllen;
 int msg_flags;
};
#define MSG_OOB 0x1
#define MSG_PEEK 0x2
#define MSG_DONTROUTE 0x4
#define MSG_EOR 0x8
#define MSG_TRUNC 0x10
#define MSG_CTRUNC 0x20
#define MSG_WAITALL 0x40
#define MSG_DONTWAIT 0x80
#define MSG_EOF 0x100
#define MSG_COMPAT 0x8000
#define MSG_NEEDSA 0x10000
#define MSG_NBIO 0x20000
#define MSG_USEUPCALL 0x80000000
struct cmsghdr {
 socklen_t cmsg_len;
 int cmsg_level;
 int cmsg_type;
};
#define CMGROUP_MAX 16
struct cmsgcred {
 pid_t cmcred_pid;
 uid_t cmcred_uid;
 uid_t cmcred_euid;
 gid_t cmcred_gid;
 short cmcred_ngroups;
 gid_t cmcred_groups[16];
};
#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + __DARWIN_ALIGN32(sizeof(struct cmsghdr)))
#define CMSG_FIRSTHDR(mhdr) ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(mhdr)->msg_control : (struct cmsghdr *)0L)
#define CMSG_NXTHDR(mhdr,cmsg) ((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : ((((unsigned char *)(cmsg) + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)) ? (struct cmsghdr *)0L : (struct cmsghdr *)(void *)((unsigned char *)(cmsg) + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len))))
#define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l))
#define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l))
#define CMSG_ALIGN(n) __DARWIN_ALIGN32(n)
#define SCM_RIGHTS 0x01
#define SCM_TIMESTAMP 0x02
#define SCM_CREDS 0x03
#define SCM_TIMESTAMP_MONOTONIC 0x04
struct osockaddr {
 __uint16_t sa_family;
 char sa_data[14];
};
struct omsghdr {
 void *msg_name;
 socklen_t msg_namelen;
 struct iovec *msg_iov;
 int msg_iovlen;
 void *msg_accrights;
 int msg_accrightslen;
};
#define SA(s) ((struct sockaddr *)(void *)(s))
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
struct sf_hdtr {
 struct iovec *headers;
 int hdr_cnt;
 struct iovec *trailers;
 int trl_cnt;
};
struct user_sf_hdtr {
 user_addr_t headers;
 int hdr_cnt;
 user_addr_t trailers;
 int trl_cnt;
};
struct user64_sf_hdtr {
 user64_addr_t headers;
 int hdr_cnt;
 user64_addr_t trailers;
 int trl_cnt;
};
struct user32_sf_hdtr {
 user32_addr_t headers;
 int hdr_cnt;
 user32_addr_t trailers;
 int trl_cnt;
};
#define __KPI_SOCKET__ 

struct timeval;
typedef void (*sock_upcall)(socket_t so, void *cookie, int waitf);
typedef void (*sock_evupcall)(socket_t so, void *cookie, u_int32_t event);
extern errno_t sock_accept(socket_t so, struct sockaddr *from, int fromlen,
    int flags, sock_upcall callback, void *cookie, socket_t *new_so);
extern errno_t sock_bind(socket_t so, const struct sockaddr *to);
extern errno_t sock_connect(socket_t so, const struct sockaddr *to, int flags);
extern errno_t sock_connectwait(socket_t so, const struct timeval *tv);
extern errno_t sock_getpeername(socket_t so, struct sockaddr *peername,
    int peernamelen);
extern errno_t sock_getsockname(socket_t so, struct sockaddr *sockname,
    int socknamelen);
extern errno_t sock_getsockopt(socket_t so, int level, int optname,
    void *optval, int *optlen);
extern errno_t sock_ioctl(socket_t so, unsigned long request, void *argp);
extern errno_t sock_setsockopt(socket_t so, int level, int optname,
    const void *optval, int optlen);
extern errno_t sock_settclassopt(socket_t so, const void* optval, size_t optlen);
extern errno_t sock_gettclassopt(socket_t so, void* optval, size_t* optlen);
extern void socket_set_traffic_mgt_flags_locked(socket_t so, u_int32_t flags);
extern void socket_clear_traffic_mgt_flags_locked(socket_t so, u_int32_t flags);
extern void socket_set_traffic_mgt_flags(socket_t so, u_int32_t flags);
extern void socket_clear_traffic_mgt_flags(socket_t so, u_int32_t flags);
extern errno_t socket_defunct(struct proc *, socket_t so, int);
extern errno_t sock_receive_internal(socket_t, struct msghdr *, mbuf_t *,
    int, size_t *);
extern errno_t sock_listen(socket_t so, int backlog);
extern errno_t sock_receive(socket_t so, struct msghdr *msg, int flags,
    size_t *recvdlen);
extern errno_t sock_receivembuf(socket_t so, struct msghdr *msg, mbuf_t *data,
    int flags, size_t *recvlen);
extern errno_t sock_send(socket_t so, const struct msghdr *msg, int flags,
    size_t *sentlen);
extern errno_t sock_sendmbuf(socket_t so, const struct msghdr *msg, mbuf_t data,
    int flags, size_t *sentlen);
extern errno_t sock_shutdown(socket_t so, int how);
extern errno_t sock_socket(int domain, int type, int protocol,
    sock_upcall callback, void *cookie, socket_t *new_so);
extern void sock_close(socket_t so);
extern void sock_retain(socket_t so);
extern void sock_release(socket_t so);
extern errno_t sock_setpriv(socket_t so, int on);
extern int sock_isconnected(socket_t so);
extern int sock_isnonblocking(socket_t so);
extern errno_t sock_gettype(socket_t so, int *domain, int *type, int *protocol);
extern errno_t sock_nointerrupt(socket_t so, int on);
extern socket_t sock_getlistener(socket_t so);
extern errno_t sock_getaddr(socket_t so, struct sockaddr **psockname,
    int peername);
extern void sock_freeaddr(struct sockaddr *sockname);
extern errno_t sock_setupcall(socket_t sock, sock_upcall callback,
    void *context);
extern errno_t sock_setupcalls(socket_t sock, sock_upcall read_callback,
    void *read_context, sock_upcall write_callback, void *write_context);
extern errno_t sock_catchevents(socket_t sock, sock_evupcall event_callback,
    void *event_context, u_int32_t event_mask);

#define _SYS_VNODE_INTERNAL_H_ 
#define _SYS_LOCK_H_ 
#define _KERN_LOCKS_H_ 
#define _MACHINE_LOCKS_H_ 
#define _I386_LOCKS_H_ 
typedef struct {
 unsigned long opaque[10];
} lck_spin_t;
typedef struct {
 unsigned long opaque[2];
} lck_mtx_t;
typedef struct {
 unsigned long opaque[10];
} lck_mtx_ext_t;
#pragma pack(1)
typedef struct {
 uint32_t opaque[3];
 uint32_t opaque4;
} lck_rw_t;
#pragma pack()
typedef unsigned int lck_sleep_action_t;
#define LCK_SLEEP_DEFAULT 0x00
#define LCK_SLEEP_UNLOCK 0x01
#define LCK_SLEEP_SHARED 0x02
#define LCK_SLEEP_EXCLUSIVE 0x04
#define LCK_SLEEP_SPIN 0x08
#define LCK_SLEEP_MASK 0x0f
typedef struct __lck_grp__ lck_grp_t;
typedef struct __lck_grp_attr__ lck_grp_attr_t;
#define LCK_GRP_ATTR_NULL (lck_grp_attr_t *)0

extern lck_grp_attr_t *lck_grp_attr_alloc_init(
         void);
extern void lck_grp_attr_setdefault(
         lck_grp_attr_t *attr);
extern void lck_grp_attr_setstat(
         lck_grp_attr_t *attr);
extern void lck_grp_attr_free(
         lck_grp_attr_t *attr);
extern lck_grp_t *lck_grp_alloc_init(
         const char* grp_name,
         lck_grp_attr_t *attr);


extern void lck_grp_free(
         lck_grp_t *grp);

typedef struct __lck_attr__ lck_attr_t;
#define LCK_ATTR_NULL (lck_attr_t *)0

extern lck_attr_t *lck_attr_alloc_init(
         void);
extern void lck_attr_setdefault(
         lck_attr_t *attr);
extern void lck_attr_setdebug(
         lck_attr_t *attr);
extern void lck_attr_cleardebug(
         lck_attr_t *attr);
extern void lck_attr_rw_shared_priority(
         lck_attr_t *attr);
extern void lck_attr_free(
         lck_attr_t *attr);
#define decl_lck_spin_data(class,name) class lck_spin_t name;
extern lck_spin_t *lck_spin_alloc_init(
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_spin_init(
         lck_spin_t *lck,
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_spin_lock(
         lck_spin_t *lck);
extern void lck_spin_unlock(
         lck_spin_t *lck);
extern void lck_spin_destroy(
         lck_spin_t *lck,
         lck_grp_t *grp);
extern void lck_spin_free(
         lck_spin_t *lck,
         lck_grp_t *grp);
extern wait_result_t lck_spin_sleep(
         lck_spin_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible);
extern wait_result_t lck_spin_sleep_deadline(
         lck_spin_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible,
         uint64_t deadline);
extern boolean_t lck_spin_try_lock(
         lck_spin_t *lck);
struct _lck_mtx_ext_;
extern void lck_mtx_init_ext(lck_mtx_t *lck, struct _lck_mtx_ext_ *lck_ext,
    lck_grp_t *grp, lck_attr_t *attr);
#define decl_lck_mtx_data(class,name) class lck_mtx_t name;
extern lck_mtx_t *lck_mtx_alloc_init(
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_mtx_init(
         lck_mtx_t *lck,
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_mtx_lock(
         lck_mtx_t *lck);
extern void lck_mtx_unlock(
         lck_mtx_t *lck);
extern void lck_mtx_destroy(
         lck_mtx_t *lck,
         lck_grp_t *grp);
extern void lck_mtx_free(
         lck_mtx_t *lck,
         lck_grp_t *grp);
extern wait_result_t lck_mtx_sleep(
         lck_mtx_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible);
extern wait_result_t lck_mtx_sleep_deadline(
         lck_mtx_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible,
         uint64_t deadline);
extern boolean_t lck_mtx_try_lock(
         lck_mtx_t *lck);
extern void mutex_pause(uint32_t);
extern void lck_mtx_yield (
         lck_mtx_t *lck);
extern boolean_t lck_mtx_try_lock_spin(
         lck_mtx_t *lck);
extern boolean_t lck_mtx_try_lock_spin_always(
         lck_mtx_t *lck);
extern void lck_mtx_lock_spin_always(
         lck_mtx_t *lck);
extern void lck_mtx_lock_spin(
         lck_mtx_t *lck);
extern void lck_mtx_convert_spin(
         lck_mtx_t *lck);
#define lck_mtx_unlock_always(l) lck_mtx_unlock(l)
extern void lck_mtx_assert(
         lck_mtx_t *lck,
         unsigned int type);

#define LCK_MTX_ASSERT_OWNED 0x01
#define LCK_MTX_ASSERT_NOTOWNED 0x02
#define decl_lck_rw_data(class,name) class lck_rw_t name;
typedef unsigned int lck_rw_type_t;
#define LCK_RW_TYPE_SHARED 0x01
#define LCK_RW_TYPE_EXCLUSIVE 0x02
#define LCK_RW_ASSERT_SHARED 0x01
#define LCK_RW_ASSERT_EXCLUSIVE 0x02
#define LCK_RW_ASSERT_HELD 0x03
#define LCK_RW_ASSERT_NOTHELD 0x04

extern lck_rw_t *lck_rw_alloc_init(
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_rw_init(
         lck_rw_t *lck,
         lck_grp_t *grp,
         lck_attr_t *attr);
extern void lck_rw_lock(
         lck_rw_t *lck,
         lck_rw_type_t lck_rw_type);
extern void lck_rw_unlock(
         lck_rw_t *lck,
         lck_rw_type_t lck_rw_type);
extern void lck_rw_lock_shared(
         lck_rw_t *lck);
extern void lck_rw_unlock_shared(
         lck_rw_t *lck);
extern void lck_rw_lock_exclusive(
         lck_rw_t *lck);
extern void lck_rw_unlock_exclusive(
         lck_rw_t *lck);
extern void lck_rw_assert(
         lck_rw_t *lck,
         unsigned int type);
extern void lck_rw_clear_promotion(
         thread_t thread);
extern lck_rw_type_t lck_rw_done(
         lck_rw_t *lck);
extern void lck_rw_destroy(
         lck_rw_t *lck,
         lck_grp_t *grp);
extern void lck_rw_free(
         lck_rw_t *lck,
         lck_grp_t *grp);
extern wait_result_t lck_rw_sleep(
         lck_rw_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible);
extern wait_result_t lck_rw_sleep_deadline(
         lck_rw_t *lck,
         lck_sleep_action_t lck_sleep_action,
         event_t event,
         wait_interrupt_t interruptible,
         uint64_t deadline);
extern boolean_t lck_rw_lock_shared_to_exclusive(
         lck_rw_t *lck);
extern void lck_rw_lock_exclusive_to_shared(
         lck_rw_t *lck);
extern boolean_t lck_rw_try_lock(
         lck_rw_t *lck,
         lck_rw_type_t lck_rw_type);
extern boolean_t lck_rw_try_lock_shared(
         lck_rw_t *lck);
extern boolean_t lck_rw_try_lock_exclusive(
         lck_rw_t *lck);

#define _SYS_TIME_H_ 
#define _STRUCT_USER_TIMESPEC struct user_timespec
struct user_timespec
{
 user_time_t tv_sec;
 user_long_t tv_nsec;
};
#define _STRUCT_USER32_TIMESPEC struct user32_timespec
struct user32_timespec
{
 user32_time_t tv_sec;
 user32_long_t tv_nsec;
};
#define _STRUCT_USER64_TIMESPEC struct user64_timespec
struct user64_timespec
{
 user64_time_t tv_sec;
 user64_long_t tv_nsec;
};
#define _STRUCT_USER_TIMEVAL struct user_timeval
struct user_timeval
{
 user_time_t tv_sec;
 __int32_t tv_usec;
};
#define _STRUCT_USER32_TIMEVAL struct user32_timeval
struct user32_timeval
{
 user32_time_t tv_sec;
 __int32_t tv_usec;
};
#define _STRUCT_USER64_TIMEVAL struct user64_timeval
struct user64_timeval
{
 user64_time_t tv_sec;
 __int32_t tv_usec;
};
#define _STRUCT_USER32_ITIMERVAL struct user32_itimerval
struct user32_itimerval
{
 struct user32_timeval it_interval;
 struct user32_timeval it_value;
};
#define _STRUCT_USER64_ITIMERVAL struct user64_itimerval
struct user64_itimerval
{
 struct user64_timeval it_interval;
 struct user64_timeval it_value;
};
struct itimerval {
 struct timeval it_interval;
 struct timeval it_value;
};
#define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
#define TIMEVAL_TO_TIMESPEC(tv,ts) { (ts)->tv_sec = (tv)->tv_sec; (ts)->tv_nsec = (tv)->tv_usec * 1000; }
#define TIMESPEC_TO_TIMEVAL(tv,ts) { (tv)->tv_sec = (ts)->tv_sec; (tv)->tv_usec = (ts)->tv_nsec / 1000; }
struct timezone {
 int tz_minuteswest;
 int tz_dsttime;
};
#define DST_NONE 0
#define DST_USA 1
#define DST_AUST 2
#define DST_WET 3
#define DST_MET 4
#define DST_EET 5
#define DST_CAN 6
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp,uvp,cmp) (((tvp)->tv_sec == (uvp)->tv_sec) ? ((tvp)->tv_usec cmp (uvp)->tv_usec) : ((tvp)->tv_sec cmp (uvp)->tv_sec))
#define timeradd(tvp,uvp,vvp) do { (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; if ((vvp)->tv_usec >= 1000000) { (vvp)->tv_sec++; (vvp)->tv_usec -= 1000000; } } while (0)
#define timersub(tvp,uvp,vvp) do { (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; if ((vvp)->tv_usec < 0) { (vvp)->tv_sec--; (vvp)->tv_usec += 1000000; } } while (0)
#define timevalcmp(l,r,cmp) timercmp(l, r, cmp)
struct clockinfo {
 int hz;
 int tick;
 int tickadj;
 int stathz;
 int profhz;
};

void microtime(struct timeval *tv);
void microtime_with_abstime(struct timeval *tv, uint64_t *abstime);
void microuptime(struct timeval *tv);
#define getmicrotime(a) microtime(a)
#define getmicrouptime(a) microuptime(a)
void nanotime(struct timespec *ts);
void nanouptime(struct timespec *ts);
#define getnanotime(a) nanotime(a)
#define getnanouptime(a) nanouptime(a)
void timevaladd(struct timeval *t1, struct timeval *t2);
void timevalsub(struct timeval *t1, struct timeval *t2);
void timevalfix(struct timeval *t1);
time_t boottime_sec(void);
void inittodr(time_t base);
int ratecheck(struct timeval *lasttime, const struct timeval *mininterval);
int ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps);

#define _SYS_UIO_H_ 
enum uio_rw { UIO_READ, UIO_WRITE };
enum uio_seg {
 UIO_USERSPACE = 0,
 UIO_SYSSPACE = 2,
 UIO_USERSPACE32 = 5,
 UIO_USERSPACE64 = 8,
 UIO_SYSSPACE32 = 11
};
#define UIO_SEG_IS_USER_SPACE(a_uio_seg) ( (a_uio_seg) == UIO_USERSPACE64 || (a_uio_seg) == UIO_USERSPACE32 || (a_uio_seg) == UIO_USERSPACE )

uio_t uio_create( int a_iovcount,
      off_t a_offset,
      int a_spacetype,
      int a_iodirection );
void uio_reset( uio_t a_uio,
    off_t a_offset,
    int a_spacetype,
    int a_iodirection );
uio_t uio_duplicate( uio_t a_uio );
void uio_free( uio_t a_uio );
int uio_addiov( uio_t a_uio, user_addr_t a_baseaddr, user_size_t a_length );
int uio_getiov( uio_t a_uio,
                 int a_index,
                 user_addr_t * a_baseaddr_p,
                 user_size_t * a_length_p );
void uio_update( uio_t a_uio, user_size_t a_count );
user_ssize_t uio_resid( uio_t a_uio );
void uio_setresid( uio_t a_uio, user_ssize_t a_value );
int uio_iovcnt( uio_t a_uio );
off_t uio_offset( uio_t a_uio );
void uio_setoffset( uio_t a_uio, off_t a_offset );
int uio_rw( uio_t a_uio );
void uio_setrw( uio_t a_uio, int a_value );
int uio_isuserspace( uio_t a_uio );
user_addr_t uio_curriovbase( uio_t a_uio );
user_size_t uio_curriovlen( uio_t a_uio );
#define UIO_MAXIOV 1024
#define UIO_SMALLIOV 8
extern int uiomove(const char * cp, int n, struct uio *uio);
extern int uiomove64(const __uint64_t cp, int n, struct uio *uio);

#define _SYS_VM_H 
#define _SYS_VMMETER_H_ 
struct vmmeter {
 unsigned int v_swtch;
 unsigned int v_trap;
 unsigned int v_syscall;
 unsigned int v_intr;
 unsigned int v_soft;
 unsigned int v_faults;
 unsigned int v_lookups;
 unsigned int v_hits;
 unsigned int v_vm_faults;
 unsigned int v_cow_faults;
 unsigned int v_swpin;
 unsigned int v_swpout;
 unsigned int v_pswpin;
 unsigned int v_pswpout;
 unsigned int v_pageins;
 unsigned int v_pageouts;
 unsigned int v_pgpgin;
 unsigned int v_pgpgout;
 unsigned int v_intrans;
 unsigned int v_reactivated;
 unsigned int v_rev;
 unsigned int v_scan;
 unsigned int v_dfree;
 unsigned int v_pfree;
 unsigned int v_zfod;
 unsigned int v_nzfod;
 unsigned int v_page_size;
 unsigned int v_kernel_pages;
 unsigned int v_free_target;
 unsigned int v_free_min;
 unsigned int v_free_count;
 unsigned int v_wire_count;
 unsigned int v_active_count;
 unsigned int v_inactive_target;
 unsigned int v_inactive_count;
};
struct vmtotal
{
 int16_t t_rq;
 int16_t t_dw;
 int16_t t_pw;
 int16_t t_sl;
 int16_t t_sw;
 int32_t t_vm;
 int32_t t_avm;
 int32_t t_rm;
 int32_t t_arm;
 int32_t t_vmshr;
 int32_t t_avmshr;
 int32_t t_rmshr;
 int32_t t_armshr;
 int32_t t_free;
};
extern struct vmtotal total;
struct vmspace {
 int vm_refcnt;
 caddr_t vm_shm;
#define vm_startcopy vm_rssize
 segsz_t vm_rssize;
 segsz_t vm_swrss;
 segsz_t vm_tsize;
 segsz_t vm_dsize;
 segsz_t vm_ssize;
 caddr_t vm_taddr;
 caddr_t vm_daddr;
 caddr_t vm_maxsaddr;
};
struct user32_vmspace {
 int vm_refcnt;
 uint32_t vm_shm;
 segsz_t vm_rssize;
 segsz_t vm_swrss;
 segsz_t vm_tsize;
 segsz_t vm_dsize;
 segsz_t vm_ssize;
 uint32_t vm_taddr;
 uint32_t vm_daddr;
 uint32_t vm_maxsaddr;
};
struct user_vmspace {
 int vm_refcnt;
 user_addr_t vm_shm __attribute((aligned(8)));
 segsz_t vm_rssize;
 segsz_t vm_swrss;
 segsz_t vm_tsize;
 segsz_t vm_dsize;
 segsz_t vm_ssize;
 user_addr_t vm_taddr __attribute((aligned(8)));
 user_addr_t vm_daddr;
 user_addr_t vm_maxsaddr;
};
#define _KERN_THREAD_H_ 

extern thread_t current_thread(void);
extern void thread_reference(
      thread_t thread);
extern void thread_deallocate(
      thread_t thread);


extern uint64_t thread_tid(
      thread_t thread);
extern uint64_t thread_dispatchqaddr(
      thread_t thread);


#define THREAD_TAG_MAINTHREAD 0x1
#define THREAD_TAG_CALLOUT 0x2
#define THREAD_TAG_IOWORKLOOP 0x4
uint16_t thread_set_tag(thread_t, uint16_t);
uint16_t thread_get_tag(thread_t);
extern kern_return_t thread_state_initialize(
       thread_t thread);
extern kern_return_t thread_setstatus(
       thread_t thread,
       int flavor,
       thread_state_t tstate,
       mach_msg_type_number_t count);
extern kern_return_t thread_getstatus(
       thread_t thread,
       int flavor,
       thread_state_t tstate,
       mach_msg_type_number_t *count);
extern kern_return_t thread_create_workq(
       task_t task,
       thread_continue_t thread_return,
       thread_t *new_thread);
extern void thread_yield_internal(
 mach_msg_timeout_t interval);
#define THREAD_CPULIMIT_BLOCK 0x1
#define THREAD_CPULIMIT_EXCEPTION 0x2
#define THREAD_CPULIMIT_DISABLE 0x3
struct _thread_ledger_indices {
 int cpu_time;
};
extern struct _thread_ledger_indices thread_ledgers;
extern int thread_get_cpulimit(int *action, uint8_t *percentage, uint64_t *interval_ns);
extern int thread_set_cpulimit(int action, uint8_t percentage, uint64_t interval_ns);
typedef struct funnel_lock funnel_t;
#define THR_FUNNEL_NULL (funnel_t *)0
extern funnel_t *funnel_alloc(
      int type);
extern void funnel_free(
      funnel_t *lock);
extern funnel_t *thread_funnel_get(void);
extern boolean_t thread_funnel_set(
      funnel_t *lock,
      boolean_t funneled);
extern void thread_read_times(
      thread_t thread,
      time_value_t *user_time,
      time_value_t *system_time);
extern void thread_setuserstack(
      thread_t thread,
      mach_vm_offset_t user_stack);
extern uint64_t thread_adjuserstack(
      thread_t thread,
      int adjust);
extern void thread_setentrypoint(
      thread_t thread,
      mach_vm_offset_t entry);
extern kern_return_t thread_setsinglestep(
      thread_t thread,
      int on);
extern kern_return_t thread_userstack(
      thread_t,
      int,
      thread_state_t,
      unsigned int,
      mach_vm_offset_t *,
      int *);
extern kern_return_t thread_entrypoint(
      thread_t,
      int,
      thread_state_t,
      unsigned int,
      mach_vm_offset_t *);
extern kern_return_t thread_userstackdefault(
      thread_t,
      mach_vm_offset_t *);
extern kern_return_t thread_wire_internal(
       host_priv_t host_priv,
       thread_t thread,
       boolean_t wired,
       boolean_t *prev_state);
extern kern_return_t thread_dup(thread_t);
typedef void (*sched_call_t)(
     int type,
     thread_t thread);
#define SCHED_CALL_BLOCK 0x1
#define SCHED_CALL_UNBLOCK 0x2
extern void thread_sched_call(
     thread_t thread,
     sched_call_t call);
extern void thread_static_param(
     thread_t thread,
     boolean_t state);
extern kern_return_t thread_policy_set_internal(
                                 thread_t thread,
     thread_policy_flavor_t flavor,
     thread_policy_t policy_info,
     mach_msg_type_number_t count);
extern task_t get_threadtask(thread_t);
#define thread_is_64bit(thd) task_has_64BitAddr(get_threadtask(thd))
extern void *get_bsdthread_info(thread_t);
extern void set_bsdthread_info(thread_t, void *);
extern void *uthread_alloc(task_t, thread_t, int);
extern void uthread_cleanup(task_t, void *, void *);
extern void uthread_zone_free(void *);
extern void uthread_cred_free(void *);
extern boolean_t thread_should_halt(
      thread_t thread);
extern boolean_t thread_should_abort(
      thread_t);
extern int is_64signalregset(void);
void act_set_apc(thread_t);
void act_set_kperf(thread_t);
extern uint32_t dtrace_get_thread_predcache(thread_t);
extern int64_t dtrace_get_thread_vtime(thread_t);
extern int64_t dtrace_get_thread_tracing(thread_t);
extern boolean_t dtrace_get_thread_reentering(thread_t);
extern vm_offset_t dtrace_get_kernel_stack(thread_t);
extern void dtrace_set_thread_predcache(thread_t, uint32_t);
extern void dtrace_set_thread_vtime(thread_t, int64_t);
extern void dtrace_set_thread_tracing(thread_t, int64_t);
extern void dtrace_set_thread_reentering(thread_t, boolean_t);
extern vm_offset_t dtrace_set_thread_recover(thread_t, vm_offset_t);
extern void dtrace_thread_bootstrap(void);
extern void dtrace_thread_didexec(thread_t);
extern int64_t dtrace_calc_thread_recent_vtime(thread_t);
extern kern_return_t thread_set_wq_state32(
           thread_t thread,
           thread_state_t tstate);
extern kern_return_t thread_set_wq_state64(
           thread_t thread,
           thread_state_t tstate);
extern vm_offset_t kernel_stack_mask;
extern vm_offset_t kernel_stack_size;
extern vm_offset_t kernel_stack_depth_max;
void guard_ast(thread_t thread);
extern void fd_guard_ast(thread_t thread);
extern void mach_port_guard_ast(thread_t thread);
extern void thread_guard_violation(thread_t thread, unsigned type);
extern kern_return_t kernel_thread_start(
       thread_continue_t continuation,
       void *parameter,
       thread_t *new_thread);
void thread_set_eager_preempt(thread_t thread);
void thread_clear_eager_preempt(thread_t thread);
extern ipc_port_t convert_thread_to_port(thread_t);


struct proc *current_proc(void);

#define _SYS_SYSTM_H_ 
#define _SYS_IOCTL_H_ 
#define _SYS_TTYCOM_H_ 
#define _SYS_IOCCOM_H_ 
#define IOCPARM_MASK 0x1fff
#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
#define IOCGROUP(x) (((x) >> 8) & 0xff)
#define IOCPARM_MAX (IOCPARM_MASK + 1)
#define IOC_VOID (__uint32_t)0x20000000
#define IOC_OUT (__uint32_t)0x40000000
#define IOC_IN (__uint32_t)0x80000000
#define IOC_INOUT (IOC_IN|IOC_OUT)
#define IOC_DIRMASK (__uint32_t)0xe0000000
#define _IOC(inout,group,num,len) (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
struct winsize {
 unsigned short ws_row;
 unsigned short ws_col;
 unsigned short ws_xpixel;
 unsigned short ws_ypixel;
};
#define TIOCMODG _IOR('t', 3, int)
#define TIOCMODS _IOW('t', 4, int)
#define TIOCM_LE 0001
#define TIOCM_DTR 0002
#define TIOCM_RTS 0004
#define TIOCM_ST 0010
#define TIOCM_SR 0020
#define TIOCM_CTS 0040
#define TIOCM_CAR 0100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RNG 0200
#define TIOCM_RI TIOCM_RNG
#define TIOCM_DSR 0400
#define TIOCEXCL _IO('t', 13)
#define TIOCNXCL _IO('t', 14)
#define TIOCFLUSH _IOW('t', 16, int)
#define TIOCGETA _IOR('t', 19, struct termios)
#define TIOCSETA _IOW('t', 20, struct termios)
#define TIOCSETAW _IOW('t', 21, struct termios)
#define TIOCSETAF _IOW('t', 22, struct termios)
#define TIOCGETA_32 _IOR('t', 19, struct termios32)
#define TIOCSETA_32 _IOW('t', 20, struct termios32)
#define TIOCSETAW_32 _IOW('t', 21, struct termios32)
#define TIOCSETAF_32 _IOW('t', 22, struct termios32)
#define TIOCGETA_64 _IOR('t', 19, struct user_termios)
#define TIOCSETA_64 _IOW('t', 20, struct user_termios)
#define TIOCSETAW_64 _IOW('t', 21, struct user_termios)
#define TIOCSETAF_64 _IOW('t', 22, struct user_termios)
#define TIOCGETD _IOR('t', 26, int)
#define TIOCSETD _IOW('t', 27, int)
#define TIOCIXON _IO('t', 129)
#define TIOCIXOFF _IO('t', 128)
#define TIOCSBRK _IO('t', 123)
#define TIOCCBRK _IO('t', 122)
#define TIOCSDTR _IO('t', 121)
#define TIOCCDTR _IO('t', 120)
#define TIOCGPGRP _IOR('t', 119, int)
#define TIOCSPGRP _IOW('t', 118, int)
#define TIOCOUTQ _IOR('t', 115, int)
#define TIOCSTI _IOW('t', 114, char)
#define TIOCNOTTY _IO('t', 113)
#define TIOCPKT _IOW('t', 112, int)
#define TIOCPKT_DATA 0x00
#define TIOCPKT_FLUSHREAD 0x01
#define TIOCPKT_FLUSHWRITE 0x02
#define TIOCPKT_STOP 0x04
#define TIOCPKT_START 0x08
#define TIOCPKT_NOSTOP 0x10
#define TIOCPKT_DOSTOP 0x20
#define TIOCPKT_IOCTL 0x40
#define TIOCSTOP _IO('t', 111)
#define TIOCSTART _IO('t', 110)
#define TIOCMSET _IOW('t', 109, int)
#define TIOCMBIS _IOW('t', 108, int)
#define TIOCMBIC _IOW('t', 107, int)
#define TIOCMGET _IOR('t', 106, int)
#define TIOCREMOTE _IOW('t', 105, int)
#define TIOCGWINSZ _IOR('t', 104, struct winsize)
#define TIOCSWINSZ _IOW('t', 103, struct winsize)
#define TIOCUCNTL _IOW('t', 102, int)
#define TIOCSTAT _IO('t', 101)
#define UIOCCMD(n) _IO('u', n)
#define TIOCSCONS _IO('t', 99)
#define TIOCCONS _IOW('t', 98, int)
#define TIOCSCTTY _IO('t', 97)
#define TIOCEXT _IOW('t', 96, int)
#define TIOCSIG _IO('t', 95)
#define TIOCDRAIN _IO('t', 94)
#define TIOCMSDTRWAIT _IOW('t', 91, int)
#define TIOCMGDTRWAIT _IOR('t', 90, int)
#define TIOCTIMESTAMP _IOR('t', 89, struct timeval)
#define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval)
#define TIOCTIMESTAMP_32 _IOR('t', 89, struct user32_timeval)
#define TIOCDCDTIMESTAMP_32 _IOR('t', 88, struct user32_timeval)
#define TIOCTIMESTAMP_64 _IOR('t', 89, struct user64_timeval)
#define TIOCDCDTIMESTAMP_64 _IOR('t', 88, struct user64_timeval)
#define TIOCSDRAINWAIT _IOW('t', 87, int)
#define TIOCGDRAINWAIT _IOR('t', 86, int)
#define TIOCDSIMICROCODE _IO('t', 85)
#define TIOCPTYGRANT _IO('t', 84)
#define TIOCPTYGNAME _IOC(IOC_OUT, 't', 83, 128)
#define TIOCPTYUNLK _IO('t', 82)
#define TTYDISC 0
#define TABLDISC 3
#define SLIPDISC 4
#define PPPDISC 5
struct ttysize {
 unsigned short ts_lines;
 unsigned short ts_cols;
 unsigned short ts_xxx;
 unsigned short ts_yyy;
};
#define TIOCGSIZE TIOCGWINSZ
#define TIOCSSIZE TIOCSWINSZ
#define _SYS_FILIO_H_ 
#define FIOCLEX _IO('f', 1)
#define FIONCLEX _IO('f', 2)
#define FIONREAD _IOR('f', 127, int)
#define FIONBIO _IOW('f', 126, int)
#define FIOASYNC _IOW('f', 125, int)
#define FIOSETOWN _IOW('f', 124, int)
#define FIOGETOWN _IOR('f', 123, int)
#define FIODTYPE _IOR('f', 122, int)
#define _SYS_SOCKIO_H_ 
#define SIOCSHIWAT _IOW('s', 0, int)
#define SIOCGHIWAT _IOR('s', 1, int)
#define SIOCSLOWAT _IOW('s', 2, int)
#define SIOCGLOWAT _IOR('s', 3, int)
#define SIOCATMARK _IOR('s', 7, int)
#define SIOCSPGRP _IOW('s', 8, int)
#define SIOCGPGRP _IOR('s', 9, int)
#define SIOCSIFADDR _IOW('i', 12, struct ifreq)
#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq)
#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq)
#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq)
#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq)
#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq)
#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq)
#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq)
#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf)
#define OSIOCGIFCONF32 _IOWR('i', 20, struct ifconf32)
#define OSIOCGIFCONF64 _IOWR('i', 20, struct ifconf64)
#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq)
#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq)
#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq)
#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq)
#define SIOCDIFADDR _IOW('i', 25, struct ifreq)
#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)
#define SIOCGETVIFCNT _IOWR('r', 27, struct sioc_vif_req)
#define SIOCGETSGCNT _IOWR('r', 28, struct sioc_sg_req)
#define SIOCALIFADDR _IOW('i', 29, struct if_laddrreq)
#define SIOCGLIFADDR _IOWR('i', 30, struct if_laddrreq)
#define SIOCDLIFADDR _IOW('i', 31, struct if_laddrreq)
#define SIOCGIFADDR _IOWR('i', 33, struct ifreq)
#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq)
#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq)
#define SIOCGIFCONF _IOWR('i', 36, struct ifconf)
#define SIOCGIFCONF32 _IOWR('i', 36, struct ifconf32)
#define SIOCGIFCONF64 _IOWR('i', 36, struct ifconf64)
#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq)
#define SIOCAUTOADDR _IOWR('i', 38, struct ifreq)
#define SIOCAUTONETMASK _IOW('i', 39, struct ifreq)
#define SIOCARPIPLL _IOWR('i', 40, struct ifreq)
#define SIOCADDMULTI _IOW('i', 49, struct ifreq)
#define SIOCDELMULTI _IOW('i', 50, struct ifreq)
#define SIOCGIFMTU _IOWR('i', 51, struct ifreq)
#define SIOCSIFMTU _IOW('i', 52, struct ifreq)
#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq)
#define SIOCSIFPHYS _IOW('i', 54, struct ifreq)
#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq)
#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq)
#define SIOCGIFMEDIA32 _IOWR('i', 56, struct ifmediareq32)
#define SIOCGIFMEDIA64 _IOWR('i', 56, struct ifmediareq64)
#define SIOCSIFGENERIC _IOW('i', 57, struct ifreq)
#define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq)
#define SIOCRSLVMULTI _IOWR('i', 59, struct rslvmulti_req)
#define SIOCSIFLLADDR _IOW('i', 60, struct ifreq)
#define SIOCGIFSTATUS _IOWR('i', 61, struct ifstat)
#define SIOCSIFPHYADDR _IOW('i', 62, struct ifaliasreq)
#define SIOCGIFPSRCADDR _IOWR('i', 63, struct ifreq)
#define SIOCGIFPDSTADDR _IOWR('i', 64, struct ifreq)
#define SIOCDIFPHYADDR _IOW('i', 65, struct ifreq)
#define SIOCSLIFPHYADDR _IOW('i', 66, struct if_laddrreq)
#define SIOCGLIFPHYADDR _IOWR('i', 67, struct if_laddrreq)
#define SIOCGIFDEVMTU _IOWR('i', 68, struct ifreq)
#define SIOCSIFALTMTU _IOW('i', 69, struct ifreq)
#define SIOCGIFALTMTU _IOWR('i', 72, struct ifreq)
#define SIOCSIFBOND _IOW('i', 70, struct ifreq)
#define SIOCGIFBOND _IOWR('i', 71, struct ifreq)
#define SIOCSIFCAP _IOW('i', 90, struct ifreq)
#define SIOCGIFCAP _IOWR('i', 91, struct ifreq)
#define SIOCIFCREATE _IOWR('i', 120, struct ifreq)
#define SIOCIFDESTROY _IOW('i', 121, struct ifreq)
#define SIOCIFCREATE2 _IOWR('i', 122, struct ifreq)
#define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv)
#define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv)
#define SIOCSDRVSPEC32 _IOW('i', 123, struct ifdrv32)
#define SIOCGDRVSPEC32 _IOWR('i', 123, struct ifdrv32)
#define SIOCSDRVSPEC64 _IOW('i', 123, struct ifdrv64)
#define SIOCGDRVSPEC64 _IOWR('i', 123, struct ifdrv64)
#define SIOCSIFVLAN _IOW('i', 126, struct ifreq)
#define SIOCGIFVLAN _IOWR('i', 127, struct ifreq)
#define SIOCSETVLAN SIOCSIFVLAN
#define SIOCGETVLAN SIOCGIFVLAN
#define SIOCSIFDEVMTU SIOCSIFALTMTU
#define SIOCIFGCLONERS _IOWR('i', 129, struct if_clonereq)
#define SIOCIFGCLONERS32 _IOWR('i', 129, struct if_clonereq32)
#define SIOCIFGCLONERS64 _IOWR('i', 129, struct if_clonereq64)
#define SIOCGIFASYNCMAP _IOWR('i', 124, struct ifreq)
#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq)
#define SIOCGIFMAC _IOWR('i', 130, struct ifreq)
#define SIOCSIFMAC _IOW('i', 131, struct ifreq)
#define SIOCSIFKPI _IOW('i', 134, struct ifreq)
#define SIOCGIFKPI _IOWR('i', 135, struct ifreq)
#define SIOCGIFWAKEFLAGS _IOWR('i', 136, struct ifreq)
#define _SYS_IOCTL_COMPAT_H_ 
#define _SYS_TTYCHARS_H_ 
struct ttychars {
 char tc_erase;
 char tc_kill;
 char tc_intrc;
 char tc_quitc;
 char tc_startc;
 char tc_stopc;
 char tc_eofc;
 char tc_brkc;
 char tc_suspc;
 char tc_dsuspc;
 char tc_rprntc;
 char tc_flushc;
 char tc_werasc;
 char tc_lnextc;
};
#define _SYS_TTYDEV_H_ 
struct tchars {
 char t_intrc;
 char t_quitc;
 char t_startc;
 char t_stopc;
 char t_eofc;
 char t_brkc;
};
struct ltchars {
 char t_suspc;
 char t_dsuspc;
 char t_rprntc;
 char t_flushc;
 char t_werasc;
 char t_lnextc;
};
#define _SGTTYB_ 
struct sgttyb {
 char sg_ispeed;
 char sg_ospeed;
 char sg_erase;
 char sg_kill;
 short sg_flags;
};
#define OTIOCGETD _IOR('t', 0, int)
#define OTIOCSETD _IOW('t', 1, int)
#define TIOCHPCL _IO('t', 2)
#define TIOCGETP _IOR('t', 8,struct sgttyb)
#define TIOCSETP _IOW('t', 9,struct sgttyb)
#define TIOCSETN _IOW('t',10,struct sgttyb)
#define TIOCSETC _IOW('t',17,struct tchars)
#define TIOCGETC _IOR('t',18,struct tchars)
#define TANDEM 0x00000001
#define CBREAK 0x00000002
#define LCASE 0x00000004
#define ECHO 0x00000008
#define CRMOD 0x00000010
#define RAW 0x00000020
#define ODDP 0x00000040
#define EVENP 0x00000080
#define ANYP 0x000000c0
#define NLDELAY 0x00000300
#define TBDELAY 0x00000c00
#define XTABS 0x00000c00
#define CRDELAY 0x00003000
#define VTDELAY 0x00004000
#define BSDELAY 0x00008000
#define NL0 0x00000000
#define NL1 0x00000100
#define NL2 0x00000200
#define NL3 0x00000300
#define TAB0 0x00000000
#define TAB1 0x00000400
#define TAB2 0x00000800
#define CR0 0x00000000
#define CR1 0x00001000
#define CR2 0x00002000
#define CR3 0x00003000
#define FF0 0x00000000
#define FF1 0x00004000
#define BS0 0x00000000
#define BS1 0x00008000
#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
#define CRTBS 0x00010000
#define PRTERA 0x00020000
#define CRTERA 0x00040000
#define TILDE 0x00080000
#define MDMBUF 0x00100000
#define LITOUT 0x00200000
#define TOSTOP 0x00400000
#define FLUSHO 0x00800000
#define NOHANG 0x01000000
#define L001000 0x02000000
#define CRTKIL 0x04000000
#define PASS8 0x08000000
#define CTLECH 0x10000000
#define PENDIN 0x20000000
#define DECCTQ 0x40000000
#define NOFLSH 0x80000000
#define TIOCLBIS _IOW('t', 127, int)
#define TIOCLBIC _IOW('t', 126, int)
#define TIOCLSET _IOW('t', 125, int)
#define TIOCLGET _IOR('t', 124, int)
#define LCRTBS (CRTBS>>16)
#define LPRTERA (PRTERA>>16)
#define LCRTERA (CRTERA>>16)
#define LTILDE (TILDE>>16)
#define LMDMBUF (MDMBUF>>16)
#define LLITOUT (LITOUT>>16)
#define LTOSTOP (TOSTOP>>16)
#define LFLUSHO (FLUSHO>>16)
#define LNOHANG (NOHANG>>16)
#define LCRTKIL (CRTKIL>>16)
#define LPASS8 (PASS8>>16)
#define LCTLECH (CTLECH>>16)
#define LPENDIN (PENDIN>>16)
#define LDECCTQ (DECCTQ>>16)
#define LNOFLSH (NOFLSH>>16)
#define TIOCSLTC _IOW('t',117,struct ltchars)
#define TIOCGLTC _IOR('t',116,struct ltchars)
#define OTIOCCONS _IO('t', 98)
#define OTTYDISC 0
#define NETLDISC 1
#define NTTYDISC 2
#define TIOCGSID _IOR('t', 99, int)
#define _SYS_MALLOC_H_ 
#define M_WAITOK 0x0000
#define M_NOWAIT 0x0001
#define M_ZERO 0x0004
#define KMEMSTATS 0
#define M_FREE 0
#define M_MBUF 1
#define M_DEVBUF 2
#define M_SOCKET 3
#define M_PCB 4
#define M_RTABLE 5
#define M_HTABLE 6
#define M_FTABLE 7
#define M_ZOMBIE 8
#define M_IFADDR 9
#define M_SOOPTS 10
#define M_SONAME 11
#define M_NAMEI 12
#define M_GPROF 13
#define M_IOCTLOPS 14
#define M_MAPMEM 15
#define M_CRED 16
#define M_PGRP 17
#define M_SESSION 18
#define M_IOV32 19
#define M_MOUNT 20
#define M_FHANDLE 21
#define M_NFSREQ 22
#define M_NFSMNT 23
#define M_NFSNODE 24
#define M_VNODE 25
#define M_CACHE 26
#define M_DQUOT 27
#define M_PROC_UUID_POLICY 28
#define M_SHM 29
#define M_PLIMIT 30
#define M_SIGACTS 31
#define M_VMOBJ 32
#define M_VMOBJHASH 33
#define M_VMPMAP 34
#define M_VMPVENT 35
#define M_VMPAGER 36
#define M_VMPGDATA 37
#define M_FILEPROC 38
#define M_FILEDESC 39
#define M_LOCKF 40
#define M_PROC 41
#define M_PSTATS 42
#define M_SEGMENT 43
#define M_LFSNODE 44
#define M_FFSNODE 45
#define M_MFSNODE 46
#define M_NQLEASE 47
#define M_NQMHOST 48
#define M_NETADDR 49
#define M_NFSSVC 50
#define M_NFSUID 51
#define M_NFSD 52
#define M_IPMOPTS 53
#define M_IPMADDR 54
#define M_IFMADDR 55
#define M_MRTABLE 56
#define M_ISOFSMNT 57
#define M_ISOFSNODE 58
#define M_NFSRVDESC 59
#define M_NFSDIROFF 60
#define M_NFSBIGFH 61
#define M_MSDOSFSMNT 62
#define M_MSDOSFSFAT 63
#define M_MSDOSFSNODE 64
#define M_TTYS 65
#define M_EXEC 66
#define M_MISCFSMNT 67
#define M_MISCFSNODE 68
#define M_ADOSFSMNT 69
#define M_ADOSFSNODE 70
#define M_ANODE 71
#define M_BUFHDR 72
#define M_OFILETABL 73
#define M_MCLUST 74
#define M_HFSMNT 75
#define M_HFSNODE 76
#define M_HFSFORK 77
#define M_TEMP 80
#define M_SECA 81
#define M_DEVFS 82
#define M_IPFW 83
#define M_UDFNODE 84
#define M_UDFMNT 85
#define M_IP6NDP 86
#define M_IP6OPT 87
#define M_IP6MISC 88
#define M_TSEGQ 89
#define M_IGMP 90
#define M_JNL_JNL 91
#define M_JNL_TR 92
#define M_SPECINFO 93
#define M_KQUEUE 94
#define M_HFSDIRHINT 95
#define M_CLRDAHEAD 96
#define M_CLWRBEHIND 97
#define M_IOV64 98
#define M_FILEGLOB 99
#define M_KAUTH 100
#define M_DUMMYNET 101
#define M_MACPIPELABEL 103
#define M_MACTEMP 104
#define M_SBUF 105
#define M_EXTATTR 106
#define M_LCTX 107
#define M_INMFILTER 110
#define M_IPMSOURCE 111
#define M_IN6MFILTER 112
#define M_IP6MOPTS 113
#define M_IP6MSOURCE 114
#define M_FLOW_DIVERT_PCB 115
#define M_FLOW_DIVERT_GROUP 116
#define M_IP6CGA 117
#define M_LAST 118
#define MALLOC(space,cast,size,type,flags) (space) = (cast)_MALLOC(size, type, flags)
#define FREE(addr,type) _FREE((void *)addr, type)
#define REALLOC(space,cast,addr,size,type,flags) (space) = (cast)_REALLOC(addr, size, type, flags)
#define MALLOC_ZONE(space,cast,size,type,flags) (space) = (cast)_MALLOC_ZONE(size, type, flags)
#define FREE_ZONE(addr,size,type) _FREE_ZONE((void *)addr, size, type)
extern void *_MALLOC(
   size_t size,
   int type,
   int flags);
extern void _FREE(
   void *addr,
   int type);
extern void *_REALLOC(
   void *addr,
   size_t size,
   int type,
   int flags);
extern void *_MALLOC_ZONE(
   size_t size,
   int type,
   int flags);
extern void _FREE_ZONE(
   void *elem,
   size_t size,
   int type);
#define _SYS_TTY_H_ 
#define _SYS_TERMIOS_H_ 
#define VEOF 0
#define VEOL 1
#define VEOL2 2
#define VERASE 3
#define VWERASE 4
#define VKILL 5
#define VREPRINT 6
#define VINTR 8
#define VQUIT 9
#define VSUSP 10
#define VDSUSP 11
#define VSTART 12
#define VSTOP 13
#define VLNEXT 14
#define VDISCARD 15
#define VMIN 16
#define VTIME 17
#define VSTATUS 18
#define NCCS 20
#define _POSIX_VDISABLE ((unsigned char)'\377')
#define CCEQ(val,c) ((c) == (val) ? (val) != _POSIX_VDISABLE : 0)
#define IGNBRK 0x00000001
#define BRKINT 0x00000002
#define IGNPAR 0x00000004
#define PARMRK 0x00000008
#define INPCK 0x00000010
#define ISTRIP 0x00000020
#define INLCR 0x00000040
#define IGNCR 0x00000080
#define ICRNL 0x00000100
#define IXON 0x00000200
#define IXOFF 0x00000400
#define IXANY 0x00000800
#define IMAXBEL 0x00002000
#define IUTF8 0x00004000
#define OPOST 0x00000001
#define ONLCR 0x00000002
#define OXTABS 0x00000004
#define ONOEOT 0x00000008
#define OCRNL 0x00000010
#define ONOCR 0x00000020
#define ONLRET 0x00000040
#define OFILL 0x00000080
#define NLDLY 0x00000300
#define TABDLY 0x00000c04
#define CRDLY 0x00003000
#define FFDLY 0x00004000
#define BSDLY 0x00008000
#define VTDLY 0x00010000
#define OFDEL 0x00020000
#define CIGNORE 0x00000001
#define CSIZE 0x00000300
#define CS5 0x00000000
#define CS6 0x00000100
#define CS7 0x00000200
#define CS8 0x00000300
#define CSTOPB 0x00000400
#define CREAD 0x00000800
#define PARENB 0x00001000
#define PARODD 0x00002000
#define HUPCL 0x00004000
#define CLOCAL 0x00008000
#define CCTS_OFLOW 0x00010000
#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW)
#define CRTS_IFLOW 0x00020000
#define CDTR_IFLOW 0x00040000
#define CDSR_OFLOW 0x00080000
#define CCAR_OFLOW 0x00100000
#define MDMBUF 0x00100000
#define ECHOKE 0x00000001
#define ECHOE 0x00000002
#define ECHOK 0x00000004
#define ECHO 0x00000008
#define ECHONL 0x00000010
#define ECHOPRT 0x00000020
#define ECHOCTL 0x00000040
#define ISIG 0x00000080
#define ICANON 0x00000100
#define ALTWERASE 0x00000200
#define IEXTEN 0x00000400
#define EXTPROC 0x00000800
#define TOSTOP 0x00400000
#define FLUSHO 0x00800000
#define NOKERNINFO 0x02000000
#define PENDIN 0x20000000
#define NOFLSH 0x80000000
typedef unsigned long tcflag_t;
typedef unsigned char cc_t;
typedef unsigned long speed_t;
struct termios {
 tcflag_t c_iflag;
 tcflag_t c_oflag;
 tcflag_t c_cflag;
 tcflag_t c_lflag;
 cc_t c_cc[20];
 speed_t c_ispeed;
 speed_t c_ospeed;
};
typedef __uint64_t user_tcflag_t;
typedef __uint64_t user_speed_t;
struct user_termios {
 user_tcflag_t c_iflag;
 user_tcflag_t c_oflag;
 user_tcflag_t c_cflag;
 user_tcflag_t c_lflag;
 cc_t c_cc[20];
 user_speed_t c_ispeed __attribute((aligned(8)));
 user_speed_t c_ospeed;
};
struct termios32 {
 __uint32_t c_iflag;
 __uint32_t c_oflag;
 __uint32_t c_cflag;
 __uint32_t c_lflag;
 cc_t c_cc[20];
 __uint32_t c_ispeed;
 __uint32_t c_ospeed;
};
#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2
#define TCSASOFT 0x10
#define B0 0
#define B50 50
#define B75 75
#define B110 110
#define B134 134
#define B150 150
#define B200 200
#define B300 300
#define B600 600
#define B1200 1200
#define B1800 1800
#define B2400 2400
#define B4800 4800
#define B9600 9600
#define B19200 19200
#define B38400 38400
#define B7200 7200
#define B14400 14400
#define B28800 28800
#define B57600 57600
#define B76800 76800
#define B115200 115200
#define B230400 230400
#define EXTA 19200
#define EXTB 38400
#define _SYS_TTYDEFAULTS_H_ 
#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
#define TTYDEF_OFLAG (OPOST | ONLCR)
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
#define TTYDEF_SPEED (B9600)
#define CTRL(x) (x&037)
#define CEOF CTRL('d')
#define CEOL 0xff
#define CERASE 0177
#define CINTR CTRL('c')
#define CSTATUS CTRL('t')
#define CKILL CTRL('u')
#define CMIN 1
#define CQUIT 034
#define CSUSP CTRL('z')
#define CTIME 0
#define CDSUSP CTRL('y')
#define CSTART CTRL('q')
#define CSTOP CTRL('s')
#define CLNEXT CTRL('v')
#define CDISCARD CTRL('o')
#define CWERASE CTRL('w')
#define CREPRINT CTRL('r')
#define CEOT CEOF
#define CBRK CEOL
#define CRPRNT CREPRINT
#define CFLUSH CDISCARD


struct clist {
 int c_cc;
 int c_cn;
 u_char *c_cf;
 u_char *c_cl;
 u_char *c_cs;
 u_char *c_ce;
 u_char *c_cq;
};
#define TTYCLSIZE 1024
struct tty {
 lck_mtx_t t_lock;
 struct clist t_rawq;
 long t_rawcc;
 struct clist t_canq;
 long t_cancc;
 struct clist t_outq;
 long t_outcc;
 int t_line;
 dev_t t_dev;
 int t_state;
 int t_flags;
 int t_timeout;
 struct pgrp *t_pgrp;
 struct session *t_session;
 struct selinfo t_rsel;
 struct selinfo t_wsel;
 struct termios t_termios;
 struct winsize t_winsize;
 void (*t_oproc)(struct tty *);
 void (*t_stop)(struct tty *, int);
 int (*t_param)(struct tty *, struct termios *);
 void *t_sc;
 int t_column;
 int t_rocount, t_rocol;
 int t_hiwat;
 int t_lowat;
 int t_gen;
 void *t_iokit;
 int t_refcnt;
};
#define TTY_NULL (struct tty *)0
#define t_cc t_termios.c_cc
#define t_cflag t_termios.c_cflag
#define t_iflag t_termios.c_iflag
#define t_ispeed t_termios.c_ispeed
#define t_lflag t_termios.c_lflag
#define t_min t_termios.c_min
#define t_oflag t_termios.c_oflag
#define t_ospeed t_termios.c_ospeed
#define t_time t_termios.c_time
#define TTIPRI 25
#define TTOPRI 26
#define IBUFSIZ 384
#define OBUFSIZ 100
#define TTYHOG 1024
#define TTMAXHIWAT roundup(2048, CBSIZE)
#define TTMINHIWAT roundup(100, CBSIZE)
#define TTMAXLOWAT 256
#define TTMINLOWAT 32
#define TS_SO_OLOWAT 0x00001
#define TS_ASYNC 0x00002
#define TS_BUSY 0x00004
#define TS_CARR_ON 0x00008
#define TS_FLUSH 0x00010
#define TS_ISOPEN 0x00020
#define TS_TBLOCK 0x00040
#define TS_TIMEOUT 0x00080
#define TS_TTSTOP 0x00100
#define TS_XCLUDE 0x00400
#define TS_BKSL 0x00800
#define TS_CNTTB 0x01000
#define TS_ERASE 0x02000
#define TS_LNCH 0x04000
#define TS_TYPEN 0x08000
#define TS_LOCAL (TS_BKSL | TS_CNTTB | TS_ERASE | TS_LNCH | TS_TYPEN)
#define TS_CAN_BYPASS_L_RINT 0x010000
#define TS_CONNECTED 0x020000
#define TS_SNOOP 0x040000
#define TS_SO_OCOMPLETE 0x080000
#define TS_ZOMBIE 0x100000
#define TS_CAR_OFLOW 0x200000
#define TS_IOCTL_NOT_OK 0x1000000
#define ORDINARY 0
#define CONTROL 1
#define BACKSPACE 2
#define NEWLINE 3
#define TAB 4
#define VTAB 5
#define RETURN 6
struct speedtab {
 int sp_speed;
 int sp_code;
};
#define DMSET 0
#define DMBIS 1
#define DMBIC 2
#define DMGET 3
#define TTY_CHARMASK 0x000000ff
#define TTY_QUOTE 0x00000100
#define TTY_ERRORMASK 0xff000000
#define TTY_FE 0x01000000
#define TTY_PE 0x02000000
#define TTY_OE 0x04000000
#define TTY_BI 0x08000000
#define TSA_CARR_ON(tp) ((void *)&(tp)->t_rawq)
#define TSA_HUP_OR_INPUT(tp) ((void *)&(tp)->t_rawq.c_cf)
#define TSA_OCOMPLETE(tp) ((void *)&(tp)->t_outq.c_cl)
#define TSA_OLOWAT(tp) ((void *)&(tp)->t_outq)
#define TSA_PTC_READ(tp) ((void *)&(tp)->t_outq.c_cf)
#define TSA_PTC_WRITE(tp) ((void *)&(tp)->t_rawq.c_cl)
#define TSA_PTS_READ(tp) ((void *)&(tp)->t_canq)

int b_to_q(const u_char *cp, int cc, struct clist *q);
void catq(struct clist *from, struct clist *to);
void clist_init(void);
int getc(struct clist *q);
void ndflush(struct clist *q, int cc);
int ndqb(struct clist *q, int flag);
u_char *firstc (struct clist *clp, int *c);
u_char *nextc(struct clist *q, u_char *cp, int *c);
int putc(int c, struct clist *q);
int q_to_b(struct clist *q, u_char *cp, int cc);
int unputc(struct clist *q);
int clalloc(struct clist *clp, int size, int quot);
void clfree(struct clist *clp);
void cinit(void);
void clrbits(u_char *cp, int off, int len);
void tty_init(void);
int ttioctl_locked(struct tty *tp, u_long com, caddr_t data, int flag,
     struct proc *p);
int ttcompat(struct tty *tp, u_long com, caddr_t data, int flag,
     struct proc *p);
void tty_lock(struct tty *tp);
void tty_unlock(struct tty *tp);
void termioschars(struct termios *t);
int tputchar(int c, struct tty *tp);
int ttioctl(struct tty *tp, u_long com, caddr_t data, int flag,
     struct proc *p);
int ttread(struct tty *tp, struct uio *uio, int flag);
int ttyselect(struct tty *tp, int rw, void * wql, struct proc *p);
int ttselect(dev_t dev, int rw, void * wql, struct proc *p);
void ttsetwater(struct tty *tp);
int ttspeedtab(int speed, struct speedtab *table);
int ttstart(struct tty *tp);
void ttwakeup(struct tty *tp);
int ttwrite(struct tty *tp, struct uio *uio, int flag);
void ttwwakeup(struct tty *tp);
void ttyblock(struct tty *tp);
int ttycheckoutq(struct tty *tp, int wait);
int ttyclose(struct tty *tp);
void ttyflush(struct tty *tp, int rw);
void ttyinfo(struct tty *tp);
void ttyinfo_locked(struct tty *tp);
int ttyinput(int c, struct tty *tp);
int ttylclose(struct tty *tp, int flag);
int ttymodem(struct tty *tp, int flag);
int ttyopen(dev_t device, struct tty *tp);
int ttysleep(struct tty *tp,
     void *chan, int pri, const char *wmesg, int timeout);
int ttywait(struct tty *tp);
struct tty *ttymalloc(void);
void ttyfree(struct tty *);

#define _SYS_PROC_H_ 
#define _SYS_PARAM_H_ 
#define BSD 199506
#define BSD4_3 1
#define BSD4_4 1
#define NeXTBSD 1995064
#define NeXTBSD4_0 0
#define NULL __DARWIN_NULL
#define _SYS_SYSLIMITS_H_ 
#define ARG_MAX (256 * 1024)
#define CHILD_MAX 266
#define GID_MAX 2147483647U
#define LINK_MAX 32767
#define MAX_CANON 1024
#define MAX_INPUT 1024
#define NAME_MAX 255
#define NGROUPS_MAX 16
#define UID_MAX 2147483647U
#define OPEN_MAX 10240
#define PATH_MAX 1024
#define PIPE_BUF 512
#define BC_BASE_MAX 99
#define BC_DIM_MAX 2048
#define BC_SCALE_MAX 99
#define BC_STRING_MAX 1000
#define CHARCLASS_NAME_MAX 14
#define COLL_WEIGHTS_MAX 2
#define EQUIV_CLASS_MAX 2
#define EXPR_NEST_MAX 32
#define LINE_MAX 2048
#define RE_DUP_MAX 255
#define NZERO 0
#define MAXCOMLEN 16
#define MAXINTERP 64
#define MAXLOGNAME 255
#define MAXUPRC CHILD_MAX
#define NCARGS ARG_MAX
#define NGROUPS NGROUPS_MAX
#define NOFILE 256
#define NOGROUP 65535
#define MAXHOSTNAMELEN 256
#define MAXDOMNAMELEN 256
#define _BSD_MACHINE_PARAM_H_ 
#define _I386_PARAM_H_ 
#define ALIGNBYTES __DARWIN_ALIGNBYTES
#define ALIGN(p) __DARWIN_ALIGN(p)
#define NBPG 4096
#define PGOFSET (NBPG-1)
#define PGSHIFT 12
#define DEV_BSIZE 512
#define DEV_BSHIFT 9
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (128 * 1024)
#define CLSIZE 1
#define CLSIZELOG2 0
#define MSIZESHIFT 8
#define MSIZE (1 << MSIZESHIFT)
#define MCLSHIFT 11
#define MCLBYTES (1 << MCLSHIFT)
#define MBIGCLSHIFT 12
#define MBIGCLBYTES (1 << MBIGCLSHIFT)
#define M16KCLSHIFT 14
#define M16KCLBYTES (1 << M16KCLSHIFT)
#define MCLOFSET (MCLBYTES - 1)
#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES)
#define ctos(x) (x)
#define stoc(x) (x)
#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
#define dtob(x) ((x)<<DEV_BSHIFT)
#define ctob(x) ((x)<<PGSHIFT)
#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
#define btodb(bytes) ((unsigned)(bytes) >> DEV_BSHIFT)
#define dbtob(db) ((unsigned)(db) << DEV_BSHIFT)
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
#define STATUS_WORD(rpl,ipl) (((ipl) << 8) | (rpl))
#define USERMODE(x) (((x) & 3) == 3)
#define BASEPRI(x) (((x) & (255 << 8)) == 0)
#define DELAY(n) delay(n)
#define _I386_LIMITS_H_ 
#define _I386__LIMITS_H_ 
#define __DARWIN_CLK_TCK 100
#define CHAR_BIT 8
#define MB_LEN_MAX 6
#define CLK_TCK __DARWIN_CLK_TCK
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define UCHAR_MAX 255
#define CHAR_MAX 127
#define CHAR_MIN (-128)
#define USHRT_MAX 65535
#define SHRT_MAX 32767
#define SHRT_MIN (-32768)
#define UINT_MAX 0xffffffff
#define INT_MAX 2147483647
#define INT_MIN (-2147483647-1)
#define ULONG_MAX 0xffffffffffffffffUL
#define LONG_MAX 0x7fffffffffffffffL
#define LONG_MIN (-0x7fffffffffffffffL-1)
#define ULLONG_MAX 0xffffffffffffffffULL
#define LLONG_MAX 0x7fffffffffffffffLL
#define LLONG_MIN (-0x7fffffffffffffffLL-1)
#define LONG_BIT 64
#define SSIZE_MAX LONG_MAX
#define WORD_BIT 32
#define SIZE_T_MAX ULONG_MAX
#define UQUAD_MAX ULLONG_MAX
#define QUAD_MAX LLONG_MAX
#define QUAD_MIN LLONG_MIN
#define _SYS_ERRNO_H_ 
#define EPERM 1
#define ENOENT 2
#define ESRCH 3
#define EINTR 4
#define EIO 5
#define ENXIO 6
#define E2BIG 7
#define ENOEXEC 8
#define EBADF 9
#define ECHILD 10
#define EDEADLK 11
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
#define ENOTBLK 15
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
#define ENODEV 19
#define ENOTDIR 20
#define EISDIR 21
#define EINVAL 22
#define ENFILE 23
#define EMFILE 24
#define ENOTTY 25
#define ETXTBSY 26
#define EFBIG 27
#define ENOSPC 28
#define ESPIPE 29
#define EROFS 30
#define EMLINK 31
#define EPIPE 32
#define EDOM 33
#define ERANGE 34
#define EAGAIN 35
#define EWOULDBLOCK EAGAIN
#define EINPROGRESS 36
#define EALREADY 37
#define ENOTSOCK 38
#define EDESTADDRREQ 39
#define EMSGSIZE 40
#define EPROTOTYPE 41
#define ENOPROTOOPT 42
#define EPROTONOSUPPORT 43
#define ESOCKTNOSUPPORT 44
#define ENOTSUP 45
#define EPFNOSUPPORT 46
#define EAFNOSUPPORT 47
#define EADDRINUSE 48
#define EADDRNOTAVAIL 49
#define ENETDOWN 50
#define ENETUNREACH 51
#define ENETRESET 52
#define ECONNABORTED 53
#define ECONNRESET 54
#define ENOBUFS 55
#define EISCONN 56
#define ENOTCONN 57
#define ESHUTDOWN 58
#define ETOOMANYREFS 59
#define ETIMEDOUT 60
#define ECONNREFUSED 61
#define ELOOP 62
#define ENAMETOOLONG 63
#define EHOSTDOWN 64
#define EHOSTUNREACH 65
#define ENOTEMPTY 66
#define EPROCLIM 67
#define EUSERS 68
#define EDQUOT 69
#define ESTALE 70
#define EREMOTE 71
#define EBADRPC 72
#define ERPCMISMATCH 73
#define EPROGUNAVAIL 74
#define EPROGMISMATCH 75
#define EPROCUNAVAIL 76
#define ENOLCK 77
#define ENOSYS 78
#define EFTYPE 79
#define EAUTH 80
#define ENEEDAUTH 81
#define EPWROFF 82
#define EDEVERR 83
#define EOVERFLOW 84
#define EBADEXEC 85
#define EBADARCH 86
#define ESHLIBVERS 87
#define EBADMACHO 88
#define ECANCELED 89
#define EIDRM 90
#define ENOMSG 91
#define EILSEQ 92
#define ENOATTR 93
#define EBADMSG 94
#define EMULTIHOP 95
#define ENODATA 96
#define ENOLINK 97
#define ENOSR 98
#define ENOSTR 99
#define EPROTO 100
#define ETIME 101
#define EOPNOTSUPP 102
#define ENOPOLICY 103
#define ENOTRECOVERABLE 104
#define EOWNERDEAD 105
#define EQFULL 106
#define ELAST 106
#define ERESTART (-1)
#define EJUSTRETURN (-2)
#define ERECYCLE (-5)
#define EREDRIVEOPEN (-6)
#define EKEEPLOOKING (-7)
#define ERESERVEDNAME (-8)
#define ECVCERORR 256
#define ECVPERORR 512
#define _SYS_RESOURCE_H_ 
typedef __uint64_t rlim_t;
#define PRIO_PROCESS 0
#define PRIO_PGRP 1
#define PRIO_USER 2
#define PRIO_DARWIN_THREAD 3
#define PRIO_DARWIN_PROCESS 4
#define PRIO_MIN -20
#define PRIO_MAX 20
#define PRIO_DARWIN_BG 0x1000
#define PRIO_DARWIN_NONUI 0x1001
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
struct rusage {
 struct timeval ru_utime;
 struct timeval ru_stime;
 long ru_maxrss;
#define ru_first ru_ixrss
 long ru_ixrss;
 long ru_idrss;
 long ru_isrss;
 long ru_minflt;
 long ru_majflt;
 long ru_nswap;
 long ru_inblock;
 long ru_oublock;
 long ru_msgsnd;
 long ru_msgrcv;
 long ru_nsignals;
 long ru_nvcsw;
 long ru_nivcsw;
#define ru_last ru_nivcsw
};
#define RUSAGE_INFO_V0 0
#define RUSAGE_INFO_V1 1
#define RUSAGE_INFO_V2 2
#define RUSAGE_INFO_CURRENT RUSAGE_INFO_V2
typedef void *rusage_info_t;
struct rusage_info_v0 {
 uint8_t ri_uuid[16];
 uint64_t ri_user_time;
 uint64_t ri_system_time;
 uint64_t ri_pkg_idle_wkups;
 uint64_t ri_interrupt_wkups;
 uint64_t ri_pageins;
 uint64_t ri_wired_size;
 uint64_t ri_resident_size;
 uint64_t ri_phys_footprint;
 uint64_t ri_proc_start_abstime;
 uint64_t ri_proc_exit_abstime;
};
struct rusage_info_v1 {
 uint8_t ri_uuid[16];
 uint64_t ri_user_time;
 uint64_t ri_system_time;
 uint64_t ri_pkg_idle_wkups;
 uint64_t ri_interrupt_wkups;
 uint64_t ri_pageins;
 uint64_t ri_wired_size;
 uint64_t ri_resident_size;
 uint64_t ri_phys_footprint;
 uint64_t ri_proc_start_abstime;
 uint64_t ri_proc_exit_abstime;
 uint64_t ri_child_user_time;
 uint64_t ri_child_system_time;
 uint64_t ri_child_pkg_idle_wkups;
 uint64_t ri_child_interrupt_wkups;
 uint64_t ri_child_pageins;
 uint64_t ri_child_elapsed_abstime;
};
struct rusage_info_v2 {
 uint8_t ri_uuid[16];
 uint64_t ri_user_time;
 uint64_t ri_system_time;
 uint64_t ri_pkg_idle_wkups;
 uint64_t ri_interrupt_wkups;
 uint64_t ri_pageins;
 uint64_t ri_wired_size;
 uint64_t ri_resident_size;
 uint64_t ri_phys_footprint;
 uint64_t ri_proc_start_abstime;
 uint64_t ri_proc_exit_abstime;
 uint64_t ri_child_user_time;
 uint64_t ri_child_system_time;
 uint64_t ri_child_pkg_idle_wkups;
 uint64_t ri_child_interrupt_wkups;
 uint64_t ri_child_pageins;
 uint64_t ri_child_elapsed_abstime;
 uint64_t ri_diskio_bytesread;
 uint64_t ri_diskio_byteswritten;
};
struct rusage_superset {
 struct rusage ru;
 struct rusage_info_v2 ri;
};
struct rusage_info_child {
 uint64_t ri_child_user_time;
 uint64_t ri_child_system_time;
 uint64_t ri_child_pkg_idle_wkups;
 uint64_t ri_child_interrupt_wkups;
 uint64_t ri_child_pageins;
 uint64_t ri_child_elapsed_abstime;
};
struct rusage_info_diskiobytes {
 volatile uint64_t ri_bytesread __attribute__((aligned(8)));
 volatile uint64_t ri_byteswritten __attribute__((aligned(8)));
};
struct user64_rusage {
 struct user64_timeval ru_utime;
 struct user64_timeval ru_stime;
 user64_long_t ru_maxrss;
 user64_long_t ru_ixrss;
 user64_long_t ru_idrss;
 user64_long_t ru_isrss;
 user64_long_t ru_minflt;
 user64_long_t ru_majflt;
 user64_long_t ru_nswap;
 user64_long_t ru_inblock;
 user64_long_t ru_oublock;
 user64_long_t ru_msgsnd;
 user64_long_t ru_msgrcv;
 user64_long_t ru_nsignals;
 user64_long_t ru_nvcsw;
 user64_long_t ru_nivcsw;
};
struct user32_rusage {
 struct user32_timeval ru_utime;
 struct user32_timeval ru_stime;
 user32_long_t ru_maxrss;
 user32_long_t ru_ixrss;
 user32_long_t ru_idrss;
 user32_long_t ru_isrss;
 user32_long_t ru_minflt;
 user32_long_t ru_majflt;
 user32_long_t ru_nswap;
 user32_long_t ru_inblock;
 user32_long_t ru_oublock;
 user32_long_t ru_msgsnd;
 user32_long_t ru_msgrcv;
 user32_long_t ru_nsignals;
 user32_long_t ru_nvcsw;
 user32_long_t ru_nivcsw;
};
#define RLIM_INFINITY (((__uint64_t)1 << 63) - 1)
#define RLIM_SAVED_MAX RLIM_INFINITY
#define RLIM_SAVED_CUR RLIM_INFINITY
#define RLIMIT_CPU 0
#define RLIMIT_FSIZE 1
#define RLIMIT_DATA 2
#define RLIMIT_STACK 3
#define RLIMIT_CORE 4
#define RLIMIT_AS 5
#define RLIMIT_RSS RLIMIT_AS
#define RLIMIT_MEMLOCK 6
#define RLIMIT_NPROC 7
#define RLIMIT_NOFILE 8
#define RLIM_NLIMITS 9
#define _RLIMIT_POSIX_FLAG 0x1000
struct rlimit {
 rlim_t rlim_cur;
 rlim_t rlim_max;
};
#define RLIMIT_WAKEUPS_MONITOR 0x1
#define RLIMIT_CPU_USAGE_MONITOR 0x2
#define WAKEMON_ENABLE 0x01
#define WAKEMON_DISABLE 0x02
#define WAKEMON_GET_PARAMS 0x04
#define WAKEMON_SET_DEFAULTS 0x08
#define WAKEMON_MAKE_FATAL 0x10
#define CPUMON_MAKE_FATAL 0x1000
struct proc_rlimit_control_wakeupmon {
 uint32_t wm_flags;
 int32_t wm_rate;
};
#define IOPOL_TYPE_DISK 0
#define IOPOL_SCOPE_PROCESS 0
#define IOPOL_SCOPE_THREAD 1
#define IOPOL_SCOPE_DARWIN_BG 2
#define IOPOL_DEFAULT 0
#define IOPOL_IMPORTANT 1
#define IOPOL_PASSIVE 2
#define IOPOL_THROTTLE 3
#define IOPOL_UTILITY 4
#define IOPOL_STANDARD 5
#define IOPOL_APPLICATION IOPOL_STANDARD
#define IOPOL_NORMAL IOPOL_IMPORTANT
#define _SYS_UCRED_H_ 
#define _BSM_AUDIT_H 
#define AUDIT_RECORD_MAGIC 0x828a0f1b
#define MAX_AUDIT_RECORDS 20
#define MAXAUDITDATA (0x8000 - 1)
#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA
#define MIN_AUDIT_FILE_SIZE (512 * 1024)
#define AUDIT_HARD_LIMIT_FREE_BLOCKS 4
#define AUDIT_TRIGGER_MIN 1
#define AUDIT_TRIGGER_LOW_SPACE 1
#define AUDIT_TRIGGER_ROTATE_KERNEL 2
#define AUDIT_TRIGGER_READ_FILE 3
#define AUDIT_TRIGGER_CLOSE_AND_DIE 4
#define AUDIT_TRIGGER_NO_SPACE 5
#define AUDIT_TRIGGER_ROTATE_USER 6
#define AUDIT_TRIGGER_INITIALIZE 7
#define AUDIT_TRIGGER_EXPIRE_TRAILS 8
#define AUDIT_TRIGGER_MAX 8
#define AUDITDEV_FILENAME "audit"
#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME)
#define AU_DEFAUDITID (uid_t)(-1)
#define AU_DEFAUDITSID 0
#define AU_ASSIGN_ASID -1
#define AT_IPC_MSG ((u_char)1)
#define AT_IPC_SEM ((u_char)2)
#define AT_IPC_SHM ((u_char)3)
#define AUC_UNSET 0
#define AUC_AUDITING 1
#define AUC_NOAUDIT 2
#define AUC_DISABLED -1
#define A_OLDGETPOLICY 2
#define A_OLDSETPOLICY 3
#define A_GETKMASK 4
#define A_SETKMASK 5
#define A_OLDGETQCTRL 6
#define A_OLDSETQCTRL 7
#define A_GETCWD 8
#define A_GETCAR 9
#define A_GETSTAT 12
#define A_SETSTAT 13
#define A_SETUMASK 14
#define A_SETSMASK 15
#define A_OLDGETCOND 20
#define A_OLDSETCOND 21
#define A_GETCLASS 22
#define A_SETCLASS 23
#define A_GETPINFO 24
#define A_SETPMASK 25
#define A_SETFSIZE 26
#define A_GETFSIZE 27
#define A_GETPINFO_ADDR 28
#define A_GETKAUDIT 29
#define A_SETKAUDIT 30
#define A_SENDTRIGGER 31
#define A_GETSINFO_ADDR 32
#define A_GETPOLICY 33
#define A_SETPOLICY 34
#define A_GETQCTRL 35
#define A_SETQCTRL 36
#define A_GETCOND 37
#define A_SETCOND 38
#define A_GETSFLAGS 39
#define A_SETSFLAGS 40
#define AUDIT_CNT 0x0001
#define AUDIT_AHLT 0x0002
#define AUDIT_ARGV 0x0004
#define AUDIT_ARGE 0x0008
#define AUDIT_SEQ 0x0010
#define AUDIT_WINDATA 0x0020
#define AUDIT_USER 0x0040
#define AUDIT_GROUP 0x0080
#define AUDIT_TRAIL 0x0100
#define AUDIT_PATH 0x0200
#define AUDIT_SCNT 0x0400
#define AUDIT_PUBLIC 0x0800
#define AUDIT_ZONENAME 0x1000
#define AUDIT_PERZONE 0x2000
#define AQ_HIWATER 100
#define AQ_MAXHIGH 10000
#define AQ_LOWATER 10
#define AQ_BUFSZ MAXAUDITDATA
#define AQ_MAXBUFSZ 1048576
#define AU_FS_MINFREE 20
#define AU_IPv4 4
#define AU_IPv6 16

typedef uid_t au_id_t;
typedef pid_t au_asid_t;
typedef u_int16_t au_event_t;
typedef u_int16_t au_emod_t;
typedef u_int32_t au_class_t;
typedef u_int64_t au_asflgs_t __attribute__ ((aligned (8)));
struct au_tid {
 dev_t port;
 u_int32_t machine;
};
typedef struct au_tid au_tid_t;
struct au_tid_addr {
 dev_t at_port;
 u_int32_t at_type;
 u_int32_t at_addr[4];
};
typedef struct au_tid_addr au_tid_addr_t;
struct au_mask {
 unsigned int am_success;
 unsigned int am_failure;
};
typedef struct au_mask au_mask_t;
struct auditinfo {
 au_id_t ai_auid;
 au_mask_t ai_mask;
 au_tid_t ai_termid;
 au_asid_t ai_asid;
};
typedef struct auditinfo auditinfo_t;
struct auditinfo_addr {
 au_id_t ai_auid;
 au_mask_t ai_mask;
 au_tid_addr_t ai_termid;
 au_asid_t ai_asid;
 au_asflgs_t ai_flags;
};
typedef struct auditinfo_addr auditinfo_addr_t;
struct auditpinfo {
 pid_t ap_pid;
 au_id_t ap_auid;
 au_mask_t ap_mask;
 au_tid_t ap_termid;
 au_asid_t ap_asid;
};
typedef struct auditpinfo auditpinfo_t;
struct auditpinfo_addr {
 pid_t ap_pid;
 au_id_t ap_auid;
 au_mask_t ap_mask;
 au_tid_addr_t ap_termid;
 au_asid_t ap_asid;
 au_asflgs_t ap_flags;
};
typedef struct auditpinfo_addr auditpinfo_addr_t;
struct au_session {
 auditinfo_addr_t *as_aia_p;
 au_mask_t as_mask;
};
typedef struct au_session au_session_t;
typedef struct au_token token_t;
struct au_qctrl {
 int aq_hiwater;
 int aq_lowater;
 int aq_bufsz;
 int aq_delay;
 int aq_minfree;
};
typedef struct au_qctrl au_qctrl_t;
struct audit_stat {
 unsigned int as_version;
 unsigned int as_numevent;
 int as_generated;
 int as_nonattrib;
 int as_kernel;
 int as_audit;
 int as_auditctl;
 int as_enqueue;
 int as_written;
 int as_wblocked;
 int as_rblocked;
 int as_dropped;
 int as_totalsize;
 unsigned int as_memused;
};
typedef struct audit_stat au_stat_t;
struct audit_fstat {
 u_int64_t af_filesz;
 u_int64_t af_currsz;
};
typedef struct audit_fstat au_fstat_t;
struct au_evclass_map {
 au_event_t ec_number;
 au_class_t ec_class;
};
typedef struct au_evclass_map au_evclass_map_t;

struct label;
struct ucred {
 struct { struct ucred *tqe_next; struct ucred **tqe_prev; } cr_link;
 u_long cr_ref;
struct posix_cred {
 uid_t cr_uid;
 uid_t cr_ruid;
 uid_t cr_svuid;
 short cr_ngroups;
 gid_t cr_groups[16];
 gid_t cr_rgid;
 gid_t cr_svgid;
 uid_t cr_gmuid;
 int cr_flags;
} cr_posix;
 struct label *cr_label;
 struct au_session cr_audit;
};
#define _KAUTH_CRED_T 
typedef struct ucred *kauth_cred_t;
typedef struct posix_cred *posix_cred_t;
#define CRF_NOMEMBERD 0x00000001
#define CRF_MAC_ENFORCE 0x00000002
struct xucred {
        u_int cr_version;
        uid_t cr_uid;
        short cr_ngroups;
        gid_t cr_groups[16];
};
#define XUCRED_VERSION 0
#define cr_gid cr_groups[0]
#define NOCRED ((kauth_cred_t )0)
#define FSCRED ((kauth_cred_t )-1)
#define IS_VALID_CRED(_cr) ((_cr) != NOCRED && (_cr) != FSCRED)

int crcmp(kauth_cred_t cr1, kauth_cred_t cr2);
int suser(kauth_cred_t cred, u_short *acflag);
int set_security_token(struct proc * p);
void cru2x(kauth_cred_t cr, struct xucred *xcr);

#define _SYS_SIGNAL_H_ 
#define __DARWIN_NSIG 32
#define NSIG __DARWIN_NSIG
#define _BSD_MACHINE_SIGNAL_H_ 
#define _I386_SIGNAL_H_ 1
typedef int sig_atomic_t;
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT SIGABRT
#define SIGEMT 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGBUS 10
#define SIGSEGV 11
#define SIGSYS 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGURG 16
#define SIGSTOP 17
#define SIGTSTP 18
#define SIGCONT 19
#define SIGCHLD 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGIO 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGINFO 29
#define SIGUSR1 30
#define SIGUSR2 31
#define SIG_DFL (void (*)( ))0
#define SIG_IGN (void (*)( ))1
#define SIG_HOLD (void (*)( ))5
#define SIG_ERR ((void (*)( ))-1)
#define __I386_MCONTEXT_H_ 
#define _STRUCT_MCONTEXT32 struct mcontext32
struct mcontext32
{
 struct i386_exception_state es;
 struct i386_thread_state ss;
 struct i386_float_state fs;
};
#define _STRUCT_MCONTEXT_AVX32 struct mcontext_avx32
struct mcontext_avx32
{
 struct i386_exception_state es;
 struct i386_thread_state ss;
 struct i386_avx_state fs;
};
#define _STRUCT_MCONTEXT64 struct mcontext64
struct mcontext64
{
 struct x86_exception_state64 es;
 struct x86_thread_state64 ss;
 struct x86_float_state64 fs;
};
#define _STRUCT_MCONTEXT_AVX64 struct mcontext_avx64
struct mcontext_avx64
{
 struct x86_exception_state64 es;
 struct x86_thread_state64 ss;
 struct x86_avx_state64 fs;
};
#define _MCONTEXT_T 
typedef struct mcontext64 *mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
#define I386_MCONTEXT_SIZE sizeof(struct mcontext)
#define _STRUCT_SIGALTSTACK struct sigaltstack
struct sigaltstack
{
 void *ss_sp;
 __darwin_size_t ss_size;
 int ss_flags;
};
typedef struct sigaltstack stack_t;
#define _STRUCT_UCONTEXT struct ucontext
struct ucontext
{
 int uc_onstack;
 __darwin_sigset_t uc_sigmask;
 struct sigaltstack uc_stack;
 struct ucontext *uc_link;
 __darwin_size_t uc_mcsize;
 struct mcontext64 *uc_mcontext;
};
typedef struct ucontext ucontext_t;
union sigval {
 int sival_int;
 void *sival_ptr;
};
#define SIGEV_NONE 0
#define SIGEV_SIGNAL 1
#define SIGEV_THREAD 3
struct sigevent {
 int sigev_notify;
 int sigev_signo;
 union sigval sigev_value;
 void (*sigev_notify_function)(union sigval);
 pthread_attr_t *sigev_notify_attributes;
};
union user64_sigval {
 struct {
  uint32_t pad;
  int32_t sival_int;
 } size_equivalent;
 user64_addr_t sival_ptr;
};
union user32_sigval {
 int32_t sival_int;
 user32_addr_t sival_ptr;
};
union user_sigval {
 struct {
  uint32_t pad;
  int32_t sival_int;
 } size_equivalent;
 user_addr_t sival_ptr;
};
struct user64_sigevent {
 int sigev_notify;
 int sigev_signo;
 union user64_sigval sigev_value;
 user64_addr_t sigev_notify_function;
 user64_addr_t sigev_notify_attributes;
};
struct user32_sigevent {
 int sigev_notify;
 int sigev_signo;
 union user32_sigval sigev_value;
 user32_addr_t sigev_notify_function;
 user32_addr_t sigev_notify_attributes;
};
struct user_sigevent {
 int sigev_notify;
 int sigev_signo;
 union user_sigval sigev_value;
 user_addr_t sigev_notify_function;
 user_addr_t sigev_notify_attributes;
};
typedef struct __siginfo {
 int si_signo;
 int si_errno;
 int si_code;
 pid_t si_pid;
 uid_t si_uid;
 int si_status;
 void *si_addr;
 union sigval si_value;
 long si_band;
 unsigned long __pad[7];
} siginfo_t;
typedef struct user_siginfo {
 int si_signo;
 int si_errno;
 int si_code;
 pid_t si_pid;
 uid_t si_uid;
 int si_status;
 user_addr_t si_addr;
 union user_sigval si_value;
 user_long_t si_band;
 user_ulong_t pad[7];
} user_siginfo_t;
typedef struct user64_siginfo {
 int si_signo;
 int si_errno;
 int si_code;
 pid_t si_pid;
 uid_t si_uid;
 int si_status;
 user64_addr_t si_addr;
 union user64_sigval si_value;
 user64_long_t si_band;
 user64_ulong_t __pad[7];
} user64_siginfo_t;
typedef struct user32_siginfo {
 int si_signo;
 int si_errno;
 int si_code;
 pid_t si_pid;
 uid_t si_uid;
 int si_status;
 user32_addr_t si_addr;
 union user32_sigval si_value;
 user32_long_t si_band;
 user32_ulong_t __pad[7];
} user32_siginfo_t;
void siginfo_user_to_user32(user_siginfo_t *, user32_siginfo_t *);
void siginfo_user_to_user64(user_siginfo_t *, user64_siginfo_t *);
#define ILL_NOOP 0
#define ILL_ILLOPC 1
#define ILL_ILLTRP 2
#define ILL_PRVOPC 3
#define ILL_ILLOPN 4
#define ILL_ILLADR 5
#define ILL_PRVREG 6
#define ILL_COPROC 7
#define ILL_BADSTK 8
#define FPE_NOOP 0
#define FPE_FLTDIV 1
#define FPE_FLTOVF 2
#define FPE_FLTUND 3
#define FPE_FLTRES 4
#define FPE_FLTINV 5
#define FPE_FLTSUB 6
#define FPE_INTDIV 7
#define FPE_INTOVF 8
#define SEGV_NOOP 0
#define SEGV_MAPERR 1
#define SEGV_ACCERR 2
#define BUS_NOOP 0
#define BUS_ADRALN 1
#define BUS_ADRERR 2
#define BUS_OBJERR 3
#define TRAP_BRKPT 1
#define TRAP_TRACE 2
#define CLD_NOOP 0
#define CLD_EXITED 1
#define CLD_KILLED 2
#define CLD_DUMPED 3
#define CLD_TRAPPED 4
#define CLD_STOPPED 5
#define CLD_CONTINUED 6
#define POLL_IN 1
#define POLL_OUT 2
#define POLL_MSG 3
#define POLL_ERR 4
#define POLL_PRI 5
#define POLL_HUP 6
union __sigaction_u {
 void (*__sa_handler)(int);
 void (*__sa_sigaction)(int, struct __siginfo *,
         void *);
};
struct __sigaction {
 union __sigaction_u __sigaction_u;
 void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
 sigset_t sa_mask;
 int sa_flags;
};
struct sigaction {
 union __sigaction_u __sigaction_u;
 sigset_t sa_mask;
 int sa_flags;
};
union __user32_sigaction_u {
 user32_addr_t __sa_handler;
 user32_addr_t __sa_sigaction;
};
struct user32_sigaction {
 union __user32_sigaction_u __sigaction_u;
 sigset_t sa_mask;
 int sa_flags;
};
struct __user32_sigaction {
 union __user32_sigaction_u __sigaction_u;
 user32_addr_t sa_tramp;
 sigset_t sa_mask;
 int sa_flags;
};
union __user64_sigaction_u {
 user64_addr_t __sa_handler;
 user64_addr_t __sa_sigaction;
};
struct user64_sigaction {
 union __user64_sigaction_u __sigaction_u;
 sigset_t sa_mask;
 int sa_flags;
};
struct __user64_sigaction {
 union __user64_sigaction_u __sigaction_u;
 user64_addr_t sa_tramp;
 sigset_t sa_mask;
 int sa_flags;
};
union __kern_sigaction_u {
 user_addr_t __sa_handler;
 user_addr_t __sa_sigaction;
};
struct kern_sigaction {
 union __kern_sigaction_u __sigaction_u;
 sigset_t sa_mask;
 int sa_flags;
};
struct __kern_sigaction {
 union __kern_sigaction_u __sigaction_u;
 user_addr_t sa_tramp;
 sigset_t sa_mask;
 int sa_flags;
};
#undef SIG_DFL
#undef SIG_IGN
#undef SIG_ERR
#define SIG_DFL ((user_addr_t)0LL)
#define SIG_IGN ((user_addr_t)1LL)
#define SIG_ERR ((user_addr_t)-1LL)
#define sa_handler __sigaction_u.__sa_handler
#define sa_sigaction __sigaction_u.__sa_sigaction
#define SA_ONSTACK 0x0001
#define SA_RESTART 0x0002
#define SA_DISABLE 0x0004
#define SA_RESETHAND 0x0004
#define SA_NOCLDSTOP 0x0008
#define SA_NODEFER 0x0010
#define SA_NOCLDWAIT 0x0020
#define SA_SIGINFO 0x0040
#define SA_USERTRAMP 0x0100
#define SA_64REGSET 0x0200
#define SA_USERSPACE_MASK (SA_ONSTACK | SA_RESTART | SA_RESETHAND | SA_NOCLDSTOP | SA_NODEFER | SA_NOCLDWAIT | SA_SIGINFO)
#define SIG_BLOCK 1
#define SIG_UNBLOCK 2
#define SIG_SETMASK 3
#define SI_USER 0x10001
#define SI_QUEUE 0x10002
#define SI_TIMER 0x10003
#define SI_ASYNCIO 0x10004
#define SI_MESGQ 0x10005
typedef void (*sig_t)(int);
struct user32_sigaltstack {
 user32_addr_t ss_sp;
 user32_size_t ss_size;
 int ss_flags;
};
struct user64_sigaltstack {
 user64_addr_t ss_sp;
 user64_size_t ss_size;
 int ss_flags;
};
struct kern_sigaltstack {
 user_addr_t ss_sp;
 user_size_t ss_size;
 int ss_flags;
};
#define SS_ONSTACK 0x0001
#define SS_DISABLE 0x0004
#define MINSIGSTKSZ 32768
#define SIGSTKSZ 131072
struct sigvec {
 void (*sv_handler)(int);
 int sv_mask;
 int sv_flags;
};
#define SV_ONSTACK SA_ONSTACK
#define SV_INTERRUPT SA_RESTART
#define SV_RESETHAND SA_RESETHAND
#define SV_NODEFER SA_NODEFER
#define SV_NOCLDSTOP SA_NOCLDSTOP
#define SV_SIGINFO SA_SIGINFO
#define sv_onstack sv_flags
struct sigstack {
 char *ss_sp;
 int ss_onstack;
};
#define sigmask(m) (1 << ((m)-1))
#define threadmask (sigmask(SIGILL)|sigmask(SIGTRAP)| sigmask(SIGIOT)|sigmask(SIGEMT)| sigmask(SIGFPE)|sigmask(SIGBUS)| sigmask(SIGSEGV)|sigmask(SIGSYS)| sigmask(SIGPIPE))
#define workq_threadmask (threadmask | sigcantmask)
#define execmask (sigmask(SIGHUP)|sigmask(SIGINT)| sigmask(SIGQUIT)|sigmask(SIGKILL)| sigmask(SIGTERM)|sigmask(SIGSTOP)| sigmask(SIGTSTP)|sigmask(SIGCONT)| sigmask(SIGTTIN)|sigmask(SIGTTOU)| sigmask(SIGUSR1)|sigmask(SIGUSR2))
#define BADSIG SIG_ERR

void (*signal(int, void (*)(int)))(int);

#define PSWP 0
#define PVM 4
#define PINOD 8
#define PRIBIO 16
#define PVFS 20
#define PZERO 22
#define PSOCK 24
#define PWAIT 32
#define PLOCK 36
#define PPAUSE 40
#define PUSER 50
#define MAXPRI 127
#define PRIMASK 0x0ff
#define PCATCH 0x100
#define PTTYBLOCK 0x200
#define PDROP 0x400
#define PSPIN 0x800
#define NBPW sizeof(int)
#define CMASK 022
#define NODEV (dev_t)(-1)
#define CLBYTES (CLSIZE*NBPG)
#define CLOFSET (CLSIZE*NBPG-1)
#define claligned(x) ((((int)(x))&CLOFSET)==0)
#define CLOFF CLOFSET
#define CLSHIFT (PGSHIFT+CLSIZELOG2)
#define clbase(i) (i)
#define clrnd(i) (i)
#define CBLOCK 64
#define CBQSIZE (CBLOCK/NBBY)
#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
#define CROUND (CBLOCK - 1)
#define MAXBSIZE (256 * 4096)
#define MAXPHYSIO MAXPHYS
#define MAXFRAG 8
#define MAXPHYSIO_WIRED (16 * 1024 * 1024)
#define MAXPATHLEN PATH_MAX
#define MAXSYMLINKS 32
#define setbit(a,i) (((char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY))
#define clrbit(a,i) (((char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY)))
#define isset(a,i) (((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY)))
#define isclr(a,i) ((((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
#define roundup(x,y) ((((x) % (y)) == 0) ? (x) : ((x) + ((y) - ((x) % (y)))))
#define powerof2(x) ((((x)-1)&(x))==0)
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MINBUCKET 4
#define MAXALLOCSAVE (2 * CLBYTES)
#define FSHIFT 11
#define FSCALE (1<<FSHIFT)
struct session;
struct pgrp;
struct proc;
struct extern_proc {
 union {
  struct {
   struct proc *__p_forw;
   struct proc *__p_back;
  } p_st1;
  struct timeval __p_starttime;
 } p_un;
#define p_forw p_un.p_st1.__p_forw
#define p_back p_un.p_st1.__p_back
#define p_starttime p_un.__p_starttime
 struct vmspace *p_vmspace;
 struct sigacts *p_sigacts;
 int p_flag;
 char p_stat;
 pid_t p_pid;
 pid_t p_oppid;
 int p_dupfd;
 caddr_t user_stack;
 void *exit_thread;
 int p_debugger;
 boolean_t sigwait;
 u_int p_estcpu;
 int p_cpticks;
 fixpt_t p_pctcpu;
 void *p_wchan;
 char *p_wmesg;
 u_int p_swtime;
 u_int p_slptime;
 struct itimerval p_realtimer;
 struct timeval p_rtime;
 u_quad_t p_uticks;
 u_quad_t p_sticks;
 u_quad_t p_iticks;
 int p_traceflag;
 struct vnode *p_tracep;
 int p_siglist;
 struct vnode *p_textvp;
 int p_holdcnt;
 sigset_t p_sigmask;
 sigset_t p_sigignore;
 sigset_t p_sigcatch;
 u_char p_priority;
 u_char p_usrpri;
 char p_nice;
 char p_comm[16 +1];
 struct pgrp *p_pgrp;
 struct user *p_addr;
 u_short p_xstat;
 u_short p_acflag;
 struct rusage *p_ru;
};
#define SIDL 1
#define SRUN 2
#define SSLEEP 3
#define SSTOP 4
#define SZOMB 5
#define P_ADVLOCK 0x00000001
#define P_CONTROLT 0x00000002
#define P_LP64 0x00000004
#define P_NOCLDSTOP 0x00000008
#define P_PPWAIT 0x00000010
#define P_PROFIL 0x00000020
#define P_SELECT 0x00000040
#define P_CONTINUED 0x00000080
#define P_SUGID 0x00000100
#define P_SYSTEM 0x00000200
#define P_TIMEOUT 0x00000400
#define P_TRACED 0x00000800
#define P_DISABLE_ASLR 0x00001000
#define P_WEXIT 0x00002000
#define P_EXEC 0x00004000
#define P_OWEUPC 0x00008000
#define P_AFFINITY 0x00010000
#define P_TRANSLATED 0x00020000
#define P_CLASSIC P_TRANSLATED
#define P_DELAYIDLESLEEP 0x00040000
#define P_CHECKOPENEVT 0x00080000
#define P_DEPENDENCY_CAPABLE 0x00100000
#define P_REBOOT 0x00200000
#define P_TBE 0x00400000
#define P_RESV7 0x00800000
#define P_THCWD 0x01000000
#define P_RESV9 0x02000000
#define P_RESV10 0x04000000
#define P_RESV11 0x08000000
#define P_NOSHLIB 0x10000000
#define P_FORCEQUOTA 0x20000000
#define P_NOCLDWAIT 0x40000000
#define P_NOREMOTEHANG 0x80000000
#define P_INMEM 0
#define P_NOSWAP 0
#define P_PHYSIO 0
#define P_FSTRACE 0
#define P_SSTEP 0
#define P_DIRTY_TRACK 0x00000001
#define P_DIRTY_ALLOW_IDLE_EXIT 0x00000002
#define P_DIRTY_DEFER 0x00000004
#define P_DIRTY 0x00000008
#define P_DIRTY_SHUTDOWN 0x00000010
#define P_DIRTY_TERMINATED 0x00000020
#define P_DIRTY_BUSY 0x00000040
#define P_DIRTY_MARKED 0x00000080
#define P_DIRTY_DEFER_IN_PROGRESS 0x00000100
#define P_DIRTY_IS_DIRTY (P_DIRTY | P_DIRTY_SHUTDOWN)
#define P_DIRTY_IDLE_EXIT_ENABLED (P_DIRTY_TRACK|P_DIRTY_ALLOW_IDLE_EXIT)

extern proc_t kernproc;
extern int proc_is_classic(proc_t p);
proc_t current_proc_EXTERNAL(void);
extern int msleep(void *chan, lck_mtx_t *mtx, int pri, const char *wmesg, struct timespec * ts );
extern void wakeup(void *chan);
extern void wakeup_one(caddr_t chan);
extern int proc_selfpid(void);
extern int proc_selfppid(void);
extern void proc_signal(int pid, int signum);
extern int proc_issignal(int pid, sigset_t mask);
extern int proc_isinferior(int pid1, int pid2);
void proc_name(int pid, char * buf, int size);
void proc_selfname(char * buf, int size);
extern proc_t proc_find(int pid);
extern proc_t proc_self(void);
extern int proc_rele(proc_t p);
extern int proc_pid(proc_t);
extern int proc_ppid(proc_t);
extern int proc_noremotehang(proc_t);
extern int proc_forcequota(proc_t);
extern int proc_is64bit(proc_t);
extern int proc_exiting(proc_t);
int proc_suser(proc_t p);
kauth_cred_t proc_ucred(proc_t p);
extern int proc_tbe(proc_t);
pid_t proc_selfpgrpid(void);
pid_t proc_pgrpid(proc_t);
void bsd_set_dependency_capable(task_t task);
extern int IS_64BIT_PROCESS(proc_t);
extern int tsleep(void *chan, int pri, const char *wmesg, int timo);
extern int msleep1(void *chan, lck_mtx_t *mtx, int pri, const char *wmesg, u_int64_t timo);
task_t proc_task(proc_t);
extern int proc_pidversion(proc_t);
extern int proc_getcdhash(proc_t, unsigned char *);
extern int proc_pidbackgrounded(pid_t pid, uint32_t* state);
extern uint64_t proc_uniqueid(proc_t);
extern uint64_t proc_puniqueid(proc_t);
extern void proc_getexecutableuuid(proc_t, unsigned char *, unsigned long);
extern uint64_t proc_was_throttled(proc_t);
extern uint64_t proc_did_throttle(proc_t);


#define _LIBKERN_LIBKERN_H_ 
#define __STDARG_H 
typedef __builtin_va_list va_list;
#define _VA_LIST 
#define va_start(ap,param) __builtin_va_start(ap, param)
#define va_end(ap) __builtin_va_end(ap)
#define va_arg(ap,type) __builtin_va_arg(ap, type)
#define __va_copy(d,s) __builtin_va_copy(d,s)
#define va_copy(dest,src) __builtin_va_copy(dest, src)
#define __GNUC_VA_LIST 1
typedef __builtin_va_list __gnuc_va_list;
extern u_char const bcd2bin_data[];
extern u_char const bin2bcd_data[];
#define bcd2bin(bcd) (bcd2bin_data[bcd])
#define bin2bcd(bin) (bin2bcd_data[bin])
extern char const hex2ascii_data[];
#define hex2ascii(hex) (hex2ascii_data[hex])

static inline int
imax(int a, int b)
{
 return (a > b ? a : b);
}
static inline int
imin(int a, int b)
{
 return (a < b ? a : b);
}
static inline long
lmax(long a, long b)
{
 return (a > b ? a : b);
}
static inline long
lmin(long a, long b)
{
 return (a < b ? a : b);
}
static inline u_int
max(u_int a, u_int b)
{
 return (a > b ? a : b);
}
static inline u_int
min(u_int a, u_int b)
{
 return (a < b ? a : b);
}
static inline u_int32_t
ulmax(u_int32_t a, u_int32_t b)
{
 return (a > b ? a : b);
}
static inline u_int32_t
ulmin(u_int32_t a, u_int32_t b)
{
 return (a < b ? a : b);
}
extern int ffs(int);
extern u_int32_t random(void);
extern int scanc(u_int, u_char *, const u_char *, int);
extern int skpc(int, int, char *);
extern long strtol(const char*, char **, int);
extern u_long strtoul(const char *, char **, int);
extern quad_t strtoq(const char *, char **, int);
extern u_quad_t strtouq(const char *, char **, int);
extern char *strsep(char **, const char *);
extern void *memchr(const void *, int, size_t);
int snprintf(char *, size_t, const char *, ...) __attribute__((__format__ (__printf__, 3, 4)));
int sprintf(char *bufp, const char *, ...) __attribute__((deprecated));
int sscanf(const char *, char const *, ...) __attribute__((__format__ (__scanf__, 2, 3)));
int printf(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));
int _consume_printf_args(int, ...);
uint32_t crc32(uint32_t crc, const void *bufp, size_t len);
int copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done);
int copyinstr(const user_addr_t uaddr, void *kaddr, size_t len, size_t *done);
int copyoutstr(const void *kaddr, user_addr_t udaddr, size_t len, size_t *done);
int copyin(const user_addr_t uaddr, void *kaddr, size_t len);
int copyout(const void *kaddr, user_addr_t udaddr, size_t len);
int vsscanf(const char *, char const *, va_list);
extern int vprintf(const char *, va_list);
extern int vsnprintf(char *, size_t, const char *, va_list);
extern int vsprintf(char *bufp, const char *, va_list) __attribute__((deprecated));
extern void invalidate_icache(vm_offset_t, unsigned, int);
extern void flush_dcache(vm_offset_t, unsigned, int);
extern void invalidate_icache64(addr64_t, unsigned, int);
extern void flush_dcache64(addr64_t, unsigned, int);
static __inline__ unsigned int
clz(unsigned int num)
{
 return num?__builtin_clz(num):__builtin_clz(0);
}

#define _KERN_DEBUG_H_ 
#define _UUID_UUID_H 
#define _UUID_T 
typedef __darwin_uuid_t uuid_t;
#define _UUID_STRING_T 
typedef __darwin_uuid_string_t uuid_string_t;
#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
void uuid_clear(uuid_t uu);
int uuid_compare(const uuid_t uu1, const uuid_t uu2);
void uuid_copy(uuid_t dst, const uuid_t src);
void uuid_generate(uuid_t out);
void uuid_generate_random(uuid_t out);
void uuid_generate_time(uuid_t out);
int uuid_is_null(const uuid_t uu);
int uuid_parse(const uuid_string_t in, uuid_t uu);
void uuid_unparse(const uuid_t uu, uuid_string_t out);
void uuid_unparse_lower(const uuid_t uu, uuid_string_t out);
void uuid_unparse_upper(const uuid_t uu, uuid_string_t out);
struct thread_snapshot {
 uint32_t snapshot_magic;
 uint32_t nkern_frames;
 uint32_t nuser_frames;
 uint64_t wait_event;
 uint64_t continuation;
 uint64_t thread_id;
 uint64_t user_time;
 uint64_t system_time;
 int32_t state;
 int32_t priority;
 int32_t sched_pri;
 int32_t sched_flags;
 char ss_flags;
} __attribute__ ((packed));
struct task_snapshot {
 uint32_t snapshot_magic;
 int32_t pid;
 uint64_t uniqueid;
 uint64_t user_time_in_terminated_threads;
 uint64_t system_time_in_terminated_threads;
 uint8_t shared_cache_identifier[16];
 uint64_t shared_cache_slide;
 uint32_t nloadinfos;
 int suspend_count;
 int task_size;
 int faults;
 int pageins;
 int cow_faults;
 uint32_t ss_flags;
 char p_comm[17];
 uint32_t was_throttled;
 uint32_t did_throttle;
 uint32_t latency_qos;
} __attribute__ ((packed));
struct micro_snapshot {
 uint32_t snapshot_magic;
 uint32_t ms_cpu;
 uint64_t ms_time;
 uint64_t ms_time_microsecs;
 uint8_t ms_flags;
 uint16_t ms_opaque_flags;
} __attribute__ ((packed));
struct mem_and_io_snapshot {
 uint32_t snapshot_magic;
 uint32_t free_pages;
 uint32_t active_pages;
 uint32_t inactive_pages;
 uint32_t purgeable_pages;
 uint32_t wired_pages;
 uint32_t speculative_pages;
 uint32_t throttled_pages;
 uint32_t filebacked_pages;
 uint32_t compressions;
 uint32_t decompressions;
 uint32_t compressor_size;
 int busy_buffer_count;
 uint32_t pages_wanted;
 uint32_t pages_reclaimed;
 uint8_t pages_wanted_reclaimed_valid;
} __attribute__((packed));
struct stack_snapshot_frame32 {
 uint32_t lr;
    uint32_t sp;
};
struct stack_snapshot_frame64 {
    uint64_t lr;
    uint64_t sp;
};
struct _dyld_cache_header
{
    char magic[16];
    uint32_t mappingOffset;
    uint32_t mappingCount;
    uint32_t imagesOffset;
    uint32_t imagesCount;
    uint64_t dyldBaseAddress;
    uint64_t codeSignatureOffset;
    uint64_t codeSignatureSize;
    uint64_t slideInfoOffset;
    uint64_t slideInfoSize;
    uint64_t localSymbolsOffset;
    uint64_t localSymbolsSize;
    uint8_t uuid[16];
};
struct dyld_uuid_info_32 {
    uint32_t imageLoadAddress;
 uuid_t imageUUID;
};
struct dyld_uuid_info_64 {
    uint64_t imageLoadAddress;
    uuid_t imageUUID;
};
enum micro_snapshot_flags {
 kInterruptRecord = 0x1,
 kTimerArmingRecord = 0x2,
 kUserMode = 0x4,
};
enum generic_snapshot_flags {
 kUser64_p = 0x1,
 kKernel64_p = 0x2
};
 enum task_snapshot_flags {
 kTaskRsrcFlagged = 0x4,
  kTerminatedSnapshot = 0x8,
 kPidSuspended = 0x10,
 kFrozen = 0x20,
 kTaskDarwinBG = 0x40,
 kTaskExtDarwinBG = 0x80,
 kTaskVisVisible = 0x100,
 kTaskVisNonvisible = 0x200,
  kTaskIsForeground = 0x400,
  kTaskIsBoosted = 0x800,
 kTaskIsSuppressed = 0x1000,
 kTaskIsTimerThrottled = 0x2000
 };
enum thread_snapshot_flags {
 kHasDispatchSerial = 0x4,
 kStacksPCOnly = 0x8,
 kThreadDarwinBG = 0x10
};
#define VM_PRESSURE_TIME_WINDOW 5
enum {
 STACKSHOT_GET_DQ = 0x01,
 STACKSHOT_SAVE_LOADINFO = 0x02,
 STACKSHOT_GET_GLOBAL_MEM_STATS = 0x04,
 STACKSHOT_SAVE_KEXT_LOADINFO = 0x08,
 STACKSHOT_GET_MICROSTACKSHOT = 0x10,
 STACKSHOT_GLOBAL_MICROSTACKSHOT_ENABLE = 0x20,
 STACKSHOT_GLOBAL_MICROSTACKSHOT_DISABLE = 0x40,
 STACKSHOT_SET_MICROSTACKSHOT_MARK = 0x80,
 STACKSHOT_SAVE_KERNEL_FRAMES_ONLY = 0x100,
 STACKSHOT_GET_BOOT_PROFILE = 0x200,
};
#define STACKSHOT_THREAD_SNAPSHOT_MAGIC 0xfeedface
#define STACKSHOT_TASK_SNAPSHOT_MAGIC 0xdecafbad
#define STACKSHOT_MEM_AND_IO_SNAPSHOT_MAGIC 0xbfcabcde
#define STACKSHOT_MICRO_SNAPSHOT_MAGIC 0x31c54011
extern unsigned int systemLogDiags;
extern char debug_buf[];
extern unsigned int debug_boot_arg;
extern unsigned char *kernel_uuid;
extern char kernel_uuid_string[];
#define DB_HALT 0x1
#define DB_PRT 0x2
#define DB_NMI 0x4
#define DB_KPRT 0x8
#define DB_KDB 0x10
#define DB_SLOG 0x20
#define DB_ARP 0x40
#define DB_KDP_BP_DIS 0x80
#define DB_LOG_PI_SCRN 0x100
#define DB_KDP_GETC_ENA 0x200
#define DB_KERN_DUMP_ON_PANIC 0x400
#define DB_KERN_DUMP_ON_NMI 0x800
#define DB_DBG_POST_CORE 0x1000
#define DB_PANICLOG_DUMP 0x2000
#define DB_REBOOT_POST_CORE 0x4000
#define DB_NMI_BTN_ENA 0x8000
#define DEBUG_KPRINT_SYSCALL_PREDICATE_INTERNAL(mask,namep) (0)
#define DEBUG_KPRINT_SYSCALL_MASK(mask,fmt,args...) do { } while (0)
enum {
 DEBUG_KPRINT_SYSCALL_UNIX_MASK = 1 << 0,
 DEBUG_KPRINT_SYSCALL_MACH_MASK = 1 << 1,
 DEBUG_KPRINT_SYSCALL_MDEP_MASK = 1 << 2,
 DEBUG_KPRINT_SYSCALL_IPC_MASK = 1 << 3
};
#define DEBUG_KPRINT_SYSCALL_PREDICATE(mask) DEBUG_KPRINT_SYSCALL_PREDICATE_INTERNAL(mask, NULL)
#define DEBUG_KPRINT_SYSCALL_UNIX(fmt,args...) DEBUG_KPRINT_SYSCALL_MASK(DEBUG_KPRINT_SYSCALL_UNIX_MASK,fmt,args)
#define DEBUG_KPRINT_SYSCALL_MACH(fmt,args...) DEBUG_KPRINT_SYSCALL_MASK(DEBUG_KPRINT_SYSCALL_MACH_MASK,fmt,args)
#define DEBUG_KPRINT_SYSCALL_MDEP(fmt,args...) DEBUG_KPRINT_SYSCALL_MASK(DEBUG_KPRINT_SYSCALL_MDEP_MASK,fmt,args)
#define DEBUG_KPRINT_SYSCALL_IPC(fmt,args...) DEBUG_KPRINT_SYSCALL_MASK(DEBUG_KPRINT_SYSCALL_IPC_MASK,fmt,args)

extern void panic(const char *string, ...) __attribute__((__format__ (__printf__, 1, 2)));
void _consume_panic_args(int, ...);
void panic_context(unsigned int reason, void *ctx, const char *string, ...);
#define panic_plain(ex,...) (panic)(ex, ## __VA_ARGS__)
#define __STRINGIFY(x) #x
#define LINE_NUMBER(x) __STRINGIFY(x)
#define PANIC_LOCATION __FILE__ ":" LINE_NUMBER(__LINE__)
#define panic(ex,...) (panic)(#ex "@" PANIC_LOCATION, ## __VA_ARGS__)
void populate_model_name(char *);
unsigned panic_active(void);


extern char version[];
extern const char copyright[];
extern int boothowto;
extern int show_space;
extern int nblkdev;
extern int nchrdev;
extern int securelevel;
extern dev_t rootdev;
extern struct vnode *rootvp;
#define NO_FUNNEL 0
#define KERNEL_FUNNEL 1
extern funnel_t * kernel_flock;
#define SYSINIT(a,b,c,d,e) 
#define MALLOC_DEFINE(a,b,c) 
#define getenv_int(a,b) (*b = 0)
#define KASSERT(exp,msg) 

int einval(void);
void nullsys(void);
int errsys(void);
int seltrue(dev_t dev, int which, struct proc *p);
void ttyprintf(struct tty *, const char *, ...) __attribute__((__format__ (__printf__, 2, 3)));
void realitexpire(struct proc *);
int hzto(struct timeval *tv);
void tablefull(const char *);
int kvprintf(char const *, void (*)(int, void*), void *, int,
        __darwin_va_list);
void uprintf(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));
int copywithin(void *saddr, void *daddr, size_t len);
int64_t fulong(user_addr_t addr);
int sulong(user_addr_t addr, int64_t longword);
uint64_t fuulong(user_addr_t addr);
int suulong(user_addr_t addr, uint64_t ulongword);
int vslock(user_addr_t addr, user_size_t len);
int vsunlock(user_addr_t addr, user_size_t len, int dirtied);
int clone_system_shared_regions(int shared_regions_active,
        int chain_regions,
        int base_vnode);
extern kern_return_t bsd_exception(int, mach_exception_data_t codes, int);
extern void bsdinit_task(void);
extern void unix_syscall_return(int) __attribute__((noreturn));
void initclocks(void);
void startprofclock(struct proc *);
void stopprofclock(struct proc *);
void setstatclockrate(int hzrate);
struct time_value;
void get_procrustime(struct time_value *tv);
void load_init_program(struct proc *p);
void __pthread_testcancel(int presyscall);
void syscall_exit_funnelcheck(void);
void throttle_info_get_last_io_time(mount_t mp, struct timeval *tv);
void update_last_io_time(mount_t mp);
void timeout(void (*)(void *), void *arg, int ticks);
void timeout_with_leeway(void (*)(void *), void *arg, int ticks, int leeway_ticks);
void untimeout(void (*)(void *), void *arg);
int bsd_hostname(char *, int, int*);
int nullop(void);
int nulldev(void);
int enoioctl(void);
int enosys(void);
int enxio(void);
int eopnotsupp(void);
void *hashinit(int count, int type, u_long *hashmask);
void ovbcopy(const void *from, void *to, size_t len);
int fubyte(user_addr_t addr);
int fuibyte(user_addr_t addr);
int subyte(user_addr_t addr, int byte);
int suibyte(user_addr_t addr, int byte);
long fuword(user_addr_t addr);
long fuiword(user_addr_t addr);
int suword(user_addr_t addr, long word);
int suiword(user_addr_t addr, long word);
#define fusize(_a) ((user_size_t)fulong(_a))
#define susize(_a,_s) sulong((_a), (_s))
#define fuptr(a) ((user_addr_t)fulong(_a)
#define suptr(_a,_p) sulong((_a), (_p))
int useracc(user_addr_t addr, user_size_t len,int prot);
typedef void (*timeout_fcn_t)(void *);
void bsd_timeout(void (*)(void *), void *arg, struct timespec * ts);
void bsd_untimeout(void (*)(void *), void *arg);
void set_fsblocksize(struct vnode *);
uint64_t tvtoabstime(struct timeval *);
void *throttle_info_create(void);
void throttle_info_mount_ref(mount_t mp, void * throttle_info);
void throttle_info_mount_rel(mount_t mp);
void throttle_info_release(void *throttle_info);
void throttle_info_update(void *throttle_info, int flags);
uint32_t throttle_lowpri_io(int sleep_amount);
void throttle_set_thread_io_policy(int policy);
typedef struct __throttle_info_handle *throttle_info_handle_t;
int throttle_info_ref_by_mask(uint64_t throttle_mask, throttle_info_handle_t *throttle_info_handle);
void throttle_info_rel_by_mask(throttle_info_handle_t throttle_info_handle);
void throttle_info_update_by_mask(void *throttle_info_handle, int flags);
int throttle_info_io_will_be_throttled(void *throttle_info_handle, int policy);
void *exec_spawnattr_getmacpolicyinfo(const void *macextensions, const char *policyname, size_t *lenp);
#define THROTTLE_IO_ENABLE 1
#define THROTTLE_IO_DISABLE 0
void sys_override_io_throttle(int flag);

#define _VM_VM_KERN_H_ 
extern kern_return_t kernel_memory_allocate(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size,
    vm_offset_t mask,
    int flags);
#define KMA_HERE 0x01
#define KMA_NOPAGEWAIT 0x02
#define KMA_KOBJECT 0x04
#define KMA_LOMEM 0x08
#define KMA_GUARD_FIRST 0x10
#define KMA_GUARD_LAST 0x20
#define KMA_PERMANENT 0x40
#define KMA_NOENCRYPT 0x80
#define KMA_KSTACK 0x100
#define KMA_VAONLY 0x200
#define KMA_COMPRESSOR 0x400
extern kern_return_t kmem_alloc_contig(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size,
    vm_offset_t mask,
    ppnum_t max_pnum,
    ppnum_t pnum_mask,
    int flags);
extern kern_return_t kmem_alloc(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size);
extern kern_return_t kmem_alloc_pageable(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size);
extern kern_return_t kmem_alloc_aligned(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size);
extern kern_return_t kmem_realloc(
    vm_map_t map,
    vm_offset_t oldaddr,
    vm_size_t oldsize,
    vm_offset_t *newaddrp,
    vm_size_t newsize);
extern void kmem_free(
    vm_map_t map,
    vm_offset_t addr,
    vm_size_t size);
extern kern_return_t kmem_suballoc(
    vm_map_t parent,
    vm_offset_t *addr,
    vm_size_t size,
    boolean_t pageable,
    int flags,
    vm_map_t *new_map);
extern kern_return_t kmem_alloc_kobject(
    vm_map_t map,
    vm_offset_t *addrp,
    vm_size_t size);
extern kern_return_t kernel_memory_populate(
 vm_map_t map,
 vm_offset_t addr,
 vm_size_t size,
 int flags);
extern void kernel_memory_depopulate(
 vm_map_t map,
 vm_offset_t addr,
 vm_size_t size,
 int flags);
extern vm_map_t kernel_map;
extern vm_map_t kernel_pageable_map;
extern vm_map_t ipc_kernel_map;
#define _VNODE_H_ 
enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, VSTR,
     VCPLX };
enum vtagtype {
 VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_MSDOSFS, VT_LFS, VT_LOFS, VT_FDESC,
 VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS,
 VT_UNION, VT_HFS, VT_ZFS, VT_DEVFS, VT_WEBDAV, VT_UDF, VT_AFP,
 VT_CDDA, VT_CIFS, VT_OTHER};
#define VNODE_READ 0x01
#define VNODE_WRITE 0x02
#define PREALLOCATE 0x00000001
#define ALLOCATECONTIG 0x00000002
#define ALLOCATEALL 0x00000004
#define FREEREMAINDER 0x00000008
#define ALLOCATEFROMPEOF 0x00000010
#define ALLOCATEFROMVOL 0x00000020
#define VNOVAL (-1)
#define IO_UNIT 0x0001
#define IO_APPEND 0x0002
#define IO_SYNC 0x0004
#define IO_NODELOCKED 0x0008
#define IO_NDELAY 0x0010
#define IO_NOZEROFILL 0x0020
#define IO_REVOKE IO_NOZEROFILL
#define IO_TAILZEROFILL 0x0040
#define IO_HEADZEROFILL 0x0080
#define IO_NOZEROVALID 0x0100
#define IO_NOZERODIRTY 0x0200
#define IO_CLOSE 0x0400
#define IO_NOCACHE 0x0800
#define IO_RAOFF 0x1000
#define IO_DEFWRITE 0x2000
#define IO_PASSIVE 0x4000
#define IO_BACKGROUND IO_PASSIVE
#define IO_NOAUTH 0x8000
#define IO_NODIRECT 0x10000
#define IO_ENCRYPTED 0x20000
#define IO_RETURN_ON_THROTTLE 0x40000
#define IO_SINGLE_WRITER 0x80000
#define IO_SYSCALL_DISPATCH 0x100000
#define IO_SWAP_DISPATCH 0x200000
struct componentname {
 uint32_t cn_nameiop;
 uint32_t cn_flags;
 vfs_context_t cn_context;
 struct nameidata *cn_ndp;
#define cn_proc (cn_context->vc_proc + 0)
#define cn_cred (cn_context->vc_ucred + 0)
 char *cn_pnbuf;
 int cn_pnlen;
 char *cn_nameptr;
 int cn_namelen;
 uint32_t cn_hash;
 uint32_t cn_consume;
};
#define LOOKUP 0
#define CREATE 1
#define DELETE 2
#define RENAME 3
#define OPMASK 3
#define FOLLOW 0x00000040
#define NOTRIGGER 0x10000000
#define ISDOTDOT 0x00002000
#define MAKEENTRY 0x00004000
#define ISLASTCN 0x00008000
#define ISWHITEOUT 0x00020000
#define DOWHITEOUT 0x00040000
struct vnode_fsparam {
 struct mount * vnfs_mp;
 enum vtype vnfs_vtype;
 const char * vnfs_str;
 struct vnode * vnfs_dvp;
 void * vnfs_fsnode;
 int (**vnfs_vops)(void *);
 int vnfs_markroot;
 int vnfs_marksystem;
 dev_t vnfs_rdev;
 off_t vnfs_filesize;
 struct componentname * vnfs_cnp;
 uint32_t vnfs_flags;
};
#define VNFS_NOCACHE 0x01
#define VNFS_CANTCACHE 0x02
#define VNFS_ADDFSREF 0x04
#define VNCREATE_FLAVOR 0
#define VCREATESIZE sizeof(struct vnode_fsparam)
enum path_operation {
 OP_LOOKUP,
 OP_MOUNT,
 OP_UNMOUNT,
 OP_STATFS,
 OP_OPEN,
 OP_LINK,
 OP_UNLINK,
 OP_RENAME,
 OP_CHDIR,
 OP_CHROOT,
 OP_MKNOD,
 OP_MKFIFO,
 OP_SYMLINK,
 OP_ACCESS,
 OP_PATHCONF,
 OP_READLINK,
 OP_GETATTR,
 OP_SETATTR,
 OP_TRUNCATE,
 OP_COPYFILE,
 OP_MKDIR,
 OP_RMDIR,
 OP_REVOKE,
 OP_EXCHANGEDATA,
 OP_SEARCHFS,
 OP_FSCTL,
 OP_GETXATTR,
 OP_SETXATTR,
 OP_REMOVEXATTR,
 OP_LISTXATTR,
 OP_MAXOP
};
extern int vfs_istraditionaltrigger(enum path_operation op, const struct componentname *cnp);
enum resolver_status {
 RESOLVER_RESOLVED,
 RESOLVER_NOCHANGE,
 RESOLVER_UNRESOLVED,
 RESOLVER_ERROR,
 RESOLVER_STOP
};
typedef uint64_t resolver_result_t;
extern resolver_result_t vfs_resolver_result(uint32_t seq, enum resolver_status stat, int aux);
extern enum resolver_status vfs_resolver_status(resolver_result_t);
extern uint32_t vfs_resolver_sequence(resolver_result_t);
extern int vfs_resolver_auxiliary(resolver_result_t);
typedef resolver_result_t (* trigger_vnode_resolve_callback_t)(
 vnode_t vp,
 const struct componentname * cnp,
 enum path_operation pop,
 int flags,
 void * data,
 vfs_context_t ctx);
typedef resolver_result_t (* trigger_vnode_unresolve_callback_t)(
 vnode_t vp,
 int flags,
 void * data,
 vfs_context_t ctx);
typedef resolver_result_t (* trigger_vnode_rearm_callback_t)(
 vnode_t vp,
 int flags,
 void * data,
 vfs_context_t ctx);
typedef void (* trigger_vnode_reclaim_callback_t)(
 vnode_t vp,
 void * data);
extern int vnode_trigger_update(vnode_t vp, resolver_result_t result);
struct vnode_trigger_info {
 trigger_vnode_resolve_callback_t vti_resolve_func;
 trigger_vnode_unresolve_callback_t vti_unresolve_func;
 trigger_vnode_rearm_callback_t vti_rearm_func;
 trigger_vnode_reclaim_callback_t vti_reclaim_func;
 void * vti_data;
 uint32_t vti_flags;
};
struct vnode_trigger_param {
 struct vnode_fsparam vnt_params;
 trigger_vnode_resolve_callback_t vnt_resolve_func;
 trigger_vnode_unresolve_callback_t vnt_unresolve_func;
 trigger_vnode_rearm_callback_t vnt_rearm_func;
 trigger_vnode_reclaim_callback_t vnt_reclaim_func;
 void * vnt_data;
 uint32_t vnt_flags;
};
#define VNCREATE_TRIGGER (('T' << 8) + ('V'))
#define VNCREATE_TRIGGER_SIZE sizeof(struct vnode_trigger_param)
#define VNT_AUTO_REARM (1 << 0)
#define VNT_NO_DIRECT_MOUNT (1 << 1)
#define VNT_VALID_MASK (VNT_AUTO_REARM | VNT_NO_DIRECT_MOUNT)
#define VATTR_INIT(v) do {(v)->va_supported = (v)->va_active = 0ll; (v)->va_vaflags = 0; } while(0)
#define VATTR_SET_ACTIVE(v,a) ((v)->va_active |= VNODE_ATTR_ ## a)
#define VATTR_SET_SUPPORTED(v,a) ((v)->va_supported |= VNODE_ATTR_ ## a)
#define VATTR_IS_SUPPORTED(v,a) ((v)->va_supported & VNODE_ATTR_ ## a)
#define VATTR_CLEAR_ACTIVE(v,a) ((v)->va_active &= ~VNODE_ATTR_ ## a)
#define VATTR_CLEAR_SUPPORTED(v,a) ((v)->va_supported &= ~VNODE_ATTR_ ## a)
#define VATTR_IS_ACTIVE(v,a) ((v)->va_active & VNODE_ATTR_ ## a)
#define VATTR_ALL_SUPPORTED(v) (((v)->va_active & (v)->va_supported) == (v)->va_active)
#define VATTR_INACTIVE_SUPPORTED(v) do {(v)->va_active &= ~(v)->va_supported; (v)->va_supported = 0;} while(0)
#define VATTR_SET(v,a,x) do { (v)-> a = (x); VATTR_SET_ACTIVE(v, a);} while(0)
#define VATTR_WANTED(v,a) VATTR_SET_ACTIVE(v, a)
#define VATTR_RETURN(v,a,x) do { (v)-> a = (x); VATTR_SET_SUPPORTED(v, a);} while(0)
#define VATTR_NOT_RETURNED(v,a) (VATTR_IS_ACTIVE(v, a) && !VATTR_IS_SUPPORTED(v, a))
#define VATTR_IS(v,a,x) (VATTR_IS_SUPPORTED(v, a) && (v)-> a == (x))
#define VATTR_IS_NOT(v,a,x) (VATTR_IS_SUPPORTED(v, a) && (v)-> a != (x))
#define VNODE_ATTR_va_rdev (1LL<< 0)
#define VNODE_ATTR_va_nlink (1LL<< 1)
#define VNODE_ATTR_va_total_size (1LL<< 2)
#define VNODE_ATTR_va_total_alloc (1LL<< 3)
#define VNODE_ATTR_va_data_size (1LL<< 4)
#define VNODE_ATTR_va_data_alloc (1LL<< 5)
#define VNODE_ATTR_va_iosize (1LL<< 6)
#define VNODE_ATTR_va_uid (1LL<< 7)
#define VNODE_ATTR_va_gid (1LL<< 8)
#define VNODE_ATTR_va_mode (1LL<< 9)
#define VNODE_ATTR_va_flags (1LL<<10)
#define VNODE_ATTR_va_acl (1LL<<11)
#define VNODE_ATTR_va_create_time (1LL<<12)
#define VNODE_ATTR_va_access_time (1LL<<13)
#define VNODE_ATTR_va_modify_time (1LL<<14)
#define VNODE_ATTR_va_change_time (1LL<<15)
#define VNODE_ATTR_va_backup_time (1LL<<16)
#define VNODE_ATTR_va_fileid (1LL<<17)
#define VNODE_ATTR_va_linkid (1LL<<18)
#define VNODE_ATTR_va_parentid (1LL<<19)
#define VNODE_ATTR_va_fsid (1LL<<20)
#define VNODE_ATTR_va_filerev (1LL<<21)
#define VNODE_ATTR_va_gen (1LL<<22)
#define VNODE_ATTR_va_encoding (1LL<<23)
#define VNODE_ATTR_va_type (1LL<<24)
#define VNODE_ATTR_va_name (1LL<<25)
#define VNODE_ATTR_va_uuuid (1LL<<26)
#define VNODE_ATTR_va_guuid (1LL<<27)
#define VNODE_ATTR_va_nchildren (1LL<<28)
#define VNODE_ATTR_va_dirlinkcount (1LL<<29)
#define VNODE_ATTR_va_addedtime (1LL<<30)
#define VNODE_ATTR_va_dataprotect_class (1LL<<31)
#define VNODE_ATTR_va_dataprotect_flags (1LL<<32)
#define VNODE_ATTR_BIT(n) (VNODE_ATTR_ ## n)
#define VNODE_ATTR_RDONLY (VNODE_ATTR_BIT(va_rdev) | VNODE_ATTR_BIT(va_nlink) | VNODE_ATTR_BIT(va_total_size) | VNODE_ATTR_BIT(va_total_alloc) | VNODE_ATTR_BIT(va_data_alloc) | VNODE_ATTR_BIT(va_iosize) | VNODE_ATTR_BIT(va_fileid) | VNODE_ATTR_BIT(va_linkid) | VNODE_ATTR_BIT(va_parentid) | VNODE_ATTR_BIT(va_fsid) | VNODE_ATTR_BIT(va_filerev) | VNODE_ATTR_BIT(va_gen) | VNODE_ATTR_BIT(va_name) | VNODE_ATTR_BIT(va_type) | VNODE_ATTR_BIT(va_nchildren) | VNODE_ATTR_BIT(va_dirlinkcount) | VNODE_ATTR_BIT(va_addedtime))
#define VNODE_ATTR_NEWOBJ (VNODE_ATTR_BIT(va_rdev) | VNODE_ATTR_BIT(va_uid) | VNODE_ATTR_BIT(va_gid) | VNODE_ATTR_BIT(va_mode) | VNODE_ATTR_BIT(va_flags) | VNODE_ATTR_BIT(va_acl) | VNODE_ATTR_BIT(va_create_time) | VNODE_ATTR_BIT(va_modify_time) | VNODE_ATTR_BIT(va_change_time) | VNODE_ATTR_BIT(va_encoding) | VNODE_ATTR_BIT(va_type) | VNODE_ATTR_BIT(va_uuuid) | VNODE_ATTR_BIT(va_guuid) | VNODE_ATTR_BIT(va_dataprotect_class) | VNODE_ATTR_BIT(va_dataprotect_flags))
struct vnode_attr {
 uint64_t va_supported;
 uint64_t va_active;
 int va_vaflags;
 dev_t va_rdev;
 uint64_t va_nlink;
 uint64_t va_total_size;
 uint64_t va_total_alloc;
 uint64_t va_data_size;
 uint64_t va_data_alloc;
 uint32_t va_iosize;
 uid_t va_uid;
 gid_t va_gid;
 mode_t va_mode;
 uint32_t va_flags;
 struct kauth_acl *va_acl;
 struct timespec va_create_time;
 struct timespec va_access_time;
 struct timespec va_modify_time;
 struct timespec va_change_time;
 struct timespec va_backup_time;
 uint64_t va_fileid;
 uint64_t va_linkid;
 uint64_t va_parentid;
 uint32_t va_fsid;
 uint64_t va_filerev;
 uint32_t va_gen;
 uint32_t va_encoding;
 enum vtype va_type;
 char * va_name;
 guid_t va_uuuid;
 guid_t va_guuid;
 uint64_t va_nchildren;
 uint64_t va_dirlinkcount;
 struct kauth_acl *va_base_acl;
 struct timespec va_addedtime;
 uint32_t va_dataprotect_class;
 uint32_t va_dataprotect_flags;
};
#define VA_DP_RAWENCRYPTED 0x0001
#define VA_UTIMES_NULL 0x010000
#define VA_EXCLUSIVE 0x020000
#define VA_NOINHERIT 0x040000
#define VA_NOAUTH 0x080000
#define VSUID 0x800
#define VSGID 0x400
#define VSVTX 0x200
#define VREAD 0x100
#define VWRITE 0x080
#define VEXEC 0x040
extern enum vtype iftovt_tab[];
extern int vttoif_tab[];
#define IFTOVT(mode) (iftovt_tab[((mode) & S_IFMT) >> 12])
#define VTTOIF(indx) (vttoif_tab[(int)(indx)])
#define MAKEIMODE(indx,mode) (int)(VTTOIF(indx) | (mode))
#define SKIPSYSTEM 0x0001
#define FORCECLOSE 0x0002
#define WRITECLOSE 0x0004
#define SKIPSWAP 0x0008
#define SKIPROOT 0x0010
#define DOCLOSE 0x0008
#define V_SAVE 0x0001
#define V_SAVEMETA 0x0002
#define REVOKEALL 0x0001
#define VNODE_REMOVE_NODELETEBUSY 0x0001
#define VNODE_REMOVE_SKIP_NAMESPACE_EVENT 0x0002
#define VNODE_READDIR_EXTENDED 0x0001
#define VNODE_READDIR_REQSEEKOFF 0x0002
#define VNODE_READDIR_SEEKOFF32 0x0004
#define VNODE_READDIR_NAMEMAX 0x0008
#define NULLVP ((struct vnode *)NULL)
extern int desiredvnodes;
struct vnodeopv_entry_desc {
 struct vnodeop_desc *opve_op;
 int (*opve_impl)(void *);
};
struct vnodeopv_desc {
 int (***opv_desc_vector_p)(void *);
 struct vnodeopv_entry_desc *opv_desc_ops;
};
int vn_default_error(void);
struct vnop_generic_args {
 struct vnodeop_desc *a_desc;
};
typedef int kauth_action_t;
#define _KAUTH_ACTION_T 
#define _SYS_VNODE_IF_H_ 
#define _SYS_BUF_H_ 
#define B_WRITE 0x00000000
#define B_READ 0x00000001
#define B_ASYNC 0x00000002
#define B_NOCACHE 0x00000004
#define B_DELWRI 0x00000008
#define B_LOCKED 0x00000010
#define B_PHYS 0x00000020
#define B_CLUSTER 0x00000040
#define B_PAGEIO 0x00000080
#define B_META 0x00000100
#define B_RAW 0x00000200
#define B_FUA 0x00000400
#define B_PASSIVE 0x00000800
#define B_IOSTREAMING 0x00001000
#define B_THROTTLED_IO 0x00002000
#define B_ENCRYPTED_IO 0x00004000
#define B_STATICCONTENT 0x00008000

void buf_markaged(buf_t);
void buf_markinvalid(buf_t);
void buf_markdelayed(buf_t);
void buf_markclean(buf_t);
void buf_markeintr(buf_t);
void buf_markfua(buf_t);
int buf_fua(buf_t);
int buf_valid(buf_t);
int buf_fromcache(buf_t);
void * buf_upl(buf_t);
uint32_t buf_uploffset(buf_t);
kauth_cred_t buf_rcred(buf_t);
kauth_cred_t buf_wcred(buf_t);
proc_t buf_proc(buf_t);
uint32_t buf_dirtyoff(buf_t);
uint32_t buf_dirtyend(buf_t);
void buf_setdirtyoff(buf_t, uint32_t);
void buf_setdirtyend(buf_t, uint32_t);
errno_t buf_error(buf_t);
void buf_seterror(buf_t, errno_t);
void buf_setflags(buf_t, int32_t);
void buf_clearflags(buf_t, int32_t);
int32_t buf_flags(buf_t);
void buf_reset(buf_t, int32_t);
errno_t buf_map(buf_t, caddr_t *);
errno_t buf_unmap(buf_t);
void buf_setdrvdata(buf_t, void *);
void * buf_drvdata(buf_t);
void buf_setfsprivate(buf_t, void *);
void * buf_fsprivate(buf_t);
daddr64_t buf_blkno(buf_t);
daddr64_t buf_lblkno(buf_t);
void buf_setblkno(buf_t, daddr64_t);
void buf_setlblkno(buf_t, daddr64_t);
uint32_t buf_count(buf_t);
uint32_t buf_size(buf_t);
uint32_t buf_resid(buf_t);
void buf_setcount(buf_t, uint32_t);
void buf_setsize(buf_t, uint32_t);
void buf_setresid(buf_t, uint32_t);
void buf_setdataptr(buf_t, uintptr_t);
uintptr_t buf_dataptr(buf_t);
vnode_t buf_vnode(buf_t);
void buf_setvnode(buf_t, vnode_t);
dev_t buf_device(buf_t);
errno_t buf_setdevice(buf_t, vnode_t);
errno_t buf_strategy(vnode_t, void *);
#define BUF_WAIT 0x01
errno_t buf_invalblkno(vnode_t, daddr64_t, int);
void * buf_callback(buf_t);
errno_t buf_setcallback(buf_t, void (*)(buf_t, void *), void *);
errno_t buf_setupl(buf_t, upl_t, uint32_t);
buf_t buf_clone(buf_t, int, int, void (*)(buf_t, void *), void *);
buf_t buf_create_shadow(buf_t bp, boolean_t force_copy, uintptr_t external_storage, void (*iodone)(buf_t, void *), void *arg);
int buf_shadow(buf_t bp);
buf_t buf_alloc(vnode_t);
void buf_free(buf_t);
#define BUF_WRITE_DATA 0x0001
#define BUF_SKIP_META 0x0002
#define BUF_INVALIDATE_LOCKED 0x0004
int buf_invalidateblks(vnode_t, int, int, int);
#define BUF_SKIP_NONLOCKED 0x01
#define BUF_SKIP_LOCKED 0x02
#define BUF_SCAN_CLEAN 0x04
#define BUF_SCAN_DIRTY 0x08
#define BUF_NOTIFY_BUSY 0x10
#define BUF_RETURNED 0
#define BUF_RETURNED_DONE 1
#define BUF_CLAIMED 2
#define BUF_CLAIMED_DONE 3
void buf_flushdirtyblks(vnode_t, int, int, const char *);
void buf_iterate(vnode_t, int (*)(buf_t, void *), int, void *);
void buf_clear(buf_t);
errno_t buf_bawrite(buf_t);
errno_t buf_bdwrite(buf_t);
errno_t buf_bwrite(buf_t);
void buf_biodone(buf_t);
errno_t buf_biowait(buf_t);
void buf_brelse(buf_t);
errno_t buf_bread(vnode_t, daddr64_t, int, kauth_cred_t, buf_t *);
errno_t buf_breadn(vnode_t, daddr64_t, int, daddr64_t *, int *, int, kauth_cred_t, buf_t *);
errno_t buf_meta_bread(vnode_t, daddr64_t, int, kauth_cred_t, buf_t *);
errno_t buf_meta_breadn(vnode_t, daddr64_t, int, daddr64_t *, int *, int, kauth_cred_t, buf_t *);
u_int minphys(buf_t bp);
int physio(void (*)(buf_t), buf_t, dev_t, int , u_int (*)(buf_t), struct uio *, int );
#define BLK_READ 0x01
#define BLK_WRITE 0x02
#define BLK_META 0x10
#define BLK_ONLYVALID 0x80000000
buf_t buf_getblk(vnode_t, daddr64_t, int, int, int, int);
buf_t buf_geteblk(int);
void buf_clear_redundancy_flags(buf_t, uint32_t);
uint32_t buf_redundancy_flags(buf_t);
void buf_set_redundancy_flags(buf_t, uint32_t);
bufattr_t buf_attr(buf_t);
 void buf_markstatic(buf_t);
int buf_static(buf_t);
void buf_setfilter(buf_t, void (*)(buf_t, void *), void *, void (**)(buf_t, void *), void **);
bufattr_t bufattr_alloc(void);
void bufattr_free(bufattr_t bap);
void *bufattr_cpaddr(bufattr_t);
uint64_t bufattr_cpoff(bufattr_t);
void bufattr_setcpaddr(bufattr_t, void *);
void bufattr_setcpoff(bufattr_t, uint64_t);
int bufattr_rawencrypted(bufattr_t bap);
 void bufattr_markgreedymode(bufattr_t bap);
int bufattr_greedymode(bufattr_t bap);
int bufattr_throttled(bufattr_t bap);
int bufattr_nocache(bufattr_t bap);
int bufattr_meta(bufattr_t bap);
int bufattr_delayidlesleep(bufattr_t bap);
vm_offset_t buf_kernel_addrperm_addr(void * addr);
void bufattr_markquickcomplete(bufattr_t bap);
int bufattr_quickcomplete(bufattr_t bap);

#define SET(t,f) (t) |= (f)
#define CLR(t,f) (t) &= ~(f)
#define ISSET(t,f) ((t) & (f))
extern struct vnodeop_desc vnop_default_desc;
extern struct vnodeop_desc vnop_lookup_desc;
extern struct vnodeop_desc vnop_compound_open_desc;
extern struct vnodeop_desc vnop_compound_remove_desc;
extern struct vnodeop_desc vnop_compound_rename_desc;
extern struct vnodeop_desc vnop_compound_mkdir_desc;
extern struct vnodeop_desc vnop_compound_rmdir_desc;
extern struct vnodeop_desc vnop_create_desc;
extern struct vnodeop_desc vnop_whiteout_desc;
extern struct vnodeop_desc vnop_mknod_desc;
extern struct vnodeop_desc vnop_open_desc;
extern struct vnodeop_desc vnop_close_desc;
extern struct vnodeop_desc vnop_access_desc;
extern struct vnodeop_desc vnop_getattr_desc;
extern struct vnodeop_desc vnop_setattr_desc;
extern struct vnodeop_desc vnop_read_desc;
extern struct vnodeop_desc vnop_write_desc;
extern struct vnodeop_desc vnop_ioctl_desc;
extern struct vnodeop_desc vnop_select_desc;
extern struct vnodeop_desc vnop_exchange_desc;
extern struct vnodeop_desc vnop_revoke_desc;
extern struct vnodeop_desc vnop_mmap_desc;
extern struct vnodeop_desc vnop_mnomap_desc;
extern struct vnodeop_desc vnop_fsync_desc;
extern struct vnodeop_desc vnop_remove_desc;
extern struct vnodeop_desc vnop_link_desc;
extern struct vnodeop_desc vnop_rename_desc;
extern struct vnodeop_desc vnop_mkdir_desc;
extern struct vnodeop_desc vnop_rmdir_desc;
extern struct vnodeop_desc vnop_symlink_desc;
extern struct vnodeop_desc vnop_readdir_desc;
extern struct vnodeop_desc vnop_readdirattr_desc;
extern struct vnodeop_desc vnop_readlink_desc;
extern struct vnodeop_desc vnop_inactive_desc;
extern struct vnodeop_desc vnop_reclaim_desc;
extern struct vnodeop_desc vnop_print_desc;
extern struct vnodeop_desc vnop_pathconf_desc;
extern struct vnodeop_desc vnop_advlock_desc;
extern struct vnodeop_desc vnop_truncate_desc;
extern struct vnodeop_desc vnop_allocate_desc;
extern struct vnodeop_desc vnop_pagein_desc;
extern struct vnodeop_desc vnop_pageout_desc;
extern struct vnodeop_desc vnop_searchfs_desc;
extern struct vnodeop_desc vnop_copyfile_desc;
extern struct vnodeop_desc vnop_blktooff_desc;
extern struct vnodeop_desc vnop_offtoblk_desc;
extern struct vnodeop_desc vnop_blockmap_desc;
extern struct vnodeop_desc vnop_strategy_desc;
extern struct vnodeop_desc vnop_bwrite_desc;

struct vnop_lookup_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 vfs_context_t a_context;
};
extern errno_t VNOP_LOOKUP(vnode_t, vnode_t *, struct componentname *, vfs_context_t);
struct vnop_create_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 vfs_context_t a_context;
};
extern errno_t VNOP_CREATE(vnode_t, vnode_t *, struct componentname *, struct vnode_attr *, vfs_context_t);
struct vnop_whiteout_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 struct componentname *a_cnp;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_WHITEOUT(vnode_t, struct componentname *, int, vfs_context_t);
struct vnop_mknod_args {
       struct vnodeop_desc *a_desc;
       vnode_t a_dvp;
       vnode_t *a_vpp;
       struct componentname *a_cnp;
       struct vnode_attr *a_vap;
       vfs_context_t a_context;
};
extern errno_t VNOP_MKNOD(vnode_t, vnode_t *, struct componentname *, struct vnode_attr *, vfs_context_t);
struct vnop_open_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_mode;
 vfs_context_t a_context;
};
struct vnop_compound_open_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 int a_fmode;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 uint32_t a_flags;
 uint32_t *a_status;
 vfs_context_t a_context;
 int (*a_open_create_authorizer)(
   vnode_t dvp,
   struct componentname *cnp,
   struct vnode_attr *vap,
   vfs_context_t ctx,
   void *reserved);
 int (*a_open_existing_authorizer)(
   vnode_t vp,
   struct componentname *cnp,
   int fmode,
   vfs_context_t ctx,
   void *reserved);
 void *a_reserved;
};
#define VNOP_COMPOUND_OPEN_DO_CREATE 0x00000001
#define COMPOUND_OPEN_STATUS_DID_CREATE 0x00000001
extern errno_t VNOP_OPEN(vnode_t, int, vfs_context_t);
struct nameidata;
extern int VNOP_COMPOUND_OPEN(vnode_t dvp, vnode_t *vpp, struct nameidata *ndp, int32_t flags, int32_t fmode, uint32_t *status, struct vnode_attr *vap, vfs_context_t ctx);
struct vnop_close_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_fflag;
 vfs_context_t a_context;
};
extern errno_t VNOP_CLOSE(vnode_t, int, vfs_context_t);
struct vnop_access_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_action;
 vfs_context_t a_context;
};
extern errno_t VNOP_ACCESS(vnode_t, int, vfs_context_t);
struct vnop_getattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct vnode_attr *a_vap;
 vfs_context_t a_context;
};
extern errno_t VNOP_GETATTR(vnode_t, struct vnode_attr *, vfs_context_t);
struct vnop_setattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct vnode_attr *a_vap;
 vfs_context_t a_context;
};
extern errno_t VNOP_SETATTR(vnode_t, struct vnode_attr *, vfs_context_t);
struct vnop_read_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct uio *a_uio;
 int a_ioflag;
 vfs_context_t a_context;
};
extern errno_t VNOP_READ(vnode_t, struct uio *, int, vfs_context_t);
struct vnop_write_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct uio *a_uio;
 int a_ioflag;
 vfs_context_t a_context;
};
extern errno_t VNOP_WRITE(vnode_t, struct uio *, int, vfs_context_t);
struct vnop_ioctl_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 u_long a_command;
 caddr_t a_data;
 int a_fflag;
 vfs_context_t a_context;
};
extern errno_t VNOP_IOCTL(vnode_t, u_long, caddr_t, int, vfs_context_t);
struct vnop_select_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_which;
 int a_fflags;
 void *a_wql;
 vfs_context_t a_context;
};
extern errno_t VNOP_SELECT(vnode_t, int, int, void *, vfs_context_t);
struct vnop_exchange_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_fvp;
        vnode_t a_tvp;
 int a_options;
 vfs_context_t a_context;
};
extern errno_t VNOP_EXCHANGE(vnode_t, vnode_t, int, vfs_context_t);
struct vnop_revoke_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_REVOKE(vnode_t, int, vfs_context_t);
struct vnop_mmap_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_fflags;
 vfs_context_t a_context;
};
extern errno_t VNOP_MMAP(vnode_t, int, vfs_context_t);
struct vnop_mnomap_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 vfs_context_t a_context;
};
extern errno_t VNOP_MNOMAP(vnode_t, vfs_context_t);
struct vnop_fsync_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_waitfor;
 vfs_context_t a_context;
};
extern errno_t VNOP_FSYNC(vnode_t, int, vfs_context_t);
struct vnop_remove_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t a_vp;
 struct componentname *a_cnp;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_REMOVE(vnode_t, vnode_t, struct componentname *, int, vfs_context_t);
struct vnop_compound_remove_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 uint32_t a_flags;
 vfs_context_t a_context;
 int (*a_remove_authorizer)(
   vnode_t dvp,
   vnode_t vp,
   struct componentname *cnp,
   vfs_context_t ctx,
   void *reserved);
 void *a_reserved;
};
extern errno_t VNOP_COMPOUND_REMOVE(vnode_t, vnode_t*, struct nameidata *, int32_t flags, struct vnode_attr *vap, vfs_context_t);
struct vnop_link_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 vnode_t a_tdvp;
 struct componentname *a_cnp;
 vfs_context_t a_context;
};
extern errno_t VNOP_LINK(vnode_t, vnode_t, struct componentname *, vfs_context_t);
struct vnop_rename_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_fdvp;
 vnode_t a_fvp;
 struct componentname *a_fcnp;
 vnode_t a_tdvp;
 vnode_t a_tvp;
 struct componentname *a_tcnp;
 vfs_context_t a_context;
};
extern errno_t VNOP_RENAME(vnode_t, vnode_t, struct componentname *, vnode_t, vnode_t, struct componentname *, vfs_context_t);
struct vnop_compound_rename_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_fdvp;
 vnode_t *a_fvpp;
 struct componentname *a_fcnp;
 struct vnode_attr *a_fvap;
 vnode_t a_tdvp;
 vnode_t *a_tvpp;
 struct componentname *a_tcnp;
 struct vnode_attr *a_tvap;
 uint32_t a_flags;
 vfs_context_t a_context;
 int (*a_rename_authorizer)(
   vnode_t fdvp,
   vnode_t fvp,
   struct componentname *fcnp,
   vnode_t tdvp,
   vnode_t tvp,
   struct componentname *tcnp,
   vfs_context_t ctx,
   void *reserved);
 void *a_reserved;
};
errno_t
VNOP_COMPOUND_RENAME(
  struct vnode *fdvp, struct vnode **fvpp, struct componentname *fcnp, struct vnode_attr *fvap,
              struct vnode *tdvp, struct vnode **tvpp, struct componentname *tcnp, struct vnode_attr *tvap,
       uint32_t flags,vfs_context_t ctx);
struct vnop_mkdir_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 vfs_context_t a_context;
};
extern errno_t VNOP_MKDIR(vnode_t, vnode_t *, struct componentname *, struct vnode_attr *, vfs_context_t);
struct vnop_compound_mkdir_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 uint32_t a_flags;
 vfs_context_t a_context;
 void *a_reserved;
};
extern errno_t VNOP_COMPOUND_MKDIR(vnode_t, vnode_t *, struct nameidata *, struct vnode_attr *, vfs_context_t);
struct vnop_rmdir_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t a_vp;
 struct componentname *a_cnp;
 vfs_context_t a_context;
};
extern errno_t VNOP_RMDIR(vnode_t, vnode_t, struct componentname *, vfs_context_t);
struct vnop_compound_rmdir_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_dvp;
 vnode_t *a_vpp;
 struct componentname *a_cnp;
 struct vnode_attr *a_vap;
 uint32_t a_flags;
 vfs_context_t a_context;
 int (*a_rmdir_authorizer)(
   vnode_t dvp,
   vnode_t vp,
   struct componentname *cnp,
   vfs_context_t ctx,
   void *reserved);
 void *a_reserved;
};
extern errno_t VNOP_COMPOUND_RMDIR(vnode_t, vnode_t*, struct nameidata *, struct vnode_attr *vap, vfs_context_t);
struct vnop_symlink_args {
       struct vnodeop_desc *a_desc;
       vnode_t a_dvp;
       vnode_t *a_vpp;
       struct componentname *a_cnp;
       struct vnode_attr *a_vap;
       char *a_target;
       vfs_context_t a_context;
};
extern errno_t VNOP_SYMLINK(vnode_t, vnode_t *, struct componentname *, struct vnode_attr *, char *, vfs_context_t);
struct vnop_readdir_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct uio *a_uio;
 int a_flags;
 int *a_eofflag;
 int *a_numdirent;
 vfs_context_t a_context;
};
extern errno_t VNOP_READDIR(vnode_t, struct uio *, int, int *, int *, vfs_context_t);
struct vnop_readdirattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct attrlist *a_alist;
 struct uio *a_uio;
 uint32_t a_maxcount;
 uint32_t a_options;
 uint32_t *a_newstate;
 int *a_eofflag;
 uint32_t *a_actualcount;
 vfs_context_t a_context;
};
extern errno_t VNOP_READDIRATTR(vnode_t, struct attrlist *, struct uio *, uint32_t, uint32_t, uint32_t *, int *, uint32_t *, vfs_context_t);
struct vnop_readlink_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 struct uio *a_uio;
 vfs_context_t a_context;
};
extern errno_t VNOP_READLINK(vnode_t, struct uio *, vfs_context_t);
struct vnop_inactive_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 vfs_context_t a_context;
};
extern errno_t VNOP_INACTIVE(vnode_t, vfs_context_t);
struct vnop_reclaim_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 vfs_context_t a_context;
};
extern errno_t VNOP_RECLAIM(vnode_t, vfs_context_t);
struct vnop_pathconf_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 int a_name;
 int32_t *a_retval;
 vfs_context_t a_context;
};
extern errno_t VNOP_PATHCONF(vnode_t, int, int32_t *, vfs_context_t);
struct vnop_advlock_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 caddr_t a_id;
 int a_op;
 struct flock *a_fl;
 int a_flags;
 vfs_context_t a_context;
 struct timespec *a_timeout;
};
extern errno_t VNOP_ADVLOCK(vnode_t, caddr_t, int, struct flock *, int, vfs_context_t, struct timespec *);
struct vnop_allocate_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 off_t a_length;
 u_int32_t a_flags;
 off_t *a_bytesallocated;
 off_t a_offset;
 vfs_context_t a_context;
};
extern errno_t VNOP_ALLOCATE(vnode_t, off_t, u_int32_t, off_t *, off_t, vfs_context_t);
struct vnop_pagein_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 upl_t a_pl;
 upl_offset_t a_pl_offset;
 off_t a_f_offset;
 size_t a_size;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_PAGEIN(vnode_t, upl_t, upl_offset_t, off_t, size_t, int, vfs_context_t);
struct vnop_pageout_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 upl_t a_pl;
 upl_offset_t a_pl_offset;
 off_t a_f_offset;
 size_t a_size;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_PAGEOUT(vnode_t, upl_t, upl_offset_t, off_t, size_t, int, vfs_context_t);
struct vnop_searchfs_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 void *a_searchparams1;
 void *a_searchparams2;
 struct attrlist *a_searchattrs;
 uint32_t a_maxmatches;
 struct timeval *a_timelimit;
 struct attrlist *a_returnattrs;
 uint32_t *a_nummatches;
 uint32_t a_scriptcode;
 uint32_t a_options;
 struct uio *a_uio;
 struct searchstate *a_searchstate;
 vfs_context_t a_context;
};
extern errno_t VNOP_SEARCHFS(vnode_t, void *, void *, struct attrlist *, uint32_t, struct timeval *, struct attrlist *, uint32_t *, uint32_t, uint32_t, struct uio *, struct searchstate *, vfs_context_t);
struct vnop_copyfile_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_fvp;
 vnode_t a_tdvp;
 vnode_t a_tvp;
 struct componentname *a_tcnp;
 int a_mode;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_COPYFILE(vnode_t, vnode_t, vnode_t, struct componentname *, int, int, vfs_context_t);
struct vnop_getxattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 const char * a_name;
 uio_t a_uio;
 size_t *a_size;
 int a_options;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_getxattr_desc;
extern errno_t VNOP_GETXATTR(vnode_t, const char *, uio_t, size_t *, int, vfs_context_t);
struct vnop_setxattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 const char * a_name;
 uio_t a_uio;
 int a_options;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_setxattr_desc;
extern errno_t VNOP_SETXATTR(vnode_t, const char *, uio_t, int, vfs_context_t);
struct vnop_removexattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 const char * a_name;
 int a_options;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_removexattr_desc;
extern errno_t VNOP_REMOVEXATTR(vnode_t, const char *, int, vfs_context_t);
struct vnop_listxattr_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 uio_t a_uio;
 size_t *a_size;
 int a_options;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_listxattr_desc;
extern errno_t VNOP_LISTXATTR(vnode_t, uio_t, size_t *, int, vfs_context_t);
struct vnop_blktooff_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 daddr64_t a_lblkno;
 off_t *a_offset;
};
extern errno_t VNOP_BLKTOOFF(vnode_t, daddr64_t, off_t *);
struct vnop_offtoblk_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 off_t a_offset;
 daddr64_t *a_lblkno;
};
extern errno_t VNOP_OFFTOBLK(vnode_t, off_t, daddr64_t *);
struct vnop_blockmap_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 off_t a_foffset;
 size_t a_size;
 daddr64_t *a_bpn;
 size_t *a_run;
 void *a_poff;
 int a_flags;
 vfs_context_t a_context;
};
extern errno_t VNOP_BLOCKMAP(vnode_t, off_t, size_t, daddr64_t *, size_t *, void *,
                             int, vfs_context_t);
struct vnop_strategy_args {
 struct vnodeop_desc *a_desc;
 struct buf *a_bp;
};
extern errno_t VNOP_STRATEGY(struct buf *bp);
struct vnop_bwrite_args {
 struct vnodeop_desc *a_desc;
 buf_t a_bp;
};
extern errno_t VNOP_BWRITE(buf_t);
struct vnop_kqfilt_add_args {
 struct vnodeop_desc *a_desc;
 struct vnode *a_vp;
 struct knote *a_kn;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_kqfilt_add_desc;
extern errno_t VNOP_KQFILT_ADD(vnode_t , struct knote *, vfs_context_t);
struct vnop_kqfilt_remove_args {
 struct vnodeop_desc *a_desc;
 struct vnode *a_vp;
 uintptr_t a_ident;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_kqfilt_remove_desc;
errno_t VNOP_KQFILT_REMOVE(vnode_t , uintptr_t , vfs_context_t);
#define VNODE_MONITOR_BEGIN 0x01
#define VNODE_MONITOR_END 0x02
#define VNODE_MONITOR_UPDATE 0x04
struct vnop_monitor_args {
 struct vnodeop_desc *a_desc;
 vnode_t a_vp;
 uint32_t a_events;
 uint32_t a_flags;
 void *a_handle;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_monitor_desc;
errno_t VNOP_MONITOR(vnode_t , uint32_t, uint32_t, void*, vfs_context_t);
struct label;
struct vnop_setlabel_args {
 struct vnodeop_desc *a_desc;
 struct vnode *a_vp;
 struct label *a_vl;
 vfs_context_t a_context;
};
extern struct vnodeop_desc vnop_setlabel_desc;
errno_t VNOP_SETLABEL(vnode_t, struct label *, vfs_context_t);


errno_t vnode_create(uint32_t, uint32_t, void *, vnode_t *);
int vnode_addfsref(vnode_t);
int vnode_removefsref(vnode_t);
int vnode_hasdirtyblks(vnode_t);
int vnode_hascleanblks(vnode_t);
#define VNODE_ASYNC_THROTTLE 15
int vnode_waitforwrites(vnode_t, int, int, int, const char *);
void vnode_startwrite(vnode_t);
void vnode_writedone(vnode_t);
enum vtype vnode_vtype(vnode_t);
uint32_t vnode_vid(vnode_t);
mount_t vnode_mountedhere(vnode_t vp);
mount_t vnode_mount(vnode_t);
dev_t vnode_specrdev(vnode_t);
void * vnode_fsnode(vnode_t);
void vnode_clearfsnode(vnode_t);
int vnode_isvroot(vnode_t);
int vnode_issystem(vnode_t);
int vnode_ismount(vnode_t);
int vnode_isreg(vnode_t);
int vnode_isdir(vnode_t);
int vnode_islnk(vnode_t);
int vnode_isfifo(vnode_t);
int vnode_isblk(vnode_t);
int vnode_ischr(vnode_t);
int vnode_isswap(vnode_t vp);
int vnode_isnamedstream(vnode_t);
int vnode_ismountedon(vnode_t);
void vnode_setmountedon(vnode_t);
void vnode_clearmountedon(vnode_t);
int vnode_isrecycled(vnode_t);
int vnode_isnocache(vnode_t);
int vnode_israge(vnode_t);
int vnode_needssnapshots(vnode_t);
void vnode_setnocache(vnode_t);
void vnode_clearnocache(vnode_t);
int vnode_isnoreadahead(vnode_t);
void vnode_setnoreadahead(vnode_t);
void vnode_clearnoreadahead(vnode_t);
void vnode_settag(vnode_t, int);
int vnode_tag(vnode_t);
int vnode_getattr(vnode_t vp, struct vnode_attr *vap, vfs_context_t ctx);
int vnode_setattr(vnode_t vp, struct vnode_attr *vap, vfs_context_t ctx);
vnode_t vfs_rootvnode(void);
void vnode_uncache_credentials(vnode_t vp);
void vnode_setmultipath(vnode_t vp);
uint32_t vnode_vfsmaxsymlen(vnode_t);
int vnode_vfsisrdonly(vnode_t);
int vnode_vfstypenum(vnode_t);
void vnode_vfsname(vnode_t, char *);
int vnode_vfs64bitready(vnode_t);
int vfs_context_get_special_port(vfs_context_t, int, ipc_port_t *);
int vfs_context_set_special_port(vfs_context_t, int, ipc_port_t);
proc_t vfs_context_proc(vfs_context_t);
kauth_cred_t vfs_context_ucred(vfs_context_t);
int vfs_context_pid(vfs_context_t);
int vfs_context_issignal(vfs_context_t, sigset_t);
int vfs_context_suser(vfs_context_t);
int vfs_context_is64bit(vfs_context_t);
vfs_context_t vfs_context_create(vfs_context_t);
int vfs_context_rele(vfs_context_t);
vfs_context_t vfs_context_current(void);
int vfs_context_bind(vfs_context_t);
int vfs_ctx_skipatime(vfs_context_t ctx);
int vflush(struct mount *mp, struct vnode *skipvp, int flags);
int vnode_get(vnode_t);
int vnode_getwithvid(vnode_t, uint32_t);
int vnode_getwithvid_drainok(vnode_t, uint32_t);
int vnode_getwithref(vnode_t);
int vnode_put(vnode_t);
int vnode_ref(vnode_t);
void vnode_rele(vnode_t);
int vnode_isinuse(vnode_t, int);
int vnode_recycle(vnode_t);
#define VNODE_EVENT_DELETE 0x00000001
#define VNODE_EVENT_WRITE 0x00000002
#define VNODE_EVENT_EXTEND 0x00000004
#define VNODE_EVENT_ATTRIB 0x00000008
#define VNODE_EVENT_LINK 0x00000010
#define VNODE_EVENT_RENAME 0x00000020
#define VNODE_EVENT_PERMS 0x00000040
#define VNODE_EVENT_FILE_CREATED 0x00000080
#define VNODE_EVENT_DIR_CREATED 0x00000100
#define VNODE_EVENT_FILE_REMOVED 0x00000200
#define VNODE_EVENT_DIR_REMOVED 0x00000400
#define VNODE_NOTIFY_ATTRS (VNODE_ATTR_BIT(va_fsid) | VNODE_ATTR_BIT(va_fileid)| VNODE_ATTR_BIT(va_mode) | VNODE_ATTR_BIT(va_uid) | VNODE_ATTR_BIT(va_gid) | VNODE_ATTR_BIT(va_dirlinkcount) | VNODE_ATTR_BIT(va_nlink))
int vnode_notify(vnode_t, uint32_t, struct vnode_attr*);
int vnode_ismonitored(vnode_t);
int vnode_isdyldsharedcache(vnode_t);
int vfs_get_notify_attributes(struct vnode_attr *vap);
int vn_getpath_fsenter(struct vnode *vp, char *pathbuf, int *len);
#define VNODE_UPDATE_PARENT 0x01
#define VNODE_UPDATE_NAME 0x02
#define VNODE_UPDATE_CACHE 0x04
#define VNODE_UPDATE_PURGE 0x08
void vnode_update_identity(vnode_t vp, vnode_t dvp, const char *name, int name_len, uint32_t name_hashval, int flags);
int vn_bwrite(struct vnop_bwrite_args *ap);
int vnode_authorize(vnode_t , vnode_t , kauth_action_t, vfs_context_t);
int vnode_authattr(vnode_t, struct vnode_attr *, kauth_action_t *, vfs_context_t);
int vnode_authattr_new(vnode_t , struct vnode_attr *, int , vfs_context_t);
errno_t vnode_close(vnode_t, int, vfs_context_t);
int vn_getpath(struct vnode *vp, char *pathbuf, int *len);
#define VNODE_LOOKUP_NOFOLLOW 0x01
#define VNODE_LOOKUP_NOCROSSMOUNT 0x02
#define VNODE_LOOKUP_DOWHITEOUT 0x04
errno_t vnode_lookup(const char *, int, vnode_t *, vfs_context_t);
errno_t vnode_open(const char *, int, int, int, vnode_t *, vfs_context_t);
int vnode_iterate(struct mount *, int, int (*)(struct vnode *, void *), void *);
#define VNODE_RELOAD 0x01
#define VNODE_WAIT 0x02
#define VNODE_WRITEABLE 0x04
#define VNODE_WITHID 0x08
#define VNODE_NOLOCK_INTERNAL 0x10
#define VNODE_NODEAD 0x20
#define VNODE_NOSUSPEND 0x40
#define VNODE_ITERATE_ALL 0x80
#define VNODE_ITERATE_ACTIVE 0x100
#define VNODE_ITERATE_INACTIVE 0x200
#define VNODE_ALWAYS 0x400
#define VNODE_DRAINO 0x800
#define VNODE_RETURNED 0
#define VNODE_RETURNED_DONE 1
#define VNODE_CLAIMED 2
#define VNODE_CLAIMED_DONE 3
int vn_revoke(vnode_t vp, int flags, vfs_context_t);
int cache_lookup(vnode_t dvp, vnode_t *vpp, struct componentname *cnp);
void cache_enter(vnode_t dvp, vnode_t vp, struct componentname *cnp);
void cache_purge(vnode_t vp);
void cache_purge_negatives(vnode_t vp);
const char *vfs_addname(const char *name, uint32_t len, uint32_t nc_hash, uint32_t flags);
int vfs_removename(const char *name);
int vcount(vnode_t vp);
int vn_path_package_check(vnode_t vp, char *path, int pathlen, int *component);
int vn_searchfs_inappropriate_name(const char *name, int len);
int vn_rdwr(enum uio_rw, vnode_t, caddr_t, int, off_t, enum uio_seg, int, kauth_cred_t, int *, proc_t);
const char *vnode_getname(vnode_t vp);
void vnode_putname(const char *name);
vnode_t vnode_getparent(vnode_t vp);
int vnode_lookup_continue_needed(vnode_t vp, struct componentname *cnp);
int vnode_istty(vnode_t vp);
struct stat;
int vn_stat(struct vnode *vp, void * sb, kauth_filesec_t *xsec, int isstat64, vfs_context_t ctx);
int vn_stat_noauth(struct vnode *vp, void * sb, kauth_filesec_t *xsec, int isstat64, vfs_context_t ctx);
int vaccess(mode_t file_mode, uid_t uid, gid_t gid,
     mode_t acc_mode, kauth_cred_t cred);
int check_mountedon(dev_t dev, enum vtype type, int *errorp);
int vn_getcdhash(struct vnode *vp, off_t offset, unsigned char *cdhash);
void vnode_reclaim(vnode_t);
vfs_context_t vfs_context_kernel(void);
int vfs_context_issuser(vfs_context_t);
vnode_t vfs_context_cwd(vfs_context_t);
vnode_t current_rootdir(void);
vnode_t current_workingdir(void);
void *vnode_vfsfsprivate(vnode_t);
struct vfsstatfs *vnode_vfsstatfs(vnode_t);
uint32_t vnode_vfsvisflags(vnode_t);
uint32_t vnode_vfscmdflags(vnode_t);
int vnode_is_openevt(vnode_t);
void vnode_set_openevt(vnode_t);
void vnode_clear_openevt(vnode_t);
int vnode_isstandard(vnode_t);
int vnode_makeimode(int, int);
enum vtype vnode_iftovt(int);
int vnode_vttoif(enum vtype);
int vnode_isshadow(vnode_t);
vnode_t vnode_parent(vnode_t);
void vnode_setparent(vnode_t, vnode_t);
const char *vnode_getname_printable(vnode_t vp);
void vnode_putname_printable(const char *name);
void vnode_setname(vnode_t, char *);
int vnode_isnoflush(vnode_t);
void vnode_setnoflush(vnode_t);
void vnode_clearnoflush(vnode_t);
thread_t vfs_context_thread(vfs_context_t);

#define _SYS_NAMEI_H_ 
#define LOCKLEAF 0x0004
#define LOCKPARENT 0x0008
#define WANTPARENT 0x0010
#define NAMEDRSRCFORK NAMEDSTREAMS
#define _SYS_MOUNT_H_ 
#define _SYS_ATTR_H_ 
#define FSOPT_NOFOLLOW 0x00000001
#define FSOPT_NOINMEMUPDATE 0x00000002
#define FSOPT_REPORT_FULLSIZE 0x00000004
#define FSOPT_PACK_INVAL_ATTRS 0x00000008
#define SEARCHFS_MAX_SEARCHPARMS 4096
typedef u_int32_t text_encoding_t;
typedef u_int32_t fsobj_type_t;
typedef u_int32_t fsobj_tag_t;
typedef u_int32_t fsfile_type_t;
typedef u_int32_t fsvolid_t;
typedef struct fsobj_id {
 u_int32_t fid_objno;
 u_int32_t fid_generation;
} fsobj_id_t;
typedef u_int32_t attrgroup_t;
struct attrlist {
 u_short bitmapcount;
 u_int16_t reserved;
 attrgroup_t commonattr;
 attrgroup_t volattr;
 attrgroup_t dirattr;
 attrgroup_t fileattr;
 attrgroup_t forkattr;
};
#define ATTR_BIT_MAP_COUNT 5
typedef struct attribute_set {
 attrgroup_t commonattr;
 attrgroup_t volattr;
 attrgroup_t dirattr;
 attrgroup_t fileattr;
 attrgroup_t forkattr;
} attribute_set_t;
typedef struct attrreference {
 int32_t attr_dataoffset;
 u_int32_t attr_length;
} attrreference_t;
struct diskextent {
 u_int32_t startblock;
 u_int32_t blockcount;
};
typedef struct diskextent extentrecord[8];
typedef u_int32_t vol_capabilities_set_t[4];
#define VOL_CAPABILITIES_FORMAT 0
#define VOL_CAPABILITIES_INTERFACES 1
#define VOL_CAPABILITIES_RESERVED1 2
#define VOL_CAPABILITIES_RESERVED2 3
typedef struct vol_capabilities_attr {
 vol_capabilities_set_t capabilities;
 vol_capabilities_set_t valid;
} vol_capabilities_attr_t;
#define ATTR_MAX_BUFFER 8192
#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
#define VOL_CAP_FMT_HARDLINKS 0x00000004
#define VOL_CAP_FMT_JOURNAL 0x00000008
#define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010
#define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020
#define VOL_CAP_FMT_SPARSE_FILES 0x00000040
#define VOL_CAP_FMT_ZERO_RUNS 0x00000080
#define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100
#define VOL_CAP_FMT_CASE_PRESERVING 0x00000200
#define VOL_CAP_FMT_FAST_STATFS 0x00000400
#define VOL_CAP_FMT_2TB_FILESIZE 0x00000800
#define VOL_CAP_FMT_OPENDENYMODES 0x00001000
#define VOL_CAP_FMT_HIDDEN_FILES 0x00002000
#define VOL_CAP_FMT_PATH_FROM_ID 0x00004000
#define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000
#define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000
#define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000
#define VOL_CAP_INT_SEARCHFS 0x00000001
#define VOL_CAP_INT_ATTRLIST 0x00000002
#define VOL_CAP_INT_NFSEXPORT 0x00000004
#define VOL_CAP_INT_READDIRATTR 0x00000008
#define VOL_CAP_INT_EXCHANGEDATA 0x00000010
#define VOL_CAP_INT_COPYFILE 0x00000020
#define VOL_CAP_INT_ALLOCATE 0x00000040
#define VOL_CAP_INT_VOL_RENAME 0x00000080
#define VOL_CAP_INT_ADVLOCK 0x00000100
#define VOL_CAP_INT_FLOCK 0x00000200
#define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400
#define VOL_CAP_INT_USERACCESS 0x00000800
#define VOL_CAP_INT_MANLOCK 0x00001000
#define VOL_CAP_INT_NAMEDSTREAMS 0x00002000
#define VOL_CAP_INT_EXTENDED_ATTR 0x00004000
typedef struct vol_attributes_attr {
 attribute_set_t validattr;
 attribute_set_t nativeattr;
} vol_attributes_attr_t;
#define ATTR_CMN_NAME 0x00000001
#define ATTR_CMN_DEVID 0x00000002
#define ATTR_CMN_FSID 0x00000004
#define ATTR_CMN_OBJTYPE 0x00000008
#define ATTR_CMN_OBJTAG 0x00000010
#define ATTR_CMN_OBJID 0x00000020
#define ATTR_CMN_OBJPERMANENTID 0x00000040
#define ATTR_CMN_PAROBJID 0x00000080
#define ATTR_CMN_SCRIPT 0x00000100
#define ATTR_CMN_CRTIME 0x00000200
#define ATTR_CMN_MODTIME 0x00000400
#define ATTR_CMN_CHGTIME 0x00000800
#define ATTR_CMN_ACCTIME 0x00001000
#define ATTR_CMN_BKUPTIME 0x00002000
#define ATTR_CMN_FNDRINFO 0x00004000
#define ATTR_CMN_OWNERID 0x00008000
#define ATTR_CMN_GRPID 0x00010000
#define ATTR_CMN_ACCESSMASK 0x00020000
#define ATTR_CMN_FLAGS 0x00040000
#define ATTR_CMN_USERACCESS 0x00200000
#define ATTR_CMN_EXTENDED_SECURITY 0x00400000
#define ATTR_CMN_UUID 0x00800000
#define ATTR_CMN_GRPUUID 0x01000000
#define ATTR_CMN_FILEID 0x02000000
#define ATTR_CMN_PARENTID 0x04000000
#define ATTR_CMN_FULLPATH 0x08000000
#define ATTR_CMN_ADDEDTIME 0x10000000
#define ATTR_CMN_RETURNED_ATTRS 0x80000000
#define ATTR_CMN_VALIDMASK 0x9FE7FFFF
#define ATTR_CMN_SETMASK 0x01C7FF00
#define ATTR_CMN_VOLSETMASK 0x00006700
#define ATTR_VOL_FSTYPE 0x00000001
#define ATTR_VOL_SIGNATURE 0x00000002
#define ATTR_VOL_SIZE 0x00000004
#define ATTR_VOL_SPACEFREE 0x00000008
#define ATTR_VOL_SPACEAVAIL 0x00000010
#define ATTR_VOL_MINALLOCATION 0x00000020
#define ATTR_VOL_ALLOCATIONCLUMP 0x00000040
#define ATTR_VOL_IOBLOCKSIZE 0x00000080
#define ATTR_VOL_OBJCOUNT 0x00000100
#define ATTR_VOL_FILECOUNT 0x00000200
#define ATTR_VOL_DIRCOUNT 0x00000400
#define ATTR_VOL_MAXOBJCOUNT 0x00000800
#define ATTR_VOL_MOUNTPOINT 0x00001000
#define ATTR_VOL_NAME 0x00002000
#define ATTR_VOL_MOUNTFLAGS 0x00004000
#define ATTR_VOL_MOUNTEDDEVICE 0x00008000
#define ATTR_VOL_ENCODINGSUSED 0x00010000
#define ATTR_VOL_CAPABILITIES 0x00020000
#define ATTR_VOL_UUID 0x00040000
#define ATTR_VOL_ATTRIBUTES 0x40000000
#define ATTR_VOL_INFO 0x80000000
#define ATTR_VOL_VALIDMASK 0xC007FFFF
#define ATTR_VOL_SETMASK 0x80002000
#define ATTR_DIR_LINKCOUNT 0x00000001
#define ATTR_DIR_ENTRYCOUNT 0x00000002
#define ATTR_DIR_MOUNTSTATUS 0x00000004
#define DIR_MNTSTATUS_MNTPOINT 0x00000001
#define DIR_MNTSTATUS_TRIGGER 0x00000002
#define ATTR_DIR_VALIDMASK 0x00000007
#define ATTR_DIR_SETMASK 0x00000000
#define ATTR_FILE_LINKCOUNT 0x00000001
#define ATTR_FILE_TOTALSIZE 0x00000002
#define ATTR_FILE_ALLOCSIZE 0x00000004
#define ATTR_FILE_IOBLOCKSIZE 0x00000008
#define ATTR_FILE_DEVTYPE 0x00000020
#define ATTR_FILE_FORKCOUNT 0x00000080
#define ATTR_FILE_FORKLIST 0x00000100
#define ATTR_FILE_DATALENGTH 0x00000200
#define ATTR_FILE_DATAALLOCSIZE 0x00000400
#define ATTR_FILE_RSRCLENGTH 0x00001000
#define ATTR_FILE_RSRCALLOCSIZE 0x00002000
#define ATTR_FILE_VALIDMASK 0x000037FF
#define ATTR_FILE_SETMASK 0x00000020
#define ATTR_FORK_TOTALSIZE 0x00000001
#define ATTR_FORK_ALLOCSIZE 0x00000002
#define ATTR_FORK_VALIDMASK 0x00000003
#define ATTR_FORK_SETMASK 0x00000000
#define ATTR_CMN_NAMEDATTRCOUNT 0x00080000
#define ATTR_CMN_NAMEDATTRLIST 0x00100000
#define ATTR_FILE_CLUMPSIZE 0x00000010
#define ATTR_FILE_FILETYPE 0x00000040
#define ATTR_FILE_DATAEXTENTS 0x00000800
#define ATTR_FILE_RSRCEXTENTS 0x00004000
#define SRCHFS_START 0x00000001
#define SRCHFS_MATCHPARTIALNAMES 0x00000002
#define SRCHFS_MATCHDIRS 0x00000004
#define SRCHFS_MATCHFILES 0x00000008
#define SRCHFS_SKIPLINKS 0x00000010
#define SRCHFS_SKIPINVISIBLE 0x00000020
#define SRCHFS_SKIPPACKAGES 0x00000040
#define SRCHFS_SKIPINAPPROPRIATE 0x00000080
#define SRCHFS_NEGATEPARAMS 0x80000000
#define SRCHFS_VALIDOPTIONSMASK 0x800000FF
struct fssearchblock {
 struct attrlist *returnattrs;
 void *returnbuffer;
 size_t returnbuffersize;
 u_long maxmatches;
 struct timeval timelimit;
 void *searchparams1;
 size_t sizeofsearchparams1;
 void *searchparams2;
 size_t sizeofsearchparams2;
 struct attrlist searchattrs;
};
struct user64_fssearchblock {
 user64_addr_t returnattrs;
 user64_addr_t returnbuffer;
 user64_size_t returnbuffersize;
 user64_ulong_t maxmatches;
 struct user64_timeval timelimit;
 user64_addr_t searchparams1;
 user64_size_t sizeofsearchparams1;
 user64_addr_t searchparams2;
 user64_size_t sizeofsearchparams2;
 struct attrlist searchattrs;
};
struct user32_fssearchblock {
 user32_addr_t returnattrs;
 user32_addr_t returnbuffer;
 user32_size_t returnbuffersize;
 user32_ulong_t maxmatches;
 struct user32_timeval timelimit;
 user32_addr_t searchparams1;
 user32_size_t sizeofsearchparams1;
 user32_addr_t searchparams2;
 user32_size_t sizeofsearchparams2;
 struct attrlist searchattrs;
};
struct searchstate {
 uint32_t ss_union_flags;
 uint32_t ss_union_layer;
 u_char ss_fsstate[548];
} __attribute__((packed));
#define FST_EOF (-1)
typedef struct fsid { int32_t val[2]; } fsid_t;
#define MFSNAMELEN 15
#define MFSTYPENAMELEN 16
#define MNAMELEN 90
#define __DARWIN_STRUCT_STATFS64 { uint32_t f_bsize; int32_t f_iosize; uint64_t f_blocks; uint64_t f_bfree; uint64_t f_bavail; uint64_t f_files; uint64_t f_ffree; fsid_t f_fsid; uid_t f_owner; uint32_t f_type; uint32_t f_flags; uint32_t f_fssubtype; char f_fstypename[MFSTYPENAMELEN]; char f_mntonname[MAXPATHLEN]; char f_mntfromname[MAXPATHLEN]; uint32_t f_reserved[8]; }
struct statfs64 { uint32_t f_bsize; int32_t f_iosize; uint64_t f_blocks; uint64_t f_bfree; uint64_t f_bavail; uint64_t f_files; uint64_t f_ffree; fsid_t f_fsid; uid_t f_owner; uint32_t f_type; uint32_t f_flags; uint32_t f_fssubtype; char f_fstypename[16]; char f_mntonname[1024]; char f_mntfromname[1024]; uint32_t f_reserved[8]; };
struct statfs {
 short f_otype;
 short f_oflags;
 long f_bsize;
 long f_iosize;
 long f_blocks;
 long f_bfree;
 long f_bavail;
 long f_files;
 long f_ffree;
 fsid_t f_fsid;
 uid_t f_owner;
 short f_reserved1;
 short f_type;
 long f_flags;
 long f_reserved2[2];
 char f_fstypename[15];
 char f_mntonname[90];
 char f_mntfromname[90];
 char f_reserved3;
 long f_reserved4[4];
};
#pragma pack(4)
struct vfsstatfs {
 uint32_t f_bsize;
 size_t f_iosize;
 uint64_t f_blocks;
 uint64_t f_bfree;
 uint64_t f_bavail;
 uint64_t f_bused;
 uint64_t f_files;
 uint64_t f_ffree;
 fsid_t f_fsid;
 uid_t f_owner;
 uint64_t f_flags;
 char f_fstypename[16];
 char f_mntonname[1024];
 char f_mntfromname[1024];
 uint32_t f_fssubtype;
 void *f_reserved[2];
};
#pragma pack()
#define VFSATTR_INIT(s) ((s)->f_supported = (s)->f_active = 0LL)
#define VFSATTR_SET_SUPPORTED(s,a) ((s)->f_supported |= VFSATTR_ ## a)
#define VFSATTR_IS_SUPPORTED(s,a) ((s)->f_supported & VFSATTR_ ## a)
#define VFSATTR_CLEAR_ACTIVE(s,a) ((s)->f_active &= ~VFSATTR_ ## a)
#define VFSATTR_IS_ACTIVE(s,a) ((s)->f_active & VFSATTR_ ## a)
#define VFSATTR_ALL_SUPPORTED(s) (((s)->f_active & (s)->f_supported) == (s)->f_active)
#define VFSATTR_WANTED(s,a) ((s)->f_active |= VFSATTR_ ## a)
#define VFSATTR_RETURN(s,a,x) do { (s)-> a = (x); VFSATTR_SET_SUPPORTED(s, a);} while(0)
#define VFSATTR_f_objcount (1LL<< 0)
#define VFSATTR_f_filecount (1LL<< 1)
#define VFSATTR_f_dircount (1LL<< 2)
#define VFSATTR_f_maxobjcount (1LL<< 3)
#define VFSATTR_f_bsize (1LL<< 4)
#define VFSATTR_f_iosize (1LL<< 5)
#define VFSATTR_f_blocks (1LL<< 6)
#define VFSATTR_f_bfree (1LL<< 7)
#define VFSATTR_f_bavail (1LL<< 8)
#define VFSATTR_f_bused (1LL<< 9)
#define VFSATTR_f_files (1LL<< 10)
#define VFSATTR_f_ffree (1LL<< 11)
#define VFSATTR_f_fsid (1LL<< 12)
#define VFSATTR_f_owner (1LL<< 13)
#define VFSATTR_f_capabilities (1LL<< 14)
#define VFSATTR_f_attributes (1LL<< 15)
#define VFSATTR_f_create_time (1LL<< 16)
#define VFSATTR_f_modify_time (1LL<< 17)
#define VFSATTR_f_access_time (1LL<< 18)
#define VFSATTR_f_backup_time (1LL<< 19)
#define VFSATTR_f_fssubtype (1LL<< 20)
#define VFSATTR_f_vol_name (1LL<< 21)
#define VFSATTR_f_signature (1LL<< 22)
#define VFSATTR_f_carbon_fsid (1LL<< 23)
#define VFSATTR_f_uuid (1LL<< 24)
#pragma pack(4)
struct vfs_attr {
 uint64_t f_supported;
 uint64_t f_active;
 uint64_t f_objcount;
 uint64_t f_filecount;
 uint64_t f_dircount;
 uint64_t f_maxobjcount;
 uint32_t f_bsize;
 size_t f_iosize;
 uint64_t f_blocks;
 uint64_t f_bfree;
 uint64_t f_bavail;
 uint64_t f_bused;
 uint64_t f_files;
 uint64_t f_ffree;
 fsid_t f_fsid;
 uid_t f_owner;
  vol_capabilities_attr_t f_capabilities;
 vol_attributes_attr_t f_attributes;
 struct timespec f_create_time;
 struct timespec f_modify_time;
 struct timespec f_access_time;
 struct timespec f_backup_time;
 uint32_t f_fssubtype;
 char *f_vol_name;
 uint16_t f_signature;
 uint16_t f_carbon_fsid;
 uuid_t f_uuid;
};
#pragma pack()
#define MNT_RDONLY 0x00000001
#define MNT_SYNCHRONOUS 0x00000002
#define MNT_NOEXEC 0x00000004
#define MNT_NOSUID 0x00000008
#define MNT_NODEV 0x00000010
#define MNT_UNION 0x00000020
#define MNT_ASYNC 0x00000040
#define MNT_CPROTECT 0x00000080
#define MNT_EXPORTED 0x00000100
#define MNT_QUARANTINE 0x00000400
#define MNT_LOCAL 0x00001000
#define MNT_QUOTA 0x00002000
#define MNT_ROOTFS 0x00004000
#define MNT_DOVOLFS 0x00008000
#define MNT_DONTBROWSE 0x00100000
#define MNT_IGNORE_OWNERSHIP 0x00200000
#define MNT_AUTOMOUNTED 0x00400000
#define MNT_JOURNALED 0x00800000
#define MNT_NOUSERXATTR 0x01000000
#define MNT_DEFWRITE 0x02000000
#define MNT_MULTILABEL 0x04000000
#define MNT_NOATIME 0x10000000
#define MNT_UNKNOWNPERMISSIONS MNT_IGNORE_OWNERSHIP
#define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | MNT_NOSUID | MNT_NODEV | MNT_UNION | MNT_ASYNC | MNT_EXPORTED | MNT_QUARANTINE | MNT_LOCAL | MNT_QUOTA | MNT_ROOTFS | MNT_DOVOLFS | MNT_DONTBROWSE | MNT_IGNORE_OWNERSHIP | MNT_AUTOMOUNTED | MNT_JOURNALED | MNT_NOUSERXATTR | MNT_DEFWRITE | MNT_MULTILABEL | MNT_NOATIME | MNT_CPROTECT)
#define MNT_UPDATE 0x00010000
#define MNT_NOBLOCK 0x00020000
#define MNT_RELOAD 0x00040000
#define MNT_FORCE 0x00080000
#define MNT_CMDFLAGS (MNT_UPDATE|MNT_NOBLOCK|MNT_RELOAD|MNT_FORCE)
#define VFS_GENERIC 0
#define VFS_NUMMNTOPS 1
#define VFS_MAXTYPENUM 1
#define VFS_CONF 2
#define VFS_SET_PACKAGE_EXTS 3
#define MNT_WAIT 1
#define MNT_NOWAIT 2
#define MNT_DWAIT 4
struct vfsconf {
 uint32_t vfc_reserved1;
 char vfc_name[15];
 int vfc_typenum;
 int vfc_refcount;
 int vfc_flags;
 uint32_t vfc_reserved2;
 uint32_t vfc_reserved3;
};
struct vfsidctl {
 int vc_vers;
 fsid_t vc_fsid;
 void *vc_ptr;
 size_t vc_len;
 u_int32_t vc_spare[12];
};
#define VFS_CTL_VERS1 0x01
struct user_vfsidctl {
       int vc_vers;
       fsid_t vc_fsid;
       user_addr_t vc_ptr __attribute((aligned(8)));
       user_size_t vc_len;
       u_int32_t vc_spare[12];
};
struct user32_vfsidctl {
       int vc_vers;
       fsid_t vc_fsid;
       user32_addr_t vc_ptr;
       user32_size_t vc_len;
       u_int32_t vc_spare[12];
};
union union_vfsidctl {
  struct user32_vfsidctl vc32;
  struct user_vfsidctl vc64;
};
#define VFS_CTL_STATFS 0x00010001
#define VFS_CTL_UMOUNT 0x00010002
#define VFS_CTL_QUERY 0x00010003
#define VFS_CTL_NEWADDR 0x00010004
#define VFS_CTL_TIMEO 0x00010005
#define VFS_CTL_NOLOCKS 0x00010006
#define VFS_CTL_SADDR 0x00010007
#define VFS_CTL_DISC 0x00010008
#define VFS_CTL_SERVERINFO 0x00010009
struct vfsquery {
 u_int32_t vq_flags;
 u_int32_t vq_spare[31];
};
struct vfs_server {
     int32_t vs_minutes;
     u_int8_t vs_server_name[256*3];
};
#define VQ_NOTRESP 0x0001
#define VQ_NEEDAUTH 0x0002
#define VQ_LOWDISK 0x0004
#define VQ_MOUNT 0x0008
#define VQ_UNMOUNT 0x0010
#define VQ_DEAD 0x0020
#define VQ_ASSIST 0x0040
#define VQ_NOTRESPLOCK 0x0080
#define VQ_UPDATE 0x0100
#define VQ_VERYLOWDISK 0x0200
#define VQ_SYNCEVENT 0x0400
#define VQ_SERVEREVENT 0x0800
#define VQ_FLAG1000 0x1000
#define VQ_FLAG2000 0x2000
#define VQ_FLAG4000 0x4000
#define VQ_FLAG8000 0x8000
struct vfsioattr {
 u_int32_t io_maxreadcnt;
 u_int32_t io_maxwritecnt;
 u_int32_t io_segreadcnt;
 u_int32_t io_segwritecnt;
 u_int32_t io_maxsegreadsize;
 u_int32_t io_maxsegwritesize;
 u_int32_t io_devblocksize;
 u_int32_t io_flags;
 void * io_reserved[2];
};
#define VFS_IOATTR_FLAGS_FUA 0x01
#define VFS_IOATTR_FLAGS_UNMAP 0x02
#define VFS_TBLTHREADSAFE 0x0001
#define VFS_TBLFSNODELOCK 0x0002
#define VFS_TBLNOTYPENUM 0x0008
#define VFS_TBLLOCALVOL 0x0010
#define VFS_TBL64BITREADY 0x0020
#define VFS_TBLNATIVEXATTR 0x0040
#define VFS_TBLDIRLINKS 0x0080
#define VFS_TBLUNMOUNT_PREFLIGHT 0x0100
#define VFS_TBLGENERICMNTARGS 0x0200
#define VFS_TBLREADDIR_EXTENDED 0x0400
#define VFS_TBLNOMACLABEL 0x1000
#define VFS_TBLVNOP_PAGEINV2 0x2000
#define VFS_TBLVNOP_PAGEOUTV2 0x4000
#define VFS_TBLVNOP_NOUPDATEID_RENAME 0x8000
struct vfs_fsentry {
 struct vfsops * vfe_vfsops;
 int vfe_vopcnt;
 struct vnodeopv_desc ** vfe_opvdescs;
 int vfe_fstypenum;
 char vfe_fsname[15];
 uint32_t vfe_flags;
    void * vfe_reserv[2];
 };
struct vfsops {
 int (*vfs_mount)(struct mount *mp, vnode_t devvp, user_addr_t data, vfs_context_t context);
 int (*vfs_start)(struct mount *mp, int flags, vfs_context_t context);
 int (*vfs_unmount)(struct mount *mp, int mntflags, vfs_context_t context);
 int (*vfs_root)(struct mount *mp, struct vnode **vpp, vfs_context_t context);
 int (*vfs_quotactl)(struct mount *mp, int cmds, uid_t uid, caddr_t arg, vfs_context_t context);
 int (*vfs_getattr)(struct mount *mp, struct vfs_attr *, vfs_context_t context);
 int (*vfs_sync)(struct mount *mp, int waitfor, vfs_context_t context);
 int (*vfs_vget)(struct mount *mp, ino64_t ino, struct vnode **vpp, vfs_context_t context);
 int (*vfs_fhtovp)(struct mount *mp, int fhlen, unsigned char *fhp, struct vnode **vpp,
                    vfs_context_t context);
 int (*vfs_vptofh)(struct vnode *vp, int *fhlen, unsigned char *fhp, vfs_context_t context);
 int (*vfs_init)(struct vfsconf *);
 int (*vfs_sysctl)(int *, u_int, user_addr_t, size_t *, user_addr_t, size_t, vfs_context_t context);
 int (*vfs_setattr)(struct mount *mp, struct vfs_attr *, vfs_context_t context);
 void *vfs_reserved[7];
};
#define VFS_RETURNED 0
#define VFS_RETURNED_DONE 1
#define VFS_CLAIMED 2
#define VFS_CLAIMED_DONE 3

extern int VFS_MOUNT(mount_t, vnode_t, user_addr_t, vfs_context_t);
extern int VFS_START(mount_t, int, vfs_context_t);
extern int VFS_UNMOUNT(mount_t, int, vfs_context_t);
extern int VFS_ROOT(mount_t, vnode_t *, vfs_context_t);
extern int VFS_QUOTACTL(mount_t, int, uid_t, caddr_t, vfs_context_t);
extern int VFS_GETATTR(mount_t, struct vfs_attr *, vfs_context_t);
extern int VFS_SETATTR(mount_t, struct vfs_attr *, vfs_context_t);
extern int VFS_SYNC(mount_t, int, vfs_context_t);
extern int VFS_VGET(mount_t, ino64_t, vnode_t *, vfs_context_t);
extern int VFS_FHTOVP(mount_t, int, unsigned char *, vnode_t *, vfs_context_t);
extern int VFS_VPTOFH(vnode_t, int *, unsigned char *, vfs_context_t);
int vfs_fsadd(struct vfs_fsentry *, vfstable_t *);
int vfs_fsremove(vfstable_t);
int vfs_iterate(int, int (*)(struct mount *, void *), void *);
int vfs_init_io_attributes(vnode_t, mount_t);
uint64_t vfs_flags(mount_t);
void vfs_setflags(mount_t, uint64_t);
void vfs_clearflags(mount_t, uint64_t);
int vfs_issynchronous(mount_t);
int vfs_iswriteupgrade(mount_t);
int vfs_isupdate(mount_t);
int vfs_isreload(mount_t);
int vfs_isforce(mount_t);
int vfs_isunmount(mount_t mp);
int vfs_isrdonly(mount_t);
int vfs_isrdwr(mount_t);
int vfs_authopaque(mount_t);
int vfs_authopaqueaccess(mount_t);
void vfs_setauthopaque(mount_t);
void vfs_setauthopaqueaccess(mount_t);
void vfs_clearauthopaque(mount_t);
void vfs_clearauthopaqueaccess(mount_t);
void vfs_setextendedsecurity(mount_t);
void vfs_clearextendedsecurity(mount_t);
void vfs_setlocklocal(mount_t);
int vfs_authcache_ttl(mount_t);
void vfs_setauthcache_ttl(mount_t, int);
void vfs_clearauthcache_ttl(mount_t);
#define CACHED_RIGHT_INFINITE_TTL ~0
uint32_t vfs_maxsymlen(mount_t);
void vfs_setmaxsymlen(mount_t, uint32_t);
void * vfs_fsprivate(mount_t);
void vfs_setfsprivate(mount_t, void *mntdata);
struct vfsstatfs * vfs_statfs(mount_t);
#define VFS_USER_EVENT 0
#define VFS_KERNEL_EVENT 1
int vfs_update_vfsstat(mount_t, vfs_context_t, int eventtype);
int vfs_typenum(mount_t);
void vfs_name(mount_t, char *);
int vfs_devblocksize(mount_t);
void vfs_ioattr(mount_t, struct vfsioattr *);
void vfs_setioattr(mount_t, struct vfsioattr *);
int vfs_64bitready(mount_t);
#define LK_NOWAIT 1
int vfs_busy(mount_t, int);
void vfs_unbusy(mount_t);
void vfs_getnewfsid(struct mount *);
mount_t vfs_getvfs(fsid_t *);
int vfs_mountedon(struct vnode *);
int vfs_unmountbyfsid(fsid_t *, int, vfs_context_t);
void vfs_event_signal(fsid_t *, u_int32_t, intptr_t);
void vfs_event_init(void);
int vfs_getbyid(fsid_t *fsid, ino64_t ino, vnode_t *vpp, vfs_context_t ctx);
int vfs_getattr(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx);
int vfs_setattr(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx);
int vfs_extendedsecurity(mount_t);
mount_t vfs_getvfs_by_mntonname(char *);
vnode_t vfs_vnodecovered(mount_t mp);
vnode_t vfs_devvp(mount_t mp);
int vfs_nativexattrs (mount_t mp);
void * vfs_mntlabel(mount_t mp);
void vfs_setunmountpreflight(mount_t mp);
void vfs_setcompoundopen(mount_t mp);
uint64_t vfs_throttle_mask(mount_t mp);
struct vnode_trigger_info;
int vfs_addtrigger(mount_t mp, const char *relpath, struct vnode_trigger_info *vtip, vfs_context_t ctx);
typedef enum {
 VTC_REPLACE,
 VTC_RELEASE
} vfs_trigger_callback_op_t;
typedef void vfs_trigger_callback_t(mount_t mp, vfs_trigger_callback_op_t op, void *data, vfs_context_t ctx);
int vfs_settriggercallback(fsid_t *fsid, vfs_trigger_callback_t vtc, void *data, uint32_t flags, vfs_context_t ctx);

#define _SYS_FILEDESC_H_ 
#define NDFILE 25
#define NDEXTENT 50
struct klist;
struct filedesc {
 struct fileproc **fd_ofiles;
 char *fd_ofileflags;
 struct vnode *fd_cdir;
 struct vnode *fd_rdir;
 int fd_nfiles;
 int fd_lastfile;
 int fd_freefile;
 u_short fd_cmask;
 int fd_knlistsize;
 struct klist *fd_knlist;
 u_long fd_knhashmask;
 struct klist *fd_knhash;
        int fd_flags;
};
#define FD_CHROOT 0x01
#define UF_EXCLOSE 0x01
#define UF_FORKCLOSE 0x02
#define UF_RESERVED 0x04
#define UF_CLOSING 0x08
#define UF_RESVWAIT 0x10
#define UF_INHERIT 0x20
#define UF_VALID_FLAGS (UF_EXCLOSE | UF_FORKCLOSE | UF_RESERVED | UF_CLOSING | UF_RESVWAIT | UF_INHERIT)
#define OFILESIZE (sizeof(struct file *) + sizeof(char))
extern int dupfdopen(struct filedesc *fdp,
    int indx, int dfd, int mode, int error);
extern int fdalloc(proc_t p, int want, int *result);
extern void fdrelse(proc_t p, int fd);
extern int fdavail(proc_t p, int n);
#define fdfile(p,fd) (&(p)->p_fd->fd_ofiles[(fd)])
#define fdflags(p,fd) (&(p)->p_fd->fd_ofileflags[(fd)])
extern int falloc(proc_t p, struct fileproc **resultfp, int *resultfd, vfs_context_t ctx);
typedef struct fileproc *(*fp_allocfn_t)(void *);
extern int falloc_withalloc(proc_t p, struct fileproc **resultfp,
    int *resultfd, vfs_context_t ctx,
    fp_allocfn_t fp_zalloc, void *crarg);
extern struct filedesc *fdcopy(proc_t p, struct vnode *uth_cdir);
extern void fdfree(proc_t p);
extern void fdexec(proc_t p, short flags);
#define PATHBUFLEN 256
struct nameidata {
 user_addr_t ni_dirp;
 enum uio_seg ni_segflg;
 struct vnode *ni_startdir;
 struct vnode *ni_rootdir;
        struct vnode *ni_usedvp;
 struct vnode *ni_vp;
 struct vnode *ni_dvp;
 u_int ni_pathlen;
 char *ni_next;
        char ni_pathbuf[256];
 u_long ni_loopcnt;
 struct componentname ni_cnd;
 int32_t ni_flag;
 int ni_ncgeneration;
};
#define NAMEI_CONTLOOKUP 0x002
#define NAMEI_TRAILINGSLASH 0x004
#define NAMEI_UNFINISHED 0x008
#define NAMEI_COMPOUNDOPEN 0x010
#define NAMEI_COMPOUNDREMOVE 0x020
#define NAMEI_COMPOUNDMKDIR 0x040
#define NAMEI_COMPOUNDRMDIR 0x080
#define NAMEI_COMPOUNDRENAME 0x100
#define NAMEI_COMPOUND_OP_MASK (NAMEI_COMPOUNDOPEN | NAMEI_COMPOUNDREMOVE | NAMEI_COMPOUNDMKDIR | NAMEI_COMPOUNDRMDIR | NAMEI_COMPOUNDRENAME)
#define NOCACHE 0x00000020
#define NOFOLLOW 0x00000000
#define SHAREDLEAF 0x00000080
#define MODMASK 0x100000fc
#define SAVENAME 0
#define NOCROSSMOUNT 0x00000100
#define RDONLY 0x00000200
#define HASBUF 0x00000400
#define DONOTAUTH 0x00000800
#define SAVESTART 0x00001000
#define ISSYMLINK 0x00010000
#define WILLBEDIR 0x00080000
#define AUDITVNPATH1 0x00100000
#define AUDITVNPATH2 0x00200000
#define USEDVP 0x00400000
#define CN_VOLFSPATH 0x00800000
#define UNIONCREATED 0x02000000
#define CN_NBMOUNTLOOK 0x20000000
#define CN_SKIPNAMECACHE 0x40000000
#define NDINIT(ndp,op,_unused_,flags,segflg,namep,ctx) { (ndp)->ni_cnd.cn_nameiop = op; (ndp)->ni_cnd.cn_flags = flags; if ((segflg) == UIO_USERSPACE) { (ndp)->ni_segflg = ((IS_64BIT_PROCESS(vfs_context_proc(ctx))) ? UIO_USERSPACE64 : UIO_USERSPACE32); } else { (ndp)->ni_segflg = segflg; } (ndp)->ni_dirp = namep; (ndp)->ni_cnd.cn_context = ctx; (ndp)->ni_flag = 0; (ndp)->ni_cnd.cn_ndp = (ndp); }
#define NCHASHMASK 0x7fffffff
struct namecache {
 struct { struct namecache *tqe_next; struct namecache **tqe_prev; } nc_entry;
 struct { struct namecache *le_next; struct namecache **le_prev; } nc_hash;
        struct { struct namecache *le_next; struct namecache **le_prev; } nc_child;
        union {
   struct { struct namecache *le_next; struct namecache **le_prev; } nc_link;
   struct { struct namecache *tqe_next; struct namecache **tqe_prev; } nc_negentry;
 } nc_un;
 vnode_t nc_dvp;
 vnode_t nc_vp;
        unsigned int nc_whiteout:1,
                         nc_hashval:31;
 const char *nc_name;
};
int namei(struct nameidata *ndp);
void nameidone(struct nameidata *);
int lookup(struct nameidata *ndp);
int relookup(struct vnode *dvp, struct vnode **vpp,
  struct componentname *cnp);
int lookup_traverse_union(vnode_t dvp, vnode_t *new_dvp, vfs_context_t ctx);
void lookup_compound_vnop_post_hook(int error, vnode_t dvp, vnode_t vp, struct nameidata *ndp, int did_create);
void cache_purgevfs(mount_t mp);
int cache_lookup_path(struct nameidata *ndp, struct componentname *cnp, vnode_t dp,
     vfs_context_t context, int *dp_authorized, vnode_t last_dp);
void vnode_cache_authorized_action(vnode_t vp, vfs_context_t context, kauth_action_t action);
void vnode_uncache_authorized_action(vnode_t vp, kauth_action_t action);
boolean_t vnode_cache_is_stale(vnode_t vp);
boolean_t vnode_cache_is_authorized(vnode_t vp, vfs_context_t context, kauth_action_t action);
int lookup_validate_creation_path(struct nameidata *ndp);
int namei_compound_available(vnode_t dp, struct nameidata *ndp);
struct nchstats {
 long ncs_goodhits;
 long ncs_neghits;
 long ncs_badhits;
 long ncs_miss;
 long ncs_pass2;
 long ncs_2passes;
        long ncs_stolen;
        long ncs_enters;
        long ncs_deletes;
        long ncs_badvid;
};
#define _BSD_SYS_VFS_CONTEXT_H_ 
#define _SYS_USER_H_ 
#define _SYS_RESOURCEVAR_H_ 
struct pstats {
 struct rusage p_ru;
 struct rusage p_cru;
 struct uprof {
  struct uprof *pr_next;
  caddr_t pr_base;
  u_int32_t pr_size;
  u_int32_t pr_off;
  u_int32_t pr_scale;
  u_int32_t pr_addr;
  u_int32_t pr_ticks;
 } p_prof;
 uint64_t ps_start;
 struct rusage_info_child ri_child;
 struct rusage_info_diskiobytes ri_diskiobytes;
 struct user_uprof {
  struct user_uprof *pr_next;
  user_addr_t pr_base;
  user_size_t pr_size;
  user_ulong_t pr_off;
  user_ulong_t pr_scale;
  user_ulong_t pr_addr;
  user_ulong_t pr_ticks;
 } user_p_prof;
};
struct plimit {
 struct rlimit pl_rlimit[9];
 int pl_refcnt;
};
#define ADDUPROF(p) addupc_task(p, (proc_is64bit((p)) ? (p)->p_stats->user_p_prof.pr_addr : CAST_USER_ADDR_T((p)->p_stats->p_prof.pr_addr)), (proc_is64bit((p)) ? (p)->p_stats->user_p_prof.pr_ticks : (p)->p_stats->p_prof.pr_ticks))
void addupc_intr(struct proc *p, uint32_t pc, u_int ticks);
void addupc_task(struct proc *p, user_addr_t pc, u_int ticks);
void calcru(struct proc *p, struct timeval *up, struct timeval *sp,
     struct timeval *ip);
void ruadd(struct rusage *ru, struct rusage *ru2);
void update_rusage_info_child(struct rusage_info_child *ru, struct rusage_info_v2 *ru2);
void proc_limitget(proc_t p, int whichi, struct rlimit * limp);
void proc_limitdrop(proc_t p, int exiting);
void proc_limitfork(proc_t parent, proc_t child);
int proc_limitreplace(proc_t p);
void proc_limitblock(proc_t);
void proc_limitunblock(proc_t);
#define _SYS_SIGNALVAR_H_ 
struct sigacts {
 user_addr_t ps_sigact[32];
 user_addr_t ps_trampact[32];
 sigset_t ps_catchmask[32];
 sigset_t ps_sigonstack;
 sigset_t ps_sigintr;
 sigset_t ps_sigreset;
 sigset_t ps_signodefer;
 sigset_t ps_siginfo;
 sigset_t ps_oldmask;
 int ps_flags;
 struct kern_sigaltstack ps_sigstk;
 int ps_sig;
 int ps_code;
 int ps_addr;
 sigset_t ps_usertramp;
 sigset_t ps_64regset;
};
#define SAS_OLDMASK 0x01
#define SAS_ALTSTACK 0x02
#define KERN_SIG_CATCH (void (*)(int))2
#define KERN_SIG_HOLD (void (*)(int))3
#define KERN_SIG_WAIT (void (*)(int))4
#define SIGACTION(p,sig) (p->p_sigacts->ps_sigact[(sig)])
#define SHOULDissignal(p,uthreadp) (((uthreadp)->uu_siglist) & ~((((uthreadp)->uu_sigmask) | (((p)->p_lflag & P_LTRACED) ? 0 : (p)->p_sigignore)) & ~sigcantmask))
#define CHECK_SIGNALS(p,thread,uthreadp) (!thread_should_halt(thread) && (SHOULDissignal(p,uthreadp)))
#define SA_KILL 0x01
#define SA_CORE 0x02
#define SA_STOP 0x04
#define SA_TTYSTOP 0x08
#define SA_IGNORE 0x10
#define SA_CONT 0x20
#define SA_CANTMASK 0x40
#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP))
int coredump(struct proc *p, uint32_t reserve_mb, int ignore_ulimit);
void execsigs(struct proc *p, thread_t thread);
void gsignal(int pgid, int sig);
int issignal_locked(struct proc *p);
int CURSIG(struct proc *p);
int clear_procsiglist(struct proc *p, int bit, int in_signalstart);
int set_procsigmask(struct proc *p, int bit);
void postsig_locked(int sig);
void siginit(struct proc *p);
void trapsignal(struct proc *p, int sig, unsigned code);
void pt_setrunnable(struct proc *p);
int hassigprop(int sig, int prop);
void sendsig(struct proc *, user_addr_t action, int sig,
 int returnmask, uint32_t code);
void psignal(struct proc *p, int sig);
void psignal_locked(struct proc *, int);
void pgsignal(struct pgrp *pgrp, int sig, int checkctty);
void tty_pgsignal(struct tty * tp, int sig, int checkctty);
void threadsignal(thread_t sig_actthread, int signum,
  mach_exception_code_t code);
int thread_issignal(proc_t p, thread_t th, sigset_t mask);
void psignal_vfork(struct proc *p, task_t new_task, thread_t thread,
  int signum);
void psignal_vtalarm(struct proc *);
void psignal_xcpu(struct proc *);
void psignal_sigprof(struct proc *);
void signal_setast(thread_t sig_actthread);
void pgsigio(pid_t pgid, int signalnum);
void sig_lock_to_exit(struct proc *p);
int sig_try_locked(struct proc *p);
#define _SYS_SYSCTL_H_ 
#define LIBKERN_SYSCTL_H 

int sysctlbyname(const char *, void *, size_t *, void *, size_t);

#define _SYS_LINKER_SET_H_ 
#define _MACHO_LOADER_H_ 
#define _ARCHITECTURE_BYTE_ORDER_H_ 
#define _OS_OSBYTEORDER_H 
#define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x)
#define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x)
#define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x)
#define _OS_OSBYTEORDERI386_H 
#define OS_INLINE static __inline__
static __inline__
uint16_t
OSReadSwapInt16(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    uint16_t result;
    result = *(volatile uint16_t *)((uintptr_t)base + byteOffset);
    return _OSSwapInt16(result);
}
static __inline__
uint32_t
OSReadSwapInt32(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    uint32_t result;
    result = *(volatile uint32_t *)((uintptr_t)base + byteOffset);
    return _OSSwapInt32(result);
}
static __inline__
uint64_t
OSReadSwapInt64(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    uint64_t result;
    result = *(volatile uint64_t *)((uintptr_t)base + byteOffset);
    return _OSSwapInt64(result);
}
static __inline__
void
OSWriteSwapInt16(
    volatile void * base,
    uintptr_t byteOffset,
    uint16_t data
)
{
    *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data);
}
static __inline__
void
OSWriteSwapInt32(
    volatile void * base,
    uintptr_t byteOffset,
    uint32_t data
)
{
    *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data);
}
static __inline__
void
OSWriteSwapInt64(
    volatile void * base,
    uintptr_t byteOffset,
    uint64_t data
)
{
    *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
}
#define OSSwapInt16(x) __DARWIN_OSSwapInt16(x)
#define OSSwapInt32(x) __DARWIN_OSSwapInt32(x)
#define OSSwapInt64(x) __DARWIN_OSSwapInt64(x)
enum {
    OSUnknownByteOrder,
    OSLittleEndian,
    OSBigEndian
};
static __inline__
int32_t
OSHostByteOrder(void) {
    return OSLittleEndian;
}
#define OSReadBigInt(x,y) OSReadBigInt32(x, y)
#define OSWriteBigInt(x,y,z) OSWriteBigInt32(x, y, z)
#define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x)
#define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x)
#define OSReadLittleInt(x,y) OSReadLittleInt32(x, y)
#define OSWriteLittleInt(x,y,z) OSWriteLittleInt32(x, y, z)
#define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x)
#define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x)
static __inline__
uint16_t
_OSReadInt16(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    return *(volatile uint16_t *)((uintptr_t)base + byteOffset);
}
static __inline__
uint32_t
_OSReadInt32(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    return *(volatile uint32_t *)((uintptr_t)base + byteOffset);
}
static __inline__
uint64_t
_OSReadInt64(
    const volatile void * base,
    uintptr_t byteOffset
)
{
    return *(volatile uint64_t *)((uintptr_t)base + byteOffset);
}
static __inline__
void
_OSWriteInt16(
    volatile void * base,
    uintptr_t byteOffset,
    uint16_t data
)
{
    *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data;
}
static __inline__
void
_OSWriteInt32(
    volatile void * base,
    uintptr_t byteOffset,
    uint32_t data
)
{
    *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data;
}
static __inline__
void
_OSWriteInt64(
    volatile void * base,
    uintptr_t byteOffset,
    uint64_t data
)
{
    *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data;
}
#define OSReadBigInt16(base,byteOffset) OSReadSwapInt16(base, byteOffset)
#define OSReadBigInt32(base,byteOffset) OSReadSwapInt32(base, byteOffset)
#define OSReadBigInt64(base,byteOffset) OSReadSwapInt64(base, byteOffset)
#define OSWriteBigInt16(base,byteOffset,data) OSWriteSwapInt16(base, byteOffset, data)
#define OSWriteBigInt32(base,byteOffset,data) OSWriteSwapInt32(base, byteOffset, data)
#define OSWriteBigInt64(base,byteOffset,data) OSWriteSwapInt64(base, byteOffset, data)
#define OSReadLittleInt16(base,byteOffset) _OSReadInt16(base, byteOffset)
#define OSReadLittleInt32(base,byteOffset) _OSReadInt32(base, byteOffset)
#define OSReadLittleInt64(base,byteOffset) _OSReadInt64(base, byteOffset)
#define OSWriteLittleInt16(base,byteOffset,data) _OSWriteInt16(base, byteOffset, data)
#define OSWriteLittleInt32(base,byteOffset,data) _OSWriteInt32(base, byteOffset, data)
#define OSWriteLittleInt64(base,byteOffset,data) _OSWriteInt64(base, byteOffset, data)
#define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x)
#define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x)
#define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x)
#define OSSwapHostToBigInt16(x) OSSwapInt16(x)
#define OSSwapHostToBigInt32(x) OSSwapInt32(x)
#define OSSwapHostToBigInt64(x) OSSwapInt64(x)
#define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x))
#define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x))
#define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x))
#define OSSwapHostToLittleInt16(x) ((uint16_t)(x))
#define OSSwapHostToLittleInt32(x) ((uint32_t)(x))
#define OSSwapHostToLittleInt64(x) ((uint64_t)(x))
#define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x)
#define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x)
#define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x)
#define OSSwapBigToHostInt16(x) OSSwapInt16(x)
#define OSSwapBigToHostInt32(x) OSSwapInt32(x)
#define OSSwapBigToHostInt64(x) OSSwapInt64(x)
#define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x))
#define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x))
#define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x))
#define OSSwapLittleToHostInt16(x) ((uint16_t)(x))
#define OSSwapLittleToHostInt32(x) ((uint32_t)(x))
#define OSSwapLittleToHostInt64(x) ((uint64_t)(x))
typedef unsigned long NXSwappedFloat;
typedef unsigned long long NXSwappedDouble;
static __inline__
unsigned short
NXSwapShort(
    unsigned short inv
)
{
    return (unsigned short)((__uint16_t)(__builtin_constant_p((uint16_t)inv) ? ((__uint16_t)((((__uint16_t)((uint16_t)inv) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)inv) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)inv)));
}
static __inline__
unsigned int
NXSwapInt(
    unsigned int inv
)
{
    return (unsigned int)(__builtin_constant_p((uint32_t)inv) ? ((__uint32_t)((((__uint32_t)((uint32_t)inv) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)inv) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)inv) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)inv) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)inv));
}
static __inline__
unsigned long
NXSwapLong(
    unsigned long inv
)
{
    return (unsigned long)(__builtin_constant_p((uint32_t)inv) ? ((__uint32_t)((((__uint32_t)((uint32_t)inv) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)inv) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)inv) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)inv) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)inv));
}
static __inline__
unsigned long long
NXSwapLongLong(
    unsigned long long inv
)
{
    return (unsigned long long)(__builtin_constant_p((uint64_t)inv) ? ((__uint64_t)((((__uint64_t)((uint64_t)inv) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)inv) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)inv) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)inv) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)inv) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)inv) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)inv) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)inv) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)inv));
}
static __inline__ NXSwappedFloat
NXConvertHostFloatToSwapped(float x)
{
    union fconv {
        float number;
        NXSwappedFloat sf;
    } u;
    u.number = x;
    return u.sf;
}
static __inline__ float
NXConvertSwappedFloatToHost(NXSwappedFloat x)
{
    union fconv {
        float number;
        NXSwappedFloat sf;
    } u;
    u.sf = x;
    return u.number;
}
static __inline__ NXSwappedDouble
NXConvertHostDoubleToSwapped(double x)
{
    union dconv {
        double number;
        NXSwappedDouble sd;
    } u;
    u.number = x;
    return u.sd;
}
static __inline__ double
NXConvertSwappedDoubleToHost(NXSwappedDouble x)
{
    union dconv {
        double number;
        NXSwappedDouble sd;
    } u;
    u.sd = x;
    return u.number;
}
static __inline__ NXSwappedFloat
NXSwapFloat(NXSwappedFloat x)
{
    return (NXSwappedFloat)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
}
static __inline__ NXSwappedDouble
NXSwapDouble(NXSwappedDouble x)
{
    return (NXSwappedDouble)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
}
enum NXByteOrder {
    NX_UnknownByteOrder,
    NX_LittleEndian,
    NX_BigEndian
};
static __inline__
enum NXByteOrder
NXHostByteOrder(void)
{
    return NX_LittleEndian;
}
static __inline__
unsigned short
NXSwapBigShortToHost(
    unsigned short x
)
{
    return (unsigned short)((__uint16_t)(__builtin_constant_p((uint16_t)x) ? ((__uint16_t)((((__uint16_t)((uint16_t)x) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)x) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)x)));
}
static __inline__
unsigned int
NXSwapBigIntToHost(
    unsigned int x
)
{
    return (unsigned int)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
}
static __inline__
unsigned long
NXSwapBigLongToHost(
    unsigned long x
)
{
    return (unsigned long)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
}
static __inline__
unsigned long long
NXSwapBigLongLongToHost(
    unsigned long long x
)
{
    return (unsigned long long)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
}
static __inline__
double
NXSwapBigDoubleToHost(
    NXSwappedDouble x
)
{
    return NXConvertSwappedDoubleToHost((NXSwappedDouble)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x)));
}
static __inline__
float
NXSwapBigFloatToHost(
    NXSwappedFloat x
)
{
    return NXConvertSwappedFloatToHost((NXSwappedFloat)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x)));
}
static __inline__
unsigned short
NXSwapHostShortToBig(
    unsigned short x
)
{
    return (unsigned short)((__uint16_t)(__builtin_constant_p((uint16_t)x) ? ((__uint16_t)((((__uint16_t)((uint16_t)x) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)x) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)x)));
}
static __inline__
unsigned int
NXSwapHostIntToBig(
    unsigned int x
)
{
    return (unsigned int)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
}
static __inline__
unsigned long
NXSwapHostLongToBig(
    unsigned long x
)
{
    return (unsigned long)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
}
static __inline__
unsigned long long
NXSwapHostLongLongToBig(
    unsigned long long x
)
{
    return (unsigned long long)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
}
static __inline__
NXSwappedDouble
NXSwapHostDoubleToBig(
    double x
)
{
    return (NXSwappedDouble)(__builtin_constant_p((uint64_t)NXConvertHostDoubleToSwapped(x)) ? ((__uint64_t)((((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)NXConvertHostDoubleToSwapped(x)));
}
static __inline__
NXSwappedFloat
NXSwapHostFloatToBig(
    float x
)
{
    return (NXSwappedFloat)(__builtin_constant_p((uint32_t)NXConvertHostFloatToSwapped(x)) ? ((__uint32_t)((((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)NXConvertHostFloatToSwapped(x)));
}
static __inline__
unsigned short
NXSwapLittleShortToHost(
    unsigned short x
)
{
    return (unsigned short)((uint16_t)((uint16_t)x));
}
static __inline__
unsigned int
NXSwapLittleIntToHost(
    unsigned int x
)
{
    return (unsigned int)((uint32_t)((uint32_t)x));
}
static __inline__
unsigned long
NXSwapLittleLongToHost(
    unsigned long x
)
{
    return (unsigned long)((uint32_t)((uint32_t)x));
}
static __inline__
unsigned long long
NXSwapLittleLongLongToHost(
    unsigned long long x
)
{
    return (unsigned long long)((uint64_t)((uint64_t)x));
}
static __inline__
double
NXSwapLittleDoubleToHost(
    NXSwappedDouble x
)
{
    return NXConvertSwappedDoubleToHost((NXSwappedDouble)((uint64_t)((uint64_t)x)));
}
static __inline__
float
NXSwapLittleFloatToHost(
    NXSwappedFloat x
)
{
    return NXConvertSwappedFloatToHost((NXSwappedFloat)((uint32_t)((uint32_t)x)));
}
static __inline__
unsigned short
NXSwapHostShortToLittle(
    unsigned short x
)
{
    return (unsigned short)((uint16_t)((uint16_t)x));
}
static __inline__
unsigned int
NXSwapHostIntToLittle(
    unsigned int x
)
{
    return (unsigned int)((uint32_t)((uint32_t)x));
}
static __inline__
unsigned long
NXSwapHostLongToLittle(
    unsigned long x
)
{
    return (unsigned long)((uint32_t)((uint32_t)x));
}
static __inline__
unsigned long long
NXSwapHostLongLongToLittle(
    unsigned long long x
)
{
    return (unsigned long long)((uint64_t)((uint64_t)x));
}
static __inline__
NXSwappedDouble
NXSwapHostDoubleToLittle(
    double x
)
{
    return (NXSwappedDouble)((uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)));
}
static __inline__
NXSwappedFloat
NXSwapHostFloatToLittle(
    float x
)
{
    return (NXSwappedFloat)((uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)));
}
struct mach_header {
 uint32_t magic;
 cpu_type_t cputype;
 cpu_subtype_t cpusubtype;
 uint32_t filetype;
 uint32_t ncmds;
 uint32_t sizeofcmds;
 uint32_t flags;
};
#define MH_MAGIC 0xfeedface
#define MH_CIGAM 0xcefaedfe
struct mach_header_64 {
 uint32_t magic;
 cpu_type_t cputype;
 cpu_subtype_t cpusubtype;
 uint32_t filetype;
 uint32_t ncmds;
 uint32_t sizeofcmds;
 uint32_t flags;
 uint32_t reserved;
};
#define MH_MAGIC_64 0xfeedfacf
#define MH_CIGAM_64 0xcffaedfe
#define MH_OBJECT 0x1
#define MH_EXECUTE 0x2
#define MH_FVMLIB 0x3
#define MH_CORE 0x4
#define MH_PRELOAD 0x5
#define MH_DYLIB 0x6
#define MH_DYLINKER 0x7
#define MH_BUNDLE 0x8
#define MH_DYLIB_STUB 0x9
#define MH_DSYM 0xa
#define MH_KEXT_BUNDLE 0xb
#define MH_NOUNDEFS 0x1
#define MH_INCRLINK 0x2
#define MH_DYLDLINK 0x4
#define MH_BINDATLOAD 0x8
#define MH_PREBOUND 0x10
#define MH_SPLIT_SEGS 0x20
#define MH_LAZY_INIT 0x40
#define MH_TWOLEVEL 0x80
#define MH_FORCE_FLAT 0x100
#define MH_NOMULTIDEFS 0x200
#define MH_NOFIXPREBINDING 0x400
#define MH_PREBINDABLE 0x800
#define MH_ALLMODSBOUND 0x1000
#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000
#define MH_CANONICAL 0x4000
#define MH_WEAK_DEFINES 0x8000
#define MH_BINDS_TO_WEAK 0x10000
#define MH_ALLOW_STACK_EXECUTION 0x20000
#define MH_ROOT_SAFE 0x40000
#define MH_SETUID_SAFE 0x80000
#define MH_NO_REEXPORTED_DYLIBS 0x100000
#define MH_PIE 0x200000
#define MH_DEAD_STRIPPABLE_DYLIB 0x400000
#define MH_HAS_TLV_DESCRIPTORS 0x800000
#define MH_NO_HEAP_EXECUTION 0x1000000
struct load_command {
 uint32_t cmd;
 uint32_t cmdsize;
};
#define LC_REQ_DYLD 0x80000000
#define LC_SEGMENT 0x1
#define LC_SYMTAB 0x2
#define LC_SYMSEG 0x3
#define LC_THREAD 0x4
#define LC_UNIXTHREAD 0x5
#define LC_LOADFVMLIB 0x6
#define LC_IDFVMLIB 0x7
#define LC_IDENT 0x8
#define LC_FVMFILE 0x9
#define LC_PREPAGE 0xa
#define LC_DYSYMTAB 0xb
#define LC_LOAD_DYLIB 0xc
#define LC_ID_DYLIB 0xd
#define LC_LOAD_DYLINKER 0xe
#define LC_ID_DYLINKER 0xf
#define LC_PREBOUND_DYLIB 0x10
#define LC_ROUTINES 0x11
#define LC_SUB_FRAMEWORK 0x12
#define LC_SUB_UMBRELLA 0x13
#define LC_SUB_CLIENT 0x14
#define LC_SUB_LIBRARY 0x15
#define LC_TWOLEVEL_HINTS 0x16
#define LC_PREBIND_CKSUM 0x17
#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
#define LC_SEGMENT_64 0x19
#define LC_ROUTINES_64 0x1a
#define LC_UUID 0x1b
#define LC_RPATH (0x1c | LC_REQ_DYLD)
#define LC_CODE_SIGNATURE 0x1d
#define LC_SEGMENT_SPLIT_INFO 0x1e
#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD)
#define LC_LAZY_LOAD_DYLIB 0x20
#define LC_ENCRYPTION_INFO 0x21
#define LC_DYLD_INFO 0x22
#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD)
#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD)
#define LC_VERSION_MIN_MACOSX 0x24
#define LC_VERSION_MIN_IPHONEOS 0x25
#define LC_FUNCTION_STARTS 0x26
#define LC_DYLD_ENVIRONMENT 0x27
#define LC_MAIN (0x28|LC_REQ_DYLD)
#define LC_DATA_IN_CODE 0x29
#define LC_SOURCE_VERSION 0x2A
#define LC_DYLIB_CODE_SIGN_DRS 0x2B
#define LC_ENCRYPTION_INFO_64 0x2C
union lc_str {
 uint32_t offset;
};
struct segment_command {
 uint32_t cmd;
 uint32_t cmdsize;
 char segname[16];
 uint32_t vmaddr;
 uint32_t vmsize;
 uint32_t fileoff;
 uint32_t filesize;
 vm_prot_t maxprot;
 vm_prot_t initprot;
 uint32_t nsects;
 uint32_t flags;
};
struct segment_command_64 {
 uint32_t cmd;
 uint32_t cmdsize;
 char segname[16];
 uint64_t vmaddr;
 uint64_t vmsize;
 uint64_t fileoff;
 uint64_t filesize;
 vm_prot_t maxprot;
 vm_prot_t initprot;
 uint32_t nsects;
 uint32_t flags;
};
#define SG_HIGHVM 0x1
#define SG_FVMLIB 0x2
#define SG_NORELOC 0x4
#define SG_PROTECTED_VERSION_1 0x8
struct section {
 char sectname[16];
 char segname[16];
 uint32_t addr;
 uint32_t size;
 uint32_t offset;
 uint32_t align;
 uint32_t reloff;
 uint32_t nreloc;
 uint32_t flags;
 uint32_t reserved1;
 uint32_t reserved2;
};
struct section_64 {
 char sectname[16];
 char segname[16];
 uint64_t addr;
 uint64_t size;
 uint32_t offset;
 uint32_t align;
 uint32_t reloff;
 uint32_t nreloc;
 uint32_t flags;
 uint32_t reserved1;
 uint32_t reserved2;
 uint32_t reserved3;
};
#define SECTION_TYPE 0x000000ff
#define SECTION_ATTRIBUTES 0xffffff00
#define S_REGULAR 0x0
#define S_ZEROFILL 0x1
#define S_CSTRING_LITERALS 0x2
#define S_4BYTE_LITERALS 0x3
#define S_8BYTE_LITERALS 0x4
#define S_LITERAL_POINTERS 0x5
#define S_NON_LAZY_SYMBOL_POINTERS 0x6
#define S_LAZY_SYMBOL_POINTERS 0x7
#define S_SYMBOL_STUBS 0x8
#define S_MOD_INIT_FUNC_POINTERS 0x9
#define S_MOD_TERM_FUNC_POINTERS 0xa
#define S_COALESCED 0xb
#define S_GB_ZEROFILL 0xc
#define S_INTERPOSING 0xd
#define S_16BYTE_LITERALS 0xe
#define S_DTRACE_DOF 0xf
#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10
#define S_THREAD_LOCAL_REGULAR 0x11
#define S_THREAD_LOCAL_ZEROFILL 0x12
#define S_THREAD_LOCAL_VARIABLES 0x13
#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14
#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15
#define SECTION_ATTRIBUTES_USR 0xff000000
#define S_ATTR_PURE_INSTRUCTIONS 0x80000000
#define S_ATTR_NO_TOC 0x40000000
#define S_ATTR_STRIP_STATIC_SYMS 0x20000000
#define S_ATTR_NO_DEAD_STRIP 0x10000000
#define S_ATTR_LIVE_SUPPORT 0x08000000
#define S_ATTR_SELF_MODIFYING_CODE 0x04000000
#define S_ATTR_DEBUG 0x02000000
#define SECTION_ATTRIBUTES_SYS 0x00ffff00
#define S_ATTR_SOME_INSTRUCTIONS 0x00000400
#define S_ATTR_EXT_RELOC 0x00000200
#define S_ATTR_LOC_RELOC 0x00000100
#define SEG_PAGEZERO "__PAGEZERO"
#define SEG_TEXT "__TEXT"
#define SECT_TEXT "__text"
#define SECT_FVMLIB_INIT0 "__fvmlib_init0"
#define SECT_FVMLIB_INIT1 "__fvmlib_init1"
#define SEG_DATA "__DATA"
#define SECT_DATA "__data"
#define SECT_BSS "__bss"
#define SECT_COMMON "__common"
#define SEG_OBJC "__OBJC"
#define SECT_OBJC_SYMBOLS "__symbol_table"
#define SECT_OBJC_MODULES "__module_info"
#define SECT_OBJC_STRINGS "__selector_strs"
#define SECT_OBJC_REFS "__selector_refs"
#define SEG_ICON "__ICON"
#define SECT_ICON_HEADER "__header"
#define SECT_ICON_TIFF "__tiff"
#define SEG_LINKEDIT "__LINKEDIT"
#define SEG_UNIXSTACK "__UNIXSTACK"
#define SEG_IMPORT "__IMPORT"
struct fvmlib {
 union lc_str name;
 uint32_t minor_version;
 uint32_t header_addr;
};
struct fvmlib_command {
 uint32_t cmd;
 uint32_t cmdsize;
 struct fvmlib fvmlib;
};
struct dylib {
    union lc_str name;
    uint32_t timestamp;
    uint32_t current_version;
    uint32_t compatibility_version;
};
struct dylib_command {
 uint32_t cmd;
 uint32_t cmdsize;
 struct dylib dylib;
};
struct sub_framework_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str umbrella;
};
struct sub_client_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str client;
};
struct sub_umbrella_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str sub_umbrella;
};
struct sub_library_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str sub_library;
};
struct prebound_dylib_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str name;
 uint32_t nmodules;
 union lc_str linked_modules;
};
struct dylinker_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str name;
};
struct thread_command {
 uint32_t cmd;
 uint32_t cmdsize;
};
struct routines_command {
 uint32_t cmd;
 uint32_t cmdsize;
 uint32_t init_address;
 uint32_t init_module;
 uint32_t reserved1;
 uint32_t reserved2;
 uint32_t reserved3;
 uint32_t reserved4;
 uint32_t reserved5;
 uint32_t reserved6;
};
struct routines_command_64 {
 uint32_t cmd;
 uint32_t cmdsize;
 uint64_t init_address;
 uint64_t init_module;
 uint64_t reserved1;
 uint64_t reserved2;
 uint64_t reserved3;
 uint64_t reserved4;
 uint64_t reserved5;
 uint64_t reserved6;
};
struct symtab_command {
 uint32_t cmd;
 uint32_t cmdsize;
 uint32_t symoff;
 uint32_t nsyms;
 uint32_t stroff;
 uint32_t strsize;
};
struct dysymtab_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint32_t ilocalsym;
    uint32_t nlocalsym;
    uint32_t iextdefsym;
    uint32_t nextdefsym;
    uint32_t iundefsym;
    uint32_t nundefsym;
    uint32_t tocoff;
    uint32_t ntoc;
    uint32_t modtaboff;
    uint32_t nmodtab;
    uint32_t extrefsymoff;
    uint32_t nextrefsyms;
    uint32_t indirectsymoff;
    uint32_t nindirectsyms;
    uint32_t extreloff;
    uint32_t nextrel;
    uint32_t locreloff;
    uint32_t nlocrel;
};
#define INDIRECT_SYMBOL_LOCAL 0x80000000
#define INDIRECT_SYMBOL_ABS 0x40000000
struct dylib_table_of_contents {
    uint32_t symbol_index;
    uint32_t module_index;
};
struct dylib_module {
    uint32_t module_name;
    uint32_t iextdefsym;
    uint32_t nextdefsym;
    uint32_t irefsym;
    uint32_t nrefsym;
    uint32_t ilocalsym;
    uint32_t nlocalsym;
    uint32_t iextrel;
    uint32_t nextrel;
    uint32_t iinit_iterm;
    uint32_t ninit_nterm;
    uint32_t
 objc_module_info_addr;
    uint32_t
 objc_module_info_size;
};
struct dylib_module_64 {
    uint32_t module_name;
    uint32_t iextdefsym;
    uint32_t nextdefsym;
    uint32_t irefsym;
    uint32_t nrefsym;
    uint32_t ilocalsym;
    uint32_t nlocalsym;
    uint32_t iextrel;
    uint32_t nextrel;
    uint32_t iinit_iterm;
    uint32_t ninit_nterm;
    uint32_t
        objc_module_info_size;
    uint64_t
        objc_module_info_addr;
};
struct dylib_reference {
    uint32_t isym:24,
        flags:8;
};
struct twolevel_hints_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint32_t offset;
    uint32_t nhints;
};
struct twolevel_hint {
    uint32_t
 isub_image:8,
 itoc:24;
};
struct prebind_cksum_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint32_t cksum;
};
struct uuid_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint8_t uuid[16];
};
struct rpath_command {
    uint32_t cmd;
    uint32_t cmdsize;
    union lc_str path;
};
struct linkedit_data_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint32_t dataoff;
    uint32_t datasize;
};
struct encryption_info_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t cryptoff;
   uint32_t cryptsize;
   uint32_t cryptid;
};
struct encryption_info_command_64 {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t cryptoff;
   uint32_t cryptsize;
   uint32_t cryptid;
   uint32_t pad;
};
struct version_min_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint32_t version;
    uint32_t sdk;
};
struct dyld_info_command {
   uint32_t cmd;
   uint32_t cmdsize;
    uint32_t rebase_off;
    uint32_t rebase_size;
    uint32_t bind_off;
    uint32_t bind_size;
    uint32_t weak_bind_off;
    uint32_t weak_bind_size;
    uint32_t lazy_bind_off;
    uint32_t lazy_bind_size;
    uint32_t export_off;
    uint32_t export_size;
};
#define REBASE_TYPE_POINTER 1
#define REBASE_TYPE_TEXT_ABSOLUTE32 2
#define REBASE_TYPE_TEXT_PCREL32 3
#define REBASE_OPCODE_MASK 0xF0
#define REBASE_IMMEDIATE_MASK 0x0F
#define REBASE_OPCODE_DONE 0x00
#define REBASE_OPCODE_SET_TYPE_IMM 0x10
#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20
#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30
#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40
#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50
#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60
#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70
#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80
#define BIND_TYPE_POINTER 1
#define BIND_TYPE_TEXT_ABSOLUTE32 2
#define BIND_TYPE_TEXT_PCREL32 3
#define BIND_SPECIAL_DYLIB_SELF 0
#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
#define BIND_OPCODE_MASK 0xF0
#define BIND_IMMEDIATE_MASK 0x0F
#define BIND_OPCODE_DONE 0x00
#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
#define BIND_OPCODE_SET_TYPE_IMM 0x50
#define BIND_OPCODE_SET_ADDEND_SLEB 0x60
#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
#define BIND_OPCODE_ADD_ADDR_ULEB 0x80
#define BIND_OPCODE_DO_BIND 0x90
#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
struct symseg_command {
 uint32_t cmd;
 uint32_t cmdsize;
 uint32_t offset;
 uint32_t size;
};
struct ident_command {
 uint32_t cmd;
 uint32_t cmdsize;
};
struct fvmfile_command {
 uint32_t cmd;
 uint32_t cmdsize;
 union lc_str name;
 uint32_t header_addr;
};
struct entry_point_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint64_t entryoff;
    uint64_t stacksize;
};
struct source_version_command {
    uint32_t cmd;
    uint32_t cmdsize;
    uint64_t version;
};
struct data_in_code_entry {
    uint32_t offset;
    uint16_t length;
    uint16_t kind;
};
#define DICE_KIND_DATA 0x0001
#define DICE_KIND_JUMP_TABLE8 0x0002
#define DICE_KIND_JUMP_TABLE16 0x0003
#define DICE_KIND_JUMP_TABLE32 0x0004
#define DICE_KIND_ABS_JUMP_TABLE32 0x0005
struct tlv_descriptor
{
 void* (*thunk)(struct tlv_descriptor*);
 unsigned long key;
 unsigned long offset;
};
#define _KERNEL_MACH_HEADER_ 
#define _MACHO_NLIST_H_ 
struct nlist {
 union {
  int32_t n_strx;
 } n_un;
 uint8_t n_type;
 uint8_t n_sect;
 int16_t n_desc;
 uint32_t n_value;
};
struct nlist_64 {
    union {
        uint32_t n_strx;
    } n_un;
    uint8_t n_type;
    uint8_t n_sect;
    uint16_t n_desc;
    uint64_t n_value;
};
#define N_STAB 0xe0
#define N_PEXT 0x10
#define N_TYPE 0x0e
#define N_EXT 0x01
#define N_UNDF 0x0
#define N_ABS 0x2
#define N_SECT 0xe
#define N_PBUD 0xc
#define N_INDR 0xa
#define NO_SECT 0
#define MAX_SECT 255
#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f)
#define SET_COMM_ALIGN(n_desc,align) (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8))
#define REFERENCE_TYPE 0x7
#define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0
#define REFERENCE_FLAG_UNDEFINED_LAZY 1
#define REFERENCE_FLAG_DEFINED 2
#define REFERENCE_FLAG_PRIVATE_DEFINED 3
#define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4
#define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5
#define REFERENCED_DYNAMICALLY 0x0010
#define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff)
#define SET_LIBRARY_ORDINAL(n_desc,ordinal) (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8))
#define SELF_LIBRARY_ORDINAL 0x0
#define MAX_LIBRARY_ORDINAL 0xfd
#define DYNAMIC_LOOKUP_ORDINAL 0xfe
#define EXECUTABLE_ORDINAL 0xff
#define N_NO_DEAD_STRIP 0x0020
#define N_DESC_DISCARDED 0x0020
#define N_WEAK_REF 0x0040
#define N_WEAK_DEF 0x0080
#define N_REF_TO_WEAK 0x0080
#define N_ARM_THUMB_DEF 0x0008
#define N_SYMBOL_RESOLVER 0x0100
extern int nlist (const char *filename, struct nlist *list);
#define _MACHO_RELOC_H_ 
struct relocation_info {
   int32_t r_address;
   uint32_t r_symbolnum:24,
  r_pcrel:1,
  r_length:2,
  r_extern:1,
  r_type:4;
};
#define R_ABS 0
#define R_SCATTERED 0x80000000
struct scattered_relocation_info {
   uint32_t
     r_address:24,
  r_type:4,
  r_length:2,
  r_pcrel:1,
  r_scattered:1;
   int32_t r_value;
};
enum reloc_type_generic
{
    GENERIC_RELOC_VANILLA,
    GENERIC_RELOC_PAIR,
    GENERIC_RELOC_SECTDIFF,
    GENERIC_RELOC_PB_LA_PTR,
    GENERIC_RELOC_LOCAL_SECTDIFF,
    GENERIC_RELOC_TLV
};
typedef struct mach_header_64 kernel_mach_header_t;
typedef struct segment_command_64 kernel_segment_command_t;
typedef struct section_64 kernel_section_t;
typedef struct nlist_64 kernel_nlist_t;
#define MH_MAGIC_KERNEL MH_MAGIC_64
#define LC_SEGMENT_KERNEL LC_SEGMENT_64
#define SECT_MODINITFUNC "__mod_init_func"
#define SECT_MODTERMFUNC "__mod_term_func"
extern kernel_mach_header_t _mh_execute_header;
vm_offset_t getlastaddr(void);
kernel_segment_command_t *firstseg(void);
kernel_segment_command_t *firstsegfromheader(kernel_mach_header_t *header);
kernel_segment_command_t *nextsegfromheader(
 kernel_mach_header_t *header,
 kernel_segment_command_t *seg);
kernel_segment_command_t *getsegbyname(const char *seg_name);
kernel_segment_command_t *getsegbynamefromheader(
 kernel_mach_header_t *header,
 const char *seg_name);
void *getsegdatafromheader(kernel_mach_header_t *, const char *, unsigned long *);
kernel_section_t *getsectbyname(const char *seg_name, const char *sect_name);
kernel_section_t *getsectbynamefromheader(
 kernel_mach_header_t *header,
 const char *seg_name,
 const char *sect_name);
void *getsectdatafromheader(kernel_mach_header_t *, const char *, const char *, unsigned long *);
kernel_section_t *firstsect(kernel_segment_command_t *sgp);
kernel_section_t *nextsect(kernel_segment_command_t *sgp, kernel_section_t *sp);
void *getcommandfromheader(kernel_mach_header_t *, uint32_t);
void *getuuidfromheader(kernel_mach_header_t *, unsigned long *);
#define __LS_VA_STRINGIFY(_x...) #_x
#define __LS_VA_STRCONCAT(_x,_y) __LS_VA_STRINGIFY(_x,_y)
#define __LINKER_MAKE_SET(_set,_sym) void const * __set_ ##_set ##_sym_ ##_sym __attribute__ ((section(__LS_VA_STRCONCAT(__DATA,_set)),used)) = (void *)&_sym
#define LINKER_SET_ENTRY(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define TEXT_SET(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define DATA_SET(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define BSS_SET(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define ABS_SET(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define SET_ENTRY(_set,_sym) __LINKER_MAKE_SET(_set, _sym)
#define LINKER_SET_OBJECT_BEGIN(_object,_set) __linker_set_object_begin(_object, _set)
#define LINKER_SET_OBJECT_LIMIT(_object,_set) __linker_set_object_limit(_object, _set)
#define LINKER_SET_OBJECT_FOREACH(_object,_pvar,_cast,_set) for (_pvar = (_cast) LINKER_SET_OBJECT_BEGIN(_object, _set); _pvar < (_cast) LINKER_SET_OBJECT_LIMIT(_object, _set); _pvar++)
#define LINKER_SET_OBJECT_ITEM(_object,_set,_i) ((LINKER_SET_OBJECT_BEGIN(_object, _set))[_i])
#define LINKER_SET_BEGIN(_set) LINKER_SET_OBJECT_BEGIN((kernel_mach_header_t *)&_mh_execute_header, _set)
#define LINKER_SET_LIMIT(_set) LINKER_SET_OBJECT_LIMIT((kernel_mach_header_t *)&_mh_execute_header, _set)
#define LINKER_SET_FOREACH(_pvar,_cast,_set) LINKER_SET_OBJECT_FOREACH((kernel_mach_header_t *)&_mh_execute_header, _pvar, _cast, _set)
#define LINKER_SET_ITEM(_set,_i) LINKER_SET_OBJECT_ITEM((kernel_mach_header_t *)&_mh_execute_header, _set, _i)
static __inline void **
__linker_set_object_begin(kernel_mach_header_t *_header, const char *_set)
     __attribute__((__const__));
static __inline void **
__linker_set_object_begin(kernel_mach_header_t *_header, const char *_set)
{
 void *_set_begin;
 unsigned long _size;
 _set_begin = getsectdatafromheader(_header, "__DATA", _set, &_size);
 return( (void **) _set_begin );
}
static __inline void **
__linker_set_object_limit(kernel_mach_header_t *_header, const char *_set)
     __attribute__((__const__));
static __inline void **
__linker_set_object_limit(kernel_mach_header_t *_header, const char *_set)
{
 void *_set_begin;
 unsigned long _size;
 _set_begin = getsectdatafromheader(_header, "__DATA", _set, &_size);
 return ((void **) ((uintptr_t) _set_begin + _size));
}
#define CTL_MAXNAME 12
struct ctlname {
 char *ctl_name;
 int ctl_type;
};
#define CTLTYPE 0xf
#define CTLTYPE_NODE 1
#define CTLTYPE_INT 2
#define CTLTYPE_STRING 3
#define CTLTYPE_QUAD 4
#define CTLTYPE_OPAQUE 5
#define CTLTYPE_STRUCT CTLTYPE_OPAQUE
#define CTLFLAG_RD 0x80000000
#define CTLFLAG_WR 0x40000000
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
#define CTLFLAG_NOLOCK 0x20000000
#define CTLFLAG_ANYBODY 0x10000000
#define CTLFLAG_SECURE 0x08000000
#define CTLFLAG_MASKED 0x04000000
#define CTLFLAG_NOAUTO 0x02000000
#define CTLFLAG_KERN 0x01000000
#define CTLFLAG_LOCKED 0x00800000
#define CTLFLAG_OID2 0x00400000
#define OID_AUTO (-1)
#define OID_AUTO_START 100
#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req)
struct sysctl_req {
 struct proc *p;
 int lock;
 user_addr_t oldptr;
 size_t oldlen;
 size_t oldidx;
 int (*oldfunc)(struct sysctl_req *, const void *, size_t);
 user_addr_t newptr;
 size_t newlen;
 size_t newidx;
 int (*newfunc)(struct sysctl_req *, void *, size_t);
};
 struct sysctl_oid_list { struct sysctl_oid *slh_first; } ;
#define SYSCTL_OID_VERSION 1
struct sysctl_oid {
 struct sysctl_oid_list *oid_parent;
 struct { struct sysctl_oid *sle_next; } oid_link;
 int oid_number;
 int oid_kind;
 void *oid_arg1;
 int oid_arg2;
 const char *oid_name;
 int (*oid_handler) (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
 const char *oid_fmt;
 const char *oid_descr;
 int oid_version;
 int oid_refcnt;
};
#define SYSCTL_IN(r,p,l) (r->newfunc)(r, p, l)
#define SYSCTL_OUT(r,p,l) (r->oldfunc)(r, p, l)
typedef int (* sysctl_handler_t) (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);

int sysctl_handle_int (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_handle_long (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_handle_quad (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_handle_int2quad (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_handle_string (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_handle_opaque (struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
int sysctl_io_number(struct sysctl_req *req, long long bigValue, size_t valueSize, void *pValue, int *changed);
int sysctl_io_string(struct sysctl_req *req, char *pValue, size_t valueSize, int trunc, int *changed);
int sysctl_io_opaque(struct sysctl_req *req, void *pValue, size_t valueSize, int *changed);
void sysctl_register_oid(struct sysctl_oid *oidp);
void sysctl_unregister_oid(struct sysctl_oid *oidp);
void sysctl_register_fixed(void);

#define SYSCTL_DECL(name) extern struct sysctl_oid_list sysctl_ ##name ##_children
#define SYSCTL_LINKER_SET_ENTRY LINKER_SET_ENTRY
#define SYSCTL_OID(parent,nbr,name,kind,a1,a2,handler,fmt,descr) struct sysctl_oid sysctl_ ##parent ##_ ##name = { &sysctl_ ##parent ##_children, { 0 }, nbr, (int)(kind|CTLFLAG_OID2), a1, (int)(a2), #name, handler, fmt, descr, SYSCTL_OID_VERSION, 0 }; SYSCTL_LINKER_SET_ENTRY(__sysctl_set, sysctl_ ##parent ##_ ##name)
#define SYSCTL_NODE(parent,nbr,name,access,handler,descr) struct sysctl_oid_list sysctl_ ##parent ##_ ##name ##_children; SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access, (void*)&sysctl_ ##parent ##_ ##name ##_children, 0, handler, "N", descr);
#define SYSCTL_STRING(parent,nbr,name,access,arg,len,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|access, arg, len, sysctl_handle_string, "A", descr)
#define SYSCTL_COMPAT_INT(parent,nbr,name,access,ptr,val,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, ptr, val, sysctl_handle_int, "I", descr)
#define SYSCTL_COMPAT_UINT(parent,nbr,name,access,ptr,val,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, ptr, val, sysctl_handle_int, "IU", descr)
#define SYSCTL_INT(parent,nbr,name,access,ptr,val,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, ptr, val, sysctl_handle_int, "I", descr); typedef char _sysctl_ ##parent ##_ ##name ##_size_check[(__builtin_constant_p(ptr) || sizeof(*(ptr)) == sizeof(int)) ? 0 : -1];
#define SYSCTL_UINT(parent,nbr,name,access,ptr,val,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, ptr, val, sysctl_handle_int, "IU", descr); typedef char _sysctl_ ##parent ##_ ##name ##_size_check[(__builtin_constant_p(ptr) || sizeof(*(ptr)) == sizeof(unsigned int)) ? 0 : -1];
#define SYSCTL_LONG(parent,nbr,name,access,ptr,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, ptr, 0, sysctl_handle_long, "L", descr); typedef char _sysctl_ ##parent ##_ ##name ##_size_check[(__builtin_constant_p(ptr) || sizeof(*(ptr)) == sizeof(long)) ? 0 : -1];
#define SYSCTL_QUAD(parent,nbr,name,access,ptr,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|access, ptr, 0, sysctl_handle_quad, "Q", descr); typedef char _sysctl_ ##parent ##_ ##name ##_size_check[(__builtin_constant_p(ptr) || sizeof(*(ptr)) == sizeof(long long)) ? 0 : -1];
#define SYSCTL_OPAQUE(parent,nbr,name,access,ptr,len,fmt,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, ptr, len, sysctl_handle_opaque, fmt, descr)
#define SYSCTL_STRUCT(parent,nbr,name,access,ptr,type,descr) SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, descr)
#define SYSCTL_PROC(parent,nbr,name,access,ptr,arg,handler,fmt,descr) SYSCTL_OID(parent, nbr, name, access, ptr, arg, handler, fmt, descr)
extern struct sysctl_oid_list sysctl__children;
extern struct sysctl_oid_list sysctl__kern_children;
extern struct sysctl_oid_list sysctl__sysctl_children;
extern struct sysctl_oid_list sysctl__vm_children;
extern struct sysctl_oid_list sysctl__vfs_children;
extern struct sysctl_oid_list sysctl__net_children;
extern struct sysctl_oid_list sysctl__debug_children;
extern struct sysctl_oid_list sysctl__hw_children;
extern struct sysctl_oid_list sysctl__machdep_children;
extern struct sysctl_oid_list sysctl__user_children;
#define SYSCTL_DEF_ENABLED 
#define CTL_UNSPEC 0
#define CTL_KERN 1
#define CTL_VM 2
#define CTL_VFS 3
#define CTL_NET 4
#define CTL_DEBUG 5
#define CTL_HW 6
#define CTL_MACHDEP 7
#define CTL_USER 8
#define CTL_MAXID 9
#define CTL_NAMES { { 0, 0 }, { "kern", CTLTYPE_NODE }, { "vm", CTLTYPE_NODE }, { "vfs", CTLTYPE_NODE }, { "net", CTLTYPE_NODE }, { "debug", CTLTYPE_NODE }, { "hw", CTLTYPE_NODE }, { "machdep", CTLTYPE_NODE }, { "user", CTLTYPE_NODE }, }
#define KERN_OSTYPE 1
#define KERN_OSRELEASE 2
#define KERN_OSREV 3
#define KERN_VERSION 4
#define KERN_MAXVNODES 5
#define KERN_MAXPROC 6
#define KERN_MAXFILES 7
#define KERN_ARGMAX 8
#define KERN_SECURELVL 9
#define KERN_HOSTNAME 10
#define KERN_HOSTID 11
#define KERN_CLOCKRATE 12
#define KERN_VNODE 13
#define KERN_PROC 14
#define KERN_FILE 15
#define KERN_PROF 16
#define KERN_POSIX1 17
#define KERN_NGROUPS 18
#define KERN_JOB_CONTROL 19
#define KERN_SAVED_IDS 20
#define KERN_BOOTTIME 21
#define KERN_NISDOMAINNAME 22
#define KERN_DOMAINNAME KERN_NISDOMAINNAME
#define KERN_MAXPARTITIONS 23
#define KERN_KDEBUG 24
#define KERN_UPDATEINTERVAL 25
#define KERN_OSRELDATE 26
#define KERN_NTP_PLL 27
#define KERN_BOOTFILE 28
#define KERN_MAXFILESPERPROC 29
#define KERN_MAXPROCPERUID 30
#define KERN_DUMPDEV 31
#define KERN_IPC 32
#define KERN_DUMMY 33
#define KERN_PS_STRINGS 34
#define KERN_USRSTACK32 35
#define KERN_LOGSIGEXIT 36
#define KERN_SYMFILE 37
#define KERN_PROCARGS 38
#define KERN_NETBOOT 40
#define KERN_SYSV 42
#define KERN_AFFINITY 43
#define KERN_TRANSLATE 44
#define KERN_CLASSIC KERN_TRANSLATE
#define KERN_EXEC 45
#define KERN_CLASSICHANDLER KERN_EXEC
#define KERN_AIOMAX 46
#define KERN_AIOPROCMAX 47
#define KERN_AIOTHREADS 48
#define KERN_PROCARGS2 49
#define KERN_COREFILE 50
#define KERN_COREDUMP 51
#define KERN_SUGID_COREDUMP 52
#define KERN_PROCDELAYTERM 53
#define KERN_SHREG_PRIVATIZABLE 54
#define KERN_LOW_PRI_WINDOW 56
#define KERN_LOW_PRI_DELAY 57
#define KERN_POSIX 58
#define KERN_USRSTACK64 59
#define KERN_NX_PROTECTION 60
#define KERN_TFP 61
#define KERN_PROCNAME 62
#define KERN_THALTSTACK 63
#define KERN_SPECULATIVE_READS 64
#define KERN_OSVERSION 65
#define KERN_SAFEBOOT 66
#define KERN_LCTX 67
#define KERN_RAGEVNODE 68
#define KERN_TTY 69
#define KERN_CHECKOPENEVT 70
#define KERN_THREADNAME 71
#define KERN_MAXID 72
#define KERN_USRSTACK KERN_USRSTACK64
#define KERN_RAGE_PROC 1
#define KERN_RAGE_THREAD 2
#define KERN_UNRAGE_PROC 3
#define KERN_UNRAGE_THREAD 4
#define KERN_OPENEVT_PROC 1
#define KERN_UNOPENEVT_PROC 2
#define KERN_TFP_POLICY 1
#define KERN_TFP_POLICY_DENY 0
#define KERN_TFP_POLICY_DEFAULT 2
#define KERN_KDEFLAGS 1
#define KERN_KDDFLAGS 2
#define KERN_KDENABLE 3
#define KERN_KDSETBUF 4
#define KERN_KDGETBUF 5
#define KERN_KDSETUP 6
#define KERN_KDREMOVE 7
#define KERN_KDSETREG 8
#define KERN_KDGETREG 9
#define KERN_KDREADTR 10
#define KERN_KDPIDTR 11
#define KERN_KDTHRMAP 12
#define KERN_KDPIDEX 14
#define KERN_KDSETRTCDEC 15
#define KERN_KDGETENTROPY 16
#define KERN_KDWRITETR 17
#define KERN_KDWRITEMAP 18
#define KERN_KDENABLE_BG_TRACE 19
#define KERN_KDDISABLE_BG_TRACE 20
#define KERN_KDREADCURTHRMAP 21
#define KERN_KDSET_TYPEFILTER 22
#define KERN_KDBUFWAIT 23
#define KERN_KDCPUMAP 24
#define CTL_KERN_NAMES { { 0, 0 }, { "ostype", CTLTYPE_STRING }, { "osrelease", CTLTYPE_STRING }, { "osrevision", CTLTYPE_INT }, { "version", CTLTYPE_STRING }, { "maxvnodes", CTLTYPE_INT }, { "maxproc", CTLTYPE_INT }, { "maxfiles", CTLTYPE_INT }, { "argmax", CTLTYPE_INT }, { "securelevel", CTLTYPE_INT }, { "hostname", CTLTYPE_STRING }, { "hostid", CTLTYPE_INT }, { "clockrate", CTLTYPE_STRUCT }, { "vnode", CTLTYPE_STRUCT }, { "proc", CTLTYPE_STRUCT }, { "file", CTLTYPE_STRUCT }, { "profiling", CTLTYPE_NODE }, { "posix1version", CTLTYPE_INT }, { "ngroups", CTLTYPE_INT }, { "job_control", CTLTYPE_INT }, { "saved_ids", CTLTYPE_INT }, { "boottime", CTLTYPE_STRUCT }, { "nisdomainname", CTLTYPE_STRING }, { "maxpartitions", CTLTYPE_INT }, { "kdebug", CTLTYPE_INT }, { "update", CTLTYPE_INT }, { "osreldate", CTLTYPE_INT }, { "ntp_pll", CTLTYPE_NODE }, { "bootfile", CTLTYPE_STRING }, { "maxfilesperproc", CTLTYPE_INT }, { "maxprocperuid", CTLTYPE_INT }, { "dumpdev", CTLTYPE_STRUCT }, { "ipc", CTLTYPE_NODE }, { "dummy", CTLTYPE_INT }, { "dummy", CTLTYPE_INT }, { "usrstack", CTLTYPE_INT }, { "logsigexit", CTLTYPE_INT }, { "symfile",CTLTYPE_STRING }, { "procargs",CTLTYPE_STRUCT }, { "dummy", CTLTYPE_INT }, { "netboot", CTLTYPE_INT }, { "dummy", CTLTYPE_INT }, { "sysv", CTLTYPE_NODE }, { "dummy", CTLTYPE_INT }, { "dummy", CTLTYPE_INT }, { "exec", CTLTYPE_NODE }, { "aiomax", CTLTYPE_INT }, { "aioprocmax", CTLTYPE_INT }, { "aiothreads", CTLTYPE_INT }, { "procargs2",CTLTYPE_STRUCT }, { "corefile",CTLTYPE_STRING }, { "coredump", CTLTYPE_INT }, { "sugid_coredump", CTLTYPE_INT }, { "delayterm", CTLTYPE_INT }, { "shreg_private", CTLTYPE_INT }, { "proc_low_pri_io", CTLTYPE_INT }, { "low_pri_window", CTLTYPE_INT }, { "low_pri_delay", CTLTYPE_INT }, { "posix", CTLTYPE_NODE }, { "usrstack64", CTLTYPE_QUAD }, { "nx", CTLTYPE_INT }, { "tfp", CTLTYPE_NODE }, { "procname", CTLTYPE_STRING }, { "threadsigaltstack", CTLTYPE_INT }, { "speculative_reads_disabled", CTLTYPE_INT }, { "osversion", CTLTYPE_STRING }, { "safeboot", CTLTYPE_INT }, { "lctx", CTLTYPE_NODE }, { "rage_vnode", CTLTYPE_INT }, { "tty", CTLTYPE_NODE }, { "check_openevt", CTLTYPE_INT }, { "thread_name", CTLTYPE_STRING } }
#define CTL_VFS_NAMES { { "vfsconf", CTLTYPE_STRUCT } }
#define KERN_PROC_ALL 0
#define KERN_PROC_PID 1
#define KERN_PROC_PGRP 2
#define KERN_PROC_SESSION 3
#define KERN_PROC_TTY 4
#define KERN_PROC_UID 5
#define KERN_PROC_RUID 6
#define KERN_PROC_LCID 7
#define KERN_LCTX_ALL 0
#define KERN_LCTX_LCID 1
struct _pcred {
 char pc_lock[72];
 struct ucred *pc_ucred;
 uid_t p_ruid;
 uid_t p_svuid;
 gid_t p_rgid;
 gid_t p_svgid;
 int p_refcnt;
};
struct _ucred {
 int32_t cr_ref;
 uid_t cr_uid;
 short cr_ngroups;
 gid_t cr_groups[16];
};
struct kinfo_proc {
 struct extern_proc kp_proc;
 struct eproc {
  struct proc *e_paddr;
  struct session *e_sess;
  struct _pcred e_pcred;
  struct _ucred e_ucred;
  struct vmspace e_vm;
  pid_t e_ppid;
  pid_t e_pgid;
  short e_jobc;
  dev_t e_tdev;
  pid_t e_tpgid;
  struct session *e_tsess;
#define WMESGLEN 7
  char e_wmesg[7 +1];
  segsz_t e_xsize;
  short e_xrssize;
  short e_xccount;
  short e_xswrss;
  int32_t e_flag;
#define EPROC_CTTY 0x01
#define EPROC_SLEADER 0x02
#define COMAPT_MAXLOGNAME 12
  char e_login[12];
  int32_t e_spare[4];
 } kp_eproc;
};
struct kinfo_lctx {
 pid_t id;
 int mc;
};
#define _SYS_PROC_INTERNAL_H_ 
#define _OS_OSATOMIC_H 
#define _OS_OSBASE_H 
#define _OS_OSTYPES_H 
#define OSTYPES_K64_REV 2
typedef unsigned int UInt;
typedef signed int SInt;
typedef unsigned char UInt8;
typedef unsigned short UInt16;
typedef unsigned int UInt32;
typedef unsigned long long UInt64;
typedef struct UnsignedWide {
   UInt32 lo;
   UInt32 hi;
} UnsignedWide __attribute__((deprecated));
typedef signed char SInt8;
typedef signed short SInt16;
typedef signed int SInt32;
typedef signed long long SInt64;
typedef SInt32 OSStatus;
#define ABSOLUTETIME_SCALAR_TYPE 1
typedef UInt64 AbsoluteTime;
typedef UInt32 OptionBits __attribute__((deprecated));
typedef unsigned char Boolean;

static __inline__
uint64_t
__OSAbsoluteTime(
 AbsoluteTime abstime)
{
 return (*(uint64_t *)&abstime);
}
static __inline__
uint64_t *
__OSAbsoluteTimePtr(
 AbsoluteTime *abstime)
{
 return ((uint64_t *)abstime);
}
#define AbsoluteTime_to_scalar(x) (*(uint64_t *)(x))
#define CMP_ABSOLUTETIME(t1,t2) (AbsoluteTime_to_scalar(t1) > AbsoluteTime_to_scalar(t2)? (int)+1 : (AbsoluteTime_to_scalar(t1) < AbsoluteTime_to_scalar(t2)? (int)-1 : 0))
#define ADD_ABSOLUTETIME(t1,t2) (AbsoluteTime_to_scalar(t1) += AbsoluteTime_to_scalar(t2))
#define SUB_ABSOLUTETIME(t1,t2) (AbsoluteTime_to_scalar(t1) -= AbsoluteTime_to_scalar(t2))
#define ADD_ABSOLUTETIME_TICKS(t1,ticks) (AbsoluteTime_to_scalar(t1) += (int32_t)(ticks))

#define __SAFE_CAST_PTR(type,var) (((type)(var))+(0/(sizeof(*var) == sizeof(*(type)0) ? 1 : 0)))
extern Boolean OSCompareAndSwap64(
    UInt64 oldValue,
    UInt64 newValue,
    volatile UInt64 * address);
#define OSCompareAndSwap64(a,b,c) (OSCompareAndSwap64(a, b, __SAFE_CAST_PTR(volatile UInt64*,c)))
extern SInt64 OSAddAtomic64(
    SInt64 theAmount,
    volatile SInt64 * address);
#define OSAddAtomic64(a,b) (OSAddAtomic64(a, __SAFE_CAST_PTR(volatile SInt64*,b)))
inline static SInt64 OSIncrementAtomic64(volatile SInt64 * address)
{
    return (OSAddAtomic64(1LL, (((volatile SInt64*)(address))+(0/(sizeof(*address) == sizeof(*(volatile SInt64*)0) ? 1 : 0)))));
}
inline static SInt64 OSDecrementAtomic64(volatile SInt64 * address)
{
    return (OSAddAtomic64(-1LL, (((volatile SInt64*)(address))+(0/(sizeof(*address) == sizeof(*(volatile SInt64*)0) ? 1 : 0)))));
}
extern long OSAddAtomicLong(
    long theAmount,
    volatile long * address);
#define OSAddAtomicLong(a,b) (OSAddAtomicLong(a, __SAFE_CAST_PTR(volatile long*,b)))
inline static long OSIncrementAtomicLong(volatile long * address)
{
    return (OSAddAtomicLong(1L, (((volatile long*)(address))+(0/(sizeof(*address) == sizeof(*(volatile long*)0) ? 1 : 0)))));
}
inline static long OSDecrementAtomicLong(volatile long * address)
{
    return (OSAddAtomicLong(-1L, (((volatile long*)(address))+(0/(sizeof(*address) == sizeof(*(volatile long*)0) ? 1 : 0)))));
}
extern Boolean OSCompareAndSwap(
    UInt32 oldValue,
    UInt32 newValue,
    volatile UInt32 * address);
#define OSCompareAndSwap(a,b,c) (OSCompareAndSwap(a, b, __SAFE_CAST_PTR(volatile UInt32*,c)))
extern Boolean OSCompareAndSwapPtr(
    void * oldValue,
    void * newValue,
    void * volatile * address);
#define OSCompareAndSwapPtr(a,b,c) (OSCompareAndSwapPtr(a, b, __SAFE_CAST_PTR(void * volatile *,c)))
extern SInt32 OSAddAtomic(
    SInt32 amount,
    volatile SInt32 * address);
#define OSAddAtomic(a,b) (OSAddAtomic(a, __SAFE_CAST_PTR(volatile SInt32*,b)))
extern SInt16 OSAddAtomic16(
    SInt32 amount,
    volatile SInt16 * address);
extern SInt8 OSAddAtomic8(
    SInt32 amount,
    volatile SInt8 * address);
extern SInt32 OSIncrementAtomic(volatile SInt32 * address);
#define OSIncrementAtomic(a) (OSIncrementAtomic(__SAFE_CAST_PTR(volatile SInt32*,a)))
extern SInt16 OSIncrementAtomic16(volatile SInt16 * address);
extern SInt8 OSIncrementAtomic8(volatile SInt8 * address);
extern SInt32 OSDecrementAtomic(volatile SInt32 * address);
#define OSDecrementAtomic(a) (OSDecrementAtomic(__SAFE_CAST_PTR(volatile SInt32*,a)))
extern SInt16 OSDecrementAtomic16(volatile SInt16 * address);
extern SInt8 OSDecrementAtomic8(volatile SInt8 * address);
extern UInt32 OSBitAndAtomic(
    UInt32 mask,
    volatile UInt32 * address);
#define OSBitAndAtomic(a,b) (OSBitAndAtomic(a, __SAFE_CAST_PTR(volatile UInt32*,b)))
extern UInt16 OSBitAndAtomic16(
    UInt32 mask,
    volatile UInt16 * address);
extern UInt8 OSBitAndAtomic8(
    UInt32 mask,
    volatile UInt8 * address);
extern UInt32 OSBitOrAtomic(
    UInt32 mask,
    volatile UInt32 * address);
#define OSBitOrAtomic(a,b) (OSBitOrAtomic(a, __SAFE_CAST_PTR(volatile UInt32*,b)))
extern UInt16 OSBitOrAtomic16(
    UInt32 mask,
    volatile UInt16 * address);
extern UInt8 OSBitOrAtomic8(
    UInt32 mask,
    volatile UInt8 * address);
extern UInt32 OSBitXorAtomic(
    UInt32 mask,
    volatile UInt32 * address);
#define OSBitXorAtomic(a,b) (OSBitXorAtomic(a, __SAFE_CAST_PTR(volatile UInt32*,b)))
extern UInt16 OSBitXorAtomic16(
    UInt32 mask,
    volatile UInt16 * address);
extern UInt8 OSBitXorAtomic8(
    UInt32 mask,
    volatile UInt8 * address);
extern Boolean OSTestAndSet(
    UInt32 bit,
    volatile UInt8 * startAddress);
extern Boolean OSTestAndClear(
    UInt32 bit,
    volatile UInt8 * startAddress);
#define OS_SPINLOCK_INIT 0
typedef SInt32 OSSpinLock;
static __inline__ void OSSynchronizeIO(void)
{
}
static inline void OSMemoryBarrier(void) {
 __asm__ volatile("mfence" ::: "memory");
}


struct label;
struct lctx {
 struct { struct lctx *le_next; struct lctx **le_prev; } lc_list;
 struct { struct proc *lh_first; } lc_members;
 int lc_mc;
 pid_t lc_id;
 lck_mtx_t lc_mtx;
 struct label *lc_label;
};
struct session {
 int s_count;
 struct proc * s_leader;
 struct vnode * s_ttyvp;
 int s_ttyvid;
 struct tty * s_ttyp;
 pid_t s_ttypgrpid;
 pid_t s_sid;
 char s_login[255];
 int s_flags;
 struct { struct session *le_next; struct session **le_prev; } s_hash;
 lck_mtx_t s_mlock;
 int s_listflags;
};
#define SESSION_NULL (struct session *)0
#define SESSION_TP(sp) (((sp)->s_ttyvp != 0) ? (sp)->s_ttyp : 0)
#define S_DEFAULT 0x00000000
#define S_NOCTTY 0x00000001
#define S_CTTYREF 0x00000010
#define S_LIST_TERM 1
#define S_LIST_DEAD 2
struct pgrp {
 struct { struct pgrp *le_next; struct pgrp **le_prev; } pg_hash;
 struct { struct proc *lh_first; } pg_members;
 struct session * pg_session;
 pid_t pg_id;
 int pg_jobc;
 int pg_membercnt;
 int pg_refcount;
 unsigned int pg_listflags;
 lck_mtx_t pg_mlock;
};
#define PGRP_FLAG_TERMINATE 1
#define PGRP_FLAG_WAITTERMINATE 2
#define PGRP_FLAG_DEAD 4
#define PGRP_FLAG_ITERABEGIN 8
#define PGRP_FLAG_ITERWAIT 0x10
#define PGRP_NULL (struct pgrp *)0
struct proc;
#define PROC_NULL (struct proc *)0
#define PROC_UPDATE_CREDS_ONPROC(p) { p->p_uid = kauth_cred_getuid(p->p_ucred); p->p_gid = kauth_cred_getgid(p->p_ucred); p->p_ruid = kauth_cred_getruid(p->p_ucred); p->p_rgid = kauth_cred_getrgid(p->p_ucred); p->p_svuid = kauth_cred_getsvuid(p->p_ucred); p->p_svgid = kauth_cred_getsvgid(p->p_ucred); }
struct proc {
 struct { struct proc *le_next; struct proc **le_prev; } p_list;
 pid_t p_pid;
 void * task;
 struct proc * p_pptr;
 pid_t p_ppid;
 pid_t p_pgrpid;
 uid_t p_uid;
 gid_t p_gid;
 uid_t p_ruid;
 gid_t p_rgid;
 uid_t p_svuid;
 gid_t p_svgid;
 uint64_t p_uniqueid;
 uint64_t p_puniqueid;
 lck_mtx_t p_mlock;
 char p_stat;
 char p_shutdownstate;
 char p_kdebug;
 char p_btrace;
 struct { struct proc *le_next; struct proc **le_prev; } p_pglist;
 struct { struct proc *le_next; struct proc **le_prev; } p_sibling;
 struct { struct proc *lh_first; } p_children;
 struct { struct uthread *tqh_first; struct uthread **tqh_last; } p_uthlist;
 struct { struct proc *le_next; struct proc **le_prev; } p_hash;
 struct { struct eventqelt *tqh_first; struct eventqelt **tqh_last; } p_evlist;
 lck_mtx_t p_fdmlock;
 kauth_cred_t p_ucred;
 struct filedesc *p_fd;
 struct pstats *p_stats;
 struct plimit *p_limit;
 struct sigacts *p_sigacts;
  int p_siglist;
 lck_spin_t p_slock;
#define p_rlimit p_limit->pl_rlimit
 struct plimit *p_olimit;
 unsigned int p_flag;
 unsigned int p_lflag;
 unsigned int p_listflag;
 unsigned int p_ladvflag;
 int p_refcount;
 int p_childrencnt;
 int p_parentref;
 pid_t p_oppid;
 u_int p_xstat;
 struct itimerval p_realtimer;
 struct timeval p_rtime;
 struct itimerval p_vtimer_user;
 struct itimerval p_vtimer_prof;
 struct timeval p_rlim_cpu;
 int p_debugger;
 boolean_t sigwait;
 void *sigwait_thread;
 void *exit_thread;
 int p_vforkcnt;
     void * p_vforkact;
 int p_fpdrainwait;
 pid_t p_contproc;
 pid_t si_pid;
 u_int si_status;
 u_int si_code;
 uid_t si_uid;
 void * vm_shm;
#define p_startcopy p_argslen
 u_int p_argslen;
 int p_argc;
 user_addr_t user_stack;
 struct vnode *p_textvp;
 off_t p_textoff;
 sigset_t p_sigmask;
 sigset_t p_sigignore;
 sigset_t p_sigcatch;
 u_char p_priority;
 u_char p_resv0;
 char p_nice;
 u_char p_resv1;
 char p_comm[16 +1];
 char p_name[(2*16)+1];
 struct pgrp *p_pgrp;
 uint32_t p_csflags;
 uint32_t p_pcaction;
 uint8_t p_uuid[16];
#define p_endcopy p_aio_total_count
 int p_aio_total_count;
 int p_aio_active_count;
 struct { struct aio_workq_entry *tqh_first; struct aio_workq_entry **tqh_last; } p_aio_activeq;
 struct { struct aio_workq_entry *tqh_first; struct aio_workq_entry **tqh_last; } p_aio_doneq;
 struct klist p_klist;
 struct rusage_superset *p_ru;
 int p_sigwaitcnt;
 thread_t p_signalholder;
 thread_t p_transholder;
 u_short p_acflag;
 volatile u_short p_vfs_iopolicy;
 struct lctx *p_lctx;
 struct { struct proc *le_next; struct proc **le_prev; } p_lclist;
 user_addr_t p_threadstart;
 user_addr_t p_wqthread;
 int p_pthsize;
 user_addr_t p_targconc;
 void * p_wqptr;
 int p_wqsize;
 boolean_t p_wqiniting;
 lck_spin_t p_wqlock;
 struct timeval p_start;
 void * p_rcall;
 int p_ractive;
 int p_idversion;
 void * p_pthhash;
 volatile uint64_t was_throttled __attribute__((aligned(8)));
 volatile uint64_t did_throttle __attribute__((aligned(8)));
 uint64_t p_dispatchqueue_offset;
 uint64_t p_dispatchqueue_serialno_offset;
};
#define PGRPID_DEAD 0xdeaddead
#define P_LIST_DRAIN 0x00000001
#define P_LIST_DRAINWAIT 0x00000002
#define P_LIST_DRAINED 0x00000004
#define P_LIST_DEAD 0x00000008
#define P_LIST_WAITING 0x00000010
#define P_LIST_EXITED 0x00000040
#define P_LIST_CHILDDRSTART 0x00000080
#define P_LIST_CHILDDRAINED 0x00000100
#define P_LIST_CHILDDRWAIT 0x00000200
#define P_LIST_CHILDLKWAIT 0x00000400
#define P_LIST_DEADPARENT 0x00000800
#define P_LIST_PARENTREFWAIT 0x00001000
#define P_LIST_INCREATE 0x00002000
#define P_LIST_INHASH 0x00010000
#define P_LIST_INPGRP 0x00020000
#define P_LIST_PGRPTRANS 0x00040000
#define P_LIST_PGRPTRWAIT 0x00080000
#define P_LIST_EXITCOUNT 0x00100000
#define P_LDELAYTERM 0x00000001
#define P_LNOZOMB 0x00000002
#define P_LTERM 0x00000004
#define P_LEXIT 0x00000008
#define P_LPEXIT 0x00000010
#define P_LTRANSCOMMIT 0x00000020
#define P_LINTRANSIT 0x00000040
#define P_LTRANSWAIT 0x00000080
#define P_LVFORK 0x00000100
#define P_LINVFORK 0x00000200
#define P_LTRACED 0x00000400
#define P_LSIGEXC 0x00000800
#define P_LNOATTACH 0x00001000
#define P_LPPWAIT 0x00002000
#define P_LKQWDRAIN 0x00004000
#define P_LKQWDRAINWAIT 0x00008000
#define P_LKQWDEAD 0x00010000
#define P_LLIMCHANGE 0x00020000
#define P_LLIMWAIT 0x00040000
#define P_LWAITED 0x00080000
#define P_LINSIGNAL 0x00100000
#define P_UNUSED 0x00200000
#define P_LRAGE_VNODES 0x00400000
#define P_LREGISTER 0x00800000
#define P_LVMRSRCOWNER 0x01000000
#define P_LTERM_DECRYPTFAIL 0x04000000
#define P_LTERM_JETSAM 0x08000000
#define P_JETSAM_VMPAGESHORTAGE 0x00000000
#define P_JETSAM_VMTHRASHING 0x10000000
#define P_JETSAM_HIWAT 0x20000000
#define P_JETSAM_PID 0x30000000
#define P_JETSAM_IDLEEXIT 0x40000000
#define P_JETSAM_VNODE 0x50000000
#define P_JETSAM_MASK 0x70000000
#define P_PCTHROTTLE 1
#define P_PCSUSP 2
#define P_PCKILL 3
#define P_PCMAX 3
#define PROC_ACTION_MASK 0xffff0000;
#define PROC_CONTROL_STATE(p) (p->p_pcaction & P_PCMAX)
#define PROC_ACTION_STATE(p) ((p->p_pcaction >> 16) & P_PCMAX)
#define PROC_SETACTION_STATE(p) (p->p_pcaction = (PROC_CONTROL_STATE(p) | (PROC_CONTROL_STATE(p) << 16)))
#define PROC_RESETACTION_STATE(p) (p->p_pcaction = PROC_CONTROL_STATE(p))
#define P_LADVLOCK 0x01
#define P_VFS_IOPOLICY_FORCE_HFS_CASE_SENSITIVITY 0x0001
#define PROC_ALLPROCLIST 1
#define PROC_ZOMBPROCLIST 2
#define PROC_NOWAITTRANS 4
#define PGRP_DROPREF 1
#define PGRP_BLOCKITERATE 2
#define PROC_RETURNED 0
#define PROC_RETURNED_DONE 1
#define PROC_CLAIMED 2
#define PROC_CLAIMED_DONE 3
#define PROC_CREATE_FORK 0
#define PROC_CREATE_SPAWN 1
#define PROC_CREATE_VFORK 2
#pragma pack(4)
struct user32_extern_proc {
 union {
  struct {
   uint32_t __p_forw;
   uint32_t __p_back;
  } p_st1;
  struct user32_timeval __p_starttime;
 } p_un;
 uint32_t p_vmspace;
 uint32_t p_sigacts;
 int p_flag;
 char p_stat;
 pid_t p_pid;
 pid_t p_oppid;
 int p_dupfd;
 uint32_t user_stack;
 uint32_t exit_thread;
 int p_debugger;
 boolean_t sigwait;
 u_int p_estcpu;
 int p_cpticks;
 fixpt_t p_pctcpu;
 uint32_t p_wchan;
 uint32_t p_wmesg;
 u_int p_swtime;
 u_int p_slptime;
 struct user32_itimerval p_realtimer;
 struct user32_timeval p_rtime;
 u_quad_t p_uticks;
 u_quad_t p_sticks;
 u_quad_t p_iticks;
 int p_traceflag;
 uint32_t p_tracep;
 int p_siglist;
 uint32_t p_textvp;
 int p_holdcnt;
 sigset_t p_sigmask;
 sigset_t p_sigignore;
 sigset_t p_sigcatch;
 u_char p_priority;
 u_char p_usrpri;
 char p_nice;
 char p_comm[16 +1];
 uint32_t p_pgrp;
 uint32_t p_addr;
 u_short p_xstat;
 u_short p_acflag;
 uint32_t p_ru;
};
#pragma pack()
struct user64_extern_proc {
 union {
  struct {
   user_addr_t __p_forw;
   user_addr_t __p_back;
  } p_st1;
  struct user64_timeval __p_starttime;
 } p_un;
 user_addr_t p_vmspace;
 user_addr_t p_sigacts;
 int p_flag;
 char p_stat;
 pid_t p_pid;
 pid_t p_oppid;
 int p_dupfd;
 user_addr_t user_stack __attribute((aligned(8)));
 user_addr_t exit_thread;
 int p_debugger;
 boolean_t sigwait;
 u_int p_estcpu;
 int p_cpticks;
 fixpt_t p_pctcpu;
 user_addr_t p_wchan __attribute((aligned(8)));
 user_addr_t p_wmesg;
 u_int p_swtime;
 u_int p_slptime;
 struct user64_itimerval p_realtimer;
 struct user64_timeval p_rtime;
 u_quad_t p_uticks;
 u_quad_t p_sticks;
 u_quad_t p_iticks;
 int p_traceflag;
 user_addr_t p_tracep __attribute((aligned(8)));
 int p_siglist;
 user_addr_t p_textvp __attribute((aligned(8)));
 int p_holdcnt;
 sigset_t p_sigmask;
 sigset_t p_sigignore;
 sigset_t p_sigcatch;
 u_char p_priority;
 u_char p_usrpri;
 char p_nice;
 char p_comm[16 +1];
 user_addr_t p_pgrp __attribute((aligned(8)));
 user_addr_t p_addr;
 u_short p_xstat;
 u_short p_acflag;
 user_addr_t p_ru __attribute((aligned(8)));
};
extern int nprocs, maxproc;
extern int maxprocperuid;
extern int hard_maxproc;
extern unsigned int proc_shutdown_exitcount;
#define PID_MAX 99999
#define NO_PID 100000
extern lck_mtx_t * proc_list_mlock;
extern lck_mtx_t * proc_klist_mlock;
#define BSD_SIMUL_EXECS 33
#define BSD_PAGEABLE_SIZE_PER_EXEC (NCARGS + PAGE_SIZE + PAGE_SIZE)
extern int execargs_cache_size;
extern int execargs_free_count;
extern vm_offset_t * execargs_cache;
#define SESS_LEADER(p,sessp) ((sessp)->s_leader == (p))
#define LCTX_LOCK(lc) lck_mtx_lock(&(lc)->lc_mtx)
#define LCTX_UNLOCK(lc) lck_mtx_unlock(&(lc)->lc_mtx)
#define LCTX_LOCKED(lc) 
#define LCTX_LOCK_ASSERT(lc,type) 
#define ALLLCTX_LOCK lck_mtx_lock(&alllctx_lock)
#define ALLLCTX_UNLOCK lck_mtx_unlock(&alllctx_lock)
extern lck_mtx_t alllctx_lock;
extern lck_grp_t * lctx_lck_grp;
extern lck_grp_attr_t * lctx_lck_grp_attr;
extern lck_attr_t * lctx_lck_attr;
#define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash])
extern struct pidhashhead { struct proc *lh_first; } *pidhashtbl;
extern u_long pidhash;
#define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash])
extern struct pgrphashhead { struct pgrp *lh_first; } *pgrphashtbl;
extern u_long pgrphash;
#define SESSHASH(sessid) (&sesshashtbl[(sessid) & sesshash])
extern struct sesshashhead { struct session *lh_first; } *sesshashtbl;
extern u_long sesshash;
extern lck_grp_t * proc_lck_grp;
extern lck_grp_attr_t * proc_lck_grp_attr;
extern lck_attr_t * proc_lck_attr;
 struct proclist { struct proc *lh_first; } ;
extern struct proclist allproc;
extern struct proclist zombproc;
extern struct proc *initproc;
extern void procinit(void);
extern void proc_lock(struct proc *);
extern void proc_unlock(struct proc *);
extern void proc_spinlock(struct proc *);
extern void proc_spinunlock(struct proc *);
extern void proc_list_lock(void);
extern void proc_list_unlock(void);
extern void proc_klist_lock(void);
extern void proc_klist_unlock(void);
extern void proc_fdlock(struct proc *);
extern void proc_fdlock_spin(struct proc *);
extern void proc_fdunlock(struct proc *);
extern void proc_fdlock_assert(proc_t p, int assertflags);
 int proc_core_name(const char *name, uid_t uid, pid_t pid,
  char *cr_name, size_t cr_name_len);
extern int isinferior(struct proc *, struct proc *);
 struct proc *pzfind(pid_t);
 struct proc *proc_find_zombref(pid_t);
 void proc_drop_zombref(struct proc * p);
extern struct lctx *lcfind(pid_t);
extern struct lctx *lccreate(void);
extern int chgproccnt(uid_t uid, int diff);
extern void enterlctx(struct proc *p, struct lctx *l, int create);
extern void pinsertchild(struct proc *parent, struct proc *child);
extern int enterpgrp(struct proc *p, pid_t pgid, int mksess);
extern void fixjobc(struct proc *p, struct pgrp *pgrp, int entering);
extern int inferior(struct proc *p);
extern int leavepgrp(struct proc *p);
extern void leavelctx(struct proc *p);
extern void resetpriority(struct proc *);
extern void setrunnable(struct proc *);
extern void setrunqueue(struct proc *);
extern int sleep(void *chan, int pri);
extern int tsleep0(void *chan, int pri, const char *wmesg, int timo, int (*continuation)(int));
extern int tsleep1(void *chan, int pri, const char *wmesg, u_int64_t abstime, int (*continuation)(int));
extern int msleep0(void *chan, lck_mtx_t *mtx, int pri, const char *wmesg, int timo, int (*continuation)(int));
extern void vfork_return(struct proc *child, int32_t *retval, int rval);
extern int exit1(struct proc *, int, int *);
extern int exit1_internal(struct proc *, int, int *, boolean_t, boolean_t, int);
extern int fork1(proc_t, thread_t *, int);
extern void vfork_exit_internal(struct proc *p, int rv, int forced);
extern void proc_reparentlocked(struct proc *child, struct proc * newparent, int cansignal, int locked);
extern int pgrp_iterate(struct pgrp * pgrp, int flags, int (*callout)(proc_t , void *), void *arg, int (*filterfn)(proc_t , void *), void *filterarg);
extern int proc_iterate(int flags, int (*callout)(proc_t , void *), void *arg, int (*filterfn)(proc_t , void *), void *filterarg);
extern int proc_rebootscan(int (*callout)(proc_t , void *), void *arg, int (*filterfn)(proc_t , void *), void *filterarg);
extern int proc_childrenwalk(proc_t p, int (*callout)(proc_t , void *), void *arg);
extern proc_t proc_findinternal(int pid, int funneled);
extern proc_t proc_findthread(thread_t thread);
extern void proc_refdrain(proc_t);
extern void proc_childdrainlocked(proc_t);
extern void proc_childdrainstart(proc_t);
extern void proc_childdrainend(proc_t);
extern void proc_checkdeadrefs(proc_t);
struct proc *pfind_locked(pid_t);
extern struct pgrp *pgfind(pid_t);
extern void pg_rele(struct pgrp * pgrp);
extern struct session * session_find_internal(pid_t sessid);
extern struct pgrp * proc_pgrp(proc_t);
extern struct pgrp * tty_pgrp(struct tty * tp);
extern struct pgrp * pgfind_internal(pid_t);
extern struct session * proc_session(proc_t);
extern void pgrp_lock(struct pgrp * pgrp);
extern void pgrp_unlock(struct pgrp * pgrp);
extern void session_lock(struct session * sess);
extern void session_unlock(struct session * sess);
extern struct session * pgrp_session(struct pgrp * pgrp);
extern void session_rele(struct session *sess);
extern int isbackground(proc_t p, struct tty *tp);
extern proc_t proc_parent(proc_t);
extern proc_t proc_parentholdref(proc_t);
extern int proc_parentdropref(proc_t, int);
int itimerfix(struct timeval *tv);
int itimerdecr(struct proc * p, struct itimerval *itp, int usec);
void proc_signalstart(struct proc *, int locked);
void proc_signalend(struct proc *, int locked);
int proc_transstart(struct proc *, int locked);
void proc_transcommit(struct proc *, int locked);
void proc_transend(struct proc *, int locked);
int proc_transwait(struct proc *, int locked);
void proc_rele_locked(struct proc * p);
struct proc *proc_ref_locked(struct proc * p);
void proc_knote(struct proc * p, long hint);
void proc_knote_drain(struct proc *p);
void workqueue_init_lock(proc_t p);
void workqueue_destroy_lock(proc_t p);
void proc_setregister(proc_t p);
void proc_resetregister(proc_t p);
thread_t proc_thread(proc_t);
extern int proc_pendingsignals(proc_t, sigset_t);
int proc_getpcontrol(int pid, int * pcontrolp);
int proc_dopcontrol(proc_t p, void *unused_arg);
int proc_resetpcontrol(int pid);
struct uthread * current_uthread(void);
extern int proc_is_forcing_hfs_case_sensitivity(proc_t);
pid_t dtrace_proc_selfpid(void);
pid_t dtrace_proc_selfppid(void);
uid_t dtrace_proc_selfruid(void);
struct user32_pcred {
 char pc_lock[72];
 user32_addr_t pc_ucred;
 uid_t p_ruid;
 uid_t p_svuid;
 gid_t p_rgid;
 gid_t p_svgid;
 int p_refcnt;
};
struct user64_pcred {
 char pc_lock[72];
 user64_addr_t pc_ucred;
 uid_t p_ruid;
 uid_t p_svuid;
 gid_t p_rgid;
 gid_t p_svgid;
 int p_refcnt;
};
struct user32_kinfo_proc {
 struct user32_extern_proc kp_proc;
 struct user32_eproc {
  user32_addr_t e_paddr;
  user32_addr_t e_sess;
  struct user32_pcred e_pcred;
  struct _ucred e_ucred;
  struct user32_vmspace e_vm;
  pid_t e_ppid;
  pid_t e_pgid;
  short e_jobc;
  dev_t e_tdev;
  pid_t e_tpgid;
  user32_addr_t e_tsess;
  char e_wmesg[7 +1];
  segsz_t e_xsize;
  short e_xrssize;
  short e_xccount;
  short e_xswrss;
  int32_t e_flag;
  char e_login[12];
  int32_t e_spare[4];
 } kp_eproc;
};
struct user64_kinfo_proc {
 struct user64_extern_proc kp_proc;
 struct user64_eproc {
  user_addr_t e_paddr;
  user_addr_t e_sess;
  struct user64_pcred e_pcred;
  struct _ucred e_ucred;
  struct user_vmspace e_vm;
  pid_t e_ppid;
  pid_t e_pgid;
  short e_jobc;
  dev_t e_tdev;
  pid_t e_tpgid;
  user64_addr_t e_tsess __attribute((aligned(8)));
  char e_wmesg[7 +1];
  segsz_t e_xsize;
  short e_xrssize;
  short e_xccount;
  short e_xswrss;
  int32_t e_flag;
  char e_login[12];
  int32_t e_spare[4];
 } kp_eproc;
};
#define KIPC_MAXSOCKBUF 1
#define KIPC_SOCKBUF_WASTE 2
#define KIPC_SOMAXCONN 3
#define KIPC_MAX_LINKHDR 4
#define KIPC_MAX_PROTOHDR 5
#define KIPC_MAX_HDR 6
#define KIPC_MAX_DATALEN 7
#define KIPC_MBSTAT 8
#define KIPC_NMBCLUSTERS 9
#define KIPC_SOQLIMITCOMPAT 10
#define VM_METER 1
#define VM_LOADAVG 2
#define VM_MACHFACTOR 4
#define VM_SWAPUSAGE 5
#define VM_MAXID 6
#define CTL_VM_NAMES { { 0, 0 }, { "vmmeter", CTLTYPE_STRUCT }, { "loadavg", CTLTYPE_STRUCT }, { 0, 0 }, { "dummy", CTLTYPE_INT }, { "swapusage", CTLTYPE_STRUCT } }
struct xsw_usage {
 u_int64_t xsu_total;
 u_int64_t xsu_avail;
 u_int64_t xsu_used;
 u_int32_t xsu_pagesize;
 boolean_t xsu_encrypted;
};
struct loadavg {
 fixpt_t ldavg[3];
 long fscale;
};
extern struct loadavg averunnable;
#define LSCALE 1000
struct user32_loadavg {
 fixpt_t ldavg[3];
    user32_long_t fscale;
};
struct user64_loadavg {
 fixpt_t ldavg[3];
    user64_long_t fscale;
};
#define HW_MACHINE 1
#define HW_MODEL 2
#define HW_NCPU 3
#define HW_BYTEORDER 4
#define HW_PHYSMEM 5
#define HW_USERMEM 6
#define HW_PAGESIZE 7
#define HW_DISKNAMES 8
#define HW_DISKSTATS 9
#define HW_EPOCH 10
#define HW_FLOATINGPT 11
#define HW_MACHINE_ARCH 12
#define HW_VECTORUNIT 13
#define HW_BUS_FREQ 14
#define HW_CPU_FREQ 15
#define HW_CACHELINE 16
#define HW_L1ICACHESIZE 17
#define HW_L1DCACHESIZE 18
#define HW_L2SETTINGS 19
#define HW_L2CACHESIZE 20
#define HW_L3SETTINGS 21
#define HW_L3CACHESIZE 22
#define HW_TB_FREQ 23
#define HW_MEMSIZE 24
#define HW_AVAILCPU 25
#define HW_MAXID 26
#define CTL_HW_NAMES { { 0, 0 }, { "machine", CTLTYPE_STRING }, { "model", CTLTYPE_STRING }, { "ncpu", CTLTYPE_INT }, { "byteorder", CTLTYPE_INT }, { "physmem", CTLTYPE_INT }, { "usermem", CTLTYPE_INT }, { "pagesize", CTLTYPE_INT }, { "disknames", CTLTYPE_STRUCT }, { "diskstats", CTLTYPE_STRUCT }, { "epoch", CTLTYPE_INT }, { "floatingpoint", CTLTYPE_INT }, { "machinearch", CTLTYPE_STRING }, { "vectorunit", CTLTYPE_INT }, { "busfrequency", CTLTYPE_INT }, { "cpufrequency", CTLTYPE_INT }, { "cachelinesize", CTLTYPE_INT }, { "l1icachesize", CTLTYPE_INT }, { "l1dcachesize", CTLTYPE_INT }, { "l2settings", CTLTYPE_INT }, { "l2cachesize", CTLTYPE_INT }, { "l3settings", CTLTYPE_INT }, { "l3cachesize", CTLTYPE_INT }, { "tbfrequency", CTLTYPE_INT }, { "memsize", CTLTYPE_QUAD }, { "availcpu", CTLTYPE_INT } }
#define USER_CS_PATH 1
#define USER_BC_BASE_MAX 2
#define USER_BC_DIM_MAX 3
#define USER_BC_SCALE_MAX 4
#define USER_BC_STRING_MAX 5
#define USER_COLL_WEIGHTS_MAX 6
#define USER_EXPR_NEST_MAX 7
#define USER_LINE_MAX 8
#define USER_RE_DUP_MAX 9
#define USER_POSIX2_VERSION 10
#define USER_POSIX2_C_BIND 11
#define USER_POSIX2_C_DEV 12
#define USER_POSIX2_CHAR_TERM 13
#define USER_POSIX2_FORT_DEV 14
#define USER_POSIX2_FORT_RUN 15
#define USER_POSIX2_LOCALEDEF 16
#define USER_POSIX2_SW_DEV 17
#define USER_POSIX2_UPE 18
#define USER_STREAM_MAX 19
#define USER_TZNAME_MAX 20
#define USER_MAXID 21
#define CTL_USER_NAMES { { 0, 0 }, { "cs_path", CTLTYPE_STRING }, { "bc_base_max", CTLTYPE_INT }, { "bc_dim_max", CTLTYPE_INT }, { "bc_scale_max", CTLTYPE_INT }, { "bc_string_max", CTLTYPE_INT }, { "coll_weights_max", CTLTYPE_INT }, { "expr_nest_max", CTLTYPE_INT }, { "line_max", CTLTYPE_INT }, { "re_dup_max", CTLTYPE_INT }, { "posix2_version", CTLTYPE_INT }, { "posix2_c_bind", CTLTYPE_INT }, { "posix2_c_dev", CTLTYPE_INT }, { "posix2_char_term", CTLTYPE_INT }, { "posix2_fort_dev", CTLTYPE_INT }, { "posix2_fort_run", CTLTYPE_INT }, { "posix2_localedef", CTLTYPE_INT }, { "posix2_sw_dev", CTLTYPE_INT }, { "posix2_upe", CTLTYPE_INT }, { "stream_max", CTLTYPE_INT }, { "tzname_max", CTLTYPE_INT } }
#define CTL_DEBUG_NAME 0
#define CTL_DEBUG_VALUE 1
#define CTL_DEBUG_MAXID 20
extern char machine[];
extern char osrelease[];
extern char ostype[];
extern char osversion[];
struct linker_set;
void sysctl_register_set(const char *set);
void sysctl_unregister_set(const char *set);
void sysctl_mib_init(void);
int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old,
        size_t *oldlenp, void *newp, size_t newlen);
int userland_sysctl(struct proc *p, int *name, u_int namelen, user_addr_t old,
   size_t *oldlenp, user_addr_t newp, size_t newlen,
   size_t *retval);
typedef int (sysctlfn)
   (int *, u_int, user_addr_t, size_t *, user_addr_t, size_t, struct proc *);
int sysctl_int(user_addr_t, size_t *, user_addr_t, size_t, int *);
int sysctl_rdint(user_addr_t, size_t *, user_addr_t, int);
int sysctl_quad(user_addr_t, size_t *, user_addr_t, size_t, quad_t *);
int sysctl_rdquad(user_addr_t, size_t *, user_addr_t, quad_t);
int sysctl_string(user_addr_t, size_t *, user_addr_t, size_t, char *, int);
int sysctl_trstring(user_addr_t, size_t *, user_addr_t, size_t, char *, int);
int sysctl_rdstring(user_addr_t, size_t *, user_addr_t, char *);
int sysctl_rdstruct(user_addr_t, size_t *, user_addr_t, void *, int);
struct sysctl_args;
int new_sysctl(struct proc *, struct sysctl_args *);
void sysctl_register_all(void);
#define _SYS_PTHREAD_INTERNAL_H_ 
#define _KERN_THREAD_CALL_H_ 
#define _KERN_CLOCK_H_ 
#define _MACH_MACH_TIME_H_ 
struct mach_timebase_info {
 uint32_t numer;
 uint32_t denom;
};
typedef struct mach_timebase_info *mach_timebase_info_t;
typedef struct mach_timebase_info mach_timebase_info_data_t;

uint64_t mach_absolute_time(void);

typedef unsigned long clock_sec_t;
typedef unsigned int clock_usec_t, clock_nsec_t;

extern void clock_adjtime(
      long *secs,
      int *microsecs);
extern void clock_initialize_calendar(void);
extern void clock_wakeup_calendar(void);
extern void clock_gettimeofday(
      clock_sec_t *secs,
      clock_usec_t *microsecs);
extern void clock_set_calendar_microtime(
      clock_sec_t secs,
      clock_usec_t microsecs);
extern void clock_get_boottime_nanotime(
      clock_sec_t *secs,
      clock_nsec_t *nanosecs);
extern void absolutetime_to_microtime(
      uint64_t abstime,
      clock_sec_t *secs,
      clock_usec_t *microsecs);
extern void clock_deadline_for_periodic_event(
      uint64_t interval,
      uint64_t abstime,
      uint64_t *deadline);
extern void clock_get_calendar_microtime(
      clock_sec_t *secs,
      clock_usec_t *microsecs);
extern void clock_get_calendar_absolute_and_microtime(
      clock_sec_t *secs,
      clock_usec_t *microsecs,
      uint64_t *abstime);
extern void clock_get_calendar_nanotime(
      clock_sec_t *secs,
      clock_nsec_t *nanosecs);
extern void clock_get_system_microtime(
      clock_sec_t *secs,
      clock_usec_t *microsecs);
extern void clock_get_system_nanotime(
      clock_sec_t *secs,
      clock_nsec_t *nanosecs);
extern void clock_timebase_info(
       mach_timebase_info_t info);
extern void clock_get_uptime(
       uint64_t *result);
extern void clock_interval_to_deadline(
       uint32_t interval,
       uint32_t scale_factor,
       uint64_t *result);
extern void clock_interval_to_absolutetime_interval(
       uint32_t interval,
       uint32_t scale_factor,
       uint64_t *result);
extern void clock_absolutetime_interval_to_deadline(
       uint64_t abstime,
       uint64_t *result);
extern void clock_delay_until(
       uint64_t deadline);
extern void absolutetime_to_nanoseconds(
       uint64_t abstime,
       uint64_t *result);
extern void nanoseconds_to_absolutetime(
       uint64_t nanoseconds,
       uint64_t *result);
#define MACH_TIMESPEC_ZERO ((mach_timespec_t) { 0, 0 } )
extern void delay_for_interval(
       uint32_t interval,
       uint32_t scale_factor);

struct thread_call;
typedef struct thread_call *thread_call_t;
typedef void *thread_call_param_t;
typedef void (*thread_call_func_t)(
     thread_call_param_t param0,
     thread_call_param_t param1);
typedef enum {
 THREAD_CALL_PRIORITY_HIGH = 0,
 THREAD_CALL_PRIORITY_KERNEL = 1,
 THREAD_CALL_PRIORITY_USER = 2,
 THREAD_CALL_PRIORITY_LOW = 3
} thread_call_priority_t;

extern boolean_t thread_call_enter(
      thread_call_t call);
extern boolean_t thread_call_enter1(
      thread_call_t call,
      thread_call_param_t param1);
extern boolean_t thread_call_enter_delayed(
      thread_call_t call,
      uint64_t deadline);
extern boolean_t thread_call_enter1_delayed(
      thread_call_t call,
      thread_call_param_t param1,
      uint64_t deadline);
#define THREAD_CALL_DELAY_SYS_NORMAL TIMEOUT_URGENCY_SYS_NORMAL
#define THREAD_CALL_DELAY_SYS_CRITICAL TIMEOUT_URGENCY_SYS_CRITICAL
#define THREAD_CALL_DELAY_SYS_BACKGROUND TIMEOUT_URGENCY_SYS_BACKGROUND
#define THREAD_CALL_DELAY_USER_MASK TIMEOUT_URGENCY_USER_MASK
#define THREAD_CALL_DELAY_USER_NORMAL TIMEOUT_URGENCY_USER_NORMAL
#define THREAD_CALL_DELAY_USER_CRITICAL TIMEOUT_URGENCY_USER_CRITICAL
#define THREAD_CALL_DELAY_USER_BACKGROUND TIMEOUT_URGENCY_USER_BACKGROUND
#define THREAD_CALL_DELAY_URGENCY_MASK TIMEOUT_URGENCY_MASK
#define THREAD_CALL_DELAY_LEEWAY TIMEOUT_URGENCY_LEEWAY
extern boolean_t thread_call_enter_delayed_with_leeway(
      thread_call_t call,
      thread_call_param_t param1,
      uint64_t deadline,
      uint64_t leeway,
      uint32_t flags);
extern boolean_t thread_call_cancel(
      thread_call_t call);
extern boolean_t thread_call_cancel_wait(
      thread_call_t call);
extern thread_call_t thread_call_allocate(
      thread_call_func_t func,
      thread_call_param_t param0);
extern thread_call_t thread_call_allocate_with_priority(
      thread_call_func_t func,
      thread_call_param_t param0,
      thread_call_priority_t pri);
extern boolean_t thread_call_free(
      thread_call_t call);
boolean_t thread_call_isactive(
      thread_call_t call);


extern void thread_call_func_delayed(
     thread_call_func_t func,
     thread_call_param_t param,
     uint64_t deadline);
extern void thread_call_func_delayed_with_leeway(
      thread_call_func_t func,
      thread_call_param_t param,
      uint64_t deadline,
      uint64_t leeway,
      uint32_t flags);
extern boolean_t thread_call_func_cancel(
      thread_call_func_t func,
      thread_call_param_t param,
      boolean_t cancel_all);

struct ksyn_waitq_element {
 char opaque[48];
};
void workqueue_mark_exiting(struct proc *);
void workqueue_exit(struct proc *);
void pthread_init(void);
#define _SYS_EVENTVAR_H_ 
#define KQ_NEVENTS 16
#define KQEXTENT 256
struct kqueue {
 wait_queue_set_t kq_wqs;
 lck_spin_t kq_lock;
 int kq_state;
 int kq_count;
 uint32_t kq_nprocess;
 struct kqtailq kq_head;
 struct selinfo kq_sel;
 struct proc *kq_p;
 int kq_level;
#define KQ_SEL 0x01
#define KQ_SLEEP 0x02
#define KQ_PROCWAIT 0x04
#define KQ_KEV32 0x08
#define KQ_KEV64 0x10
};
extern struct kqueue *kqueue_alloc(struct proc *);
extern void kqueue_dealloc(struct kqueue *);
typedef int (*kevent_callback_t)(struct kqueue *, struct kevent64_s *, void *);
typedef void (*kqueue_continue_t)(struct kqueue *, void *, int);
extern int kevent_register(struct kqueue *, struct kevent64_s *, struct proc *);
extern int kqueue_scan(struct kqueue *, kevent_callback_t, kqueue_continue_t,
         void *, struct timeval *, struct proc *);
struct vfs_context {
 thread_t vc_thread;
 kauth_cred_t vc_ucred;
};
#define uu_ucred uu_context.vc_ucred
struct label;
#define MAXTHREADNAMESIZE 64
struct uthread {
 u_int64_t uu_arg[8];
 int *uu_ap;
    int uu_rval[2];
 mach_exception_code_t uu_code;
 mach_exception_subcode_t uu_subcode;
 int uu_exception;
 char uu_cursig;
 union {
  struct _select_data {
   u_int64_t abstime;
   char * wql;
   int poll;
   int error;
   int count;
  } ss_select_data;
  struct _kqueue_scan {
   kevent_callback_t call;
   kqueue_continue_t cont;
   uint64_t deadline;
   void *data;
  } ss_kqueue_scan;
  struct _kevent {
   struct _kqueue_scan scan;
   struct fileproc *fp;
   int fd;
   int32_t *retval;
   user_addr_t eventlist;
   size_t eventsize;
   int eventcount;
   int eventout;
  } ss_kevent;
  struct _kauth {
   user_addr_t message;
  } uu_kauth;
  struct ksyn_waitq_element uu_kwe;
 } uu_kevent;
 struct _select {
   u_int32_t *ibits, *obits;
   uint nbytes;
   struct _select_data *data;
 } uu_select;
    int (*uu_continuation)(int);
    int uu_pri;
    int uu_timo;
 caddr_t uu_wchan;
 const char *uu_wmesg;
 struct proc * uu_proc;
 thread_t uu_thread;
 void * uu_userstate;
 wait_queue_set_t uu_wqset;
 size_t uu_allocsize;
 int uu_flag;
 sigset_t uu_siglist;
 sigset_t uu_sigwait;
 sigset_t uu_sigmask;
 sigset_t uu_oldmask;
 sigset_t uu_vforkmask;
 struct vfs_context uu_context;
 struct { struct uthread *tqe_next; struct uthread **tqe_prev; } uu_list;
 struct kaudit_record *uu_ar;
 struct task* uu_aio_task;
 lck_mtx_t *uu_mtx;
 struct { struct uthread *tqe_next; struct uthread **tqe_prev; } uu_throttlelist;
 void * uu_throttle_info;
 int uu_on_throttlelist;
 int uu_lowpri_window;
 boolean_t uu_throttle_bc;
 u_int32_t uu_network_marks;
 struct kern_sigaltstack uu_sigstk;
        vnode_t uu_vreclaims;
 vnode_t uu_cdir;
 int uu_notrigger;
 int uu_dupfd;
        int uu_defer_reclaims;
 void * uu_threadlist;
 char * pth_name;
 struct label * uu_label;
};
typedef struct uthread * uthread_t;
#define UT_SAS_OLDMASK 0x00000001
#define UT_NO_SIGMASK 0x00000002
#define UT_NOTCANCELPT 0x00000004
#define UT_CANCEL 0x00000008
#define UT_CANCELED 0x00000010
#define UT_CANCELDISABLE 0x00000020
#define UT_ALTSTACK 0x00000040
#define UT_THROTTLE_IO 0x00000080
#define UT_PASSIVE_IO 0x00000100
#define UT_PROCEXIT 0x00000200
#define UT_RAGE_VNODES 0x00000400
#define UT_VFORK 0x02000000
#define UT_SETUID 0x04000000
#define UT_WASSETUID 0x08000000
#define UT_VFORKING 0x10000000
struct user {
};
struct lockf;
struct label;
 struct buflists { struct buf *lh_first; } ;
struct vnode {
 lck_mtx_t v_lock;
 struct { struct vnode *tqe_next; struct vnode **tqe_prev; } v_freelist;
 struct { struct vnode *tqe_next; struct vnode **tqe_prev; } v_mntvnodes;
        struct { struct namecache *lh_first; } v_nclinks;
        struct { struct namecache *lh_first; } v_ncchildren;
        vnode_t v_defer_reclaimlist;
        uint32_t v_listflag;
 uint32_t v_flag;
 uint16_t v_lflag;
 uint8_t v_iterblkflags;
 uint8_t v_references;
 int32_t v_kusecount;
 int32_t v_usecount;
 int32_t v_iocount;
 void * v_owner;
 uint16_t v_type;
 uint16_t v_tag;
 uint32_t v_id;
 union {
  struct mount *vu_mountedhere;
  struct socket *vu_socket;
  struct specinfo *vu_specinfo;
  struct fifoinfo *vu_fifoinfo;
         struct ubc_info *vu_ubcinfo;
 } v_un;
 struct buflists v_cleanblkhd;
 struct buflists v_dirtyblkhd;
 struct klist v_knotes;
        kauth_cred_t v_cred;
        kauth_action_t v_authorized_actions;
        int v_cred_timestamp;
        int v_nc_generation;
 int32_t v_numoutput;
 int32_t v_writecount;
 const char *v_name;
 vnode_t v_parent;
 struct lockf *v_lockf;
 int (**v_op)(void *);
 mount_t v_mount;
 void * v_data;
};
#define v_mountedhere v_un.vu_mountedhere
#define v_socket v_un.vu_socket
#define v_specinfo v_un.vu_specinfo
#define v_fifoinfo v_un.vu_fifoinfo
#define v_ubcinfo v_un.vu_ubcinfo
#define VBI_ITER 0x1
#define VBI_ITERWANT 0x2
#define VBI_CLEAN 0x4
#define VBI_DIRTY 0x8
#define VBI_NEWBUF 0x10
#define VLIST_RAGE 0x01
#define VLIST_DEAD 0x02
#define VLIST_ASYNC_WORK 0x04
#define VL_SUSPENDED 0x0001
#define VL_DRAIN 0x0002
#define VL_TERMINATE 0x0004
#define VL_TERMWANT 0x0008
#define VL_DEAD 0x0010
#define VL_MARKTERM 0x0020
#define VL_NEEDINACTIVE 0x0080
#define VL_LABEL 0x0100
#define VL_LABELWAIT 0x0200
#define VL_LABELED 0x0400
#define VL_LWARNED 0x0800
#define VL_HASSTREAMS 0x1000
#define VNAMED_UBC 0x2000
#define VNAMED_MOUNT 0x4000
#define VNAMED_FSHASH 0x8000
#define VROOT 0x000001
#define VTEXT 0x000002
#define VSYSTEM 0x000004
#define VISTTY 0x000008
#define VRAGE 0x000010
#define VBDEVVP 0x000020
#define VDEVFLUSH 0x000040
#define VMOUNT 0x000080
#define VBWAIT 0x000100
#define VSHARED_DYLD 0x000200
#define VNOCACHE_DATA 0x000400
#define VSTANDARD 0x000800
#define VAGE 0x001000
#define VRAOFF 0x002000
#define VNCACHEABLE 0x004000
#define VSWAP 0x010000
#define VTHROTTLED 0x020000
#define VNOFLUSH 0x040000
#define VLOCKLOCAL 0x080000
#define VISHARDLINK 0x100000
#define VISUNION 0x200000
#define VOPENEVT 0x800000
#define VNEEDSSNAPSHOT 0x1000000
#define VNOCS 0x2000000
extern struct vnode *rootvnode;
#define VDESC_MAX_VPS 16
#define VDESC_VP0_WILLRELE 0x0001
#define VDESC_VP1_WILLRELE 0x0002
#define VDESC_VP2_WILLRELE 0x0004
#define VDESC_VP3_WILLRELE 0x0008
#define VDESC_NOMAP_VPP 0x0100
#define VDESC_VPP_WILLRELE 0x0200
#define VDESC_NO_OFFSET -1
struct vnodeop_desc {
 int vdesc_offset;
 const char *vdesc_name;
 int vdesc_flags;
 int *vdesc_vp_offsets;
 int vdesc_vpp_offset;
 int vdesc_cred_offset;
 int vdesc_proc_offset;
 int vdesc_componentname_offset;
 int vdesc_context_offset;
 caddr_t *vdesc_transports;
};
extern struct vnodeop_desc *vnodeop_descs[];
#define VOPARG_OFFSET(p_type,field) ((int) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#define VOPARG_OFFSETOF(s_type,field) VOPARG_OFFSET(s_type*,field)
#define VOPARG_OFFSETTO(S_TYPE,S_OFFSET,STRUCT_P) ((S_TYPE)(((char*)(STRUCT_P))+(S_OFFSET)))
#define VOCALL(OPSV,OFF,AP) (( *((OPSV)[(OFF)])) (AP))
#define VCALL(VP,OFF,AP) VOCALL((VP)->v_op,(OFF),(AP))
#define VDESC(OP) (& __CONCAT(OP,_desc))
#define VOFFSET(OP) (VDESC(OP)->vdesc_offset)
struct ostat;
#define BUILDPATH_NO_FS_ENTER 0x1
#define BUILDPATH_CHECKACCESS 0x2
#define BUILDPATH_CHECK_MOVED 0x4
#define BUILDPATH_VOLUME_RELATIVE 0x8
int build_path(vnode_t first_vp, char *buff, int buflen, int *outlen, int flags, vfs_context_t ctx);
int bdevvp(dev_t dev, struct vnode **vpp);
void cvtstat(struct stat *st, struct ostat *ost);
void vprint(const char *label, struct vnode *vp);
 int is_package_name(const char *name, int len);
 int set_package_extensions_table(user_addr_t data, int nentries, int maxwidth);
int vn_rdwr_64(enum uio_rw rw, struct vnode *vp, uint64_t base,
       int64_t len, off_t offset, enum uio_seg segflg,
   int ioflg, kauth_cred_t cred, int64_t *aresid,
   struct proc *p);
void fifo_printinfo(struct vnode *vp);
int vn_open(struct nameidata *ndp, int fmode, int cmode);
int vn_open_modflags(struct nameidata *ndp, int *fmode, int cmode);
int vn_open_auth(struct nameidata *ndp, int *fmode, struct vnode_attr *);
int vn_close(vnode_t, int flags, vfs_context_t ctx);
errno_t vn_remove(vnode_t dvp, vnode_t *vpp, struct nameidata *ndp, int32_t flags, struct vnode_attr *vap, vfs_context_t ctx);
errno_t vn_rename(struct vnode *fdvp, struct vnode **fvpp, struct componentname *fcnp, struct vnode_attr *fvap,
             struct vnode *tdvp, struct vnode **tvpp, struct componentname *tcnp, struct vnode_attr *tvap,
             uint32_t flags, vfs_context_t ctx);
void lock_vnode_and_post(vnode_t, int);
#define post_event_if_success(_vp,_error,_event) do { if (0 == (_error)) { lock_vnode_and_post((_vp), (_event)); } } while (0)
int vn_authorize_open_existing(vnode_t vp, struct componentname *cnp, int fmode, vfs_context_t ctx, void *reserved);
int vn_authorize_create(vnode_t, struct componentname *, struct vnode_attr *, vfs_context_t, void*);
int vn_attribute_prepare(vnode_t dvp, struct vnode_attr *vap, uint32_t *defaulted_fieldsp, vfs_context_t ctx);
void vn_attribute_cleanup(struct vnode_attr *vap, uint32_t defaulted_fields);
int vn_authorize_unlink(vnode_t dvp, vnode_t vp, struct componentname *cnp, vfs_context_t ctx, void *reserved);
int vn_authorize_rename(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp,
         struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp,
             vfs_context_t ctx, void *reserved);
int vn_authorize_rmdir(vnode_t dvp, vnode_t vp, struct componentname *cnp, vfs_context_t ctx, void *reserved);
typedef int (*vn_create_authorizer_t)(vnode_t, struct componentname *, struct vnode_attr *, vfs_context_t, void*);
int vn_authorize_mkdir(vnode_t, struct componentname *, struct vnode_attr *, vfs_context_t, void*);
int vn_authorize_null(vnode_t, struct componentname *, struct vnode_attr *, vfs_context_t, void*);
#define VN_CREATE_NOAUTH (1<<0)
#define VN_CREATE_NOINHERIT (1<<1)
#define VN_CREATE_UNION (1<<2)
#define VN_CREATE_NOLABEL (1<<3)
#define VN_CREATE_DOOPEN (1<<4)
errno_t vn_create(vnode_t, vnode_t *, struct nameidata *, struct vnode_attr *, uint32_t, int, uint32_t*, vfs_context_t);
int vn_mkdir(vnode_t dvp, vnode_t *vpp, struct nameidata *ndp, struct vnode_attr *vap, vfs_context_t ctx);
int vn_rmdir(vnode_t dvp, vnode_t *vpp, struct nameidata *ndp, struct vnode_attr *vap, vfs_context_t ctx);
int vn_getxattr(vnode_t, const char *, uio_t, size_t *, int, vfs_context_t);
int vn_setxattr(vnode_t, const char *, uio_t, int, vfs_context_t);
int vn_removexattr(vnode_t, const char *, int, vfs_context_t);
int vn_listxattr(vnode_t, uio_t, size_t *, int, vfs_context_t);
void nchinit(void);
int resize_namecache(uint32_t newsize);
void name_cache_lock_shared(void);
void name_cache_lock(void);
void name_cache_unlock(void);
void cache_enter_with_gen(vnode_t dvp, vnode_t vp, struct componentname *cnp, int gen);
const char *cache_enter_create(vnode_t dvp, vnode_t vp, struct componentname *cnp);
int vn_pathconf(vnode_t, int, int32_t *, vfs_context_t);
extern int nc_disabled;
#define vnode_lock_convert(v) lck_mtx_convert_spin(&(v)->v_lock)
void vnode_lock_spin(vnode_t);
void vnode_list_lock(void);
void vnode_list_unlock(void);
#define VNODE_REF_FORCE 0x1
int vnode_ref_ext(vnode_t, int, int);
void vnode_rele_ext(vnode_t, int, int);
void vnode_rele_internal(vnode_t, int, int, int);
int vnode_getalways(vnode_t);
int vget_internal(vnode_t, int, int);
errno_t vnode_getiocount(vnode_t, unsigned int, int);
int vnode_get_locked(vnode_t);
int vnode_put_locked(vnode_t);
int vnode_issock(vnode_t);
int vnode_isaliased(vnode_t);
void unlock_fsnode(vnode_t, int *);
int lock_fsnode(vnode_t, int *);
errno_t vnode_resume(vnode_t);
errno_t vnode_suspend(vnode_t);
errno_t vnode_size(vnode_t, off_t *, vfs_context_t);
errno_t vnode_setsize(vnode_t, off_t, int ioflag, vfs_context_t);
int vnode_setattr_fallback(vnode_t vp, struct vnode_attr *vap, vfs_context_t ctx);
int vnode_isspec(vnode_t vp);
typedef uint32_t compound_vnop_id_t;
#define COMPOUND_VNOP_OPEN 0x01
#define COMPOUND_VNOP_MKDIR 0x02
#define COMPOUND_VNOP_RENAME 0x04
#define COMPOUND_VNOP_REMOVE 0x08
#define COMPOUND_VNOP_RMDIR 0x10
int vnode_compound_rename_available(vnode_t vp);
int vnode_compound_rmdir_available(vnode_t vp);
int vnode_compound_mkdir_available(vnode_t vp);
int vnode_compound_remove_available(vnode_t vp);
int vnode_compound_open_available(vnode_t vp);
int vnode_compound_op_available(vnode_t, compound_vnop_id_t);
void vn_setunionwait(vnode_t);
void vn_checkunionwait(vnode_t);
void vn_clearunionwait(vnode_t, int);
void SPECHASH_LOCK(void);
void SPECHASH_UNLOCK(void);
void vnode_authorize_init(void);
void vfsinit(void);
void vnode_lock(vnode_t);
void vnode_unlock(vnode_t);
void vfs_op_init(void);
void vfs_opv_init(void);
int vfs_sysctl(int *name, uint32_t namelen, user_addr_t oldp, size_t *oldlenp,
  user_addr_t newp, size_t newlen, struct proc *p);
int sysctl_vnode(struct sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req);
void vnode_setneedinactive(vnode_t);
int vnode_hasnamedstreams(vnode_t);
void nspace_proc_exit(struct proc *p);
#define _NETINET_TCP_FSM_H_ 
#define TCP_NSTATES 11
#define TCPS_CLOSED 0
#define TCPS_LISTEN 1
#define TCPS_SYN_SENT 2
#define TCPS_SYN_RECEIVED 3
#define TCPS_ESTABLISHED 4
#define TCPS_CLOSE_WAIT 5
#define TCPS_FIN_WAIT_1 6
#define TCPS_CLOSING 7
#define TCPS_LAST_ACK 8
#define TCPS_FIN_WAIT_2 9
#define TCPS_TIME_WAIT 10
#define TCP6_NSTATES TCP_NSTATES
#define TCP6S_CLOSED TCPS_CLOSED
#define TCP6S_LISTEN TCPS_LISTEN
#define TCP6S_SYN_SENT TCPS_SYN_SENT
#define TCP6S_SYN_RECEIVED TCPS_SYN_RECEIVED
#define TCP6S_ESTABLISHED TCPS_ESTABLISHED
#define TCP6S_CLOSE_WAIT TCPS_CLOSE_WAIT
#define TCP6S_FIN_WAIT_1 TCPS_FIN_WAIT_1
#define TCP6S_CLOSING TCPS_CLOSING
#define TCP6S_LAST_ACK TCPS_LAST_ACK
#define TCP6S_FIN_WAIT_2 TCPS_FIN_WAIT_2
#define TCP6S_TIME_WAIT TCPS_TIME_WAIT
#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
#define _NETINET_IN_H_ 
#define IPPROTO_IP 0
#define IPPROTO_HOPOPTS 0
#define IPPROTO_ICMP 1
#define IPPROTO_IGMP 2
#define IPPROTO_GGP 3
#define IPPROTO_IPV4 4
#define IPPROTO_IPIP IPPROTO_IPV4
#define IPPROTO_TCP 6
#define IPPROTO_ST 7
#define IPPROTO_EGP 8
#define IPPROTO_PIGP 9
#define IPPROTO_RCCMON 10
#define IPPROTO_NVPII 11
#define IPPROTO_PUP 12
#define IPPROTO_ARGUS 13
#define IPPROTO_EMCON 14
#define IPPROTO_XNET 15
#define IPPROTO_CHAOS 16
#define IPPROTO_UDP 17
#define IPPROTO_MUX 18
#define IPPROTO_MEAS 19
#define IPPROTO_HMP 20
#define IPPROTO_PRM 21
#define IPPROTO_IDP 22
#define IPPROTO_TRUNK1 23
#define IPPROTO_TRUNK2 24
#define IPPROTO_LEAF1 25
#define IPPROTO_LEAF2 26
#define IPPROTO_RDP 27
#define IPPROTO_IRTP 28
#define IPPROTO_TP 29
#define IPPROTO_BLT 30
#define IPPROTO_NSP 31
#define IPPROTO_INP 32
#define IPPROTO_SEP 33
#define IPPROTO_3PC 34
#define IPPROTO_IDPR 35
#define IPPROTO_XTP 36
#define IPPROTO_DDP 37
#define IPPROTO_CMTP 38
#define IPPROTO_TPXX 39
#define IPPROTO_IL 40
#define IPPROTO_IPV6 41
#define IPPROTO_SDRP 42
#define IPPROTO_ROUTING 43
#define IPPROTO_FRAGMENT 44
#define IPPROTO_IDRP 45
#define IPPROTO_RSVP 46
#define IPPROTO_GRE 47
#define IPPROTO_MHRP 48
#define IPPROTO_BHA 49
#define IPPROTO_ESP 50
#define IPPROTO_AH 51
#define IPPROTO_INLSP 52
#define IPPROTO_SWIPE 53
#define IPPROTO_NHRP 54
#define IPPROTO_ICMPV6 58
#define IPPROTO_NONE 59
#define IPPROTO_DSTOPTS 60
#define IPPROTO_AHIP 61
#define IPPROTO_CFTP 62
#define IPPROTO_HELLO 63
#define IPPROTO_SATEXPAK 64
#define IPPROTO_KRYPTOLAN 65
#define IPPROTO_RVD 66
#define IPPROTO_IPPC 67
#define IPPROTO_ADFS 68
#define IPPROTO_SATMON 69
#define IPPROTO_VISA 70
#define IPPROTO_IPCV 71
#define IPPROTO_CPNX 72
#define IPPROTO_CPHB 73
#define IPPROTO_WSN 74
#define IPPROTO_PVP 75
#define IPPROTO_BRSATMON 76
#define IPPROTO_ND 77
#define IPPROTO_WBMON 78
#define IPPROTO_WBEXPAK 79
#define IPPROTO_EON 80
#define IPPROTO_VMTP 81
#define IPPROTO_SVMTP 82
#define IPPROTO_VINES 83
#define IPPROTO_TTP 84
#define IPPROTO_IGP 85
#define IPPROTO_DGP 86
#define IPPROTO_TCF 87
#define IPPROTO_IGRP 88
#define IPPROTO_OSPFIGP 89
#define IPPROTO_SRPC 90
#define IPPROTO_LARP 91
#define IPPROTO_MTP 92
#define IPPROTO_AX25 93
#define IPPROTO_IPEIP 94
#define IPPROTO_MICP 95
#define IPPROTO_SCCSP 96
#define IPPROTO_ETHERIP 97
#define IPPROTO_ENCAP 98
#define IPPROTO_APES 99
#define IPPROTO_GMTP 100
#define IPPROTO_PIM 103
#define IPPROTO_IPCOMP 108
#define IPPROTO_PGM 113
#define IPPROTO_SCTP 132
#define IPPROTO_DIVERT 254
#define IPPROTO_RAW 255
#define IPPROTO_MAX 256
#define IPPROTO_DONE 257
#define __DARWIN_IPPORT_RESERVED 1024
#define IPPORT_RESERVED __DARWIN_IPPORT_RESERVED
#define IPPORT_USERRESERVED 5000
#define IPPORT_HIFIRSTAUTO 49152
#define IPPORT_HILASTAUTO 65535
#define IPPORT_RESERVEDSTART 600
struct in_addr {
 in_addr_t s_addr;
};
#define INADDR_ANY (u_int32_t)0x00000000
#define INADDR_BROADCAST (u_int32_t)0xffffffff
#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST 0x00ffffff
#define IN_CLASSA_MAX 128
#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST 0x0000ffff
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST 0x000000ff
#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
#define IN_CLASSD_NET 0xf0000000
#define IN_CLASSD_NSHIFT 28
#define IN_CLASSD_HOST 0x0fffffff
#define IN_MULTICAST(i) IN_CLASSD(i)
#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000
#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001
#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002
#define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016
#define INADDR_CARP_GROUP (u_int32_t)0xe0000012
#define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0
#define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb
#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff
#define IN_LOOPBACKNET 127
struct sockaddr_in {
 __uint8_t sin_len;
 sa_family_t sin_family;
 in_port_t sin_port;
 struct in_addr sin_addr;
 char sin_zero[8];
};
#define INET_ADDRSTRLEN 16
struct ip_opts {
 struct in_addr ip_dst;
 char ip_opts[40];
};
#define IP_OPTIONS 1
#define IP_HDRINCL 2
#define IP_TOS 3
#define IP_TTL 4
#define IP_RECVOPTS 5
#define IP_RECVRETOPTS 6
#define IP_RECVDSTADDR 7
#define IP_RETOPTS 8
#define IP_MULTICAST_IF 9
#define IP_MULTICAST_TTL 10
#define IP_MULTICAST_LOOP 11
#define IP_ADD_MEMBERSHIP 12
#define IP_DROP_MEMBERSHIP 13
#define IP_MULTICAST_VIF 14
#define IP_RSVP_ON 15
#define IP_RSVP_OFF 16
#define IP_RSVP_VIF_ON 17
#define IP_RSVP_VIF_OFF 18
#define IP_PORTRANGE 19
#define IP_RECVIF 20
#define IP_IPSEC_POLICY 21
#define IP_FAITH 22
#define IP_RECVTTL 24
#define IP_BOUND_IF 25
#define IP_PKTINFO 26
#define IP_RECVPKTINFO IP_PKTINFO
#define IP_FW_ADD 40
#define IP_FW_DEL 41
#define IP_FW_FLUSH 42
#define IP_FW_ZERO 43
#define IP_FW_GET 44
#define IP_FW_RESETLOG 45
#define IP_OLD_FW_ADD 50
#define IP_OLD_FW_DEL 51
#define IP_OLD_FW_FLUSH 52
#define IP_OLD_FW_ZERO 53
#define IP_OLD_FW_GET 54
#define IP_NAT__XXX 55
#define IP_OLD_FW_RESETLOG 56
#define IP_DUMMYNET_CONFIGURE 60
#define IP_DUMMYNET_DEL 61
#define IP_DUMMYNET_FLUSH 62
#define IP_DUMMYNET_GET 64
#define IP_TRAFFIC_MGT_BACKGROUND 65
#define IP_MULTICAST_IFINDEX 66
#define IP_ADD_SOURCE_MEMBERSHIP 70
#define IP_DROP_SOURCE_MEMBERSHIP 71
#define IP_BLOCK_SOURCE 72
#define IP_UNBLOCK_SOURCE 73
#define IP_MSFILTER 74
#define MCAST_JOIN_GROUP 80
#define MCAST_LEAVE_GROUP 81
#define MCAST_JOIN_SOURCE_GROUP 82
#define MCAST_LEAVE_SOURCE_GROUP 83
#define MCAST_BLOCK_SOURCE 84
#define MCAST_UNBLOCK_SOURCE 85
#define IP_DEFAULT_MULTICAST_TTL 1
#define IP_DEFAULT_MULTICAST_LOOP 1
#define IP_MIN_MEMBERSHIPS 31
#define IP_MAX_MEMBERSHIPS 4095
#define IP_MAX_GROUP_SRC_FILTER 512
#define IP_MAX_SOCK_SRC_FILTER 128
#define IP_MAX_SOCK_MUTE_FILTER 128
struct ip_mreq {
 struct in_addr imr_multiaddr;
 struct in_addr imr_interface;
};
struct ip_mreqn {
 struct in_addr imr_multiaddr;
 struct in_addr imr_address;
 int imr_ifindex;
};
#pragma pack(4)
struct ip_mreq_source {
 struct in_addr imr_multiaddr;
 struct in_addr imr_sourceaddr;
 struct in_addr imr_interface;
};
struct group_req {
 uint32_t gr_interface;
 struct sockaddr_storage gr_group;
};
struct group_source_req {
 uint32_t gsr_interface;
 struct sockaddr_storage gsr_group;
 struct sockaddr_storage gsr_source;
};
#define __MSFILTERREQ_DEFINED 
struct __msfilterreq {
 uint32_t msfr_ifindex;
 uint32_t msfr_fmode;
 uint32_t msfr_nsrcs;
 uint32_t __msfr_align;
 struct sockaddr_storage msfr_group;
 struct sockaddr_storage *msfr_srcs;
};
struct __msfilterreq32 {
 uint32_t msfr_ifindex;
 uint32_t msfr_fmode;
 uint32_t msfr_nsrcs;
 uint32_t __msfr_align;
 struct sockaddr_storage msfr_group;
 user32_addr_t msfr_srcs;
};
struct __msfilterreq64 {
 uint32_t msfr_ifindex;
 uint32_t msfr_fmode;
 uint32_t msfr_nsrcs;
 uint32_t __msfr_align;
 struct sockaddr_storage msfr_group;
 user64_addr_t msfr_srcs;
};
#pragma pack()
struct sockaddr;
#define MCAST_UNDEFINED 0
#define MCAST_INCLUDE 1
#define MCAST_EXCLUDE 2
#define IP_PORTRANGE_DEFAULT 0
#define IP_PORTRANGE_HIGH 1
#define IP_PORTRANGE_LOW 2
struct in_pktinfo {
 unsigned int ipi_ifindex;
 struct in_addr ipi_spec_dst;
 struct in_addr ipi_addr;
};
#define IPPROTO_MAXID (IPPROTO_AH + 1)
#define CTL_IPPROTO_NAMES { { "ip", CTLTYPE_NODE }, { "icmp", CTLTYPE_NODE }, { "igmp", CTLTYPE_NODE }, { "ggp", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { "tcp", CTLTYPE_NODE }, { 0, 0 }, { "egp", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "pup", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "udp", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "idp", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "ipsec", CTLTYPE_NODE }, }
#define IPCTL_FORWARDING 1
#define IPCTL_SENDREDIRECTS 2
#define IPCTL_DEFTTL 3
#define IPCTL_RTEXPIRE 5
#define IPCTL_RTMINEXPIRE 6
#define IPCTL_RTMAXCACHE 7
#define IPCTL_SOURCEROUTE 8
#define IPCTL_DIRECTEDBROADCAST 9
#define IPCTL_INTRQMAXLEN 10
#define IPCTL_INTRQDROPS 11
#define IPCTL_STATS 12
#define IPCTL_ACCEPTSOURCEROUTE 13
#define IPCTL_FASTFORWARDING 14
#define IPCTL_KEEPFAITH 15
#define IPCTL_GIF_TTL 16
#define IPCTL_MAXID 17
#define IPCTL_NAMES { { 0, 0 }, { "forwarding", CTLTYPE_INT }, { "redirect", CTLTYPE_INT }, { "ttl", CTLTYPE_INT }, { "mtu", CTLTYPE_INT }, { "rtexpire", CTLTYPE_INT }, { "rtminexpire", CTLTYPE_INT }, { "rtmaxcache", CTLTYPE_INT }, { "sourceroute", CTLTYPE_INT }, { "directed-broadcast", CTLTYPE_INT }, { "intr-queue-maxlen", CTLTYPE_INT }, { "intr-queue-drops", CTLTYPE_INT }, { "stats", CTLTYPE_STRUCT }, { "accept_sourceroute", CTLTYPE_INT }, { "fastforwarding", CTLTYPE_INT }, { "keepfaith", CTLTYPE_INT }, { "gifttl", CTLTYPE_INT }, }
#define __KAME_NETINET_IN_H_INCLUDED_ 
#define _NETINET6_IN6_H_ 
#define __KAME__ 
#define __KAME_VERSION "2009/apple-darwin"
#define IPV6PORT_RESERVED 1024
#define IPV6PORT_ANONMIN 49152
#define IPV6PORT_ANONMAX 65535
#define IPV6PORT_RESERVEDMIN 600
#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
struct in6_addr {
 union {
  __uint8_t __u6_addr8[16];
  __uint16_t __u6_addr16[8];
  __uint32_t __u6_addr32[4];
 } __u6_addr;
};
#define s6_addr __u6_addr.__u6_addr8
#define s6_addr8 __u6_addr.__u6_addr8
#define s6_addr16 __u6_addr.__u6_addr16
#define s6_addr32 __u6_addr.__u6_addr32
#define INET6_ADDRSTRLEN 46
#define SIN6_LEN 
struct sockaddr_in6 {
 __uint8_t sin6_len;
 sa_family_t sin6_family;
 in_port_t sin6_port;
 __uint32_t sin6_flowinfo;
 struct in6_addr sin6_addr;
 __uint32_t sin6_scope_id;
};
#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
#define IN6MASK7 {{{ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK16 {{{ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
extern const struct sockaddr_in6 sa6_any;
extern const struct in6_addr in6mask0;
extern const struct in6_addr in6mask7;
extern const struct in6_addr in6mask16;
extern const struct in6_addr in6mask32;
extern const struct in6_addr in6mask64;
extern const struct in6_addr in6mask96;
extern const struct in6_addr in6mask128;
#define SIN6(s) ((struct sockaddr_in6 *)(void *)s)
#define satosin6(sa) SIN6(sa)
#define sin6tosa(sin6) ((struct sockaddr *)(void *)(sin6))
#define SIN6IFSCOPE(s) SIN6(s)
#define IPV6_ADDR_INT32_ONE 0x01000000
#define IPV6_ADDR_INT32_TWO 0x02000000
#define IPV6_ADDR_INT32_MNL 0x000001ff
#define IPV6_ADDR_INT32_MLL 0x000002ff
#define IPV6_ADDR_INT32_SMP 0xffff0000
#define IPV6_ADDR_INT16_ULL 0x80fe
#define IPV6_ADDR_INT16_USL 0xc0fe
#define IPV6_ADDR_INT16_MLL 0x02ff
#define IN6ADDR_ANY_INIT {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6ADDR_LOOPBACK_INIT {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_NODELOCAL_ALLNODES_INIT {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_INTFACELOCAL_ALLNODES_INIT {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_LINKLOCAL_ALLNODES_INIT {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
#define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}}
#define IN6ADDR_V4MAPPED_INIT {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
extern const struct in6_addr in6addr_nodelocal_allnodes;
extern const struct in6_addr in6addr_linklocal_allnodes;
extern const struct in6_addr in6addr_linklocal_allrouters;
extern const struct in6_addr in6addr_linklocal_allv2routers;
#define IN6_ARE_ADDR_EQUAL(a,b) (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof (struct in6_addr)) == 0)
#define SA6_ARE_ADDR_EQUAL(a,b) (((a)->sin6_scope_id == 0 || (b)->sin6_scope_id == 0 || ((a)->sin6_scope_id == (b)->sin6_scope_id)) && (bcmp(&(a)->sin6_addr, &(b)->sin6_addr, sizeof (struct in6_addr)) == 0))
#define IN6_IS_ADDR_UNSPECIFIED(a) ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
#define IN6_IS_ADDR_LOOPBACK(a) ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
#define IN6_IS_ADDR_V4COMPAT(a) ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
#define IN6_IS_ADDR_V4MAPPED(a) ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
#define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) == 0x2002)
#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
#define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08
#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
#define IN6_IS_ADDR_LINKLOCAL(a) (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
#define IN6_IS_ADDR_SITELOCAL(a) (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
#define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd))
#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
#define IN6_IS_ADDR_MC_NODELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL))
#define IN6_IS_ADDR_MC_INTFACELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL))
#define IN6_IS_ADDR_MC_LINKLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
#define IN6_IS_ADDR_MC_SITELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
#define IN6_IS_ADDR_MC_ORGLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
#define IN6_IS_ADDR_MC_GLOBAL(a) (IN6_IS_ADDR_MULTICAST(a) && (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL))
#define IN6_IS_SCOPE_LINKLOCAL(a) ((IN6_IS_ADDR_LINKLOCAL(a)) || (IN6_IS_ADDR_MC_LINKLOCAL(a)))
#define IN6_IS_SCOPE_EMBED(a) ((IN6_IS_ADDR_LINKLOCAL(a)) || (IN6_IS_ADDR_MC_LINKLOCAL(a)) || (IN6_IS_ADDR_MC_INTFACELOCAL(a)))
#define IFA6_IS_DEPRECATED(a,t) ((a)->ia6_lifetime.ia6ti_preferred != 0 && (a)->ia6_lifetime.ia6ti_preferred < (t))
#define IFA6_IS_INVALID(a,t) ((a)->ia6_lifetime.ia6ti_expire != 0 && (a)->ia6_lifetime.ia6ti_expire < (t))
struct route_in6 {
 struct rtentry *ro_rt;
 struct ifaddr *ro_srcia;
 uint32_t ro_flags;
 struct sockaddr_in6 ro_dst;
};
#define __APPLE_USE_RFC_3542 1
#define IPV6_SOCKOPT_RESERVED1 3
#define IPV6_UNICAST_HOPS 4
#define IPV6_MULTICAST_IF 9
#define IPV6_MULTICAST_HOPS 10
#define IPV6_MULTICAST_LOOP 11
#define IPV6_JOIN_GROUP 12
#define IPV6_LEAVE_GROUP 13
#define IPV6_PORTRANGE 14
#define ICMP6_FILTER 18
#define IPV6_2292PKTINFO 19
#define IPV6_2292HOPLIMIT 20
#define IPV6_2292NEXTHOP 21
#define IPV6_2292HOPOPTS 22
#define IPV6_2292DSTOPTS 23
#define IPV6_2292RTHDR 24
#define IPV6_2292PKTOPTIONS 25
#define IPV6_CHECKSUM 26
#define IPV6_V6ONLY 27
#define IPV6_IPSEC_POLICY 28
#define IPV6_FAITH 29
#define IPV6_FW_ADD 30
#define IPV6_FW_DEL 31
#define IPV6_FW_FLUSH 32
#define IPV6_FW_ZERO 33
#define IPV6_FW_GET 34
#define IPV6_RECVTCLASS 35
#define IPV6_TCLASS 36
#define IPV6_RTHDRDSTOPTS 57
#define IPV6_RECVPKTINFO 61
#define IPV6_RECVHOPLIMIT 37
#define IPV6_RECVRTHDR 38
#define IPV6_RECVHOPOPTS 39
#define IPV6_RECVDSTOPTS 40
#define IPV6_RECVRTHDRDSTOPTS 41
#define IPV6_USE_MIN_MTU 42
#define IPV6_RECVPATHMTU 43
#define IPV6_PATHMTU 44
#define IPV6_3542PKTINFO 46
#define IPV6_3542HOPLIMIT 47
#define IPV6_3542NEXTHOP 48
#define IPV6_3542HOPOPTS 49
#define IPV6_3542DSTOPTS 50
#define IPV6_3542RTHDR 51
#define IPV6_PKTINFO IPV6_3542PKTINFO
#define IPV6_HOPLIMIT IPV6_3542HOPLIMIT
#define IPV6_NEXTHOP IPV6_3542NEXTHOP
#define IPV6_HOPOPTS IPV6_3542HOPOPTS
#define IPV6_DSTOPTS IPV6_3542DSTOPTS
#define IPV6_RTHDR IPV6_3542RTHDR
#define IPV6_AUTOFLOWLABEL 59
#define IPV6_DONTFRAG 62
#define IPV6_PREFER_TEMPADDR 63
#define IPV6_MSFILTER 74
#define IPV6_BOUND_IF 125
#define IPV6_RTHDR_LOOSE 0
#define IPV6_RTHDR_STRICT 1
#define IPV6_RTHDR_TYPE_0 0
#define IPV6_DEFAULT_MULTICAST_HOPS 1
#define IPV6_DEFAULT_MULTICAST_LOOP 1
#define IPV6_MIN_MEMBERSHIPS 31
#define IPV6_MAX_MEMBERSHIPS 4095
#define IPV6_MAX_GROUP_SRC_FILTER 512
#define IPV6_MAX_SOCK_SRC_FILTER 128
struct ipv6_mreq {
 struct in6_addr ipv6mr_multiaddr;
 unsigned int ipv6mr_interface;
};
struct in6_pktinfo {
 struct in6_addr ipi6_addr;
 unsigned int ipi6_ifindex;
};
struct ip6_mtuinfo {
 struct sockaddr_in6 ip6m_addr;
 uint32_t ip6m_mtu;
};
#define IPV6_PORTRANGE_DEFAULT 0
#define IPV6_PORTRANGE_HIGH 1
#define IPV6_PORTRANGE_LOW 2
#define IPV6PROTO_MAXID (IPPROTO_PIM + 1)
#define IPV6CTL_FORWARDING 1
#define IPV6CTL_SENDREDIRECTS 2
#define IPV6CTL_DEFHLIM 3
#define IPV6CTL_FORWSRCRT 5
#define IPV6CTL_STATS 6
#define IPV6CTL_MRTSTATS 7
#define IPV6CTL_MRTPROTO 8
#define IPV6CTL_MAXFRAGPACKETS 9
#define IPV6CTL_SOURCECHECK 10
#define IPV6CTL_SOURCECHECK_LOGINT 11
#define IPV6CTL_ACCEPT_RTADV 12
#define IPV6CTL_KEEPFAITH 13
#define IPV6CTL_LOG_INTERVAL 14
#define IPV6CTL_HDRNESTLIMIT 15
#define IPV6CTL_DAD_COUNT 16
#define IPV6CTL_AUTO_FLOWLABEL 17
#define IPV6CTL_DEFMCASTHLIM 18
#define IPV6CTL_GIF_HLIM 19
#define IPV6CTL_KAME_VERSION 20
#define IPV6CTL_USE_DEPRECATED 21
#define IPV6CTL_RR_PRUNE 22
#define IPV6CTL_V6ONLY 24
#define IPV6CTL_RTEXPIRE 25
#define IPV6CTL_RTMINEXPIRE 26
#define IPV6CTL_RTMAXCACHE 27
#define IPV6CTL_USETEMPADDR 32
#define IPV6CTL_TEMPPLTIME 33
#define IPV6CTL_TEMPVLTIME 34
#define IPV6CTL_AUTO_LINKLOCAL 35
#define IPV6CTL_RIP6STATS 36
#define IPV6CTL_PREFER_TEMPADDR 37
#define IPV6CTL_ADDRCTLPOLICY 38
#define IPV6CTL_USE_DEFAULTZONE 39
#define IPV6CTL_MAXFRAGS 41
#define IPV6CTL_MCAST_PMTU 44
#define IPV6CTL_NEIGHBORGCTHRESH 46
#define IPV6CTL_MAXIFPREFIXES 47
#define IPV6CTL_MAXIFDEFROUTERS 48
#define IPV6CTL_MAXDYNROUTES 49
#define ICMPV6CTL_ND6_ONLINKNSRFC4861 50
#define IPV6CTL_MAXID 51
#define CTL_IPV6PROTO_NAMES { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "tcp6", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "udp6", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "ip6", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "ipsec6", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "icmp6", CTLTYPE_NODE }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { "pim6", CTLTYPE_NODE }, }
#define M_AUTHIPHDR M_PROTO2
#define M_DECRYPTED M_PROTO3
#define M_AUTHIPDGM M_PROTO5
struct cmsghdr;
struct mbuf;
struct ifnet;
struct in6_aliasreq;
extern uint16_t in6_pseudo(const struct in6_addr *, const struct in6_addr *,
    uint32_t);
extern u_int16_t inet6_cksum(struct mbuf *, uint32_t, uint32_t, uint32_t);
#define in6_cksum(_m,_n,_o,_l) inet6_cksum(_m, _n, _o, _l)
extern int in6_addrscope(struct in6_addr *);
extern struct in6_ifaddr *in6_ifawithscope(struct ifnet *, struct in6_addr *);
extern struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *);
struct sockaddr;
extern void in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6);
extern void in6_sin_2_v4mapsin6(struct sockaddr_in *sin,
    struct sockaddr_in6 *sin6);
extern void in6_sin6_2_sin_in_sock(struct sockaddr *nam);
extern int in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam);
extern uint32_t in6_finalize_cksum(struct mbuf *, uint32_t, int32_t,
    int32_t, uint32_t);
#define in6_delayed_cksum(_m) ((void) in6_finalize_cksum(_m, 0, 0, -1, CSUM_DELAY_IPV6_DATA))
#define in6_delayed_cksum_offset(_m,_o,_s,_p) ((void) in6_finalize_cksum(_m, _o, _s, _p, CSUM_DELAY_IPV6_DATA))
extern int in6_localaddr(struct in6_addr *);
extern int in6addr_local(struct in6_addr *);
#undef __KAME_NETINET_IN_H_INCLUDED_
struct ip;
struct ifnet;
struct mbuf;
extern boolean_t in_broadcast(struct in_addr, struct ifnet *);
extern boolean_t in_canforward(struct in_addr);
extern u_int32_t in_netof(struct in_addr);
extern uint16_t inet_cksum(struct mbuf *, uint32_t, uint32_t, uint32_t);
extern uint16_t in_addword(uint16_t, uint16_t);
extern uint16_t in_pseudo(uint32_t, uint32_t, uint32_t);
extern uint16_t in_pseudo64(uint64_t, uint64_t, uint64_t);
extern uint16_t in_cksum_hdr_opt(const struct ip *);
extern uint16_t ip_cksum_hdr_dir(struct mbuf *, uint32_t, int);
extern uint32_t in_finalize_cksum(struct mbuf *, uint32_t, uint32_t);
extern uint16_t b_sum16(const void *buf, int len);
#define in_cksum(_m,_l) inet_cksum(_m, 0, 0, _l)
#define ip_cksum_hdr_in(_m,_l) ip_cksum_hdr_dir(_m, _l, 0)
#define ip_cksum_hdr_out(_m,_l) ip_cksum_hdr_dir(_m, _l, 1)
#define in_cksum_hdr(_ip) (~b_sum16(_ip, sizeof (struct ip)) & 0xffff)
#define in_cksum_offset(_m,_o) ((void) in_finalize_cksum(_m, _o, CSUM_DELAY_IP))
#define in_delayed_cksum(_m) ((void) in_finalize_cksum(_m, 0, CSUM_DELAY_DATA))
#define in_delayed_cksum_offset(_m,_o) ((void) in_finalize_cksum(_m, _o, CSUM_DELAY_DATA))
#define in_hosteq(s,t) ((s).s_addr == (t).s_addr)
#define in_nullhost(x) ((x).s_addr == INADDR_ANY)
#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP))
#define SIN(s) ((struct sockaddr_in *)(void *)s)
#define satosin(sa) SIN(sa)
#define sintosa(sin) ((struct sockaddr *)(void *)(sin))
#define SINIFSCOPE(s) ((struct sockaddr_inifscope *)(void *)(s))
extern int in_localaddr(struct in_addr);
extern int inaddr_local(struct in_addr);
#define MAX_IPv4_STR_LEN 16
#define MAX_IPv6_STR_LEN 64
extern int inet_aton(const char *, struct in_addr *);
extern char *inet_ntoa(struct in_addr);
extern char *inet_ntoa_r(struct in_addr ina, char *buf,
    size_t buflen);
extern const char *inet_ntop(int, const void *, char *, socklen_t);
extern int inet_pton(int af, const char *, void *);
#define _PEXPERT_I386_BOOT_H 
enum {
    kBootDriverTypeInvalid = 0,
    kBootDriverTypeKEXT = 1,
    kBootDriverTypeMKEXT = 2
};
enum {
    kEfiReservedMemoryType = 0,
    kEfiLoaderCode = 1,
    kEfiLoaderData = 2,
    kEfiBootServicesCode = 3,
    kEfiBootServicesData = 4,
    kEfiRuntimeServicesCode = 5,
    kEfiRuntimeServicesData = 6,
    kEfiConventionalMemory = 7,
    kEfiUnusableMemory = 8,
    kEfiACPIReclaimMemory = 9,
    kEfiACPIMemoryNVS = 10,
    kEfiMemoryMappedIO = 11,
    kEfiMemoryMappedIOPortSpace = 12,
    kEfiPalCode = 13,
    kEfiMaxMemoryType = 14
};
typedef struct EfiMemoryRange {
    uint32_t Type;
    uint32_t Pad;
    uint64_t PhysicalStart;
    uint64_t VirtualStart;
    uint64_t NumberOfPages;
    uint64_t Attribute;
} EfiMemoryRange;
#define BOOT_LINE_LENGTH 1024
#define BOOT_STRING_LEN BOOT_LINE_LENGTH
struct Boot_Video {
 uint32_t v_baseAddr;
 uint32_t v_display;
 uint32_t v_rowBytes;
 uint32_t v_width;
 uint32_t v_height;
 uint32_t v_depth;
};
typedef struct Boot_Video Boot_Video;
#define GRAPHICS_MODE 1
#define FB_TEXT_MODE 2
struct boot_icon_element {
    unsigned int width;
    unsigned int height;
    int y_offset_from_center;
    unsigned int data_size;
    unsigned int __reserved1[4];
    unsigned char data[0];
};
typedef struct boot_icon_element boot_icon_element;
#define kBootArgsRevision 0
#define kBootArgsVersion 2
#define kBootArgsVersion1 1
#define kBootArgsVersion2 2
#define kBootArgsRevision2_0 0
#define kBootArgsEfiMode32 32
#define kBootArgsEfiMode64 64
#define kBootArgsFlagRebootOnPanic (1 << 0)
#define kBootArgsFlagHiDPI (1 << 1)
#define kBootArgsFlagBlack (1 << 2)
typedef struct boot_args {
    uint16_t Revision;
    uint16_t Version;
    uint8_t efiMode;
    uint8_t debugMode;
    uint16_t flags;
    char CommandLine[1024];
    uint32_t MemoryMap;
    uint32_t MemoryMapSize;
    uint32_t MemoryMapDescriptorSize;
    uint32_t MemoryMapDescriptorVersion;
    Boot_Video Video;
    uint32_t deviceTreeP;
    uint32_t deviceTreeLength;
    uint32_t kaddr;
    uint32_t ksize;
    uint32_t efiRuntimeServicesPageStart;
    uint32_t efiRuntimeServicesPageCount;
    uint64_t efiRuntimeServicesVirtualPageStart;
    uint32_t efiSystemTable;
    uint32_t kslide;
    uint32_t performanceDataStart;
    uint32_t performanceDataSize;
    uint32_t keyStoreDataStart;
    uint32_t keyStoreDataSize;
    uint64_t bootMemStart;
    uint64_t bootMemSize;
    uint64_t PhysicalMemorySize;
    uint64_t FSBFrequency;
    uint64_t pciConfigSpaceBaseAddress;
    uint32_t pciConfigSpaceStartBusNumber;
    uint32_t pciConfigSpaceEndBusNumber;
    uint32_t __reserved4[730];
} boot_args;
extern char assert_boot_args_size_is_4096[sizeof(boot_args) == 4096 ? 1 : -1];
enum SOCK_ENUM {
  _SOCK_STREAM = 1,
  _SOCK_DGRAM = 2,
  _SOCK_RAW = 3,
  _SOCK_RDM = 4,
  _SOCK_SEQPACKET = 5,
  _SOCK_MAXADDRLEN = 255
};
static enum SOCK_ENUM AAAA0;
enum SO_ENUM {
  _SO_DEBUG = 0x0001,
  _SO_ACCEPTCONN = 0x0002,
  _SO_REUSEADDR = 0x0004,
  _SO_KEEPALIVE = 0x0008,
  _SO_DONTROUTE = 0x0010,
  _SO_BROADCAST = 0x0020,
  _SO_USELOOPBACK = 0x0040,
  _SO_LINGER = 0x0080,
  _SO_OOBINLINE = 0x0100,
  _SO_REUSEPORT = 0x0200,
  _SO_TIMESTAMP = 0x0400,
  _SO_TIMESTAMP_MONOTONIC = 0x0800,
  _SO_ACCEPTFILTER = 0x1000,
  _SO_SNDBUF = 0x1001,
  _SO_RCVBUF = 0x1002,
  _SO_SNDLOWAT = 0x1003,
  _SO_RCVLOWAT = 0x1004,
  _SO_SNDTIMEO = 0x1005,
  _SO_RCVTIMEO = 0x1006,
  _SO_ERROR = 0x1007,
  _SO_TYPE = 0x1008,
  _SO_LABEL = 0x1010,
  _SO_PEERLABEL = 0x1011
};
static enum SO_ENUM AAAA1;
enum LC_ENUM {
  _LC_REQ_DYLD = 0x80000000,
  _LC_SEGMENT = 0x1,
  _LC_SYMTAB = 0x2,
  _LC_SYMSEG = 0x3,
  _LC_THREAD = 0x4,
  _LC_UNIXTHREAD = 0x5,
  _LC_LOADFVMLIB = 0x6,
  _LC_IDFVMLIB = 0x7,
  _LC_IDENT = 0x8,
  _LC_FVMFILE = 0x9,
  _LC_PREPAGE = 0xa,
  _LC_DYSYMTAB = 0xb,
  _LC_LOAD_DYLIB = 0xc,
  _LC_ID_DYLIB = 0xd,
  _LC_LOAD_DYLINKER = 0xe,
  _LC_ID_DYLINKER = 0xf,
  _LC_PREBOUND_DYLIB = 0x10,
  _LC_ROUTINES = 0x11,
  _LC_SUB_FRAMEWORK = 0x12,
  _LC_SUB_UMBRELLA = 0x13,
  _LC_SUB_CLIENT = 0x14,
  _LC_SUB_LIBRARY = 0x15,
  _LC_TWOLEVEL_HINTS = 0x16,
  _LC_PREBIND_CKSUM = 0x17,
  _LC_LOAD_WEAK_DYLIB = (0x18 | 0x80000000),
  _LC_SEGMENT_64 = 0x19,
  _LC_ROUTINES_64 = 0x1a,
  _LC_UUID = 0x1b,
  _LC_RPATH = (0x1c | 0x80000000),
  _LC_CODE_SIGNATURE = 0x1d,
  _LC_SEGMENT_SPLIT_INFO = 0x1e,
  _LC_REEXPORT_DYLIB = (0x1f | 0x80000000),
  _LC_LAZY_LOAD_DYLIB = 0x20,
  _LC_ENCRYPTION_INFO = 0x21,
  _LC_DYLD_INFO = 0x22,
  _LC_DYLD_INFO_ONLY = (0x22|0x80000000),
  _LC_LOAD_UPWARD_DYLIB = (0x23 | 0x80000000),
  _LC_VERSION_MIN_MACOSX = 0x24,
  _LC_VERSION_MIN_IPHONEOS = 0x25,
  _LC_FUNCTION_STARTS = 0x26,
  _LC_DYLD_ENVIRONMENT = 0x27,
  _LC_MAIN = (0x28|0x80000000),
  _LC_DATA_IN_CODE = 0x29,
  _LC_SOURCE_VERSION = 0x2A,
  _LC_DYLIB_CODE_SIGN_DRS = 0x2B,
  _LC_ENCRYPTION_INFO_64 = 0x2C,
  _LC_SEGMENT_KERNEL = 0x19
};
static enum LC_ENUM AAAA2;
enum AF_ENUM {
  _AF_UNSPEC = 0,
  _AF_UNIX = 1,
  _AF_LOCAL = 1,
  _AF_INET = 2,
  _AF_IMPLINK = 3,
  _AF_PUP = 4,
  _AF_CHAOS = 5,
  _AF_NS = 6,
  _AF_ISO = 7,
  _AF_OSI = 7,
  _AF_ECMA = 8,
  _AF_DATAKIT = 9,
  _AF_CCITT = 10,
  _AF_SNA = 11,
  _AF_DECnet = 12,
  _AF_DLI = 13,
  _AF_LAT = 14,
  _AF_HYLINK = 15,
  _AF_APPLETALK = 16,
  _AF_ROUTE = 17,
  _AF_LINK = 18,
  _AF_COIP = 20,
  _AF_CNT = 21,
  _AF_IPX = 23,
  _AF_SIP = 24,
  _AF_NDRV = 27,
  _AF_ISDN = 28,
  _AF_E164 = 28,
  _AF_INET6 = 30,
  _AF_NATM = 31,
  _AF_SYSTEM = 32,
  _AF_NETBIOS = 33,
  _AF_PPP = 34,
  _AF_RESERVED_36 = 36,
  _AF_IEEE80211 = 37,
  _AF_UTUN = 38,
  _AF_MAX = 40
};
static enum AF_ENUM AAAA3;
enum MH_ENUM {
  _MH_MAGIC = 0xfeedface,
  _MH_CIGAM = 0xcefaedfe,
  _MH_MAGIC_64 = 0xfeedfacf,
  _MH_CIGAM_64 = 0xcffaedfe,
  _MH_OBJECT = 0x1,
  _MH_EXECUTE = 0x2,
  _MH_FVMLIB = 0x3,
  _MH_CORE = 0x4,
  _MH_PRELOAD = 0x5,
  _MH_DYLIB = 0x6,
  _MH_DYLINKER = 0x7,
  _MH_BUNDLE = 0x8,
  _MH_DYLIB_STUB = 0x9,
  _MH_DSYM = 0xa,
  _MH_KEXT_BUNDLE = 0xb,
  _MH_NOUNDEFS = 0x1,
  _MH_INCRLINK = 0x2,
  _MH_DYLDLINK = 0x4,
  _MH_BINDATLOAD = 0x8,
  _MH_PREBOUND = 0x10,
  _MH_SPLIT_SEGS = 0x20,
  _MH_LAZY_INIT = 0x40,
  _MH_TWOLEVEL = 0x80,
  _MH_FORCE_FLAT = 0x100,
  _MH_NOMULTIDEFS = 0x200,
  _MH_NOFIXPREBINDING = 0x400,
  _MH_PREBINDABLE = 0x800,
  _MH_ALLMODSBOUND = 0x1000,
  _MH_SUBSECTIONS_VIA_SYMBOLS = 0x2000,
  _MH_CANONICAL = 0x4000,
  _MH_WEAK_DEFINES = 0x8000,
  _MH_BINDS_TO_WEAK = 0x10000,
  _MH_ALLOW_STACK_EXECUTION = 0x20000,
  _MH_ROOT_SAFE = 0x40000,
  _MH_SETUID_SAFE = 0x80000,
  _MH_NO_REEXPORTED_DYLIBS = 0x100000,
  _MH_PIE = 0x200000,
  _MH_DEAD_STRIPPABLE_DYLIB = 0x400000,
  _MH_HAS_TLV_DESCRIPTORS = 0x800000,
  _MH_NO_HEAP_EXECUTION = 0x1000000,
  _MH_MAGIC_KERNEL = 0xfeedfacf
};
static enum MH_ENUM AAAA4;
enum CPU_TYPE_ENUM {
  _CPU_TYPE_ANY = ((cpu_type_t) -1),
  _CPU_TYPE_VAX = ((cpu_type_t) 1),
  _CPU_TYPE_MC680x0 = ((cpu_type_t) 6),
  _CPU_TYPE_X86 = ((cpu_type_t) 7),
  _CPU_TYPE_I386 = ((cpu_type_t) 7),
  _CPU_TYPE_X86_64 = (((cpu_type_t) 7) | 0x01000000),
  _CPU_TYPE_MC98000 = ((cpu_type_t) 10),
  _CPU_TYPE_HPPA = ((cpu_type_t) 11),
  _CPU_TYPE_ARM = ((cpu_type_t) 12),
  _CPU_TYPE_MC88000 = ((cpu_type_t) 13),
  _CPU_TYPE_SPARC = ((cpu_type_t) 14),
  _CPU_TYPE_I860 = ((cpu_type_t) 15),
  _CPU_TYPE_POWERPC = ((cpu_type_t) 18),
  _CPU_TYPE_POWERPC64 = (((cpu_type_t) 18) | 0x01000000)
};
static enum CPU_TYPE_ENUM AAAA5;
enum CTLTYPE_ENUM {
  _CTLTYPE_NODE = 1,
  _CTLTYPE_INT = 2,
  _CTLTYPE_STRING = 3,
  _CTLTYPE_QUAD = 4,
  _CTLTYPE_OPAQUE = 5,
  _CTLTYPE_STRUCT = 5
};
static enum CTLTYPE_ENUM AAAA6;
enum CTLFLAG_ENUM {
  _CTLFLAG_RD = 0x80000000,
  _CTLFLAG_WR = 0x40000000,
  _CTLFLAG_RW = (0x80000000|0x40000000),
  _CTLFLAG_NOLOCK = 0x20000000,
  _CTLFLAG_ANYBODY = 0x10000000,
  _CTLFLAG_SECURE = 0x08000000,
  _CTLFLAG_MASKED = 0x04000000,
  _CTLFLAG_NOAUTO = 0x02000000,
  _CTLFLAG_KERN = 0x01000000,
  _CTLFLAG_LOCKED = 0x00800000,
  _CTLFLAG_OID2 = 0x00400000
};
static enum CTLFLAG_ENUM AAAA7;
int main() {
  struct load_command a;
  struct mach_header b;
  struct mach_header_64 c;
  struct segment_command_64 d;
  struct uuid_command a1;
  int x = kEfiReservedMemoryType;
};
