Merge from vendor branch NTPD:
[dragonfly.git] / sys / net / i4b / driver / i4b_tel.c
1 /*
2  * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      i4b_tel.c - device driver for ISDN telephony
28  *      --------------------------------------------
29  *
30  * $FreeBSD: src/sys/i4b/driver/i4b_tel.c,v 1.10.2.4 2001/12/16 15:12:57 hm Exp $
31  * $DragonFly: src/sys/net/i4b/driver/i4b_tel.c,v 1.10 2005/01/23 13:47:24 joerg Exp $
32  *
33  *      last edit-date: [Sat Aug 11 18:07:05 2001]
34  *
35  *---------------------------------------------------------------------------*/
36
37 #include "use_i4btel.h"
38
39 #if NI4BTEL > 0
40
41 #undef I4BTELDEBUG
42
43 #include <sys/param.h>
44 #include <sys/systm.h>
45
46 #include <sys/ioccom.h>
47 #include <sys/poll.h>
48
49 #include <sys/conf.h>
50 #include <sys/uio.h>
51 #include <sys/kernel.h>
52 #include <sys/mbuf.h>
53 #include <sys/socket.h>
54 #include <net/if.h>
55 #include <sys/tty.h>
56
57 #ifdef DEVFS
58 #include <sys/devfsext.h>
59 #endif
60
61 #include <net/i4b/include/machine/i4b_ioctl.h>
62 #include <net/i4b/include/machine/i4b_tel_ioctl.h>
63 #include <net/i4b/include/machine/i4b_debug.h>
64
65 #include "../include/i4b_global.h"
66 #include "../include/i4b_mbuf.h"
67 #include "../include/i4b_l3l4.h"
68 #include "../layer4/i4b_l4.h"
69
70 /* minor number: lower 6 bits = unit number */
71
72 #define UNITBITS        6
73 #define UNITMASK        0x3f
74 #define UNIT(n)         (minor(n) & UNITMASK)
75
76 /* minor number: upper 2 bits = function number */
77
78 #define FUNCMASK        0x03
79 #define FUNC(n)         (((minor(n)) >> UNITBITS) & FUNCMASK)
80
81 #define FUNCTEL         0       /* 0 = normal i4btel device     */
82 #define FUNCDIAL        1       /* 1 = i4bteld dialout device   */
83
84 #define NOFUNCS         2       /* number of device classes     */
85
86 typedef struct {
87
88         /* used only in func = FUNCTEL */
89
90         drvr_link_t             drvr_linktab;   /* driver linktab */
91         isdn_link_t             *isdn_linktab;  /* isdn linktab */
92         int                     audiofmt;       /* audio format conversion */
93         u_char                  *rcvttab;       /* conversion table on read */
94         u_char                  *wcvttab;       /* conversion table on write */
95         call_desc_t             *cdp;           /* call descriptor pointer */
96
97         /* used only in func = FUNCDIAL */
98
99         char                    result;         /* result code for dial dev */  
100
101         /* used in func = FUNCDIAL and func = FUNCTEL*/
102         
103         int                     devstate;       /* state of this unit   */
104 #define ST_IDLE         0x00            /* idle */
105 #define ST_CONNECTED    0x01            /* isdn connected state */
106 #define ST_ISOPEN       0x02            /* userland opened */
107 #define ST_RDWAITDATA   0x04            /* userland read waiting */
108 #define ST_WRWAITEMPTY  0x08            /* userland write waiting */
109 #define ST_TONE         0x10            /* tone generator */
110
111         struct selinfo          selp;           /* select / poll */
112
113         struct i4b_tel_tones    tones;
114         int                     toneidx;
115         int                     toneomega;
116         int                     tonefreq;
117
118 } tel_sc_t;
119
120 static tel_sc_t tel_sc[NI4BTEL][NOFUNCS];
121         
122 /* forward decl */
123
124 static void tel_rx_data_rdy(int unit);
125 static void tel_tx_queue_empty(int unit);
126 static void tel_init_linktab(int unit);
127 static void tel_connect(int unit, void *cdp);
128 static void tel_disconnect(int unit, void *cdp);
129 static void tel_tone(tel_sc_t *sc);
130
131 /* audio format conversion tables */
132 static unsigned char a2u_tab[];
133 static unsigned char u2a_tab[];
134 static unsigned char bitreverse[];
135 static u_char sinetab[];
136
137 #define PDEVSTATIC      static
138
139 PDEVSTATIC d_open_t     i4btelopen;
140 PDEVSTATIC d_close_t    i4btelclose;
141 PDEVSTATIC d_read_t     i4btelread;
142 PDEVSTATIC d_read_t     i4btelwrite;
143 PDEVSTATIC d_ioctl_t    i4btelioctl;
144
145 #ifdef OS_USES_POLL
146 PDEVSTATIC d_poll_t i4btelpoll;
147 #define POLLFIELD i4btelpoll
148 #else
149 PDEVSTATIC d_select_t i4btelsel;
150 #define POLLFIELD i4btelsel
151 #endif
152
153 #define CDEV_MAJOR 56
154
155 static struct cdevsw i4btel_cdevsw = {
156         /* name */      "i4btel",
157         /* maj */       CDEV_MAJOR,
158         /* flags */     0,
159         /* port */      NULL,
160         /* clone */     NULL,
161
162         /* open */      i4btelopen,
163         /* close */     i4btelclose,
164         /* read */      i4btelread,
165         /* write */     i4btelwrite,
166         /* ioctl */     i4btelioctl,
167         /* poll */      POLLFIELD,
168         /* mmap */      nommap,
169         /* strategy */  nostrategy,
170         /* dump */      nodump,
171         /* psize */     nopsize
172 };
173
174 PDEVSTATIC void i4btelinit(void *unused);
175 PDEVSTATIC void i4btelattach(void *);
176
177 PSEUDO_SET(i4btelattach, i4b_tel);
178
179 /*===========================================================================*
180  *                      DEVICE DRIVER ROUTINES
181  *===========================================================================*/
182
183 /*---------------------------------------------------------------------------*
184  *      initialization at kernel load time
185  *---------------------------------------------------------------------------*/
186 PDEVSTATIC void
187 i4btelinit(void *unused)
188 {
189         cdevsw_add(&i4btel_cdevsw, 0, 0);
190 }
191
192 SYSINIT(i4bteldev, SI_SUB_DRIVERS,
193         SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btelinit, NULL);
194
195 /*---------------------------------------------------------------------------*
196  *      interface attach routine
197  *---------------------------------------------------------------------------*/
198 PDEVSTATIC void
199 i4btelattach(void *dummy)
200 {
201         int i, j;
202
203         printf("i4btel: %d ISDN telephony interface device(s) attached\n", NI4BTEL);
204         
205         for(i=0; i < NI4BTEL; i++)
206         {
207                 for(j=0; j < NOFUNCS; j++)
208                 {
209                         tel_sc[i][j].devstate = ST_IDLE;
210                         tel_sc[i][j].audiofmt = CVT_NONE;
211                         tel_sc[i][j].rcvttab = 0;
212                         tel_sc[i][j].wcvttab = 0;
213                         tel_sc[i][j].result = 0;
214
215                         switch(j)
216                         {
217                                 case FUNCTEL:   /* normal i4btel device */
218                                         make_dev(&i4btel_cdevsw, i,
219                                                 UID_ROOT, GID_WHEEL,
220                                                 0600, "i4btel%d", i);
221                                         break;
222                                 
223                                 case FUNCDIAL:  /* i4bteld dialout device */
224                                         make_dev(&i4btel_cdevsw, i+(1<<UNITBITS),
225                                                 UID_ROOT, GID_WHEEL,
226                                                 0600, "i4bteld%d", i);
227                                         break;
228                         }
229                 }
230                 tel_init_linktab(i);            
231         }
232 }
233
234 /*---------------------------------------------------------------------------*
235  *      open tel device
236  *---------------------------------------------------------------------------*/
237 PDEVSTATIC int
238 i4btelopen(dev_t dev, int flag, int fmt, struct thread *td)
239 {
240         int unit = UNIT(dev);
241         int func = FUNC(dev);
242         
243         tel_sc_t *sc;
244         
245         if(unit >= NI4BTEL)
246                 return(ENXIO);
247
248         sc = &tel_sc[unit][func];               
249
250         if(sc->devstate & ST_ISOPEN)
251                 return(EBUSY);
252
253         sc->devstate |= ST_ISOPEN;              
254
255         if(func == FUNCDIAL)
256         {
257                 sc->result = 0;
258         }
259         
260         return(0);
261 }
262
263 /*---------------------------------------------------------------------------*
264  *      close tel device
265  *---------------------------------------------------------------------------*/
266 PDEVSTATIC int
267 i4btelclose(dev_t dev, int flag, int fmt, struct thread *td)
268 {
269         int unit = UNIT(dev);
270         int func = FUNC(dev);
271         tel_sc_t *sc;
272         int error = 0;
273         int x;
274         
275         if(unit > NI4BTEL)
276                 return(ENXIO);
277
278         sc = &tel_sc[unit][func];               
279
280         x = splimp();
281         sc->devstate &= ~ST_TONE;               
282
283         if((func == FUNCTEL) &&
284            (sc->isdn_linktab != NULL && sc->isdn_linktab->tx_queue != NULL))
285         {
286                 while(!(IF_QEMPTY(sc->isdn_linktab->tx_queue)))
287                 {
288                         sc->devstate |= ST_WRWAITEMPTY;
289         
290                         if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
291                                         PCATCH, "wtcl", 0)) != 0)
292                         {
293                                 break;
294                         }
295                 }
296                 sc->devstate &= ~ST_WRWAITEMPTY;                
297         }
298
299         sc->devstate &= ~ST_ISOPEN;             
300         splx(x);
301         wakeup((caddr_t) &sc->tones);
302
303         return(error);
304 }
305
306 /*---------------------------------------------------------------------------*
307  *      i4btelioctl - device driver ioctl routine
308  *---------------------------------------------------------------------------*/
309 PDEVSTATIC int
310 i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
311 {
312         int unit = UNIT(dev);
313         int func = FUNC(dev);
314         int error = 0;
315         struct mbuf *m;
316         int s;
317
318         tel_sc_t *sc = &tel_sc[unit][func];
319
320         if(func == FUNCTEL)
321         {
322                 switch(cmd)
323                 {
324                         case I4B_TEL_GETAUDIOFMT:
325                                 *(int *)data = sc->audiofmt;
326                                 break;
327                         
328                         case I4B_TEL_SETAUDIOFMT:
329                                 switch (*(int *)data)
330                                 {
331                                         case CVT_NONE:
332                                                 sc->rcvttab = 0;
333                                                 sc->wcvttab = 0;
334                                                 break;
335                                         case CVT_ALAW2ULAW:
336                                                 /* ISDN: a-law */
337                                                 /* user: u-law */ 
338                                                 sc->rcvttab = a2u_tab;
339                                                 sc->wcvttab = u2a_tab;
340                                                 break;
341                                         case CVT_ULAW2ALAW:
342                                                 /* ISDN: u-law */
343                                                 /* user: a-law */ 
344                                                 sc->rcvttab = u2a_tab;
345                                                 sc->wcvttab = a2u_tab;
346                                                 break;
347                                         default:
348                                                 error = ENODEV;
349                                                 break;
350                                 }
351                                 if(error == 0)
352                                         sc->audiofmt = *(int *)data;
353                                 break;
354         
355                         case I4B_TEL_EMPTYINPUTQUEUE:
356                                 s = splimp();
357                                 while((sc->devstate & ST_CONNECTED)     &&
358                                         (sc->devstate & ST_ISOPEN)      &&
359                                         !IF_QEMPTY(sc->isdn_linktab->rx_queue))
360                                 {
361                                         IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
362                                         if(m)
363                                                 i4b_Bfreembuf(m);
364                                 }
365                                 splx(s);
366                                 break;
367
368                         case I4B_TEL_VR_REQ:
369                         {
370                                 msg_vr_req_t *mvr;
371
372                                 mvr = (msg_vr_req_t *)data;
373
374                                 mvr->version = VERSION;
375                                 mvr->release = REL;
376                                 mvr->step = STEP;                       
377                                 break;
378                         }
379                         case I4B_TEL_TONES:
380                         {
381                                 struct i4b_tel_tones *tt;
382
383                                 tt = (struct i4b_tel_tones *)data;
384                                 s = splimp();
385                                 while ((sc->devstate & ST_TONE) && 
386                                     sc->tones.duration[sc->toneidx] != 0) {
387                                         if((error = tsleep((caddr_t) &sc->tones,
388                                             PCATCH, "rtone", 0 )) != 0) {
389                                                 splx(s);
390                                                 return(error);
391                                         }
392                                 } 
393                                 if(!(sc->devstate & ST_ISOPEN)) {
394                                         splx(s);
395                                         return (EIO);
396                                 }
397                                 if(!(sc->devstate & ST_CONNECTED)) {
398                                         splx(s);
399                                         return (EIO);
400                                 }
401
402                                 sc->tones = *tt;
403                                 sc->toneidx = 0;
404                                 sc->tonefreq = tt->frequency[0];
405                                 sc->devstate |= ST_TONE;
406                                 splx(s);
407                                 tel_tone(sc);
408                                 break;
409                         }
410         
411                         default:
412                                 error = ENOTTY;
413                                 break;
414                 }
415         }
416         else if(func == FUNCDIAL)
417         {
418                 switch(cmd)
419                 {
420                         default:
421                                 error = ENOTTY;
422                                 break;
423                 }
424         }               
425         return(error);
426 }
427
428 /*---------------------------------------------------------------------------*
429  *      read from tel device
430  *---------------------------------------------------------------------------*/
431 PDEVSTATIC int
432 i4btelread(dev_t dev, struct uio *uio, int ioflag)
433 {
434         int unit = UNIT(dev);
435         int func = FUNC(dev);
436
437         struct mbuf *m;
438         int s;
439         int error = 0;
440
441         tel_sc_t *sc = &tel_sc[unit][func];
442         
443         if(!(sc->devstate & ST_ISOPEN))
444                 return(EIO);
445
446         if(func == FUNCTEL)
447         {
448                 s = splimp();
449
450                 while((sc->devstate & ST_ISOPEN)        &&
451                       (sc->devstate & ST_CONNECTED)     &&
452                       IF_QEMPTY(sc->isdn_linktab->rx_queue))            
453                 {
454                         sc->devstate |= ST_RDWAITDATA;
455
456                         NDBGL4(L4_TELDBG, "i4btel%d, queue empty!", unit);
457
458 #if defined (__FreeBSD__) && __FreeBSD__ > 4
459                         if((error = msleep((caddr_t) &sc->isdn_linktab->rx_queue,
460                                         &sc->isdn_linktab->rx_queue->ifq_mtx,
461                                         TTIPRI | PCATCH,
462                                         "rtel", 0 )) != 0)
463 #else
464                         if((error = tsleep((caddr_t) &sc->isdn_linktab->rx_queue,
465                                                 PCATCH, "rtel", 0 )) != 0)
466 #endif                                          
467                         {
468                                 sc->devstate &= ~ST_RDWAITDATA;
469                                 splx(s);
470                                 return(error);
471                         }
472                 }
473         
474                 if(!(sc->devstate & ST_ISOPEN))
475                 {
476                         splx(s);
477                         return(EIO);
478                 }
479         
480                 if(!(sc->devstate & ST_CONNECTED))
481                 {
482                         splx(s);
483                         return(EIO);
484                 }
485                 
486         
487                 IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
488                 
489                 if(m && m->m_len > 0)
490                 {
491                         int i;
492
493                         for(i = 0; i < m->m_len; i++)
494                         {
495                                 /* always reverse bit order from line */
496                                 mtod(m,u_char *)[i] = bitreverse[mtod(m,u_char *)[i]];
497
498                                 /* convert if necessary */
499                                 if(sc->rcvttab)
500                                         mtod(m,u_char *)[i] = sc->rcvttab[mtod(m,u_char *)[i]];
501                         }
502                         error = uiomove(m->m_data, m->m_len, uio);
503
504                         NDBGL4(L4_TELDBG, "i4btel%d, mbuf (%d bytes), uiomove %d!", unit, m->m_len, error);
505                 }
506                 else
507                 {
508                         NDBGL4(L4_TELDBG, "i4btel%d, empty mbuf from queue!", unit);
509                         error = EIO;
510                 }
511                         
512                 if(m)
513                         i4b_Bfreembuf(m);
514         
515                 splx(s);
516         }
517         else if(func == FUNCDIAL)
518         {
519                 s = splimp();
520                 while((sc->result == 0) && (sc->devstate & ST_ISOPEN))
521                 {
522                         sc->devstate |= ST_RDWAITDATA;
523         
524                         if((error = tsleep((caddr_t) &sc->result,
525                                                 PCATCH, "rtel1", 0 )) != 0)
526                         {
527                                 sc->devstate &= ~ST_RDWAITDATA;
528                                 splx(s);
529                                 return(error);
530                         }
531                 }
532         
533                 if(!(sc->devstate & ST_ISOPEN))
534                 {
535                         splx(s);
536                         return(EIO);
537                 }
538         
539                 if(sc->result != 0)
540                 {
541                         error = uiomove(&sc->result, 1, uio);
542                         sc->result = 0;
543                 }
544                 else
545                 {
546                         error = EIO;
547                 }
548
549                 splx(s);                        
550         }
551         return(error);
552 }
553
554 /*---------------------------------------------------------------------------*
555  *      write to tel device
556  *---------------------------------------------------------------------------*/
557 PDEVSTATIC int
558 i4btelwrite(dev_t dev, struct uio * uio, int ioflag)
559 {
560         int unit = UNIT(dev);
561         int func = FUNC(dev);
562         struct mbuf *m;
563         int s;
564         int error = 0;
565         tel_sc_t *sc = &tel_sc[unit][func];
566         
567         if(!(sc->devstate & ST_ISOPEN))
568         {
569                 return(EIO);
570         }
571
572         if(func == FUNCTEL)
573         {
574                 s = splimp();
575                 
576                 if(!(sc->devstate & ST_CONNECTED)) {
577                         splx(s);
578                         return(EIO);
579                 }
580                         
581                 sc->devstate &= ~ST_TONE;               
582                 while((IF_QFULL(sc->isdn_linktab->tx_queue)) &&
583                       (sc->devstate & ST_ISOPEN))
584                 {
585                         sc->devstate |= ST_WRWAITEMPTY;
586
587 #if defined (__FreeBSD__) && __FreeBSD__ > 4    
588                         if((error = msleep((caddr_t) &sc->isdn_linktab->tx_queue,
589                                         &sc->isdn_linktab->tx_queue->ifq_mtx,
590                                         TTIPRI | PCATCH, "wtel", 0)) != 0)
591 #else
592                         if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
593                                         PCATCH, "wtel", 0)) != 0)
594 #endif                                  
595                         {
596                                 sc->devstate &= ~ST_WRWAITEMPTY;
597                                 splx(s);
598                                 return(error);
599                         }
600                 }
601         
602                 if(!(sc->devstate & ST_ISOPEN))
603                 {
604                         splx(s);
605                         return(EIO);
606                 }
607         
608                 if(!(sc->devstate & ST_CONNECTED))
609                 {
610                         splx(s);
611                         return(EIO);
612                 }
613
614                 if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
615                 {
616                         int i;
617                         
618                         m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
619         
620                         error = uiomove(m->m_data, m->m_len, uio);
621         
622                         for(i = 0; i < m->m_len; i++)
623                         {
624                                 /* convert if necessary */
625                                 if(sc->wcvttab)
626                                         mtod(m,u_char *)[i] = sc->wcvttab[mtod(m,u_char *)[i]];
627
628                                 /* always reverse bitorder to line */
629                                 mtod(m,u_char *)[i] = bitreverse[mtod(m,u_char *)[i]];
630                         }
631
632 #if defined (__FreeBSD__) && __FreeBSD__ > 4                    
633                         (void) IF_HANDOFF(sc->isdn_linktab->tx_queue, m, NULL);
634 #else
635                         if(IF_QFULL(sc->isdn_linktab->tx_queue))
636                                 m_freem(m);
637                         else
638                                 IF_ENQUEUE(sc->isdn_linktab->tx_queue, m);
639 #endif                  
640                         (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
641                 }
642         
643                 splx(s);
644         }
645         else if(func == FUNCDIAL)
646         {
647 #define CMDBUFSIZ 80 
648                 char cmdbuf[CMDBUFSIZ];
649                 int len = min(CMDBUFSIZ-1, uio->uio_resid);
650         
651                 error = uiomove(cmdbuf, len, uio);
652
653                 if(cmdbuf[0] == CMD_DIAL)
654                 {
655                         i4b_l4_dialoutnumber(BDRV_TEL, unit, len-1, &cmdbuf[1]);
656                 }
657                 else if(cmdbuf[0] == CMD_HUP)
658                 {
659                         i4b_l4_drvrdisc(BDRV_TEL, unit);
660                 }
661                 else if(cmdbuf[0] == CMD_KEYP)
662                 {
663                         i4b_l4_keypad(BDRV_TEL, unit, len-1, &cmdbuf[1]);
664                 }
665         }
666         else
667         {
668                 error = EIO;
669         }               
670         
671         return(error);
672 }
673
674 /*---------------------------------------------------------------------------*
675  *      
676  *---------------------------------------------------------------------------*/
677 #define NTONESAMP 32
678 static void
679 tel_tone(tel_sc_t *sc)
680 {
681         struct mbuf *m;
682         u_char *p;
683         int i;
684
685         if((m = i4b_Bgetmbuf(NTONESAMP)) == NULL) {
686                 printf("no mbuf in tel_tone\n");
687                 return;
688         }
689         p = m->m_data;
690         m->m_len = 0;
691         for (i = 0; i < NTONESAMP && (sc->devstate & ST_TONE); i++) {
692
693                 if (sc->tones.duration[sc->toneidx] > 0) {
694                         if (--sc->tones.duration[sc->toneidx] == 0) {
695                                 sc->toneidx++;
696                                 if (sc->toneidx == I4B_TEL_MAXTONES) {
697                                         sc->devstate &= ~ST_TONE;
698                                         sc->toneomega = 0;
699                                         sc->tonefreq = 0;
700                                 } else if (sc->tones.frequency[sc->toneidx] == 0 &&
701                                            sc->tones.duration[sc->toneidx] == 0) {
702                                         sc->devstate &= ~ST_TONE;
703                                         sc->toneomega = 0;
704                                         sc->tonefreq = 0;
705                                 } else {
706                                         sc->tonefreq = sc->tones.frequency[sc->toneidx];
707                                 }
708                                 if (sc->tones.duration[sc->toneidx] == 0) {
709                                         wakeup((caddr_t) &sc->tones);
710                                 }
711                         }
712                 }
713
714                 sc->toneomega += sc->tonefreq;
715                 if (sc->toneomega >= 8000)
716                         sc->toneomega -= 8000;
717                 *p++ = bitreverse[sinetab[sc->toneomega]];
718                 m->m_len++;
719         }
720         IF_ENQUEUE(sc->isdn_linktab->tx_queue, m);
721         (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
722 }
723
724
725 #ifdef OS_USES_POLL
726 /*---------------------------------------------------------------------------*
727  *      device driver poll
728  *---------------------------------------------------------------------------*/
729 PDEVSTATIC int
730 i4btelpoll(dev_t dev, int events, struct thread *td)
731 {
732         int revents = 0;        /* Events we found */
733         int s;
734         int unit = UNIT(dev);
735         int func = FUNC(dev);   
736
737         tel_sc_t *sc = &tel_sc[unit][func];
738         
739         s = splhigh();
740
741         if(!(sc->devstate & ST_ISOPEN))
742         {
743                 NDBGL4(L4_TELDBG, "i4btel%d, !ST_ISOPEN", unit);
744                 splx(s);
745                 return(0);
746         }
747
748         if(func == FUNCTEL)
749         {
750                 /*
751                  * Writes are OK if we are connected and the
752                  * transmit queue can take them
753                  */
754                  
755                 if((events & (POLLOUT|POLLWRNORM))      &&
756                         (sc->devstate & ST_CONNECTED)   &&
757                         (sc->isdn_linktab != NULL)      &&
758                         (!IF_QFULL(sc->isdn_linktab->tx_queue)))
759                 {
760                         NDBGL4(L4_TELDBG, "i4btel%d, POLLOUT", unit);
761                         revents |= (events & (POLLOUT|POLLWRNORM));
762                 }
763                 
764                 /* ... while reads are OK if we have any data */
765         
766                 if((events & (POLLIN|POLLRDNORM))       &&
767                         (sc->devstate & ST_CONNECTED)   &&
768                         (sc->isdn_linktab != NULL)      &&
769                         (!IF_QEMPTY(sc->isdn_linktab->rx_queue)))
770                 {
771                         NDBGL4(L4_TELDBG, "i4btel%d, POLLIN", unit);
772                         revents |= (events & (POLLIN|POLLRDNORM));
773                 }
774                         
775                 if(revents == 0)
776                 {
777                         NDBGL4(L4_TELDBG, "i4btel%d, selrecord", unit);
778                         selrecord(td, &sc->selp);
779                 }
780         }
781         else if(func == FUNCDIAL)
782         {
783                 if(events & (POLLOUT|POLLWRNORM))
784                 {
785                         NDBGL4(L4_TELDBG, "i4bteld%d,  POLLOUT", unit);
786                         revents |= (events & (POLLOUT|POLLWRNORM));
787                 }
788
789                 if(events & (POLLIN|POLLRDNORM))
790                 {
791                         NDBGL4(L4_TELDBG, "i4bteld%d,  POLLIN, result = %d", unit, sc->result);
792                         if(sc->result != 0)
793                                 revents |= (events & (POLLIN|POLLRDNORM));
794                 }
795                         
796                 if(revents == 0)
797                 {
798                         NDBGL4(L4_TELDBG, "i4bteld%d,  selrecord", unit);
799                         selrecord(td, &sc->selp);
800                 }
801         }
802         splx(s);
803         return(revents);
804 }
805
806 #else /* OS_USES_POLL */
807
808 /*---------------------------------------------------------------------------*
809  *      device driver select
810  *---------------------------------------------------------------------------*/
811 PDEVSTATIC int
812 i4btelsel(dev_t dev, int rw, struct thread *td)
813 {
814         int s;
815         int unit = UNIT(dev);
816         int func = FUNC(dev);   
817
818         tel_sc_t *sc = &tel_sc[unit][func];
819         
820         s = splhigh();
821
822         if (!(sc->devstate & ST_ISOPEN))
823         {
824                 NDBGL4(L4_TELDBG, "i4btel%d, !ST_ISOPEN", unit);
825                 splx(s);
826                 return(0);
827         }
828
829         if (func == FUNCTEL)
830         {
831                 /* Don't even bother if we're not connected */
832                 if (!(sc->devstate & ST_CONNECTED) || sc->isdn_linktab == NULL)
833                 {
834                         splx(s);
835                         return 0;
836                 }
837
838                 if (rw == FREAD)
839                 {
840                         if (!IF_QEMPTY(sc->isdn_linktab->rx_queue))
841                         {
842                                 NDBGL4(L4_TELDBG, "i4btel%d, FREAD", unit);
843                                 splx(s);
844                                 return 1;
845                         }
846                 }
847                 else if (rw == FWRITE)
848                 {
849                         if (!IF_QFULL(sc->isdn_linktab->tx_queue))
850                         {
851                                 NDBGL4(L4_TELDBG, "i4btel%d, FWRITE", unit);
852                                 splx(s);
853                                 return 1;
854                         }
855                 }
856         }
857         else if (func == FUNCDIAL)
858         {
859                 if (rw == FWRITE)
860                 {
861                         NDBGL4(L4_TELDBG, "i4bteld%d,  FWRITE", unit);
862                         splx(s);
863                         return 1;
864                 }
865
866                 if (rw == FREAD)
867                 {
868                         NDBGL4(L4_TELDBG, "i4bteld%d,  FREAD, result = %d", unit, sc->result);
869                         if (sc->result != 0)
870                         {
871                                 splx(s);
872                                 return 1;
873                         }
874                 }
875         }
876
877         NDBGL4(L4_TELDBG, "i4bteld%d,  selrecord", unit);
878         selrecord(p, &sc->selp);
879         splx(s);
880         return 0;
881 }
882
883 #endif /* OS_USES_POLL */
884
885 /*===========================================================================*
886  *                      ISDN INTERFACE ROUTINES
887  *===========================================================================*/
888
889 /*---------------------------------------------------------------------------*
890 *       this routine is called from L4 handler at connect time
891  *---------------------------------------------------------------------------*/
892 static void
893 tel_connect(int unit, void *cdp)
894 {
895         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
896
897         /* audio device */
898         
899         sc->cdp = (call_desc_t *)cdp;
900
901         sc->devstate |= ST_CONNECTED;
902
903         /* dialer device */
904         
905         sc = &tel_sc[unit][FUNCDIAL];
906
907         if(sc->devstate == ST_ISOPEN)
908         {
909                 sc->result = RSP_CONN;
910
911                 if(sc->devstate & ST_RDWAITDATA)
912                 {
913                         sc->devstate &= ~ST_RDWAITDATA;
914                         wakeup((caddr_t) &sc->result);
915                 }
916                 selwakeup(&sc->selp);
917         }
918 }
919
920 /*---------------------------------------------------------------------------*
921  *      this routine is called from L4 handler at disconnect time
922  *---------------------------------------------------------------------------*/
923 static void
924 tel_disconnect(int unit, void *cdp)
925 {
926 /*      call_desc_t *cd = (call_desc_t *)cdp; */
927
928         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
929         
930         /* audio device */
931         
932         sc->devstate &= ~ST_CONNECTED;
933
934         if(sc->devstate & ST_RDWAITDATA)
935         {
936                 sc->devstate &= ~ST_RDWAITDATA;
937                 wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
938         }
939
940         if(sc->devstate & ST_WRWAITEMPTY)
941         {
942                 sc->devstate &= ~ST_WRWAITEMPTY;
943                 wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
944         }
945
946         /* dialer device */
947         
948         sc = &tel_sc[unit][FUNCDIAL];
949
950         if(sc->devstate & ST_ISOPEN)
951         {
952                 sc->result = RSP_HUP;
953
954                 if(sc->devstate & ST_RDWAITDATA)
955                 {
956                         sc->devstate &= ~ST_RDWAITDATA;
957                         wakeup((caddr_t) &sc->result);
958                 }
959                 selwakeup(&sc->selp);
960
961                 if (sc->devstate & ST_TONE) {
962                         sc->devstate &= ~ST_TONE;
963                         wakeup((caddr_t) &sc->tones);
964                 }
965         }
966 }
967
968 /*---------------------------------------------------------------------------*
969  *      feedback from daemon in case of dial problems
970  *---------------------------------------------------------------------------*/
971 static void
972 tel_dialresponse(int unit, int status, cause_t cause)
973 {       
974         tel_sc_t *sc = &tel_sc[unit][FUNCDIAL];
975
976         NDBGL4(L4_TELDBG, "i4btel%d,  status=%d, cause=0x%4x", unit, status, cause);
977
978         if((sc->devstate == ST_ISOPEN) && status)
979         {       
980                 sc->result = RSP_NOA;
981
982                 if(sc->devstate & ST_RDWAITDATA)
983                 {
984                         sc->devstate &= ~ST_RDWAITDATA;
985                         wakeup((caddr_t) &sc->result);
986                 }
987                 selwakeup(&sc->selp);
988         }
989 }
990         
991 /*---------------------------------------------------------------------------*
992  *      interface up/down
993  *---------------------------------------------------------------------------*/
994 static void
995 tel_updown(int unit, int updown)
996 {
997 }
998         
999 /*---------------------------------------------------------------------------*
1000  *      this routine is called from the HSCX interrupt handler
1001  *      when a new frame (mbuf) has been received and was put on
1002  *      the rx queue.
1003  *---------------------------------------------------------------------------*/
1004 static void
1005 tel_rx_data_rdy(int unit)
1006 {
1007         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
1008         
1009         if(sc->devstate & ST_RDWAITDATA)
1010         {
1011                 sc->devstate &= ~ST_RDWAITDATA;
1012                 wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
1013         }
1014         selwakeup(&sc->selp);
1015 }
1016
1017 /*---------------------------------------------------------------------------*
1018  *      this routine is called from the HSCX interrupt handler
1019  *      when the last frame has been sent out and there is no
1020  *      further frame (mbuf) in the tx queue.
1021  *---------------------------------------------------------------------------*/
1022 static void
1023 tel_tx_queue_empty(int unit)
1024 {
1025         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
1026
1027         if(sc->devstate & ST_WRWAITEMPTY)
1028         {
1029                 sc->devstate &= ~ST_WRWAITEMPTY;
1030                 wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
1031         }
1032         if(sc->devstate & ST_TONE) {
1033                 tel_tone(sc);
1034         } else {
1035                 selwakeup(&sc->selp);
1036         }
1037 }
1038
1039 /*---------------------------------------------------------------------------*
1040  *      this routine is called from the HSCX interrupt handler
1041  *      each time a packet is received or transmitted.
1042  *---------------------------------------------------------------------------*/
1043 static void
1044 tel_activity(int unit, int rxtx)
1045 {
1046         if(tel_sc[unit][FUNCTEL].cdp)
1047                 tel_sc[unit][FUNCTEL].cdp->last_active_time = SECOND;
1048 }
1049
1050 /*---------------------------------------------------------------------------*
1051  *      return this drivers linktab address
1052  *---------------------------------------------------------------------------*/
1053 drvr_link_t *
1054 tel_ret_linktab(int unit)
1055 {
1056         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
1057         
1058         tel_init_linktab(unit);
1059         return(&sc->drvr_linktab);
1060 }
1061
1062 /*---------------------------------------------------------------------------*
1063  *      setup the isdn_linktab for this driver
1064  *---------------------------------------------------------------------------*/
1065 void
1066 tel_set_linktab(int unit, isdn_link_t *ilt)
1067 {
1068         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
1069         sc->isdn_linktab = ilt;
1070 }
1071
1072 /*---------------------------------------------------------------------------*
1073  *      initialize this drivers linktab
1074  *---------------------------------------------------------------------------*/
1075 static void
1076 tel_init_linktab(int unit)
1077 {
1078         tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
1079         
1080         sc->drvr_linktab.unit = unit;
1081         sc->drvr_linktab.bch_rx_data_ready = tel_rx_data_rdy;
1082         sc->drvr_linktab.bch_tx_queue_empty = tel_tx_queue_empty;
1083         sc->drvr_linktab.bch_activity = tel_activity;   
1084         sc->drvr_linktab.line_connected = tel_connect;
1085         sc->drvr_linktab.line_disconnected = tel_disconnect;
1086         sc->drvr_linktab.dial_response = tel_dialresponse;
1087         sc->drvr_linktab.updown_ind = tel_updown;       
1088 }
1089
1090 /*===========================================================================*
1091  *      AUDIO FORMAT CONVERSION (produced by running g711conv)
1092  *===========================================================================*/
1093
1094 /*---------------------------------------------------------------------------*
1095  *      A-law to u-law conversion
1096  *---------------------------------------------------------------------------*/
1097 static unsigned char a2u_tab[256] = {
1098 /* 00 */        0x2a, 0x2b, 0x28, 0x29, 0x2e, 0x2f, 0x2c, 0x2d, 
1099 /* 08 */        0x22, 0x23, 0x20, 0x21, 0x26, 0x27, 0x24, 0x25, 
1100 /* 10 */        0x39, 0x3a, 0x37, 0x38, 0x3d, 0x3e, 0x3b, 0x3c, 
1101 /* 18 */        0x31, 0x32, 0x30, 0x30, 0x35, 0x36, 0x33, 0x34, 
1102 /* 20 */        0x0a, 0x0b, 0x08, 0x09, 0x0e, 0x0f, 0x0c, 0x0d, 
1103 /* 28 */        0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05, 
1104 /* 30 */        0x1a, 0x1b, 0x18, 0x19, 0x1e, 0x1f, 0x1c, 0x1d, 
1105 /* 38 */        0x12, 0x13, 0x10, 0x11, 0x16, 0x17, 0x14, 0x15, 
1106 /* 40 */        0x62, 0x63, 0x60, 0x61, 0x66, 0x67, 0x64, 0x65, 
1107 /* 48 */        0x5d, 0x5d, 0x5c, 0x5c, 0x5f, 0x5f, 0x5e, 0x5e, 
1108 /* 50 */        0x74, 0x76, 0x70, 0x72, 0x7c, 0x7e, 0x78, 0x7a, 
1109 /* 58 */        0x6a, 0x6b, 0x68, 0x69, 0x6e, 0x6f, 0x6c, 0x6d, 
1110 /* 60 */        0x48, 0x49, 0x46, 0x47, 0x4c, 0x4d, 0x4a, 0x4b, 
1111 /* 68 */        0x40, 0x41, 0x3f, 0x3f, 0x44, 0x45, 0x42, 0x43, 
1112 /* 70 */        0x56, 0x57, 0x54, 0x55, 0x5a, 0x5b, 0x58, 0x59, 
1113 /* 78 */        0x4f, 0x4f, 0x4e, 0x4e, 0x52, 0x53, 0x50, 0x51, 
1114 /* 80 */        0xaa, 0xab, 0xa8, 0xa9, 0xae, 0xaf, 0xac, 0xad, 
1115 /* 88 */        0xa2, 0xa3, 0xa0, 0xa1, 0xa6, 0xa7, 0xa4, 0xa5, 
1116 /* 90 */        0xb9, 0xba, 0xb7, 0xb8, 0xbd, 0xbe, 0xbb, 0xbc, 
1117 /* 98 */        0xb1, 0xb2, 0xb0, 0xb0, 0xb5, 0xb6, 0xb3, 0xb4, 
1118 /* a0 */        0x8a, 0x8b, 0x88, 0x89, 0x8e, 0x8f, 0x8c, 0x8d, 
1119 /* a8 */        0x82, 0x83, 0x80, 0x81, 0x86, 0x87, 0x84, 0x85, 
1120 /* b0 */        0x9a, 0x9b, 0x98, 0x99, 0x9e, 0x9f, 0x9c, 0x9d, 
1121 /* b8 */        0x92, 0x93, 0x90, 0x91, 0x96, 0x97, 0x94, 0x95, 
1122 /* c0 */        0xe2, 0xe3, 0xe0, 0xe1, 0xe6, 0xe7, 0xe4, 0xe5, 
1123 /* c8 */        0xdd, 0xdd, 0xdc, 0xdc, 0xdf, 0xdf, 0xde, 0xde, 
1124 /* d0 */        0xf4, 0xf6, 0xf0, 0xf2, 0xfc, 0xfe, 0xf8, 0xfa, 
1125 /* d8 */        0xea, 0xeb, 0xe8, 0xe9, 0xee, 0xef, 0xec, 0xed, 
1126 /* e0 */        0xc8, 0xc9, 0xc6, 0xc7, 0xcc, 0xcd, 0xca, 0xcb, 
1127 /* e8 */        0xc0, 0xc1, 0xbf, 0xbf, 0xc4, 0xc5, 0xc2, 0xc3, 
1128 /* f0 */        0xd6, 0xd7, 0xd4, 0xd5, 0xda, 0xdb, 0xd8, 0xd9, 
1129 /* f8 */        0xcf, 0xcf, 0xce, 0xce, 0xd2, 0xd3, 0xd0, 0xd1
1130 };
1131
1132 /*---------------------------------------------------------------------------*
1133  *      u-law to A-law conversion
1134  *---------------------------------------------------------------------------*/
1135 static unsigned char u2a_tab[256] = {
1136 /* 00 */        0x2a, 0x2b, 0x28, 0x29, 0x2e, 0x2f, 0x2c, 0x2d, 
1137 /* 08 */        0x22, 0x23, 0x20, 0x21, 0x26, 0x27, 0x24, 0x25, 
1138 /* 10 */        0x3a, 0x3b, 0x38, 0x39, 0x3e, 0x3f, 0x3c, 0x3d, 
1139 /* 18 */        0x32, 0x33, 0x30, 0x31, 0x36, 0x37, 0x34, 0x35, 
1140 /* 20 */        0x0a, 0x0b, 0x08, 0x09, 0x0e, 0x0f, 0x0c, 0x0d, 
1141 /* 28 */        0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05, 
1142 /* 30 */        0x1b, 0x18, 0x19, 0x1e, 0x1f, 0x1c, 0x1d, 0x12, 
1143 /* 38 */        0x13, 0x10, 0x11, 0x16, 0x17, 0x14, 0x15, 0x6a, 
1144 /* 40 */        0x68, 0x69, 0x6e, 0x6f, 0x6c, 0x6d, 0x62, 0x63, 
1145 /* 48 */        0x60, 0x61, 0x66, 0x67, 0x64, 0x65, 0x7a, 0x78, 
1146 /* 50 */        0x7e, 0x7f, 0x7c, 0x7d, 0x72, 0x73, 0x70, 0x71, 
1147 /* 58 */        0x76, 0x77, 0x74, 0x75, 0x4b, 0x49, 0x4f, 0x4d, 
1148 /* 60 */        0x42, 0x43, 0x40, 0x41, 0x46, 0x47, 0x44, 0x45, 
1149 /* 68 */        0x5a, 0x5b, 0x58, 0x59, 0x5e, 0x5f, 0x5c, 0x5d, 
1150 /* 70 */        0x52, 0x52, 0x53, 0x53, 0x50, 0x50, 0x51, 0x51, 
1151 /* 78 */        0x56, 0x56, 0x57, 0x57, 0x54, 0x54, 0x55, 0x55, 
1152 /* 80 */        0xaa, 0xab, 0xa8, 0xa9, 0xae, 0xaf, 0xac, 0xad, 
1153 /* 88 */        0xa2, 0xa3, 0xa0, 0xa1, 0xa6, 0xa7, 0xa4, 0xa5, 
1154 /* 90 */        0xba, 0xbb, 0xb8, 0xb9, 0xbe, 0xbf, 0xbc, 0xbd, 
1155 /* 98 */        0xb2, 0xb3, 0xb0, 0xb1, 0xb6, 0xb7, 0xb4, 0xb5, 
1156 /* a0 */        0x8a, 0x8b, 0x88, 0x89, 0x8e, 0x8f, 0x8c, 0x8d, 
1157 /* a8 */        0x82, 0x83, 0x80, 0x81, 0x86, 0x87, 0x84, 0x85, 
1158 /* b0 */        0x9b, 0x98, 0x99, 0x9e, 0x9f, 0x9c, 0x9d, 0x92, 
1159 /* b8 */        0x93, 0x90, 0x91, 0x96, 0x97, 0x94, 0x95, 0xea, 
1160 /* c0 */        0xe8, 0xe9, 0xee, 0xef, 0xec, 0xed, 0xe2, 0xe3, 
1161 /* c8 */        0xe0, 0xe1, 0xe6, 0xe7, 0xe4, 0xe5, 0xfa, 0xf8, 
1162 /* d0 */        0xfe, 0xff, 0xfc, 0xfd, 0xf2, 0xf3, 0xf0, 0xf1, 
1163 /* d8 */        0xf6, 0xf7, 0xf4, 0xf5, 0xcb, 0xc9, 0xcf, 0xcd, 
1164 /* e0 */        0xc2, 0xc3, 0xc0, 0xc1, 0xc6, 0xc7, 0xc4, 0xc5, 
1165 /* e8 */        0xda, 0xdb, 0xd8, 0xd9, 0xde, 0xdf, 0xdc, 0xdd, 
1166 /* f0 */        0xd2, 0xd2, 0xd3, 0xd3, 0xd0, 0xd0, 0xd1, 0xd1, 
1167 /* f8 */        0xd6, 0xd6, 0xd7, 0xd7, 0xd4, 0xd4, 0xd5, 0xd5
1168 };
1169   
1170 /*---------------------------------------------------------------------------*
1171  *      reverse bits in a byte
1172  *---------------------------------------------------------------------------*/
1173 static unsigned char bitreverse[256] = {
1174 /* 00 */        0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 
1175 /* 08 */        0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 
1176 /* 10 */        0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 
1177 /* 18 */        0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 
1178 /* 20 */        0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 
1179 /* 28 */        0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 
1180 /* 30 */        0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 
1181 /* 38 */        0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 
1182 /* 40 */        0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 
1183 /* 48 */        0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 
1184 /* 50 */        0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 
1185 /* 58 */        0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 
1186 /* 60 */        0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 
1187 /* 68 */        0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 
1188 /* 70 */        0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 
1189 /* 78 */        0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 
1190 /* 80 */        0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 
1191 /* 88 */        0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 
1192 /* 90 */        0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 
1193 /* 98 */        0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 
1194 /* a0 */        0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 
1195 /* a8 */        0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 
1196 /* b0 */        0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 
1197 /* b8 */        0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 
1198 /* c0 */        0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 
1199 /* c8 */        0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 
1200 /* d0 */        0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 
1201 /* d8 */        0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 
1202 /* e0 */        0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 
1203 /* e8 */        0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 
1204 /* f0 */        0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 
1205 /* f8 */        0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
1206 };
1207
1208 static u_char sinetab[8000] = { 213, 213, 213, 213, 213, 213, 213, 212,
1209 212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 214, 214,
1210 214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 208, 208,
1211 208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 210, 210, 210,
1212 210, 210, 210, 221, 221, 221, 221, 221, 221, 220, 220, 220, 220,
1213 220, 220, 220, 223, 223, 223, 223, 223, 223, 222, 222, 222, 222,
1214 222, 222, 217, 217, 217, 217, 217, 217, 216, 216, 216, 216, 216,
1215 216, 216, 219, 219, 219, 219, 219, 219, 218, 218, 218, 218, 218,
1216 218, 197, 197, 197, 197, 197, 197, 196, 196, 196, 196, 196, 196,
1217 196, 199, 199, 199, 199, 199, 199, 198, 198, 198, 198, 198, 198,
1218 193, 193, 193, 193, 193, 193, 192, 192, 192, 192, 192, 192, 192,
1219 195, 195, 195, 195, 195, 195, 194, 194, 194, 194, 194, 194, 205,
1220 205, 205, 205, 205, 205, 204, 204, 204, 204, 204, 204, 204, 207,
1221 207, 207, 207, 207, 207, 206, 206, 206, 206, 206, 206, 201, 201,
1222 201, 201, 201, 201, 200, 200, 200, 200, 200, 200, 200, 203, 203,
1223 203, 203, 203, 203, 202, 202, 202, 202, 202, 202, 245, 245, 245,
1224 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 244, 244, 244,
1225 244, 244, 244, 244, 244, 244, 244, 244, 244, 247, 247, 247, 247,
1226 247, 247, 247, 247, 247, 247, 247, 247, 247, 246, 246, 246, 246,
1227 246, 246, 246, 246, 246, 246, 246, 246, 246, 241, 241, 241, 241,
1228 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 240, 240, 240,
1229 240, 240, 240, 240, 240, 240, 240, 240, 243, 243, 243, 243, 243,
1230 243, 243, 243, 243, 243, 243, 243, 243, 242, 242, 242, 242, 242,
1231 242, 242, 242, 242, 242, 242, 242, 242, 253, 253, 253, 253, 253,
1232 253, 253, 253, 253, 253, 253, 253, 253, 252, 252, 252, 252, 252,
1233 252, 252, 252, 252, 252, 252, 252, 255, 255, 255, 255, 255, 255,
1234 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254,
1235 254, 254, 254, 254, 254, 254, 254, 249, 249, 249, 249, 249, 249,
1236 249, 249, 249, 249, 249, 249, 249, 248, 248, 248, 248, 248, 248,
1237 248, 248, 248, 248, 248, 248, 248, 251, 251, 251, 251, 251, 251,
1238 251, 251, 251, 251, 251, 251, 251, 250, 250, 250, 250, 250, 250,
1239 250, 250, 250, 250, 250, 250, 250, 229, 229, 229, 229, 229, 229,
1240 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
1241 229, 229, 229, 229, 229, 229, 229, 228, 228, 228, 228, 228, 228,
1242 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
1243 228, 228, 228, 228, 228, 228, 228, 228, 231, 231, 231, 231, 231,
1244 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
1245 231, 231, 231, 231, 231, 231, 231, 231, 231, 230, 230, 230, 230,
1246 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
1247 230, 230, 230, 230, 230, 230, 230, 230, 230, 225, 225, 225, 225,
1248 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
1249 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 224, 224,
1250 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
1251 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 227,
1252 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
1253 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
1254 227, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
1255 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
1256 226, 226, 226, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
1257 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
1258 237, 237, 237, 237, 237, 236, 236, 236, 236, 236, 236, 236, 236,
1259 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1260 236, 236, 236, 236, 236, 236, 236, 236, 239, 239, 239, 239, 239,
1261 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1262 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 238, 238,
1263 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
1264 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
1265 238, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
1266 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
1267 233, 233, 233, 233, 233, 232, 232, 232, 232, 232, 232, 232, 232,
1268 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
1269 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 235, 235, 235,
1270 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
1271 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
1272 235, 235, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
1273 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
1274 234, 234, 234, 234, 234, 234, 234, 149, 149, 149, 149, 149, 149,
1275 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1276 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1277 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1278 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1279 149, 149, 149, 149, 149, 149, 149, 148, 148, 148, 148, 148, 148,
1280 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1281 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1282 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1283 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1284 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 151, 151, 151,
1285 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1286 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1287 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1288 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1289 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1290 151, 151, 151, 151, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1291 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1292 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1293 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1294 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1295 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1296 150, 150, 150, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1297 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1298 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1299 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1300 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1301 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1302 145, 145, 145, 145, 145, 145, 145, 145, 144, 144, 144, 144, 144,
1303 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1304 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1305 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1306 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1307 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1308 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1309 144, 144, 144, 144, 144, 144, 144, 144, 144, 147, 147, 147, 147,
1310 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1311 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1312 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1313 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1314 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1315 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1316 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1317 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 146, 146, 146,
1318 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1319 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1320 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1321 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1322 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1323 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1324 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1325 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1326 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1327 146, 146, 146, 146, 146, 146, 157, 157, 157, 157, 157, 157, 157,
1328 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1329 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1330 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1331 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1332 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1333 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1334 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1335 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1336 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1337 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1338 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1339 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1340 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1341 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1342 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1343 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1344 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1345 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1346 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1347 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1348 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1349 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1350 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1351 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1352 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1353 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1354 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1355 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1356 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1357 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1358 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1359 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1360 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1361 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1362 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1363 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1364 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1365 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1366 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1367 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1368 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1369 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1370 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1371 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1372 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1373 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1374 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1375 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1376 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1377 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1378 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1379 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1380 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1381 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1382 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
1383 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157,
1384 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1385 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1386 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1387 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1388 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1389 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1390 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1391 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1392 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1393 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1394 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1395 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1396 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
1397 157, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1398 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1399 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1400 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1401 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1402 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1403 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1404 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1405 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
1406 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, 147,
1407 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1408 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1409 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1410 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1411 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1412 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1413 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
1414 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 144, 144,
1415 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1416 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1417 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1418 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1419 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1420 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
1421 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145,
1422 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1423 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1424 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1425 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1426 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1427 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
1428 145, 145, 145, 145, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1429 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1430 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1431 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1432 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1433 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1434 150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1435 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1436 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1437 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1438 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
1439 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 148, 148, 148,
1440 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1441 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1442 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1443 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1444 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1445 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1446 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1447 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1448 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1449 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1450 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
1451 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
1452 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235,
1453 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
1454 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 232, 232, 232,
1455 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
1456 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
1457 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
1458 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
1459 233, 233, 233, 233, 233, 233, 238, 238, 238, 238, 238, 238, 238,
1460 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
1461 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239,
1462 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1463 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 236,
1464 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1465 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1466 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
1467 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
1468 237, 237, 237, 237, 226, 226, 226, 226, 226, 226, 226, 226, 226,
1469 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
1470 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, 227,
1471 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
1472 227, 227, 227, 227, 227, 227, 227, 227, 224, 224, 224, 224, 224,
1473 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
1474 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225,
1475 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
1476 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 230, 230,
1477 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
1478 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231,
1479 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
1480 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 228,
1481 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
1482 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
1483 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
1484 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
1485 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1486 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
1487 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
1488 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
1489 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
1490 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
1491 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 253,
1492 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 242,
1493 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 243,
1494 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 240,
1495 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241,
1496 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 246, 246,
1497 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247,
1498 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 244, 244,
1499 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245,
1500 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 202, 202, 202,
1501 202, 202, 202, 203, 203, 203, 203, 203, 203, 200, 200, 200, 200,
1502 200, 200, 200, 201, 201, 201, 201, 201, 201, 206, 206, 206, 206,
1503 206, 206, 207, 207, 207, 207, 207, 207, 204, 204, 204, 204, 204,
1504 204, 204, 205, 205, 205, 205, 205, 205, 194, 194, 194, 194, 194,
1505 194, 195, 195, 195, 195, 195, 195, 192, 192, 192, 192, 192, 192,
1506 192, 193, 193, 193, 193, 193, 193, 198, 198, 198, 198, 198, 198,
1507 199, 199, 199, 199, 199, 199, 196, 196, 196, 196, 196, 196, 196,
1508 197, 197, 197, 197, 197, 197, 218, 218, 218, 218, 218, 218, 219,
1509 219, 219, 219, 219, 219, 216, 216, 216, 216, 216, 216, 216, 217,
1510 217, 217, 217, 217, 217, 222, 222, 222, 222, 222, 222, 223, 223,
1511 223, 223, 223, 223, 220, 220, 220, 220, 220, 220, 220, 221, 221,
1512 221, 221, 221, 221, 210, 210, 210, 210, 210, 210, 211, 211, 211,
1513 211, 211, 211, 208, 208, 208, 208, 208, 208, 209, 209, 209, 209,
1514 209, 209, 209, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215,
1515 215, 215, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213,
1516 213, 213, 90, 90, 90, 85, 85, 85, 85, 85, 85, 84, 84, 84, 84, 84,
1517 84, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 86, 81, 81, 81,
1518 81, 81, 81, 81, 80, 80, 80, 80, 80, 80, 83, 83, 83, 83, 83, 83,
1519 82, 82, 82, 82, 82, 82, 93, 93, 93, 93, 93, 93, 93, 92, 92, 92,
1520 92, 92, 92, 95, 95, 95, 95, 95, 95, 94, 94, 94, 94, 94, 94, 89,
1521 89, 89, 89, 89, 89, 88, 88, 88, 88, 88, 88, 88, 91, 91, 91, 91,
1522 91, 91, 90, 90, 90, 90, 90, 90, 69, 69, 69, 69, 69, 69, 68, 68,
1523 68, 68, 68, 68, 68, 71, 71, 71, 71, 71, 71, 70, 70, 70, 70, 70,
1524 70, 65, 65, 65, 65, 65, 65, 64, 64, 64, 64, 64, 64, 64, 67, 67,
1525 67, 67, 67, 67, 66, 66, 66, 66, 66, 66, 77, 77, 77, 77, 77, 77,
1526 76, 76, 76, 76, 76, 76, 76, 79, 79, 79, 79, 79, 79, 78, 78, 78,
1527 78, 78, 78, 73, 73, 73, 73, 73, 73, 73, 72, 72, 72, 72, 72, 72,
1528 75, 75, 75, 75, 75, 75, 74, 74, 74, 74, 74, 74, 117, 117, 117, 117,
1529 117, 117, 117, 117, 117, 117, 117, 117, 117, 116, 116, 116, 116,
1530 116, 116, 116, 116, 116, 116, 116, 116, 116, 119, 119, 119, 119,
1531 119, 119, 119, 119, 119, 119, 119, 119, 118, 118, 118, 118, 118,
1532 118, 118, 118, 118, 118, 118, 118, 118, 113, 113, 113, 113, 113,
1533 113, 113, 113, 113, 113, 113, 113, 113, 112, 112, 112, 112, 112,
1534 112, 112, 112, 112, 112, 112, 112, 115, 115, 115, 115, 115, 115,
1535 115, 115, 115, 115, 115, 115, 115, 114, 114, 114, 114, 114, 114,
1536 114, 114, 114, 114, 114, 114, 114, 125, 125, 125, 125, 125, 125,
1537 125, 125, 125, 125, 125, 125, 125, 124, 124, 124, 124, 124, 124,
1538 124, 124, 124, 124, 124, 124, 124, 127, 127, 127, 127, 127, 127,
1539 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126,
1540 126, 126, 126, 126, 126, 126, 121, 121, 121, 121, 121, 121, 121,
1541 121, 121, 121, 121, 121, 121, 120, 120, 120, 120, 120, 120, 120,
1542 120, 120, 120, 120, 120, 120, 123, 123, 123, 123, 123, 123, 123,
1543 123, 123, 123, 123, 123, 123, 122, 122, 122, 122, 122, 122, 122,
1544 122, 122, 122, 122, 122, 122, 101, 101, 101, 101, 101, 101, 101,
1545 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1546 101, 101, 101, 101, 101, 101, 101, 100, 100, 100, 100, 100, 100,
1547 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1548 100, 100, 100, 100, 100, 100, 100, 103, 103, 103, 103, 103, 103,
1549 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
1550 103, 103, 103, 103, 103, 103, 103, 103, 102, 102, 102, 102, 102,
1551 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
1552 102, 102, 102, 102, 102, 102, 102, 102, 102, 97, 97, 97, 97, 97,
1553 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
1554 97, 97, 97, 97, 97, 97, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
1555 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
1556 96, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1557 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, 98,
1558 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
1559 98, 98, 98, 98, 98, 98, 98, 98, 98, 109, 109, 109, 109, 109, 109,
1560 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
1561 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 108, 108, 108,
1562 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
1563 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 111,
1564 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
1565 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
1566 111, 111, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
1567 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
1568 110, 110, 110, 110, 110, 110, 105, 105, 105, 105, 105, 105, 105,
1569 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
1570 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 104, 104, 104,
1571 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1572 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1573 104, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1574 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1575 107, 107, 107, 107, 107, 107, 106, 106, 106, 106, 106, 106, 106,
1576 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
1577 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 21,
1578 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1579 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1580 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1581 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1582 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1583 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1584 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1585 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1586 20, 20, 20, 20, 20, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1587 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1588 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1589 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1590 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22,
1591 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1592 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1593 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1594 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1595 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 17, 17, 17, 17, 17, 17,
1596 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1597 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1598 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1599 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1600 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16,
1601 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1602 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1603 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1604 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1605 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1606 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 19,
1607 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1608 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1609 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1610 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1611 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1612 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1613 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1614 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1615 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1616 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1617 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1618 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1619 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1620 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1621 18, 18, 18, 18, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1622 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1623 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1624 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1625 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1626 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1627 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1628 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1629 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1630 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1631 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1632 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28,
1633 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1634 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1635 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1636 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1637 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1638 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1639 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1640 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1641 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1642 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1643 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1644 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1645 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1646 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1647 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1648 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1649 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1650 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1651 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1652 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1653 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1654 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1655 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1656 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1657 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1658 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1659 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1660 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1661 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1662 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1663 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1664 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
1665 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1666 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1667 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1668 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1669 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1670 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1671 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1672 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1673 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1674 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1675 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1676 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 18, 18, 18, 18, 18,
1677 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1678 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1679 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1680 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1681 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1682 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1683 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1684 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
1685 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1686 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1687 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1688 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1689 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1690 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
1691 19, 19, 19, 19, 19, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1692 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1693 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1694 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1695 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1696 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1697 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1698 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1699 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1700 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1701 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1702 17, 17, 17, 17, 17, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1703 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1704 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1705 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1706 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
1707 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1708 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1709 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1710 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
1711 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 20, 20, 20, 20, 20, 20,
1712 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1713 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1714 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
1715 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
1716 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1717 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1718 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1719 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
1720 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
1721 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
1722 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107,
1723 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1724 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 104, 104,
1725 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1726 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1727 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
1728 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
1729 105, 105, 105, 105, 105, 105, 110, 110, 110, 110, 110, 110, 110,
1730 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
1731 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111,
1732 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
1733 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
1734 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
1735 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
1736 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
1737 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
1738 109, 109, 109, 109, 109, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
1739 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
1740 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1741 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 96, 96,
1742 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
1743 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97,
1744 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
1745 97, 97, 97, 97, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
1746 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
1747 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103,
1748 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
1749 103, 103, 103, 103, 103, 100, 100, 100, 100, 100, 100, 100, 100,
1750 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1751 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101,
1752 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1753 101, 101, 101, 101, 101, 101, 122, 122, 122, 122, 122, 122, 122,
1754 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123,
1755 123, 123, 123, 123, 123, 123, 120, 120, 120, 120, 120, 120, 120,
1756 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121,
1757 121, 121, 121, 121, 121, 121, 126, 126, 126, 126, 126, 126, 126,
1758 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127,
1759 127, 127, 127, 127, 127, 124, 124, 124, 124, 124, 124, 124, 124,
1760 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125,
1761 125, 125, 125, 125, 125, 114, 114, 114, 114, 114, 114, 114, 114,
1762 114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115,
1763 115, 115, 115, 115, 115, 112, 112, 112, 112, 112, 112, 112, 112,
1764 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113,
1765 113, 113, 113, 113, 118, 118, 118, 118, 118, 118, 118, 118, 118,
1766 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119,
1767 119, 119, 119, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
1768 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
1769 117, 117, 117, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 72,
1770 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 78, 78, 78, 78,
1771 78, 78, 79, 79, 79, 79, 79, 79, 76, 76, 76, 76, 76, 76, 76, 77,
1772 77, 77, 77, 77, 77, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67,
1773 67, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 70, 70,
1774 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 68, 68, 68, 68, 68, 68,
1775 68, 69, 69, 69, 69, 69, 69, 90, 90, 90, 90, 90, 90, 91, 91, 91,
1776 91, 91, 91, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89,
1777 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 92, 92, 92, 92,
1778 92, 92, 93, 93, 93, 93, 93, 93, 93, 82, 82, 82, 82, 82, 82, 83,
1779 83, 83, 83, 83, 83, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81,
1780 81, 81, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 84, 84,
1781 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 90, 90, 90 };
1782
1783 /*===========================================================================*/
1784
1785 #endif /* NI4BTEL > 0 */