# 1 "/usr/src/lib/libthr/thread/thr_setschedparam.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 338 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
# 35 "/usr/src/lib/libthr/thread/thr_setschedparam.c"
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 36 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
__asm__(".ident\t\"" "$FreeBSD$" "\"");


# 1 "/usr/src/lib/libc/include/namespace.h" 1
# 39 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
# 1 "/usr/include/sys/param.h" 1 3 4
# 43 "/usr/include/sys/param.h" 3 4
# 1 "/usr/include/sys/_null.h" 1 3 4
# 44 "/usr/include/sys/param.h" 2 3 4
# 98 "/usr/include/sys/param.h" 3 4
# 1 "/usr/include/sys/types.h" 1 3 4
# 46 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/machine/endian.h" 1 3 4
# 39 "/usr/include/machine/endian.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 35 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 51 "/usr/include/machine/_types.h" 3 4
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 __int64_t;
typedef unsigned long __uint64_t;
# 76 "/usr/include/machine/_types.h" 3 4
typedef __uint32_t __clock_t;

typedef double __double_t;
typedef float __float_t;


typedef __int64_t __critical_t;
typedef __int64_t __intfptr_t;
typedef __int64_t __intptr_t;





typedef __int64_t __intmax_t;
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_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 __int64_t __ptrdiff_t;
typedef __int64_t __register_t;
typedef __int64_t __segsz_t;
typedef __uint64_t __size_t;
typedef __int64_t __ssize_t;







typedef __int64_t __time_t;

typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintptr_t;




typedef __uint64_t __uintmax_t;
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_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 __uint64_t __u_register_t;
typedef __uint64_t __vm_offset_t;
typedef __uint64_t __vm_paddr_t;
typedef __uint64_t __vm_size_t;
# 144 "/usr/include/machine/_types.h" 3 4
typedef int ___wchar_t;
# 36 "/usr/include/sys/_types.h" 2 3 4




typedef __int32_t __blksize_t;
typedef __int64_t __blkcnt_t;
typedef __int32_t __clockid_t;
typedef __uint32_t __fflags_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t;
typedef __uint64_t __ino_t;
typedef long __key_t;
typedef __int32_t __lwpid_t;
typedef __uint16_t __mode_t;
typedef int __accmode_t;
typedef int __nl_item;
typedef __uint64_t __nlink_t;
typedef __int64_t __off_t;
typedef __int64_t __off64_t;
typedef __int32_t __pid_t;
typedef __int64_t __rlim_t;


typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t;
typedef struct __timer *__timer_t;
typedef struct __mq *__mqd_t;
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t;
typedef int __cpuwhich_t;
typedef int __cpulevel_t;
typedef int __cpusetid_t;
typedef __int64_t __daddr_t;
# 91 "/usr/include/sys/_types.h" 3 4
typedef int __ct_rune_t;
typedef __ct_rune_t __rune_t;
typedef __ct_rune_t __wint_t;



typedef __uint_least16_t __char16_t;
typedef __uint_least32_t __char32_t;







typedef struct {
 long long __max_align1 __attribute__((__aligned__(__alignof(long long))));

 long double __max_align2 __attribute__((__aligned__(__alignof(long double))));

} __max_align_t;

typedef __uint64_t __dev_t;

typedef __uint32_t __fixpt_t;





typedef union {
 char __mbstate8[128];
 __int64_t _mbstateL;
} __mbstate_t;

typedef __uintmax_t __rman_res_t;






typedef __builtin_va_list __va_list;






typedef __va_list __gnuc_va_list;
# 40 "/usr/include/machine/endian.h" 2 3 4
# 109 "/usr/include/machine/endian.h" 3 4
static __inline __uint16_t
__bswap16_var(__uint16_t _x)
{

 return ((_x >> 8) | ((_x << 8) & 0xff00));
}

static __inline __uint32_t
__bswap32_var(__uint32_t _x)
{

 return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) |
     ((_x << 24) & 0xff000000));
}

static __inline __uint64_t
__bswap64_var(__uint64_t _x)
{

 return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
     ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
     ((_x << 24) & ((__uint64_t)0xff << 40)) |
     ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
# 47 "/usr/include/sys/types.h" 2 3 4


# 1 "/usr/include/sys/_pthreadtypes.h" 1 3 4
# 46 "/usr/include/sys/_pthreadtypes.h" 3 4
struct pthread;
struct pthread_attr;
struct pthread_cond;
struct pthread_cond_attr;
struct pthread_mutex;
struct pthread_mutex_attr;
struct _pthread_once;
struct pthread_rwlock;
struct pthread_rwlockattr;
struct pthread_barrier;
struct pthread_barrier_attr;
struct pthread_spinlock;
# 67 "/usr/include/sys/_pthreadtypes.h" 3 4
typedef struct pthread *pthread_t;


typedef struct pthread_attr *pthread_attr_t;
typedef struct pthread_mutex *pthread_mutex_t;
typedef struct pthread_mutex_attr *pthread_mutexattr_t;
typedef struct pthread_cond *pthread_cond_t;
typedef struct pthread_cond_attr *pthread_condattr_t;
typedef int pthread_key_t;
typedef struct _pthread_once pthread_once_t;
typedef struct pthread_rwlock *pthread_rwlock_t;
typedef struct pthread_rwlockattr *pthread_rwlockattr_t;
typedef struct pthread_barrier *pthread_barrier_t;
typedef struct pthread_barrierattr *pthread_barrierattr_t;
typedef struct pthread_spinlock *pthread_spinlock_t;







typedef void *pthread_addr_t;
typedef void *(*pthread_startroutine_t)(void *);




struct _pthread_once {
 int state;
 pthread_mutex_t mutex;
};
# 50 "/usr/include/sys/types.h" 2 3 4


typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;

typedef unsigned short ushort;
typedef unsigned int uint;







# 1 "/usr/include/sys/_stdint.h" 1 3 4
# 36 "/usr/include/sys/_stdint.h" 3 4
typedef __int8_t int8_t;




typedef __int16_t int16_t;




typedef __int32_t int32_t;




typedef __int64_t int64_t;




typedef __uint8_t uint8_t;




typedef __uint16_t uint16_t;




typedef __uint32_t uint32_t;




typedef __uint64_t uint64_t;




typedef __intptr_t intptr_t;



typedef __uintptr_t uintptr_t;



typedef __intmax_t intmax_t;



typedef __uintmax_t uintmax_t;
# 66 "/usr/include/sys/types.h" 2 3 4

typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;

typedef __uint64_t u_quad_t;
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;

typedef char * caddr_t;
typedef const char * c_caddr_t;


typedef __blksize_t blksize_t;



typedef __cpuwhich_t cpuwhich_t;
typedef __cpulevel_t cpulevel_t;
typedef __cpusetid_t cpusetid_t;


typedef __blkcnt_t blkcnt_t;




typedef __clock_t clock_t;




typedef __clockid_t clockid_t;



typedef __critical_t critical_t;
typedef __daddr_t daddr_t;


typedef __dev_t dev_t;




typedef __fflags_t fflags_t;



typedef __fixpt_t fixpt_t;


typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;




typedef __gid_t gid_t;




typedef __uint32_t in_addr_t;




typedef __uint16_t in_port_t;




typedef __id_t id_t;




typedef __ino_t ino_t;




typedef __key_t key_t;




typedef __lwpid_t lwpid_t;




typedef __mode_t mode_t;




typedef __accmode_t accmode_t;




typedef __nlink_t nlink_t;




typedef __off_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;



typedef __register_t register_t;


typedef __rlim_t rlim_t;



typedef __int64_t sbintime_t;

typedef __segsz_t segsz_t;


typedef __size_t size_t;




typedef __ssize_t ssize_t;




typedef __suseconds_t suseconds_t;




typedef __time_t time_t;




typedef __timer_t timer_t;




typedef __mqd_t mqd_t;



typedef __u_register_t u_register_t;


typedef __uid_t uid_t;




typedef __useconds_t useconds_t;





typedef unsigned long cap_ioctl_t;




struct cap_rights;

typedef struct cap_rights cap_rights_t;
# 260 "/usr/include/sys/types.h" 3 4
typedef __uint64_t kvaddr_t;
typedef __uint64_t ksize_t;

typedef __vm_offset_t vm_offset_t;
typedef __uint64_t vm_ooffset_t;
typedef __vm_paddr_t vm_paddr_t;
typedef __uint64_t vm_pindex_t;
typedef __vm_size_t vm_size_t;

typedef __rman_res_t rman_res_t;
# 323 "/usr/include/sys/types.h" 3 4
static __inline __uint16_t
__bitcount16(__uint16_t _x)
{

 _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1);
 _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2);
 _x = (_x + (_x >> 4)) & 0x0f0f;
 _x = (_x + (_x >> 8)) & 0x00ff;
 return (_x);
}

static __inline __uint32_t
__bitcount32(__uint32_t _x)
{

 _x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1);
 _x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2);
 _x = (_x + (_x >> 4)) & 0x0f0f0f0f;
 _x = (_x + (_x >> 8));
 _x = (_x + (_x >> 16)) & 0x000000ff;
 return (_x);
}


static __inline __uint64_t
__bitcount64(__uint64_t _x)
{

 _x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1);
 _x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2);
 _x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f;
 _x = (_x + (_x >> 8));
 _x = (_x + (_x >> 16));
 _x = (_x + (_x >> 32)) & 0x000000ff;
 return (_x);
}
# 376 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
# 40 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/_sigset.h" 1 3 4
# 53 "/usr/include/sys/_sigset.h" 3 4
typedef struct __sigset {
 __uint32_t __bits[4];
} __sigset_t;
# 41 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/sys/_timeval.h" 1 3 4
# 49 "/usr/include/sys/_timeval.h" 3 4
struct timeval {
 time_t tv_sec;
 suseconds_t tv_usec;
};
# 42 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/sys/timespec.h" 1 3 4
# 40 "/usr/include/sys/timespec.h" 3 4
# 1 "/usr/include/sys/_timespec.h" 1 3 4
# 46 "/usr/include/sys/_timespec.h" 3 4
struct timespec {
 time_t tv_sec;
 long tv_nsec;
};
# 41 "/usr/include/sys/timespec.h" 2 3 4
# 60 "/usr/include/sys/timespec.h" 3 4
struct itimerspec {
 struct timespec it_interval;
 struct timespec it_value;
};
# 43 "/usr/include/sys/select.h" 2 3 4

typedef unsigned long __fd_mask;

typedef __fd_mask fd_mask;




typedef __sigset_t sigset_t;
# 73 "/usr/include/sys/select.h" 3 4
typedef struct fd_set {
 __fd_mask __fds_bits[(((1024) + (((sizeof(__fd_mask) * 8)) - 1)) / ((sizeof(__fd_mask) * 8)))];
} fd_set;
# 100 "/usr/include/sys/select.h" 3 4
int pselect(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
 const struct timespec *restrict, const sigset_t *restrict);



int _select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
# 377 "/usr/include/sys/types.h" 2 3 4
# 390 "/usr/include/sys/types.h" 3 4
static __inline int
__major(dev_t _d)
{
 return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff));
}

static __inline int
__minor(dev_t _d)
{
 return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff));
}

static __inline dev_t
__makedev(int _Major, int _Minor)
{
 return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
     ((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff));
}
# 418 "/usr/include/sys/types.h" 3 4
int ftruncate(int, off_t);



off_t lseek(int, off_t, int);



void * mmap(void *, size_t, int, int, int, off_t);



int truncate(const char *, off_t);
# 99 "/usr/include/sys/param.h" 2 3 4








# 1 "/usr/include/sys/syslimits.h" 1 3 4
# 108 "/usr/include/sys/param.h" 2 3 4
# 139 "/usr/include/sys/param.h" 3 4
# 1 "/usr/include/sys/signal.h" 1 3 4
# 47 "/usr/include/sys/signal.h" 3 4
# 1 "/usr/include/machine/_limits.h" 1 3 4
# 48 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/machine/signal.h" 1 3 4
# 42 "/usr/include/machine/signal.h" 3 4
typedef int sig_atomic_t;



# 1 "/usr/include/machine/frame.h" 1 3 4
# 52 "/usr/include/machine/frame.h" 3 4
struct trapframe {
 register_t fixreg[32];
 register_t lr;
 register_t cr;
 register_t xer;
 register_t ctr;
 register_t srr0;
 register_t srr1;
 register_t exc;
 register_t dar;
 union {
  struct {

   register_t dsisr;
  } aim;
  struct {
   register_t esr;
   register_t dbcr0;
  } booke;
 } cpu;
};
# 88 "/usr/include/machine/frame.h" 3 4
struct callframe {
 register_t cf_dummy_fp;
 register_t cf_cr;
 register_t cf_lr;
 register_t cf_compiler;
 register_t cf_linkeditor;
 register_t cf_toc;
 register_t cf_func;
 register_t cf_arg0;
 register_t cf_arg1;
 register_t _padding;
};
# 46 "/usr/include/machine/signal.h" 2 3 4

struct sigcontext {
 int sc_onstack;
 int __sc_mask13;
 struct trapframe sc_frame;
 struct __sigset sc_mask;
};
# 49 "/usr/include/sys/signal.h" 2 3 4
# 161 "/usr/include/sys/signal.h" 3 4
typedef void __sighandler_t(int);
# 171 "/usr/include/sys/signal.h" 3 4
union sigval {

 int sival_int;
 void *sival_ptr;

 int sigval_int;
 void *sigval_ptr;
};
# 193 "/usr/include/sys/signal.h" 3 4
struct pthread_attr;

struct sigevent {
 int sigev_notify;
 int sigev_signo;
 union sigval sigev_value;
 union {
  __lwpid_t _threadid;
  struct {
   void (*_function)(union sigval);
   struct pthread_attr **_attribute;
  } _sigev_thread;
  unsigned short _kevent_flags;
  long __spare__[8];
 } _sigev_un;
};
# 229 "/usr/include/sys/signal.h" 3 4
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;
 union {
  struct {
   int _trapno;
  } _fault;
  struct {
   int _timerid;
   int _overrun;
  } _timer;
  struct {
   int _mqd;
  } _mesgq;
  struct {
   long _band;
  } _poll;
  struct {
   long __spare1__;
   int __spare2__[7];
  } __spare__;
 } _reason;
} siginfo_t;
# 361 "/usr/include/sys/signal.h" 3 4
struct __siginfo;




struct sigaction {
 union {
  void (*__sa_handler)(int);
  void (*__sa_sigaction)(int, struct __siginfo *, void *);
 } __sigaction_u;
 int sa_flags;
 sigset_t sa_mask;
};
# 418 "/usr/include/sys/signal.h" 3 4
typedef __sighandler_t *sig_t;
typedef void __siginfohandler_t(int, struct __siginfo *, void *);






typedef struct sigaltstack stack_t;
# 439 "/usr/include/sys/signal.h" 3 4
struct sigaltstack {
 void *ss_sp;
 __size_t ss_size;
 int ss_flags;
};






struct sigvec {
 __sighandler_t *sv_handler;
 int sv_mask;
 int sv_flags;
};
# 477 "/usr/include/sys/signal.h" 3 4
struct sigstack {
 void *ss_sp;
 int ss_onstack;
};
# 509 "/usr/include/sys/signal.h" 3 4
__sighandler_t *signal(int, __sighandler_t *);
# 140 "/usr/include/sys/param.h" 2 3 4



# 1 "/usr/include/machine/param.h" 1 3 4
# 50 "/usr/include/machine/param.h" 3 4
# 1 "/usr/include/machine/_align.h" 1 3 4
# 51 "/usr/include/machine/param.h" 2 3 4
# 144 "/usr/include/sys/param.h" 2 3 4

# 1 "/usr/include/sys/limits.h" 1 3 4
# 146 "/usr/include/sys/param.h" 2 3 4
# 40 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 46 "/usr/include/errno.h" 3 4
int * __error(void);
# 204 "/usr/include/errno.h" 3 4
typedef int errno_t;
# 41 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
# 1 "/usr/src/include/pthread.h" 1
# 48 "/usr/src/include/pthread.h"
# 1 "/usr/include/sched.h" 1 3 4
# 238 "/usr/include/sched.h" 3 4
struct sched_param {
        int sched_priority;
};
# 256 "/usr/include/sched.h" 3 4
int sched_get_priority_max(int);
int sched_get_priority_min(int);
int sched_getparam(pid_t, struct sched_param *);
int sched_getscheduler(pid_t);
int sched_rr_get_interval(pid_t, struct timespec *);
int sched_setparam(pid_t, const struct sched_param *);
int sched_setscheduler(pid_t, int, const struct sched_param *);
int sched_yield(void);
# 49 "/usr/src/include/pthread.h" 2
# 1 "/usr/src/include/time.h" 1
# 127 "/usr/src/include/time.h"
struct tm {
 int tm_sec;
 int tm_min;
 int tm_hour;
 int tm_mday;
 int tm_mon;
 int tm_year;
 int tm_wday;
 int tm_yday;
 int tm_isdst;
 long tm_gmtoff;
 char *tm_zone;
};


extern char *tzname[];



char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);

double difftime(time_t, time_t);


struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char * restrict, size_t, const char * restrict,
    const struct tm * restrict);
time_t time(time_t *);

struct sigevent;
int timer_create(clockid_t, struct sigevent *restrict, timer_t *restrict);
int timer_delete(timer_t);
int timer_gettime(timer_t, struct itimerspec *);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const struct itimerspec *restrict,
 struct itimerspec *restrict);


void tzset(void);



int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
int _nanosleep(const struct timespec *, struct timespec *);



int clock_getcpuclockid(pid_t, clockid_t *);
int _clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);



char *asctime_r(const struct tm *, char *);
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);



char *strptime(const char * restrict, const char * restrict,
    struct tm * restrict);



char *timezone(int, int);
void tzsetwall(void);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
int timer_oshandle_np(timer_t timerid);
time_t time2posix(time_t t);
time_t posix2time(time_t t);




# 1 "/usr/src/include/xlocale/_time.h" 1
# 36 "/usr/src/include/xlocale/_time.h"
typedef struct _xlocale *locale_t;
# 47 "/usr/src/include/xlocale/_time.h"
size_t strftime_l(char * restrict, size_t, const char * restrict,
     const struct tm * restrict, locale_t) __attribute__((__format__ (__strftime__, 3, 0)));
# 208 "/usr/src/include/time.h" 2







int timespec_get(struct timespec *ts, int base);
# 50 "/usr/src/include/pthread.h" 2
# 130 "/usr/src/include/pthread.h"
enum pthread_mutextype {
 PTHREAD_MUTEX_ERRORCHECK = 1,
 PTHREAD_MUTEX_RECURSIVE = 2,
 PTHREAD_MUTEX_NORMAL = 3,
 PTHREAD_MUTEX_ADAPTIVE_NP = 4,
 PTHREAD_MUTEX_TYPE_MAX
};






struct _pthread_cleanup_info {
 __uintptr_t pthread_cleanup_pad[8];
};





int _pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
int _pthread_attr_destroy(pthread_attr_t *);
int _pthread_attr_getstack(
      const pthread_attr_t * restrict, void ** restrict,
      size_t * restrict);
int _pthread_attr_getstacksize(const pthread_attr_t * restrict,
      size_t * restrict);
int _pthread_attr_getguardsize(const pthread_attr_t * restrict,
      size_t * restrict);
int _pthread_attr_getstackaddr(const pthread_attr_t *, void **);
int _pthread_attr_getdetachstate(const pthread_attr_t *,
      int *);
int _pthread_attr_init(pthread_attr_t *);
int _pthread_attr_setstacksize(pthread_attr_t *, size_t);
int _pthread_attr_setguardsize(pthread_attr_t *, size_t);
int _pthread_attr_setstack(pthread_attr_t *, void *,
      size_t);
int _pthread_attr_setstackaddr(pthread_attr_t *, void *);
int _pthread_attr_setdetachstate(pthread_attr_t *, int);
int _pthread_barrier_destroy(pthread_barrier_t *);
int _pthread_barrier_init(pthread_barrier_t * restrict,
   const pthread_barrierattr_t * restrict, unsigned);
int _pthread_barrier_wait(pthread_barrier_t *);
int _pthread_barrierattr_destroy(pthread_barrierattr_t *);
int _pthread_barrierattr_getpshared(
      const pthread_barrierattr_t * restrict, int * restrict);
int _pthread_barrierattr_init(pthread_barrierattr_t *);
int _pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
# 193 "/usr/src/include/pthread.h"
int _pthread_condattr_destroy(pthread_condattr_t *);
int _pthread_condattr_getclock(const pthread_condattr_t * restrict,
      clockid_t * restrict);
int _pthread_condattr_getpshared(const pthread_condattr_t *, int *);
int _pthread_condattr_init(pthread_condattr_t *);
int _pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
int _pthread_condattr_setpshared(pthread_condattr_t *, int);
int _pthread_cond_broadcast(pthread_cond_t *);
int _pthread_cond_destroy(pthread_cond_t *);
int _pthread_cond_init(pthread_cond_t * restrict,
      const pthread_condattr_t * restrict);
int _pthread_cond_signal(pthread_cond_t *);
int _pthread_cond_timedwait(pthread_cond_t *,
      pthread_mutex_t * __mutex,
      const struct timespec *)
      __attribute__((exclusive_locks_required(*__mutex)));
int _pthread_cond_wait(pthread_cond_t * restrict,
      pthread_mutex_t * restrict __mutex)
      __attribute__((exclusive_locks_required(*__mutex)));
int _pthread_create(pthread_t * restrict,
      const pthread_attr_t * restrict, void *(*) (void *),
      void * restrict);
int _pthread_detach(pthread_t);
int _pthread_equal(pthread_t, pthread_t);
void _pthread_exit(void *) __attribute__((__noreturn__));
void *_pthread_getspecific(pthread_key_t);
int _pthread_getcpuclockid(pthread_t, clockid_t *);
int _pthread_join(pthread_t, void **);
int _pthread_key_create(pthread_key_t *, void (*) (void *));
int _pthread_key_delete(pthread_key_t);
int _pthread_mutexattr_init(pthread_mutexattr_t *);
int _pthread_mutexattr_destroy(pthread_mutexattr_t *);
int _pthread_mutexattr_getpshared(
      const pthread_mutexattr_t * restrict,
      int * restrict);
int _pthread_mutexattr_gettype(
      const pthread_mutexattr_t * restrict, int * restrict);
int _pthread_mutexattr_settype(pthread_mutexattr_t *, int);
int _pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
int pthread_mutex_consistent(pthread_mutex_t * __mutex)
      __attribute__((exclusive_locks_required(*__mutex)));
int _pthread_mutex_destroy(pthread_mutex_t * __mutex)
      __attribute__((locks_excluded(*__mutex)));
int _pthread_mutex_init(pthread_mutex_t * restrict __mutex,
      const pthread_mutexattr_t * restrict)
      __attribute__((locks_excluded(*__mutex)));
int _pthread_mutex_lock(pthread_mutex_t * __mutex)
      __attribute__((exclusive_lock_function(*__mutex)));
int _pthread_mutex_trylock(pthread_mutex_t * __mutex)
      __attribute__((exclusive_trylock_function(0, *__mutex)));
int _pthread_mutex_timedlock(pthread_mutex_t * restrict __mutex,
      const struct timespec * restrict)
      __attribute__((exclusive_trylock_function(0, *__mutex)));
int _pthread_mutex_unlock(pthread_mutex_t * __mutex)
      __attribute__((unlock_function(*__mutex)));
int _pthread_once(pthread_once_t *, void (*) (void));
int _pthread_rwlock_destroy(pthread_rwlock_t * __rwlock)
      __attribute__((locks_excluded(*__rwlock)));
int _pthread_rwlock_init(pthread_rwlock_t * restrict __rwlock,
      const pthread_rwlockattr_t * restrict)
      __attribute__((locks_excluded(*__rwlock)));
int _pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock)
      __attribute__((shared_lock_function(*__rwlock)));
int _pthread_rwlock_timedrdlock(
      pthread_rwlock_t * restrict __rwlock,
      const struct timespec * restrict)
      __attribute__((shared_trylock_function(0, *__rwlock)));
int _pthread_rwlock_timedwrlock(
      pthread_rwlock_t * restrict __rwlock,
      const struct timespec * restrict)
      __attribute__((exclusive_trylock_function(0, *__rwlock)));
int _pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock)
      __attribute__((shared_trylock_function(0, *__rwlock)));
int _pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock)
      __attribute__((exclusive_trylock_function(0, *__rwlock)));
int _pthread_rwlock_unlock(pthread_rwlock_t * __rwlock)
      __attribute__((unlock_function(*__rwlock)));
int _pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock)
      __attribute__((exclusive_lock_function(*__rwlock)));
int _pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
      int *);
int _pthread_rwlockattr_getpshared(
      const pthread_rwlockattr_t * restrict,
      int * restrict);
int _pthread_rwlockattr_init(pthread_rwlockattr_t *);
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *,
      int);
int _pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
pthread_t _pthread_self(void);
int _pthread_setspecific(pthread_key_t, const void *);

int _pthread_spin_init(pthread_spinlock_t * __spin, int)
      __attribute__((locks_excluded(*__spin)));
int _pthread_spin_destroy(pthread_spinlock_t * __spin)
      __attribute__((locks_excluded(*__spin)));
int _pthread_spin_lock(pthread_spinlock_t * __spin)
   __attribute__((exclusive_lock_function(*__spin)));
int _pthread_spin_trylock(pthread_spinlock_t * __spin)
   __attribute__((exclusive_trylock_function(0, *__spin)));
int _pthread_spin_unlock(pthread_spinlock_t * __spin)
   __attribute__((unlock_function(*__spin)));
int _pthread_cancel(pthread_t);
int _pthread_setcancelstate(int, int *);
int _pthread_setcanceltype(int, int *);
void _pthread_testcancel(void);


int _pthread_getprio(pthread_t);
int _pthread_setprio(pthread_t, int);
void _pthread_yield(void);


int _pthread_mutexattr_getprioceiling(
      const pthread_mutexattr_t * restrict,
      int * restrict);
int _pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
int _pthread_mutex_getprioceiling(const pthread_mutex_t * restrict,
      int * restrict);
int _pthread_mutex_setprioceiling(pthread_mutex_t * restrict, int,
      int * restrict);

int _pthread_mutexattr_getprotocol(
      const pthread_mutexattr_t * restrict,
      int * restrict);
int _pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);

int pthread_mutexattr_getrobust(
      pthread_mutexattr_t * restrict, int * restrict);
int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int);

int _pthread_attr_getinheritsched(const pthread_attr_t * restrict,
      int * restrict);
int _pthread_attr_getschedparam(const pthread_attr_t *,
      struct sched_param *);
int _pthread_attr_getschedpolicy(const pthread_attr_t * restrict,
      int * restrict);
int _pthread_attr_getscope(const pthread_attr_t * restrict,
      int * restrict);
int _pthread_attr_setinheritsched(pthread_attr_t *, int);
int _pthread_attr_setschedparam(pthread_attr_t *,
      const struct sched_param *);
int _pthread_attr_setschedpolicy(pthread_attr_t *, int);
int _pthread_attr_setscope(pthread_attr_t *, int);
int _pthread_getschedparam(pthread_t pthread, int * restrict,
      struct sched_param * restrict);
int _pthread_setschedparam(pthread_t, int,
      const struct sched_param *);

int _pthread_getconcurrency(void);
int _pthread_setconcurrency(int);


void __pthread_cleanup_push_imp(void (*)(void *), void *,
   struct _pthread_cleanup_info *);
void __pthread_cleanup_pop_imp(int);
# 42 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2
# 1 "/usr/src/lib/libc/include/un-namespace.h" 1
# 43 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2

# 1 "/usr/src/lib/libthr/thread/thr_private.h" 1
# 41 "/usr/src/lib/libthr/thread/thr_private.h"
# 1 "/usr/include/sys/time.h" 1 3 4
# 42 "/usr/include/sys/time.h" 3 4
struct timezone {
 int tz_minuteswest;
 int tz_dsttime;
};
# 55 "/usr/include/sys/time.h" 3 4
struct bintime {
 time_t sec;
 uint64_t frac;
};

static __inline void
bintime_addx(struct bintime *_bt, uint64_t _x)
{
 uint64_t _u;

 _u = _bt->frac;
 _bt->frac += _x;
 if (_u > _bt->frac)
  _bt->sec++;
}

static __inline void
bintime_add(struct bintime *_bt, const struct bintime *_bt2)
{
 uint64_t _u;

 _u = _bt->frac;
 _bt->frac += _bt2->frac;
 if (_u > _bt->frac)
  _bt->sec++;
 _bt->sec += _bt2->sec;
}

static __inline void
bintime_sub(struct bintime *_bt, const struct bintime *_bt2)
{
 uint64_t _u;

 _u = _bt->frac;
 _bt->frac -= _bt2->frac;
 if (_u < _bt->frac)
  _bt->sec--;
 _bt->sec -= _bt2->sec;
}

static __inline void
bintime_mul(struct bintime *_bt, u_int _x)
{
 uint64_t _p1, _p2;

 _p1 = (_bt->frac & 0xffffffffull) * _x;
 _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32);
 _bt->sec *= _x;
 _bt->sec += (_p2 >> 32);
 _bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull);
}

static __inline void
bintime_shift(struct bintime *_bt, int _exp)
{

 if (_exp > 0) {
  _bt->sec <<= _exp;
  _bt->sec |= _bt->frac >> (64 - _exp);
  _bt->frac <<= _exp;
 } else if (_exp < 0) {
  _bt->frac >>= -_exp;
  _bt->frac |= (uint64_t)_bt->sec << (64 + _exp);
  _bt->sec >>= -_exp;
 }
}
# 136 "/usr/include/sys/time.h" 3 4
static __inline int
sbintime_getsec(sbintime_t _sbt)
{

 return (_sbt >> 32);
}

static __inline sbintime_t
bttosbt(const struct bintime _bt)
{

 return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
}

static __inline struct bintime
sbttobt(sbintime_t _sbt)
{
 struct bintime _bt;

 _bt.sec = _sbt >> 32;
 _bt.frac = _sbt << 32;
 return (_bt);
}
# 184 "/usr/include/sys/time.h" 3 4
static __inline int64_t
sbttons(sbintime_t _sbt)
{
 uint64_t ns;




 ns = _sbt;
 if (ns >= ((sbintime_t)1 << 32))
  ns = (ns >> 32) * 1000000000;
 else
  ns = 0;

 return (ns + (1000000000 * (_sbt & 0xffffffffu) >> 32));
}

static __inline sbintime_t
nstosbt(int64_t _ns)
{
 sbintime_t sb = 0;




 if (_ns >= ((sbintime_t)1 << 32)) {
  sb = (_ns / 1000000000) * ((sbintime_t)1 << 32);
  _ns = _ns % 1000000000;
 }

 sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31;
 return (sb);
}

static __inline int64_t
sbttous(sbintime_t _sbt)
{

 return ((1000000 * _sbt) >> 32);
}

static __inline sbintime_t
ustosbt(int64_t _us)
{
 sbintime_t sb = 0;




 if (_us >= ((sbintime_t)1 << 32)) {
  sb = (_us / 1000000) * ((sbintime_t)1 << 32);
  _us = _us % 1000000;
 }

 sb += ((_us * 9223372036855ull) + 0x7fffffff) >> 31;
 return (sb);
}

static __inline int64_t
sbttoms(sbintime_t _sbt)
{

 return ((1000 * _sbt) >> 32);
}

static __inline sbintime_t
mstosbt(int64_t _ms)
{
 sbintime_t sb = 0;




 if (_ms >= ((sbintime_t)1 << 32)) {
  sb = (_ms / 1000) * ((sbintime_t)1 << 32);
  _ms = _ms % 1000;
 }

 sb += ((_ms * 9223372036854776ull) + 0x7fffffff) >> 31;
 return (sb);
}
# 280 "/usr/include/sys/time.h" 3 4
static __inline void
bintime2timespec(const struct bintime *_bt, struct timespec *_ts)
{

 _ts->tv_sec = _bt->sec;
 _ts->tv_nsec = ((uint64_t)1000000000 *
     (uint32_t)(_bt->frac >> 32)) >> 32;
}

static __inline void
timespec2bintime(const struct timespec *_ts, struct bintime *_bt)
{

 _bt->sec = _ts->tv_sec;

 _bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL;
}

static __inline void
bintime2timeval(const struct bintime *_bt, struct timeval *_tv)
{

 _tv->tv_sec = _bt->sec;
 _tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32;
}

static __inline void
timeval2bintime(const struct timeval *_tv, struct bintime *_bt)
{

 _bt->sec = _tv->tv_sec;

 _bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL;
}

static __inline struct timespec
sbttots(sbintime_t _sbt)
{
 struct timespec _ts;

 _ts.tv_sec = _sbt >> 32;
 _ts.tv_nsec = sbttons((uint32_t)_sbt);
 return (_ts);
}

static __inline sbintime_t
tstosbt(struct timespec _ts)
{

 return (((sbintime_t)_ts.tv_sec << 32) + nstosbt(_ts.tv_nsec));
}

static __inline struct timeval
sbttotv(sbintime_t _sbt)
{
 struct timeval _tv;

 _tv.tv_sec = _sbt >> 32;
 _tv.tv_usec = sbttous((uint32_t)_sbt);
 return (_tv);
}

static __inline sbintime_t
tvtosbt(struct timeval _tv)
{

 return (((sbintime_t)_tv.tv_sec << 32) + ustosbt(_tv.tv_usec));
}
# 447 "/usr/include/sys/time.h" 3 4
struct itimerval {
 struct timeval it_interval;
 struct timeval it_value;
};




struct clockinfo {
 int hz;
 int tick;
 int spare;
 int stathz;
 int profhz;
};
# 606 "/usr/include/sys/time.h" 3 4
int setitimer(int, const struct itimerval *, struct itimerval *);
int utimes(const char *, const struct timeval *);


int adjtime(const struct timeval *, struct timeval *);
int clock_getcpuclockid2(id_t, int, clockid_t *);
int futimes(int, const struct timeval *);
int futimesat(int, const char *, const struct timeval [2]);
int lutimes(const char *, const struct timeval *);
int settimeofday(const struct timeval *, const struct timezone *);



int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval *, struct timezone *);
# 42 "/usr/src/lib/libthr/thread/thr_private.h" 2

# 1 "/usr/include/sys/queue.h" 1 3 4
# 44 "/usr/src/lib/libthr/thread/thr_private.h" 2

# 1 "/usr/include/sys/cpuset.h" 1 3 4
# 37 "/usr/include/sys/cpuset.h" 3 4
# 1 "/usr/include/sys/_cpuset.h" 1 3 4
# 37 "/usr/include/sys/_cpuset.h" 3 4
# 1 "/usr/include/sys/_bitset.h" 1 3 4
# 64 "/usr/include/sys/_bitset.h" 3 4
struct bitset { long __bits[(((((1)) + (((sizeof(long) * 8)) - 1)) / ((sizeof(long) * 8))))]; };
# 38 "/usr/include/sys/_cpuset.h" 2 3 4
# 49 "/usr/include/sys/_cpuset.h" 3 4
struct _cpuset { long __bits[(((((256)) + (((sizeof(long) * 8)) - 1)) / ((sizeof(long) * 8))))]; };
typedef struct _cpuset cpuset_t;
# 38 "/usr/include/sys/cpuset.h" 2 3 4

# 1 "/usr/include/sys/bitset.h" 1 3 4
# 40 "/usr/include/sys/cpuset.h" 2 3 4
# 152 "/usr/include/sys/cpuset.h" 3 4
int cpuset(cpusetid_t *);
int cpuset_setid(cpuwhich_t, id_t, cpusetid_t);
int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *);
int cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, cpuset_t *);
int cpuset_setaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, const cpuset_t *);
# 46 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/include/machine/atomic.h" 1 3 4
# 41 "/usr/include/machine/atomic.h" 3 4
# 1 "/usr/include/sys/atomic_common.h" 1 3 4
# 42 "/usr/include/machine/atomic.h" 2 3 4
# 68 "/usr/include/machine/atomic.h" 3 4
static __inline void
powerpc_lwsync(void)
{


 __asm volatile("lwsync" : : : "memory");



}
# 141 "/usr/include/machine/atomic.h" 3 4
static __inline void atomic_add_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_add_acq_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_add_rel_int(volatile u_int *p, u_int v) { u_int t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	lwarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
static __inline void atomic_add_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_add_acq_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_add_rel_long(volatile u_long *p, u_long v) { u_long t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	ldarx	%0, 0, %2\n" "	add	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
# 228 "/usr/include/machine/atomic.h" 3 4
static __inline void atomic_clear_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_clear_acq_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_clear_rel_int(volatile u_int *p, u_int v) { u_int t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	lwarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
static __inline void atomic_clear_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_clear_acq_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_clear_rel_long(volatile u_long *p, u_long v) { u_long t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	ldarx	%0, 0, %2\n" "	andc	%0, %0, %3\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
# 329 "/usr/include/machine/atomic.h" 3 4
static __inline void atomic_set_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_set_acq_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_set_rel_int(volatile u_int *p, u_int v) { u_int t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	lwarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
static __inline void atomic_set_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_set_acq_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_set_rel_long(volatile u_long *p, u_long v) { u_long t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	ldarx	%0, 0, %2\n" "	or	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
# 415 "/usr/include/machine/atomic.h" 3 4
static __inline void atomic_subtract_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_subtract_acq_int(volatile u_int *p, u_int v) { u_int t; __asm volatile( "1:	lwarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_subtract_rel_int(volatile u_int *p, u_int v) { u_int t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	lwarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stwcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
static __inline void atomic_subtract_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); } static __inline void atomic_subtract_acq_long(volatile u_long *p, u_long v) { u_long t; __asm volatile( "1:	ldarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); __asm volatile("isync" : : : "memory"); } static __inline void atomic_subtract_rel_long(volatile u_long *p, u_long v) { u_long t; __asm volatile("lwsync" : : : "memory"); __asm volatile( "1:	ldarx	%0, 0, %2\n" "	subf	%0, %3, %0\n" "	stdcx.	%0, 0, %2\n" "	bne-	1b\n" : "=&r" (t), "=m" (*p) : "r" (p), "r" (v), "m" (*p) : "cr0", "memory"); }
# 448 "/usr/include/machine/atomic.h" 3 4
static __inline u_int
atomic_readandclear_int(volatile u_int *addr)
{
 u_int result,temp;

 __asm volatile (
  "\tsync\n"
  "1:\tlwarx %0, 0, %3\n\t"
  "li %1, 0\n\t"
  "stwcx. %1, 0, %3\n\t"
  "bne- 1b\n\t"
  : "=&r"(result), "=&r"(temp), "=m" (*addr)
  : "r" (addr), "m" (*addr)
  : "cr0", "memory");

 return (result);
}


static __inline u_long
atomic_readandclear_long(volatile u_long *addr)
{
 u_long result,temp;

 __asm volatile (
  "\tsync\n"
  "1:\tldarx %0, 0, %3\n\t"
  "li %1, 0\n\t"
  "stdcx. %1, 0, %3\n\t"
  "bne- 1b\n\t"
  : "=&r"(result), "=&r"(temp), "=m" (*addr)
  : "r" (addr), "m" (*addr)
  : "cr0", "memory");

 return (result);
}
# 525 "/usr/include/machine/atomic.h" 3 4
static __inline u_int atomic_load_acq_int(volatile u_int *p) { u_int v; v = *p; powerpc_lwsync(); return (v); } static __inline void atomic_store_rel_int(volatile u_int *p, u_int v) { powerpc_lwsync(); *p = v; }





static __inline u_long atomic_load_acq_long(volatile u_long *p) { u_long v; v = *p; powerpc_lwsync(); return (v); } static __inline void atomic_store_rel_long(volatile u_long *p, u_long v) { powerpc_lwsync(); *p = v; }
# 563 "/usr/include/machine/atomic.h" 3 4
static __inline int
atomic_cmpset_int(volatile u_int* p, u_int cmpval, u_int newval)
{
 int ret;

 __asm volatile (
  "1:\tlwarx %0, 0, %2\n\t"
  "cmplw %3, %0\n\t"
  "bne 2f\n\t"
  "stwcx. %4, 0, %2\n\t"
  "bne- 1b\n\t"
  "li %0, 1\n\t"
  "b 3f\n\t"
  "2:\n\t"
  "stwcx. %0, 0, %2\n\t"
  "li %0, 0\n\t"
  "3:\n\t"
  : "=&r" (ret), "=m" (*p)
  : "r" (p), "r" (cmpval), "r" (newval), "m" (*p)
  : "cr0", "memory");

 return (ret);
}
static __inline int
atomic_cmpset_long(volatile u_long* p, u_long cmpval, u_long newval)
{
 int ret;

 __asm volatile (

  "1:\tldarx %0, 0, %2\n\t"
  "cmpld %3, %0\n\t"
  "bne 2f\n\t"
  "stdcx. %4, 0, %2\n\t"






  "bne- 1b\n\t"
  "li %0, 1\n\t"
  "b 3f\n\t"
  "2:\n\t"

  "stdcx. %0, 0, %2\n\t"



  "li %0, 0\n\t"
  "3:\n\t"
  : "=&r" (ret), "=m" (*p)
  : "r" (p), "r" (cmpval), "r" (newval), "m" (*p)
  : "cr0", "memory");

 return (ret);
}

static __inline int
atomic_cmpset_acq_int(volatile u_int *p, u_int cmpval, u_int newval)
{
 int retval;

 retval = atomic_cmpset_int(p, cmpval, newval);
 __asm volatile("isync" : : : "memory");
 return (retval);
}

static __inline int
atomic_cmpset_rel_int(volatile u_int *p, u_int cmpval, u_int newval)
{
 __asm volatile("lwsync" : : : "memory");
 return (atomic_cmpset_int(p, cmpval, newval));
}

static __inline int
atomic_cmpset_acq_long(volatile u_long *p, u_long cmpval, u_long newval)
{
 u_long retval;

 retval = atomic_cmpset_long(p, cmpval, newval);
 __asm volatile("isync" : : : "memory");
 return (retval);
}

static __inline int
atomic_cmpset_rel_long(volatile u_long *p, u_long cmpval, u_long newval)
{
 __asm volatile("lwsync" : : : "memory");
 return (atomic_cmpset_long(p, cmpval, newval));
}
# 679 "/usr/include/machine/atomic.h" 3 4
static __inline int
atomic_fcmpset_int(volatile u_int *p, u_int *cmpval, u_int newval)
{
 int ret;

 __asm volatile (
  "lwarx %0, 0, %3\n\t"
  "cmplw %4, %0\n\t"
  "bne 1f\n\t"
  "stwcx. %5, 0, %3\n\t"
  "bne- 1f\n\t"
  "li %0, 1\n\t"
  "b 2f\n\t"
  "1:\n\t"
  "stwcx. %0, 0, %3\n\t"
  "stwx %0, 0, %7\n\t"
  "li %0, 0\n\t"
  "2:\n\t"
  : "=&r" (ret), "=m" (*p), "=m" (*cmpval)
  : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval)
  : "cr0", "memory");

 return (ret);
}
static __inline int
atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval)
{
 int ret;

 __asm volatile (

  "ldarx %0, 0, %3\n\t"
  "cmpld %4, %0\n\t"
  "bne 1f\n\t"
  "stdcx. %5, 0, %3\n\t"






  "bne- 1f\n\t"
  "li %0, 1\n\t"
  "b 2f\n\t"
  "1:\n\t"

  "stdcx. %0, 0, %3\n\t"
  "stdx %0, 0, %7\n\t"




  "li %0, 0\n\t"
  "2:\n\t"
  : "=&r" (ret), "=m" (*p), "=m" (*cmpval)
  : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval)
  : "cr0", "memory");

 return (ret);
}

static __inline int
atomic_fcmpset_acq_int(volatile u_int *p, u_int *cmpval, u_int newval)
{
 int retval;

 retval = atomic_fcmpset_int(p, cmpval, newval);
 __asm volatile("isync" : : : "memory");
 return (retval);
}

static __inline int
atomic_fcmpset_rel_int(volatile u_int *p, u_int *cmpval, u_int newval)
{
 __asm volatile("lwsync" : : : "memory");
 return (atomic_fcmpset_int(p, cmpval, newval));
}

static __inline int
atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval)
{
 u_long retval;

 retval = atomic_fcmpset_long(p, cmpval, newval);
 __asm volatile("isync" : : : "memory");
 return (retval);
}

static __inline int
atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval)
{
 __asm volatile("lwsync" : : : "memory");
 return (atomic_fcmpset_long(p, cmpval, newval));
}
# 792 "/usr/include/machine/atomic.h" 3 4
static __inline u_int
atomic_fetchadd_int(volatile u_int *p, u_int v)
{
 u_int value;

 do {
  value = *p;
 } while (!atomic_cmpset_int(p, value, value + v));
 return (value);
}

static __inline u_long
atomic_fetchadd_long(volatile u_long *p, u_long v)
{
 u_long value;

 do {
  value = *p;
 } while (!atomic_cmpset_long(p, value, value + v));
 return (value);
}

static __inline u_int
atomic_swap_32(volatile u_int *p, u_int v)
{
 u_int prev;

 __asm volatile(
 "1:	lwarx	%0,0,%2\n"
 "	stwcx.	%3,0,%2\n"
 "	bne-	1b\n"
 : "=&r" (prev), "+m" (*(volatile u_int *)p)
 : "r" (p), "r" (v)
 : "cr0", "memory");

 return (prev);
}


static __inline u_long
atomic_swap_64(volatile u_long *p, u_long v)
{
 u_long prev;

 __asm volatile(
 "1:	ldarx	%0,0,%2\n"
 "	stdcx.	%3,0,%2\n"
 "	bne-	1b\n"
 : "=&r" (prev), "+m" (*(volatile u_long *)p)
 : "r" (p), "r" (v)
 : "cr0", "memory");

 return (prev);
}
# 863 "/usr/include/machine/atomic.h" 3 4
static __inline void
atomic_thread_fence_acq(void)
{

 powerpc_lwsync();
}

static __inline void
atomic_thread_fence_rel(void)
{

 powerpc_lwsync();
}

static __inline void
atomic_thread_fence_acq_rel(void)
{

 powerpc_lwsync();
}

static __inline void
atomic_thread_fence_seq_cst(void)
{

 __asm volatile("sync" : : : "memory");
}
# 47 "/usr/src/lib/libthr/thread/thr_private.h" 2

# 1 "/usr/src/include/limits.h" 1
# 49 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/include/signal.h" 1
# 42 "/usr/src/include/signal.h"
# 1 "/usr/include/machine/ucontext.h" 1 3 4
# 40 "/usr/include/machine/ucontext.h" 3 4
typedef struct __mcontext {
 int mc_vers;
 int mc_flags;


 int mc_onstack;
 int mc_len;
 __uint64_t mc_avec[32*2];
 __uint32_t mc_av[2];
 __register_t mc_frame[42];
 __uint64_t mc_fpreg[33];
 __uint64_t mc_vsxfpreg[32];
} mcontext_t __attribute__((__aligned__(16)));
# 43 "/usr/src/include/signal.h" 2
# 1 "/usr/include/sys/_ucontext.h" 1 3 4
# 36 "/usr/include/sys/_ucontext.h" 3 4
typedef struct __ucontext {
# 45 "/usr/include/sys/_ucontext.h" 3 4
 __sigset_t uc_sigmask;
 mcontext_t uc_mcontext;

 struct __ucontext *uc_link;
 struct sigaltstack uc_stack;
 int uc_flags;
 int __spare__[4];
} ucontext_t;
# 44 "/usr/src/include/signal.h" 2


#pragma clang diagnostic push
# 46 "/usr/src/include/signal.h"
#pragma clang diagnostic ignored "-Wnullability-completeness"






extern const char * const sys_signame[32];
extern const char * const sys_siglist[32];
extern const int sys_nsig;
# 66 "/usr/src/include/signal.h"
struct pthread;
typedef struct pthread *__pthread_t;







int raise(int);


int kill(__pid_t, int);
int pthread_kill(__pthread_t, int);
int pthread_sigmask(int, const __sigset_t * restrict,
     __sigset_t * restrict);
int sigaction(int, const struct sigaction * restrict,
     struct sigaction * restrict);
int sigaddset(sigset_t *, int);
int sigdelset(sigset_t *, int);
int sigemptyset(sigset_t *);
int sigfillset(sigset_t *);
int sigismember(const sigset_t *, int);
int sigpending(sigset_t * _Nonnull);
int sigprocmask(int, const sigset_t * restrict, sigset_t * restrict);
int sigsuspend(const sigset_t * _Nonnull);
int sigwait(const sigset_t * _Nonnull restrict,
     int * _Nonnull restrict);



int sigqueue(__pid_t, int, const union sigval);

struct timespec;
int sigtimedwait(const sigset_t * restrict, siginfo_t * restrict,
     const struct timespec * restrict);
int sigwaitinfo(const sigset_t * restrict, siginfo_t * restrict);



int killpg(__pid_t, int);
int sigaltstack(const stack_t * restrict, stack_t * restrict);
int sighold(int);
int sigignore(int);
int sigpause(int);
int sigrelse(int);
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
int xsi_sigpause(int);



int siginterrupt(int, int);



void psignal(int, const char *);



int sigblock(int);
int sigreturn(const struct __ucontext *);
int sigsetmask(int);
int sigstack(const struct sigstack *, struct sigstack *);
int sigvec(int, struct sigvec *, struct sigvec *);


#pragma clang diagnostic pop
# 50 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/include/stdbool.h" 1
# 51 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/include/stddef.h" 1
# 44 "/usr/src/include/stddef.h"
typedef __ptrdiff_t ptrdiff_t;





typedef __rune_t rune_t;
# 62 "/usr/src/include/stddef.h"
typedef ___wchar_t wchar_t;






typedef __max_align_t max_align_t;
# 81 "/usr/src/include/stddef.h"
typedef size_t rsize_t;
# 52 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/include/stdio.h" 1
# 45 "/usr/src/include/stdio.h"
#pragma clang diagnostic push
# 45 "/usr/src/include/stdio.h"
#pragma clang diagnostic ignored "-Wnullability-completeness"

typedef __off_t fpos_t;
# 77 "/usr/src/include/stdio.h"
typedef __va_list va_list;
# 91 "/usr/src/include/stdio.h"
struct __sbuf {
 unsigned char *_base;
 int _size;
};
# 124 "/usr/src/include/stdio.h"
struct __sFILE {
 unsigned char *_p;
 int _r;
 int _w;
 short _flags;
 short _file;
 struct __sbuf _bf;
 int _lbfsize;


 void *_cookie;
 int (* _Nullable _close)(void *);
 int (* _Nullable _read)(void *, char *, int);
 fpos_t (* _Nullable _seek)(void *, fpos_t, int);
 int (* _Nullable _write)(void *, const char *, int);


 struct __sbuf _ub;
 unsigned char *_up;
 int _ur;


 unsigned char _ubuf[3];
 unsigned char _nbuf[1];


 struct __sbuf _lb;


 int _blksize;
 fpos_t _offset;

 struct pthread_mutex *_fl_mutex;
 struct pthread *_fl_owner;
 int _fl_count;
 int _orientation;
 __mbstate_t _mbstate;
 int _flags2;
};


typedef struct __sFILE FILE;



extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
# 251 "/usr/src/include/stdio.h"
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * restrict, fpos_t * restrict);
char *fgets(char * restrict, int, FILE * restrict);
FILE *fopen(const char * restrict, const char * restrict);
int fprintf(FILE * restrict, const char * restrict, ...);
int fputc(int, FILE *);
int fputs(const char * restrict, FILE * restrict);
size_t fread(void * restrict, size_t, size_t, FILE * restrict);
FILE *freopen(const char * restrict, const char * restrict, FILE * restrict);
int fscanf(FILE * restrict, const char * restrict, ...);
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict);
int getc(FILE *);
int getchar(void);

char *gets_s(char *, rsize_t);

void perror(const char *);
int printf(const char * restrict, ...);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char * restrict, ...);
void setbuf(FILE * restrict, char * restrict);
int setvbuf(FILE * restrict, char * restrict, int, size_t);
int sprintf(char * restrict, const char * restrict, ...);
int sscanf(const char * restrict, const char * restrict, ...);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * restrict, const char * restrict,
     __va_list);
int vprintf(const char * restrict, __va_list);
int vsprintf(char * restrict, const char * restrict,
     __va_list);


int snprintf(char * restrict, size_t, const char * restrict,
     ...) __attribute__((__format__ (__printf__, 3, 4)));
int vsnprintf(char * restrict, size_t, const char * restrict,
     __va_list) __attribute__((__format__ (__printf__, 3, 0)));


int vfscanf(FILE * restrict, const char * restrict, __va_list)
     __attribute__((__format__ (__scanf__, 2, 0)));
int vscanf(const char * restrict, __va_list) __attribute__((__format__ (__scanf__, 1, 0)));
int vsscanf(const char * restrict, const char * restrict, __va_list)
     __attribute__((__format__ (__scanf__, 2, 0)));
# 321 "/usr/src/include/stdio.h"
char *ctermid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);



int pclose(FILE *);
FILE *popen(const char *, const char *);



int ftrylockfile(FILE *);
void flockfile(FILE *);
void funlockfile(FILE *);





int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);


void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);



int fseeko(FILE *, __off_t, int);
__off_t ftello(FILE *);



int getw(FILE *);
int putw(int, FILE *);



char *tempnam(const char *, const char *);



FILE *fmemopen(void * restrict, size_t, const char * restrict);
ssize_t getdelim(char ** restrict, size_t * restrict, int,
     FILE * restrict);
FILE *open_memstream(char **, size_t *);
int renameat(int, const char *, int, const char *);
int vdprintf(int, const char * restrict, __va_list) __attribute__((__format__ (__printf__, 2, 0)));

ssize_t getline(char ** restrict, size_t * restrict, FILE * restrict);
int dprintf(int, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3)));






int asprintf(char **, const char *, ...) __attribute__((__format__ (__printf__, 2, 3)));
char *ctermid_r(char *);
void fcloseall(void);
int fdclose(FILE *, int *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *) __attribute__((__format_arg__ (2)));
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char **, const char *, __va_list)
     __attribute__((__format__ (__printf__, 2, 0)));






extern const int sys_nerr;
extern const char * const sys_errlist[];




FILE *funopen(const void *,
     int (* _Nullable)(void *, char *, int),
     int (* _Nullable)(void *, const char *, int),
     fpos_t (* _Nullable)(void *, fpos_t, int),
     int (* _Nullable)(void *));



typedef __ssize_t cookie_read_function_t(void *, char *, size_t);
typedef __ssize_t cookie_write_function_t(void *, const char *, size_t);
typedef int cookie_seek_function_t(void *, off64_t *, int);
typedef int cookie_close_function_t(void *);
typedef struct {
 cookie_read_function_t *read;
 cookie_write_function_t *write;
 cookie_seek_function_t *seek;
 cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie(void *, const char *, cookie_io_functions_t);
# 449 "/usr/src/include/stdio.h"
int __srget(FILE *);
int __swbuf(int, FILE *);







static __inline int __sputc(int _c, FILE *_p) {
 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
  return (*_p->_p++ = _c);
 else
  return (__swbuf(_c, _p));
}
# 480 "/usr/src/include/stdio.h"
extern int __isthreaded;
# 525 "/usr/src/include/stdio.h"
#pragma clang diagnostic pop
# 53 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/include/unistd.h" 1
# 40 "/usr/src/include/unistd.h"
# 1 "/usr/include/sys/unistd.h" 1 3 4
# 41 "/usr/src/include/unistd.h" 2
# 323 "/usr/src/include/unistd.h"
void _exit(int) __attribute__((__noreturn__));
int access(const char *, int);
unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
void closefrom(int);
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...) __attribute__((__sentinel__));
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...) __attribute__((__sentinel__));
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t []);
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);




long pathconf(const char *, int);
int pause(void);
int pipe(int *);
ssize_t read(int, void *, size_t);
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
unsigned int sleep(unsigned int);
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t);
int unlink(const char *);
ssize_t write(int, const void *, size_t);



size_t confstr(int, char *, size_t);


int getopt(int, char * const [], const char *);

extern char *optarg;
extern int optind, opterr, optopt;





int fsync(int);
int fdatasync(int);
# 402 "/usr/src/include/unistd.h"
int getlogin_r(char *, int);




int fchown(int, uid_t, gid_t);
ssize_t readlink(const char * restrict, char * restrict, size_t);


int gethostname(char *, size_t);
int setegid(gid_t);
int seteuid(uid_t);




int getsid(pid_t _pid);
int fchdir(int);
int getpgid(pid_t _pid);
int lchown(const char *, uid_t, gid_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
# 433 "/usr/src/include/unistd.h"
int faccessat(int, const char *, int, int);
int fchownat(int, const char *, uid_t, gid_t, int);
int fexecve(int, char *const [], char *const []);
int linkat(int, const char *, int, const char *, int);
ssize_t readlinkat(int, const char * restrict, char * restrict, size_t);
int symlinkat(const char *, int, const char *);
int unlinkat(int, const char *, int);
# 448 "/usr/src/include/unistd.h"
int symlink(const char * restrict, const char * restrict);




char *crypt(const char *, const char *);
long gethostid(void);
int lockf(int, int, off_t);
int nice(int);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);



void swab(const void * restrict, void * restrict, ssize_t);


void sync(void);




int brk(const void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void) __attribute__((__const__));
char *getpass(const char *);
void *sbrk(intptr_t);



char *getwd(char *);
useconds_t
  ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork(void) __attribute__((__returns_twice__));



struct timeval;

struct crypt_data {
 int initialized;
 char __buf[256];
};

int acct(const char *);
int async_daemon(void);
int check_utility_compat(const char *);
ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned int);
const char *
  crypt_get_format(void);
char *crypt_r(const char *, const char *, struct crypt_data *);
int crypt_set_format(const char *);
int dup3(int, int, int);
int eaccess(const char *, int);
void endusershell(void);
int exect(const char *, char * const *, char * const *);
int execvP(const char *, const char *, char * const *);
int feature_present(const char *);
char *fflagstostr(u_long);
int getdomainname(char *, int);
int getentropy(void *, size_t);
int getgrouplist(const char *, gid_t, gid_t *, int *);
int getloginclass(char *, size_t);
mode_t getmode(const void *, mode_t);
int getosreldate(void);
int getpeereid(int, uid_t *, gid_t *);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getusershell(void);
int initgroups(const char *, gid_t);
int iruserok(unsigned long, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
int issetugid(void);
void __FreeBSD_libc_enter_restricted_mode(void);
long lpathconf(const char *, int);

char *mkdtemp(char *);



int mknod(const char *, mode_t, dev_t);



int mkstemp(char *);


int mkstemps(char *, int);

char *mktemp(char *);


int nfssvc(int, void *);
int nlm_syscall(int, int, int, char **);
int pipe2(int *, int);
int profil(char *, size_t, vm_offset_t, int);
int rcmd(char **, int, const char *, const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
  const char *, const char *, int *, int);
int rcmdsh(char **, int, const char *,
  const char *, const char *, const char *);
char *re_comp(const char *);
int re_exec(const char *);
int reboot(int);
int revoke(const char *);
pid_t rfork(int);
pid_t rfork_thread(int, void *, int (*)(void *), void *);
int rresvport(int *);
int rresvport_af(int *, int);
int ruserok(const char *, int, const char *, const char *);






int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
int setlogin(const char *);
int setloginclass(const char *);
void *setmode(const char *);
int setpgrp(pid_t, pid_t);
void setproctitle(const char *_fmt, ...) __attribute__((__format__ (__printf0__, 1, 2)));
void setproctitle_fast(const char *_fmt, ...) __attribute__((__format__ (__printf0__, 1, 2)));
int setresgid(gid_t, gid_t, gid_t);
int setresuid(uid_t, uid_t, uid_t);
int setrgid(gid_t);
int setruid(uid_t);
void setusershell(void);
int strtofflags(char **, u_long *, u_long *);
int swapon(const char *);
int swapoff(const char *);
int syscall(int, ...);
off_t __syscall(quad_t, ...);
int undelete(const char *);
int unwhiteout(const char *);
void *valloc(size_t);
int funlinkat(int, const char *, int, int);



extern int optreset;
# 54 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/include/ucontext.h" 1 3 4
# 60 "/usr/include/ucontext.h" 3 4
int getcontext(ucontext_t *) __attribute__((__returns_twice__));
ucontext_t *getcontextx(void);
int setcontext(const ucontext_t *);
void makecontext(ucontext_t *, void (*)(void), int, ...);
int signalcontext(ucontext_t *, int, __sighandler_t *);
int swapcontext(ucontext_t *, const ucontext_t *);


int __getcontextx_size(void);
int __fillcontextx(char *ctx) __attribute__((__returns_twice__));
int __fillcontextx2(char *ctx);
# 55 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/include/sys/thr.h" 1 3 4
# 49 "/usr/include/sys/thr.h" 3 4
struct thr_param {
    void (*start_func)(void *);
    void *arg;
    char *stack_base;
    size_t stack_size;
    char *tls_base;
    size_t tls_size;
    long *child_tid;
    long *parent_tid;
    int flags;
    struct rtprio *rtp;
    void *spare[3];
};
# 75 "/usr/include/sys/thr.h" 3 4
int thr_create(ucontext_t *ctx, long *id, int flags);
int thr_new(struct thr_param *param, int param_size);
int thr_self(long *id);
void thr_exit(long *state);
int thr_kill(long id, int sig);
int thr_kill2(pid_t pid, long id, int sig);
int thr_suspend(const struct timespec *timeout);
int thr_wake(long id);
int thr_set_name(long id, const char *name);
# 56 "/usr/src/lib/libthr/thread/thr_private.h" 2


#pragma clang diagnostic push
# 58 "/usr/src/lib/libthr/thread/thr_private.h"
#pragma clang diagnostic ignored "-Wnullability-completeness"
# 74 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread;
extern struct pthread *_thr_initial __attribute__((__visibility__("hidden")));


# 1 "/usr/src/lib/libthr/arch/powerpc/include/pthread_md.h" 1
# 55 "/usr/src/lib/libthr/arch/powerpc/include/pthread_md.h"
struct tcb {
 void *tcb_dtv;
 struct pthread *tcb_thread;
};

static __inline void
_tcb_set(struct tcb *tcb)
{

 __asm volatile("mr 13,%0" ::
     "r"((uint8_t *)tcb + 0x7010));




}

static __inline struct tcb *
_tcb_get(void)
{
        register struct tcb *tcb;


 __asm volatile("addi %0,13,%1" : "=r"(tcb) : "i"(-0x7010));




 return (tcb);
}

static __inline struct pthread *
_get_curthread(void)
{
 if (_thr_initial)
  return (_tcb_get()->tcb_thread);
 return (((void *)0));
}
# 78 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/lib/libthr/thread/thr_umtx.h" 1
# 34 "/usr/src/lib/libthr/thread/thr_umtx.h"
# 1 "/usr/src/include/strings.h" 1
# 44 "/usr/src/include/strings.h"
int bcmp(const void *, const void *, size_t) __attribute__((__pure__));
void bcopy(const void *, void *, size_t);
void bzero(void *, size_t);


void explicit_bzero(void *, size_t);


int ffs(int) __attribute__((__const__));


int ffsl(long) __attribute__((__const__));
int ffsll(long long) __attribute__((__const__));
int fls(int) __attribute__((__const__));
int flsl(long) __attribute__((__const__));
int flsll(long long) __attribute__((__const__));


char *index(const char *, int) __attribute__((__pure__));
char *rindex(const char *, int) __attribute__((__pure__));

int strcasecmp(const char *, const char *) __attribute__((__pure__));
int strncasecmp(const char *, const char *, size_t) __attribute__((__pure__));



# 1 "/usr/src/include/xlocale/_strings.h" 1
# 46 "/usr/src/include/xlocale/_strings.h"
int strcasecmp_l(const char *, const char *, locale_t);
int strncasecmp_l(const char *, const char *, size_t, locale_t);
# 70 "/usr/src/include/strings.h" 2
# 35 "/usr/src/lib/libthr/thread/thr_umtx.h" 2
# 1 "/usr/include/sys/umtx.h" 1 3 4
# 35 "/usr/include/sys/umtx.h" 3 4
# 1 "/usr/include/sys/_umtx.h" 1 3 4
# 38 "/usr/include/sys/_umtx.h" 3 4
struct umutex {
 volatile __lwpid_t m_owner;
 __uint32_t m_flags;
 __uint32_t m_ceilings[2];
 __uintptr_t m_rb_lnk;



 __uint32_t m_spare[2];
};

struct ucond {
 volatile __uint32_t c_has_waiters;
 __uint32_t c_flags;
 __uint32_t c_clockid;
 __uint32_t c_spare[1];
};

struct urwlock {
 volatile __int32_t rw_state;
 __uint32_t rw_flags;
 __uint32_t rw_blocked_readers;
 __uint32_t rw_blocked_writers;
 __uint32_t rw_spare[4];
};

struct _usem {
 volatile __uint32_t _has_waiters;
 volatile __uint32_t _count;
 __uint32_t _flags;
};

struct _usem2 {
 volatile __uint32_t _count;
 __uint32_t _flags;
};

struct _umtx_time {
 struct timespec _timeout;
 __uint32_t _flags;
 __uint32_t _clockid;
};
# 36 "/usr/include/sys/umtx.h" 2 3 4
# 119 "/usr/include/sys/umtx.h" 3 4
struct umtx_robust_lists_params {
 uintptr_t robust_list_offset;
 uintptr_t robust_priv_list_offset;
 uintptr_t robust_inact_offset;
};





int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2);
# 36 "/usr/src/lib/libthr/thread/thr_umtx.h" 2








int _umtx_op_err(void *, int op, u_long, void *, void *) __attribute__((__visibility__("hidden")));
int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __attribute__((__visibility__("hidden")));
int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __attribute__((__visibility__("hidden")));
int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
 const struct timespec *timeout) __attribute__((__visibility__("hidden")));
int __thr_umutex_unlock(struct umutex *mtx) __attribute__((__visibility__("hidden")));
int __thr_umutex_trylock(struct umutex *mtx) __attribute__((__visibility__("hidden")));
int __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling,
 uint32_t *oldceiling) __attribute__((__visibility__("hidden")));

void _thr_umutex_init(struct umutex *mtx) __attribute__((__visibility__("hidden")));
void _thr_urwlock_init(struct urwlock *rwl) __attribute__((__visibility__("hidden")));

int _thr_umtx_wait(volatile long *mtx, long exp,
 const struct timespec *timeout) __attribute__((__visibility__("hidden")));
int _thr_umtx_wait_uint(volatile u_int *mtx, u_int exp,
 const struct timespec *timeout, int shared) __attribute__((__visibility__("hidden")));
int _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int exp, int clockid,
 const struct timespec *timeout, int shared) __attribute__((__visibility__("hidden")));
int _thr_umtx_wake(volatile void *mtx, int count, int shared) __attribute__((__visibility__("hidden")));
int _thr_ucond_wait(struct ucond *cv, struct umutex *m,
        const struct timespec *timeout, int flags) __attribute__((__visibility__("hidden")));
void _thr_ucond_init(struct ucond *cv) __attribute__((__visibility__("hidden")));
int _thr_ucond_signal(struct ucond *cv) __attribute__((__visibility__("hidden")));
int _thr_ucond_broadcast(struct ucond *cv) __attribute__((__visibility__("hidden")));

int __thr_rwlock_rdlock(struct urwlock *rwlock, int flags,
 const struct timespec *tsp) __attribute__((__visibility__("hidden")));
int __thr_rwlock_wrlock(struct urwlock *rwlock,
 const struct timespec *tsp) __attribute__((__visibility__("hidden")));
int __thr_rwlock_unlock(struct urwlock *rwlock) __attribute__((__visibility__("hidden")));


void _thr_rwl_rdlock(struct urwlock *rwlock) __attribute__((__visibility__("hidden")));
void _thr_rwl_wrlock(struct urwlock *rwlock) __attribute__((__visibility__("hidden")));
void _thr_rwl_unlock(struct urwlock *rwlock) __attribute__((__visibility__("hidden")));

static inline int
_thr_umutex_trylock(struct umutex *mtx, uint32_t id)
{

 if (atomic_cmpset_acq_int(&mtx->m_owner, 0x0, id))
  return (0);
 if (__builtin_expect(((uint32_t)mtx->m_owner == (0x80000000U | 0x10)), 0) &&
     atomic_cmpset_acq_int(&mtx->m_owner, (0x80000000U | 0x10),
     id | 0x80000000U))
  return (96);
 if (__builtin_expect(((uint32_t)mtx->m_owner == (0x80000000U | 0x11)), 0))
  return (95);
 if ((mtx->m_flags & 0x0008) == 0)
  return (16);
 return (__thr_umutex_trylock(mtx));
}

static inline int
_thr_umutex_trylock2(struct umutex *mtx, uint32_t id)
{

 if (atomic_cmpset_acq_int(&mtx->m_owner, 0x0, id) != 0)
  return (0);
 if ((uint32_t)mtx->m_owner == 0x80000000U &&
     __builtin_expect(((mtx->m_flags & (0x0008 | 0x0004)) == 0), 1) &&

    atomic_cmpset_acq_int(&mtx->m_owner, 0x80000000U,
    id | 0x80000000U))
  return (0);
 if (__builtin_expect(((uint32_t)mtx->m_owner == (0x80000000U | 0x10)), 0) &&
     atomic_cmpset_acq_int(&mtx->m_owner, (0x80000000U | 0x10),
     id | 0x80000000U))
  return (96);
 if (__builtin_expect(((uint32_t)mtx->m_owner == (0x80000000U | 0x11)), 0))
  return (95);
 return (16);
}

static inline int
_thr_umutex_lock(struct umutex *mtx, uint32_t id)
{

 if (_thr_umutex_trylock2(mtx, id) == 0)
  return (0);
 return (__thr_umutex_lock(mtx, id));
}

static inline int
_thr_umutex_lock_spin(struct umutex *mtx, uint32_t id)
{

 if (_thr_umutex_trylock2(mtx, id) == 0)
  return (0);
 return (__thr_umutex_lock_spin(mtx, id));
}

static inline int
_thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
    const struct timespec *timeout)
{

 if (_thr_umutex_trylock2(mtx, id) == 0)
  return (0);
 return (__thr_umutex_timedlock(mtx, id, timeout));
}

static inline int
_thr_umutex_unlock2(struct umutex *mtx, uint32_t id, int *defer)
{
 uint32_t flags, owner;
 _Bool noncst;

 flags = mtx->m_flags;
 noncst = (flags & 0x0020) != 0;

 if ((flags & (0x0008 | 0x0004)) != 0) {
  if (atomic_cmpset_rel_int(&mtx->m_owner, id, noncst ?
      (0x80000000U | 0x11) : 0x0))
   return (0);
  return (__thr_umutex_unlock(mtx));
 }

 do {
  owner = mtx->m_owner;
  if (__builtin_expect(((owner & ~0x80000000U) != id), 0))
   return (1);
 } while (__builtin_expect((!atomic_cmpset_rel_int(&mtx->m_owner, owner, noncst ? (0x80000000U | 0x11) : 0x0)), 0));

 if ((owner & 0x80000000U) != 0) {
  if (defer == ((void *)0) || noncst)
   (void)_umtx_op_err(mtx, 22,
       flags, 0, 0);
  else
   *defer = 1;
 }
 return (0);
}

static inline int
_thr_umutex_unlock(struct umutex *mtx, uint32_t id)
{

 return (_thr_umutex_unlock2(mtx, id, ((void *)0)));
}

static inline int
_thr_rwlock_tryrdlock(struct urwlock *rwlock, int flags)
{
 int32_t state, wrflags;

 if ((flags & 0x0002) != 0 ||
     (rwlock->rw_flags & 0x0002) != 0)
  wrflags = 0x80000000U;
 else
  wrflags = 0x80000000U | 0x40000000U;
 state = rwlock->rw_state;
 while (!(state & wrflags)) {
  if (__builtin_expect((((state) & 0x1fffffffU) == 0x1fffffffU), 0))

   return (35);
  if (atomic_cmpset_acq_int(&rwlock->rw_state, state, state + 1))
   return (0);
  state = rwlock->rw_state;
 }

 return (16);
}

static inline int
_thr_rwlock_trywrlock(struct urwlock *rwlock)
{
 int32_t state;

 state = rwlock->rw_state;
 while ((state & 0x80000000U) == 0 &&
     ((state) & 0x1fffffffU) == 0) {
  if (atomic_cmpset_acq_int(&rwlock->rw_state, state,
      state | 0x80000000U))
   return (0);
  state = rwlock->rw_state;
 }

 return (16);
}

static inline int
_thr_rwlock_rdlock(struct urwlock *rwlock, int flags, struct timespec *tsp)
{

 if (_thr_rwlock_tryrdlock(rwlock, flags) == 0)
  return (0);
 return (__thr_rwlock_rdlock(rwlock, flags, tsp));
}

static inline int
_thr_rwlock_wrlock(struct urwlock *rwlock, struct timespec *tsp)
{

 if (_thr_rwlock_trywrlock(rwlock) == 0)
  return (0);
 return (__thr_rwlock_wrlock(rwlock, tsp));
}

static inline int
_thr_rwlock_unlock(struct urwlock *rwlock)
{
 int32_t state;

 state = rwlock->rw_state;
 if ((state & 0x80000000U) != 0) {
  if (atomic_cmpset_rel_int(&rwlock->rw_state,
      0x80000000U, 0))
   return (0);
 } else {
  for (;;) {
   if (__builtin_expect((((state) & 0x1fffffffU) == 0), 0))
    return (1);
   if (!((state & (0x40000000U |
       0x20000000U)) != 0 &&
       ((state) & 0x1fffffffU) == 1)) {
    if (atomic_cmpset_rel_int(&rwlock->rw_state,
        state, state - 1))
     return (0);
    state = rwlock->rw_state;
   } else {
    break;
   }
  }
     }
     return (__thr_rwlock_unlock(rwlock));
}
# 79 "/usr/src/lib/libthr/thread/thr_private.h" 2
# 1 "/usr/src/lib/libthread_db/thread_db.h" 1
# 35 "/usr/src/lib/libthread_db/thread_db.h"
# 1 "/usr/include/sys/procfs.h" 1 3 4
# 35 "/usr/include/sys/procfs.h" 3 4
# 1 "/usr/include/machine/reg.h" 1 3 4







struct reg {
 register_t fixreg[32];
 register_t lr;
 register_t cr;
 register_t xer;
 register_t ctr;
 register_t pc;
};

struct fpreg {
 double fpreg[32];
 double fpscr;
};


struct vmxreg {
 uint32_t vr[32][4];
 uint32_t pad[2];
 uint32_t vrsave;
 uint32_t vscr;
};

struct dbreg {
 unsigned int junk;
};



struct reg32 {
 int32_t fixreg[32];
 int32_t lr;
 int32_t cr;
 int32_t xer;
 int32_t ctr;
 int32_t pc;
};

struct fpreg32 {
 struct fpreg data;
};

struct vmxreg32 {
 struct vmxreg data;
};

struct dbreg32 {
 struct dbreg data;
};
# 36 "/usr/include/sys/procfs.h" 2 3 4

typedef struct reg gregset_t;
typedef struct fpreg fpregset_t;
# 62 "/usr/include/sys/procfs.h" 3 4
typedef struct prstatus {
    int pr_version;
    size_t pr_statussz;
    size_t pr_gregsetsz;
    size_t pr_fpregsetsz;
    int pr_osreldate;
    int pr_cursig;
    pid_t pr_pid;
    gregset_t pr_reg;
} prstatus_t;

typedef gregset_t prgregset_t[1];
typedef fpregset_t prfpregset_t;






typedef struct prpsinfo {
    int pr_version;
    size_t pr_psinfosz;
    char pr_fname[16 +1];
    char pr_psargs[80 +1];
    pid_t pr_pid;
} prpsinfo_t;

typedef struct thrmisc {
    char pr_tname[19 +1];
    u_int _pad;
} thrmisc_t;

typedef uint64_t psaddr_t;


typedef struct prstatus32 {
 int32_t pr_version;
 uint32_t pr_statussz;
 uint32_t pr_gregsetsz;
 uint32_t pr_fpregsetsz;
 int32_t pr_osreldate;
 int32_t pr_cursig;
 int32_t pr_pid;
 struct reg32 pr_reg;
} prstatus32_t;

typedef struct prpsinfo32 {
 int32_t pr_version;
 uint32_t pr_psinfosz;
 char pr_fname[16 +1];
 char pr_psargs[80 +1];
 int32_t pr_pid;
} prpsinfo32_t;

struct thrmisc32 {
 char pr_tname[19 +1];
 uint32_t _pad;
};
# 36 "/usr/src/lib/libthread_db/thread_db.h" 2


typedef enum {
 TD_ERR = -1,
 TD_OK = 0,
 TD_BADKEY,
 TD_BADPH,
 TD_BADSH,
 TD_BADTA,
 TD_BADTH,
 TD_DBERR,
 TD_MALLOC,
 TD_NOAPLIC,
 TD_NOCAPAB,
 TD_NOEVENT,
 TD_NOFPREGS,
 TD_NOLIBTHREAD,
 TD_NOLWP,
 TD_NOMSG,
 TD_NOSV,
 TD_NOTHR,
 TD_NOTSD,
 TD_NOXREGS,
 TD_PARTIALREG
} td_err_e;

struct ps_prochandle;
typedef struct td_thragent td_thragent_t;
typedef long thread_t;

typedef struct {
 const td_thragent_t *th_ta;
 psaddr_t th_thread;
 thread_t th_tid;
} td_thrhandle_t;





typedef enum {
 TD_EVENT_NONE = 0,
 TD_CATCHSIG = 0x0001,
 TD_CONCURRENCY= 0x0002,
 TD_CREATE = 0x0004,
 TD_DEATH = 0x0008,
 TD_IDLE = 0x0010,
 TD_LOCK_TRY = 0x0020,
 TD_PREEMPT = 0x0040,
 TD_PRI_INHERIT= 0x0080,
 TD_READY = 0x0100,
 TD_REAP = 0x0200,
 TD_SLEEP = 0x0400,
 TD_SWITCHFROM = 0x0800,
 TD_SWITCHTO = 0x1000,
 TD_TIMEOUT = 0x2000,
 TD_ALL_EVENTS = ~0
} td_thr_events_e;




typedef struct {
 td_thr_events_e event;
 psaddr_t th_p;
 uintptr_t data;
} td_event_msg_t;

typedef unsigned int td_thr_events_t;

typedef enum {
 NOTIFY_BPT,
 NOTIFY_AUTOBPT,
 NOTIFY_SYSCALL
} td_notify_e;

typedef struct {
 td_notify_e type;
 union {
  psaddr_t bptaddr;
  int syscallno;
 } u;
} td_notify_t;

static __inline void
td_event_addset(td_thr_events_t *es, td_thr_events_e e)
{
 *es |= e;
}

static __inline void
td_event_delset(td_thr_events_t *es, td_thr_events_e e)
{
 *es &= ~e;
}

static __inline void
td_event_emptyset(td_thr_events_t *es)
{
 *es = TD_EVENT_NONE;
}

static __inline void
td_event_fillset(td_thr_events_t *es)
{
 *es = TD_ALL_EVENTS;
}

static __inline int
td_eventisempty(td_thr_events_t *es)
{
 return ((*es == TD_EVENT_NONE) ? 1 : 0);
}

static __inline int
td_eventismember(td_thr_events_t *es, td_thr_events_e e)
{
 return ((*es & e) ? 1 : 0);
}





typedef enum {
 TD_THR_UNKNOWN = -1,
 TD_THR_ANY_STATE = 0,
 TD_THR_ACTIVE,
 TD_THR_RUN,
 TD_THR_SLEEP,
 TD_THR_STOPPED,
 TD_THR_STOPPED_ASLEEP,
 TD_THR_ZOMBIE
} td_thr_state_e;

typedef enum
{
 TD_THR_SYSTEM = 1,
 TD_THR_USER
} td_thr_type_e;

typedef pthread_key_t thread_key_t;

typedef struct {
 const td_thragent_t *ti_ta_p;
 thread_t ti_tid;
 psaddr_t ti_thread;
 td_thr_state_e ti_state;
 td_thr_type_e ti_type;
 td_thr_events_t ti_events;
 int ti_pri;
 lwpid_t ti_lid;
 char ti_db_suspended;
 char ti_traceme;
 sigset_t ti_sigmask;
 sigset_t ti_pending;
 psaddr_t ti_tls;
 psaddr_t ti_startfunc;
 psaddr_t ti_stkbase;
 size_t ti_stksize;
 siginfo_t ti_siginfo;
} td_thrinfo_t;





typedef int td_key_iter_f(thread_key_t, void (*)(void *), void *);
typedef int td_thr_iter_f(const td_thrhandle_t *, void *);







td_err_e td_init(void);

td_err_e td_ta_clear_event(const td_thragent_t *, td_thr_events_t *);
td_err_e td_ta_delete(td_thragent_t *);
td_err_e td_ta_event_addr(const td_thragent_t *, td_thr_events_e,
    td_notify_t *);
td_err_e td_ta_event_getmsg(const td_thragent_t *, td_event_msg_t *);
td_err_e td_ta_map_id2thr(const td_thragent_t *, thread_t, td_thrhandle_t *);
td_err_e td_ta_map_lwp2thr(const td_thragent_t *, lwpid_t, td_thrhandle_t *);
td_err_e td_ta_new(struct ps_prochandle *, td_thragent_t **);
td_err_e td_ta_set_event(const td_thragent_t *, td_thr_events_t *);
td_err_e td_ta_thr_iter(const td_thragent_t *, td_thr_iter_f *, void *,
    td_thr_state_e, int, sigset_t *, unsigned int);
td_err_e td_ta_tsd_iter(const td_thragent_t *, td_key_iter_f *, void *);

td_err_e td_thr_clear_event(const td_thrhandle_t *, td_thr_events_t *);
td_err_e td_thr_dbresume(const td_thrhandle_t *);
td_err_e td_thr_dbsuspend(const td_thrhandle_t *);
td_err_e td_thr_event_enable(const td_thrhandle_t *, int);
td_err_e td_thr_event_getmsg(const td_thrhandle_t *, td_event_msg_t *);
td_err_e td_thr_get_info(const td_thrhandle_t *, td_thrinfo_t *);



td_err_e td_thr_getfpregs(const td_thrhandle_t *, prfpregset_t *);
td_err_e td_thr_getgregs(const td_thrhandle_t *, prgregset_t);
td_err_e td_thr_set_event(const td_thrhandle_t *, td_thr_events_t *);



td_err_e td_thr_setfpregs(const td_thrhandle_t *, const prfpregset_t *);
td_err_e td_thr_setgregs(const td_thrhandle_t *, const prgregset_t);
td_err_e td_thr_validate(const td_thrhandle_t *);
td_err_e td_thr_tls_get_addr(const td_thrhandle_t *, psaddr_t, size_t,
    psaddr_t *);


td_err_e td_thr_sstep(const td_thrhandle_t *, int);
# 80 "/usr/src/lib/libthr/thread/thr_private.h" 2



# 1 "/usr/src/include/unwind.h" 1
# 45 "/usr/src/include/unwind.h"
typedef enum
  {
    _URC_NO_REASON = 0,
    _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
    _URC_FATAL_PHASE2_ERROR = 2,
    _URC_FATAL_PHASE1_ERROR = 3,
    _URC_NORMAL_STOP = 4,
    _URC_END_OF_STACK = 5,
    _URC_HANDLER_FOUND = 6,
    _URC_INSTALL_CONTEXT = 7,
    _URC_CONTINUE_UNWIND = 8
  }
_Unwind_Reason_Code;

typedef int _Unwind_Action;






struct _Unwind_Context;
struct _Unwind_Exception;

typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
           struct _Unwind_Exception *);

typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
      __int64_t,
      struct _Unwind_Exception *,
      struct _Unwind_Context *,
      void *);






struct _Unwind_Exception
  {
    __int64_t exception_class;
    _Unwind_Exception_Cleanup_Fn exception_cleanup;
    unsigned long private_1;
    unsigned long private_2;
  };

extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
       _Unwind_Stop_Fn, void *);
extern void _Unwind_Resume (struct _Unwind_Exception *);
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);





typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
       void *);
# 118 "/usr/src/include/unwind.h"
extern _Unwind_Reason_Code
   _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);



extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);



extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);


extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);


extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);







extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);







extern void *_Unwind_FindEnclosingFunction (void *);
# 84 "/usr/src/lib/libthr/thread/thr_private.h" 2


typedef struct pthreadlist { struct pthread *tqh_first; struct pthread **tqh_last; } pthreadlist;
typedef struct atfork_head { struct pthread_atfork *tqh_first; struct pthread_atfork **tqh_last; } atfork_head;
struct mutex_queue { struct pthread_mutex *tqh_first; struct pthread_mutex **tqh_last; };
# 166 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread_mutex {



 struct umutex m_lock;
 int m_flags;
 int m_count;
 int m_spinloops;
 int m_yieldloops;
 int m_ps;




 struct { struct pthread_mutex *tqe_next; struct pthread_mutex **tqe_prev; } m_qe;

 struct { struct pthread_mutex *tqe_next; struct pthread_mutex **tqe_prev; } m_pqe;
 struct pthread_mutex *m_rb_prev;
};

struct pthread_mutex_attr {
 enum pthread_mutextype m_type;
 int m_protocol;
 int m_ceiling;
 int m_pshared;
 int m_robust;
};





struct pthread_cond {
 __uint32_t __has_user_waiters;
 struct ucond kcond;
};

struct pthread_cond_attr {
 int c_pshared;
 int c_clockid;
};

struct pthread_barrier {
 struct umutex b_lock;
 struct ucond b_cv;
 int64_t b_cycle;
 int b_count;
 int b_waiters;
 int b_refcount;
 int b_destroying;
};

struct pthread_barrierattr {
 int pshared;
};

struct pthread_spinlock {
 struct umutex s_lock;
};
# 236 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread_cleanup {
 struct pthread_cleanup *prev;
 void (*routine)(void *);
 void *routine_arg;
 int onheap;
};
# 258 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread_atfork {
 struct { struct pthread_atfork *tqe_next; struct pthread_atfork **tqe_prev; } qe;
 void (*prepare)(void);
 void (*parent)(void);
 void (*child)(void);
};

struct pthread_attr {

 int sched_policy;
 int sched_inherit;
 int prio;
 int suspend;

 int flags;
 void *stackaddr_attr;
 size_t stacksize_attr;
 size_t guardsize_attr;

 cpuset_t *cpuset;
 size_t cpusetsize;
};

struct wake_addr {
 struct wake_addr *link;
 unsigned int value;
 char pad[12];
};

struct sleepqueue {
 struct { struct pthread *tqh_first; struct pthread **tqh_last; } sq_blocked;
 struct { struct sleepqueue *slh_first; } sq_freeq;
 struct { struct sleepqueue *le_next; struct sleepqueue **le_prev; } sq_hash;
 struct { struct sleepqueue *sle_next; } sq_flink;
 void *sq_wchan;
 int sq_type;
};
# 330 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread_prio {
 int pri_min;
 int pri_max;
 int pri_default;
};

struct pthread_rwlockattr {
 int pshared;
};

struct pthread_rwlock {
 struct urwlock lock;
 uint32_t owner;
};




enum pthread_state {
 PS_RUNNING,
 PS_DEAD
};

struct pthread_specific_elem {
 const void *data;
 int seqno;
};

struct pthread_key {
 volatile int allocated;
 int seqno;
 void (*destructor)(void *);
};
# 373 "/usr/src/lib/libthr/thread/thr_private.h"
struct pthread {


 long tid;





 struct umutex lock;


 uint32_t cycle;


 int locklevel;





 int critical_count;


 int sigblock;


 struct { struct pthread *tqe_next; struct pthread **tqe_prev; } tle;


 struct { struct pthread *tqe_next; struct pthread **tqe_prev; } gcle;


 struct { struct pthread *le_next; struct pthread **le_prev; } hle;


 struct { struct pthread *tqe_next; struct pthread **tqe_prev; } wle;


 int refcount;





 void *(*start_routine)(void *);
 void *arg;
 struct pthread_attr attr;






 int cancel_enable;


 int cancel_pending;


 int cancel_point;


 int no_cancel;


 int cancel_async;


 int cancelling;


 sigset_t sigmask;


 int unblock_sigcancel;


 int in_sigsuspend;


 siginfo_t deferred_siginfo;


 sigset_t deferred_sigmask;


 struct sigaction deferred_sigact;


 int deferred_run;


 int force_exit;


 enum pthread_state state;





 int error;





 struct pthread *joiner;


 int flags;






 int tlflags;
# 507 "/usr/src/lib/libthr/thread/thr_private.h"
 struct mutex_queue mq[6];

 void *ret;
 struct pthread_specific_elem *specific;
 int specific_data_count;


 int rdlock_count;



 int rtld_bits;


 struct tcb *tcb;


 struct pthread_cleanup *cleanup;


 struct _Unwind_Exception ex;
 void *unwind_stackend;
 int unwind_disabled;







 u_int32_t magic;


 int report_events;


 int event_mask;


 td_event_msg_t event_buf;


 void *wchan;


 struct pthread_mutex *mutex_obj;


 int will_sleep;


 int nwaiter_defer;

 int robust_inited;
 uintptr_t robust_list;
 uintptr_t priv_robust_list;
 uintptr_t inact_mtx;


 unsigned int *defer_waiters[50];


 struct wake_addr *wake_addr;



 struct sleepqueue *sleepqueue;


 char *name;
};
# 720 "/usr/src/lib/libthr/thread/thr_private.h"
extern char *_usrstack __attribute__((__visibility__("hidden")));


extern int _libthr_debug;
extern int _thread_event_mask;
extern struct pthread *_thread_last_event;

extern struct pthread_key _thread_keytable[];


extern pthreadlist _thread_list;


extern pthreadlist _thread_gc_list __attribute__((__visibility__("hidden")));

extern int _thread_active_threads;
extern atfork_head _thr_atfork_list __attribute__((__visibility__("hidden")));
extern struct urwlock _thr_atfork_lock __attribute__((__visibility__("hidden")));


extern struct pthread_attr _pthread_attr_default __attribute__((__visibility__("hidden")));


extern struct pthread_mutex_attr _pthread_mutexattr_default __attribute__((__visibility__("hidden")));
extern struct pthread_mutex_attr _pthread_mutexattr_adaptive_default __attribute__((__visibility__("hidden")));


extern struct pthread_cond_attr _pthread_condattr_default __attribute__((__visibility__("hidden")));

extern struct pthread_prio _thr_priorities[] __attribute__((__visibility__("hidden")));

extern int _thr_is_smp __attribute__((__visibility__("hidden")));

extern size_t _thr_guard_default __attribute__((__visibility__("hidden")));
extern size_t _thr_stack_default __attribute__((__visibility__("hidden")));
extern size_t _thr_stack_initial __attribute__((__visibility__("hidden")));
extern int _thr_page_size __attribute__((__visibility__("hidden")));
extern int _thr_spinloops __attribute__((__visibility__("hidden")));
extern int _thr_yieldloops __attribute__((__visibility__("hidden")));
extern int _thr_queuefifo __attribute__((__visibility__("hidden")));


extern int _gc_count __attribute__((__visibility__("hidden")));

extern struct umutex _mutex_static_lock __attribute__((__visibility__("hidden")));
extern struct umutex _cond_static_lock __attribute__((__visibility__("hidden")));
extern struct umutex _rwlock_static_lock __attribute__((__visibility__("hidden")));
extern struct umutex _keytable_lock __attribute__((__visibility__("hidden")));
extern struct urwlock _thr_list_lock __attribute__((__visibility__("hidden")));
extern struct umutex _thr_event_lock __attribute__((__visibility__("hidden")));
extern struct umutex _suspend_all_lock __attribute__((__visibility__("hidden")));
extern int _suspend_all_waiters __attribute__((__visibility__("hidden")));
extern int _suspend_all_cycle __attribute__((__visibility__("hidden")));
extern struct pthread *_single_thread __attribute__((__visibility__("hidden")));





void _thr_setthreaded(int) __attribute__((__visibility__("hidden")));
int _mutex_cv_lock(struct pthread_mutex *, int, _Bool) __attribute__((__visibility__("hidden")));
int _mutex_cv_unlock(struct pthread_mutex *, int *, int *) __attribute__((__visibility__("hidden")));
int _mutex_cv_attach(struct pthread_mutex *, int) __attribute__((__visibility__("hidden")));
int _mutex_cv_detach(struct pthread_mutex *, int *) __attribute__((__visibility__("hidden")));
int _mutex_owned(struct pthread *, const struct pthread_mutex *) __attribute__((__visibility__("hidden")));
int _mutex_reinit(pthread_mutex_t *) __attribute__((__visibility__("hidden")));
void _mutex_fork(struct pthread *curthread) __attribute__((__visibility__("hidden")));
int _mutex_enter_robust(struct pthread *curthread, struct pthread_mutex *m)
     __attribute__((__visibility__("hidden")));
void _mutex_leave_robust(struct pthread *curthread, struct pthread_mutex *m)
     __attribute__((__visibility__("hidden")));
void _libpthread_init(struct pthread *) __attribute__((__visibility__("hidden")));
struct pthread *_thr_alloc(struct pthread *) __attribute__((__visibility__("hidden")));
void _thread_exit(const char *, int, const char *) __attribute__((__visibility__("hidden"))) __attribute__((__noreturn__));
void _thread_exitf(const char *, int, const char *, ...) __attribute__((__visibility__("hidden"))) __attribute__((__noreturn__))
     __attribute__((__format__ (__printf__, 3, 4)));
int _thr_ref_add(struct pthread *, struct pthread *, int) __attribute__((__visibility__("hidden")));
void _thr_ref_delete(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_ref_delete_unlocked(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
int _thr_find_thread(struct pthread *, struct pthread *, int) __attribute__((__visibility__("hidden")));
void _thr_rtld_init(void) __attribute__((__visibility__("hidden")));
void _thr_rtld_postfork_child(void) __attribute__((__visibility__("hidden")));
int _thr_stack_alloc(struct pthread_attr *) __attribute__((__visibility__("hidden")));
void _thr_stack_free(struct pthread_attr *) __attribute__((__visibility__("hidden")));
void _thr_free(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_gc(struct pthread *) __attribute__((__visibility__("hidden")));
void _thread_cleanupspecific(void) __attribute__((__visibility__("hidden")));
void _thread_printf(int, const char *, ...) __attribute__((__visibility__("hidden"))) __attribute__((__format__ (__printf__, 2, 3)));
void _thread_vprintf(int, const char *, va_list) __attribute__((__visibility__("hidden")));
void _thr_spinlock_init(void) __attribute__((__visibility__("hidden")));
void _thr_cancel_enter(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_cancel_enter2(struct pthread *, int) __attribute__((__visibility__("hidden")));
void _thr_cancel_leave(struct pthread *, int) __attribute__((__visibility__("hidden")));
void _thr_testcancel(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_signal_block(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_signal_unblock(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_signal_init(int) __attribute__((__visibility__("hidden")));
void _thr_signal_deinit(void) __attribute__((__visibility__("hidden")));
int _thr_send_sig(struct pthread *, int sig) __attribute__((__visibility__("hidden")));
void _thr_list_init(void) __attribute__((__visibility__("hidden")));
void _thr_hash_add(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_hash_remove(struct pthread *) __attribute__((__visibility__("hidden")));
struct pthread *_thr_hash_find(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_link(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_unlink(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_assert_lock_level(void) __attribute__((__visibility__("hidden"))) __attribute__((__noreturn__));
void _thr_ast(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_report_creation(struct pthread *curthread,
     struct pthread *newthread) __attribute__((__visibility__("hidden")));
void _thr_report_death(struct pthread *curthread) __attribute__((__visibility__("hidden")));
int _thr_getscheduler(lwpid_t, int *, struct sched_param *) __attribute__((__visibility__("hidden")));
int _thr_setscheduler(lwpid_t, int, const struct sched_param *) __attribute__((__visibility__("hidden")));
void _thr_signal_prefork(void) __attribute__((__visibility__("hidden")));
void _thr_signal_postfork(void) __attribute__((__visibility__("hidden")));
void _thr_signal_postfork_child(void) __attribute__((__visibility__("hidden")));
void _thr_suspend_all_lock(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_suspend_all_unlock(struct pthread *) __attribute__((__visibility__("hidden")));
void _thr_try_gc(struct pthread *, struct pthread *) __attribute__((__visibility__("hidden")));
int _rtp_to_schedparam(const struct rtprio *rtp, int *policy,
  struct sched_param *param) __attribute__((__visibility__("hidden")));
int _schedparam_to_rtp(int policy, const struct sched_param *param,
  struct rtprio *rtp) __attribute__((__visibility__("hidden")));
void _thread_bp_create(void);
void _thread_bp_death(void);
int _sched_yield(void);

void _pthread_cleanup_push(void (*)(void *), void *);
void _pthread_cleanup_pop(int);
void _pthread_exit_mask(void *status, sigset_t *mask) __attribute__((__noreturn__)) __attribute__((__visibility__("hidden")));

void _pthread_cancel_enter(int maycancel);
void _pthread_cancel_leave(int maycancel);

int _pthread_mutex_consistent(pthread_mutex_t * _Nonnull);
int _pthread_mutexattr_getrobust(pthread_mutexattr_t * _Nonnull restrict,
     int * _Nonnull restrict);
int _pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, int);
# 869 "/usr/src/lib/libthr/thread/thr_private.h"
int __sys_sigaction(int, const struct sigaction *, struct sigaction *);
int __sys_sigprocmask(int, const sigset_t *, sigset_t *);
int __sys_sigsuspend(const sigset_t *);
int __sys_sigtimedwait(const sigset_t *, siginfo_t *,
  const struct timespec *);
int __sys_sigwait(const sigset_t *, int *);
int __sys_sigwaitinfo(const sigset_t *set, siginfo_t *info);






int __sys_clock_nanosleep(clockid_t, int, const struct timespec *,
     struct timespec *);
int __sys_nanosleep(const struct timespec *, struct timespec *);






int __sys_setcontext(const ucontext_t *ucp);
int __sys_swapcontext(ucontext_t *oucp, const ucontext_t *ucp);






int __sys_close(int);
int __sys_fork(void);
ssize_t __sys_read(int, void *, size_t);



static inline int
_thr_isthreaded(void)
{
 return (__isthreaded != 0);
}

static inline int
_thr_is_inited(void)
{
 return (_thr_initial != ((void *)0));
}

static inline void
_thr_check_init(void)
{
 if (_thr_initial == ((void *)0))
  _libpthread_init(((void *)0));
}

struct wake_addr *_thr_alloc_wake_addr(void);
void _thr_release_wake_addr(struct wake_addr *);
int _thr_sleep(struct pthread *, int, const struct timespec *);

void _thr_wake_addr_init(void) __attribute__((__visibility__("hidden")));

static inline void
_thr_clear_wake(struct pthread *td)
{
 td->wake_addr->value = 0;
}

static inline int
_thr_is_woken(struct pthread *td)
{
 return td->wake_addr->value != 0;
}

static inline void
_thr_set_wake(unsigned int *waddr)
{
 *waddr = 1;
 _thr_umtx_wake(waddr, 0x7fffffff, 0);
}

void _thr_wake_all(unsigned int *waddrs[], int) __attribute__((__visibility__("hidden")));

static inline struct pthread *
_sleepq_first(struct sleepqueue *sq)
{
 return ((&sq->sq_blocked)->tqh_first);
}

void _sleepq_init(void) __attribute__((__visibility__("hidden")));
struct sleepqueue *_sleepq_alloc(void) __attribute__((__visibility__("hidden")));
void _sleepq_free(struct sleepqueue *) __attribute__((__visibility__("hidden")));
void _sleepq_lock(void *) __attribute__((__visibility__("hidden")));
void _sleepq_unlock(void *) __attribute__((__visibility__("hidden")));
struct sleepqueue *_sleepq_lookup(void *) __attribute__((__visibility__("hidden")));
void _sleepq_add(void *, struct pthread *) __attribute__((__visibility__("hidden")));
int _sleepq_remove(struct sleepqueue *, struct pthread *) __attribute__((__visibility__("hidden")));
void _sleepq_drop(struct sleepqueue *,
  void (*cb)(struct pthread *, void *arg), void *) __attribute__((__visibility__("hidden")));

int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
     void *(calloc_cb)(size_t, size_t));

struct dl_phdr_info;
void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info);
void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __attribute__((__visibility__("hidden")));
void _thr_sigact_unload(struct dl_phdr_info *phdr_info) __attribute__((__visibility__("hidden")));
void _thr_stack_fix_protection(struct pthread *thrd);
void __pthread_distribute_static_tls(size_t offset, void *src, size_t len,
    size_t total_len);

int *__error_threaded(void) __attribute__((__visibility__("hidden")));
void __thr_interpose_libc(void) __attribute__((__visibility__("hidden")));
pid_t __thr_fork(void);
int __thr_setcontext(const ucontext_t *ucp);
int __thr_sigaction(int sig, const struct sigaction *act,
    struct sigaction *oact) __attribute__((__visibility__("hidden")));
int __thr_sigprocmask(int how, const sigset_t *set, sigset_t *oset);
int __thr_sigsuspend(const sigset_t * set);
int __thr_sigtimedwait(const sigset_t *set, siginfo_t *info,
    const struct timespec * timeout);
int __thr_sigwait(const sigset_t *set, int *sig);
int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info);
int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp);

void __thr_map_stacks_exec(void);

struct _spinlock;
void __thr_spinunlock(struct _spinlock *lck);
void __thr_spinlock(struct _spinlock *lck);

struct tcb *_tcb_ctor(struct pthread *, int);
void _tcb_dtor(struct tcb *);

void __thr_pshared_init(void) __attribute__((__visibility__("hidden")));
void *__thr_pshared_offpage(void *key, int doalloc) __attribute__((__visibility__("hidden")));
void __thr_pshared_destroy(void *key) __attribute__((__visibility__("hidden")));
void __thr_pshared_atfork_pre(void) __attribute__((__visibility__("hidden")));
void __thr_pshared_atfork_post(void) __attribute__((__visibility__("hidden")));

void *__thr_calloc(size_t num, size_t size);
void __thr_free(void *cp);
void *__thr_malloc(size_t nbytes);
void *__thr_realloc(void *cp, size_t nbytes);
void __thr_malloc_init(void);
void __thr_malloc_prefork(struct pthread *curthread);
void __thr_malloc_postfork(struct pthread *curthread);

int _thr_join(pthread_t, void **);
int _Tthr_kill(pthread_t, int);
int _thr_getthreadid_np(void);
void __thr_cleanup_push_imp(void (*)(void *), void *,
    struct _pthread_cleanup_info *);
void __thr_cleanup_pop_imp(int);
void _thr_cleanup_push(void (*)(void *), void *);
void _thr_cleanup_pop(int);
void _Tthr_testcancel(void);
void _Tthr_cancel_enter(int);
void _Tthr_cancel_leave(int);
int _thr_cancel(pthread_t);
int _thr_atfork(void (*)(void), void (*)(void), void (*)(void));
int _thr_attr_destroy(pthread_attr_t *);
int _thr_attr_get_np(pthread_t, pthread_attr_t *);
int _thr_attr_getdetachstate(const pthread_attr_t *, int *);
int _thr_attr_getguardsize(const pthread_attr_t * restrict,
    size_t * restrict);
int _thr_attr_getinheritsched(const pthread_attr_t * restrict,
    int * restrict);
int _thr_attr_getschedparam(const pthread_attr_t * restrict,
    struct sched_param * restrict);
int _thr_attr_getschedpolicy(const pthread_attr_t * restrict,
    int * restrict);
int _thr_attr_getscope(const pthread_attr_t * restrict, int * restrict);
int _thr_attr_getstackaddr(const pthread_attr_t *, void **);
int _thr_attr_getstacksize(const pthread_attr_t * restrict,
    size_t * restrict);
int _thr_attr_init(pthread_attr_t *);
int _thr_attr_setdetachstate(pthread_attr_t *, int);
int _thr_attr_setguardsize(pthread_attr_t *, size_t);
int _thr_attr_setinheritsched(pthread_attr_t *, int);
int _thr_attr_setschedparam(pthread_attr_t * restrict,
    const struct sched_param * restrict);
int _thr_attr_setschedpolicy(pthread_attr_t *, int);
int _thr_attr_setscope(pthread_attr_t *, int);
int _thr_attr_setstackaddr(pthread_attr_t *, void *);
int _thr_attr_setstacksize(pthread_attr_t *, size_t);
int _thr_cond_init(pthread_cond_t * restrict,
    const pthread_condattr_t * restrict);
int _thr_cond_destroy(pthread_cond_t *);
int _thr_cond_timedwait(pthread_cond_t * restrict,
    pthread_mutex_t * restrict, const struct timespec * restrict);
int _thr_cond_signal(pthread_cond_t * cond);
int _thr_cond_broadcast(pthread_cond_t * cond);
int __thr_cond_wait(pthread_cond_t *, pthread_mutex_t *);
int _thr_cond_wait(pthread_cond_t *, pthread_mutex_t *);
int _thr_detach(pthread_t);
int _thr_equal(pthread_t, pthread_t);
void _Tthr_exit(void *);
int _thr_key_create(pthread_key_t *, void (*)(void *));
int _thr_key_delete(pthread_key_t);
int _thr_setspecific(pthread_key_t, const void *);
void *_thr_getspecific(pthread_key_t);
int _thr_setcancelstate(int, int *);
int _thr_setcanceltype(int, int *);
pthread_t _Tthr_self(void);
int _thr_rwlock_init(pthread_rwlock_t *, const pthread_rwlockattr_t *);
int _thr_rwlock_destroy(pthread_rwlock_t *);
int _Tthr_rwlock_rdlock(pthread_rwlock_t *);
int _Tthr_rwlock_tryrdlock(pthread_rwlock_t *);
int _Tthr_rwlock_trywrlock(pthread_rwlock_t *);
int _Tthr_rwlock_wrlock(pthread_rwlock_t *);
int _Tthr_rwlock_unlock(pthread_rwlock_t *);
int _thr_once(pthread_once_t *, void (*)(void));
int _thr_sigmask(int, const sigset_t *, sigset_t *);
int _thr_main_np(void);
int _thr_mutexattr_init(pthread_mutexattr_t *);
int _thr_mutexattr_destroy(pthread_mutexattr_t *);
int _thr_mutexattr_settype(pthread_mutexattr_t *, int);
int _thr_mutexattr_getrobust(pthread_mutexattr_t *, int *);
int _thr_mutexattr_setrobust(pthread_mutexattr_t *, int);
int __Tthr_mutex_init(pthread_mutex_t * restrict,
    const pthread_mutexattr_t * restrict);
int _Tthr_mutex_consistent(pthread_mutex_t *);
int _thr_mutex_destroy(pthread_mutex_t *);
int _thr_mutex_unlock(pthread_mutex_t *);
int __Tthr_mutex_lock(pthread_mutex_t *);
int __Tthr_mutex_trylock(pthread_mutex_t *);


#pragma clang diagnostic pop
# 45 "/usr/src/lib/libthr/thread/thr_setschedparam.c" 2

__asm__(".weak " "pthread_setschedparam"); __asm__(".equ " "pthread_setschedparam" ", " "_pthread_setschedparam");





int
_pthread_setschedparam(pthread_t pthread, int policy,
 const struct sched_param *param)
{
 struct pthread *curthread = _get_curthread();
 int ret;

 if (pthread == curthread)
  do { (curthread)->locklevel++; _thr_umutex_lock(&(curthread)->lock, ((uint32_t) ((curthread)->tid))); } while (0);
 else if ((ret = _thr_find_thread(curthread, pthread,
                   0)) != 0)
  return (ret);
 if (pthread->attr.sched_policy == policy &&
     (policy == 2 ||
      pthread->attr.prio == param->sched_priority)) {
  pthread->attr.prio = param->sched_priority;
  do { do { if (__builtin_expect(((curthread)->locklevel <= 0), 0)) _thr_assert_lock_level(); } while (0); _thr_umutex_unlock((&(pthread)->lock), ((uint32_t) ((curthread)->tid))); (curthread)->locklevel--; _thr_ast(curthread); } while (0);
  return (0);
 }
 ret = _thr_setscheduler(pthread->tid, policy, param);
 if (ret == -1)
  ret = (* __error());
 else {
  pthread->attr.sched_policy = policy;
  pthread->attr.prio = param->sched_priority;
 }
 do { do { if (__builtin_expect(((curthread)->locklevel <= 0), 0)) _thr_assert_lock_level(); } while (0); _thr_umutex_unlock((&(pthread)->lock), ((uint32_t) ((curthread)->tid))); (curthread)->locklevel--; _thr_ast(curthread); } while (0);
 return (ret);
}
