# 1 "combine.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "combine.c"
# 1 "combine.h" 1
# 14 "combine.h"
typedef int data_t;
# 41 "combine.h"
# 1 "vec.h" 1
# 1 "/usr/include/stdlib.h" 1 3 4
# 25 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 329 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 313 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 314 "/usr/include/sys/cdefs.h" 2 3 4
# 330 "/usr/include/features.h" 2 3 4
# 352 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4



# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4


# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
# 8 "/usr/include/gnu/stubs.h" 2 3 4
# 353 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 1 3 4
# 214 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 3 4
typedef unsigned int size_t;
# 326 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 3 4
typedef long int wchar_t;
# 34 "/usr/include/stdlib.h" 2 3 4


# 96 "/usr/include/stdlib.h" 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;



# 140 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;




extern double atof (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;





__extension__ extern long long int atoll (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;





extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

# 182 "/usr/include/stdlib.h" 3 4


extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




__extension__
extern long long int strtoq (__const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;





__extension__
extern long long int strtoll (__const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

# 279 "/usr/include/stdlib.h" 3 4
extern double __strtod_internal (__const char *__restrict __nptr,
     char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
extern float __strtof_internal (__const char *__restrict __nptr,
    char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
extern long double __strtold_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern long int __strtol_internal (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;



extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
      char **__restrict __endptr,
      int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;



__extension__
extern unsigned long long int __strtoull_internal (__const char *
         __restrict __nptr,
         char **__restrict __endptr,
         int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;








extern __inline double
__attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr)
{
  return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
__attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
__attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoul_internal (__nptr, __endptr, __base, 0);
}

# 364 "/usr/include/stdlib.h" 3 4
__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




extern __inline double
__attribute__ ((__nothrow__)) atof (__const char *__nptr)
{
  return strtod (__nptr, (char **) ((void *)0));
}
extern __inline int
__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
{
  return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline long int
__attribute__ ((__nothrow__)) atol (__const char *__nptr)
{
  return strtol (__nptr, (char **) ((void *)0), 10);
}




__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) atoll (__const char *__nptr)
{
  return strtoll (__nptr, (char **) ((void *)0), 10);
}

# 429 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;


extern long int a64l (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/sys/types.h" 1 3 4
# 29 "/usr/include/sys/types.h" 3 4


# 1 "/usr/include/bits/types.h" 1 3 4
# 28 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4


# 1 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 1 3 4
# 32 "/usr/include/bits/types.h" 2 3 4


typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;




__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;







__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
# 134 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 135 "/usr/include/bits/types.h" 2 3 4


__extension__ typedef __u_quad_t __dev_t;
__extension__ typedef unsigned int __uid_t;
__extension__ typedef unsigned int __gid_t;
__extension__ typedef unsigned long int __ino_t;
__extension__ typedef __u_quad_t __ino64_t;
__extension__ typedef unsigned int __mode_t;
__extension__ typedef unsigned int __nlink_t;
__extension__ typedef long int __off_t;
__extension__ typedef __quad_t __off64_t;
__extension__ typedef int __pid_t;
__extension__ typedef struct { int __val[2]; } __fsid_t;
__extension__ typedef long int __clock_t;
__extension__ typedef unsigned long int __rlim_t;
__extension__ typedef __u_quad_t __rlim64_t;
__extension__ typedef unsigned int __id_t;
__extension__ typedef long int __time_t;
__extension__ typedef unsigned int __useconds_t;
__extension__ typedef long int __suseconds_t;

__extension__ typedef int __daddr_t;
__extension__ typedef long int __swblk_t;
__extension__ typedef int __key_t;


__extension__ typedef int __clockid_t;


__extension__ typedef void * __timer_t;


__extension__ typedef long int __blksize_t;




__extension__ typedef long int __blkcnt_t;
__extension__ typedef __quad_t __blkcnt64_t;


__extension__ typedef unsigned long int __fsblkcnt_t;
__extension__ typedef __u_quad_t __fsblkcnt64_t;


__extension__ typedef unsigned long int __fsfilcnt_t;
__extension__ typedef __u_quad_t __fsfilcnt64_t;

__extension__ typedef int __ssize_t;



typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


__extension__ typedef int __intptr_t;


__extension__ typedef unsigned int __socklen_t;
# 32 "/usr/include/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;




typedef __loff_t loff_t;



typedef __ino_t ino_t;
# 62 "/usr/include/sys/types.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;





typedef __off_t off_t;
# 100 "/usr/include/sys/types.h" 3 4
typedef __pid_t pid_t;




typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;
# 133 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/time.h" 1 3 4
# 75 "/usr/include/time.h" 3 4


typedef __time_t time_t;



# 93 "/usr/include/time.h" 3 4
typedef __clockid_t clockid_t;
# 105 "/usr/include/time.h" 3 4
typedef __timer_t timer_t;
# 134 "/usr/include/sys/types.h" 2 3 4
# 147 "/usr/include/sys/types.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 1 3 4
# 148 "/usr/include/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 195 "/usr/include/sys/types.h" 3 4
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef int int64_t __attribute__ ((__mode__ (__DI__)));


typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));

typedef int register_t __attribute__ ((__mode__ (__word__)));
# 217 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/endian.h" 1 3 4
# 38 "/usr/include/endian.h" 2 3 4
# 218 "/usr/include/sys/types.h" 2 3 4


# 1 "/usr/include/sys/select.h" 1 3 4
# 31 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/bits/select.h" 1 3 4
# 32 "/usr/include/sys/select.h" 2 3 4


# 1 "/usr/include/bits/sigset.h" 1 3 4
# 23 "/usr/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 35 "/usr/include/sys/select.h" 2 3 4



typedef __sigset_t sigset_t;





# 1 "/usr/include/time.h" 1 3 4
# 121 "/usr/include/time.h" 3 4
struct timespec
  {
    __time_t tv_sec;
    long int tv_nsec;
  };
# 45 "/usr/include/sys/select.h" 2 3 4

# 1 "/usr/include/bits/time.h" 1 3 4
# 69 "/usr/include/bits/time.h" 3 4
struct timeval
  {
    __time_t tv_sec;
    __suseconds_t tv_usec;
  };
# 47 "/usr/include/sys/select.h" 2 3 4


typedef __suseconds_t suseconds_t;





typedef long int __fd_mask;
# 67 "/usr/include/sys/select.h" 3 4
typedef struct
  {






    __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];


  } fd_set;






typedef __fd_mask fd_mask;
# 99 "/usr/include/sys/select.h" 3 4

# 109 "/usr/include/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 121 "/usr/include/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);



# 221 "/usr/include/sys/types.h" 2 3 4


# 1 "/usr/include/sys/sysmacros.h" 1 3 4
# 29 "/usr/include/sys/sysmacros.h" 3 4
__extension__
extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
       unsigned int __minor)
     __attribute__ ((__nothrow__));


__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}

__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long int) (__minor & ~0xff)) << 12)
   | (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# 224 "/usr/include/sys/types.h" 2 3 4
# 235 "/usr/include/sys/types.h" 3 4
typedef __blkcnt_t blkcnt_t;



typedef __fsblkcnt_t fsblkcnt_t;



typedef __fsfilcnt_t fsfilcnt_t;
# 270 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 36 "/usr/include/bits/pthreadtypes.h" 3 4
typedef unsigned long int pthread_t;


typedef union
{
  char __size[36];
  long int __align;
} pthread_attr_t;


typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;




typedef union
{
  struct __pthread_mutex_s
  {
    int __lock;
    unsigned int __count;
    int __owner;


    int __kind;
    unsigned int __nusers;
    __extension__ union
    {
      int __spins;
      __pthread_slist_t __list;
    };
  } __data;
  char __size[24];
  long int __align;
} pthread_mutex_t;

typedef union
{
  char __size[4];
  long int __align;
} pthread_mutexattr_t;




typedef union
{
  struct
  {
    int __lock;
    unsigned int __futex;
    __extension__ unsigned long long int __total_seq;
    __extension__ unsigned long long int __wakeup_seq;
    __extension__ unsigned long long int __woken_seq;
    void *__mutex;
    unsigned int __nwaiters;
    unsigned int __broadcast_seq;
  } __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;

typedef union
{
  char __size[4];
  long int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;





typedef union
{
  struct
  {
    int __lock;
    unsigned int __nr_readers;
    unsigned int __readers_wakeup;
    unsigned int __writer_wakeup;
    unsigned int __nr_readers_queued;
    unsigned int __nr_writers_queued;


    unsigned char __flags;
    unsigned char __shared;
    unsigned char __pad1;
    unsigned char __pad2;
    int __writer;
  } __data;
  char __size[32];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[20];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 271 "/usr/include/sys/types.h" 2 3 4



# 439 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));






extern int rand (void) __attribute__ ((__nothrow__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));




extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));







extern double drand48 (void) __attribute__ ((__nothrow__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    unsigned long long int __a;
  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));









extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;







extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));

extern void free (void *__ptr) __attribute__ ((__nothrow__));




extern void cfree (void *__ptr) __attribute__ ((__nothrow__));



# 1 "/usr/include/alloca.h" 1 3 4
# 25 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h" 1 3 4
# 26 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__));






# 613 "/usr/include/stdlib.h" 2 3 4




extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));






extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));

# 658 "/usr/include/stdlib.h" 3 4


extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




extern char *__secure_getenv (__const char *__name)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;





extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (__const char *__name, __const char *__value, int __replace)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));






extern int clearenv (void) __attribute__ ((__nothrow__));
# 698 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
# 709 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 729 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;








extern int system (__const char *__command) ;

# 756 "/usr/include/stdlib.h" 3 4
extern char *realpath (__const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__)) ;






typedef int (*__compar_fn_t) (__const void *, __const void *);









extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));



extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;












extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;

# 821 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));







extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__));








extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
# 926 "/usr/include/stdlib.h" 3 4
extern int posix_openpt (int __oflag) ;
# 961 "/usr/include/stdlib.h" 3 4
extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 977 "/usr/include/stdlib.h" 3 4

# 2 "vec.h" 2



typedef struct {
    int len;
    data_t *data;

    int allocated_len;

} vec_rec, *vec_ptr;



static vec_ptr new_vec(int len);



static vec_ptr new_vec(int len)
{

    vec_ptr result = (vec_ptr) malloc(sizeof(vec_rec));
    if (!result)
        return ((void *)0);
    result->len = len;


    result->allocated_len = len;


    if (len > 0) {
        data_t *data = (data_t *)calloc(len, sizeof(data_t));
 if (!data) {
     free((void *) result);
      return ((void *)0);
 }
 result->data = data;
    }
    else
 result->data = ((void *)0);
    return result;
}






static int get_vec_element(vec_ptr v, int index, data_t *dest);

static data_t *get_vec_start(vec_ptr v);






static int set_vec_element(vec_ptr v, int index, data_t val);


static int vec_length(vec_ptr v);


static void set_vec_length(vec_ptr v, int newlen);





int get_vec_element(vec_ptr v, int index, data_t *dest)
{
    if (index < 0 || index >= v->len)
 return 0;
    *dest = v->data[index];
    return 1;
}


static int vec_length(vec_ptr v)
{
    return v->len;
}




static data_t *get_vec_start(vec_ptr v)
{
    return v->data;
}







static int set_vec_element(vec_ptr v, int index, data_t val)
{
    if (index < 0 || index >= v->len)
 return 0;
    v->data[index] = val;
    return 1;
}



static void set_vec_length(vec_ptr v, int newlen)
{
    if (newlen > v->allocated_len) {
 free(v->data);
 v->data = calloc(newlen, sizeof(data_t));
 v->allocated_len = newlen;
    }
    v->len = newlen;
}
# 42 "combine.h" 2



typedef void (*combiner)(vec_ptr, data_t *);


void add_combiner(combiner f, combiner fc, char *description);


void register_combiners(void);
# 2 "combine.c" 2



char combine1_descr[] = "combine1: Maximum use of data abstraction";


void combine1(vec_ptr v, data_t *dest)
{
    int i;

    *dest = 0;
    for (i = 0; i < vec_length(v); i++) {
 data_t val;
 get_vec_element(v, i, &val);

 *dest = *dest + val;

    }
}


char combine2_descr[] = "combine2: Take vec_length() out of loop";


void combine2(vec_ptr v, data_t *dest)
{
    int i;
    int length = vec_length(v);

    *dest = 0;
    for (i = 0; i < length; i++) {
 data_t val;
 get_vec_element(v, i, &val);
 *dest = *dest + val;
    }
}


char combine3_descr[] = "combine3: Array reference to vector data";


void combine3(vec_ptr v, data_t *dest)
{
    int i;
    int length = vec_length(v);
    data_t *data = get_vec_start(v);

    *dest = 0;
    for (i = 0; i < length; i++) {
 *dest = *dest + data[i];
    }
}


char combine4_descr[] = "combine4: Array reference, accumulate in temporary";


void combine4(vec_ptr v, data_t *dest)
{
    int i;
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t x = 0;

    for (i = 0; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}


char combine4p_descr[] = "combine4p: Pointer reference, accumulate in temporary";


void combine4p(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length;
    data_t x = 0;

    for (; data < dend; data++)
 x = x + *data;
    *dest = x;
}


char combine1l_descr[] = "combine1l: Maximum use of data abstraction, accumulate in temporary";


void combine1l(vec_ptr v, data_t *dest)
{
    int i;
    data_t x = 0;

    for (i = 0; i < vec_length(v); i++) {
 data_t val;
 get_vec_element(v, i, &val);
 x = x + val;
    }
    *dest = x;
}


char unroll2a_descr[] = "Array code, unrolled by 2";
void unroll2a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-1;
    data_t *data = get_vec_start(v);
    data_t x = 0;

    int i;


    for (i = 0; i < limit; i+=2) {
 x = x + data[i] + data[i+1];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char combine5_descr[] = "combine5: Array code, unrolled by 3";


void combine5(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-2;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=3) {
 x = x + data[i] + data[i+1] + data[i+2];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}


char combine5p_descr[] = "combine5p: Pointer code, unrolled by 3, for loop";


void combine5p(vec_ptr v, data_t *dest)
{
    data_t *data = get_vec_start(v);
    data_t *dend = data+vec_length(v);
    data_t *dlimit = dend-2;
    data_t x = 0;


    for (; data < dlimit; data += 3) {
 x = x + data[0] + data[1] + data[2];
    }


    for (; data < dend; data++) {
 x = x + data[0];
    }
    *dest = x;
}


char unroll3aw_descr[] = "Array code, unrolled by 3, while loop";
void unroll3aw_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-1;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i = 0;


    while (i < limit) {
 x = x + data[i];
 i+= 3;
 x = x + data[i-2] + data[i-1];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}


char unroll4a_descr[] = "Array code, unrolled by 4";
void unroll4a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-3;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=4) {
 x = x + data[i] + data[i+1];
 x = x + data[i+2] + data[i+3];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll8a_descr[] = "Array code, unrolled by 8";
void unroll8a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-7;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=8) {
 x = x + data[i] + data[i+1];
 x = x + data[i+2] + data[i+3];
 x = x + data[i+4] + data[i+5];
 x = x + data[i+6] + data[i+7];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll16a_descr[] = "Array code, unrolled by 16";
void unroll16a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-15;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=16) {
 x = x + data[i] + data[i+1];
 x = x + data[i+2] + data[i+3];
 x = x + data[i+4] + data[i+5];
 x = x + data[i+6] + data[i+7];
 x = x + data[i+8] + data[i+9];
 x = x + data[i+10] + data[i+11];
 x = x + data[i+12] + data[i+13];
 x = x + data[i+14] + data[i+15];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll2_descr[] = "Pointer code, unrolled by 2";
void unroll2_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    int over = length%2;
    data_t *dend = data+length-over;
    data_t x = 0;

    while (data < dend) {
 x = x + data[0];
 x = x + data[1];
 data += 2;
    }
    dend += over;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x;
}


char unroll3_descr[] = "Pointer code, unrolled by 3";
void unroll3_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-2;
    data_t x = 0;

    while (data < dend) {
 x = x + data[0];
 x = x + data[1];
 x = x + data[2];
 data += 3;
    }
    dend += 2;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x;
}


char unroll4_descr[] = "Pointer code, unrolled by 4";
void unroll4_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-3;
    data_t x = 0;

    while (data < dend) {
 x = x + data[0];
 x = x + data[1];
 x = x + data[2];
 x = x + data[3];
 data += 4;
    }
    dend += 3;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x;
}

char unroll8_descr[] = "Pointer code, unrolled by 8";
void unroll8_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    int over = length%8;
    data_t *dend = data+length-over;
    data_t x = 0;

    while (data < dend) {
 x = x + data[0];
 x = x + data[1];
 x = x + data[2];
 x = x + data[3];
 x = x + data[4];
 x = x + data[5];
 x = x + data[6];
 x = x + data[7];
 data += 8;
    }
    dend += over;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x;
}

char unroll16_descr[] = "Pointer code, unrolled by 16";
void unroll16_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    int over = length%16;
    data_t *dend = data+length-over;
    data_t x = 0;

    while (data < dend) {
 x = x + data[0];
 x = x + data[1];
 x = x + data[2];
 x = x + data[3];
 x = x + data[4];
 x = x + data[5];
 x = x + data[6];
 x = x + data[7];
 x = x + data[8];
 x = x + data[9];
 x = x + data[10];
 x = x + data[11];
 x = x + data[12];
 x = x + data[13];
 x = x + data[14];
 x = x + data[15];
 data += 16;
    }
    dend += over;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x;
}


char combine6_descr[] = "combine6: Array code, unrolled by 2, Superscalar x2";


void combine6(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-1;
    data_t *data = get_vec_start(v);
    data_t x0 = 0;
    data_t x1 = 0;
    int i;


    for (i = 0; i < limit; i+=2) {
 x0 = x0 + data[i];
 x1 = x1 + data[i+1];
    }


    for (; i < length; i++) {
 x0 = x0 + data[i];
    }
    *dest = x0 + x1;
}


char unroll4x2a_descr[] = "Array code, unrolled by 4, Superscalar x2";
void unroll4x2a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-3;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    data_t y = 0;
    int i;


    for (i = 0; i < limit; i+=4) {
 x = x + data[i]; y = y + data[i+1];
 x = x + data[i+2]; y = y + data[i+3];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x + y;
}


char unroll8x2a_descr[] = "Array code, unrolled by 8, Superscalar x2";
void unroll8x2a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-7;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    data_t y = 0;
    int i;


    for (i = 0; i < limit; i+=8) {
 x = x + data[i]; y = y + data[i+1];
 x = x + data[i+2]; y = y + data[i+3];
 x = x + data[i+4]; y = y + data[i+5];
 x = x + data[i+6]; y = y + data[i+7];
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x + y;
}

char unroll8x4a_descr[] = "Array code, unrolled by 8, Superscalar x4";
void unroll8x4a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-7;
    data_t *data = get_vec_start(v);
    data_t x0 = 0;
    data_t x1 = 0;
    data_t x2 = 0;
    data_t x3 = 0;
    int i;


    for (i = 0; i < limit; i+=8) {
 x0 = x0 + data[i]; x1 = x1 + data[i+1];
 x2 = x2 + data[i+2]; x3 = x3 + data[i+3];
 x0 = x0 + data[i+4]; x1 = x1 + data[i+5];
 x2 = x2 + data[i+6]; x3 = x3 + data[i+7];
    }


    for (; i < length; i++) {
 x0 = x0 + data[i];
    }
    *dest = x0 + x1 + x2 + x3;
}

char unroll12x6a_descr[] = "Array code, unrolled by 12, Superscalar x6";
void unroll12x6a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-11;
    data_t *data = get_vec_start(v);
    data_t x0 = 0;
    data_t x1 = 0;
    data_t x2 = 0;
    data_t x3 = 0;
    data_t x4 = 0;
    data_t x5 = 0;
    int i;


    for (i = 0; i < limit; i+=12) {
 x0 = x0 + data[i];
 x0 = x0 + data[i+6];
 x1 = x1 + data[i+1];
 x1 = x1 + data[i+7];
 x2 = x2 + data[i+2];
 x2 = x2 + data[i+8];
 x3 = x3 + data[i+3];
 x3 = x3 + data[i+9];
 x4 = x4 + data[i+4];
 x4 = x4 + data[i+10];
 x5 = x5 + data[i+5];
 x5 = x5 + data[i+11];
    }


    for (; i < length; i++) {
 x0 = x0 + data[i];
    }
    *dest = (x0 + x1) + (x2 + x3) + (x4 + x5);
}

char unroll8x8a_descr[] = "Array code, unrolled by 8, Superscalar x8";
void unroll8x8a_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-7;
    data_t *data = get_vec_start(v);
    data_t x0 = 0;
    data_t x1 = 0;
    data_t x2 = 0;
    data_t x3 = 0;
    data_t x4 = 0;
    data_t x5 = 0;
    data_t x6 = 0;
    data_t x7 = 0;
    int i;


    for (i = 0; i < limit; i+=8) {
 x0 = x0 + data[i]; x1 = x1 + data[i+1];
 x2 = x2 + data[i+2]; x3 = x3 + data[i+3];
 x4 = x4 + data[i+4]; x5 = x5 + data[i+5];
 x6 = x6 + data[i+6]; x7 = x7 + data[i+7];
    }


    for (; i < length; i++) {
 x0 = x0 + data[i];
    }
    *dest = x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7;
}

char unrollx2as_descr[] = "Array code, Unroll x2, Superscalar x2, noninterleaved";
void unrollx2as_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length/2;
    data_t *data = get_vec_start(v);
    data_t *data2 = data+limit;
    data_t x = 0;
    data_t y = 0;
    int i;


    for (i = 0; i < limit; i++) {
 x = x + data[i]; y = y + data2[i];
    }


    for (i = limit*2; i < length; i++) {
 y = y + data[i];
    }
    *dest = x + y;
}

char unroll4x2as_descr[] = "Array code, Unroll x4, Superscalar x2, noninterleaved";
void unroll4x2as_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length/2;
    data_t *data = get_vec_start(v);
    data_t *data2 = data+limit;
    data_t x = 0;
    data_t y = 0;
    int i;


    for (i = 0; i < limit; i++) {
 x = x + data[i]; y = y + data2[i];
    }


    for (i = limit*2; i < length; i++) {
 y = y + data[i];
    }
    *dest = x + y;
}



char unroll8x2_descr[] = "Pointer code, unrolled by 8, Superscalar x2";
void unroll8x2_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-7;
    data_t x = 0;
    data_t y = 0;

    while (data < dend) {
 x = x + data[0];
 y = y + data[1];
 x = x + data[2];
 y = y + data[3];
 x = x + data[4];
 y = y + data[5];
 x = x + data[6];
 y = y + data[7];
 data += 8;
    }
    dend += 7;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x + y;
}

char unroll9x3_descr[] = "Pointer code, unrolled by 9, Superscalar x3";
void unroll9x3_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-8;
    data_t x = 0;
    data_t y = 0;
    data_t z = 0;

    while (data < dend) {
 x = x + data[0];
 y = y + data[1];
 z = z + data[2];
 x = x + data[3];
 y = y + data[4];
 z = z + data[5];
 x = x + data[6];
 y = y + data[7];
 z = z + data[8];
 data += 9;
    }
    dend += 8;
    while (data < dend) {
 x = x + *data;
 data ++;
    }
    *dest = x + y + z;
}


char unroll8x4_descr[] = "Pointer code, unrolled by 8, Superscalar x4";
void unroll8x4_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-7;
    data_t w = 0;
    data_t x = 0;
    data_t y = 0;
    data_t z = 0;

    while (data < dend) {
 w = w + data[0];
 x = x + data[1];
 y = y + data[2];
 z = z + data[3];
 w = w + data[4];
 x = x + data[5];
 y = y + data[6];
 z = z + data[7];
 data += 8;
    }
    dend += 7;
    while (data < dend) {
 w = w + *data;
 data ++;
    }
    *dest = w + x + y + z;
}

char unroll8x8_descr[] = "Pointer code, unrolled by 8, Superscalar x8";
void unroll8x8_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    data_t *data = get_vec_start(v);
    data_t *dend = data+length-7;
    data_t a = 0;
    data_t b = 0;
    data_t c = 0;
    data_t d = 0;
    data_t w = 0;
    data_t x = 0;
    data_t y = 0;
    data_t z = 0;

    while (data < dend) {
 a = a + data[0];
 b = b + data[1];
 c = c + data[2];
 d = d + data[3];
 w = w + data[4];
 x = x + data[5];
 y = y + data[6];
 z = z + data[7];
 data += 8;
    }
    dend += 7;
    while (data < dend) {
 a = a + *data;
 data ++;
    }
    *dest = a + b + c + d + w + x + y + z;
}

char unroll2aa_descr[] = "Array code, unrolled by 2, Different associativity";

void unroll2aa_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-1;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=2) {
 x = x + (data[i] + data[i+1]);
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll3aa_descr[] = "Array code, unrolled by 3, Different Associativity";
void unroll3aa_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-2;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=3) {
 x = x + (data[i] + data[i+1] + data[i+2]);
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll4aa_descr[] = "Array code, unrolled by 4, Different Associativity";
void unroll4aa_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-3;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=4) {
 data_t t1 = data[i] + data[i+1];
 data_t t2 = data[i+2] + data[i+3];
 x = x + (t1 + t2);
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll6aa_descr[] = "Array code, unrolled by 6, Different Associativity";
void unroll6aa_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-5;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=6) {
 data_t t1 = data[i] + data[i+1];
 data_t t2 = data[i+2] + data[i+3];
 data_t t3 = data[i+4] + data[i+5];
 x = x + (t1 + t2 + t3);
    }


    for (; i < length; i++) {
 x = x + data[i];
    }
    *dest = x;
}

char unroll8aa_descr[] = "Array code, unrolled by 8, Different Associativity";
void unroll8aa_combine(vec_ptr v, data_t *dest)
{
    int length = vec_length(v);
    int limit = length-7;
    data_t *data = get_vec_start(v);
    data_t x = 0;
    int i;


    for (i = 0; i < limit; i+=8) {
 data_t t1 = data[i] + data[i+1];
 data_t t2 = data[i+2] + data[i+3];
 data_t u1 = t1 + t2;
 data_t t3 = data[i+4] + data[i+5];
 data_t t4 = data[i+6] + data[i+7];
 data_t u2 = t3 + t4;
 x = x + (u1 + u2);
    }


    for (; i < length; i++) {
 x = x + data[i];
    }

    *dest = x;
}


void register_combiners(void)
{
    add_combiner(combine1, combine1, combine1_descr);
    add_combiner(combine1l, combine1, combine1l_descr);
    add_combiner(combine2, combine1, combine2_descr);
    add_combiner(combine3, combine1, combine3_descr);
    add_combiner(combine4, combine1, combine4_descr);
    add_combiner(combine4p, combine1, combine4p_descr);
    add_combiner(unroll2a_combine, combine1, unroll2a_descr);
    add_combiner(combine5p, combine1, combine5p_descr);
    add_combiner(unroll3aw_combine, combine1, unroll3aw_descr);
    add_combiner(unroll4a_combine, combine1, unroll4a_descr);
    add_combiner(unroll8a_combine, combine1, unroll8a_descr);
    add_combiner(unroll16a_combine, combine1, unroll16a_descr);
    add_combiner(unroll2_combine, combine1, unroll2_descr);
    add_combiner(unroll3_combine, combine1, unroll3_descr);
    add_combiner(unroll4_combine, combine1, unroll4_descr);
    add_combiner(unroll8_combine, combine1, unroll8_descr);
    add_combiner(unroll16_combine, combine1, unroll16_descr);
    add_combiner(combine6, combine1, combine6_descr);
    add_combiner(unroll4x2a_combine, combine1, unroll4x2a_descr);
    add_combiner(unroll8x2a_combine, combine1, unroll8x2a_descr);
    add_combiner(unroll8x4a_combine, combine1, unroll8x4a_descr);
    add_combiner(unroll8x8a_combine, combine1, unroll8x8a_descr);
    add_combiner(unroll12x6a_combine, combine1, unroll12x6a_descr);
    add_combiner(unroll8x2_combine, combine1, unroll8x2_descr);
    add_combiner(unroll8x4_combine, combine1, unroll8x4_descr);
    add_combiner(unroll8x8_combine, combine1, unroll8x8_descr);
    add_combiner(unroll9x3_combine, combine1, unroll9x3_descr);
    add_combiner(unrollx2as_combine, combine1, unrollx2as_descr);
    add_combiner(unroll2aa_combine, combine1, unroll2aa_descr);
    add_combiner(unroll3aa_combine, combine1, unroll3aa_descr);
    add_combiner(unroll4aa_combine, combine1, unroll4aa_descr);
    add_combiner(unroll6aa_combine, combine1, unroll6aa_descr);
    add_combiner(unroll8aa_combine, combine1, unroll8aa_descr);
}
