file
stringlengths 18
26
| data
stringlengths 2
1.05M
|
---|---|
the_stack_data/148157.c | #include<stdio.h>
main()
{
printf("Pick an item\n");
printf("1.pizza");
printf("2.burger");
printf("3.pasta");
printf("4.french fries");
printf("5.sandwich");
int choice;
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("you picked pizza\n prize of pizza=Rs239:");
scanf("%d",&choice) ;
break;
case 2:
printf("you picked burger\n prize of burger=Rs129:");
scanf("%d",&choice);
break;
case 3:
printf("you picked pasta\n prize of pasta=Rs179:");
scanf("%d",&choice);
break;
case 4:
printf("you picked french fries\n prize of French fries=Rs99:");
scanf("%d",&choice);
break;
case 5:
printf("you picked sandwich\n prize of sandwich=Rs149:");
scanf("%d",&choice);
break;
default:
printf("Invalid choice");
break;
}
return 0;
}
|
the_stack_data/9513252.c | /***
Fanti Andrea 235808
lab 11 ex. 01
*/
#include <stdio.h>
#include <stdlib.h>
#include <semaphore.h>
#include <time.h>
#include <pthread.h>
void tcore(char* s){
struct timespec time;
time.tv_sec= 0;
time.tv_nsec= (rand()%1001)*1000000; // converted to milliseconds
nanosleep(&time, NULL);
puts(s);
}
void* a (void* arg){
sem_t* sems;
sems= (sem_t*) arg;
tcore("A");
sem_post(&sems[0]);
sem_post(&sems[0]);
pthread_exit(NULL);
}
void* b (void* arg){
sem_t* sems;
sems= (sem_t*) arg;
sem_wait(&sems[0]);
tcore("B");
sem_post(&sems[1]);
pthread_exit(NULL);
}
void* c (void* arg){
sem_t* sems;
sems= (sem_t*) arg;
sem_wait(&sems[0]);
tcore("C");
sem_post(&sems[1]);
pthread_exit(NULL);
}
void* d (void* arg){
sem_t* sems;
sems= (sem_t*) arg;
sem_wait(&sems[1]);
sem_wait(&sems[1]);
tcore("D");
pthread_exit(NULL);
}
int main (int argc, char* argv[]){
sem_t sems[2];
int i;
pthread_t tids[4];
srand(time(NULL));
for (i= 0; i < 2; i++)
sem_init(&sems[i], 0, 0);
pthread_create(&tids[0], NULL, a, sems);
pthread_create(&tids[1], NULL, b, sems);
pthread_create(&tids[2], NULL, c, sems);
pthread_create(&tids[3], NULL, d, sems);
for (i= 0; i < 4; i++)
pthread_join(tids[i], NULL);
for (i= 0; i < 2; i++)
sem_destroy(&sems[i]);
return 0;
}
|
the_stack_data/20450144.c | #include <stdio.h>
/**
* main - prints all arguments it receives.
* @argc: number of command line arguments.
* @argv: array that contains the program command line arguments.
* Return: 0 - success.
*/
int main(int argc, char *argv[])
{
int i;
for (i = 0; i < argc; i++)
printf("%s\n", argv[i]);
return (0);
}
|
the_stack_data/89578.c | /*
* Sample demo application that showcases inter processor
* communication from linux userspace to a remote software
* context. The application generates random matrices and
* transmits them to the remote context over rpmsg. The
* remote application performs multiplication of matrices
* and transmits the results back to this application.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <time.h>
#include <fcntl.h>
#include <pthread.h>
#include <string.h>
#include <linux/rpmsg.h>
#define MATRIX_SIZE 6
struct _matrix {
unsigned int size;
unsigned int elements[MATRIX_SIZE][MATRIX_SIZE];
};
static void matrix_print(struct _matrix *m)
{
int i, j;
/* Generate two random matrices */
printf(" \r\n Master : Linux : Printing results \r\n");
for (i = 0; i < m->size; ++i) {
for (j = 0; j < m->size; ++j)
printf(" %d ", (unsigned int)m->elements[i][j]);
printf("\r\n");
}
}
static void generate_matrices(int num_matrices,
unsigned int matrix_size, void *p_data)
{
int i, j, k;
struct _matrix *p_matrix = p_data;
time_t t;
unsigned long value;
srand((unsigned) time(&t));
for (i = 0; i < num_matrices; i++) {
/* Initialize workload */
p_matrix[i].size = matrix_size;
printf(" \r\n Master : Linux : Input matrix %d \r\n", i);
for (j = 0; j < matrix_size; j++) {
printf("\r\n");
for (k = 0; k < matrix_size; k++) {
value = (rand() & 0x7F);
value = value % 10;
p_matrix[i].elements[j][k] = value;
printf(" %d ",
(unsigned int)p_matrix[i].elements[j][k]);
}
}
printf("\r\n");
}
}
static pthread_t ui_thread, compute_thread;
static pthread_mutex_t sync_lock;
static int charfd = -1, fd, compute_flag;
static int ntimes = 1;
static struct _matrix i_matrix[2];
static struct _matrix r_matrix;
#define RPMSG_GET_KFIFO_SIZE 1
#define RPMSG_GET_FREE_SPACE 3
void *ui_thread_entry(void *ptr)
{
int cmd, ret, i;
for (i=0; i < ntimes; i++){
printf("\r\n **********************************");
printf("****\r\n");
printf("\r\n Matrix multiplication demo Round %d \r\n", i);
printf("\r\n **********************************");
printf("****\r\n");
compute_flag = 1;
pthread_mutex_unlock(&sync_lock);
printf("\r\n Compute thread unblocked .. \r\n");
printf(" The compute thread is now blocking on");
printf("a read() from rpmsg device \r\n");
printf("\r\n Generating random matrices now ... \r\n");
generate_matrices(2, 6, i_matrix);
printf("\r\n Writing generated matrices to rpmsg ");
printf("rpmsg device, %d bytes .. \r\n",
sizeof(i_matrix));
write(fd, i_matrix, sizeof(i_matrix));
/* adding this so the threads
dont overlay the strings they print */
sleep(1);
printf("\r\nEnd of Matrix multiplication demo Round %d \r\n", i);
}
compute_flag = 0;
pthread_mutex_unlock(&sync_lock);
printf("\r\n Quitting application .. \r\n");
printf(" Matrix multiplication demo end \r\n");
return 0;
}
void *compute_thread_entry(void *ptr)
{
int bytes_rcvd;
pthread_mutex_lock(&sync_lock);
while (compute_flag == 1) {
do {
bytes_rcvd = read(fd, &r_matrix, sizeof(r_matrix));
} while ((bytes_rcvd < sizeof(r_matrix)) || (bytes_rcvd < 0));
printf("\r\n Received results! - %d bytes from ", bytes_rcvd);
printf("rpmsg device (transmitted from remote context) \r\n");
matrix_print(&r_matrix);
pthread_mutex_lock(&sync_lock);
}
return 0;
}
int rpmsg_create_ept(int rpfd, struct rpmsg_endpoint_info *eptinfo)
{
int ret;
ret = ioctl(rpfd, RPMSG_CREATE_EPT_IOCTL, eptinfo);
if (ret)
perror("Failed to create endpoint.\n");
return ret;
}
char *get_rpmsg_ept_dev_name(char *rpmsg_char_name, char *ept_name,
char *ept_dev_name)
{
char sys_rpmsg_ept_name_path[64];
char svc_name[64];
char *sys_rpmsg_path = "/sys/class/rpmsg";
FILE *fp;
int i;
int ept_name_len;
for (i = 0; i < 128; i++) {
sprintf(sys_rpmsg_ept_name_path, "%s/%s/rpmsg%d/name",
sys_rpmsg_path, rpmsg_char_name, i);
printf("checking %s\n", sys_rpmsg_ept_name_path);
fp = fopen(sys_rpmsg_ept_name_path, "r");
if (!fp) {
printf("failed to open %s\n", sys_rpmsg_ept_name_path);
break;
}
fgets(svc_name, sizeof(svc_name), fp);
fclose(fp);
printf("svc_name: %s.\n",svc_name);
ept_name_len = strlen(ept_name);
if (ept_name_len > sizeof(svc_name))
ept_name_len = sizeof(svc_name);
if (!strncmp(svc_name, ept_name, ept_name_len)) {
sprintf(ept_dev_name, "rpmsg%d", i);
return ept_dev_name;
}
}
printf("Not able to RPMsg endpoint file for %s:%s.\n",
rpmsg_char_name, ept_name);
return NULL;
}
int main(int argc, char *argv[])
{
unsigned int size;
int opt;
char *rpmsg_dev="/dev/rpmsg0";
char *rpmsg_char_name;
struct rpmsg_endpoint_info eptinfo;
while ((opt = getopt(argc, argv, "d:n:")) != -1) {
switch (opt) {
case 'd':
rpmsg_dev = optarg;
break;
case 'n':
ntimes = atoi(optarg);
break;
default:
printf("getopt return unsupported option: -%c\n",opt);
break;
}
}
printf("\r\n Matrix multiplication demo start \r\n");
printf("\r\n Open rpmsg dev %s! \r\n", rpmsg_dev);
fd = open(rpmsg_dev, O_RDWR);
if (fd < 0) {
perror("Failed to open rpmsg device.\n");
return -1;
}
rpmsg_char_name = strstr(rpmsg_dev, "rpmsg_ctrl");
if (rpmsg_char_name != NULL) {
char ept_dev_name[16];
char ept_dev_path[32];
int ret;
strcpy(eptinfo.name, "rpmsg-openamp-demo-channel");
eptinfo.src = 0;
eptinfo.dst = 0xFFFFFFFF;
ret = rpmsg_create_ept(fd, &eptinfo);
if (ret) {
printf("failed to create RPMsg endpoint.\n");
return -1;
}
charfd = fd;
if (!get_rpmsg_ept_dev_name(rpmsg_char_name, eptinfo.name,
ept_dev_name))
return -1;
sprintf(ept_dev_path, "/dev/%s", ept_dev_name);
fd = open(ept_dev_path, O_RDWR | O_NONBLOCK);
if (fd < 0) {
perror("Failed to open rpmsg device.");
close(charfd);
return -1;
}
}
if (pthread_mutex_init(&sync_lock, NULL) != 0)
printf("\r\n mutex initialization failure \r\n");
pthread_mutex_lock(&sync_lock);
printf("\r\n Creating ui_thread and compute_thread ... \r\n");
pthread_create(&ui_thread, NULL, &ui_thread_entry, "ui_thread");
pthread_create(&compute_thread, NULL, &compute_thread_entry,
"compute_thread");
pthread_join(ui_thread, NULL);
pthread_join(compute_thread, NULL);
close(fd);
if (charfd >= 0)
close(charfd);
printf("\r\n Quitting application .. \r\n");
printf(" Matrix multiply application end \r\n");
pthread_mutex_destroy(&sync_lock);
return 0;
}
|
the_stack_data/408418.c | #include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
/*
* No such concept in plan9, but supposed to be always successful
*/
mode_t
umask(mode_t mode)
{
return 0;
}
|
the_stack_data/111079437.c | #include <stdio.h>
int main(void)
{
puts("Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.");
puts("- Linus Torvalds");
return (98);
}
|
the_stack_data/147141.c | /* Copyright (c) Piotr Durlej
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
int strlen(char *s)
{
int i = 0;
while (s[i++]);
return i - 1;
}
|
the_stack_data/1249535.c | //===--- offset.c --- Test Cases for Bit Accurate Types -------------------===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This is a test for data size calculation with non-regular integral type.
//
//===----------------------------------------------------------------------===//
#include <stdio.h>
typedef int __attribute__ ((bitwidth(33))) int33;
struct s { int33 field[0]; };
#define OFFS (((char *) &((struct s *) 0)->field[1]) - (char *) 0)
int foo[OFFS];
int main()
{
printf("%d\n", OFFS);
return 0;
}
|
the_stack_data/167331523.c | // Tests for macro expansion backtraces. The RUN and CHECK lines are grouped
// below the test code to reduce noise when updating them.
#define M1(A, B) ((A) < (B))
#define M2(A, B) M1(A, B)
#define M3(A, B) M2(A, B)
#define M4(A, B) M3(A, B)
#define M5(A, B) M4(A, B)
#define M6(A, B) M5(A, B)
#define M7(A, B) M6(A, B)
#define M8(A, B) M7(A, B)
#define M9(A, B) M8(A, B)
#define M10(A, B) M9(A, B)
#define M11(A, B) M10(A, B)
#define M12(A, B) M11(A, B)
void f(int *ip, float *fp) {
if (M12(ip, fp)) { }
// RUN: %clang_cc1 -fsyntax-only -fmacro-backtrace-limit 5 %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-LIMIT
// CHECK-LIMIT: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *')
// CHECK-LIMIT: if (M12(ip, fp)) { }
// CHECK-LIMIT: macro-backtrace.c:15:19: note: expanded from macro 'M12'
// CHECK-LIMIT: #define M12(A, B) M11(A, B)
// CHECK-LIMIT: macro-backtrace.c:14:19: note: expanded from macro 'M11'
// CHECK-LIMIT: #define M11(A, B) M10(A, B)
// CHECK-LIMIT: note: (skipping 7 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
// CHECK-LIMIT: macro-backtrace.c:6:18: note: expanded from macro 'M3'
// CHECK-LIMIT: #define M3(A, B) M2(A, B)
// CHECK-LIMIT: macro-backtrace.c:5:18: note: expanded from macro 'M2'
// CHECK-LIMIT: #define M2(A, B) M1(A, B)
// CHECK-LIMIT: macro-backtrace.c:4:23: note: expanded from macro 'M1'
// CHECK-LIMIT: #define M1(A, B) ((A) < (B))
// RUN: %clang_cc1 -fsyntax-only -fno-caret-diagnostics %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-NO-CARETS
// CHECK-NO-CARETS: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *')
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:15:19: note: expanded from macro 'M12'
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:14:19: note: expanded from macro 'M11'
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:13:19: note: expanded from macro 'M10'
// CHECK-NO-CARETS-NEXT: note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:6:18: note: expanded from macro 'M3'
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:5:18: note: expanded from macro 'M2'
// CHECK-NO-CARETS-NEXT: macro-backtrace.c:4:23: note: expanded from macro 'M1'
// Check that the expansion notes respect the same formatting options as
// other diagnostics.
// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-format vi %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-NOTE-FORMAT
// CHECK-NOTE-FORMAT: macro-backtrace.c +18:7: warning:
// CHECK-NOTE-FORMAT: macro-backtrace.c +15:19: note:
// CHECK-NOTE-FORMAT: macro-backtrace.c +14:19: note:
// CHECK-NOTE-FORMAT: note:
// CHECK-NOTE-FORMAT: macro-backtrace.c +6:18: note:
// CHECK-NOTE-FORMAT: macro-backtrace.c +5:18: note:
// CHECK-NOTE-FORMAT: macro-backtrace.c +4:23: note:
}
|
the_stack_data/96434.c | /* libyywrap - flex run-time support library "yywrap" function */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* 1. Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* Neither the name of the University nor the names of its contributors */
/* may be used to endorse or promote products derived from this software */
/* without specific prior written permission. */
/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE. */
int yywrap (void);
int yywrap (void)
{
return 1;
}
|
the_stack_data/417554.c | #include <stdio.h>
main(argc,argv)
int argc;
char *argv[];
{
int i;
static int force = 1;
for(i = 1 ; i < argc ; ++i)
if( strcmp(argv[i], "-c") )
touch(force, argv[i]);
else
force = 0;
}
#include <sys/types.h>
#include <sys/stat.h>
touch(force, name)
int force;
char *name;
{
struct stat stbuff;
char junk[1];
int fd;
if( stat(name,&stbuff) < 0)
if(force)
goto create;
else
{
fprintf(stderr, "touch: file %s does not exist.\n", name);
return;
}
if(stbuff.st_size == 0)
goto create;
if( (fd = open(name, 2)) < 0)
goto bad;
if( read(fd, junk, 1) < 1)
{
close(fd);
goto bad;
}
lseek(fd, 0L, 0);
if( write(fd, junk, 1) < 1 )
{
close(fd);
goto bad;
}
close(fd);
return;
bad:
fprintf(stderr, "Cannot touch %s\n", name);
return;
create:
if( (fd = creat(name, 0666)) < 0)
goto bad;
close(fd);
}
|
the_stack_data/170453259.c | #include <stdio.h>
#define PI 3.14
#define ANGOLO_PIATTO_IN_GRADI 180
int main()
{ float angoloGradi, angoloRadianti;
printf("Inserire l'angolo in gradi: ");
scanf("%f", &angoloGradi);
angoloRadianti = angoloGradi * PI / ANGOLO_PIATTO_IN_GRADI;
printf("L'angolo di %.2f° in radianti e': %.2f rad\n", angoloGradi, angoloRadianti);
return 0;
} |
the_stack_data/220456215.c |
/* $Log: tcas.c,v $
* Revision 10/2020 elbaum -- fault version -- _fl3.c
* */
#include <stdio.h>
#include <stdlib.h>
#define OLEV 600 /* in feets/minute */
#define MAXALTDIFF 600 /* max altitude difference in feet */
#define MINSEP 300 /* min separation in feet */
#define NOZCROSS 100 /* in feet */
/* variables */
typedef int bool;
int Cur_Vertical_Sep;
bool High_Confidence;
bool Two_of_Three_Reports_Valid;
int Own_Tracked_Alt;
int Own_Tracked_Alt_Rate;
int Other_Tracked_Alt;
int Alt_Layer_Value; /* 0, 1, 2, 3 */
int Positive_RA_Alt_Thresh[4];
int Up_Separation;
int Down_Separation;
/* state variables */
int Other_RAC; /* NO_INTENT, DO_NOT_CLIMB, DO_NOT_DESCEND */
#define NO_INTENT 0
#define DO_NOT_CLIMB 1
#define DO_NOT_DESCEND 2
int Other_Capability; /* TCAS_TA, OTHER */
#define TCAS_TA 1
#define OTHER 2
int Climb_Inhibit; /* true/false */
#define UNRESOLVED 0
#define UPWARD_RA 1
#define DOWNWARD_RA 2
void initialize()
{
Positive_RA_Alt_Thresh[0] = 400;
Positive_RA_Alt_Thresh[1] = 500;
Positive_RA_Alt_Thresh[2] = 640;
Positive_RA_Alt_Thresh[3] = 740;
}
int ALIM ()
{
return Positive_RA_Alt_Thresh[Alt_Layer_Value];
}
int Inhibit_Biased_Climb ()
{
return (Climb_Inhibit ? Up_Separation + NOZCROSS : Up_Separation);
}
bool Own_Below_Threat()
{
return (Own_Tracked_Alt < Other_Tracked_Alt);
}
bool Own_Above_Threat()
{
return (Other_Tracked_Alt < Own_Tracked_Alt);
}
bool Non_Crossing_Biased_Climb()
{
int upward_preferred;
bool result;
upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
if (upward_preferred)
{
result = !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= ALIM())));
}
else
{
result = Own_Above_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= ALIM());
}
return result;
}
bool Non_Crossing_Biased_Descend()
{
int upward_preferred;
bool result;
upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
if (upward_preferred)
{
result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM());
}
else
{
result = Own_Above_Threat() && (Up_Separation >= ALIM());
}
return result;
}
int alt_sep_test()
{
bool enabled, tcas_equipped, intent_not_known;
bool need_upward_RA, need_downward_RA;
int alt_sep;
enabled = High_Confidence && (Own_Tracked_Alt_Rate <= OLEV);
tcas_equipped = Other_Capability == TCAS_TA;
intent_not_known = Two_of_Three_Reports_Valid && Other_RAC == NO_INTENT;
alt_sep = UNRESOLVED;
if (enabled && ((tcas_equipped && intent_not_known) || !tcas_equipped))
{
need_upward_RA = Non_Crossing_Biased_Climb() && Own_Below_Threat();
need_downward_RA = Non_Crossing_Biased_Descend() && Own_Above_Threat();
if (need_upward_RA && need_downward_RA)
/* intentionally unreachable: requires Own_Below_Threat and Own_Above_Threat
to both be true - that requires Own_Tracked_Alt < Other_Tracked_Alt
and Other_Tracked_Alt < Own_Tracked_Alt, which isn't possible */
alt_sep = UNRESOLVED;
else if (need_upward_RA)
alt_sep = UPWARD_RA;
else if (need_downward_RA)
alt_sep = DOWNWARD_RA;
else
alt_sep = UNRESOLVED;
}
return alt_sep;
}
int main(argc, argv)
int argc;
char *argv[];
{//Mutant [change '<13' to '<15']
if(argc < 15)
{
fprintf(stdout, "Error: Command line arguments");
exit(1);
}
initialize();
Cur_Vertical_Sep = atoi(argv[1]);
High_Confidence = atoi(argv[2]);
Two_of_Three_Reports_Valid = atoi(argv[3]);
Own_Tracked_Alt = atoi(argv[4]);
Own_Tracked_Alt_Rate = atoi(argv[5]);
Other_Tracked_Alt = atoi(argv[6]);
Alt_Layer_Value = atoi(argv[7]);
Up_Separation = atoi(argv[8]);
Down_Separation = atoi(argv[9]);
Other_RAC = atoi(argv[10]);
Other_Capability = atoi(argv[11]);
Climb_Inhibit = atoi(argv[12]);
fprintf(stdout, "%d\n", alt_sep_test());
exit(0);
}
|
the_stack_data/799573.c | #include <stdio.h>
#include <stdlib.h>
enum { len = 14, root = 1 };
void swap(int* a, int* b) {
int* t;
t = b;
b = a;
a = t;
}
void shiftup(size_t len, int x[len], size_t n) {
size_t i, p;
i = n;
for (;;) {
if (i == 1) { break; }
p = i/2;
if (x[p] <= x[i]) { break; }
swap(&x[p], &x[i]);
i = p;
}
}
void shiftdown(size_t len, int x[len], size_t n) {
size_t i, c;
i = 1;
for (;;) {
c = 2*i;
if (c > n) { break; }
if (c+1 <= n) {
if (x[c+1] < x[c]) { c += 1; }
}
if (x[i] <= x[c]) { break; }
swap(&x[c], &x[i]);
i = c;
}
}
int main(int argc, char* argv[argc+1]) {
int x[len] = {0, 12, 20, 15, 29, 23, 17, 22, 35, 40, 26, 51, 19, 13};
int y[len] = {0, 18, 20, 15, 29, 23, 17, 22, 35, 40, 26, 51, 19, 100};
shiftup(len, x, len-1);
shiftdown(len, x, len-1);
for (size_t i = 0; i < len; ++i) {
printf("%d ", x[i]);
}
puts("");
for (size_t i = 0; i < len; ++i) {
printf("%d ", y[i]);
}
puts("");
return EXIT_SUCCESS;
}
|
the_stack_data/51634.c | #include <argp.h>
#include <error.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
/* kernel accepts window sizes ranging from 500ms to 10s
* Default to minimum window size for polling */
#define CPU_WIN 500 // 0.5 seconds
#define IO_WIN 500 // 1000 is 1 second
#define MEM_WIN 500 // 750 is 0.75 seconds
#define MS_TO_US 1000 // millisecs to microseconds factor
/* min monitoring update interval is 50ms and max is 1s
* Default to minimum trigger threshold for delay */
#define CPU_TRIG 50 // 50 ms
#define IO_TRIG 50 // 100 is 0.1 seconds
#define MEM_TRIG 50 // 75 is 75 ms
/* paths to the pressure stall information files writable by kernel 5.2+ */
#define CPU_PSI "/proc/pressure/cpu"
#define IO_PSI "/proc/pressure/io"
#define MEMORY_PSI "/proc/pressure/memory"
/* index values to refer to each of the pressure files */
#define IDX_CPU 0
#define IDX_IO 1
#define IDX_MEM 2
/* format values to refer to '%T' vs '%s' time formats */
#define FMT_YMD_HMS 0
#define FMT_EPOCH 1
/* size values for the length of different char arrays */
#define SZ_IDX 3
#define SZ_CONTENT 128
#define SZ_EVENT 256
#define SZ_TIME 21
#define SZ_EPOCH 11
/* errors defined to differentiate program exit values */
#define E_KERNEL_UNSUPPORTED 1
#define E_PRESSURE_OPEN 2
#define E_PRESSURE_WRITE 3
#define E_PRESSURE_POLL_FDS 4
#define E_PSI_GONE 5
#define E_PRESSURE_EVENT_UNK 6
#define E_CPU_TRIG_VALUE 7
#define E_CPU_WIN_VALUE 8
#define E_IO_TRIG_VALUE 9
#define E_IO_WIN_VALUE 10
#define E_MEM_TRIG_VALUE 11
#define E_MEM_WIN_VALUE 12
#define E_ALL_TRIG_VALUE 13
#define E_ALL_WIN_VALUE 14
#define E_TIME_VALUE 15
#define E_REQUIRED_ARGUMENT 16
const char *argp_program_version =
"pressure 0.1";
const char *argp_program_bug_address =
"<[email protected]>";
/* Program documentation. */
static char doc[] =
"pressure 0.1 -- a program to allow you to set triggers for \
Pressure Stall Information (PSI) to report when processes are \
being stalled by unavailable CPU, I/O, or Memory resources. \
\vThe pressure program is currently under development. \
Use as-is without any warranties.\n";
/* A description of the arguments we accept. */
static char args_doc[] = "some|full|both [OPTION...]";
/* Keys for options without short-options. */
#define OPT_ABORT 1 /* –abort */
/* Used by main to communicate with parse_opt. */
struct arguments
{
char **strings; /* [string…] */
char *all_trigger; /* ms arg to ‘--all-trigger’ */
char *all_window; /* ms arg to ‘--all-window’ */
char *arg1; /* arg1 */
char *cpu_trigger; /* ms arg to ‘--cpu-trig’ */
char *cpu_window; /* ms arg to ‘--cpu-window’ */
char *io_trigger; /* ms arg to ‘--io-trig’ */
char *io_window; /* ms arg to ‘--io-window’ */
char *mem_trigger; /* ms arg to ‘--memory-trigger’ */
char *mem_window; /* ms arg to ‘--memory-window’ */
char *output_file; /* file arg to ‘--output’ */
char *time; /* time arg to ‘--time’ */
int quiet, verbose, abort; /* ‘-v’, ‘--abort’ */
};
FILE *outstream;
char *pressure_file[SZ_IDX];
char content_str[SZ_CONTENT];
char time_str[SZ_TIME];
double start_time_s;
int timeout_s;
int MAX_TRIG = 1000; // ten seconds
int MAX_WIN = 10000; // ten seconds
int MIN_TRIG = 50; // 0.05 seconds or 50 ms
int MIN_WIN = 500; // 0.5 seconds
int active_tracking[SZ_IDX];
int continue_event_loop = 1;
int delay_threshold_ms[SZ_IDX];
int full;
int out_fd;
int some;
int tracking_window_ms[SZ_IDX];
struct arguments arguments;
struct pollfd fds[SZ_IDX];
/* The argp_options that show in help.*/
static struct argp_option options[] = {
{"all-trigger", 't', "ms", 0, "Set Global threshold to (500-10000ms) to TRIGGER" },
{"all-window", 'w', "ms", 0, "Set Global window (500-10000ms) to WIN" },
{"cpu-trigger", 'C', "ms", 0, "Set CPU threshold (50-1000ms) 0 to disable CPU monitoring" },
{"cpu-window", 'c', "ms", 0, "Set CPU window (500-10000ms) 0 to disable CPU monitoring" },
{"io-trigger", 'I', "ms", 0, "Set IO threshold (50-1000ms) 0 to disable IO monitoring" },
{"io-window", 'i', "ms", 0, "Set IO window (500-10000ms) 0 to disable IO monitoring" },
{"mem-trigger", 'M', "ms", 0, "Set MEMORY threshold (50-1000ms) 0 to disable MEMORY monitoring" },
{"mem-window", 'm', "ms", 0, "Set MEMORY window (500-10000ms) 0 to disable MEMORY monitoring" },
{"quiet", 'q', 0, 0, "Don't produce any output" },
{"time", 'T', "secs", 0, "Set time to end monitoring in seconds." },
{"verbose", 'v', 0, 0, "Produce verbose output" },
{"output", 'o', "FILE", 0,
"Output to FILE instead of standard output" },
{ 0 }
};
/* set the global time_str char array to the ISO formatted time */
void set_time_str(int fmt) {
time_t now;
struct tm* tm_info;
time(&now);
tm_info = localtime(&now);
strftime(time_str, SZ_TIME, "%Y-%m-%d %H:%M:%S", tm_info);
}
/* close all file descriptors before exiting */
void close_fds(){
if (arguments.verbose == 1) {
fprintf(stderr, "Please wait until all file descriptors are closed\n");
set_time_str(FMT_YMD_HMS);
if (arguments.quiet == 0) {
if (arguments.output_file != NULL)
fprintf(outstream, "Polling events stopping at %s\n", time_str);
fprintf(stdout, "Polling events stopping at %s\n", time_str);
}
}
for (int i=0; i < SZ_IDX; i++){
if (arguments.verbose == 1) fprintf(stderr, "Closing file descriptor fds[%i] for %s\n", i, pressure_file[i]);
usleep(tracking_window_ms[i] * MS_TO_US);
close(fds[i].fd);
}
if (arguments.output_file != NULL) {
if (arguments.verbose == 1) fprintf(stderr, "Closing file descriptor %s\n", arguments.output_file);
fclose(outstream);
}
if (arguments.verbose == 1) fprintf(stderr, "\nAll file descriptors closed, exiting now!\n");
}
/* signal handler for SIGINT and SIGTERM */
void sig_handler(int sig_num) {
/* Reset handler to catch SIGINT next time.
Refer http://en.cppreference.com/w/c/program/signal */
if (sig_num == SIGINT) {
if (arguments.verbose == 1) printf("\nInterrupted in response to Ctrl+C \n");
signal(SIGINT, sig_handler);
}
if (sig_num == SIGTERM) {
if (arguments.verbose == 1) printf("\nEnding because of timeout or Terminate signal\n");
signal(SIGTERM, sig_handler);
}
continue_event_loop = 0;
close_fds();
fflush(stdout);
}
/* set the global content_str char array to the contents of a PSI file */
void read_psi_file(int psi_idx) {
int fd;
memset(&(content_str[0]), 0, SZ_CONTENT);
fd = open(pressure_file[psi_idx], O_NONBLOCK | O_RDONLY);
read(fd, content_str, SZ_CONTENT);
close(fd);
}
/* set the event delay for `some delay_threshold_ms tracking_window_ms`
* so tasks delayed greater than the threshold time within a tracking window
* will cause an event indicating that condition of distress
*/
void poll_pressure_events() {
char distress_event[SZ_EVENT];
for (int i = 0; i < SZ_IDX; i++) {
if (active_tracking[i] == 0) continue;
memset(&(distress_event[0]), 0, SZ_EVENT); // clear distress_event
fds[i].fd = open(pressure_file[i], O_RDWR | O_NONBLOCK);
if (fds[i].fd < 0) {
fprintf(stderr, "Error open() pressure file %s:", pressure_file[i]);
exit(E_PRESSURE_OPEN);
}
if (i == IDX_CPU) { // don't print full for the cpu
if (some == 1) {
snprintf(distress_event, SZ_EVENT, "some %d %d",
delay_threshold_ms[i] * MS_TO_US,
tracking_window_ms[i] * MS_TO_US);
if (write(fds[i].fd, distress_event, strlen(distress_event) + 1) < 0) {
fprintf(stderr, "Error write() pressure file: %s\n",
pressure_file[i]);
exit(E_PRESSURE_WRITE);
}
if (arguments.output_file != NULL)
fprintf(outstream, "\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
if (arguments.quiet == 0 && arguments.verbose == 1)
fprintf(stdout, "\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
}
} else {
if (full == 1) {
snprintf(distress_event, SZ_EVENT, "full %d %d",
delay_threshold_ms[i] * MS_TO_US,
tracking_window_ms[i] * MS_TO_US);
if (write(fds[i].fd, distress_event, strlen(distress_event) + 1) < 0) {
fprintf(stderr, "Error write() pressure file: %s\n",
pressure_file[i]);
exit(E_PRESSURE_WRITE);
}
if (arguments.output_file != NULL)
fprintf(outstream, "\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
if (arguments.quiet == 0 && arguments.verbose == 1)
fprintf(stdout, "\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
}
if (some == 1) {
snprintf(distress_event, SZ_EVENT, "some %d %d",
delay_threshold_ms[i] * MS_TO_US,
tracking_window_ms[i] * MS_TO_US);
if (write(fds[i].fd, distress_event, strlen(distress_event) + 1) < 0) {
fprintf(stderr, "Error write() pressure file: %s\n",
pressure_file[i]);
exit(E_PRESSURE_WRITE);
}
if (arguments.output_file != NULL)
fprintf(outstream,"\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
if (arguments.quiet == 0 && arguments.verbose == 1)
fprintf(stdout, "\n%s distress_event:\n%s\n", pressure_file[i], distress_event);
}
}
fds[i].events = POLLPRI;
}
}
/* loop until program is terminated or interrupted
* increment event_counter for cpu, io, and memory
* continue polling for events until continue_event_loop
* changes value */
void pressure_event_loop() {
time_t timer;
double time_now_s;
if (active_tracking[IDX_CPU] == 0 && active_tracking[IDX_IO] == 0 && active_tracking[IDX_MEM] == 0) {
fprintf(stderr, "\nThere is nothing to monitor. Exiting program.\n");
exit(E_PRESSURE_POLL_FDS);
}
int event_counter[SZ_IDX];
for (int i = 0; i < SZ_IDX; i++) {
event_counter[i] = 0;
}
while (continue_event_loop == 1) {
time_now_s = time(&timer);
time_now_s = time_now_s - start_time_s;
if (timeout_s > 0) {
if (time_now_s > timeout_s){
raise(SIGTERM);
}
}
if ( continue_event_loop == 0) break;
int n = poll(fds, SZ_IDX, -1);
if (n < 0) {
fprintf(stderr, "\nError using poll() function\n");
exit(E_PRESSURE_POLL_FDS);
}
for (int i = 0; i < SZ_IDX; i++) {
if (full == 1 && some == 0 && i == 0) continue; //skip polling cpu if only full
if (active_tracking[i] == 0) continue; // if not tracking pressure resource
if ((fds[i].revents == 0) || (continue_event_loop == 0)) {
continue;
}
if (fds[i].revents & POLLERR) {
fprintf(stderr, "\nError: poll() event source is gone.\n");
exit(E_PSI_GONE);
}
if (fds[i].events) { // An event has crossed the trigger threshold within the tracking window
set_time_str(FMT_YMD_HMS);
read_psi_file(i);
event_counter[i]++;
if (arguments.output_file != NULL)
fprintf(outstream, "%s %i %s %s\n", pressure_file[i], event_counter[i], time_str, content_str);
if (arguments.quiet == 0 && arguments.verbose)
fprintf(stdout, "%s %i %s %s\n", pressure_file[i], event_counter[i], time_str, content_str);
} else {
fprintf(stderr, "\nUnrecognized event: 0x%x.\n", fds[i].revents);
exit(E_PRESSURE_EVENT_UNK);
}
}
}
}
void verify_proc_pressure() {
for (int i = 0; i < SZ_IDX; i++) {
fds[i].fd = open(pressure_file[i], O_RDWR | O_NONBLOCK);
if (fds[i].fd < 0) {
fprintf(stderr, "Error open() pressure file %s:", pressure_file[i]);
fprintf(stderr,
"To monitor with poll() in Linux, uname -r must report a kernel version of 5.2+\n");
exit(E_KERNEL_UNSUPPORTED);
} else {
read_psi_file(i);
if (arguments.output_file != NULL)
fprintf(outstream, "%s content:\n%s\n", pressure_file[i], content_str);
if (arguments.quiet == 0 && arguments.verbose == 1)
fprintf(stdout, "%s content:\n%s\n", pressure_file[i], content_str);
}
}
set_time_str(FMT_YMD_HMS);
if (arguments.quiet == 0 && arguments.verbose == 1) {
if (arguments.output_file != NULL)
fprintf(outstream, "Polling events starting at %s", time_str);
fprintf(stdout, "Polling events starting at %s", time_str);
}
}
/* Parse a single option. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
/* Get the input argument from argp_parse, which we
know is a pointer to our arguments structure. */
struct arguments *arguments = state->input;
switch (key)
{
case 'q':
arguments->quiet = 1;
break;
case 'v':
arguments->verbose = 1;
break;
case 'c':
arguments->cpu_window = arg;
break;
case 'C':
arguments->cpu_trigger = arg;
break;
case 'i':
arguments->io_window = arg;
break;
case 'I':
arguments->io_trigger = arg;
break;
case 'm':
arguments->mem_window = arg;
break;
case 'M':
arguments->mem_trigger = arg;
break;
case 'o':
arguments->output_file = arg;
break;
case 'w':
arguments->all_window = arg;
break;
case 't':
arguments->all_trigger = arg;
break;
case 'T':
arguments->time = arg;
break;
case ARGP_KEY_NO_ARGS:
break;
case ARGP_KEY_ARG:
arguments->arg1 = arg;
if (strcmp(arg, "some") == 0) {
some = 1;
full = 0;
} else if (strcmp(arg, "full") == 0) {
some = 0;
full = 1;
} else if (strcmp(arg, "both") == 0) {
some = 1;
full = 1;
} else {
fprintf(stderr, "Missing required argument some | full | both\n");
printf("%s\n", doc);
exit(E_REQUIRED_ARGUMENT);
}
arguments->strings = &state->argv[state->next];
state->next = state->argc;
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
void populate_arrays(struct arguments *arguments) {
/* The kernel accepts window sizes ranging from 500ms to 10s, therefore min monitoring update interval is 50ms and max is 1s.
* Use these limits to validate options
*/
time_t start_t;
if (arguments->output_file != NULL) {
outstream = fopen(arguments->output_file, "w");
} else {
outstream = stdout;
}
if (arguments->time != NULL) {
timeout_s = atoi(arguments->time);
if (timeout_s > 0) {
if (arguments->verbose == 1) fprintf(stdout, "-T %s time to end monitoring in seconds.\n", arguments->time);
start_time_s = time(&start_t);
} else {
exit (E_TIME_VALUE);
}
}
if (arguments->cpu_trigger != NULL) {
int cpu_t = atoi (arguments->cpu_trigger);
if (arguments->verbose == 1) fprintf(stdout, "-C %i cpu delay_threshold_ms\n", cpu_t);
if (cpu_t >= MIN_TRIG && cpu_t <= MAX_TRIG) { // 50ms to 1s
delay_threshold_ms[IDX_CPU] = cpu_t;
if (tracking_window_ms[IDX_CPU] < cpu_t)
tracking_window_ms[IDX_CPU] = delay_threshold_ms[IDX_CPU];
} else if (cpu_t == 0) { // disable cpu monitoring
fprintf(stdout, "Since -C or --cpu-trig was set to 0, CPU pressure stall monitoring is disabled\n");
active_tracking[IDX_CPU] = 0;
} else {
fprintf(stderr, "The -C or --cpu-trig option is required integer between 50 to 1000 (ms)\n", arguments->cpu_trigger);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->cpu_trigger);
exit(E_CPU_TRIG_VALUE);
}
}
if (arguments->cpu_window != NULL) {
int cpu_w = atoi (arguments->cpu_window);
if (arguments->verbose == 1) fprintf(stdout, "-c %i cpu tracking_window_ms\n", cpu_w);
if (cpu_w >= MIN_WIN && cpu_w <= MAX_WIN) { // 500ms to 10s
tracking_window_ms[IDX_CPU] = cpu_w;
if (cpu_w < delay_threshold_ms[IDX_CPU]) {
delay_threshold_ms[IDX_CPU] = cpu_w / 10;
}
} else if (cpu_w == 0) { // disable cpu monitoring
fprintf(stdout, "Since -c or --cpu-win was set to 0, CPU pressure stall monitoring is disabled\n");
active_tracking[IDX_CPU] = 0;
} else {
fprintf(stderr, "The -c or --cpu-win option required to be integer between 500 to 10000000 (ms)\n", arguments->cpu_window);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->cpu_window);
exit(E_CPU_WIN_VALUE);
}
}
if (arguments->io_trigger != NULL) {
int io_t = atoi (arguments->io_trigger);
if (arguments->verbose == 1) fprintf(stdout, "-I %i io delay_threshold_ms\n", io_t);
if (io_t >= MIN_TRIG && io_t <= MAX_TRIG) { // 50ms to 1s
delay_threshold_ms[IDX_IO] = io_t;
if (tracking_window_ms[IDX_IO] < io_t)
tracking_window_ms[IDX_IO] = io_t;
} else if (io_t == 0) { // disable IO monitoring
fprintf(stdout, "Since -Ior --io-trig was set to 0, IO pressure stall monitoring is disabled\n");
active_tracking[IDX_IO] = 0;
} else {
fprintf(stderr, "The -I or --io-trig option is required integer between 50 to 1000 (ms)\n", arguments->io_trigger);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->io_trigger);
exit(E_IO_TRIG_VALUE);
}
}
if (arguments->io_window != NULL) {
int io_w = atoi (arguments->io_window);
if (arguments->verbose == 1) fprintf(stdout, "-i %i io tracking_window_ms\n", io_w);
if (io_w >= MIN_WIN && io_w <= MAX_WIN) { // 500ms to 10s
tracking_window_ms[IDX_IO] = io_w;
if (tracking_window_ms[IDX_IO] < delay_threshold_ms[IDX_IO])
tracking_window_ms[IDX_IO] = delay_threshold_ms[IDX_IO];
} else if (io_w == 0) { // disable IO monitoring
fprintf(stdout, "Since -i or --io-win was set to 0, IO pressure stall monitoring is disabled\n");
active_tracking[IDX_IO] = 0;
} else {
fprintf(stderr, "The -i or --io-win option required to be integer between 500 to 10000000 (ms)\n", arguments->io_window);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->io_window);
exit(E_IO_WIN_VALUE);
}
}
if (arguments->mem_trigger != NULL) {
int mem_t = atoi (arguments->mem_trigger);
if (arguments->verbose == 1) fprintf(stdout, "-M %i mem delay_threshold_ms\n", mem_t);
if (mem_t >= MIN_TRIG && mem_t <= MAX_TRIG) { // 50ms to 1s
delay_threshold_ms[IDX_MEM] = mem_t;
if (tracking_window_ms[IDX_MEM] < mem_t)
tracking_window_ms[IDX_MEM] = mem_t;
} else if (mem_t == 0) { // disable MEMORY monitoring
fprintf(stdout, "Since -M or --mem-trig was set to 0, MEMORY pressure stall monitoring is disabled\n");
active_tracking[IDX_MEM] = 0;
} else {
fprintf(stderr, "The -M or --mem-trig option is required integer between 50 to 1000 (ms)\n", arguments->mem_trigger);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->mem_trigger);
exit(E_MEM_TRIG_VALUE);
}
}
if (arguments->mem_window != NULL) {
int mem_w = atoi (arguments->mem_window);
if (arguments->verbose == 1) fprintf(stdout, "-m %i mem tracking_window_ms\n", mem_w);
if (mem_w >= MIN_WIN && mem_w <= MAX_WIN) { // 500ms to 10s
tracking_window_ms[IDX_MEM] = mem_w;
if (tracking_window_ms[IDX_MEM] < delay_threshold_ms[IDX_MEM])
tracking_window_ms[IDX_MEM] = delay_threshold_ms[IDX_MEM];
} else if (mem_w == 0) { // disable MEMORY monitoring
fprintf(stdout, "Since -m or --mem-win was set to 0, MEMORY pressure stall monitoring is disabled\n");
active_tracking[IDX_MEM] = 0;
} else {
fprintf(stderr, "The -m or --mem-win option required to be integer between 500 to 10000000 (ms)\n", arguments->mem_window);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->mem_window);
exit(E_MEM_WIN_VALUE);
}
}
// global trigger and threshold
if (arguments->all_trigger != NULL) {
if (arguments->cpu_trigger != NULL || arguments->io_trigger != NULL || arguments->mem_trigger != NULL) {
fprintf(stderr, "The -t or --all-trig option cannot be used with cpu, io, or memory options.\n", arguments->all_trigger);
exit(E_ALL_TRIG_VALUE);
}
active_tracking[IDX_CPU] = 1;
active_tracking[IDX_IO] = 1;
active_tracking[IDX_MEM] = 1;
int all_t = atoi (arguments->all_trigger);
if (arguments->verbose == 1) fprintf(stdout, "-t %i all delay_threshold_ms\n", all_t);
if (all_t >= MIN_TRIG && all_t <= MAX_TRIG) { // 50ms to 1s
delay_threshold_ms[IDX_CPU] = all_t;
delay_threshold_ms[IDX_IO] = all_t;
delay_threshold_ms[IDX_MEM] = all_t;
// ensure tracking_window_ms >= delay_threshold_ms
tracking_window_ms[IDX_CPU] = ( all_t > tracking_window_ms[IDX_CPU] ? all_t : tracking_window_ms[IDX_CPU] );
tracking_window_ms[IDX_IO] = ( all_t > tracking_window_ms[IDX_IO] ? all_t : tracking_window_ms[IDX_IO] );
tracking_window_ms[IDX_MEM] = ( all_t > tracking_window_ms[IDX_MEM] ? all_t : tracking_window_ms[IDX_MEM] );
} else {
fprintf(stderr, "The -t or --all-trig option is required integer between 50 to 1000 (ms)\n", arguments->all_trigger);
exit(E_ALL_TRIG_VALUE);
}
}
if (arguments->all_window != NULL) {
if (arguments->cpu_window != NULL || arguments->io_window != NULL || arguments->mem_window != NULL) {
fprintf(stderr, "The -w or --all-win option cannot be used with cpu, io, or memory window options.\n", arguments->all_trigger);
exit(E_ALL_WIN_VALUE);
}
active_tracking[IDX_CPU] = 1;
active_tracking[IDX_IO] = 1;
active_tracking[IDX_MEM] = 1;
int all_w = atoi (arguments->all_window);
// ensure tracking_window_ms >= delay_threshold_ms
if (arguments->verbose == 1) printf("-w %i all tracking_window_ms\n", all_w);
if (all_w >= MIN_WIN && all_w <= MAX_WIN) { // 500ms to 10s
tracking_window_ms[IDX_CPU] = ( all_w > delay_threshold_ms[IDX_CPU] ? all_w : delay_threshold_ms[IDX_CPU] );
tracking_window_ms[IDX_IO] = ( all_w > delay_threshold_ms[IDX_IO] ? all_w : delay_threshold_ms[IDX_IO] );
tracking_window_ms[IDX_MEM] = ( all_w > delay_threshold_ms[IDX_MEM] ? all_w : delay_threshold_ms[IDX_MEM] );
} else {
fprintf(stderr, "The -w or --all-win option required to be integer between 500 to 10000000 (ms)\n", arguments->all_window);
fprintf(stderr, "%s is not an integer in this range. Exiting.\n", arguments->all_window);
exit(E_ALL_WIN_VALUE);
}
}
}
void set_defaults (){
/* Default values. */
arguments.quiet = 0;
arguments.verbose = 1;
arguments.output_file = NULL;
arguments.abort = 0;
full = 0;
some = 1;
timeout_s = 0;
pressure_file[IDX_CPU] = CPU_PSI; // "/proc/pressure/cpu";
pressure_file[IDX_IO] = IO_PSI; // "/proc/pressure/io";
pressure_file[IDX_MEM] = MEMORY_PSI; //"/proc/pressure/memory";
active_tracking[IDX_CPU] = 1;
active_tracking[IDX_IO] = 1;
active_tracking[IDX_MEM] = 1;
delay_threshold_ms[IDX_CPU] = CPU_TRIG;
delay_threshold_ms[IDX_IO] = IO_TRIG;
delay_threshold_ms[IDX_MEM] = MEM_TRIG;
tracking_window_ms[IDX_CPU] = CPU_WIN;
tracking_window_ms[IDX_IO] = IO_WIN;
tracking_window_ms[IDX_MEM] = MEM_WIN;
}
/* Our argp parser. */
static struct argp argp = { options, parse_opt, args_doc, doc };
// set everything up to poll pressure events, and then start the event_loop
int main (int argc, char **argv) {
set_defaults();
argp_parse (&argp, argc, argv, 0, 0, &arguments);
populate_arrays(&arguments);
verify_proc_pressure();
signal(SIGTERM, sig_handler);
signal(SIGINT, sig_handler);
poll_pressure_events();
pressure_event_loop();
exit (0);
}
|
the_stack_data/76172.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HASHSIZE 101
struct nlist {
struct nlist *next;
char *keys;
char *value;
};
static struct nlist *hashtable[HASHSIZE];
unsigned hash(char *s)
{
unsigned hashval;
for (hashval = 0; *s != '\0'; s++)
hashval = *s + 31 * hashval;
return hashval % HASHSIZE;
}
struct nlist *hashtable_search(char *s)
{
struct nlist *np;
for (np = hashtable[hash(s)]; np != NULL; np = np->next)
if (strcmp(s, np->keys) == 0)
return np;
return NULL;
}
struct nlist *hashtable_insert(char *keys, char *value)
{
struct nlist *np;
unsigned hashval;
if ((np = hashtable_search(keys)) == NULL) {
np = (struct nlist *)malloc(sizeof(*np));
if (np == NULL || (np->keys = strdup(keys)) == NULL)
return NULL;
hashval = hash(keys);
np->next = hashtable[hashval];
hashtable[hashval] = np;
} else
free((void *)np->value);
if ((np->value = strdup(value)) == NULL)
return NULL;
return np;
}
char *hashtable_getvalue(char *keys)
{
struct nlist *np;
if ((np = hashtable_search(keys)) == NULL)
return NULL;
else
return np->value;
}
int main(int argc, char *argv[])
{
char *ret;
if (argc < 2) {
printf("Usage: %s string\n",argv[0]);
return -1;
}
hashtable_insert("INT_MAX", "32767");
hashtable_insert("INT_MIN", "-32768");
hashtable_insert("LONG_MAX", "2147483647");
hashtable_insert("LONG_MIN", "-2147483647");
if ((ret = hashtable_getvalue(argv[1])) == NULL)
printf("%s not found\n", argv[1]);
else
printf("%s = %s\n", argv[1], ret);
}
|
the_stack_data/179832037.c | #ifdef HAVE_CONFIG_H
#include "../config.h"
#ifdef HAVE_CUNIT_CUNIT_H
//#ifdef HAVE_LIBCUNIT
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include <stdlib.h>
#include <stdbool.h>
#include <limits.h>
#include <assert.h>
#include "../config_parser.h"
typedef struct {
ConfigErrorType error_type;
char* error_filename;
int error_line_number;
} ErrorInfo;
static bool config_error_handler(
ConfigErrorType type, const char* filename, int line_number, void* data)
{
ErrorInfo* p = (ErrorInfo*)data;
p->error_type = type;
p->error_filename = strdup(filename);
p->error_line_number = line_number;
return true;
}
static void test_parse_config()
{
char test_input[] = "# comment\n"
"\r\n"
"idle:1:test.sh\n"
"wakeup:30:wakeup.sh\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, NO_ERROR);
CU_ASSERT_STRING_EQUAL(find_equals(p->idle_commands, 1)[0], "test.sh");
CU_ASSERT_STRING_EQUAL(find_equals(p->wakeup_commands, 30)[0], "wakeup.sh");
fclose(f);
delete_config(p);
}
static void test_parse_config_too_short_minutes_error()
{
char test_input[] = "idle:0:too_short_minute\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, TOO_SHORT_MINUTES);
fclose(f);
delete_config(p);
}
static void test_parse_config_too_long_minutes_error()
{
char test_input[1024];
snprintf(test_input, sizeof(test_input),
"idle:%lu:too_long_minutes\n", ULONG_MAX);
FILE* f = fmemopen(test_input, strlen(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, TOO_LONG_MINUTES);
fclose(f);
delete_config(p);
}
static void test_parse_config_illegal_command_type_error()
{
char test_input[] = "illegal:1:illegal_command_type\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, ILLEGAL_COMMAND_TYPE);
fclose(f);
delete_config(p);
}
static void test_parse_config_illegal_minutes_error()
{
char test_input[] = "idle:illegal:illegal_minutes\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, ILLEGAL_MINUTES);
fclose(f);
delete_config(p);
}
static void test_parse_config_illegal_line_format_error()
{
char test_input[] = "*** ILLEGAL LINE ***\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, ILLEGAL_LINE_FORMAT);
fclose(f);
delete_config(p);
}
static void test_parse_config_too_long_line_error()
{
char test_input[CONFIG_PARSER_MAX_LINE_LENGTH * 3];
memset(test_input, 'x', sizeof(test_input) - 1);
test_input[sizeof(test_input) - 1] = '\0';
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
ErrorInfo error_info = { NO_ERROR, NULL, 0 };
Config* p = parse_config(f, "test.conf", config_error_handler, &error_info);
CU_ASSERT_EQUAL(error_info.error_type, TOO_LONG_LINE);
fclose(f);
delete_config(p);
}
static bool config_error_handler_returns_false(
ConfigErrorType type, const char* filename, int line_number, void* data)
{
return false;
}
static void test_parse_config_stop_on_error()
{
char test_input[] = "idle:1:test.sh\n"
"*** ILLEGAL LINE ***\n"
"wakeup:30:wakeup.sh\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
Config* p = parse_config(
f, "test.conf", config_error_handler_returns_false, NULL);
CU_ASSERT_STRING_EQUAL(find_equals(p->idle_commands, 1)[0], "test.sh");
CU_ASSERT_TRUE(is_command_map_empty(p->wakeup_commands));
fclose(f);
delete_config(p);
}
static bool config_error_handler_returns_true(
ConfigErrorType type, const char* filename, int line_number, void* data)
{
return true;
}
static void test_parse_config_continue_on_error()
{
char test_input[] = "idle:1:test.sh\n"
"*** ILLEGAL LINE ***\n"
"wakeup:30:wakeup.sh\n";
FILE* f = fmemopen(test_input, sizeof(test_input), "r");
Config* p = parse_config(
f, "test.conf", config_error_handler_returns_true, NULL);
CU_ASSERT_STRING_EQUAL(find_equals(p->idle_commands, 1)[0], "test.sh");
CU_ASSERT_STRING_EQUAL(find_equals(p->wakeup_commands, 30)[0], "wakeup.sh");
fclose(f);
delete_config(p);
}
int main(int argc, char* argv[])
{
CU_TestInfo tests[] = {
{ "test_parse_config", test_parse_config },
{ "test_parse_config_too_short_minutes_error",
test_parse_config_too_short_minutes_error },
{ "test_parse_config_too_long_minutes_error",
test_parse_config_too_long_minutes_error },
{ "test_parse_config_illegal_command_type_error",
test_parse_config_illegal_command_type_error },
{ "test_parse_config_illegal_minutes_error",
test_parse_config_illegal_minutes_error },
{ "test_parse_config_illegal_line_format_error",
test_parse_config_illegal_line_format_error },
{ "test_parse_config_too_long_line_error",
test_parse_config_too_long_line_error },
{ "test_parse_config_stop_on_error",
test_parse_config_stop_on_error },
{ "test_parse_config_continue_on_error",
test_parse_config_continue_on_error },
CU_TEST_INFO_NULL
};
CU_SuiteInfo suites[] = {
{ "Config", NULL, NULL, NULL, NULL, tests },
CU_SUITE_INFO_NULL
};
CU_initialize_registry();
CU_register_suites(suites);
CU_set_error_action(CUEA_ABORT);
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
bool failed = (CU_get_failure_list() != NULL);
CU_cleanup_registry();
return (failed)? EXIT_FAILURE : EXIT_SUCCESS;
}
#else
#error CUnit not found.
#endif /* HAVE_LIBCUNIT */
#endif /* HAVE_CONFIG_H */
|
the_stack_data/9733.c | #include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <wait.h>
typedef struct command
{
char *command_name;
char **arguments;
} command;
typedef struct command_array
{
command **commands;
int number_of_commands;
} command_array;
command_array *parse_line (char *line)
{
command_array *result = malloc (sizeof (struct command_array));
int command_number = 1; // = pipe number + 1, min 1
for (int i=0; i<strlen(line); i++)
if (line[i] == '|')
command_number += 1;
result->number_of_commands = command_number;
command **commands = malloc (command_number * sizeof (command*));
// holds parts between |
char **commands_and_args = malloc (command_number * sizeof (char*));
char *command_and_args = strtok (line, "|\n");
int i = 0;
while (command_and_args != NULL)
{
commands_and_args[i] = strdup (command_and_args);
i += 1;
command_and_args = strtok (NULL, "|\n");
}
for (command_number = 0; command_number < result->number_of_commands; command_number++)
{
char *command_and_args = commands_and_args[command_number];
// count number of arguments of given command
char *command_and_args_copy = strdup (command_and_args);
int args_number = -1; // because it will also count command, making it 0
char *word;
word = strtok (command_and_args_copy, " ");
while (word != NULL)
{
args_number += 1;
word = strtok (NULL, " ");
}
// create and fill command struct
command *command = malloc (sizeof (struct command));
// fill command name
word = strtok (command_and_args, " ");
command->command_name = malloc ((strlen (word) + 1) * sizeof (char));
strcpy (command->command_name, word);
// fill args
if (args_number == 0)
{
command->arguments = malloc (2 * sizeof (char*));
}
else
{
command->arguments = malloc ((args_number + 2) * sizeof (char*)); // +1 for command name as first argument, +1 for ending NULL pointer
word = strtok (NULL, " ");
int arg_counter = 1;
while (word != NULL)
{
command->arguments[arg_counter] = malloc ((strlen (word) + 1) * sizeof (char));
strcpy (command->arguments[arg_counter], word);
arg_counter += 1;
word = strtok (NULL, " ");
}
}
command->arguments[0] = command->command_name;
command->arguments[args_number + 1] = NULL;
commands[command_number] = command;
}
free (commands_and_args);
result->commands = commands;
return result;
}
void wait_for_processes()
{
pid_t wpid;
int status;
while ((wpid = wait (&status)) > 0)
{
if (WIFEXITED (status))
if (WEXITSTATUS (status) != 0)
printf ("Warning: process with pid %d did not exit with success.\n", wpid);
}
}
int main (int argc, char **argv)
{
if (argc != 2)
{
perror ("Error: wrong number of arguments! There should be file_name!");
exit (1);
}
if (strcmp (argv[1], "") == 0)
{
perror ("Error: file name cannot be empty!");
exit (1);
}
FILE *file = fopen (argv[1], "r");
if (file == NULL)
{
perror ("Error: could not open provided file!");
exit (1);
}
size_t size = 512;
char *line = malloc (size * sizeof (char));
while (getline (&line, &size, file) != -1)
{
if (strcmp (line, "\n") == 0)
continue;
char *line_copy = malloc ((strlen (line) + 1) * sizeof (char));
strcpy (line_copy, line);
command_array *parsed_line = parse_line (line_copy);
int prev_cmd_out = 0;
int pipefd[2] = {0,0};
for (int i=0; i < parsed_line->number_of_commands; i++)
{
if (i < parsed_line->number_of_commands - 1)
pipe (pipefd);
pid_t child_PID = fork();
if (child_PID == 0)
{
if (prev_cmd_out != 0)
dup2 (prev_cmd_out, STDIN_FILENO);
if (i < parsed_line->number_of_commands - 1)
{
dup2 (pipefd[1], STDOUT_FILENO);
close (pipefd[0]);
}
char *command_name = parsed_line->commands[i]->command_name;
char **arguments = parsed_line->commands[i]->arguments;
execvp (command_name, arguments);
perror ("Error: got after exec, couldn't start child process properly!");
exit (1);
}
else
{
if (prev_cmd_out != 0)
close (prev_cmd_out);
}
if (i < parsed_line->number_of_commands - 1)
{
close (pipefd[1]);
prev_cmd_out = pipefd[0];
}
}
wait_for_processes();
}
free (line);
return 0;
}
|
the_stack_data/133494.c | /* findin - finds files by glob in PATH or the given colon-delimited
* environment variable or instead with a directory list given on
* standard input */
#include <err.h>
#include <errno.h>
#include <getopt.h>
#include <glob.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
#define STDIN_DELIMITER '\n'
#define STDOUT_DELIMITER '\n'
/* NOTE tilde is a non-standard extension to IEEE Std 1003.2
* (``POSIX.2''). used to have GLOB_LIMIT as well, though that is
* problematical on Mac OS X */
#define GLOB_FLAGS GLOB_BRACE | GLOB_TILDE
void check_dir(char *directory, size_t dir_len, const char *expr,
char output_delim);
void emit_help(void);
void parse_env(const char *envname, const char *expr, char output_delim);
void parse_stdin(const char *expr, char input_delim, char output_delim);
bool Flag_Nulsep; /* -0 */
bool Flag_Quiet; /* -q */
int exit_status = EXIT_SUCCESS;
bool File_Hits;
extern int errno;
int main(int argc, char *argv[])
{
char *env_or_stdin;
int ch;
#ifdef __OpenBSD__
if (pledge("rpath stdio", NULL) == -1)
err(1, "pledge failed");
#endif
while ((ch = getopt(argc, argv, "0qh?")) != -1) {
switch (ch) {
case '0':
Flag_Nulsep = true;
break;
case 'q':
Flag_Quiet = true;
break;
case '?':
case 'h':
default:
emit_help();
/* NOTREACHED */
}
}
argc -= optind;
argv += optind;
if (argc < 1 || argc > 2)
emit_help();
env_or_stdin = argc == 2 ? argv[1] : "PATH";
if (strncmp(env_or_stdin, "-", 2) == 0)
parse_stdin(argv[0], Flag_Nulsep ? '\0' : STDIN_DELIMITER,
Flag_Nulsep ? '\0' : STDOUT_DELIMITER);
else
parse_env(env_or_stdin, argv[0], Flag_Nulsep ? '\0' : STDOUT_DELIMITER);
if (!File_Hits && exit_status == EXIT_SUCCESS)
exit_status = 2;
exit(exit_status);
}
void check_dir(char *directory, size_t dir_len, const char *expr,
char output_delim)
{
glob_t g;
int ret;
size_t tail = dir_len - 1;
/* NOTE dir_len may be out of sync with directory afterwards, but is
* not presently relevant hence */
while (tail > 0 && directory[tail] == '/')
directory[tail--] = '\0';
if (chdir(directory) != 0) {
if (errno != ENOENT && !Flag_Quiet) {
warn("could not chdir '%s'", directory);
exit_status = EX_OSERR;
}
return;
}
if ((ret = glob(expr, GLOB_FLAGS, NULL, &g)) != 0) {
if (ret != GLOB_NOMATCH && !Flag_Quiet) {
warn("glob error (%d) for %s/%s", ret, directory, expr);
exit_status = EX_OSERR;
}
} else {
for (unsigned int i = 0; i < g.gl_pathc; i++) {
printf("%s/%s%c", directory, g.gl_pathv[i], output_delim);
File_Hits = true;
}
}
globfree(&g);
}
void emit_help(void)
{
fputs("Usage: findin [-0q] glob-expr [ENVVAR|-]\n"
" note that MANPATH likely requires man*/foo* as a glob\n", stderr);
exit(EX_USAGE);
}
void parse_env(const char *envname, const char *expr, char output_delim)
{
char *directory, *envp, *string, *tofree;
size_t dir_len;
if (!(envp = getenv(envname)))
errx(EX_USAGE, "no such environment variable '%s'", envname);
if (!(string = strdup(envp)))
err(EX_OSERR, "could not strdup environment");
tofree = string;
while ((directory = strsep(&string, ":")) != NULL) {
dir_len = strlen(directory);
if (dir_len > 0)
check_dir(directory, dir_len, expr, output_delim);
}
free(tofree);
}
void parse_stdin(const char *expr, char input_delim, char output_delim)
{
char *line = NULL;
size_t linebuflen;
ssize_t numchars;
while ((numchars = getdelim(&line, &linebuflen, input_delim, stdin)) != -1) {
if (numchars > 1) {
/* NOTE line includes the delimiter, except when the caller
* fails to append the delimiter to the ultimate line */
if (line[numchars - 1] == input_delim)
line[--numchars] = '\0';
check_dir(line, numchars, expr, output_delim);
}
}
if (ferror(stdin)) {
warn("error reading from standard input");
exit_status = EX_OSERR;
}
}
|
the_stack_data/94967.c | #include <stdio.h>
#include <stdlib.h>
typedef struct pilha
{
int *dados;
int N, p, u;
} fila;
int desenfileira (fila *f, int *y)
{
if (f->p != f->u)
{
*y = f->dados[f->p];
f->p ++;
return 1;
}
else
return 0;
}
|
the_stack_data/150141787.c | /*
** libgcc support for software floating point.
** Copyright (C) 1991 by Pipeline Associates, Inc. All rights reserved.
** Permission is granted to do *anything* you want with this file,
** commercial or otherwise, provided this message remains intact. So there!
** I would appreciate receiving any updates/patches/changes that anyone
** makes, and am willing to be the repository for said changes (am I
** making a big mistake?).
Warning! Only single-precision is actually implemented. This file
won't really be much use until double-precision is supported.
However, once that is done, this file might eventually become a
replacement for libgcc1.c. It might also make possible
cross-compilation for an IEEE target machine from a non-IEEE
host such as a VAX.
If you'd like to work on completing this, please talk to [email protected].
--> Double precision floating support added by James Carlson on 20 April 1998.
**
** Pat Wood
** Pipeline Associates, Inc.
** [email protected] or
** sun!pipeline!phw or
** uunet!motown!pipeline!phw
**
** 05/01/91 -- V1.0 -- first release to gcc mailing lists
** 05/04/91 -- V1.1 -- added float and double prototypes and return values
** -- fixed problems with adding and subtracting zero
** -- fixed rounding in truncdfsf2
** -- fixed SWAP define and tested on 386
*/
/*
** The following are routines that replace the libgcc soft floating point
** routines that are called automatically when -msoft-float is selected.
** The support single and double precision IEEE format, with provisions
** for byte-swapped machines (tested on 386). Some of the double-precision
** routines work at full precision, but most of the hard ones simply punt
** and call the single precision routines, producing a loss of accuracy.
** long long support is not assumed or included.
** Overall accuracy is close to IEEE (actually 68882) for single-precision
** arithmetic. I think there may still be a 1 in 1000 chance of a bit
** being rounded the wrong way during a multiply. I'm not fussy enough to
** bother with it, but if anyone is, knock yourself out.
**
** Efficiency has only been addressed where it was obvious that something
** would make a big difference. Anyone who wants to do this right for
** best speed should go in and rewrite in assembler.
**
** I have tested this only on a 68030 workstation and 386/ix integrated
** in with -msoft-float.
*/
#define float long
#define double long long
/* the following deal with IEEE single-precision numbers */
#define EXCESS 126
#define SIGNBIT 0x80000000
#define HIDDEN (1 << 23)
#define SIGN(fp) ((fp) & SIGNBIT)
#define EXP(fp) (((fp) >> 23) & 0xFF)
#define MANT(fp) (((fp) & 0x7FFFFF) | HIDDEN)
#define PACK(s,e,m) ((s) | ((e) << 23) | (m))
/* the following deal with IEEE double-precision numbers */
#define EXCESSD 1022
#define HIDDEND (1 << 20)
#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) |(fp.l.lower >> 22))
#define HIDDEND_LL ((long long)1 << 52)
#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
#define PACKD_LL(s,e,m) (((long long)((s)+((e)<<20))<<32)|(m))
/* define SWAP for 386/960 reverse-byte-order brain-damaged CPUs */
union double_long {
double d;
#ifdef SWAP
struct {
unsigned long lower;
long upper;
} l;
#else
struct {
long upper;
unsigned long lower;
} l;
#endif
long long ll;
};
union float_long
{
float f;
long l;
};
long long
__negdi2 (long long u)
{
union lll {
long long ll;
long s[2];
};
union lll w,uu;
uu.ll = u;
w.s[1] = -uu.s[1];
w.s[0] = -uu.s[0] - ((int) w.s[1] != 0);
return w.ll;
}
/* add two floats */
float
__addsf3 (float a1, float a2)
{
register long mant1, mant2;
register union float_long fl1, fl2;
register int exp1, exp2;
int sign = 0;
fl1.f = a1;
fl2.f = a2;
/* check for zero args */
if (!fl1.l) {
fl1.f = fl2.f;
goto test_done;
}
if (!fl2.l)
goto test_done;
exp1 = EXP (fl1.l);
exp2 = EXP (fl2.l);
if (exp1 > exp2 + 25)
goto test_done;
if (exp2 > exp1 + 25) {
fl1.f = fl2.f;
goto test_done;
}
/* do everything in excess precision so's we can round later */
mant1 = MANT (fl1.l) << 6;
mant2 = MANT (fl2.l) << 6;
if (SIGN (fl1.l))
mant1 = -mant1;
if (SIGN (fl2.l))
mant2 = -mant2;
if (exp1 > exp2)
{
mant2 >>= exp1 - exp2;
}
else
{
mant1 >>= exp2 - exp1;
exp1 = exp2;
}
mant1 += mant2;
if (mant1 < 0)
{
mant1 = -mant1;
sign = SIGNBIT;
}
else if (!mant1) {
fl1.f = 0;
goto test_done;
}
/* normalize up */
while (!(mant1 & 0xE0000000))
{
mant1 <<= 1;
exp1--;
}
/* normalize down? */
if (mant1 & (1 << 30))
{
mant1 >>= 1;
exp1++;
}
/* round to even */
mant1 += (mant1 & 0x40) ? 0x20 : 0x1F;
/* normalize down? */
if (mant1 & (1 << 30))
{
mant1 >>= 1;
exp1++;
}
/* lose extra precision */
mant1 >>= 6;
/* turn off hidden bit */
mant1 &= ~HIDDEN;
/* pack up and go home */
fl1.l = PACK (sign, exp1, mant1);
test_done:
return (fl1.f);
}
/* subtract two floats */
float
__subsf3 (float a1, float a2)
{
register union float_long fl1, fl2;
fl1.f = a1;
fl2.f = a2;
/* check for second arg zero */
if (!fl2.l)
return (fl1.f);
/* twiddle sign bit */
fl2.l ^= SIGNBIT;
/* check for first arg zero */
if (!fl1.l)
return (fl2.f);
/* add values */
return __addsf3 (a1, fl2.f);
}
/* compare two floats */
long
__cmpsf2 (float a1, float a2)
{
register union float_long fl1, fl2;
fl1.f = a1;
fl2.f = a2;
if (SIGN (fl1.l) && SIGN (fl2.l))
{
fl1.l ^= SIGNBIT;
fl2.l ^= SIGNBIT;
if (fl1.l < fl2.l)
return (-1);
if (fl1.l > fl2.l)
return (1);
return 0;
} else {
if (fl1.l < fl2.l)
return (-1);
if (fl1.l > fl2.l)
return (1);
return (0);
}
}
/* multiply two floats */
float
__mulsf3 (float a1, float a2)
{
register union float_long fl1, fl2;
register unsigned long result;
register int exp;
int sign;
fl1.f = a1;
fl2.f = a2;
if (!fl1.l || !fl2.l) {
fl1.f = 0;
goto test_done;
}
/* compute sign and exponent */
sign = SIGN (fl1.l) ^ SIGN (fl2.l);
exp = EXP (fl1.l) - EXCESS;
exp += EXP (fl2.l);
fl1.l = MANT (fl1.l);
fl2.l = MANT (fl2.l);
/* the multiply is done as one 16x16 multiply and two 16x8 multiples */
result = (fl1.l >> 8) * (fl2.l >> 8);
result += ((fl1.l & 0xFF) * (fl2.l >> 8)) >> 8;
result += ((fl2.l & 0xFF) * (fl1.l >> 8)) >> 8;
result >>= 2;
if (result & 0x20000000)
{
/* round */
result += 0x20;
result >>= 6;
}
else
{
/* round */
result += 0x10;
result >>= 5;
exp--;
}
if (result & (HIDDEN<<1)) {
result >>= 1;
exp++;
}
result &= ~HIDDEN;
/* pack up and go home */
fl1.l = PACK (sign, exp, result);
test_done:
return (fl1.f);
}
/* divide two floats */
float
__divsf3 (float a1, float a2)
{
register union float_long fl1, fl2;
register int result;
register int mask;
register int exp, sign;
fl1.f = a1;
fl2.f = a2;
/* subtract exponents */
exp = EXP (fl1.l) - EXP (fl2.l) + EXCESS;
/* compute sign */
sign = SIGN (fl1.l) ^ SIGN (fl2.l);
/* divide by zero??? */
if (!fl2.l)
/* return NaN or -NaN */
return (sign ? 0xFFFFFFFF : 0x7FFFFFFF);
/* numerator zero??? */
if (!fl1.l)
return (0);
/* now get mantissas */
fl1.l = MANT (fl1.l);
fl2.l = MANT (fl2.l);
/* this assures we have 25 bits of precision in the end */
if (fl1.l < fl2.l)
{
fl1.l <<= 1;
exp--;
}
/* now we perform repeated subtraction of fl2.l from fl1.l */
mask = 0x1000000;
result = 0;
while (mask)
{
if (fl1.l >= fl2.l)
{
result |= mask;
fl1.l -= fl2.l;
}
fl1.l <<= 1;
mask >>= 1;
}
/* round */
result += 1;
/* normalize down */
exp++;
result >>= 1;
result &= ~HIDDEN;
/* pack up and go home */
fl1.l = PACK (sign, exp, result);
return (fl1.f);
}
/* convert double to float */
float
__truncdfsf2 (double a1)
{
register int exp;
register long mant;
register union float_long fl;
register union double_long dl1;
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (float)(0);
exp = EXPD (dl1) - EXCESSD + EXCESS;
/* shift double mantissa 6 bits so we can round */
mant = MANTD (dl1) >> 6;
/* now round and shift down */
mant += 1;
mant >>= 1;
/* did the round overflow? */
if (mant & 0xFF000000)
{
mant >>= 1;
exp++;
}
mant &= ~HIDDEN;
/* pack up and go home */
fl.l = PACK (SIGND (dl1), exp, mant);
return (fl.f);
}
/* convert int to double */
double
__floatsidf (register long a1)
{
register int sign = 0, exp = 31 + EXCESSD;
union double_long dl;
if (a1 == 0x80000000)
{
/*
* -a1 would be 0 !
*/
dl.l.upper = 0xc1e00000;
dl.l.lower = 0x0;
return (dl.d);
}
if (!a1)
{
dl.l.upper = dl.l.lower = 0;
return (dl.d);
}
if (a1 < 0)
{
sign = SIGNBIT;
a1 = -a1;
}
while (a1 < 0x1000000)
{
a1 <<= 4;
exp -= 4;
}
while (a1 < 0x40000000)
{
a1 <<= 1;
exp--;
}
/* pack up and go home */
dl.l.upper = sign;
dl.l.upper |= exp << 20;
dl.l.upper |= (a1 >> 10) & ~HIDDEND;
dl.l.lower = a1 << 22;
return (dl.d);
}
double
__floatdidf (register long long a1)
{
register int exp = 63 + EXCESSD;
union double_long dl;
dl.l.upper = dl.l.lower = 0;
if (a1 == 0)
return (dl.d);
if (a1 < 0) {
dl.l.upper = SIGNBIT;
a1 = -a1;
}
while (a1 < (long long)1<<54) {
a1 <<= 8;
exp -= 8;
}
while (a1 < (long long)1<<62) {
a1 <<= 1;
exp -= 1;
}
/* pack up and go home */
dl.ll |= (a1 >> 10) & ~HIDDEND_LL;
dl.l.upper |= exp << 20;
return (dl.d);
}
float
__floatsisf (register long a1)
{
return __truncdfsf2(__floatsidf(a1));
}
float
__floatdisf (register long long a1)
{
return (float)__floatdidf(a1);
}
/* negate a float */
float
__negsf2 (float a1)
{
register union float_long fl1;
fl1.f = a1;
if (!fl1.l)
return (0);
fl1.l ^= SIGNBIT;
return (fl1.f);
}
/* negate a double */
double
__negdf2 (double a1)
{
register union double_long dl1;
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (dl1.d);
dl1.l.upper ^= SIGNBIT;
return (dl1.d);
}
/* convert float to double */
double
__extendsfdf2 (float a1)
{
register union float_long fl1;
register union double_long dl;
register int exp;
fl1.f = a1;
if (!fl1.l)
{
dl.l.upper = dl.l.lower = 0;
return (dl.d);
}
dl.l.upper = SIGN (fl1.l);
exp = EXP (fl1.l) - EXCESS + EXCESSD;
dl.l.upper |= exp << 20;
dl.l.upper |= (MANT (fl1.l) & ~HIDDEN) >> 3;
dl.l.lower = MANT (fl1.l) << 29;
return (dl.d);
}
/* compare two doubles */
long
__cmpdf2 (double a1, double a2)
{
register union double_long dl1, dl2;
dl1.d = a1;
dl2.d = a2;
if (SIGND (dl1) && SIGND (dl2))
{
dl1.l.upper ^= SIGNBIT;
dl2.l.upper ^= SIGNBIT;
if (dl1.l.upper < dl2.l.upper)
return (1);
if (dl1.l.upper > dl2.l.upper)
return (-1);
if (dl1.l.lower < dl2.l.lower)
return (1);
if (dl1.l.lower > dl2.l.lower)
return (-1);
return (0);
} else {
if (dl1.l.upper < dl2.l.upper)
return (-1);
if (dl1.l.upper > dl2.l.upper)
return (1);
if (dl1.l.lower < dl2.l.lower)
return (-1);
if (dl1.l.lower > dl2.l.lower)
return (1);
return (0);
}
}
/* convert double to int */
long
__fixdfsi (double a1)
{
register union double_long dl1;
register int exp;
register long l;
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (0);
exp = EXPD (dl1) - EXCESSD - 31;
l = MANTD (dl1);
if (exp > 0)
return SIGND(dl1) ? (1<<31) : ((1ul<<31)-1);
/* shift down until exp = 0 or l = 0 */
if (exp <= 0 && exp > -32 && l)
l >>= -exp;
else
return (0);
return (SIGND (dl1) ? -l : l);
}
/* convert float to int */
long
__fixsfsi (float a1)
{
return __fixdfsi(__extendsfdf2(a1));
}
/* convert double to int */
long long
__fixdfdi (double a1)
{
register union double_long dl1;
register int exp;
register long long l;
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (0);
exp = EXPD (dl1) - EXCESSD - 64;
l = MANTD_LL(dl1);
if (exp > 0) {
l = (long long)1<<63;
if (!SIGND(dl1))
l--;
return l;
}
/* shift down until exp = 0 or l = 0 */
if (exp <= 0 && exp > -64 && l)
l >>= -exp;
else
return (0);
return (SIGND (dl1) ? -l : l);
}
/* convert double to unsigned int */
unsigned long
__fixunsdfsi (double a1)
{
register union double_long dl1;
register int exp;
register unsigned long l;
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (0);
exp = EXPD (dl1) - EXCESSD - 32;
l = (((((dl1.l.upper) & 0xFFFFF) | HIDDEND) << 11) | (dl1.l.lower >> 21));
if (exp > 0)
return (0xFFFFFFFFul); /* largest integer */
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -32 && l)
l >>= -exp;
else
return (0);
return (l);
}
/* convert double to unsigned int */
unsigned long long
__fixunsdfdi (double a1)
{
register union double_long dl1;
register int exp;
register unsigned long long l;
dl1.d = a1;
if (dl1.ll == 0)
return (0);
exp = EXPD (dl1) - EXCESSD - 64;
l = dl1.ll;
if (exp > 0)
return (unsigned long long)-1;
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -64 && l)
l >>= -exp;
else
return (0);
return (l);
}
/* addtwo doubles */
double
__adddf3 (double a1, double a2)
{
register long long mant1, mant2;
register union double_long fl1, fl2;
register int exp1, exp2;
int sign = 0;
fl1.d = a1;
fl2.d = a2;
/* check for zero args */
if (!fl2.ll)
goto test_done;
if (!fl1.ll) {
fl1.d = fl2.d;
goto test_done;
}
exp1 = EXPD(fl1);
exp2 = EXPD(fl2);
if (exp1 > exp2 + 54)
goto test_done;
if (exp2 > exp1 + 54) {
fl1.d = fl2.d;
goto test_done;
}
/* do everything in excess precision so's we can round later */
mant1 = MANTD_LL(fl1) << 9;
mant2 = MANTD_LL(fl2) << 9;
if (SIGND(fl1))
mant1 = -mant1;
if (SIGND(fl2))
mant2 = -mant2;
if (exp1 > exp2)
mant2 >>= exp1 - exp2;
else {
mant1 >>= exp2 - exp1;
exp1 = exp2;
}
mant1 += mant2;
if (mant1 < 0) {
mant1 = -mant1;
sign = SIGNBIT;
} else if (!mant1) {
fl1.d = 0;
goto test_done;
}
/* normalize up */
while (!(mant1 & ((long long)7<<61))) {
mant1 <<= 1;
exp1--;
}
/* normalize down? */
if (mant1 & ((long long)3<<62)) {
mant1 >>= 1;
exp1++;
}
/* round to even */
mant1 += (mant1 & (1<<9)) ? (1<<8) : ((1<<8)-1);
/* normalize down? */
if (mant1 & ((long long)3<<62)) {
mant1 >>= 1;
exp1++;
}
/* lose extra precision */
mant1 >>= 9;
/* turn off hidden bit */
mant1 &= ~HIDDEND_LL;
/* pack up and go home */
fl1.ll = PACKD_LL(sign,exp1,mant1);
test_done:
return (fl1.d);
}
/* subtract two doubles */
double
__subdf3 (double a1, double a2)
{
register union double_long fl1, fl2;
fl1.d = a1;
fl2.d = a2;
/* check for zero args */
if (!fl2.ll)
return (fl1.d);
/* twiddle sign bit and add */
fl2.l.upper ^= SIGNBIT;
if (!fl1.ll)
return (fl2.d);
return __adddf3 (a1, fl2.d);
}
/* multiply two doubles */
double
__muldf3 (double a1, double a2)
{
register union double_long fl1, fl2;
register unsigned long long result=0ULL;
register int exp;
int sign;
fl1.d = a1;
fl2.d = a2;
if (!fl1.ll || !fl2.ll) {
fl1.d = 0;
goto test_done;
}
/* compute sign and exponent */
sign = SIGND(fl1) ^ SIGND(fl2);
exp = EXPD(fl1) - EXCESSD;
exp += EXPD(fl2);
fl1.ll = MANTD_LL(fl1);
fl2.ll = MANTD_LL(fl2);
/* the multiply is done as one 31x31 multiply and two 31x21 multiples */
result = (fl1.ll >> 21) * (fl2.ll >> 21);
result += ((fl1.ll & 0x1FFFFF) * (fl2.ll >> 21)) >> 21;
result += ((fl2.ll & 0x1FFFFF) * (fl1.ll >> 21)) >> 21;
result >>= 2;
if (result & ((long long)1<<61)) {
/* round */
result += 1<<8;
result >>= 9;
} else {
/* round */
result += 1<<7;
result >>= 8;
exp--;
}
if (result & (HIDDEND_LL<<1)) {
result >>= 1;
exp++;
}
result &= ~HIDDEND_LL;
/* pack up and go home */
fl1.ll = PACKD_LL(sign,exp,result);
test_done:
return (fl1.d);
}
/* divide two doubles */
double
__divdf3 (double a1, double a2)
{
register union double_long fl1, fl2;
register long long mask,result;
register int exp, sign;
fl1.d = a1;
fl2.d = a2;
/* subtract exponents */
exp = EXPD(fl1) - EXPD(fl2) + EXCESSD;
/* compute sign */
sign = SIGND(fl1) ^ SIGND(fl2);
/* numerator zero??? */
if (fl1.ll == 0) {
/* divide by zero??? */
if (fl2.ll == 0)
fl1.ll = ((unsigned long long)1<<63)-1; /* NaN */
else
fl1.ll = 0;
goto test_done;
}
/* return +Inf or -Inf */
if (fl2.ll == 0) {
fl1.ll = PACKD_LL(SIGND(fl1),2047,0);
goto test_done;
}
/* now get mantissas */
fl1.ll = MANTD_LL(fl1);
fl2.ll = MANTD_LL(fl2);
/* this assures we have 54 bits of precision in the end */
if (fl1.ll < fl2.ll) {
fl1.ll <<= 1;
exp--;
}
/* now we perform repeated subtraction of fl2.ll from fl1.ll */
mask = (long long)1<<53;
result = 0;
while (mask) {
if (fl1.ll >= fl2.ll)
{
result |= mask;
fl1.ll -= fl2.ll;
}
fl1.ll <<= 1;
mask >>= 1;
}
/* round */
result += 1;
/* normalize down */
exp++;
result >>= 1;
result &= ~HIDDEND_LL;
/* pack up and go home */
fl1.ll = PACKD_LL(sign, exp, result);
test_done:
return (fl1.d);
}
int
__gtdf2 (double a1, double a2)
{
return __cmpdf2 ((float) a1, (float) a2) > 0;
}
int
__gedf2 (double a1, double a2)
{
return (__cmpdf2 ((float) a1, (float) a2) >= 0) - 1;
}
int
__ltdf2 (double a1, double a2)
{
return - (__cmpdf2 ((float) a1, (float) a2) < 0);
}
int
__ledf2 (double a1, double a2)
{
return __cmpdf2 ((float) a1, (float) a2) > 0;
}
int
__eqdf2 (double a1, double a2)
{
return *(long long *) &a1 == *(long long *) &a2;
}
int
__nedf2 (double a1, double a2)
{
return *(long long *) &a1 != *(long long *) &a2;
}
/* absolute value of double */
double
__absdf2(double a1)
{
if (__cmpdf2(a1,0.0) < 0)
return __negdf2(a1);
else
return a1;
}
/* absolute value of float */
float
__abssf2(float a1)
{
if (__cmpsf2(a1,0.0) < 0)
return __negsf2(a1);
else
return a1;
}
|
the_stack_data/59513344.c | /*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2014 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the Intel Corporation nor the names of its contributors may be used to
endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END_LEGAL */
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
volatile int lock=0;
static void * child(void * v)
{
printf("Child: calling pthread_spin_lock()\n");
sleep(3);
int locked = pthread_spin_lock( &lock );
printf("Child: acquired spinlock\n");
locked = pthread_spin_unlock( &lock );
printf("Child: released spinlock\n");
return 0;
}
int main()
{
pthread_t child_thread;
pthread_spin_init( &lock, PTHREAD_PROCESS_PRIVATE );
printf("Main: calling pthread_spin_lock()\n");
int locked = pthread_spin_lock( &lock );
printf("Main: acquired spinlock\n");
int status = pthread_create(&child_thread, 0, child, 0);
if (status != 0 )
printf("Main: could not create chikd thread\n" );
sleep(10);
locked = pthread_spin_unlock( &lock );
printf("Main: released spinlock\n");
pthread_join(child_thread, 0);
}
|
the_stack_data/826448.c | #include <stdio.h>
#include <stdlib.h>
struct aluno{
int mat;
char nome[30];
float n1,n2;
};
void ordenacao_por_insercao_structs(struct aluno *v, int n){
int i, j;
struct aluno aux;
for(i=0; i<n; i++){
aux=v[i];
for(j=i; (j>0) && (aux.mat<v[j-1].mat); j--)
v[j]=v[j-1];
v[j]=aux;
}
}
int main (){
int i;
struct aluno v[3] = {{2, "andre", 9.5, 7.8},
{3, "carlos", 8.7, 9.1},
{1, "ze", 7.5,7.5}
}; // vetor com 3 alunos;;
ordenacao_por_insercao_structs(v, 3);
for(i=0; i<3;i++){
printf("%d %s\n", v[i].mat, v[i].nome);
}
return 0;
}
|
the_stack_data/87636540.c | /*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* %sccs.include.proprietary.c%
*/
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char sccsid[] = "@(#)deroff.c 8.1 (Berkeley) 06/06/93";
#endif /* not lint */
#include <stdio.h>
/*
* Deroff command -- strip troff, eqn, and Tbl sequences from
* a file. Has two flags argument, -w, to cause output one word per line
* rather than in the original format.
* -mm (or -ms) causes the corresponding macro's to be interpreted
* so that just sentences are output
* -ml also gets rid of lists.
* Deroff follows .so and .nx commands, removes contents of macro
* definitions, equations (both .EQ ... .EN and $...$),
* Tbl command sequences, and Troff backslash constructions.
*
* All input is through the Cget macro;
* the most recently read character is in c.
*
* Modified by Robert Henry to process -me and -man macros.
*/
#define Cget ( (c=getc(infile)) == EOF ? eof() : ((c==ldelim)&&(filesp==files) ? skeqn() : c) )
#define C1get ( (c=getc(infile)) == EOF ? eof() : c)
#ifdef DEBUG
# define C _C()
# define C1 _C1()
#else not DEBUG
# define C Cget
# define C1 C1get
#endif not DEBUG
#define SKIP while(C != '\n')
#define SKIP_TO_COM SKIP; SKIP; pc=c; while(C != '.' || pc != '\n' || C > 'Z')pc=c
#define YES 1
#define NO 0
#define MS 0 /* -ms */
#define MM 1 /* -mm */
#define ME 2 /* -me */
#define MA 3 /* -man */
#ifdef DEBUG
char *mactab[] = {"-ms", "-mm", "-me", "-ma"};
#endif DEBUG
#define ONE 1
#define TWO 2
#define NOCHAR -2
#define SPECIAL 0
#define APOS 1
#define PUNCT 2
#define DIGIT 3
#define LETTER 4
int wordflag;
int msflag; /* processing a source written using a mac package */
int mac; /* which package */
int disp;
int parag;
int inmacro;
int intable;
int keepblock; /* keep blocks of text; normally false when msflag */
char chars[128]; /* SPECIAL, PUNCT, APOS, DIGIT, or LETTER */
char line[512];
char *lp;
int c;
int pc;
int ldelim;
int rdelim;
int argc;
char **argv;
char fname[50];
FILE *files[15];
FILE **filesp;
FILE *infile;
FILE *opn();
/*
* Flags for matching conditions other than
* the macro name
*/
#define NONE 0
#define FNEST 1 /* no nested files */
#define NOMAC 2 /* no macro */
#define MAC 3 /* macro */
#define PARAG 4 /* in a paragraph */
#define MSF 5 /* msflag is on */
#define NBLK 6 /* set if no blocks to be kept */
/*
* Return codes from macro minions, determine where to jump,
* how to repeat/reprocess text
*/
#define COMX 1 /* goto comx */
#define COM 2 /* goto com */
main(ac, av)
int ac;
char **av;
{
register int i;
int errflg = 0;
register optchar;
FILE *opn();
int kflag = NO;
char *p;
wordflag = NO;
msflag = NO;
mac = ME;
disp = NO;
parag = NO;
inmacro = NO;
intable = NO;
ldelim = NOCHAR;
rdelim = NOCHAR;
keepblock = YES;
for(argc = ac - 1, argv = av + 1;
( (argc > 0)
&& (argv[0][0] == '-')
&& (argv[0][1] != '\0') );
--argc, ++argv
){
for(p = argv[0]+1; *p; ++p) {
switch(*p) {
case 'p':
parag=YES;
break;
case 'k':
kflag = YES;
break;
case 'w':
wordflag = YES;
kflag = YES;
break;
case 'm':
msflag = YES;
keepblock = NO;
switch(p[1]){
case 'm': mac = MM; p++; break;
case 's': mac = MS; p++; break;
case 'e': mac = ME; p++; break;
case 'a': mac = MA; p++; break;
case 'l': disp = YES; p++; break;
default: errflg++; break;
}
break;
default:
errflg++;
}
}
}
if (kflag)
keepblock = YES;
if (errflg)
fatal("usage: deroff [ -w ] [ -k] [ -m (a e m s l) ] [ file ] ... \n",
(char *) NULL);
#ifdef DEBUG
printf("msflag = %d, mac = %s, keepblock = %d, disp = %d\n",
msflag, mactab[mac], keepblock, disp);
#endif DEBUG
if (argc == 0){
infile = stdin;
} else {
infile = opn(argv[0]);
--argc;
++argv;
}
files[0] = infile;
filesp = &files[0];
for(i='a'; i<='z' ; ++i)
chars[i] = LETTER;
for(i='A'; i<='Z'; ++i)
chars[i] = LETTER;
for(i='0'; i<='9'; ++i)
chars[i] = DIGIT;
chars['\''] = APOS;
chars['&'] = APOS;
chars['.'] = PUNCT;
chars[','] = PUNCT;
chars[';'] = PUNCT;
chars['?'] = PUNCT;
chars[':'] = PUNCT;
work();
}
char *calloc();
skeqn()
{
while((c = getc(infile)) != rdelim)
if(c == EOF)
c = eof();
else if(c == '"')
while( (c = getc(infile)) != '"')
if(c == EOF)
c = eof();
else if(c == '\\')
if((c = getc(infile)) == EOF)
c = eof();
if(msflag)return(c='x');
return(c = ' ');
}
FILE *opn(p)
register char *p;
{
FILE *fd;
if( (fd = fopen(p, "r")) == NULL) {
fprintf(stderr, "Deroff: ");
perror(p);
exit(1);
}
return(fd);
}
eof()
{
if(infile != stdin)
fclose(infile);
if(filesp > files)
infile = *--filesp;
else if (argc > 0) {
infile = opn(argv[0]);
--argc;
++argv;
} else
exit(0);
return(C);
}
getfname()
{
register char *p;
struct chain {
struct chain *nextp;
char *datap;
} *chainblock;
register struct chain *q;
static struct chain *namechain = NULL;
char *copys();
while(C == ' ') ;
for(p = fname ; (*p=c)!= '\n' && c!=' ' && c!='\t' && c!='\\' ; ++p)
C;
*p = '\0';
while(c != '\n')
C;
/* see if this name has already been used */
for(q = namechain ; q; q = q->nextp)
if( ! strcmp(fname, q->datap))
{
fname[0] = '\0';
return;
}
q = (struct chain *) calloc(1, sizeof(*chainblock));
q->nextp = namechain;
q->datap = copys(fname);
namechain = q;
}
fatal(s,p)
char *s, *p;
{
fprintf(stderr, "Deroff: ");
fprintf(stderr, s, p);
exit(1);
}
/*ARGSUSED*/
textline(str, constant)
char *str;
int constant;
{
if (wordflag) {
msputwords(0);
return;
}
puts(str);
}
work()
{
for( ;; )
{
C;
#ifdef FULLDEBUG
printf("Starting work with `%c'\n", c);
#endif FULLDEBUG
if(c == '.' || c == '\'')
comline();
else
regline(textline, TWO);
}
}
regline(pfunc, constant)
int (*pfunc)();
int constant;
{
line[0] = c;
lp = line;
for( ; ; )
{
if(c == '\\') {
*lp = ' ';
backsl();
}
if(c == '\n')
break;
if(intable && c=='T') {
*++lp = C;
if(c=='{' || c=='}') {
lp[-1] = ' ';
*lp = C;
}
} else {
*++lp = C;
}
}
*lp = '\0';
if(line[0] != '\0')
(*pfunc)(line, constant);
}
macro()
{
if(msflag){
do {
SKIP;
} while(C!='.' || C!='.' || C=='.'); /* look for .. */
if(c != '\n')SKIP;
return;
}
SKIP;
inmacro = YES;
}
tbl()
{
while(C != '.');
SKIP;
intable = YES;
}
stbl()
{
while(C != '.');
SKIP_TO_COM;
if(c != 'T' || C != 'E'){
SKIP;
pc=c;
while(C != '.' || pc != '\n' || C != 'T' || C != 'E')pc=c;
}
}
eqn()
{
register int c1, c2;
register int dflg;
char last;
last=0;
dflg = 1;
SKIP;
for( ;;)
{
if(C1 == '.' || c == '\'')
{
while(C1==' ' || c=='\t')
;
if(c=='E' && C1=='N')
{
SKIP;
if(msflag && dflg){
putchar('x');
putchar(' ');
if(last){
putchar(last);
putchar('\n');
}
}
return;
}
}
else if(c == 'd') /* look for delim */
{
if(C1=='e' && C1=='l')
if( C1=='i' && C1=='m')
{
while(C1 == ' ');
if((c1=c)=='\n' || (c2=C1)=='\n'
|| (c1=='o' && c2=='f' && C1=='f') )
{
ldelim = NOCHAR;
rdelim = NOCHAR;
}
else {
ldelim = c1;
rdelim = c2;
}
}
dflg = 0;
}
if(c != '\n') while(C1 != '\n'){
if(chars[c] == PUNCT)last = c;
else if(c != ' ')last = 0;
}
}
}
backsl() /* skip over a complete backslash construction */
{
int bdelim;
sw:
switch(C)
{
case '"':
SKIP;
return;
case 's':
if(C == '\\') backsl();
else {
while(C>='0' && c<='9') ;
ungetc(c,infile);
c = '0';
}
--lp;
return;
case 'f':
case 'n':
case '*':
if(C != '(')
return;
case '(':
if(msflag){
if(C == 'e'){
if(C == 'm'){
*lp = '-';
return;
}
}
else if(c != '\n')C;
return;
}
if(C != '\n') C;
return;
case '$':
C; /* discard argument number */
return;
case 'b':
case 'x':
case 'v':
case 'h':
case 'w':
case 'o':
case 'l':
case 'L':
if( (bdelim=C) == '\n')
return;
while(C!='\n' && c!=bdelim)
if(c == '\\') backsl();
return;
case '\\':
if(inmacro)
goto sw;
default:
return;
}
}
char *copys(s)
register char *s;
{
register char *t, *t0;
if( (t0 = t = calloc( (unsigned)(strlen(s)+1), sizeof(*t) ) ) == NULL)
fatal("Cannot allocate memory", (char *) NULL);
while( *t++ = *s++ )
;
return(t0);
}
sce()
{
register char *ap;
register int n, i;
char a[10];
for(ap=a;C != '\n';ap++){
*ap = c;
if(ap == &a[9]){
SKIP;
ap=a;
break;
}
}
if(ap != a)n = atoi(a);
else n = 1;
for(i=0;i<n;){
if(C == '.'){
if(C == 'c'){
if(C == 'e'){
while(C == ' ');
if(c == '0'){
SKIP;
break;
}
else SKIP;
}
else SKIP;
}
else if(c == 'P' || C == 'P'){
if(c != '\n')SKIP;
break;
}
else if(c != '\n')SKIP;
}
else {
SKIP;
i++;
}
}
}
refer(c1)
{
register int c2;
if(c1 != '\n')
SKIP;
while(1){
if(C != '.')
SKIP;
else {
if(C != ']')
SKIP;
else {
while(C != '\n')
c2=c;
if(chars[c2] == PUNCT)putchar(c2);
return;
}
}
}
}
inpic()
{
register int c1;
register char *p1;
SKIP;
p1 = line;
c = '\n';
while(1){
c1 = c;
if(C == '.' && c1 == '\n'){
if(C != 'P'){
if(c == '\n')continue;
else { SKIP; c='\n'; continue;}
}
if(C != 'E'){
if(c == '\n')continue;
else { SKIP; c='\n';continue; }
}
SKIP;
return;
}
else if(c == '\"'){
while(C != '\"'){
if(c == '\\'){
if(C == '\"')continue;
ungetc(c,infile);
backsl();
}
else *p1++ = c;
}
*p1++ = ' ';
}
else if(c == '\n' && p1 != line){
*p1 = '\0';
if(wordflag)msputwords(NO);
else {
puts(line);
putchar('\n');
}
p1 = line;
}
}
}
#ifdef DEBUG
_C1()
{
return(C1get);
}
_C()
{
return(Cget);
}
#endif DEBUG
/*
* Macro processing
*
* Macro table definitions
*/
#define reg register
typedef int pacmac; /* compressed macro name */
int argconcat = 0; /* concat arguments together (-me only) */
#define tomac(c1, c2) ((((c1) & 0xFF) << 8) | ((c2) & 0xFF))
#define frommac(src, c1, c2) (((c1)=((src)>>8)&0xFF),((c2) =(src)&0xFF))
struct mactab{
int condition;
pacmac macname;
int (*func)();
};
struct mactab troffmactab[];
struct mactab ppmactab[];
struct mactab msmactab[];
struct mactab mmmactab[];
struct mactab memactab[];
struct mactab manmactab[];
/*
* macro table initialization
*/
#define M(cond, c1, c2, func) {cond, tomac(c1, c2), func}
/*
* Put out a macro line, using ms and mm conventions.
*/
msputmac(s, constant)
register char *s;
int constant;
{
register char *t;
register found;
int last;
found = 0;
if (wordflag) {
msputwords(YES);
return;
}
while(*s)
{
while(*s==' ' || *s=='\t')
putchar(*s++);
for(t = s ; *t!=' ' && *t!='\t' && *t!='\0' ; ++t)
;
if(*s == '\"')s++;
if(t>s+constant && chars[ s[0] ]==LETTER && chars[ s[1] ]==LETTER){
while(s < t)
if(*s == '\"')s++;
else
putchar(*s++);
last = *(t-1);
found++;
}
else if(found && chars[ s[0] ] == PUNCT && s[1] == '\0')
putchar(*s++);
else{
last = *(t-1);
s = t;
}
}
putchar('\n');
if(msflag && chars[last] == PUNCT){
putchar(last);
putchar('\n');
}
}
/*
* put out words (for the -w option) with ms and mm conventions
*/
msputwords(macline)
int macline; /* is this is a macro line */
{
register char *p, *p1;
int i, nlet;
for(p1 = line ; ;) {
/*
* skip initial specials ampersands and apostrophes
*/
while( chars[*p1] < DIGIT)
if(*p1++ == '\0') return;
nlet = 0;
for(p = p1 ; (i=chars[*p]) != SPECIAL ; ++p)
if(i == LETTER) ++nlet;
if (nlet > 1 && chars[p1[0]] == LETTER) {
/*
* delete trailing ampersands and apostrophes
*/
while( (i=chars[p[-1]]) == PUNCT || i == APOS )
--p;
while(p1 < p)
putchar(*p1++);
putchar('\n');
} else {
p1 = p;
}
}
}
/*
* put out a macro using the me conventions
*/
#define SKIPBLANK(cp) while(*cp == ' ' || *cp == '\t') { cp++; }
#define SKIPNONBLANK(cp) while(*cp !=' ' && *cp !='\cp' && *cp !='\0') { cp++; }
meputmac(cp, constant)
reg char *cp;
int constant;
{
reg char *np;
int found;
int argno;
int last;
int inquote;
if (wordflag) {
meputwords(YES);
return;
}
for (argno = 0; *cp; argno++){
SKIPBLANK(cp);
inquote = (*cp == '"');
if (inquote)
cp++;
for (np = cp; *np; np++){
switch(*np){
case '\n':
case '\0': break;
case '\t':
case ' ': if (inquote) {
continue;
} else {
goto endarg;
}
case '"': if(inquote && np[1] == '"'){
strcpy(np, np + 1);
np++;
continue;
} else {
*np = ' '; /* bye bye " */
goto endarg;
}
default: continue;
}
}
endarg: ;
/*
* cp points at the first char in the arg
* np points one beyond the last char in the arg
*/
if ((argconcat == 0) || (argconcat != argno)) {
putchar(' ');
}
#ifdef FULLDEBUG
{
char *p;
printf("[%d,%d: ", argno, np - cp);
for (p = cp; p < np; p++) {
putchar(*p);
}
printf("]");
}
#endif FULLDEBUG
/*
* Determine if the argument merits being printed
*
* constant is the cut off point below which something
* is not a word.
*/
if ( ( (np - cp) > constant)
&& ( inquote
|| (chars[cp[0]] == LETTER)) ){
for (cp = cp; cp < np; cp++){
putchar(*cp);
}
last = np[-1];
found++;
} else
if(found && (np - cp == 1) && chars[*cp] == PUNCT){
putchar(*cp);
} else {
last = np[-1];
}
cp = np;
}
if(msflag && chars[last] == PUNCT)
putchar(last);
putchar('\n');
}
/*
* put out words (for the -w option) with ms and mm conventions
*/
meputwords(macline)
int macline;
{
msputwords(macline);
}
/*
*
* Skip over a nested set of macros
*
* Possible arguments to noblock are:
*
* fi end of unfilled text
* PE pic ending
* DE display ending
*
* for ms and mm only:
* KE keep ending
*
* NE undocumented match to NS (for mm?)
* LE mm only: matches RL or *L (for lists)
*
* for me:
* ([lqbzcdf]
*/
noblock(a1, a2)
char a1, a2;
{
register int c1,c2;
register int eqnf;
int lct;
lct = 0;
eqnf = 1;
SKIP;
while(1){
while(C != '.')
if(c == '\n')
continue;
else
SKIP;
if((c1=C) == '\n')
continue;
if((c2=C) == '\n')
continue;
if(c1==a1 && c2 == a2){
SKIP;
if(lct != 0){
lct--;
continue;
}
if(eqnf)
putchar('.');
putchar('\n');
return;
} else if(a1 == 'L' && c2 == 'L'){
lct++;
SKIP;
}
/*
* equations (EQ) nested within a display
*/
else if(c1 == 'E' && c2 == 'Q'){
if ( (mac == ME && a1 == ')')
|| (mac != ME && a1 == 'D') ) {
eqn();
eqnf=0;
}
}
/*
* turning on filling is done by the paragraphing
* macros
*/
else if(a1 == 'f') { /* .fi */
if ( (mac == ME && (c2 == 'h' || c2 == 'p'))
||(mac != ME && (c1 == 'P' || c2 == 'P')) ) {
SKIP;
return;
}
} else {
SKIP;
}
}
}
EQ()
{
eqn();
return(0);
}
domacro()
{
macro();
return(0);
}
PS()
{
for (C; c == ' ' || c == '\t'; C);
if (c == '<') { /* ".PS < file" -- don't expect a .PE */
SKIP;
return(0);
}
if (!msflag) {
inpic();
} else {
noblock('P', 'E');
}
return(0);
}
skip()
{
SKIP;
return(0);
}
intbl()
{
if(msflag){
stbl();
}
else tbl();
return(0);
}
outtbl(){ intable = NO; }
so()
{
getfname();
if( fname[0] )
infile = *++filesp = opn( fname );
return(0);
}
nx()
{
getfname();
if(fname[0] == '\0') exit(0);
if(infile != stdin)
fclose(infile);
infile = *filesp = opn(fname);
return(0);
}
skiptocom(){ SKIP_TO_COM; return(COMX); }
PP(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
printf(".%c%c",c1,c2);
while(C != '\n')putchar(c);
putchar('\n');
return(0);
}
AU()
{
if(mac==MM) {
return(0);
} else {
SKIP_TO_COM;
return(COMX);
}
}
SH(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
if(parag){
printf(".%c%c",c1,c2);
while(C != '\n')putchar(c);
putchar(c);
putchar('!');
while(1){
while(C != '\n')putchar(c);
putchar('\n');
if(C == '.')
return(COM);
putchar('!');
putchar(c);
}
/*NOTREACHED*/
} else {
SKIP_TO_COM;
return(COMX);
}
}
UX()
{
if(wordflag)
printf("UNIX\n");
else
printf("UNIX ");
return(0);
}
MMHU(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
if(parag){
printf(".%c%c",c1,c2);
while(C != '\n')putchar(c);
putchar('\n');
} else {
SKIP;
}
return(0);
}
mesnblock(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
noblock(')',c2);
return(0);
}
mssnblock(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
noblock(c1,'E');
return(0);
}
nf()
{
noblock('f','i');
return(0);
}
ce()
{
sce();
return(0);
}
meip(c12)
pacmac c12;
{
if(parag)
mepp(c12);
else if (wordflag) /* save the tag */
regline(meputmac, ONE);
else {
SKIP;
}
return(0);
}
/*
* only called for -me .pp or .sh, when parag is on
*/
mepp(c12)
pacmac c12;
{
PP(c12); /* eats the line */
return(0);
}
/*
* Start of a section heading; output the section name if doing words
*/
mesh(c12)
pacmac c12;
{
if (parag)
mepp(c12);
else if (wordflag)
defcomline(c12);
else {
SKIP;
}
return(0);
}
/*
* process a font setting
*/
mefont(c12)
pacmac c12;
{
argconcat = 1;
defcomline(c12);
argconcat = 0;
return(0);
}
manfont(c12)
pacmac c12;
{
return(mefont(c12));
}
manpp(c12)
pacmac c12;
{
return(mepp(c12));
}
defcomline(c12)
pacmac c12;
{
int c1, c2;
frommac(c12, c1, c2);
if(msflag && mac==MM && c2=='L'){
if(disp || c1 == 'R') {
noblock('L','E');
} else {
SKIP;
putchar('.');
}
}
else if(c1=='.' && c2=='.'){
if(msflag){
SKIP;
return;
}
while(C == '.')
/*VOID*/;
}
++inmacro;
/*
* Process the arguments to the macro
*/
switch(mac){
default:
case MM:
case MS:
if(c1 <= 'Z' && msflag)
regline(msputmac, ONE);
else
regline(msputmac, TWO);
break;
case ME:
regline(meputmac, ONE);
break;
}
--inmacro;
}
comline()
{
reg int c1;
reg int c2;
pacmac c12;
reg int mid;
int lb, ub;
int hit;
static int tabsize = 0;
static struct mactab *mactab = (struct mactab *)0;
reg struct mactab *mp;
if (mactab == 0){
buildtab(&mactab, &tabsize);
}
com:
while(C==' ' || c=='\t')
;
comx:
if( (c1=c) == '\n')
return;
c2 = C;
if(c1=='.' && c2 !='.')
inmacro = NO;
if(msflag && c1 == '['){
refer(c2);
return;
}
if(parag && mac==MM && c1 == 'P' && c2 == '\n'){
printf(".P\n");
return;
}
if(c2 == '\n')
return;
/*
* Single letter macro
*/
if (mac == ME && (c2 == ' ' || c2 == '\t') )
c2 = ' ';
c12 = tomac(c1, c2);
/*
* binary search through the table of macros
*/
lb = 0;
ub = tabsize - 1;
while(lb <= ub){
mid = (ub + lb) / 2;
mp = &mactab[mid];
if (mp->macname < c12)
lb = mid + 1;
else if (mp->macname > c12)
ub = mid - 1;
else {
hit = 1;
#ifdef FULLDEBUG
printf("preliminary hit macro %c%c ", c1, c2);
#endif FULLDEBUG
switch(mp->condition){
case NONE: hit = YES; break;
case FNEST: hit = (filesp == files); break;
case NOMAC: hit = !inmacro; break;
case MAC: hit = inmacro; break;
case PARAG: hit = parag; break;
case NBLK: hit = !keepblock; break;
default: hit = 0;
}
if (hit) {
#ifdef FULLDEBUG
printf("MATCH\n");
#endif FULLDEBUG
switch( (*(mp->func))(c12) ) {
default: return;
case COMX: goto comx;
case COM: goto com;
}
}
#ifdef FULLDEBUG
printf("FAIL\n");
#endif FULLDEBUG
break;
}
}
defcomline(c12);
}
int macsort(p1, p2)
struct mactab *p1, *p2;
{
return(p1->macname - p2->macname);
}
int sizetab(mp)
reg struct mactab *mp;
{
reg int i;
i = 0;
if (mp){
for (; mp->macname; mp++, i++)
/*VOID*/ ;
}
return(i);
}
struct mactab *macfill(dst, src)
reg struct mactab *dst;
reg struct mactab *src;
{
if (src) {
while(src->macname){
*dst++ = *src++;
}
}
return(dst);
}
buildtab(r_back, r_size)
struct mactab **r_back;
int *r_size;
{
int size;
struct mactab *p, *p1, *p2;
struct mactab *back;
size = sizetab(troffmactab);
size += sizetab(ppmactab);
p1 = p2 = (struct mactab *)0;
if (msflag){
switch(mac){
case ME: p1 = memactab; break;
case MM: p1 = msmactab;
p2 = mmmactab; break;
case MS: p1 = msmactab; break;
case MA: p1 = manmactab; break;
default: break;
}
}
size += sizetab(p1);
size += sizetab(p2);
back = (struct mactab *)calloc(size+2, sizeof(struct mactab));
p = macfill(back, troffmactab);
p = macfill(p, ppmactab);
p = macfill(p, p1);
p = macfill(p, p2);
qsort(back, size, sizeof(struct mactab), macsort);
*r_size = size;
*r_back = back;
}
/*
* troff commands
*/
struct mactab troffmactab[] = {
M(NONE, '\\','"', skip), /* comment */
M(NOMAC, 'd','e', domacro), /* define */
M(NOMAC, 'i','g', domacro), /* ignore till .. */
M(NOMAC, 'a','m', domacro), /* append macro */
M(NBLK, 'n','f', nf), /* filled */
M(NBLK, 'c','e', ce), /* centered */
M(NONE, 's','o', so), /* source a file */
M(NONE, 'n','x', nx), /* go to next file */
M(NONE, 't','m', skip), /* print string on tty */
M(NONE, 'h','w', skip), /* exception hyphen words */
M(NONE, 0,0, 0)
};
/*
* Preprocessor output
*/
struct mactab ppmactab[] = {
M(FNEST, 'E','Q', EQ), /* equation starting */
M(FNEST, 'T','S', intbl), /* table starting */
M(FNEST, 'T','C', intbl), /* alternative table? */
M(FNEST, 'T','&', intbl), /* table reformatting */
M(NONE, 'T','E', outtbl),/* table ending */
M(NONE, 'P','S', PS), /* picture starting */
M(NONE, 0,0, 0)
};
/*
* Particular to ms and mm
*/
struct mactab msmactab[] = {
M(NONE, 'T','L', skiptocom), /* title follows */
M(NONE, 'F','S', skiptocom), /* start footnote */
M(NONE, 'O','K', skiptocom), /* Other kws */
M(NONE, 'N','R', skip), /* undocumented */
M(NONE, 'N','D', skip), /* use supplied date */
M(PARAG, 'P','P', PP), /* begin parag */
M(PARAG, 'I','P', PP), /* begin indent parag, tag x */
M(PARAG, 'L','P', PP), /* left blocked parag */
M(NONE, 'A','U', AU), /* author */
M(NONE, 'A','I', AU), /* authors institution */
M(NONE, 'S','H', SH), /* section heading */
M(NONE, 'S','N', SH), /* undocumented */
M(NONE, 'U','X', UX), /* unix */
M(NBLK, 'D','S', mssnblock), /* start display text */
M(NBLK, 'K','S', mssnblock), /* start keep */
M(NBLK, 'K','F', mssnblock), /* start float keep */
M(NONE, 0,0, 0)
};
struct mactab mmmactab[] = {
M(NONE, 'H',' ', MMHU), /* -mm ? */
M(NONE, 'H','U', MMHU), /* -mm ? */
M(PARAG, 'P',' ', PP), /* paragraph for -mm */
M(NBLK, 'N','S', mssnblock), /* undocumented */
M(NONE, 0,0, 0)
};
struct mactab memactab[] = {
M(PARAG, 'p','p', mepp),
M(PARAG, 'l','p', mepp),
M(PARAG, 'n','p', mepp),
M(NONE, 'i','p', meip),
M(NONE, 's','h', mesh),
M(NONE, 'u','h', mesh),
M(NBLK, '(','l', mesnblock),
M(NBLK, '(','q', mesnblock),
M(NBLK, '(','b', mesnblock),
M(NBLK, '(','z', mesnblock),
M(NBLK, '(','c', mesnblock),
M(NBLK, '(','d', mesnblock),
M(NBLK, '(','f', mesnblock),
M(NBLK, '(','x', mesnblock),
M(NONE, 'r',' ', mefont),
M(NONE, 'i',' ', mefont),
M(NONE, 'b',' ', mefont),
M(NONE, 'u',' ', mefont),
M(NONE, 'q',' ', mefont),
M(NONE, 'r','b', mefont),
M(NONE, 'b','i', mefont),
M(NONE, 'b','x', mefont),
M(NONE, 0,0, 0)
};
struct mactab manmactab[] = {
M(PARAG, 'B','I', manfont),
M(PARAG, 'B','R', manfont),
M(PARAG, 'I','B', manfont),
M(PARAG, 'I','R', manfont),
M(PARAG, 'R','B', manfont),
M(PARAG, 'R','I', manfont),
M(PARAG, 'P','P', manpp),
M(PARAG, 'L','P', manpp),
M(PARAG, 'H','P', manpp),
M(NONE, 0,0, 0)
};
|
the_stack_data/692855.c | int incr(int a) {
a++;
return a;
}
int main() {
int a = 1;
int b = 0;
a++;
b++;
b = incr(a);
return a + b;
} |
the_stack_data/960939.c | /*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* %sccs.include.redist.c%
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)insque.c 8.1 (Berkeley) 06/04/93";
#endif /* LIBC_SCCS and not lint */
/*
* insque -- vax insque instruction
*
* NOTE: this implementation is non-atomic!!
*/
struct vaxque { /* queue format expected by VAX queue instructions */
struct vaxque *vq_next;
struct vaxque *vq_prev;
};
insque(e, prev)
register struct vaxque *e, *prev;
{
e->vq_prev = prev;
e->vq_next = prev->vq_next;
prev->vq_next->vq_prev = e;
prev->vq_next = e;
}
|
the_stack_data/1063076.c | /* { dg-do compile } */
/* { dg-options "-O3 -Warray-bounds -fdump-tree-cunroll-details" } */
int a[3];
int b[4];
int
foo (int n)
{
int i;
for (i=0;i<n;i++)
if (b[i]==2)
a[i]++;
}
/* { dg-final { scan-tree-dump-times "Forced statement unreachable" 2 "cunroll" } } */
|
the_stack_data/132952025.c | // These tests try to ensure that the driver operates reasonably when run with
// a strange environment. Unfortunately, it requires a normal shell and the
// 'env' command that understands arguments, unlike the LIT built-in env.
//
// REQUIRES: shell
// The PATH variable is heavily used when trying to find a linker.
// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
//
// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
//
// CHECK-LD-32-NOT: warning:
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
// CHECK-LD-32: "-L[[SYSROOT]]/lib"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
|
the_stack_data/64201146.c | #include <stdio.h>
#define SIZE 12000000
char output[SIZE];
static inline void solve(){
int n, temp, flag = 0;
register char *p;
scanf("%d", &n);
p = output + SIZE - 1;
*p-- = '\0';
while(n--){
flag = 0;
scanf("%d", &temp);
if(temp < 0){
flag = 1;
temp = ~temp + 1;
}
while(temp){
*p-- = '0' | (temp%10);
temp /= 10;
}
if(flag)*p-- = '-';
*p-- = ' ';
}
puts(p + 2);
}
int main(){
solve();
return 0;
}
|
the_stack_data/1223224.c | #include <libgen.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define BUFSIZE 128
static void debug(const char *str, ...) {
va_list ap;
va_start(ap, str);
if (getenv("DEBUG")) {
vprintf(str, ap);
}
va_end(ap);
}
static void get_process_name(pid_t pid, char *name) {
char procfile[BUFSIZ];
sprintf(procfile, "/proc/%d/cmdline", pid);
FILE *f = fopen(procfile, "r");
if (f) {
size_t size;
size = fread(name, sizeof(char), sizeof(procfile), f);
if (size > 0) {
if ('\n' == name[size - 1])
name[size - 1] = '\0';
}
fclose(f);
}
}
int main(int argc, char *argv[]) {
pid_t pid = getppid();
if (pid == 0) {
printf("%s", "[? PID]");
return 0;
}
char name[BUFSIZ];
get_process_name(pid, name);
debug("name: %s\n", name);
char *shell = basename(name);
debug("shell: %s\n", shell);
if (strcmp(shell, "bash") == 0) {
printf("%s", "🥊");
} else if (strcmp(shell, "csh") == 0) {
printf("%s", "[csh] 🧓");
} else if (strcmp(shell, "dash") == 0) {
printf("%s", "🦌");
} else if (strcmp(shell, "elvish") == 0) {
printf("%s", "[elvish] 🧝");
} else if (strcmp(shell, "eshell") == 0) {
printf("%s", "[eshell] 🐃");
} else if (strcmp(shell, "fish") == 0) {
printf("%s", "🐟");
} else if (strcmp(shell, "ion") == 0) {
printf("%s", "⚛️");
} else if (strcmp(shell, "ksh") == 0) {
printf("%s", "🌽");
} else if (strcmp(shell, "oh") == 0) {
printf("%s", "[oh] 😮");
} else if (strcmp("%s", "rc") == 0) {
printf("%s", "[rc] 🧓");
} else if (strcmp(shell, "scsh") == 0) {
printf("%s", "scsh 🧓");
} else if (strcmp(shell, "sh") == 0) {
printf("%s", "[sh] 🍦");
} else if (strcmp(shell, "tcsh") == 0) {
printf("%s", "[tcsh] 🧓");
} else if (strcmp(shell, "xonsh") == 0) {
printf("%s", "[xonsh] 🐍");
} else if (strcmp(shell, "zsh") == 0) {
printf("%s", "🚀");
} else {
printf("%s", "[? SHELL]");
}
return 0;
}
|
the_stack_data/1153581.c | // PARAM: --set solver td3 --enable exp.partition-arrays.enabled --set exp.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set exp.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint
void example1() __attribute__((goblint_precision("no-def_exc","interval")));
void init_array(int* arr, int val) __attribute__((goblint_precision("no-def_exc","interval")));
void example2(void) __attribute__((goblint_precision("no-def_exc","interval")));
int main(void) {
example1();
example2();
}
// ----------------------------------- Example 1 ------------------------------------------------------------------------------
void example1() {
int a[20];
int b[20];
init_array(a, 42);
assert(a[2] == 42);
assert(a[10] == 42);
do_first(a);
assert(a[0] == 3);
init_array(b,12);
assert(b[2] == 12);
assert(b[10] == 12);
}
void do_first(int* arr) {
int x = arr[0];
arr[0] = 3;
}
void init_array(int* arr, int val) {
for(int i = 0; i < 20; i++) {
arr[i] = val;
}
arr[0] = val;
assert(arr[2] == val);
assert(arr[10] == val);
}
// ----------------------------------- Example 2 ------------------------------------------------------------------------------
void example2(void) {
int arr[20];
for(int i = 0; i < 20; i++)
{
arr[i] = 42;
assert(arr[i] == 42);
callee(arr);
}
assert(arr[0] == 100); //UNKNOWN
assert(arr[0] == 7); //UNKNOWN
assert(arr[0] == 42); //UNKNOWN
assert(arr[7] == 100); //UNKNOWN
assert(arr[7] == 7); //UNKNOWN
assert(arr[7] == 42); //UNKNOWN
assert(arr[20] == 100); //UNKNOWN
assert(arr[20] == 7); //UNKNOWN
assert(arr[20] == 42); //UNKNOWN
}
void callee(int* arr) {
arr[0] = 7;
assert(arr[0] == 7);
}
|
the_stack_data/24069.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
printf("argc %d\n", argc);
printf("argv[0] %d\n", atoi(argv[0]));
printf("argv[1] %d\n", atoi(argv[1]));
printf("------- \n");
int **pp;
int *p;
int a = 100;
/* ppにpを指させる */
pp = &p;
/* pにaを指させる */
p = &a; /* *pp = &a でも良い */
/*
pp -> p -> a
pp = p のアドレス
p = a のアドレス
a = 100
*/
printf("&a %p\n", &a);
printf("p %p\n", p);
printf("*pp %p\n", *pp);
printf("&p %p\n", &p);
printf("pp %p\n", pp);
printf("a %d\n", a);
printf("*p %d\n", *p);
printf("**pp %d\n", **pp);
return 0;
} |
the_stack_data/930571.c | /* Exercise 1 - Calculations
Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */
#include <stdio.h>
int main() {
int sub1;
int sub2;
int avg=0;
printf("Enter the subject 1 marks -");
scanf("%d",&sub1);
printf("Enter the subject 2 marks -");
scanf("%d",&sub2);
avg=(sub1+sub2)/2;
printf("The avarage is -%d",avg);
return 0;
}
|
the_stack_data/839504.c | struct st
{
char c;
int n[4];
};
int main()
{
unsigned i;
int k;
i %= 4;
struct st s;
int *p = s.n;
p[i] = k;
return 0;
}
|
the_stack_data/1194781.c | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
/*
Selection Sort Algorithm
https://www.geeksforgeeks.org/selection-sort/
Youtube search "Selection Sort", "CS50"
64 25 12 22 11 (min_idx = 0)
64 (min_idx = 0)
25 (min_idx = 1)
25 (min_idx = 1)
12 (min_idx = 2)
12 (min_idx = 2)
12 (min_idx = 2)
11 (min_idx = 4)
11 25 12 22 64 (swap arr[0] and arr[4])
11 25 12 22 64 (min_idx = 1)
25 (min_idx = 1)
12 (min_idx = 2)
12 (min_idx = 2)
12 (min_idx = 2)
11 12 25 22 64 (swap arr[1] and arr[2])
11 12 25 22 64 (min_idx = 2)
...
11 12 22 25 64 (min_idx = 3)
...
*/
void swap(int* xp, int* yp);
void printArray(int arr[], int size);
void selectionSort(int arr[], int n);
int main()
{
return 0;
}
void printArray(int arr[], int size)
{
}
void swap(int* xp, int* yp)
{
}
void selectionSort(int arr[], int n)
{
}
|
the_stack_data/146382.c | #include <stdio.h>
#define CLS(x, n) (((x) << (n)) | ((x) >> ((32) - (n))))
/*********************************Global var used to save the digest*/
/*state[0] = A, state[1] = B, state[2] = C, state[3] = D, state[4] = E*/
unsigned int state[5];
/*********************************Define the function used in SHA-1*/
unsigned int f1(unsigned int B, unsigned int C, unsigned int D)
{
return (B&C)|(~B&D);
}
unsigned int f2(unsigned int B, unsigned int C, unsigned int D)
{
return B^C^D;
}
unsigned int f3(unsigned int B, unsigned int C, unsigned int D)
{
return (B&C)|(B&D)|(C&D);
}
unsigned int f4(unsigned int B, unsigned int C, unsigned int D)
{
return B^C^D;
}
/*********************************Init the global var unsigned int state[5]*/
void Init()
{
state[0] = 0x67452301;
state[1] = 0xefcdab89;
state[2] = 0x98badcfe;
state[3] = 0x10325476;
state[4] = 0xc3d2e1f0;
}
/*********************************the end of the function*/
/*********************************the function used to compute the 80 loops and save the result into the global var state[]*/
void shaTran(unsigned char * buf,unsigned int * state)
{
int i,j;
unsigned int A,B,C,D,E,temp; /*the Register "A,B,C,D,E" and temp*/
unsigned int K[4]; /*the K[t] used in SHA-1*/
unsigned int W[80]; /*the W[t] used in SHA-1*/
unsigned char * p = (unsigned char *)W; /*the (unsigned char *)p point to W[0]*/
unsigned int new_A,new_B,new_C,new_D,new_E;
/*********************************init the Register "A,B,C,D,E"*/
A = state[0];
B = state[1];
C = state[2];
D = state[3];
E = state[4];
/*********************************init K*/
K[0] = 0x5a827999;
K[1] = 0x6ed9eba1;
K[2] = 0x8f1bbcdc;
K[3] = 0xca62c1d6;
/*********************************compute W[t]*/
/*compute W[t] 0<=t<=15*/
/*++++++++++++++++++++++++++++++++
Notice that
The IA32 System use little-endian to save data in Main Memory
So change the sequence before use it
++++++++++++++++++++++++++++++++*/
for(i=0;i<16;i++)
{
j = 4*i;
p[j+3] = buf[j];
p[j+2] = buf[j+1];
p[j+1] = buf[j+2];
p[j] = buf[j+3];
}
/*compute W[t] 16<=t<=79*/
for(i=16;i<80;i++)
{
//TODO 需要添加代码
W[i] = CLS((W[i-16] ^ W[i-14] ^ W[i-8] ^ W[i-3]), 1);
}
/*********************************compute 1st loop*/
for(i=0;i<20;i++)
{
//TODO 需要添加代码
// new_A = E ^ f1(B,C,D) ^ CLS(A,5) ^ W[i] ^ K[0];
new_A = E + f1(B,C,D) + CLS(A,5) + W[i] + K[0];
new_B = A;
new_C = CLS(B,30);
new_D = C;
new_E = D;
A = new_A;
B = new_B;
C = new_C;
D = new_D;
E = new_E;
}
/*********************************compute 2nd loop*/
for(i=20;i<40;i++)
{
//TODO 需要添加代码
new_A = E + f2(B,C,D) + CLS(A,5) + W[i] + K[1];
new_B = A;
new_C = CLS(B,30);
new_D = C;
new_E = D;
A = new_A;
B = new_B;
C = new_C;
D = new_D;
E = new_E;
}
/*********************************compute 3rd loop*/
for(i=40;i<60;i++)
{
//TODO 需要添加代码
new_A = E + f3(B,C,D) + CLS(A,5) + W[i] + K[2];
new_B = A;
new_C = CLS(B,30);
new_D = C;
new_E = D;
A = new_A;
B = new_B;
C = new_C;
D = new_D;
E = new_E;
}
/*********************************compute 4th loop*/
for(i=60;i<80;i++)
{
//TODO 需要添加代码
new_A = E + f4(B,C,D) + CLS(A,5) + W[i] + K[3];
new_B = A;
new_C = CLS(B,30);
new_D = C;
new_E = D;
A = new_A;
B = new_B;
C = new_C;
D = new_D;
E = new_E;
}
/*********************************add the vars back into the global var state[]*/
state[0] += A;
state[1] += B;
state[2] += C;
state[3] += D;
state[4] += E;
}
/*********************************the end of the function*/
/*********************************the function used to padding*/
void sha(unsigned char *buf, int len, unsigned int * state, unsigned int f1,unsigned int f2)
{
int i;
unsigned int floop1,floop2; /*use floop1:floop2 to represent the length of the file in bit*/
unsigned char flen[8]; /*use unsigned char flen[8] to transform the floop1:floop2 in last block*/
unsigned char *p1 = (unsigned char *)&floop1;
unsigned char *p2 = (unsigned char *)&floop2;
floop1 = f1;
floop2 = f2;
floop2 = floop2 + (unsigned int)(len*8); /*add the last block's length(in bit)*/
/*********************************compute the whole file's length*/
/*compute the length of the file and save it into unsigned char flen[8]*/
/*++++++++++++++++++++++++++++++++
Notice that
The IA32 System use little-endian to save data in Main Memory
So change the sequence before use it
++++++++++++++++++++++++++++++++*/
// printf("floop1 = %08x\n",floop1);
// printf("floop2 = %08x\n",floop2);
for(i=0; i<4; i++)
{
flen[3-i] = *p1;
flen[7-i] = *p2;
p1++;
p2++;
}
/*********************************do the padding*/
/*the file's length(bit) < 448 */
if(len<56)
{
/*pad it like 1000000...(bit) from the end(buf[len-1]) to the buf[55]*/
buf[len] = 0x80;
for(i=len+1; i<56; i++)
{
buf[i] = 0x00;
}
/*pad the last 64bit using flen[8](the length of the file computed before)*/
for(i=56; i<64; i++)
{
buf[i] = flen[i-56];
}
/*then call the function "shaTran" to do the loop*/
shaTran(buf,state);
}
/*the file's length(bit) >= 448 */
else
{
/*pad the 1st block with a number of bit 100000... until the end of the buf(buf[63])*/
buf[len] = 0x80;
for(i=len+1; i<64; i++)
{
buf[i] = 0x00;
}
/*call the function "shaTran" to do the loop*/
shaTran(buf,state);
/*pad the 1st block with a number of bit 000000... until the 448 bit(buf[55])*/
for(i=0; i<56; i++)
buf[i] = 0x00;
/*pad the last 64bit using flen[8](the length of the file computed before)*/
for(i=56; i<64; i++)
{
buf[i] = flen[i-56];
}
/*call the function "shaTran" to do the loop*/
shaTran(buf,state);
}
}
/*********************************the end of the function*/
#define MAX_PATH_LEN (32)
int getSHA(char path[MAX_PATH_LEN])
{
unsigned char buf[64]; /*the input block of SHA-1*/
FILE * file;
int len; /*used to save the length of one read from the file (byte)*/
unsigned int floop1,floop2; /*use floop1:floop2 to represent the length of the file in bit*/
floop1 = floop2 = 0; /*at 1st make them equal 0*/
/*********************************Init the global var*/
Init();
/*********************************can not open file error*/
// if (!(file = fopen("test.txt", "rb")))
if (!(file = fopen(path, "rb")))
{
printf("can not open file!!!\n");
return -1;
}
/*********************************read data from the file*/
while(!feof(file))
{
/*********************************each time read 64 bits into buf at most*/
len=fread(buf,1,64,file);/*len used to save the length of each read*/
/*********************************read file error*/
if(ferror(file))
{
printf("read file error!!!\n");
return -1;
}
/*********************************the buf[64] is full*/
if(len == 64)
{
/*use 2 unsigned int to represent 1 64bit number, floop1:floop2*/
if((floop1 == 0xffffffff) && (floop2 == 0xfffffe00))
{
printf("file larger than 2exp(64)");
return -1;
}
if(floop2 != 0xfffffe00)floop2+=512;
else
{
floop1++;
floop2 = 0;
}
/*call the function "shaTran" to do the loop*/
shaTran(buf,state);
}
/*********************************less than 512 bits need to pad*/
else
{
/*call the function "sha" to do the padding and other compute*/
sha(buf,len,state,floop1,floop2);
}
}
/*********************************print the digest*/
// printf("The hash value is:\n%08x %08x %08x %08x %08x\n",state[0],state[1],state[2],state[3],state[4]);
// getchar();
return 0;
}
|
the_stack_data/69175.c | /* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target tls } */
extern void abort (void);
extern void exit (int);
struct A
{
char a;
int b;
long long c;
};
extern __thread struct A a1, a2, a3, a4;
extern struct A *f1a (void);
extern struct A *f2a (void);
extern struct A *f3a (void);
extern struct A *f4a (void);
extern struct A *f5a (void);
extern struct A *f6a (void);
extern struct A *f7a (void);
extern struct A *f8a (void);
extern struct A *f9a (void);
extern struct A *f10a (void);
extern int f1b (void);
extern int f2b (void);
extern int f3b (void);
extern int f4b (void);
extern int f5b (void);
extern int f6b (void);
extern int f7b (void);
extern int f8b (void);
extern int f9b (void);
extern int f10b (void);
extern void check1 (void);
extern void check2 (void);
__thread int dummy = 12;
__thread struct A local = { 1, 2, 3 };
int
main (void)
{
struct A *p;
if (local.a != 1 || local.b != 2 || local.c != 3)
abort ();
if (a1.a != 4 || a1.b != 5 || a1.c != 6)
abort ();
if (a2.a != 22 || a2.b != 23 || a2.c != 24)
abort ();
if (a3.a != 10 || a3.b != 11 || a3.c != 12)
abort ();
if (a4.a != 25 || a4.b != 26 || a4.c != 27)
abort ();
check1 ();
check2 ();
if (f1a () != &a1 || f2a () != &a2 || f3a () != &a3 || f4a () != &a4)
abort ();
p = f5a (); if (p->a != 16 || p->b != 16 + 1 || p->c != 16 + 2)
abort ();
p = f6a (); if (p->a != 19 || p->b != 19 + 1 || p->c != 19 + 2)
abort ();
if (f7a () != &a2 || f8a () != &a4)
abort ();
p = f9a (); if (p->a != 28 || p->b != 28 + 1 || p->c != 28 + 2)
abort ();
p = f10a (); if (p->a != 31 || p->b != 31 + 1 || p->c != 31 + 2)
abort ();
exit (0);
}
|
the_stack_data/786574.c | int main()
{
return 2084849;
}
|
the_stack_data/248580886.c | #include <stdint.h>
const int16_t cg_MP_FC1weit[1620] = { // Co,H,W,Ci: (180, 9)
// Out channel 0
756, 64, -815, 919, -2680, 1842, 1030, 2648, 1440,
// Out channel 1
167, -3262, 1396, 739, -3891, -384, 2054, -3620, -993,
// Out channel 2
-30, -4930, 1308, -1533, 4923, 842, 695, -1768, -2141,
// Out channel 3
627, 2490, 3628, 370, -1810, -1401, -1163, 1389, -1856,
// Out channel 4
53, -4665, 3015, -114, 3879, -1796, -1930, -524, -2572,
// Out channel 5
70, -2553, 1949, 188, -993, 501, -2556, -2403, -1625,
// Out channel 6
48, 1105, 3088, 1397, 3239, 2986, -1366, -1205, -2075,
// Out channel 7
-102, -45, -392, 1965, 1253, 5140, 1968, -1679, -833,
// Out channel 8
-14, -3778, 2422, -839, -3664, 1239, 1008, -4325, -689,
// Out channel 9
-301, 3199, -1207, 1436, -2831, -973, 1733, 3777, 1573,
// Out channel 10
-195, -2483, -3490, -2034, -1321, -2325, 2151, 1011, 2539,
// Out channel 11
378, -664, -1040, -292, -3045, -1485, 433, 433, -1510,
// Out channel 12
221, 184, 2051, 1276, 80, -1252, 1320, -503, -3390,
// Out channel 13
112, 1, 4010, 655, -1485, 1255, -629, 711, -2248,
// Out channel 14
-131, -2673, 274, -1007, 1910, 3639, -1426, -834, -22,
// Out channel 15
25, -5477, -1144, -1024, 1111, -953, 2391, -3061, 2849,
// Out channel 16
-188, -533, 1619, -457, 3024, 647, 480, -5446, -339,
// Out channel 17
363, 1186, 931, 2381, 363, -1439, 958, 1149, -2944,
// Out channel 18
34, -3074, -924, -1074, 1933, 1717, -1814, -629, 1093,
// Out channel 19
-160, -1483, -365, 1393, 10, 1928, 3147, -1300, -274,
// Out channel 20
-24, 3089, -3787, 1327, 4277, -274, 2917, 1453, 909,
// Out channel 21
204, -3061, -1184, 828, -3424, 2150, 2556, -956, 1220,
// Out channel 22
-205, 4414, -987, 36, -76, -601, 1556, 3440, -567,
// Out channel 23
147, -1084, 2319, -370, -4390, 1414, -1485, -2086, -1728,
// Out channel 24
421, -4695, 1044, 2186, -4067, 347, -1445, -188, 3354,
// Out channel 25
-79, -4074, 1478, -479, 108, 488, -33, -947, 369,
// Out channel 26
-244, 3329, 803, 960, 3733, 1226, -2856, 1244, -777,
// Out channel 27
-54, 2, 1360, -1672, -2404, -320, -2731, 2590, -1103,
// Out channel 28
-9, -434, -1090, 834, 6038, -3675, -1918, 3415, 637,
// Out channel 29
-367, 400, 2384, 3674, -989, 667, -472, 885, -2179,
// Out channel 30
-362, -1107, -1289, -1820, -2138, -2336, -1114, 852, 422,
// Out channel 31
338, 2829, -1926, 1816, 2317, 314, 849, 4066, 1220,
// Out channel 32
29, -2949, 1423, -1833, -296, 294, 1879, -5021, -441,
// Out channel 33
115, -2944, -679, -979, -3852, -371, 1466, -4648, -818,
// Out channel 34
-32, -1787, -910, 1505, -2203, -261, -2512, 5992, 974,
// Out channel 35
47, 2289, -2082, 1106, 3296, 1899, -140, 3572, 1350,
// Out channel 36
105, -967, -22, -211, 2507, 275, 2120, -6061, 569,
// Out channel 37
215, -878, -2911, -960, 3152, 25, -1000, 815, 1044,
// Out channel 38
-149, -3252, 2205, 291, -2272, -3241, 2132, -2306, -1200,
// Out channel 39
-226, 3479, -3759, -1595, 1071, -865, 2911, 1110, 1851,
// Out channel 40
-17, 2863, -1204, 3144, 1861, 3480, -367, 2720, 1146,
// Out channel 41
-532, 452, -54, -1174, -4843, -930, 635, -1411, 2039,
// Out channel 42
50, 5319, -1693, 264, -1298, 2805, 2472, 1384, 228,
// Out channel 43
-79, 2143, 496, -713, -6339, 2387, 1069, -1066, 2199,
// Out channel 44
-609, -4345, 882, 443, 2103, 2281, 1075, -94, -1703,
// Out channel 45
181, -1018, -2002, 357, 6283, -1391, -795, 2476, 1674,
// Out channel 46
-221, 2847, 2015, 2411, 228, 699, 371, 1832, -3386,
// Out channel 47
211, 283, -2142, 1560, 3917, 3257, -1767, 1518, 1032,
// Out channel 48
509, 1199, 375, 907, 422, 3005, 2142, -3355, -3138,
// Out channel 49
-52, -4559, 2551, 115, -1901, -2574, -2277, -1175, 202,
// Out channel 50
107, -1735, -1325, -2544, 1846, -475, -1087, -303, 2353,
// Out channel 51
87, 1952, 109, 1616, -1476, 4508, 1961, -525, 227,
// Out channel 52
335, 685, 688, 1089, -4427, 1040, -2583, 1955, -809,
// Out channel 53
-25, 4287, 1736, 1406, -3970, -1183, 105, -129, -1243,
// Out channel 54
102, -476, 3949, 616, -4039, 2120, -2132, 853, -1612,
// Out channel 55
121, 1359, 1181, 1007, 3876, 740, 690, -3909, 676,
// Out channel 56
6, -1763, 2065, -36, -4090, -2673, 2687, -1579, -1000,
// Out channel 57
-86, 1547, -2900, -1911, 5275, -2143, 776, 116, 1628,
// Out channel 58
330, -1368, -597, 659, -4733, 3222, 3089, -2226, 1034,
// Out channel 59
457, -5466, -347, -1697, 2782, -832, 804, -3859, 1228,
// Out channel 60
-154, -3202, -1577, -206, -307, 3263, 1340, -4283, 808,
// Out channel 61
407, 4243, -947, 1190, 2388, 2884, 1549, 1619, -170,
// Out channel 62
195, -3315, -39, -1508, 2986, 533, -549, -5156, 1716,
// Out channel 63
-64, 79, -1233, 1205, 4543, -3582, -2301, 3788, 685,
// Out channel 64
-148, 1550, -3622, -390, 1099, 2125, -580, 1370, 2543,
// Out channel 65
209, 3656, 193, -1063, -3669, -1289, -1364, -1424, 398,
// Out channel 66
-257, 431, -1696, -237, 5350, -337, -1966, 2383, 1056,
// Out channel 67
-124, -75, -3236, -77, 3530, -1817, 2811, -507, 1734,
// Out channel 68
-42, -453, -2651, -1480, -3809, -1340, 2877, 1267, 629,
// Out channel 69
-232, 1919, -3270, 441, 1273, -2410, 2001, 2023, 2316,
// Out channel 70
390, 1137, -127, -1949, -2356, -3392, 1254, -1920, 35,
// Out channel 71
-183, -3371, 3639, 508, -154, -1927, -3041, 222, -1572,
// Out channel 72
104, -2895, 2140, -1241, -3480, -2306, 2033, -3808, -1625,
// Out channel 73
-4, 4269, -2839, 519, 1533, 494, 563, 4113, 1395,
// Out channel 74
556, -198, 839, 1183, 1912, -2377, -177, 1284, -742,
// Out channel 75
-227, 5669, -1956, 1507, -4564, 1948, 331, 1337, 573,
// Out channel 76
-122, -1369, -3471, -1504, 2953, 1817, 239, 96, 2245,
// Out channel 77
49, -4084, 1859, -980, 856, 375, 508, -4161, 983,
// Out channel 78
134, 857, -1316, 909, 1131, 3821, 3330, -2721, 364,
// Out channel 79
-50, -282, 2846, -582, -4930, 1499, -2900, 443, -958,
// Out channel 80
334, -4398, 2247, -1815, -4896, 379, -2245, -1990, 250,
// Out channel 81
-45, 717, 2738, 1784, 1583, 2110, -2783, 1835, -278,
// Out channel 82
-746, -3295, 1857, 367, 2474, 1801, 889, 1019, -1075,
// Out channel 83
-77, 4901, -311, 1916, -4032, 5062, 1925, 1050, -486,
// Out channel 84
-367, -620, 747, 46, -2185, 1126, 2503, -1812, -2399,
// Out channel 85
-360, -1145, -579, -216, -1519, 3535, 232, -2101, 1918,
// Out channel 86
-188, -106, 3229, 1428, -4064, 3769, -405, 183, -2112,
// Out channel 87
-185, 1987, -2764, 659, 4889, -1924, -164, 3880, 1282,
// Out channel 88
-207, -269, 1247, 1765, -3732, 4262, 1309, -1319, 604,
// Out channel 89
412, -1582, 327, 1598, 4940, -1358, -1649, 3453, 1151,
// Out channel 90
19, 110, 1443, -1386, -2596, 4039, 42, -4298, -110,
// Out channel 91
232, -421, -2711, -1946, -3518, 2179, 2325, -3127, 1726,
// Out channel 92
68, -22, -1081, 1672, 3966, 2977, -2317, 1512, 557,
// Out channel 93
72, 1452, -41, -106, 1859, -3139, -2883, 2723, -825,
// Out channel 94
-82, -1648, -2797, -1514, 2016, -4215, 779, -2068, 2473,
// Out channel 95
-57, 1430, -2111, -1482, -3964, 105, 3114, 719, -1081,
// Out channel 96
-313, -1983, 2307, 620, 3546, -1896, -3710, -778, 136,
// Out channel 97
312, -5288, 1511, 725, 3635, 326, -316, 347, 482,
// Out channel 98
38, 3391, 505, 579, 4173, 2374, -2334, 330, -259,
// Out channel 99
132, -972, 2198, -1356, -5365, 2321, 1231, -4109, -1177,
// Out channel 100
160, 1256, 363, -2326, 2845, -2772, -2820, 1869, 1123,
// Out channel 101
-93, -3535, 2204, -1183, -3638, -846, 324, -4051, -1804,
// Out channel 102
165, -32, 1880, -1334, 1581, -2270, -2345, -2272, 1197,
// Out channel 103
25, -3434, 1796, -1039, -1030, 533, -1124, -5355, -78,
// Out channel 104
258, -3775, 280, 2128, -4582, 2127, 1098, 516, 2533,
// Out channel 105
48, -255, -903, 582, 747, -4354, -2973, 3772, 737,
// Out channel 106
-135, -3034, 2368, -612, 1468, 857, -1760, -3473, -1880,
// Out channel 107
-27, 2138, 0, 917, 2666, 426, -3776, 3764, 863,
// Out channel 108
-48, -1395, 4011, 193, 1722, -538, -1542, -1375, -2041,
// Out channel 109
166, 3359, -942, 1167, 1652, 1798, 2165, 1891, 540,
// Out channel 110
355, -3482, -1761, -390, 1288, 1383, -690, -1281, 2534,
// Out channel 111
15, -4418, 2677, -758, -2873, -2064, -1412, -2236, -567,
// Out channel 112
-61, 4367, 652, 1398, -3488, 1293, -327, 37, -1201,
// Out channel 113
596, -4354, 2487, -1189, -3462, -944, -1252, -2356, 979,
// Out channel 114
-130, 3655, -1355, 930, -4235, -252, -980, -514, 1065,
// Out channel 115
130, 2078, 2473, 1976, 692, 1926, -801, 763, -3211,
// Out channel 116
-359, 945, 702, -2128, -3420, 977, -1593, -458, 1410,
// Out channel 117
-209, 3806, -3313, -68, -2075, 650, 2373, 3152, 253,
// Out channel 118
-416, 1334, -810, 2959, -387, -379, 1725, 1319, -2356,
// Out channel 119
-26, 1366, -719, 78, -2650, -1746, 4053, 633, -330,
// Out channel 120
-227, 4017, -212, 2253, -2459, 1233, 1220, 508, -1547,
// Out channel 121
-12, 3435, -1684, -1437, -3644, -1754, 1246, 5, 3419,
// Out channel 122
387, 1737, 933, 2629, 4391, -97, -560, -857, 836,
// Out channel 123
-31, 72, -768, 278, -5894, 675, 2986, 1396, -498,
// Out channel 124
-60, -88, 3001, 1321, -3267, 3296, 639, -1482, -643,
// Out channel 125
-393, -1081, 513, -189, 106, 973, 2671, -5685, -1283,
// Out channel 126
-398, 2651, 769, 2529, -890, 833, 666, 1360, -2858,
// Out channel 127
-324, -1798, -3752, -448, 5807, -790, 1693, -1040, 940,
// Out channel 128
-102, -4069, 159, -1642, -105, -2908, 2789, -2320, -618,
// Out channel 129
80, 316, -713, 1587, 1893, -2731, 2782, 1888, -174,
// Out channel 130
221, -1010, 1682, 1036, 5261, -799, -1697, 2800, -232,
// Out channel 131
-173, 1386, 3326, -627, -3367, 3161, 234, -972, -1070,
// Out channel 132
-348, -564, 844, 2356, 5391, 1881, -945, -2561, 17,
// Out channel 133
-88, -940, 3094, 1061, -3809, -2073, 1005, -912, -1040,
// Out channel 134
-711, 3281, 1415, 2233, -2419, 929, 7, -687, -1422,
// Out channel 135
-134, -333, 911, 15, -3515, -2934, 2296, 653, 176,
// Out channel 136
-88, -2417, 368, 192, -2593, 3656, 2674, -4809, -576,
// Out channel 137
-302, 357, -755, 1315, 1478, -2144, 2285, -218, 1193,
// Out channel 138
96, 1570, -3352, -108, 5302, -2354, 1673, 1817, 1612,
// Out channel 139
-33, 299, -1925, 783, 5116, -807, -1353, 4418, 1871,
// Out channel 140
103, 2647, 1070, 325, 2542, -487, -3629, 1409, -553,
// Out channel 141
-43, 2944, -2526, 19, 2859, -400, -1653, 4882, 1625,
// Out channel 142
-20, -1653, 2651, 1796, 1910, 433, -4478, -474, 232,
// Out channel 143
-319, 3075, 173, -507, -6330, -24, 124, -2321, 56,
// Out channel 144
-563, -4371, 1174, 388, 1977, 80, -576, 954, 970,
// Out channel 145
254, -1921, 1598, 1745, 1549, -434, 388, -3832, 814,
// Out channel 146
-241, -2559, 1556, 687, -1702, 3065, 1846, -2530, 571,
// Out channel 147
-342, -1263, 668, 3119, 1928, -573, -1492, 1394, 1427,
// Out channel 148
-34, 3540, -298, -1486, 2117, -2681, -550, -1219, 152,
// Out channel 149
245, -3212, 2443, 244, 3770, -1521, -1273, -3381, 536,
// Out channel 150
-663, -4464, 2066, -565, 3593, 1547, 839, -264, -11,
// Out channel 151
-3, 750, 2570, 321, -1858, 2446, -2247, 2384, -2424,
// Out channel 152
-1063, -1433, 1079, 1326, -3593, 180, -421, 1015, 127,
// Out channel 153
405, -179, -1311, 36, 2883, 2151, -2378, 2345, 812,
// Out channel 154
85, 3675, -1945, -249, -2330, 1978, 2843, 1535, -246,
// Out channel 155
131, -1772, -3238, -174, -787, 2077, 3029, -2467, 3780,
// Out channel 156
145, -129, -1743, -404, -4496, -573, 3677, 722, 396,
// Out channel 157
-400, -3100, 1765, -828, -4322, 650, 178, -4096, -173,
// Out channel 158
36, -2921, 1824, -1739, -5446, 113, 489, -3948, -733,
// Out channel 159
-51, 2894, 3795, 1480, -2392, 893, -1668, 1923, -2567,
// Out channel 160
353, 773, 1120, -1883, -2896, 3185, -975, -2177, 312,
// Out channel 161
-70, -1651, 2918, -1734, -2827, -1105, -1738, -1992, -2462,
// Out channel 162
152, 921, 2807, 535, -6292, 3138, 242, -1988, -1866,
// Out channel 163
54, -361, 2511, 625, -542, 3325, 316, -3846, -1666,
// Out channel 164
-424, 1710, 1628, 1644, 1211, -1764, 110, 1598, -3255,
// Out channel 165
310, -1958, 546, -1257, 4331, -3364, -1535, 436, -1657,
// Out channel 166
-112, -1432, -177, 1097, 6873, -3854, -2414, 3602, 441,
// Out channel 167
-186, -1672, 2334, 282, 1346, -825, -3810, -1398, 131,
// Out channel 168
-201, -3734, 611, 300, -1757, 1944, 2522, -3702, 2,
// Out channel 169
78, 3506, -39, 1730, 2674, -434, -2051, 4749, 578,
// Out channel 170
-76, 1310, 1057, -633, -2402, 2876, -1664, 2806, -2006,
// Out channel 171
-147, -1111, -1228, -3152, 215, 186, -1426, -669, 2666,
// Out channel 172
167, -1804, 354, -1923, -926, 2076, -316, -4357, 521,
// Out channel 173
-290, -1455, 2539, 1877, -3116, 921, -4080, 3113, -789,
// Out channel 174
-176, 4075, -3353, 641, 4799, 406, 1241, 1129, -2159,
// Out channel 175
-208, -1553, 1603, 878, 3966, 4081, 1540, -368, -1972,
// Out channel 176
-84, -3092, -485, 635, 4858, 643, 434, 1818, -1862,
// Out channel 177
48, 1868, -4342, -942, 392, -1746, 1995, 1330, 3707,
// Out channel 178
-54, -1827, -696, -1512, 3172, 794, 3236, -5750, 325,
// Out channel 179
-84, -3542, -1357, -1648, 6621, -3673, -1032, 566, 247,
};
const int16_t cg_MP_FC1bias[180] = { // Co,H,W,Ci: (180,)
2510, 1263, -740, 2403, -2727, -3898, 3839, 5220, -239, 2388, -1821, -5850, 1183, 2512, -1474, 1315, 1449, 1591, -3591, 4197, // 20
1392, 2810, 2670, -3811, 1274, -8, 59, -3093, -832, 2431, -4888, 3945, 278, -4836, -2277, 2167, 2370, -3013, 1142, 2184, // 40
4572, 923, 4096, 3910, -1158, 643, 2274, 18, 200, -3379, -2063, 6744, -4225, 1269, 1350, 4054, 2448, 737, 2987, -88, // 60
-1127, 5019, -29, -2286, -1095, -1299, -904, 793, -753, -400, -1704, -3435, -1059, 1889, 2066, 736, -1531, 2646, 6136, -1458, // 80
-3132, 4574, 1843, 4575, 868, 1775, 2381, 127, 5027, 2202, 1523, -932, 1144, -4794, -2890, -723, -2285, 1748, 1539, 752, // 100
-1780, -3845, -1473, -2122, 3553, -4714, -1873, -654, 1043, 6095, -1417, -3233, 1222, -1096, -748, 1381, -1077, -6, 1915, 1264, // 120
1237, 1441, 3301, 593, 4403, 733, 2317, -1589, -79, 504, 2998, 4334, 2522, 2354, 2315, 1259, 2840, 1025, 645, 676, // 140
-2648, -672, -1936, -1943, -12, 1984, 4634, 2220, -1140, 1818, 2920, 474, -2143, -1650, 1755, 2258, 1129, -1975, -3094, 1371, // 160
-1222, -4453, 683, 1869, 725, -3264, -898, -2325, 2521, 2175, -62, -2327, -1646, -1925, -413, 5639, -1480, 62, 2051, -3275, // 180
};
const int16_t cg_MP_FC2weit[18000] = { // Co,H,W,Ci: (100, 180)
// Out channel 0
-647, 78, 920, 282, 403, 1381, -453, -968, 1335, 892, -1357, 253, -15, 816, 676, -1912, 352, -404, 389, -1748, // 20
-835, -875, -205, 1831, -170, 437, 268, -16, -1526, -446, 1456, -2708, 104, 1424, -1074, -1633, 280, -251, -450, -637, // 40
-1431, -221, -405, 276, 552, -2977, 650, -624, -636, 460, -615, -1509, 1112, 62, -76, 876, 449, -505, -316, -742, // 60
1003, -1928, -316, -507, -148, 130, -503, -748, -886, 151, 399, 661, 825, -1514, -385, 149, -997, -147, -1778, 1039, // 80
415, -377, 475, 1057, 352, 52, -19, -1898, -546, -1400, 1291, 206, -203, 955, -174, -659, 1155, -757, 16, 1452, // 100
646, 1999, 1575, 1884, -729, 185, 968, -301, 165, -646, -428, 1645, 381, 972, 119, -488, 1518, 268, -597, 683, // 120
525, 661, -24, -729, 1178, -285, -617, -2105, -1139, -731, -379, 1177, -63, 769, 465, -510, -340, 186, -718, -2696, // 140
962, -1397, 482, 702, 325, 505, -333, -194, 586, -482, 475, -483, 697, -72, 32, -1047, -412, 2361, 1481, 2109, // 160
786, 2604, 2169, 1180, -484, -244, -1427, 701, -613, -310, 179, 72, 1148, -72, -216, -458, 193, -877, -832, -459, // 180
// Out channel 1
-19, -626, -391, -2560, -1021, -152, -1465, 491, -1079, -350, 2349, -492, -1300, -1348, 365, 1672, -1252, 10, 397, 1588, // 200
944, 1100, -254, -1085, 1325, -369, -750, -618, 1865, -677, 642, 2151, -450, -242, 841, 2252, -457, 729, 295, 1019, // 220
2130, -249, -594, 122, -281, 3101, -1403, 1378, -183, -965, 407, -127, -857, -503, -1355, -1183, -1080, 1300, 1288, 1088, // 240
1030, 70, 483, 762, 1110, 36, 1358, 1129, 753, 310, -655, -990, -1746, 2471, 40, 27, 1688, 564, 945, -1060, // 260
-70, -395, -155, -1066, -111, 569, -1442, 1623, 492, 773, -1108, 691, 897, -498, 336, 32, -747, 512, -698, -1823, // 280
-661, -1968, -1193, -706, 816, 221, -403, 16, -1140, 696, 891, -1365, -739, -182, 649, -1404, -641, 408, 376, -134, // 300
-296, -73, -466, -16, -1236, -576, -249, 3008, 182, -191, 88, -1952, 167, -1775, -929, -605, 963, 415, 1681, 2709, // 320
-1642, 1136, 37, -321, -196, -159, 522, 224, -277, -615, 195, -688, -442, 674, -342, 2312, 352, -672, -1039, -3536, // 340
-923, -3289, -2711, -1997, -690, -110, 1285, -72, 719, 306, 185, 746, -852, -409, 259, 210, -496, 1311, 496, 1459, // 360
// Out channel 2
-1050, -145, 6, -708, -87, 844, 491, 1493, -206, -1286, -479, -583, -164, -885, -169, -60, 142, 156, 77, 977, // 380
1, -106, -258, 608, -1076, -627, -231, 590, -177, 380, -39, -175, 477, -71, -515, 316, -477, 224, -36, 223, // 400
1030, -724, 252, -773, -349, 494, 85, 545, 694, -2267, -171, 417, -295, -188, -697, -190, -437, 1838, -195, 1264, // 420
550, 827, 687, -153, 3, 619, 666, -587, 90, -291, -706, -1532, 163, 70, -172, 581, 205, 201, 1147, 35, // 440
89, 196, -1160, 738, -118, 695, -1066, 27, 198, -949, 837, 1248, 551, -497, -201, 95, -399, -1404, 22, -81, // 460
-140, -233, -819, 121, -322, -431, 828, 368, -138, 121, 337, -1548, 603, -810, -25, 125, 64, -74, -128, -722, // 480
382, -1308, -816, 81, -391, 473, -164, 1252, 439, -616, -1193, 94, -65, -1156, 655, -604, -164, -248, 245, -717, // 500
-130, -560, -493, 846, -558, -300, -57, -646, 99, -284, -721, 92, -1639, 112, -52, 936, 611, -323, 133, -479, // 520
470, -598, -1005, -17, -232, 808, -228, -634, 561, 2, 725, 186, 829, -158, 1199, 253, -285, -149, 934, 144, // 540
// Out channel 3
-191, -697, 182, 604, -541, 147, 1053, 1128, -755, -1614, 165, -946, -47, -490, -34, -8, 94, -307, -355, 407, // 560
-2033, 441, 132, -411, -432, 225, 185, 2102, 638, -106, -310, 1447, -29, -1572, 831, 1462, -443, -196, -43, 72, // 580
1113, -647, 1261, 14, -395, 1379, -30, 617, 627, -457, 115, 2090, -356, 122, 2001, -557, -963, 104, -96, 111, // 600
297, 751, 897, -184, -77, 458, 670, -2463, -444, -1124, -613, 95, -756, 1038, 224, -62, -138, -21, 280, 2022, // 620
223, 3113, -524, 1759, -96, 801, 11, 638, 1004, 639, 138, -60, 643, -748, -1298, -297, -458, -146, 961, 292, // 640
-137, -1550, -25, 67, -370, -439, 284, 987, 588, 78, 182, -1178, 339, -562, 15, 567, -69, -703, 213, -1574, // 660
118, -215, -670, -318, -469, -1000, 368, -787, -607, -1808, 330, 1051, 366, -1109, 187, -637, -961, -2285, -2067, 669, // 680
-231, 869, 566, -146, -140, -878, 871, -528, -552, -103, 509, 1498, -822, 936, 147, -552, -260, 199, -260, 252, // 700
852, -369, -848, 114, 272, 462, -268, 457, -216, 1546, 1831, -167, 90, 1338, -53, -254, -178, -121, -679, -767, // 720
// Out channel 4
202, -173, -833, -863, -2595, -1107, -2393, -260, 21, -677, 4767, -242, -1315, -549, -558, 1581, -2383, -526, -1047, 979, // 740
100, 1681, 428, -450, 1604, -883, -2000, 370, 280, -419, 1404, 1313, -1117, -490, 902, 495, -1245, 36, 417, 1865, // 760
-62, 818, 615, 824, -844, 946, -1382, -143, -1214, -856, 659, -203, -262, -648, -1140, -1279, 287, 772, 752, 639, // 780
-330, -222, -18, -290, 582, 25, -112, 701, 2683, 410, 73, -833, 12, 1005, 404, 293, 281, 173, 270, -661, // 800
380, -377, -727, -176, 376, 854, -1133, 1109, 313, 0, -1249, 868, -106, -1029, 798, 468, -1917, -720, -2022, -526, // 820
-472, -887, -1203, -475, 1457, 704, -848, -16, -1929, 657, 555, -444, 64, 272, 639, -1786, -157, 1053, 398, -206, // 840
-378, 2016, -644, 633, -948, -767, -1158, 188, 385, -149, -753, -1182, -1738, 59, -337, 276, -450, -391, 320, 951, // 860
-1896, 145, -1986, 604, -250, -1013, 190, -694, -743, -1533, -266, -458, -581, 180, 1253, 2550, 2292, 151, -110, -2190, // 880
-72, -1549, -1367, -3188, -1231, -508, 419, -2024, 785, 408, 81, 248, -793, 476, -456, -1238, -951, 2853, -789, -630, // 900
// Out channel 5
1168, -724, 590, -1363, -454, -356, -1215, -316, 520, 575, 571, -470, -3661, -181, 1012, 677, 637, -2546, 2220, -977, // 920
305, 0, -638, -281, 1646, 1220, -655, -204, -710, -1503, 359, -249, -186, -876, -349, 595, 684, 129, -2477, -17, // 940
919, 562, -507, 846, 1057, -28, -2644, 444, -912, 630, 1868, -246, 366, -282, -376, 190, -1071, -81, 484, 372, // 960
1278, -634, 214, -84, 2600, -335, 88, 640, 184, 600, 265, -1266, -1222, 139, -1242, 547, 1152, 406, -125, 166, // 980
-221, -203, 742, 87, -1382, 1117, -527, -115, 261, 156, 246, 719, -44, -414, 639, -153, 454, 965, -48, 332, // 1000
882, -403, 793, -146, 1135, -301, -672, 1057, -881, 497, 2139, 481, -812, 925, -402, -2249, 893, -6, -2177, 116, // 1020
-1953, 495, 606, 296, 932, -389, -1703, -575, -1144, 254, 350, 1139, -205, -130, -933, 271, 138, 1109, 503, 110, // 1040
-68, -126, 184, -309, 1613, 851, 113, 1238, -9, -402, 757, -923, 894, 236, -276, 1740, 754, 370, 139, -26, // 1060
455, -952, 489, 203, -1850, -1549, 108, -253, -287, -754, -923, 3240, 822, 27, -1219, -389, -118, 945, -384, -1060, // 1080
// Out channel 6
41, -276, -4688, 914, -3796, 204, -291, -960, -171, 976, -471, -660, -289, 130, -430, -850, 250, 105, -652, -766, // 1100
-529, -350, 455, 1086, 288, -689, -19, 152, -1498, 663, -7, 526, -1394, -304, -576, -716, 363, -422, 67, 1024, // 1120
636, 1298, 1278, 2510, -450, -980, 228, -297, -495, -660, -234, 1089, 382, 1646, 125, 10, 55, -1200, 211, -1487, // 1140
-417, 814, -733, -205, 94, 1043, -437, -875, -451, 439, 673, -931, 247, 640, -295, 3141, -1415, -282, 71, 483, // 1160
60, -69, -1545, 3656, -558, -3, 210, -211, -248, -1390, 404, 940, -516, 36, -176, 124, -388, -2123, -116, 532, // 1180
-36, -357, 581, -677, -112, 506, -735, 747, -760, 110, -718, -1319, 1856, -2, 2057, -209, 1229, 739, 331, 18, // 1200
814, 1747, 187, -176, 575, 30, 553, -1375, -592, -301, -1429, 725, 314, 583, 806, 509, -729, -225, -979, -310, // 1220
554, 951, -98, 2801, -828, 491, -625, 477, 886, -140, -1863, -986, 973, -153, 873, -324, 40, -258, -332, 1641, // 1240
654, 99, 1558, -245, 26, -2418, -2603, 11, -579, -69, -44, -153, -206, 138, -117, -783, -2965, 1189, -635, -4155, // 1260
// Out channel 7
145, 288, -5790, -373, -3433, 311, -859, -563, -1163, 421, 523, 412, 465, -1122, -960, -980, -309, 113, -322, -49, // 1280
340, -133, 236, 257, 512, -1086, 306, 496, 24, 284, -289, 679, -458, 503, 275, 395, 8, -221, -166, 899, // 1300
580, 661, 1828, 997, -1527, -424, 267, 276, -343, -382, -619, 774, 650, 923, -31, -293, 289, 413, -27, -103, // 1320
128, 283, 100, 413, 388, 1402, -380, 355, -178, 767, -140, -1070, -390, 912, 103, 4260, -778, -614, -360, 252, // 1340
132, -731, -1176, 2259, -826, -623, -635, -61, -835, -749, 187, 704, 40, 678, 627, -64, -150, -2793, 157, -512, // 1360
-306, -322, -234, 172, -162, 1235, -278, -281, -858, -393, -135, -1225, 2184, -515, 1779, -20, 536, 711, 496, -56, // 1380
885, 1147, 308, 451, 226, 128, 779, -124, -116, -530, -1678, -903, 402, -142, 755, -435, 527, -66, 483, -230, // 1400
536, 319, 500, 2481, -1180, -315, -723, 326, 555, -862, -4160, -192, -54, -316, -11, -8, -791, -285, -109, -181, // 1420
-270, -43, 231, -451, -761, -547, -2167, 108, -431, 328, -238, -780, 82, 173, -190, -1309, -1822, 1488, -722, -2489, // 1440
// Out channel 8
-290, -188, -1113, 495, 211, -498, 702, -182, -278, -1082, -268, 941, 577, -1237, -665, 70, -276, 469, -504, -121, // 1460
130, -93, 373, -314, -504, -1948, -14, 351, 253, -294, 342, -181, -123, -117, -277, 160, -27, 822, 438, 1119, // 1480
-433, 28, 740, -1106, -2518, 819, 204, -343, 275, -822, 266, -466, -387, 464, -805, -227, -379, 1394, -877, -331, // 1500
-462, 159, 131, 346, 127, 1100, 584, 624, 285, 37, 39, -56, 471, 1154, -35, 1292, -118, -1226, -575, 169, // 1520
251, -1158, -2399, -624, -828, -239, -771, 814, -616, -617, -226, 299, 475, 278, 465, 529, -19, -2036, 44, -187, // 1540
138, -486, -268, -122, -802, 548, 315, 90, -912, -517, -252, -740, 903, -748, 848, -970, -522, 516, 346, -831, // 1560
177, 582, -643, 228, -2062, -899, 210, 437, 466, 406, -623, -408, -367, -536, -218, -10, -947, -501, 261, 147, // 1580
246, -24, -112, 924, -1384, -75, -3, -631, 93, -354, -2728, -152, -1094, 135, 200, 776, 125, -364, -73, -498, // 1600
271, 292, -1096, -332, -57, 651, 306, -555, -334, 549, 254, -428, -213, -248, 725, -678, -1355, 1557, 60, 728, // 1620
// Out channel 9
133, 483, -2189, 405, -4300, -805, -84, 116, 247, 1185, 248, -1145, -879, 631, 127, -66, 381, -844, -473, -5, // 1640
114, 301, 763, -606, 811, -182, 405, 68, -2255, 318, 92, -32, -127, -676, -452, -129, 646, -485, -83, 1676, // 1660
382, 1291, 3371, 5090, -655, -620, -235, 36, 15, -790, -505, 3976, 55, 273, 914, 907, 372, -141, 1019, -729, // 1680
-235, 1053, -224, -2381, -40, 395, -292, -707, -279, 117, 265, -1238, -8, 640, 87, 2465, -489, 588, 1238, 846, // 1700
-238, 749, -452, 3963, 81, 197, 1187, -436, 2598, -1034, 966, 1095, 220, -1256, -128, 224, 29, -184, 424, 318, // 1720
-592, -187, 73, -20, 318, -1425, -290, -36, -673, 1012, -178, -978, 857, 103, 950, -993, 910, 150, -411, 51, // 1740
-34, 1146, 373, -358, 1188, 82, -520, -1770, -301, -358, -989, 2250, 330, 376, 1054, 729, 635, 534, -942, -1425, // 1760
-344, -286, -656, 1237, -292, 378, 1224, -28, -92, -288, 764, 238, 244, -706, 586, 1438, 183, 571, -419, 74, // 1780
768, -1256, 1708, 447, -341, -945, -3614, -279, 507, -463, 276, 744, 422, -39, -142, 528, -1412, 1364, 58, -6136, // 1800
// Out channel 10
109, -306, 530, -17, -321, -77, 722, 570, -1342, 83, -811, -132, 833, -289, -448, -2004, -357, 1459, -999, 720, // 1820
352, -661, 1613, -412, -1303, -804, 664, 226, 366, 792, 671, 1541, -1295, -98, -83, 843, -286, -30, 557, 1077, // 1840
-27, -510, 1292, -5, -184, -403, 2428, 537, 217, -2395, -1174, 988, -45, -201, -13, -33, 334, 352, -412, -1043, // 1860
-446, 1103, -1167, -440, 534, 367, 522, -67, 214, 334, -505, -748, -511, 1526, 440, 1146, -136, -1512, -41, -264, // 1880
-123, -181, -980, 943, 921, -249, 172, 319, 240, 267, -418, -174, -261, -425, -304, 273, -702, -569, 181, -918, // 1900
-1187, -474, -742, -1001, -609, 16, -462, 132, 734, 543, -1072, -1675, 981, -2145, 464, 375, -762, 1316, 3014, -12, // 1920
1576, 31, 53, 415, -385, -133, 1482, 1170, -499, 529, 503, -59, 132, -665, 451, -55, 240, 189, -327, 504, // 1940
-521, 1164, -746, 390, -695, -254, 383, -208, 546, -458, -565, 361, -258, 362, 1160, -218, 501, -1168, -1106, 151, // 1960
-683, -926, -599, -878, 1727, 479, -86, -1052, 44, 903, 440, -1849, -1304, 190, 1978, 846, 112, 359, 237, -800, // 1980
// Out channel 11
-283, -1967, -511, -443, 512, -123, -249, -1340, -1204, -225, -188, -842, -1858, -830, 25, -479, 628, -1156, 612, -2525, // 2000
-553, -1704, -367, -187, 296, -232, 2024, 278, 2022, -1178, 416, -46, -753, -1176, -89, 92, 183, 763, -1736, -325, // 2020
45, -249, -1655, -395, -471, 1428, -1275, 701, -1354, 452, 1609, -2020, 258, 370, -328, -205, -2687, 1247, -2334, 456, // 2040
-958, -174, 1053, 1640, 1439, 866, 3339, -625, -1071, 251, 112, 487, -1364, 1270, 119, 400, 154, -513, -2330, 394, // 2060
-728, 94, -359, -2044, -1842, -128, -1751, 1332, -1516, 627, -31, -556, 797, 1984, 994, -1401, 2906, -364, 1148, -2159, // 2080
2954, -1296, 1374, 174, -1073, 876, -473, 2037, -123, -657, 86, 102, 489, 100, 753, -896, 915, -1660, -1410, -1880, // 2100
-562, -212, 191, -2186, -1023, -573, -1429, 392, -1373, -195, 284, -389, 86, -1699, 643, -1000, -3036, -324, 1283, 1391, // 2120
1724, 2109, 2328, 522, -12, 55, -1666, 279, 1309, 308, -489, 32, -349, 636, -1412, -709, -2532, -916, -955, -290, // 2140
403, 265, -2166, -435, -751, 430, 1697, 2074, -1968, 1361, -343, 2160, 837, 909, 7, -1002, -112, 1325, -611, 700, // 2160
// Out channel 12
-213, 833, 504, -405, -649, -21, -370, 652, -189, 537, 442, -637, 220, -1404, -428, 664, 847, 272, -446, 366, // 2180
2712, -356, -216, -521, -558, -101, -246, -1696, 780, -82, -226, 244, 753, 1531, -1927, -113, 2608, 27, 312, 2148, // 2200
-279, 216, 112, -994, -2, 1268, -298, -398, 837, -1483, 437, -45, -1216, -177, -5672, 1392, 22, 2032, 819, 669, // 2220
788, 1014, 775, 847, -209, 776, -768, 2308, -231, 2008, 8, -2327, 359, 939, 63, 104, -39, 109, 2419, -1362, // 2240
-1377, -2364, -806, -1569, -617, 69, -4185, 1029, -1866, -641, 393, 1274, -12, 41, 2879, -592, -199, -337, -3, -727, // 2260
-745, -569, 360, 712, -1650, -725, -508, -552, -1250, 113, -217, -2043, -146, -1276, 562, -1058, 27, 279, 443, -96, // 2280
152, 421, 971, -39, -1687, 359, -528, 2327, -13, -189, -342, -1939, 1171, -422, -625, 10, 459, 34, 2749, -613, // 2300
-364, 67, -425, 77, -368, 1075, -354, 288, 928, 605, -202, -3920, -176, -249, -66, 1151, 409, 141, -805, -1974, // 2320
-205, -1156, -2452, 204, -553, 5, -440, -156, 711, -6, -1318, -321, -12, -2148, 1729, -317, 171, 2037, 2567, 1548, // 2340
// Out channel 13
112, -1928, 210, -1200, 168, 686, 563, 301, 37, -446, -797, -457, -1042, -188, 1401, -1096, 679, -714, 2241, -1233, // 2360
101, -470, -1545, 17, -8, 813, 892, 71, 458, -666, -131, -842, -151, -2, 102, 1208, -488, 1564, -4223, 46, // 2380
2894, -624, -1115, -249, 243, 1290, -203, 3358, -105, -917, 573, -174, 999, -647, -628, 240, -3058, 486, -515, -126, // 2400
1011, 15, 577, 539, 1245, 47, 2073, -46, -775, -159, -1047, -522, -4279, 542, -1053, 588, 1325, 696, 699, -127, // 2420
-512, 786, 175, -784, -263, 1011, 86, 467, -546, 990, 404, 368, 1409, 400, -506, -618, 738, 618, 1589, -75, // 2440
829, -1053, 688, 557, -488, -938, 965, 2237, 65, 151, 1316, -1124, -363, 40, 344, -268, 532, -599, -854, -305, // 2460
-433, -495, 69, -1598, -44, -833, -570, 1296, -2677, 175, 790, -85, 174, -1651, -468, -3028, -143, -157, 5, 595, // 2480
736, 1415, 2156, -332, 1038, -144, -646, -125, 10, 264, 321, 390, 411, 2112, -785, 186, -1878, -110, -299, -803, // 2500
218, -217, -77, 883, -1557, 161, 430, 882, -378, -163, 443, 867, 1183, 1084, 222, 441, 200, -209, -161, -354, // 2520
// Out channel 14
268, -487, 1282, -1704, 268, -300, 1624, 3748, 118, -751, -114, 557, 236, 98, 1074, -705, -558, -251, 340, 1412, // 2540
-241, 1516, -7, 706, -1409, 231, -596, -29, -950, -86, -95, 284, -365, 612, -223, -45, -1029, 1027, -483, 648, // 2560
451, -968, 1104, -138, 990, -88, 1237, 432, 1590, -2149, 359, 2710, -414, -886, 592, -1094, -29, -168, 1085, -115, // 2580
1244, 1176, -707, -2469, 319, -639, 426, -724, 1235, -1478, -1146, -784, -436, -175, -983, -737, 996, 502, 2791, -230, // 2600
-297, -208, 595, 2245, 1845, 330, 1733, -666, 2093, -385, 229, 533, -45, -2028, -2621, 2225, -2568, 104, -706, 778, // 2620
-1950, 909, -2590, -632, 418, -3174, -36, -557, -519, -72, 38, -1005, -175, -1169, -237, 90, -679, 1157, 479, 893, // 2640
33, -738, -1480, 1182, -162, 701, 649, 759, 89, 11, -296, -16, -98, -601, -377, -494, 1333, -769, -457, 139, // 2660
-1456, -682, -1700, -509, -297, -1565, 985, -1405, -1528, -2056, 636, 1814, 383, 352, 1341, 991, 555, -423, -6, -366, // 2680
104, -114, 1142, 395, 560, -390, -703, -1521, 778, -384, 1000, -437, 93, -547, 986, 2702, 796, -1441, 948, -41, // 2700
// Out channel 15
-721, -2206, 146, -372, -113, -334, 336, -37, -2244, 429, 1278, -486, -867, -544, 462, -103, 45, -691, 832, -803, // 2720
1657, -1624, 119, -1421, -357, 68, 2362, -511, 2890, -1059, 730, 1558, -1489, -1407, 551, 1893, -80, 684, -899, 134, // 2740
832, -439, -418, -521, -173, 4186, -496, 1473, -493, -341, 863, -933, -481, -185, -1925, 551, -1416, 637, -1792, -491, // 2760
-163, 1750, 343, 3816, 1597, 350, 2109, -135, -481, 889, -104, -476, -2323, 1779, 614, -418, 753, -472, -292, -796, // 2780
-1313, 136, -127, -1510, -659, 36, -969, 2822, -1700, 1333, -1151, -193, 822, 1720, -33, -1146, 1927, 749, 1730, -3794, // 2800
1678, -2444, 21, -707, -1184, 898, -665, 1318, 126, 1098, 639, -1743, -83, -1571, 320, -646, 589, -476, -445, -425, // 2820
38, 441, 1032, -2889, -2133, -1249, -291, 2504, -818, -241, 785, -819, 847, -1462, -54, -617, -3307, 32, 2446, 3392, // 2840
2146, 3134, 1189, -78, 369, -28, -1400, 1062, 514, 431, -142, -860, 310, 1202, -764, 1209, -1456, -1972, -3083, -1082, // 2860
-85, -2458, -3808, -933, 101, 289, 2073, 620, -1992, 1877, -343, 1045, -811, -554, 1664, -513, -134, 651, -714, 1683, // 2880
// Out channel 16
-584, -55, -1010, 1396, -518, -547, 1165, -173, 117, -824, -580, -673, -75, -731, -398, 1166, 300, 321, -1046, 89, // 2900
-1179, 67, -378, -611, -185, -996, 134, 411, -413, -833, -147, 25, 490, -40, -506, 319, 28, 452, 60, 488, // 2920
-901, 815, 603, 287, -2725, 537, 365, 524, 337, -502, 253, 174, -298, 229, 264, 150, -701, 671, -355, -499, // 2940
-85, 781, 526, -11, 268, 434, 382, -423, 107, -318, 287, -227, 291, -106, 429, 237, 376, 65, 255, 39, // 2960
408, 191, -2169, 351, -707, -239, -298, 153, -231, 12, -90, 141, -523, -900, -605, 182, -734, 90, 177, 184, // 2980
10, -220, -350, 500, 60, -221, 481, 400, -19, 312, -71, -62, 782, 715, 335, -64, -430, -676, 139, -726, // 3000
15, 781, 77, 266, -1223, 181, 249, -17, 264, -305, 138, 358, 696, -332, 11, -520, 126, -251, -683, -3, // 3020
-668, 787, -670, 227, -2260, -224, 536, -544, -65, 456, -1429, -17, -2597, 44, -79, 630, -79, -167, 150, -538, // 3040
-358, -168, -592, 786, 84, 290, -155, -299, -359, -234, 232, -291, -348, -346, -216, 194, -1839, 992, 705, 191, // 3060
// Out channel 17
-409, -22, 5960, -1525, 3619, 612, 306, 581, 466, -509, 896, 530, -340, -125, 1566, 1483, -100, 183, 821, 970, // 3080
20, -9, -889, -144, -69, 1164, -414, 14, 1000, -1302, 728, -1145, 336, 739, -83, -202, -344, 924, 237, -956, // 3100
-1782, -814, -2577, -1976, 1962, 136, -870, 239, 409, 864, 749, -1061, -596, -2216, -371, -250, -311, 599, -242, 1683, // 3120
837, -1166, 139, 380, 186, -1025, 935, 663, 804, -691, 6, 594, 257, -1597, -398, -4620, 1780, 561, 254, -437, // 3140
-45, -438, 984, -3347, 562, 548, -720, 141, -905, 1109, -124, 938, 180, -148, -11, 449, 138, 2010, -204, -226, // 3160
-55, 991, -266, 496, 364, 13, 708, -795, -181, -544, 1194, 1091, -2549, 615, -1342, -1233, -563, -503, -185, -241, // 3180
-1720, -1603, -852, 222, -1190, 422, -999, 1938, 1353, -403, -107, -1253, -559, -414, -1697, -189, 163, -198, 418, 295, // 3200
-502, -274, 122, -1376, 1002, -429, 515, -6, -457, 61, 2537, -171, -469, 1015, -704, 802, 100, 381, -166, -2082, // 3220
166, 331, -1701, -463, -523, 1222, 1376, 435, 963, -623, 205, 19, 126, -217, 267, 1025, 2063, -212, 1030, 4417, // 3240
// Out channel 18
970, -746, 92, 115, 951, 88, 1162, 1590, -26, 172, -15, 184, 446, 1987, 694, -800, -1284, 161, 176, 718, // 3260
-1698, 955, -99, 868, -439, -384, 410, 20, -718, 141, -779, -78, -350, -270, 1204, 720, -1790, 232, 210, -2727, // 3280
871, -1052, 632, -708, 205, -204, 515, 180, 1170, -347, -511, 1038, 808, -920, 1529, -33, 341, -1655, 949, -413, // 3300
242, 991, -1163, 590, -223, -435, -300, -1336, 393, -1474, -1101, 636, -4, -109, 67, 1124, 514, -225, -54, 1860, // 3320
770, 1020, 284, 2143, 94, -205, 3063, -287, 1764, 938, -689, -1365, 570, -684, -4796, 289, -42, 821, -384, -221, // 3340
-1198, -76, -1430, 170, 1406, -161, 93, 671, -211, -210, 363, 202, -158, -50, -326, 1262, -1084, 587, 374, 27, // 3360
723, -1610, -914, 586, 1280, -562, 809, -114, -55, -310, 1068, 793, 38, 58, 45, 459, 1291, -438, -1577, 633, // 3380
149, 462, 508, -917, -31, -350, 673, -76, -2037, -783, 75, 2509, 9, 1102, 269, -1106, 481, -390, -467, 1066, // 3400
-575, -192, 824, -119, 836, -371, -155, -425, -81, 966, 1411, -64, -550, 1535, -147, 1985, 717, -2241, -1578, -458, // 3420
// Out channel 19
-382, 257, -1401, 1092, 164, -724, -508, -4058, -318, 949, 17, -824, 217, -589, -1783, 429, 1264, 465, -932, -2075, // 3440
347, -1859, 610, -928, 478, -1026, 434, -325, 1370, 184, -442, -87, -238, -575, -1368, -514, 207, -740, 205, 776, // 3460
-237, 1380, -238, 775, -988, 13, 783, -1198, -893, 1055, -62, -914, 304, 1640, 256, 917, 1055, 151, -201, -130, // 3480
-1935, -1124, -537, 1135, -222, 457, -663, -102, -1617, 382, 2260, 736, 1347, 469, 569, 1430, -1541, -164, -1920, -448, // 3500
-653, -566, -708, -1375, -1235, -1407, -1773, 642, -2193, 806, -181, -1067, -136, 2150, 2664, -1522, 1141, -498, 476, 100, // 3520
905, -917, 1937, 4, -407, 2256, -915, 379, 256, -257, -878, 785, 641, 487, 469, 35, 156, -783, 131, -336, // 3540
620, 704, 1952, -911, -447, -243, -6, -711, 154, -155, -117, -236, 522, 886, 1093, 868, -1796, 164, 658, -120, // 3560
716, 617, 1324, 754, -1225, 1188, -921, 19, 1627, 2093, -1070, -1376, -269, -1138, -632, -1235, -273, -137, -451, 504, // 3580
-390, 592, -188, 358, 730, -22, 892, 1472, -919, 1116, -958, -115, -643, 114, -202, -1815, -573, 952, -893, -202, // 3600
// Out channel 20
-265, -463, -130, 615, -224, -517, 2616, 1121, -567, -139, -3239, -2772, -237, 525, -141, -594, 1173, -28, -594, 691, // 3620
505, -692, 542, -691, -454, -378, 1595, -111, -42, 198, -1631, 995, 110, -2071, -706, 609, 862, -300, -385, 67, // 3640
2426, -426, 2105, 458, 121, 298, 148, 1022, -445, -2227, -57, 3183, -930, 216, 143, 841, -493, 1020, 26, -115, // 3660
-626, 3588, 439, -557, 920, 266, 809, -417, -1338, -658, 39, -824, -720, 716, 613, 434, -902, 386, 3085, -426, // 3680
-651, 2416, 283, 1525, -884, 432, 1202, -237, 701, -25, 2070, -398, 246, -655, -980, -1591, 93, -479, 2660, 412, // 3700
-138, -1561, 369, -616, -905, -1376, 751, 1071, 748, 1632, -251, -2454, 712, -878, -302, 395, 589, -778, -800, -508, // 3720
273, -168, 979, -1674, 1437, -158, 206, -186, -1325, -601, 782, 1960, 1858, -335, 703, -258, 431, -598, -60, -71, // 3740
1049, 890, 1022, -390, -103, 170, -271, 571, 316, 1231, 227, 793, -428, 441, -60, 301, -2139, -423, -1385, 695, // 3760
538, -845, 445, 1317, -245, -449, -330, 413, 157, 850, 482, -163, 22, -723, -502, 562, -43, -107, 968, -176, // 3780
// Out channel 21
-332, 546, 407, 214, 40, 1934, 1506, -232, 584, -367, -1330, -504, 836, -60, 253, 337, 3645, -112, -195, -96, // 3800
663, -1224, -1170, 59, -924, 91, 1667, -2197, -134, 594, -1386, -934, 981, 1070, -2540, -153, 2039, 247, -306, -106, // 3820
242, -152, -257, -250, 299, -88, 485, 273, 688, -961, -737, 986, -462, 182, -1544, 2634, 12, -429, -348, 117, // 3840
342, 186, 1192, 22, -150, 37, 302, 842, -2965, 514, 379, -160, -343, -472, -49, 475, 128, 773, 2823, -434, // 3860
-886, -739, 435, -944, -161, -368, -615, -571, -68, 133, 1507, 439, -784, -510, 576, -1696, 1550, 169, 1521, 421, // 3880
-99, 2, 795, 866, -986, -1051, 1195, -82, 596, 400, 40, -461, -314, -606, -230, 273, -51, -1530, -166, -423, // 3900
-5, -26, 1683, -2256, 1273, 1229, 330, 778, 334, 209, -256, 326, 3163, 287, 482, -230, 1137, 679, 625, -328, // 3920
1529, -525, 954, -411, -95, 2613, -570, 490, 368, 1984, 92, -196, 96, -231, -635, 290, -1515, 583, -427, 123, // 3940
455, -535, 50, 2611, 316, 731, -247, 937, -569, -526, -971, 38, 396, -1182, 697, 257, 499, -157, 2335, 306, // 3960
// Out channel 22
-280, -418, 589, 1339, 2002, 1428, 2130, 236, -339, 169, -2629, 69, 954, 2091, 444, -2022, 198, 825, 808, -403, // 3980
-538, -1505, -314, 983, -1323, -179, 989, 457, -31, 505, -693, -864, 280, -42, -384, 18, -263, -39, -687, -2507, // 4000
-665, -1740, -710, -1181, 491, -1166, 2312, -365, 1686, -279, -762, -909, 1339, 91, 2794, 534, -1006, -817, -676, -1356, // 4020
87, 898, -829, -18, -554, -702, 407, -868, -808, -608, -581, 1149, -283, -517, 705, 415, -321, -1089, -1424, 1162, // 4040
462, 536, 203, 370, 885, -1205, 2187, -878, -1332, 27, -89, -2203, 879, 1802, -1653, -273, 3, -301, 636, 831, // 4060
-66, 813, -102, -586, -1250, 316, -52, 17, 1451, -371, -919, 193, 381, -1293, -609, 3072, -1140, -111, 496, 813, // 4080
839, -1953, 241, 160, -208, 306, 1553, -1081, -119, -161, 1476, 1151, -233, 250, -487, -541, -842, -394, -1563, -619, // 4100
821, -22, -31, 46, -274, -496, -429, -1381, -94, -40, 430, 1312, -129, -34, 1065, -3837, 1, -580, 277, 2503, // 4120
19, 2260, 2317, 429, 2203, 1636, -334, -88, -1228, 274, 804, -1302, -429, 556, 1094, 1114, 355, -3248, -468, -307, // 4140
// Out channel 23
-1497, 663, 361, 55, 1863, 1629, 2261, 570, 1062, 38, -470, 207, 2428, 616, 635, -527, -305, 884, 578, 121, // 4160
-813, -659, 33, 1209, -572, -366, 639, 825, 621, 1413, 594, -727, -239, 1129, 950, -233, 56, -422, 1405, -1269, // 4180
-1060, -400, -1609, -1455, 84, 172, 1744, -337, 112, 1029, -663, -876, -70, -102, 459, -79, 421, -680, -1557, 368, // 4200
-478, -1119, -498, 894, -1587, 371, 948, -109, -70, -549, -167, 1908, 885, -826, 500, -743, -1084, -81, -1529, 566, // 4220
296, 77, -490, -2166, 63, -641, 315, 56, -939, 257, -478, -790, -241, 829, -297, -1150, 782, -19, -258, -44, // 4240
-1065, 840, -402, 593, -897, 634, 1009, 3, 1719, -1139, -583, 2522, 287, 52, 518, 1786, -153, -1323, 1547, -456, // 4260
719, -712, -167, -610, -310, 945, 2181, 544, 82, -525, -22, -421, 503, -19, 473, -296, -737, -538, 210, -245, // 4280
951, -1293, 750, 442, -113, -149, 188, 421, -229, -50, -102, -115, 285, -782, -746, -2559, -1396, 682, 230, 1171, // 4300
-148, 2347, -704, 19, 1752, 777, 569, 494, 279, -58, 424, -1618, -1181, 130, 313, 182, 430, -1187, -16, 885, // 4320
// Out channel 24
-54, -768, -334, 1778, 497, 9, 1914, 101, 29, -476, -851, -693, 1654, 732, 15, -1233, 239, 619, -1229, 8, // 4340
-425, -733, 925, 365, -735, -909, 142, 286, 23, 369, -396, 853, -1399, -1891, 656, 1381, -25, 630, 607, -638, // 4360
829, -23, 565, 196, -678, -368, 1050, 436, -219, -553, -676, 255, -661, 469, 935, -89, -497, -681, -414, -456, // 4380
-1164, 2076, 364, -66, -1155, 748, 802, -766, 152, -776, -206, 1152, -1348, 893, 765, 118, -774, -774, -582, 1157, // 4400
439, 1217, -71, 705, 224, -440, 651, -12, 282, 384, -186, -243, 442, -289, -1247, 228, 81, -739, 607, -33, // 4420
225, -1208, -429, -1176, -824, 269, 624, 1924, 1397, 255, -1005, -630, 1118, -650, -13, 678, -326, -177, 184, -350, // 4440
627, 113, -171, 458, -726, -484, 1396, -931, -475, -832, 1310, 213, -454, 447, 865, -52, -736, -752, -978, 428, // 4460
-526, 1415, 261, 515, -890, 26, 445, -511, -206, 532, -444, 1389, -1084, 623, -153, -456, -716, -41, -191, 1431, // 4480
-206, -180, 312, -253, 1539, 294, -599, -117, -22, 413, 1488, -1305, -901, 866, -471, 349, -899, -414, -923, -407, // 4500
// Out channel 25
-477, 2259, 207, 421, 716, 394, 388, -278, 2437, -824, -543, 245, 404, -29, -563, 974, 1126, 197, -672, 1512, // 4520
-362, -276, -1472, 234, 375, 48, -348, -433, -613, 283, -253, -1739, 1989, 1140, -333, -2588, 680, -1110, 1481, -631, // 4540
-2012, 507, -1947, -146, 498, -349, 23, -650, 709, 2661, -567, 403, -475, 191, 542, 808, -130, -1168, 758, 298, // 4560
282, -399, 501, -985, -773, -252, -536, -222, -296, 498, 210, 547, 3231, -4581, 658, -1482, -1035, 957, 174, -36, // 4580
47, -414, 12, -1092, 735, -251, 857, -1126, 1027, -532, 497, -636, -544, 47, -373, -1048, 1138, 521, 24, 844, // 4600
-494, 2257, 762, 1090, -306, -206, 778, -2458, 1181, -257, -485, 2793, -154, 547, -509, 571, -391, -2079, 407, 42, // 4620
19, -75, 409, -155, 608, 1241, 876, -296, 1245, 40, 194, 1442, 516, 1060, 617, 629, 2228, 383, -708, -1244, // 4640
-340, -4503, 1600, -553, -420, 673, 1249, -423, 271, 1915, 34, 65, -98, -951, -1012, 587, -634, 925, 1266, -435, // 4660
-127, 1539, 1466, 1311, 54, 149, 267, 901, 1853, -747, -621, -1217, 484, 281, -593, 463, 799, -462, 1440, -201, // 4680
// Out channel 26
304, 1332, -887, 403, -2769, -781, 172, 415, 1929, -119, -210, -376, -11, 242, -302, -444, -132, -442, -794, 923, // 4700
556, 840, 331, 1675, -382, -33, -461, -420, -4549, -456, -511, -1280, 1097, 91, -692, -836, 61, -808, 460, 877, // 4720
-59, 1232, 2122, 2667, -892, -3124, -300, -549, 1124, -984, -343, 2499, -326, 1001, 388, 68, 432, -1206, 2038, -148, // 4740
364, -68, -147, -3538, -174, 774, -2030, -627, 422, -340, 77, -1541, 2190, -556, 9, 1759, -518, 680, 1566, -147, // 4760
-208, -150, -836, 2316, 342, 483, 1124, -1201, 1722, -2337, 684, 1273, -1227, -1515, -522, 262, -867, -1034, 68, 4762, // 4780
-848, 990, 57, -115, 118, -1524, 544, -1731, 60, 66, -718, -1, 1442, 423, 824, 165, 755, 800, -86, 251, // 4800
438, 1399, -35, 1506, 1083, 1142, -62, -1345, -161, -441, -2315, 1707, -429, 282, 1095, 918, 2705, 144, -1120, -3757, // 4820
-558, -2104, -729, 1442, -188, 284, 422, -434, 594, -425, -579, 81, -544, -915, 742, 480, 370, 1792, 2171, 1220, // 4840
615, -259, 2437, -10, -92, -853, -5114, -332, 836, -890, -292, -83, 933, -520, 97, 240, -834, 219, 363, -4584, // 4860
// Out channel 27
887, 378, 1842, -584, 429, 794, -152, -292, -408, 342, 357, 934, -242, 709, 360, -935, -398, -207, 1268, -578, // 4880
-55, -116, 451, 81, -322, 1448, -25, 167, -179, 571, 246, 229, -1162, -83, 413, 475, -352, 6, 214, -634, // 4900
643, -718, -218, 262, 2813, -1005, -124, -245, -876, 805, -64, -1009, 207, -700, -756, -13, 187, -837, 27, -264, // 4920
107, -481, -122, 102, -33, -400, -483, 257, -190, 425, -63, -74, 175, -214, -773, -83, 361, -279, -1376, -397, // 4940
-773, 121, 1459, -756, 957, 165, 249, 604, -293, 588, 63, -267, -240, 326, 852, 58, -31, 773, 246, -252, // 4960
159, 354, 535, -348, -301, -180, -377, 354, -69, -120, -432, 5, -1372, -45, -1152, -891, -13, 367, -125, -60, // 4980
-239, -440, 203, -313, 252, 107, -410, -400, -257, 515, -29, 205, -425, -125, 221, 89, 275, 367, 7, 654, // 5000
499, -1075, -17, -738, 2731, 495, -379, 762, -230, -323, 955, 261, 3283, -217, 497, -816, -430, -272, -339, 483, // 5020
-20, -654, 607, -426, 136, -526, 891, 651, -1, 132, -559, -183, 299, 615, -54, -390, 1694, -336, -516, 359, // 5040
// Out channel 28
1238, -493, -1019, -333, -2184, -1134, -2869, -892, -486, 326, 4033, -96, -1590, -999, -838, 1219, -2755, -1791, 666, -680, // 5060
-22, 1099, -482, -493, 1662, -187, -1722, 967, 800, -1522, 702, 1700, -1979, -924, 1970, 577, -1905, 1469, -191, 731, // 5080
634, 1223, -218, 276, -758, 755, -2331, 572, -1877, 706, 715, -467, 1013, -626, 116, -975, -696, 258, 1233, -123, // 5100
-721, -1496, -428, 300, 1563, 210, 91, -17, 1736, 219, -15, 69, -399, 1277, 195, 294, 883, -812, -1622, 477, // 5120
314, -268, -21, 109, -234, 406, -185, 979, 443, -12, -86, -309, 187, -74, 801, 404, -1078, 114, -1035, -902, // 5140
729, -649, -637, -797, 2213, 1129, -980, 1150, -2949, 182, 562, 156, -266, 874, 470, -1664, 645, 557, -738, -617, // 5160
-707, 1205, -539, 739, -1284, -1289, -1340, -471, -604, -15, -595, -1390, -1431, -950, -597, -49, -1258, -280, 670, 631, // 5180
-327, 959, -734, 300, -189, -1119, 86, -90, -253, -1817, -327, -155, -325, 177, -64, 1987, 812, 491, -228, -1278, // 5200
-21, -1577, -545, -2066, -981, -550, 547, -806, -320, -492, 324, 1425, -636, 988, -1181, -773, -833, 1591, -1443, -1059, // 5220
// Out channel 29
666, -359, 909, -284, 17, 605, 260, -481, 2016, -212, -749, 732, -973, 328, 883, -585, 794, -1684, 899, -1501, // 5240
-114, -390, -2606, 858, -253, 927, 127, -298, -1190, -789, 71, -2227, 593, -276, -1306, -1346, 1192, 124, -1377, -642, // 5260
-301, 1323, -440, 1250, 645, -1487, -1010, -355, -854, 884, 693, -884, 164, 572, -62, 421, -654, -284, 508, 390, // 5280
518, -1418, 839, -497, 545, 361, -777, 178, -248, -512, -139, -72, 47, -856, -1708, -297, 93, 1972, -672, -193, // 5300
179, 81, 479, 70, -56, 440, 505, -1060, 307, -762, 2503, 65, -313, 181, -162, 183, 858, -20, 550, 2339, // 5320
671, 1217, 1206, 1677, 93, -641, 212, 565, -137, -745, -373, -55, -352, 1949, -310, -320, 300, -514, -3246, -374, // 5340
-1248, -120, 632, -610, 1154, -34, -1067, -1282, -489, -334, -262, 856, 58, -321, -521, -225, 94, 50, -81, -1726, // 5360
428, -812, 1300, -419, 668, 512, 174, -27, 903, 363, 606, -426, 33, -486, -590, -384, -789, 968, 1642, 1062, // 5380
2458, 1812, 1127, 1347, -1306, -503, -1478, 2254, 229, -451, -462, 2159, 2038, -244, -1163, 153, 357, -643, 652, -1306, // 5400
// Out channel 30
-241, 3660, 33, 1018, 364, -138, 601, -426, 1814, 507, 92, 346, 958, 1166, -1112, 79, 556, 1103, -1208, 991, // 5420
-1163, 530, -229, 781, -1, -711, -1750, 252, -692, 668, -91, -842, 1283, 1032, -449, -1994, -554, -1460, 3304, -829, // 5440
-3463, 123, -1296, 205, -314, -1508, 894, -2622, 258, 1555, -698, -265, -1545, -56, 848, -346, 3344, -220, 1159, 718, // 5460
-706, -1405, -622, -1144, -1577, -306, -2202, 437, 478, -12, 1105, 518, 4288, -2142, 905, -943, -1221, 682, -34, 5, // 5480
529, -316, 46, -501, 226, -338, 590, 161, 692, 170, -464, 180, -1318, -1071, 114, 167, 49, 124, -1837, 1584, // 5500
-177, 3177, 649, 299, -2, 194, 244, -3064, 1263, -372, -516, 2252, -268, 621, -503, 515, -190, -554, -189, 753, // 5520
536, -96, -115, 655, 367, 1175, -124, -415, 2445, -152, -137, 125, -706, 2031, 452, 1649, 932, 204, -301, -1531, // 5540
-952, -3432, -514, -644, -342, 120, 775, 658, -336, 859, 37, 184, -128, -1505, -857, -331, 844, 357, 1607, 666, // 5560
-485, 1687, 1060, -53, 595, 401, -347, 458, 804, -353, -266, -271, -207, -337, -784, 56, 33, -967, 850, 197, // 5580
// Out channel 31
910, 237, -791, -369, -3216, -2189, -2520, -694, -374, 1514, 1746, 794, -234, -1279, -365, 700, 322, -183, 343, 238, // 5600
3326, 647, 243, -1426, -23, -49, -344, -2237, 144, -434, -189, 390, 782, 270, -569, -197, 611, -271, 92, 4451, // 5620
-252, 1060, 2221, 893, -162, -64, -747, -313, -1213, -713, 136, -34, -1072, -266, -3577, 730, 224, 1135, 902, 580, // 5640
684, 844, -624, 156, -36, -348, -334, 2988, 518, 4744, 491, -2681, 131, 1432, 380, 818, 658, -209, 1853, -1398, // 5660
-1293, -2511, 172, 1172, -682, 223, -2435, 2021, -960, -242, -489, 943, -706, -140, 2140, 979, -1384, -433, -133, 398, // 5680
557, -510, 672, -1006, 327, 392, -2065, -427, -884, 1383, 547, -1425, -458, 476, -81, -1357, -191, 1922, -392, 807, // 5700
643, 1740, 752, -147, -420, -562, -201, 739, 51, 770, -753, -786, -52, 565, -127, 774, 171, 956, 3439, -469, // 5720
-224, 501, -948, 42, -222, 435, -314, 199, 537, -476, 189, -2383, 552, -94, 1456, 1453, 795, -157, -41, -933, // 5740
-71, -3712, -951, 122, -1048, -1114, -372, -833, -168, -138, -1490, 30, -170, -2117, -1063, -661, -642, 2801, 889, 205, // 5760
// Out channel 32
498, 271, 322, 362, 524, 370, 483, 607, 1206, 117, -33, 850, 194, 2135, 64, 116, 439, 246, 257, 536, // 5780
-787, 52, 135, 348, 409, 1194, 93, -168, -570, 377, -44, -573, -916, -481, 293, 19, -365, -510, -456, -2260, // 5800
-445, -533, -631, 964, 576, -1479, 469, -771, -773, 1709, 414, 329, 818, -7, 3209, -109, 371, -2972, 1139, -420, // 5820
268, -330, -400, -868, -1068, -740, -386, -489, 124, -1014, -508, 1047, 330, -2573, -72, -616, -456, 694, -252, 1312, // 5840
432, 346, 955, 1229, 488, 31, 3265, -1381, 2082, 617, 277, -492, -91, -873, -1796, 368, 447, 1319, 272, 913, // 5860
-315, 1599, 9, 188, 745, -381, -55, -54, -549, 664, -532, 3566, -64, 530, -936, 321, 603, -963, -581, 486, // 5880
-223, -575, 4, -207, 1870, -377, 199, -2238, 120, 941, 1059, 1415, 256, 661, 464, 387, 347, 234, -1897, -462, // 5900
452, -246, 230, -419, 121, 94, 1250, 196, -600, 659, 1286, 1216, 1382, 450, -404, -1245, -172, 1086, 1367, 1697, // 5920
-108, 1378, 1656, 34, 494, -137, -96, -97, 1003, -1092, 768, -308, 83, 803, -1907, 246, -70, -2537, -336, -871, // 5940
// Out channel 33
598, 654, -252, 34, -1214, -169, 842, 743, 243, 540, -123, -1854, -520, 313, -679, 733, 652, -228, -540, 577, // 5960
-176, 687, 514, -421, 837, 709, -83, 257, -761, -394, -1302, 822, 790, -472, -794, 134, 460, -402, 482, 997, // 5980
506, 591, 1038, 1414, -23, 563, -342, -186, -420, -728, 147, 3340, -1599, 347, 278, 719, 289, 67, 1786, 762, // 6000
-230, 1163, 634, -1345, 37, -26, -284, -350, -333, -345, 57, -692, -75, 70, -126, 206, 163, 1672, 3107, 440, // 6020
-109, 1221, -117, 1663, 323, 201, 27, -387, 2070, -743, 583, -65, -347, -3191, 114, -908, -687, 116, -228, 395, // 6040
380, -112, 499, 398, 594, -2531, 10, -245, 175, 1184, -96, -454, -368, 869, -446, 279, 472, -777, -430, -91, // 6060
-172, 792, 341, 279, 1639, 215, -99, -353, -105, -9, 557, 1823, 379, -227, -66, 142, 1856, -170, 311, -672, // 6080
-586, 83, -243, -438, 7, 294, 1522, 351, 156, 391, 383, 336, -651, -939, 542, 1010, -510, -375, 77, 466, // 6100
-171, -1427, -296, 283, -654, -821, -86, -47, 654, -340, -63, -195, 294, -1084, -810, 854, -585, 362, 1134, -652, // 6120
// Out channel 34
-78, -415, -1490, 999, -321, -256, -628, -301, -1152, 229, -177, -858, 86, 521, -711, -1107, -1017, 1595, -567, 371, // 6140
-166, 322, 1398, -443, 933, -475, -641, -345, 1063, 1674, 667, 1818, -1912, -530, 233, 796, -978, 314, 640, -388, // 6160
826, -525, -390, -29, -385, 794, 1047, -82, -296, 113, -801, 899, -81, 582, 432, 137, 393, -463, -65, -1674, // 6180
-1252, 368, -1419, 536, -365, 182, 69, -217, 109, -268, -257, 574, -607, 1453, 316, 737, -418, -1262, -1009, 128, // 6200
400, 820, -517, 601, 359, -725, -98, 1114, 109, 931, -1115, -1370, -25, -272, -744, 284, -190, -506, -552, -1355, // 6220
-576, -449, -568, -1436, 163, 723, -734, 383, -95, 918, -228, -736, 443, -53, 1192, 1098, -768, 404, 1514, -137, // 6240
1263, -195, -452, 1131, -923, 348, 1206, 13, 130, -212, 524, -1164, -29, -602, 94, 18, -515, -244, 47, 1509, // 6260
-560, 1484, -213, -225, -261, -42, 334, 650, -628, 54, -1282, -174, -119, -86, 306, -1108, 1068, -901, -1051, 413, // 6280
-1368, -1083, -886, -691, 1116, 373, 629, -1298, -813, 1051, 109, -967, -2368, 450, 453, -98, -614, 285, -393, -459, // 6300
// Out channel 35
-96, -775, -23, 706, 636, -67, 849, -193, -639, 268, -854, -814, 479, 194, -213, 331, 44, 528, -65, 616, // 6320
-204, -46, 428, -631, 1716, -80, 349, -298, 127, 1068, -597, 1024, -428, -1792, 321, 202, 6, -408, 46, -1394, // 6340
1848, 759, -945, -78, -204, 824, 546, 975, -116, -204, 25, 1211, 14, 47, 785, 98, -75, 17, -155, -259, // 6360
-374, 723, 112, 35, 334, 67, 862, -48, -727, -79, -59, 963, -950, 498, 506, -133, -522, 411, 270, 275, // 6380
-43, 1767, -638, 63, -701, -1113, 801, -81, 346, 571, 64, -504, 779, -367, -722, -954, 643, 189, 516, -182, // 6400
580, -1511, -57, -455, 141, 210, -918, 2139, 554, 288, -319, -457, 130, 128, 229, 142, -515, -423, 697, -378, // 6420
251, -155, 104, -302, 722, -626, 403, -450, -654, -181, 373, 342, 607, 561, 178, 414, -1116, 405, -819, 291, // 6440
425, 709, 1385, 371, 393, 704, 105, 1072, -626, 532, -600, 477, -65, 254, -853, -152, -442, 431, -374, 900, // 6460
-28, -294, -456, -267, 241, -6, 517, 740, 97, 1811, -372, -980, -866, 1101, -1102, -370, -646, -64, -164, -429, // 6480
// Out channel 36
-253, 461, 623, 632, 649, 618, 2125, -122, -195, 484, -4231, -1265, 351, 1413, -10, -1290, 3202, 239, 532, -478, // 6500
237, -885, -32, 3, -455, 737, 2024, -1487, -90, 448, -576, -1052, 633, -79, -1885, -229, 1714, -974, -309, -572, // 6520
941, -13, 171, 159, 926, -519, 895, -222, 627, -341, -1683, 1544, 82, 348, 770, 2398, 928, -867, -409, -870, // 6540
-543, 1569, 301, -340, -1109, -160, -489, -288, -1997, 721, 320, -137, 709, -244, -646, -26, -352, -25, 1683, -34, // 6560
-558, 684, 304, 524, -366, 236, 162, -415, 432, 273, 1123, 241, -327, -101, -952, -1593, 1454, 783, 1971, 627, // 6580
618, -110, 1550, 698, -838, -212, 122, 417, 1206, 1079, -703, -929, -74, -101, -701, 329, 1078, -727, -325, 488, // 6600
517, -1588, 1726, -1800, 2026, 933, 509, -808, -456, 801, 871, 1220, 1426, 1202, 827, 154, 546, 858, -744, -149, // 6620
1344, -729, 1205, -309, 242, 2226, 70, 1174, 486, 1544, 527, -359, 457, 193, 254, -552, -2301, 165, -164, 2081, // 6640
479, 175, 1175, 3246, -112, -812, -279, 1730, 24, 135, -1360, -214, 566, -376, 81, 1103, 1141, -1184, 663, -743, // 6660
// Out channel 37
7, -222, 726, -463, 59, 1173, -1, 158, 1867, -1495, 321, 440, -175, -591, 625, -41, 1046, -556, 659, -207, // 6680
510, -305, -931, 739, -1394, -136, -225, 94, -1809, -1729, -334, -2360, 867, 1649, -1228, -176, -230, 992, -590, 409, // 6700
-1428, 1, 965, 331, 500, -767, -832, -211, 1085, -1069, 906, -911, 467, -648, -369, 42, -153, 219, -305, 1480, // 6720
890, 211, 752, -1255, 222, 245, -62, 546, 295, 262, 96, 83, 941, -279, -747, -149, 975, 371, 1220, -87, // 6740
-461, -939, 639, 447, -145, -374, 219, -921, -205, -1464, 1140, 1105, 425, -217, 691, -191, -328, -868, -84, 1091, // 6760
-161, 908, 110, 1747, -978, -972, 744, -316, -862, -1163, 143, -1117, 176, -267, -253, -384, -215, 726, -1025, -213, // 6780
-386, 80, -256, 531, -1052, 523, -1001, 942, 808, -496, -380, -655, 85, -732, 109, -371, 2143, -576, 817, -2218, // 6800
78, -515, -908, 603, 172, -92, 303, -1605, 274, -333, 34, 272, -911, 510, 765, 958, -295, 1565, 1168, 4, // 6820
1931, 1732, 957, 392, -1708, 45, -2060, -123, 449, -1710, 622, 578, 2064, 84, 1185, 481, 211, 91, 602, 478, // 6840
// Out channel 38
118, 1535, -1122, 220, -1358, 309, -1104, 0, 2512, 262, -296, 246, 104, 924, 58, 284, 655, -986, -177, 119, // 6860
-480, 333, -400, 2007, 1340, 174, -442, -700, -4633, -44, 201, -1091, 672, 898, -748, -1786, 296, -888, 444, -486, // 6880
-646, 1509, 401, 3648, -98, -3238, -486, -972, 117, 902, -184, 528, 739, -70, 1268, 303, 101, -1443, 1134, -244, // 6900
218, -982, -40, -3216, -522, 719, -1091, -1137, -37, -82, 385, -411, 1129, -1553, -521, 672, -254, 317, -790, 376, // 6920
743, -511, -320, 2257, 456, 525, 1327, -2201, 1214, -2464, 720, 987, -1581, -726, -75, 387, -603, -954, -342, 5200, // 6940
-448, 2599, 445, 405, 468, -619, 54, -451, -283, -605, -992, 1001, 186, 1864, 1274, -628, 1399, 279, 276, 373, // 6960
-85, 1505, 124, 459, 1780, 102, 319, -1685, 182, -22, -2288, 1456, -197, 349, 750, 899, 1710, 26, -2527, -2872, // 6980
-263, -663, -561, 2139, 196, 566, 316, 397, 345, -535, -302, -250, 314, -591, 299, 58, 777, 2301, 2912, 834, // 7000
261, 1849, 4448, 1079, -734, -1684, -4584, 451, 1384, -1847, 321, 145, 551, 255, -1250, -979, -1468, -204, 521, -4201, // 7020
// Out channel 39
639, -2817, 140, -1873, -1810, -343, -962, -140, -1738, 120, 597, -224, -1422, -1045, 1085, 149, 101, -1390, 605, -554, // 7040
629, -72, 352, -612, -349, -467, 1550, -207, 868, -854, 715, 1250, -845, -528, 372, 2635, 167, 1777, -1603, 1897, // 7060
2509, 204, 1150, 4, 537, 2678, -830, 2611, -433, -2619, 888, -655, 540, -643, -905, 102, -1849, 989, -303, -836, // 7080
1217, 736, 204, 1374, 3440, 264, 1446, 1054, -203, 966, -739, -1038, -4159, 3538, -961, 1374, 834, -879, -34, -140, // 7100
-191, 177, -156, 115, -934, 955, -628, 1114, -445, 338, 314, 1143, 589, 945, 415, 815, -311, -694, 1252, -1463, // 7120
424, -2974, -165, -506, -176, 145, -211, 1250, -1785, 581, 514, -2752, 200, -1441, 295, -1012, 394, 1008, -823, -384, // 7140
-235, 448, 431, -783, -1424, -1318, -638, 1431, -1904, -319, 78, -805, -144, -2051, -341, -920, -1828, -165, 1095, 1719, // 7160
591, 3788, -396, -133, -231, -433, -787, 413, 569, -915, 30, -455, 545, 1194, 1341, 1223, -594, -988, -1335, -1604, // 7180
355, -2927, -2422, -594, -1541, -340, -220, -674, -1481, 433, -228, 471, 156, 41, 1020, -428, -108, 1070, -626, 325, // 7200
// Out channel 40
798, 1007, 125, -1437, -781, -338, -503, 430, 802, 367, 1756, -276, -1125, -365, 646, 2590, 82, -485, -365, 1117, // 7220
-236, 1781, -367, -925, 1428, 660, -1563, -564, -1180, -864, 160, 209, 838, 465, 306, 327, -146, -325, 685, 1462, // 7240
113, 260, 549, 1128, 380, 790, -1221, -153, -778, 412, 386, 2052, -1417, -681, -889, -294, 817, 76, 2346, 2066, // 7260
1260, -522, 582, -361, 443, -277, -234, 983, 882, 606, -373, -1066, 1031, -307, -851, -807, 1357, 1339, 3545, -946, // 7280
-94, -864, -73, 396, -169, 651, -209, -240, 1578, 19, 368, 1217, -516, -2766, 256, 503, -1142, 248, -1162, -20, // 7300
-1162, 226, 150, 65, 1378, -1442, -483, -1336, -558, 891, 858, 336, -878, 654, -160, -1320, -133, 251, -295, 257, // 7320
-1236, 692, 128, 119, -69, -233, -1471, 1452, 1285, 331, 397, -382, 289, -89, -938, 550, 2779, -343, 1166, -402, // 7340
-1578, -804, -1116, -274, 663, 165, 1880, -77, -66, 764, 707, 107, 65, -389, 273, 3436, 1225, -151, -110, -2046, // 7360
-107, -1314, -800, -309, -1265, -897, -1582, -932, 2387, -743, -563, 444, 533, -545, -673, 8, 26, 1393, 2008, 97, // 7380
// Out channel 41
168, -445, 688, -454, 733, -79, -299, -843, -1393, 619, -19, 1327, 318, 201, -189, -1016, -413, 396, -175, -973, // 7400
3362, -917, 1096, -566, -1996, -292, 480, -141, 1539, 349, -7, 598, -653, 819, -204, 522, 298, -493, -357, 989, // 7420
-833, -1130, 340, -1852, 696, -398, 431, -149, 930, -1442, -528, -2815, -296, 288, -2689, 75, -55, -516, -588, -1252, // 7440
-36, 530, -1513, 1717, -123, -236, -185, 1141, 610, 1697, 391, -416, -621, 1485, -147, -110, 208, -1832, -1824, -1942, // 7460
-2504, -1341, 459, 284, 457, -527, -1642, 1887, -2719, 150, -596, 32, -162, 1822, 1030, 827, -678, -243, 61, -2032, // 7480
529, -275, 443, -603, -920, 1064, -754, 58, -321, 184, -552, -2023, -123, -2424, -675, 356, -341, 1360, 605, 1609, // 7500
896, -719, -360, 550, -469, 372, 425, 1656, -270, 1251, -395, -1361, -789, 228, -239, 624, -1753, 1144, 3788, 1177, // 7520
909, 426, -997, -236, -402, 223, -1571, 18, 631, -764, -243, -747, 153, -55, 978, -897, 293, -540, -1293, 121, // 7540
-412, -299, -1629, -250, 272, 419, 1427, -598, -1256, 323, -657, -382, -367, -867, 2627, 351, 695, 214, -545, 992, // 7560
// Out channel 42
667, 600, -53, 1189, 4163, 898, 204, -517, 733, 59, -686, 1100, 1398, 645, 249, 1122, -243, 845, -182, 244, // 7580
-970, -78, -459, 126, 808, 327, 520, 120, 173, 792, -596, -77, 291, 910, 256, -900, -323, 499, 273, -1260, // 7600
-1170, 248, -1875, -844, -514, 681, 603, -8, -166, 1617, -37, -1857, 233, 290, 223, 176, 282, -88, 121, 751, // 7620
-76, -898, -100, 667, -1019, 361, -443, -259, 713, -30, -362, 2519, 501, -987, 323, -2145, -312, 372, -1501, 54, // 7640
235, 268, -4, -2683, -353, -396, 422, -411, -704, 564, -296, -1677, 146, 432, -122, -1054, 1005, 754, -665, 291, // 7660
-159, 1204, -22, 544, 740, 1166, -3, 616, 336, -514, -693, 2021, -517, 1397, -1259, 968, -695, -253, 326, -59, // 7680
-202, -847, 670, 356, -283, -709, -762, -818, 1483, 396, 684, -146, -350, 132, -700, 304, -9, 298, 422, 81, // 7700
9, -470, -72, -728, -169, 80, 41, -428, -646, 94, 11, 171, -282, 62, -1415, -1552, 40, -586, 1231, 625, // 7720
-765, 1489, -738, 109, 484, 1107, 695, 323, -636, -538, -557, -447, 198, 97, -594, -295, 1005, -1738, -215, 1109, // 7740
// Out channel 43
-346, -905, -255, 106, 141, 1649, 1833, -90, -138, -1247, -1862, -1306, -38, -414, 8, -1368, 285, -305, -329, -379, // 7760
-1230, -958, -1634, 768, 931, -690, 2522, 1150, 303, -253, -362, 331, -686, -1062, 300, 959, 628, 365, -357, -1209, // 7780
2169, -410, -855, -674, -666, 686, -11, 1519, -202, 128, 22, 1935, 1298, -109, 1564, 448, -800, 941, -1515, 715, // 7800
-339, 852, 1339, 510, 507, 506, 682, -2532, -2617, -875, -242, 185, -560, 617, 103, 552, -261, 221, 421, 1191, // 7820
721, 2686, -260, -306, -1009, 482, -214, -392, 193, 567, 1510, -548, 1267, 149, -689, -2328, 2259, 74, 3773, 26, // 7840
658, -1479, 754, 937, -802, 636, 1297, 2289, 339, -633, -148, -1000, 453, -56, 161, 383, 88, -2395, 90, -4028, // 7860
91, -373, 1182, -3452, -162, -154, 205, -161, -1662, -1994, -426, 520, 2280, -725, 218, -525, -53, -807, -1203, 823, // 7880
1676, 912, 4660, 373, -536, -445, -74, 128, 802, 645, -463, 1003, -993, 833, -1629, 17, -4007, 14, -582, 578, // 7900
515, 405, -387, 529, -144, 424, -106, 4024, -1284, 1484, 432, -233, 38, 1659, 134, -132, -129, -528, -432, 561, // 7920
// Out channel 44
1073, 196, -242, -906, -1783, -1787, -48, 488, -703, 761, 1247, 390, -1874, -567, 7, 773, 578, -1122, 265, -453, // 7940
951, 239, -173, -1388, 749, 590, -721, -456, -744, -1288, -627, 914, -410, -1256, -835, 1464, 35, 643, -1218, 1624, // 7960
1798, -88, 2318, 811, 111, 61, -1530, 184, -351, -1361, -12, 1662, -879, -1268, -170, 335, -376, 299, 1024, 350, // 7980
335, 1759, -176, -433, 1704, -572, -111, 966, 650, 462, -60, -1350, -1608, 1081, -733, 685, 1083, -158, 1612, -129, // 8000
-539, 236, 162, 1601, -986, 285, 127, 435, 1390, 940, 734, 600, 663, -1211, 764, -170, -545, 772, -228, 539, // 8020
228, -786, 398, -861, 850, -1126, -1031, 675, -1122, 1529, 568, -1520, -155, -416, -590, -1099, 105, 1056, -822, -16, // 8040
-545, 479, 593, 231, 804, -568, -626, -673, -442, 313, 268, 513, -11, -148, -567, 12, 631, 803, 236, 605, // 8060
-457, 1038, -826, -250, 874, 831, 448, 806, -406, 354, 1005, -418, 589, 679, 1035, 2714, 272, 215, -450, -1201, // 8080
268, -2187, 454, 617, -2108, -1549, -625, -965, 133, 1146, -555, 1835, 54, -1034, -61, 521, 406, 1423, 1, -755, // 8100
// Out channel 45
-52, -2726, -533, -1478, -1344, -27, 0, 692, -928, -544, -535, -290, -1021, -1051, 1524, -1211, 474, -385, 1391, -1018, // 8120
85, -14, -562, -73, -394, 384, 770, -604, 264, -1035, 522, -76, -427, -517, -70, 1795, 120, 1682, -3327, 408, // 8140
3637, -474, 514, -640, 35, 1160, -212, 2676, 199, -1943, 1135, -151, 291, -786, -1174, -241, -2790, -215, -94, -193, // 8160
663, 1283, 93, 375, 1976, -296, 2118, 183, -907, -144, -929, -498, -4657, 1179, -917, 1614, 915, 99, 127, -742, // 8180
-461, -310, 210, 329, 111, 586, -520, 351, -740, -289, 780, -17, 1151, 985, 83, -550, 69, -406, 1919, -803, // 8200
474, -2237, -157, -241, -939, -223, 725, 1573, -1161, 599, 414, -2477, -838, -799, 360, -1141, 466, 424, -198, -676, // 8220
-489, 502, 249, -1067, -619, -342, -211, 2066, -1741, -24, 384, 139, 417, -2144, -259, -1517, -477, -141, 699, 1472, // 8240
1573, 3107, 724, -116, 1312, -318, -356, 106, -590, -1033, 281, -169, 175, 1501, 220, 903, -1276, -545, -1295, -968, // 8260
-87, -1550, -701, 98, -531, 279, 506, 469, -549, 611, -15, 811, 921, 7, 1490, 167, 260, 244, 363, 440, // 8280
// Out channel 46
-417, -347, 215, 334, 495, 1134, 1015, -1217, 384, 268, -1406, -1018, -77, 101, -886, -19, 875, 380, -177, -1732, // 8300
-1401, -705, -761, 1077, 1174, -147, 1675, 326, 1134, 264, 55, -1390, 487, -128, -690, -905, -159, -491, 341, -1763, // 8320
-711, 360, -2187, 445, -319, -584, -446, -273, -740, 2134, 293, -1879, 589, 210, 779, 732, 400, -316, -1332, 329, // 8340
-498, -1970, 561, 591, -141, 559, 90, -816, -2147, 555, 355, 808, 90, -1320, -401, -418, -525, 226, -1886, 277, // 8360
548, 488, -117, -2482, -1027, 142, 194, -566, -1233, 677, 965, -413, 422, 1794, 845, -2810, 4233, 195, 891, 69, // 8380
2956, 451, 1741, 1200, -351, 1171, 1102, 923, 1380, -1337, -245, 1544, 206, 789, -25, -467, 941, -3035, -517, -1050, // 8400
-303, -142, 58, -3014, 1390, -125, -483, -902, -1483, -328, 63, -300, 1525, 378, 405, 365, -1222, 699, -1149, 483, // 8420
1749, -46, 3792, -197, 316, 528, -347, 1224, 304, 2703, 272, -725, 476, -885, -2680, -494, -2263, 782, 161, 552, // 8440
-84, 1193, 369, 1144, -318, 193, 544, 5059, -1227, -178, -423, 326, 452, 715, -1004, -666, -492, -620, -257, 679, // 8460
// Out channel 47
-593, -554, -552, -805, 30, -365, 115, -562, -366, -813, 378, -489, -194, -2002, -136, 682, 460, -152, 223, -182, // 8480
668, -525, 143, -580, -425, -680, -12, -99, 707, -698, 461, 65, 1123, 188, -192, 222, -360, 597, 564, 1317, // 8500
-381, 639, -979, -718, -1011, 1239, -528, 473, -608, -547, 901, -2632, -1339, 10, -2652, -559, -373, 3596, -1039, 2010, // 8520
249, -1655, 673, 1368, 431, 512, 200, 1234, 486, 469, 746, -761, 424, -323, 421, 305, 444, 719, -607, -1744, // 8540
196, -352, -326, -2569, -146, -464, -3925, 1250, -2514, -102, 218, 39, 311, 327, 3386, 363, -402, -856, -227, -783, // 8560
418, -678, 109, -580, -1235, 943, 433, 5, -459, -1215, -37, -419, -237, -1208, 721, -553, 118, 379, -239, -572, // 8580
-687, 479, -375, 2, -2509, 260, 245, 2846, 151, -281, 47, -729, -462, -606, -236, 96, -599, 15, 2397, 603, // 8600
-503, 663, 112, 570, -267, -523, -532, -47, 1172, 450, -992, -905, -731, -289, -590, 190, 301, 435, 47, -1606, // 8620
-796, 47, -3357, -810, 138, 485, 1193, -577, 348, -602, -470, 444, -242, -1288, 1031, -1241, -500, 1991, 1154, 1774, // 8640
// Out channel 48
-247, 1551, 1318, -175, 108, 143, -594, 1453, 1631, -847, 766, 298, 609, -363, 616, 1294, 322, -425, -71, 1708, // 8660
95, 1643, -1140, -511, -134, 2, -1843, -593, -870, -38, -316, -113, 941, 1335, -540, -857, 467, 131, 541, -120, // 8680
-435, -235, 300, -396, -221, -1169, -247, -314, 1737, -1410, 540, 1856, -889, -492, -338, 372, 386, 359, 1693, 1420, // 8700
1864, 459, 1090, -1483, -28, 7, -621, 604, 699, 452, -23, -757, 609, -1054, -376, -1136, 1120, 605, 3277, -987, // 8720
-26, -844, 218, 668, 1321, 436, 219, -379, 1395, -962, 506, 586, -93, -4483, -507, 524, -2153, 585, -1079, 356, // 8740
-1745, 558, -1548, 554, 1005, -1505, 91, -1158, 281, 266, 654, -398, -540, -742, -136, -2, -948, -78, 83, 737, // 8760
-601, 324, -159, 712, 545, 1111, 712, 1157, 1201, 110, -726, -141, 892, 177, -214, 274, 4328, -373, 308, -552, // 8780
-2211, -1470, -1771, 438, -147, 85, 1682, -538, -486, -2, 79, 288, -305, 238, 307, 1627, 1141, 712, -132, -1423, // 8800
-526, -1785, 131, 168, -444, 104, -1454, -867, 2938, -1800, 115, -186, -272, -632, 652, 514, -306, -344, 1636, 211, // 8820
// Out channel 49
2375, -675, 241, -76, -712, -1269, -649, 22, -224, 878, 588, 743, -291, 463, 445, 396, -406, -45, 333, -260, // 8840
89, 1437, 306, -1705, 748, 990, -1051, -437, 458, 449, -477, 1752, -900, -2740, 1182, 1730, 212, 531, -1104, 123, // 8860
1921, 681, 536, 378, 62, 1401, -143, 615, -866, -521, -158, 383, -1249, -1869, 597, -218, -743, -35, 928, 143, // 8880
-245, 434, -401, 180, 360, -503, 127, 394, -2, 270, -541, 784, -1809, 1240, -62, 254, 1275, 425, 41, -41, // 8900
320, 1440, 773, -231, -255, 279, 284, 894, 1125, 1888, -438, -282, -188, -1268, -624, 416, -133, 757, 921, -618, // 8920
475, -2235, -588, -968, 1425, 127, -1513, 1204, -857, 1656, 78, -825, -1816, 1042, -689, 309, -259, 833, -45, 791, // 8940
-552, 635, 197, 644, -81, -2896, -683, -677, -383, 592, 1261, -381, -750, -246, -944, 181, -546, 212, 957, 1238, // 8960
-490, 1398, 198, -1774, 453, 578, 1253, 422, -1255, -93, 1624, 260, 356, 596, 255, 187, 626, -260, -852, -186, // 8980
-503, -2122, -891, -458, -445, -1010, 1004, 52, -252, 1145, -62, 564, -288, -380, -829, 586, 448, 128, -349, 537, // 9000
// Out channel 50
556, 415, 2666, -94, 813, -135, 496, 294, 17, 115, -124, 218, -255, 370, -143, 349, 705, -539, -233, 546, // 9020
1074, 148, -679, -799, 705, 1600, -420, -1509, 28, -159, -500, -532, 438, 228, -970, -307, 846, -605, 157, -330, // 9040
-822, 115, -78, 842, 2613, 75, -476, -732, 42, 224, -97, 520, 337, -843, 101, 911, 10, -1058, 1253, -382, // 9060
884, -2, -125, 460, -624, -1333, -755, 70, -93, -299, -231, 842, 563, -702, -1068, -1730, 295, 1017, -128, -756, // 9080
-866, -90, 2481, -192, 1135, 246, 228, 90, 149, 997, 357, -777, -1035, -527, -434, -170, 255, 2846, 151, -885, // 9100
-1249, -531, 216, -65, 686, -47, -568, -648, -640, 784, -126, 538, -1214, -138, -1538, 1242, -501, -440, -163, 950, // 9120
-531, 284, 494, 276, 783, 267, -397, 36, 1099, 209, 968, 902, 598, 53, -774, 382, 958, 513, 821, 94, // 9140
-160, 266, -82, -1103, 1353, 309, 203, 238, 55, 706, 2371, 241, 1220, -870, -160, 62, 544, -524, -74, 110, // 9160
-24, -508, 803, 985, -414, -574, 791, -373, 1030, -320, 180, 36, 364, -204, -448, 498, 1257, -1307, 419, -104, // 9180
// Out channel 51
34, 598, -150, 9, 40, 1003, -1052, -1484, 258, -210, 306, 1277, -39, -385, -654, 220, -689, -242, 52, -169, // 9200
-2692, 494, -850, 1426, 49, 113, -418, 1277, 621, -345, 1321, -905, 288, 1609, 705, -1592, -916, -825, 710, -897, // 9220
-1092, 1128, -783, -154, -143, -272, -343, -657, -908, 1665, -39, -2306, 1295, -18, 492, -1362, 379, -1647, -575, -52, // 9240
589, -2147, 411, 272, 136, -50, -610, -2258, 158, 35, 683, 836, 440, -891, -103, -679, 376, -738, -2887, 2591, // 9260
3359, -724, 197, 276, -740, 458, -62, -701, 243, -1495, -281, 1002, -855, 817, 5, -261, -233, -93, -118, 381, // 9280
-245, 1517, 175, 24, 389, 2299, 488, -298, 92, -1846, -396, 1816, -143, 1396, 351, -928, 221, 262, -49, -317, // 9300
369, -226, -1520, 303, -502, -12, -544, -500, -387, -823, -1309, -1295, -1460, 327, 174, 1072, -1316, -958, -1278, -1136, // 9320
633, -331, 988, 834, 126, -508, -739, -733, -402, -254, 247, 942, 270, -1037, -26, 505, -9, 668, 2117, 110, // 9340
1229, 1519, 860, -1093, -222, -148, -1040, -235, -811, -1033, 566, -329, -16, 1632, -830, -1060, -190, 68, -1948, 169, // 9360
// Out channel 52
152, -462, 344, 316, -693, -1877, 363, -108, -830, 998, 104, 1028, 81, 212, 476, -1312, 525, -159, 81, 693, // 9380
6246, 233, 1272, -1847, -2287, -304, -82, -1753, -807, 559, -1096, -35, -354, 239, -877, 173, 604, 509, -522, 2151, // 9400
586, 366, 2154, -562, 490, -82, 602, -494, 1725, -2735, -782, 723, -416, -513, -3002, 466, 94, 938, 303, -954, // 9420
-111, 2431, -793, -587, -168, -945, -121, 2740, 403, 2314, 337, -1802, -246, 792, 132, 144, 166, -531, 3149, -3619, // 9440
-5048, -1740, 362, 944, 485, -722, -1079, 793, -266, 165, -918, -116, -217, -20, 506, 565, -1093, 656, 319, -274, // 9460
-508, -641, 150, -921, -227, -1138, -1109, 86, -565, 2349, -484, -1763, -366, -1946, -469, 565, -840, 1264, -66, 1651, // 9480
414, -211, 514, 441, -214, 328, 454, 1413, -24, 964, -538, -363, -45, 252, 159, -226, 541, 1459, 3510, -200, // 9500
-420, -313, -998, -177, 358, 794, -494, -152, 670, 21, 321, -1496, -185, -654, 1754, -69, 832, -734, -908, 329, // 9520
-28, -1080, -318, 355, 208, -782, -499, -681, 67, 162, -1046, -446, -135, -3556, 2012, 685, 703, 593, 1265, 267, // 9540
// Out channel 53
716, -366, 722, 661, 806, 485, -65, -68, -13, 80, -160, -72, 55, 1095, 648, -1479, -1463, 81, -450, -236, // 9560
-1812, 325, 763, 119, 578, 394, 441, 1096, -182, 77, -204, 584, -426, -1018, 541, 133, -1719, -834, -228, -1183, // 9580
120, -373, 706, 217, 803, -46, 742, -2, 19, -391, -300, 612, 497, -507, 2367, -1069, 443, -1924, -489, -1756, // 9600
-788, 278, -742, -151, 187, -490, 194, -1610, -5, -369, -679, 1886, -600, -36, -505, -345, 264, -1080, -2170, 1554, // 9620
607, 2053, 610, 2094, 295, -496, 2959, -457, 951, 299, -180, -733, 309, 194, -4376, 66, 80, -39, 445, -314, // 9640
592, 235, -68, -400, 1392, 822, -36, 216, 178, 690, -397, 927, -550, 152, -401, 747, -45, 430, -140, 358, // 9660
140, -695, -521, 472, 1237, -747, 665, -2185, 179, 349, 1201, 1208, -1090, 114, 119, -414, -776, -180, -2591, 77, // 9680
50, 332, 365, -126, 892, -473, 293, 325, -876, -1493, 312, 3792, 360, 135, 706, -1681, -859, -375, 1, 1047, // 9700
210, 1231, 1072, 332, 509, -395, 489, -206, -332, 1286, 2054, 66, 79, 2374, -439, 964, 627, -1980, -1904, -1075, // 9720
// Out channel 54
-99, -382, 952, 112, 2084, -103, 322, -363, 402, -247, 548, 526, 593, 196, 256, 766, -1253, 515, 559, 40, // 9740
-762, 47, 118, -941, 1062, 1351, -191, 297, 1455, 252, 471, -136, 264, -789, 545, -315, 380, 382, 522, -645, // 9760
33, -15, -2378, -1315, -17, 1326, 186, 146, -725, 1413, 162, -1549, -346, -684, 293, -87, 564, 182, 22, 483, // 9780
-477, -940, 289, 910, -599, -604, 309, 362, 58, -647, -284, 890, 254, -1238, -945, -2729, 102, 1233, -1140, -320, // 9800
161, 400, 195, -3522, -78, -736, -706, 79, -926, 1182, -248, -166, -119, 218, 342, -355, 795, 1480, -649, 371, // 9820
821, 572, -15, -1032, -315, 639, 715, 223, 625, -470, 730, 1161, -1538, 1169, -615, -157, -412, -322, -460, 424, // 9840
-989, -570, 293, -216, -1078, -183, -439, 164, 190, 246, 744, -639, -90, 398, 197, -206, 298, 26, 540, -69, // 9860
93, 28, 562, -1267, 1755, 60, -240, 698, 123, 783, 1074, -100, 453, 707, -523, 278, -581, -721, 51, -888, // 9880
-378, -514, -1427, -1224, -31, 614, 1978, 712, -69, -804, -511, 25, -672, 0, -626, 668, 945, -686, -467, 2433, // 9900
// Out channel 55
730, -546, -169, 462, -292, 294, -1426, -883, -1975, -8, 1142, 1712, -63, -440, -33, -226, -3164, -30, 398, -568, // 9920
-639, 33, -202, 545, 485, 20, -581, 1351, 304, 285, 777, 1056, -3183, -155, 1920, 203, -2214, 399, -477, -617, // 9940
-215, 61, -1013, 91, 8, 19, -311, -641, -836, 727, 328, -3172, 705, 55, 931, -1536, -72, -310, -1633, -153, // 9960
120, -672, -1244, 2205, -282, 311, 91, -796, 1501, -572, -103, 734, -722, 1320, 559, 406, -391, -1898, -4237, 761, // 9980
895, -591, -11, -28, -334, -741, -231, 1505, -1600, -96, -1262, -1010, -143, 1542, -425, 1473, -218, 155, -814, -1206, // 10000
488, -1245, -974, -2555, -657, 1295, -235, 769, -618, -749, -16, 379, -195, 86, 188, 601, 74, 1555, 230, -123, // 10020
-121, 25, -1190, 1262, -1795, -1543, -118, -1322, 256, 786, 68, -746, -1950, -303, -134, 169, -3441, -740, 65, 1325, // 10040
393, 1544, -1179, 88, 31, -1482, -1377, 86, -240, -1491, -93, 943, 827, 207, 472, -952, 1245, -1190, -70, 580, // 10060
-591, 1648, -467, -4199, 15, 199, 438, -616, -1326, 1849, 840, -95, -538, 2163, 369, -146, -250, 119, -3485, -85, // 10080
// Out channel 56
-908, 216, -774, 635, -1446, -1508, -1381, -2089, -1304, -461, 1028, -417, -65, -1286, -846, 591, 916, -220, -305, 565, // 10100
1293, -149, 75, -1223, -223, -920, -97, -187, 1369, -579, -5, 562, 628, 659, -611, 200, 1435, 345, 135, 2148, // 10120
-366, 380, -64, -891, -1049, -50, -399, 188, -609, -1046, 427, -2191, -1213, 740, -3682, 334, -500, 3296, -962, 1026, // 10140
-95, 293, 1000, 1317, 812, 1174, 112, 1958, -59, 1644, 700, -1585, -133, 496, 366, 42, -674, 140, 402, -746, // 10160
-690, -1203, -833, -2973, -1180, -244, -5330, 1141, -3441, -874, -404, 1411, -358, 1063, 5619, -123, -428, -849, 121, -1017, // 10180
1113, -953, 683, -1084, -1424, 1631, -188, -392, -485, 195, 107, -1009, 43, -1040, 576, -574, 24, 542, -117, -164, // 10200
321, 1639, -96, -859, -1867, 238, -346, 738, 568, -82, -999, -1221, 457, -458, -201, -176, -1206, -201, 2532, -374, // 10220
-454, 840, -699, 1048, -984, 419, -1233, 416, 1620, 1209, -860, -2589, -1293, -687, -673, 276, 24, 92, -160, -1587, // 10240
224, -603, -2516, -299, -932, 1034, -308, -113, -1083, -397, -1493, -40, 372, -1569, 490, -3110, -477, 2840, 1890, 1168, // 10260
// Out channel 57
-197, 2076, -9, 1344, 204, -325, 1206, 29, 144, 999, -1057, 280, 921, 830, -1425, -287, 582, 87, -1796, 262, // 10280
19, -481, 872, 226, -406, -868, -687, -529, -709, 905, -1185, -553, 874, 513, -1894, -1806, 593, -1808, 1929, -133, // 10300
-1034, 87, 1652, 628, -4, -1796, 571, -2264, 671, 602, -508, 1050, -176, 1919, 921, 1158, 1564, -382, 74, -778, // 10320
-892, 104, -98, -1171, -576, -314, -2166, -96, -600, -37, 1506, 376, 3906, -1134, -114, -308, -1133, 234, 559, 371, // 10340
-115, -206, 483, 1651, 439, -25, 580, -636, 532, -715, 801, 12, -1426, 51, -541, -340, -598, -638, -21, 732, // 10360
17, 1275, 901, 192, 240, 141, -826, -1850, 1103, 128, -1131, 825, 617, 323, -648, 748, 51, -472, 156, 290, // 10380
1050, -31, 1196, 504, 2597, 1058, 735, -2163, 432, 326, -234, 1701, -271, 1492, 1437, 1010, -21, 462, -413, -1967, // 10400
404, -2012, -366, -34, -749, 729, -12, 212, 317, 919, 123, 641, 202, -2197, 48, -69, 496, 297, 630, 1849, // 10420
347, 1343, 1731, 1623, 439, -626, -747, -204, 243, -140, -94, -702, 393, -264, -610, 740, -65, -632, 73, -2542, // 10440
// Out channel 58
-450, -543, 631, -131, 1730, 487, -11, -1043, -1348, 94, -568, 213, 253, -321, -219, -1015, -284, 101, 168, -1101, // 10460
329, -1717, -336, -311, -1019, -522, 1272, 488, 2185, 32, 397, 56, -1619, -696, 472, 444, -434, 543, 347, -1509, // 10480
225, -587, -1627, -1358, 52, 744, 77, 575, -391, 366, -139, -3568, 923, 298, -700, 259, -280, 337, -4512, 178, // 10500
-64, -334, -200, 2933, -365, -390, 1127, 0, -1161, 300, 249, 1039, -370, 204, -26, -128, -840, -720, -4665, -615, // 10520
-679, -547, -16, -2773, -228, -851, -402, 1213, -4173, 330, -485, -1478, -209, 3960, 599, -1252, 3212, 263, 1181, -883, // 10540
1741, -248, 261, -337, -1883, 2491, 406, 308, 574, -60, -301, 569, -159, -742, -50, -491, -312, -110, -467, 448, // 10560
-92, 341, 99, -2453, -768, -689, -184, 92, 221, 387, 25, -1754, -14, 167, 330, -268, -3847, 204, 532, 432, // 10580
2247, 696, 2680, -154, -1, -599, -2102, 280, 513, 61, -124, 376, 623, -78, -1431, -1721, -1999, -512, -793, 280, // 10600
-428, 665, -1572, -750, -44, 1556, 2405, 1682, -2402, 1038, 184, -160, 247, 1103, 630, -471, 721, -84, -1014, 1017, // 10620
// Out channel 59
131, 761, 225, 792, -641, -1783, -800, 337, -143, 1008, 949, 102, 1537, 875, -1393, 1362, -647, 2532, -643, 1949, // 10640
1194, 1059, 2792, -1310, -695, -219, -1660, -477, 8, 882, -772, 1472, 150, -144, -20, 14, -364, -423, 1852, 2381, // 10660
-874, 64, 1712, 273, -535, -464, 1121, -907, 333, -940, -1229, 476, -1913, 234, -694, 142, 2614, -323, 1157, -177, // 10680
-87, 553, -1817, -181, -1181, -821, -404, 1982, 842, 814, 1109, -163, 609, -188, 740, -769, -656, -264, 2165, -1632, // 10700
-1045, -1317, -87, 19, 1286, -1199, -197, 478, 405, 233, -1223, -162, -1120, -964, 217, 859, -2144, 1366, -1117, -178, // 10720
-1775, -278, -832, -1282, 286, -153, -1766, -1749, 202, 1027, -918, -662, -16, -131, -520, -176, -1592, 1960, 3170, 839, // 10740
1021, 165, -474, 1440, 31, 1668, 1406, 1519, 1289, 925, -28, -711, -344, 1272, -61, 1167, 1741, 1079, 925, 805, // 10760
-1146, -475, -3106, -256, -720, -485, 614, 428, 61, -558, -327, -1047, 50, -1130, 470, 783, 1950, -217, -731, -503, // 10780
-2334, -1216, -648, -900, 1137, -453, -45, -2819, 1237, 104, 133, -3389, -1217, -2014, 1266, 29, -218, -165, 1575, -25, // 10800
// Out channel 60
733, 478, 290, -212, -1203, -1262, -294, 1732, 791, -314, 1713, -659, -430, 276, 130, 884, 698, -964, 359, 1329, // 10820
157, 1383, 626, 112, -1200, 469, -937, -343, -2006, -459, -475, 217, 525, -88, 510, 33, 97, -284, 329, 2243, // 10840
265, 325, 1994, 1004, 238, -698, -871, -422, 677, -2487, -19, 2836, -334, -182, -1001, 46, -176, 118, 2839, 267, // 10860
814, 1364, 201, -2368, -202, 85, -170, 1157, 1606, -177, -611, -1799, -72, 762, -465, -100, 112, 238, 4317, -1281, // 10880
-197, -957, 201, 2143, 1000, 846, -19, -904, 2510, -985, 875, 1474, 77, -3358, -457, 2016, -3003, -201, -981, 1628, // 10900
-1508, -176, -879, 267, 561, -2819, -882, -957, -1267, 881, 150, -1551, -327, -201, -84, -421, 756, 1387, -190, 614, // 10920
404, -88, -479, 2158, 354, 261, -153, 685, -69, 175, -785, 782, -47, -356, -516, -628, 3280, -698, 248, -821, // 10940
-1844, -188, -3851, -225, 114, -584, 1265, -1055, 44, -661, 465, -402, -159, -564, 2555, 2075, 1489, -89, 20, -1839, // 10960
104, -690, 1059, 817, -478, -246, -2542, -2692, 2298, -1036, 135, 298, 478, -1588, 623, 574, -236, 1237, 1672, -824, // 10980
// Out channel 61
489, 319, 2445, -1044, 2234, 682, -367, -33, -38, 1, 347, 703, -227, -223, 122, -746, -642, 159, 658, -109, // 11000
504, -495, 149, 161, 283, 1664, 264, 326, 299, 505, -461, -169, -94, 716, 635, 19, -228, 586, -56, -862, // 11020
95, -1449, -1883, -1780, 3588, -394, -847, 103, -123, 574, -99, -128, -231, -1372, -613, -144, 568, -636, -188, -329, // 11040
804, -486, -27, 559, 574, -1760, -169, 159, -119, 151, -334, 643, 76, -522, 76, -1423, 373, 189, 65, 117, // 11060
-606, 50, 1564, -1796, 677, -433, -503, -540, -436, 83, 83, -72, 319, 535, 152, -414, -249, 1608, -183, 16, // 11080
-37, 131, -174, 208, 344, -36, -208, -694, -241, -100, 762, 526, -2026, 71, -1182, 242, -405, 1046, 111, 76, // 11100
-667, -2098, 88, 545, 761, -40, -407, 531, 521, 21, 804, 175, 128, 67, -1135, -300, 360, 4, -188, 668, // 11120
273, -954, -45, -1323, 1944, -94, -498, 245, 33, -914, 1589, 15, 1721, -41, 230, -606, -404, 17, -202, -205, // 11140
-102, -331, 87, -189, -496, 459, 38, 206, 851, 302, -95, -150, 387, 544, 591, 500, 3121, -1358, -567, 1516, // 11160
// Out channel 62
1132, -1132, -732, -1371, -1435, 582, -913, 1265, -1177, -1409, 1672, -103, -2466, -1559, 388, -183, -709, -1908, 349, -773, // 11180
-407, 214, -913, 433, 1812, -14, -89, 1622, 699, -1868, 175, -233, -273, 428, 1105, 806, -980, 2130, -1127, -314, // 11200
1107, -73, 1065, 210, -273, 922, -1906, 1769, -410, -73, 942, -716, 1687, -783, -372, -1000, -1223, 451, -416, 140, // 11220
971, 449, -469, 1611, 3104, 660, 1174, -1380, 952, -882, -829, -545, -1749, 1103, -950, 939, 1220, -683, -1795, 887, // 11240
444, 730, 12, 787, -1154, 429, -96, 487, -43, -255, 407, 462, 1030, 716, -455, 315, 521, -733, -429, -964, // 11260
684, -373, -572, 376, 305, -361, -72, 2153, -1802, -1029, 1687, -62, 258, 383, 1174, -768, 699, 685, -713, -410, // 11280
-759, 24, -447, -441, -1071, -1062, -772, 372, -381, -962, -563, -450, -183, -2571, -337, -1271, -1427, -945, 207, 959, // 11300
658, 2065, 632, 207, -440, -931, -801, -60, -390, -1420, -511, 258, -679, 1279, 84, 914, 91, -737, -173, -2227, // 11320
905, -270, 366, -310, -1530, 79, 129, 476, -655, 822, 1072, 2144, 877, 1422, 115, -361, -444, 361, -900, -791, // 11340
// Out channel 63
-86, -235, -19, -2202, -243, 674, -700, -665, 651, -473, 1409, -4, -1720, -1480, 603, 401, 252, -2020, 642, -1272, // 11360
41, -465, -1862, 304, 1140, 396, -81, 86, 817, -2367, 979, -1380, 857, 971, 225, -388, 426, 651, -613, -346, // 11380
-459, 574, -1083, 440, -74, 41, -2897, 71, -1021, 1014, 1300, -2744, 876, -158, -788, -125, -1144, 291, 8, 785, // 11400
-281, -2820, 338, 1106, 2206, 518, 584, 861, -227, 188, 548, -396, -485, 248, -578, 973, 61, 566, -1119, -652, // 11420
1184, -1076, -370, -1414, -131, 200, -430, -419, -973, -564, 389, 815, -463, 353, 987, -696, 1400, 297, -11, 454, // 11440
1534, 700, 873, 1111, 93, -6, -58, 334, -965, -1474, 1420, 1464, -100, 1174, 441, -2296, 1976, -847, -1574, -301, // 11460
-1341, 410, -286, -703, -423, -65, -1665, -75, -334, -821, -1172, -685, 9, -855, -436, -307, -557, 308, -45, -1214, // 11480
753, 923, 773, 608, 804, -97, -323, 111, 382, 130, 376, -97, 492, 185, -1149, 1317, -817, 1159, 919, -1508, // 11500
703, 204, -373, -270, -1996, -200, 486, 1027, 275, -1036, -9, 2902, 2014, -435, -657, -1038, -288, 383, 766, -61, // 11520
// Out channel 64
-773, 769, -43, -324, 860, 570, -969, -864, -455, -106, 1775, 547, 743, -432, -711, 240, -645, 683, -10, 82, // 11540
-961, -73, -898, -197, 1260, -687, -1431, 866, 897, 57, 1360, -7, -249, 1645, 1202, -902, -585, 633, 710, -627, // 11560
-1770, -155, -3133, -238, -259, 1038, -59, -79, -1107, 1896, -221, -3754, 414, -374, -329, -274, 627, 202, -1144, 341, // 11580
-328, -2688, 250, 1004, -287, 321, 617, 101, 918, -399, 755, 1091, 1157, -531, 1329, -1139, -513, -482, -2540, -78, // 11600
1467, -1272, -1099, -2936, -655, -1096, -911, 534, -2005, -60, -1848, 329, -191, 1688, 1491, -118, 847, 297, -1200, -1101, // 11620
715, 517, -291, -15, -121, 3069, 557, -310, 630, -1655, 292, 1133, 433, 91, 410, 224, -986, -277, 1065, -13, // 11640
-193, 14, 36, 54, -2130, 53, -189, 1007, 197, 225, -640, -2007, 124, 355, 117, 381, -1174, -144, 414, 1185, // 11660
357, 80, 887, -5, -1, 694, -886, 366, 4, -558, -839, -1268, -495, -92, -2080, -994, -216, 686, 612, -848, // 11680
-687, 648, -1932, -1622, 1012, 1475, 1576, 483, -442, 29, -693, -1271, -1182, 114, -202, -1273, -381, 470, -507, 1816, // 11700
// Out channel 65
-232, 1597, 386, -1786, -988, 11, -644, 1478, 1572, -463, 1619, 307, 206, -1135, 401, 3117, -222, -673, 398, 2039, // 11720
1352, 1274, -856, -397, 318, 86, -1981, -93, -614, -1468, -567, -689, 1108, 513, 40, -128, 511, -340, 719, 1090, // 11740
-873, -191, 646, -530, 209, 844, -1632, 198, 647, -542, 768, 1390, -1459, -397, -1281, -54, 724, 645, 2215, 2277, // 11760
1326, -183, 1497, -1514, -765, -66, -747, 852, 900, 552, -612, -862, 1597, -379, -36, -534, 1032, 1611, 3020, -559, // 11780
-2, -1013, -573, -598, 388, 188, -1052, -288, 513, -703, 774, 1812, 281, -2424, 809, 925, -1042, 1053, -853, 1263, // 11800
-981, 348, -85, 761, 281, -1901, 791, -1816, -458, 264, 781, -2, -724, 1, -319, -1930, -801, -505, 206, -164, // 11820
-440, 19, -347, 264, -697, 618, -577, 1768, 1578, 291, -369, -1102, -191, -45, -524, -111, 3121, 101, 790, -40, // 11840
-2077, -1215, -1654, 605, -163, -171, 1998, -645, -273, -92, -128, -408, 42, -542, 191, 3958, 971, 406, 983, -2047, // 11860
52, -597, -912, -418, -713, 70, -1420, -1595, 2887, -1989, 56, 382, 999, -816, 224, -4, 544, 448, 2278, 1259, // 11880
// Out channel 66
-964, 754, -63, -499, 904, 2047, 720, 814, 1625, -2325, -826, -1156, -79, -994, -73, 455, -11, -247, -310, -320, // 11900
-5857, 680, -2064, 2736, 1736, -259, 278, 1606, -1682, 195, 40, -1060, 596, -162, 635, -180, -601, 547, 170, -2315, // 11920
534, -161, -943, -159, -273, 208, -591, 660, -48, 815, 187, 846, 938, -54, 2549, -767, -326, 39, -117, 1856, // 11940
826, -1288, 2499, -1810, 146, 1289, 24, -2730, -114, -4342, -342, 650, -92, -1330, -74, -428, 229, 981, 602, 2872, // 11960
4236, 1239, -694, 462, -1088, 765, 1131, -2648, 2404, -558, 1573, 582, 946, -1586, -1176, -908, 419, -112, 226, 2224, // 11980
-192, 710, -289, 2457, 357, -1119, 1782, 56, 42, -2419, 574, 702, 176, 2093, 321, -1104, 559, -1877, -211, -4157, // 12000
-179, -540, -730, -293, 530, 209, -46, 195, -503, -2761, -243, 1304, 367, -992, 164, -242, 1485, -1483, -5134, -249, // 12020
23, -633, 1953, 298, -498, -450, 692, -245, -18, 413, -540, 1167, -1009, 325, -1202, 492, -995, 1498, 1439, -318, // 12040
743, 2016, 1709, -209, -420, 560, -1624, 1457, 1099, -507, 810, 415, 512, 1924, -1596, -41, -62, -417, 800, 4, // 12060
// Out channel 67
645, 1971, -707, -376, -1908, -302, -408, 1120, 1832, 22, 1207, 235, 55, 46, 42, 776, 692, 74, 292, 2349, // 12080
-13, 2014, -320, -231, -127, -216, -2526, -932, -2448, 281, -758, -450, 1161, 936, -478, -7, 344, -320, -706, 642, // 12100
906, 118, 1565, 1289, -158, -1535, 369, -526, 1071, -1868, -417, 4838, -1036, -472, 465, 177, 789, 80, 4048, 434, // 12120
787, 1257, 281, -4012, 199, 477, -1487, 274, 1040, -405, -87, -1932, 459, -429, -204, -22, 238, 904, 4682, -584, // 12140
810, 12, 648, 2376, 949, 1095, 985, -1949, 3914, -744, 1086, 1223, -220, -3367, -162, 1401, -2127, -191, -755, 2172, // 12160
-2642, 796, -286, 929, 1305, -2729, 411, -1543, -649, 645, 432, -631, -1079, 457, -565, 261, 417, 344, 137, 343, // 12180
112, -208, -15, 1800, 1498, 815, 748, -372, 566, 98, 202, 1326, -90, 48, 56, -240, 4672, -362, -426, -1399, // 12200
-1642, -1845, -1974, -513, -460, -155, 1820, -185, -1078, -310, 344, 485, 13, 542, 934, 2001, 891, 624, 1249, -369, // 12220
602, -720, 1902, 1186, -461, -1086, -2027, -1789, 3518, -968, -230, 277, 233, -1256, -192, 1254, -20, 71, 2616, -927, // 12240
// Out channel 68
-1026, -279, 627, 1236, 1704, 674, 1559, 394, 497, -139, -2130, -24, 308, 1511, -370, -1853, -527, 99, -261, -1390, // 12260
-245, -582, -195, 1012, 449, 239, 776, 329, 5, 1712, -207, -339, -645, -759, 166, 458, 7, -271, 510, -2837, // 12280
216, -62, -391, -691, 270, -785, 1733, -197, 591, 1285, -728, -452, 556, -61, 1729, 536, 187, -1107, -337, -604, // 12300
-304, 983, -526, -68, -881, 277, -134, -779, -745, -748, -633, 1590, -325, -136, -128, -826, -931, -132, -2022, 188, // 12320
390, 1901, -87, 120, -364, -205, 1202, -1257, -473, 10, -405, -1473, -95, 848, -1523, -896, 857, -203, 224, 1127, // 12340
523, 106, 291, 206, -475, 579, 996, -72, 1813, -630, 103, 1203, 495, 742, -382, 1330, 330, -1123, -27, 89, // 12360
37, -784, 43, 228, 527, 233, 1520, -599, -834, 174, 925, 1023, -224, 307, 31, 238, -859, -94, -1273, -1004, // 12380
991, -76, 1408, 350, -747, 384, -49, -92, 255, 252, 21, 723, 428, -331, -1487, -2352, -346, 251, 500, 3248, // 12400
-375, 2110, 1110, 392, 1575, -60, 963, 1598, -13, 826, -37, -1076, -81, -28, -728, 162, 291, -1968, -370, 287, // 12420
// Out channel 69
-349, -183, -501, 63, 4, 260, 1870, 256, -802, -255, -2397, -1402, -450, 107, -344, -628, 94, 377, -427, -138, // 12440
-252, -78, -217, -446, 872, -225, 1642, 736, 4, 1136, -1573, 1013, -202, -1842, 138, 304, -129, -579, -320, -418, // 12460
3513, 657, 259, 404, 554, 1137, 288, 762, -228, -606, -851, 3003, -310, 200, 1065, 724, -448, -180, -110, -90, // 12480
-784, 2501, 599, -425, 51, -16, 260, -94, -1769, -800, -383, -435, -622, 423, -42, 69, -100, 588, 1982, 587, // 12500
-173, 2268, 66, 989, -1018, -104, 620, 161, 1707, 344, 872, -321, 698, -1453, -617, -1963, 763, 361, 1637, 107, // 12520
424, -1799, 732, -509, 165, -842, -489, 867, 230, 895, -266, -1816, 227, 340, 388, 440, 445, -426, -422, -789, // 12540
214, -450, 1028, -1318, 252, 11, 42, -671, -1740, -16, 209, 1583, 1833, 59, 297, -198, 60, 134, 446, 287, // 12560
1305, 1026, 1331, -235, 40, 1007, 267, 820, 30, 440, -369, -6, -210, 123, -425, 272, -2086, -289, -1137, 902, // 12580
51, -1692, -445, 696, -111, -637, 760, 824, 51, 1210, -597, -200, -59, 921, 106, 97, -186, -250, -395, -332, // 12600
// Out channel 70
294, 161, -800, 1032, 749, -95, -86, -1663, -293, 1273, 306, 1241, -88, 2404, -563, -566, 594, 584, 158, -461, // 12620
203, 265, 231, -413, 723, 623, -192, -226, -532, 320, -652, 322, -1060, -207, 89, 66, -251, -388, -219, -1173, // 12640
-659, 857, -204, 854, 352, -1571, 357, -937, -517, 2668, -252, 270, 798, 74, 2056, 522, 229, -2803, 182, -1715, // 12660
-60, -582, -538, -227, -203, -786, -566, -417, -155, 417, 457, 1795, -216, -921, 262, -973, -708, -617, -1096, -172, // 12680
218, -87, 1193, 566, 382, -370, 2609, -709, 981, 494, -786, -952, -336, 233, -1478, -324, 1078, 1262, 368, 814, // 12700
711, 1320, 638, -260, 923, 413, -491, 622, 5, 606, -791, 1701, -204, 1240, -423, 175, 227, 469, -561, 837, // 12720
-334, 266, 753, -369, 1553, -967, 612, -3345, -390, 447, 537, 583, 184, 804, 232, 263, -494, 961, -955, 968, // 12740
732, 646, 506, -129, 307, 491, 194, 944, 30, -192, 714, 899, 1802, -42, -386, -1461, 5, -525, 353, 2020, // 12760
-290, 520, 1704, 361, 377, -1529, 312, 269, -301, 391, 215, 404, -228, 1017, -1100, 154, 604, -2244, -1344, -1278, // 12780
// Out channel 71
-955, 422, -3855, 502, -2327, -13, -228, -906, -650, 320, 890, -1645, -672, 492, 163, 441, 343, -472, -459, -383, // 12800
-1294, -143, 921, 604, 705, 175, 390, 589, -1091, 442, 930, -99, -214, -261, -177, -700, 495, -859, -155, 90, // 12820
-83, 1270, 319, 4109, -1428, -1683, 218, -371, -2824, 1052, 219, 1231, 403, 1191, 933, 577, -48, -388, 369, -1011, // 12840
-630, -1282, -711, -1094, 21, 1533, 389, -490, 75, 261, 407, -305, 472, 968, 337, 1456, -814, 592, 434, 668, // 12860
1188, -164, -416, 965, -735, 659, 286, -1289, 1128, -1146, 542, 995, -273, 214, -7, -80, 1045, -613, -381, 568, // 12880
515, 670, 131, 214, -243, -756, 69, 832, 948, 75, 313, 844, 1681, 721, 2025, -1177, 1094, -476, -263, -340, // 12900
-2, 2152, -82, -421, 1228, -96, 137, -1820, -1124, -659, -1233, 964, -255, 372, 965, 232, -458, -28, -683, -1059, // 12920
-241, 547, -322, 3342, 452, -224, -43, 853, 578, 609, -701, -949, 678, -313, -222, -322, -420, 1973, 1191, 1144, // 12940
468, 139, 706, -335, 111, -989, -1969, 314, -137, 246, -206, 556, -8, 851, -1884, -1560, -3885, 832, -778, -4436, // 12960
// Out channel 72
-987, 98, 568, 613, 1493, 2982, 1047, -1591, 590, -359, -1125, -5, 47, 69, 115, -1011, 353, -34, 599, -1394, // 12980
-1368, -1595, -1504, 1736, 109, 461, 1480, 553, -610, 265, 380, -826, 828, 739, 255, -870, -250, -349, 349, -2206, // 13000
-1014, -373, -2567, -578, 317, -297, 945, -433, -45, 1189, -144, -2839, 796, 378, 1191, -219, 41, -133, -2495, -434, // 13020
44, -1842, -27, 479, -271, 241, 505, -715, -1428, -841, 277, 1737, 604, -1349, -445, -122, -748, 278, -2233, 1013, // 13040
-181, 1070, -313, -1314, -685, 145, 445, -1447, -1133, -155, 143, -163, -685, 1788, -526, -613, 2548, -533, 672, 283, // 13060
1512, 1292, 473, 1520, -481, 1578, 1533, 47, 721, -2559, -173, 1094, 99, 813, 282, 86, 811, -2195, -89, -212, // 13080
-501, -653, -350, -877, -639, 506, -304, 190, -312, -527, 720, -311, 148, -260, 459, -332, -1095, -344, -783, -1180, // 13100
1407, -584, 2117, 353, -267, 172, -993, 638, 290, 164, -207, 341, 138, -182, -1498, -1011, -1535, 1151, 307, 1006, // 13120
507, 3098, -182, 258, 204, 644, 997, 3166, -761, 239, 205, -2, 389, 267, -379, -703, -350, -1033, -459, 684, // 13140
// Out channel 73
833, -479, -88, 325, -497, -1754, 1755, 281, -1179, 1231, -1037, -1173, -165, 583, 68, -527, 827, -38, 292, -381, // 13160
2267, -535, 777, -882, -479, 181, 736, -1426, -9, 263, -1222, 1735, -929, -2672, -760, 511, 704, 486, -304, 1125, // 13180
1538, -706, 1547, 404, 275, -136, 254, 591, 73, -872, -12, 1837, -1220, 31, 700, 1218, -233, 891, -343, -578, // 13200
-606, 2495, -549, -327, 51, 24, -150, 795, -627, 281, 248, -836, -189, 877, 157, 850, -111, 393, 1938, -1201, // 13220
-3504, 544, 480, 544, -394, -57, 157, 577, 928, 1493, -193, -973, 508, -175, -230, -844, -315, 431, 814, 396, // 13240
380, -1059, 652, -951, -557, -1388, -361, 553, 8, 2036, -620, -1440, 296, -1779, 240, 889, 160, 324, -420, 616, // 13260
229, 309, 1732, 369, 657, -903, 384, -754, -221, 992, 773, 1513, 749, 208, 361, 393, 105, 1055, 770, 760, // 13280
524, 650, -151, -143, 129, 876, -177, 1149, 675, 599, 755, -785, 221, 212, 658, -353, 107, -1237, -1297, 433, // 13300
-157, -1777, 214, 405, 517, -585, -148, 25, -531, 787, -997, 135, -851, -1145, 59, 552, -175, 280, 329, -340, // 13320
// Out channel 74
554, -498, -482, -183, -833, -492, -2934, -782, -196, 215, 3569, 869, -364, -622, 351, 71, -2624, -561, 245, -671, // 13340
-610, 1223, 555, 837, 806, -311, -1430, 1701, -34, -995, 2506, 433, -1409, -1065, 1809, 928, -1132, 1497, -521, -100, // 13360
-846, 1018, 224, 533, -245, 246, -1180, -625, -1900, 515, 1298, -1451, 1669, -293, 649, -2793, -431, 145, 657, 88, // 13380
56, -1955, -394, 332, 954, 242, 298, -736, 2653, -1343, -201, 458, -613, 609, 207, -432, 953, -521, -3431, 677, // 13400
797, -796, -165, 205, -113, 423, 101, -144, 323, -6, -944, 157, 92, -99, 175, 1189, -908, -344, -2183, -702, // 13420
-49, -80, -850, -699, 713, 455, -1011, 468, -1648, -678, -24, 1055, -114, 554, -7, -860, 154, 1417, -189, -95, // 13440
-382, 1147, -2034, 1744, -1498, -1652, -1214, 203, -426, -507, -213, -903, -3171, -960, -824, -67, -1468, -1090, -909, 264, // 13460
-386, 1527, -542, 403, -403, -2668, -565, -1096, -202, -2791, -631, 943, 152, 579, 1032, 355, 1604, -531, 1360, -1706, // 13480
198, 315, -360, -2351, -927, -768, 611, -606, -718, 528, 1076, 879, -579, 1115, -1234, -492, -636, 1045, -2353, 271, // 13500
// Out channel 75
-548, 505, 971, -973, 926, 786, -277, 2, 795, -708, 204, 311, 45, -1050, -575, 347, 468, -365, 190, -606, // 13520
-2, -314, -1554, 814, -247, -319, 662, 142, -842, -1120, 39, -2327, 1444, 998, 148, -1349, 454, 627, -434, 242, // 13540
-1215, 546, -650, -26, 322, -334, -1098, 901, 378, 151, 1313, -1574, 362, -101, -416, -150, -299, 260, -316, 1464, // 13560
1568, -1264, 1390, -1011, 46, 58, 544, 219, -633, 655, 211, -57, 525, -1435, -527, -442, 344, 1393, 746, 110, // 13580
224, -836, -179, -1021, 411, 865, -259, 34, -990, -1326, 908, 1725, -66, 26, 1056, -36, 550, 68, 379, 498, // 13600
363, 768, 775, 2219, -589, -502, 1374, -521, -779, -1056, 401, 785, -294, 204, 32, -1177, 544, -825, -828, -1100, // 13620
-126, 177, -631, -966, -118, 619, -889, 623, -231, -266, -842, -428, 227, -518, -68, -865, 947, -413, 792, -1209, // 13640
388, -1281, -58, 31, -365, 82, -61, -770, 234, 355, 567, -611, -94, -215, -641, 480, -467, 753, 20, -759, // 13660
449, 769, -125, 236, -329, 426, -996, 1101, 39, -1438, -480, 759, 1958, -1026, -14, -132, 93, -644, 2028, 603, // 13680
// Out channel 76
233, -2042, -840, -245, -1064, -1053, -299, 285, -1116, -143, -454, -170, -499, -350, -9, -439, 204, -286, -174, -885, // 13700
692, 21, 1370, -386, -407, 190, 569, -139, -385, -267, -284, 1495, -368, -1736, -453, 1461, 160, 407, -1555, 972, // 13720
2957, -56, 4677, 230, -533, -413, 27, 489, -245, -2216, -338, 718, -259, 210, 12, 590, -704, 772, -120, -589, // 13740
-194, 2345, -706, 255, 757, 72, 542, -53, -258, 143, -547, -1158, -2037, 4223, -904, 2339, 185, -690, 360, -248, // 13760
-959, 378, 235, 3251, 400, -356, 344, -114, -605, -485, 128, 286, -552, 369, 8, 115, -1073, -170, 799, 334, // 13780
760, -2113, 654, -1137, -260, -504, -415, 178, -1607, 821, -206, -3974, 143, -540, 221, -203, 295, 1935, 274, 108, // 13800
246, 302, 354, 262, 337, -499, -131, -108, -1261, -331, -336, 919, -595, -932, 225, 44, -1411, -185, -302, -401, // 13820
563, 1490, -653, -23, -762, 21, -1062, -724, 411, -849, -82, -559, -68, 478, 1402, 188, 368, 283, -869, -87, // 13840
77, -1808, 564, -159, -413, -327, -1225, -1038, -991, 749, 508, 30, -273, -369, 1277, 324, -196, 1078, 534, -850, // 13860
// Out channel 77
381, 615, -1435, -111, -1853, 357, -894, -1200, 908, -455, -3, 1320, -125, 120, 690, -353, 625, -485, 369, -1001, // 13880
-571, -888, -842, 2033, 374, 360, -222, -374, -4569, -781, 472, -1083, -239, 1591, -247, -1350, -63, -650, -465, 20, // 13900
-1496, 1781, 1133, 3475, -116, -3825, -397, -390, 72, 869, 134, 612, 1567, 470, 769, 327, 243, -849, 576, -1355, // 13920
1159, -873, 166, -2035, -250, 715, -1040, -1067, -171, -118, 789, 331, 1670, 311, -268, 2110, -587, -424, -764, 1033, // 13940
366, -1687, -37, 1806, -204, 226, 533, -2275, 545, -2799, 890, 596, -566, 289, 82, 1186, -956, -1328, 435, 3150, // 13960
-231, 1209, 726, 243, -180, 365, -181, -778, -771, -1015, 332, 914, 751, 664, 1113, -1103, 686, 13, -557, 383, // 13980
1049, 1080, -11, 107, 601, 143, -22, -2784, 213, 0, -2101, 1171, -112, 1005, -541, 476, 537, 416, -2016, -2644, // 14000
-19, -681, -65, 2771, -164, 207, -866, -777, 599, -730, -891, 27, 179, -493, 647, -101, 39, 1925, 2301, 545, // 14020
920, 2681, 4766, 635, -536, -593, -6130, 73, -232, -1096, 511, 268, 1221, -556, -864, -2674, -1610, -451, -558, -3616, // 14040
// Out channel 78
-1093, 180, 94, 390, 915, -70, 2193, 1169, -553, -544, -3026, -219, 2289, 545, -141, -2462, 683, 1171, -558, 341, // 14060
542, -1537, 890, -124, -3334, -250, 1629, -248, 173, 877, -506, -79, 294, -126, -756, -290, 2, -851, 94, -667, // 14080
-264, -772, 856, -872, 39, -1029, 2741, -127, 2790, -1931, -1359, 361, -200, 1376, 27, 297, 180, 119, -1050, -933, // 14100
155, 1717, -443, -453, -1207, 85, -326, -293, -309, -671, -250, 292, -31, -599, -140, 186, -725, -842, 1756, -172, // 14120
-775, 353, -278, 670, 576, -20, 715, -394, -121, -1006, -317, -658, 190, -657, -1492, -394, 425, -665, 931, -190, // 14140
-552, 265, -715, -492, -1763, -841, 857, -512, 1302, 166, -905, -504, 1036, -1776, 285, 2026, -702, 65, 1435, 76, // 14160
752, -563, -107, -776, 445, 1230, 1188, 83, -812, -88, 301, 1070, 1242, 74, 1175, -767, 527, 5, -492, -235, // 14180
911, -853, 329, -26, -970, -693, 176, -586, 532, -220, -152, 562, -340, -250, 952, -3213, -666, -527, -1364, 2302, // 14200
122, 664, 791, 1228, 2192, 858, -553, -41, -70, 71, 445, -1532, -81, -463, 2692, 881, 56, -1589, 699, 7, // 14220
// Out channel 79
-372, 1224, 536, -351, 346, 138, 1774, 2207, 3153, -1005, -168, -910, 700, -543, 6, 809, 570, 71, -245, 2092, // 14240
775, 1049, -440, -317, 14, 194, -351, -773, -1895, 697, -42, -216, 1150, -1, -69, 185, 358, -438, 381, -99, // 14260
954, -17, 339, 207, -206, -601, 397, 239, 1271, -1077, -679, 4152, -2394, 371, 39, 79, -343, -285, 1312, 403, // 14280
488, 1226, 1227, -2852, -133, -551, -585, -119, 403, -1968, -500, -689, 1040, -1354, -713, -666, -335, 922, 4410, -1176, // 14300
-174, 955, -279, 447, 1004, 689, 827, -1765, 3431, -510, 716, 292, 116, -2697, -533, 275, -458, 508, -321, 1893, // 14320
-1551, 905, -600, 339, 19, -3410, 449, -1085, 244, 995, 170, 578, 25, 770, 34, 208, -673, -756, -50, -504, // 14340
209, -279, 220, 457, 1318, 1085, 359, 973, 115, -196, -669, 641, 990, -115, 342, -21, 5422, 189, -1195, -1537, // 14360
-1626, -3310, -368, 125, 19, 470, 2097, -175, -429, 154, 267, -318, -270, -81, 139, 1785, 148, 1869, 1615, -825, // 14380
106, -1291, 1287, 987, -503, -1017, -1813, -96, 3947, -1679, -483, -324, 540, -1072, 5, 1012, 527, -385, 2119, -95, // 14400
// Out channel 80
-39, -243, -1483, -154, 12, -40, -421, -756, -805, 105, -72, 472, 254, -942, -693, -403, -428, 286, -404, -285, // 14420
84, 539, 254, 450, -499, -1918, 437, 528, 490, -257, 563, -506, 133, 1276, 1224, -65, -437, 794, 116, 67, // 14440
-848, -666, 72, -1553, -1364, 213, 52, 60, 706, 71, -748, -1273, 715, -118, -1184, -918, -336, 314, -902, -492, // 14460
-211, -200, -597, 1357, 956, 1005, 183, -94, 224, 198, 812, 767, 476, 745, -8, 985, 87, -1713, -1432, 303, // 14480
42, -1399, -1760, -82, -219, -568, -1019, 516, -758, -604, -584, 452, 229, 1472, 616, -36, 241, -1563, 171, -107, // 14500
-580, -18, -133, -175, -528, 1592, -211, -439, -759, -512, 26, 9, 344, -211, 550, 28, -999, 302, 780, -689, // 14520
876, -433, -217, -108, -1592, -40, 408, 1007, -33, -377, -1411, -1455, -394, -989, 146, -46, -573, -192, -72, 406, // 14540
735, 121, 130, 621, -1537, -32, -1899, 442, -97, -569, -3109, 358, -40, 28, 635, -280, -56, 509, -519, -1252, // 14560
32, 61, -952, -202, 508, 627, -160, -337, -727, -267, -269, -279, -559, 478, 1062, -2400, -52, 662, -1064, 1052, // 14580
// Out channel 81
304, 211, -2114, -192, -2559, -1159, -1895, -94, -237, 806, 1682, 334, -752, -914, -1731, 105, -748, 209, -669, 82, // 14600
-554, -24, 341, 27, 1331, -449, -852, -420, -162, 1293, 162, 1378, -725, -402, 308, 212, -868, -519, 319, 628, // 14620
769, 793, 1471, 1065, -535, 388, -935, -311, -463, -36, -242, 1246, 81, 967, 445, -734, 1175, -433, 1514, -983, // 14640
-858, 165, -336, -431, 732, 8, -437, -438, 796, 903, 380, -1139, -256, 1707, 577, 1951, -510, -1094, 916, 472, // 14660
332, -170, 340, 2641, -739, 416, -132, 503, 515, 36, -210, 676, -235, -483, -6, 114, -1767, -405, -952, -486, // 14680
-788, -971, -118, -1126, 1246, 689, -2107, -518, -1479, 974, -371, -938, 478, -316, 460, -948, -268, 2638, 566, 93, // 14700
1194, 1004, 115, 1599, -372, -196, 374, -578, 252, -502, -984, -409, -1227, 731, 296, 1740, 809, 301, 112, 986, // 14720
-556, 947, -1133, 105, -457, 254, -355, 609, -218, -835, -969, 109, 521, -1103, 763, 1066, 1641, -468, -987, -311, // 14740
-36, -1611, -101, -948, -511, -377, 579, -1383, -134, 1220, -27, -11, -1345, 513, -68, -815, -935, 1993, -993, -831, // 14760
// Out channel 82
-388, -123, -239, 102, -459, -404, -576, 376, -616, 1012, 469, 731, 652, 169, -230, -1038, -864, 2108, -373, 966, // 14780
798, 283, 1913, -345, -22, -992, -175, -4, 337, 1249, -428, 856, -1013, 616, 499, 1244, -658, 106, 689, 447, // 14800
176, -505, 666, -526, 234, 244, 1358, -627, 453, -555, -1760, 1316, 142, -198, -109, 38, 569, -915, 84, -1255, // 14820
-521, 520, -2249, -275, 8, -334, -196, 641, 289, 1599, 185, -264, -146, 1189, 587, 612, 16, -918, 484, -725, // 14840
-473, -904, 240, 786, 159, -953, 146, 713, -66, 528, -571, -301, -544, 113, 412, 738, -1240, 280, -1190, -694, // 14860
-1289, -1047, -771, -1346, -690, 346, -484, -1283, -376, 670, -693, -747, 625, -1108, -153, 1081, -1232, 1230, 2752, 338, // 14880
1186, -412, 211, 1022, 39, 41, 1321, 1189, 241, 901, -471, -610, -518, 509, 459, 651, -482, 646, 691, 823, // 14900
-14, 282, -1180, 80, -343, -41, -374, 141, 316, -542, -172, -1050, 88, -527, 1293, -203, 1602, -1254, -946, 705, // 14920
-1725, -1420, -780, -43, 828, -172, 10, -1952, 290, -427, -198, -1649, -1615, 18, 1062, 359, 43, 736, -332, 470, // 14940
// Out channel 83
781, -296, -349, 458, -2038, -2416, 142, 32, -790, 1139, 74, -290, -464, 320, 502, -482, 569, -321, -96, 41, // 14960
1333, -559, 419, -45, 488, 139, -337, -1082, -1333, -518, -902, 672, 701, -1639, -1722, 594, 1057, -395, -440, 1966, // 14980
1633, 90, 1252, 2187, -265, 341, -451, -322, -814, -933, 509, 1506, -481, 299, 119, 1403, -46, 172, 736, -950, // 15000
-378, 1773, -278, -960, 372, -9, 279, 656, -374, 1137, 698, -2326, -525, 338, -276, 755, 529, 759, 1285, -696, // 15020
-1496, 377, 384, 1235, -152, 568, 239, 26, 1094, 657, -118, -527, 35, -466, 1035, 74, -850, -408, -131, 564, // 15040
936, -1293, 802, -747, 81, -1638, -1123, -11, -212, 845, -285, -1240, -383, -836, 587, 178, 838, 563, -507, 528, // 15060
-412, 2217, 1559, -175, 965, -219, -83, -1604, -890, 286, 742, 2012, -511, 206, 289, 364, -817, 361, 1130, -381, // 15080
-162, 166, -513, -342, 375, 762, -39, 371, 752, 653, 771, -1447, -135, -7, 475, -270, 406, -531, -739, 686, // 15100
357, -2074, 1419, 345, 254, -1193, -1532, 213, -1225, 1628, -1237, 426, -157, -1740, 147, -355, -510, 502, 754, -1571, // 15120
// Out channel 84
1245, -797, -178, -234, -465, 613, 407, -581, -135, -494, -17, 484, -2192, -123, 458, -775, -1054, -2551, 1557, -1102, // 15140
-1709, -609, -2005, 660, 2467, 426, 491, 678, 294, -449, -101, -735, -754, -228, 1028, 380, -295, 554, -745, -1194, // 15160
301, 87, -677, 115, -67, -642, -1766, 788, -435, 2122, 1079, -606, 3030, -353, 1076, -573, -1024, -475, -156, 665, // 15180
110, -583, -186, 127, 1750, -326, 676, -1275, -961, -750, -619, 163, -519, -416, -676, -93, 470, -490, -2307, 1068, // 15200
1076, 385, -118, 864, -1579, 427, 393, -1467, -240, 846, 495, 138, 938, 807, 313, -1680, 688, -166, 427, -167, // 15220
471, 671, 330, 742, 1415, 1026, 248, 1543, -296, -877, 858, 787, -94, 1080, 131, 182, 588, -657, -1802, -917, // 15240
-531, 68, 239, -651, 552, -1899, -1580, -1915, -1018, -819, 231, 394, -329, -367, -443, -612, -1040, -531, -600, 192, // 15260
862, 128, 2106, 201, 464, 147, -292, -191, 0, -467, 225, 87, 413, 1321, -708, -134, -969, 746, 99, -254, // 15280
1316, 918, 969, -306, -1276, -353, 47, 1180, -788, 693, 219, 1956, 343, 1619, -1660, -484, 3, 329, -1389, -913, // 15300
// Out channel 85
455, 84, 5695, -138, 4015, 284, 974, -217, 1449, -236, -520, -544, -199, 581, 943, -10, 240, -281, 988, 243, // 15320
-596, 592, -391, -137, -242, 1766, 45, -927, 625, -373, -279, -1227, 812, -902, -172, -1097, 76, -187, 157, -1740, // 15340
-1742, 100, -2243, -667, 1196, 699, -298, -647, -70, 1298, 697, -421, -916, -945, 190, 292, 279, 43, -1134, 203, // 15360
-270, -1170, 163, -165, -703, -761, 449, -359, -168, -1350, -752, 1563, 569, -1915, -598, -5208, 1614, 1673, 311, -95, // 15380
80, 761, 897, -2916, 639, 609, 649, -585, 790, 997, -608, -471, -444, -572, -1030, -576, 1033, 1604, -309, -230, // 15400
1178, 1213, -87, 529, -74, -148, 385, 327, 1752, -729, 1078, 1332, -1502, 1715, -1613, -84, 277, -1463, -542, 11, // 15420
-2063, -284, 7, 180, 268, -48, -784, 859, 290, 12, 1052, -520, 217, 264, -383, -333, -414, 55, -236, 114, // 15440
-234, -890, 218, -1489, 1844, -559, -16, 70, -172, 502, 3232, 393, 497, 28, -1120, -1089, -29, 424, 303, -613, // 15460
-297, 1188, -596, -665, 49, 731, 2280, 800, 1319, -531, 745, 733, 477, -277, -322, 1187, 1163, -1467, 1033, 2226, // 15480
// Out channel 86
459, 1489, 8, -50, -316, -341, -993, 976, 2306, 747, 539, -418, 637, 1037, -143, 321, -750, 609, -266, 2805, // 15500
490, 1642, -171, 115, 36, 835, -1654, -10, -953, 663, -413, -93, -12, 173, 61, 461, -245, -860, 242, 365, // 15520
687, 195, 1138, 580, 510, -739, 783, -961, 970, -1522, -828, 3435, -1276, 223, 544, -458, 1617, -1182, 1911, -230, // 15540
1192, 482, -266, -1817, -757, -429, -1852, 502, 1897, -312, -27, -899, 865, 390, -299, -810, -99, 447, 3360, 35, // 15560
251, -149, 54, 2033, 1424, -10, 1502, -735, 2189, -1096, 52, 518, -298, -2256, -1037, 1214, -3367, 40, -1728, 950, // 15580
-3381, 229, -2025, 146, 745, -1671, -420, -1648, -288, 620, -13, -509, -497, -326, 304, 127, -792, 817, 1022, 1251, // 15600
413, 99, 108, 3443, 1385, 376, 933, -73, 564, 774, -390, 711, -395, 708, 396, 399, 3370, -322, -11, -1005, // 15620
-2565, -1838, -4262, -123, 658, -481, 1555, -91, -549, -180, 959, 532, 739, -36, 1682, 869, 2473, 513, -449, -228, // 15640
5, -802, 1183, 263, 62, -966, -1068, -2892, 2649, -540, 488, -657, 12, -837, -167, 417, 269, 124, 1104, -930, // 15660
// Out channel 87
437, 1168, 582, -1766, 253, 115, -857, 26, 368, -348, 464, 394, -856, -601, 391, 443, 467, -928, 810, -440, // 15680
752, 636, -553, -210, 363, 487, -191, -605, -268, -1070, -394, -1141, 970, 1195, 16, -537, 365, 793, -31, -135, // 15700
-127, -567, -270, -189, 961, -525, -633, -277, 300, 1199, 678, 276, 211, -288, -367, 785, -296, -312, 70, -224, // 15720
1375, -1053, -9, -523, 859, -693, -638, 1208, 410, 432, 105, -1032, 475, -990, -864, 397, 1502, -2, 540, -1426, // 15740
-326, -847, 191, -710, 568, 1063, -491, -323, 301, -98, 594, 468, -598, -671, 784, 262, -253, 994, -919, -579, // 15760
-676, 918, -299, 1362, 345, 196, -274, -1244, -902, -224, 979, 476, -510, 329, -473, -325, 844, 871, -1087, 329, // 15780
-957, -902, 323, 104, 493, 358, -1293, 1598, 693, -8, 109, 23, 449, -547, -490, 224, 869, -247, 345, -828, // 15800
-124, -479, -796, -1315, 892, 536, 56, 193, 428, 184, 707, -809, 575, 5, 229, 449, 662, 387, -188, -1718, // 15820
338, -521, 521, 335, -831, -334, -144, -752, 690, -1120, -1281, 995, 888, -276, -462, -582, 848, 487, 395, 212, // 15840
// Out channel 88
-43, -131, 100, -38, 212, -67, 355, -331, -524, 4, 117, -195, 859, 701, -151, 545, -18, 510, 35, -8, // 15860
90, 408, -82, -342, 321, -658, -163, 267, 1039, 475, -397, 883, -491, -318, 185, 550, -356, -547, 186, -383, // 15880
606, -1195, -1211, -708, -616, 665, 581, 600, -614, 437, -361, 314, -92, -433, 76, -210, 487, -219, -244, 113, // 15900
-991, 849, -509, 1004, -540, 758, 258, 118, 578, -13, -548, 737, -141, 283, 1045, -8, 137, -317, 50, -233, // 15920
-277, -409, -263, -814, 291, -804, 342, 303, 218, 1400, -914, -1721, -312, 412, 42, -1022, -28, 290, -497, -1334, // 15940
-78, -493, -1101, -1267, 201, 961, 273, -31, 611, 448, 449, 55, -286, -620, -292, 752, -1545, 285, 1097, 772, // 15960
-118, 219, -539, 70, -853, -231, 315, 987, 634, -130, 442, -957, 62, 266, -455, 100, -583, 606, 595, 1262, // 15980
-797, -319, 306, 415, 251, -513, 238, 476, -868, 303, 200, -162, -553, -402, -341, -299, -88, -1202, -149, -292, // 16000
-508, 492, -1058, -160, 1104, 954, 766, 236, 285, 985, -238, -333, -1378, 647, -659, -417, 316, 183, 430, 1073, // 16020
// Out channel 89
167, -321, 324, 574, -1055, -1383, -950, -520, -1182, 1847, 1048, 794, 664, 48, -576, 232, -589, 2057, -691, 580, // 16040
998, 505, 2943, -1153, -261, -622, -825, -270, 446, 1042, 39, 1324, -701, 42, 879, 555, -321, -211, 300, 1301, // 16060
-87, -80, 1019, -905, -203, 119, 1317, -436, -148, -896, -919, 184, -671, -104, -194, -88, 689, -563, 846, -1485, // 16080
-1071, 860, -1915, 760, -498, -202, -119, 699, 952, 1540, 277, 50, -526, 1592, 850, 573, -296, -1593, 517, -1074, // 16100
-1154, -1382, -345, 448, 706, -1009, 284, 919, 398, 143, -1417, -10, -495, -85, -51, 742, -1420, -520, -876, -426, // 16120
-1121, -715, -504, -2033, -186, 907, -1195, -1119, -768, 1119, -1393, -1011, 669, -1590, -328, 242, -925, 1691, 2717, 979, // 16140
943, -180, 750, 1309, -702, 222, 1408, 1002, 498, 938, 50, -737, -788, 498, 750, 642, 16, 836, 282, 990, // 16160
-543, 227, -1751, 139, -603, 241, -303, -105, -282, -1246, -445, -657, -434, -330, 802, 284, 1608, -925, -1174, -399, // 16180
-2070, -1114, -573, -396, 1445, 96, 155, -1964, 72, 138, -223, -2156, -2968, -408, 883, 7, -253, 101, -795, 606, // 16200
// Out channel 90
-760, -11, 192, -294, 418, -74, -942, -1709, 498, 469, 910, 267, -403, -1074, -90, 972, 799, -161, 591, -573, // 16220
897, -788, -921, 28, 18, -226, 154, 559, 458, -565, 724, -1274, 761, 1915, -1058, -952, 821, 718, 31, 583, // 16240
-1255, 173, -1417, -866, -325, 484, -314, -231, -509, 1520, 32, -4888, -1130, 295, -3440, 199, 744, 625, -681, 594, // 16260
381, -2389, 577, 1249, 318, -94, 187, 2425, 586, 1969, 350, 80, 942, -1248, -76, -500, -565, 178, -1831, -850, // 16280
-390, -1477, -368, -3181, -329, -40, -2176, -8, -2452, -131, -132, 703, -367, 1226, 2477, -47, 693, -112, -652, -478, // 16300
291, 1418, 551, 861, -234, 1104, -217, -751, 186, -1978, 360, 1156, -173, 20, 36, -311, 612, -299, -35, 197, // 16320
-76, -307, 254, -195, -2008, 684, -611, 1962, 150, -45, -55, -2293, 138, 43, -454, 593, -600, 988, 2146, 190, // 16340
287, -190, 192, -49, -17, 505, -1716, 223, 752, 794, 125, -1451, 298, -393, -1223, 278, 254, 55, 915, -589, // 16360
10, 613, -2079, -883, -37, 444, 394, 506, -193, -1005, -1617, 346, 413, -1618, 523, -546, 391, 641, 1512, 1319, // 16380
// Out channel 91
629, -2071, -875, -798, -765, 374, -1439, 187, -610, -983, 669, 213, -1528, -1095, -84, 1123, -258, -1584, 511, -1183, // 16400
-197, 241, -828, 197, 699, -577, -75, 943, 973, -1961, 605, 367, -781, -1480, 670, 879, -883, 2245, -1396, 86, // 16420
1631, -280, -428, 59, -586, 1113, -1737, 1594, -1155, -97, 1394, -1188, 1461, -490, 204, -1276, -2066, 1365, -264, -110, // 16440
264, 366, 403, -79, 2190, 531, 1851, -244, 149, 366, -564, -38, -2605, 673, 2, 767, 547, -438, -2414, 1404, // 16460
378, 1060, -781, -564, -1557, 120, -699, 445, -195, 478, 370, -62, 375, 390, 583, 186, 108, 70, -244, -549, // 16480
1412, -1596, 97, -55, 518, 1198, 302, 2618, -867, -914, 1338, 528, 270, 546, 761, -1038, 544, -359, -1041, -1476, // 16500
-491, 126, -301, 168, -1050, -2052, -1324, 535, -866, -350, -171, 40, -917, -2218, -471, -1007, -946, -157, 419, 881, // 16520
412, 2854, 1382, 450, -287, -195, -93, -797, -213, -472, -210, 27, -576, 1834, -145, 778, -343, -291, -649, -653, // 16540
952, 133, -715, -1032, -1067, 427, 403, 1178, -1247, 265, 976, 1887, 444, 1369, -676, -573, -229, 1258, -1702, 798, // 16560
// Out channel 92
363, 141, -322, -343, -686, -1628, 908, 968, -787, 727, -20, -1597, 91, 199, -8, 12, 712, -215, -456, 767, // 16580
1834, 517, 451, -1810, 1021, 425, 167, -1746, -49, 237, -962, 503, -889, -2077, -391, 1282, 850, 134, -383, -317, // 16600
1830, -44, -276, 1032, 154, 1028, 614, 314, 158, -7, 197, 1993, -522, -269, -327, 1253, 221, 452, 800, 95, // 16620
223, 475, -113, -4, 111, -732, -51, 786, -636, 800, -847, -205, -451, -87, 178, 731, 477, 1169, 1475, -1013, // 16640
-1880, 740, 722, -8, -209, -344, 251, 136, 617, 2311, -131, -900, 747, -1258, 181, -945, -175, 482, 191, -952, // 16660
-201, -1061, 276, -359, 206, -1428, -777, 410, 85, 1540, 287, -1297, 308, 409, -328, 357, -435, 175, 531, 582, // 16680
25, 1002, 2135, 186, 907, -427, 406, 485, 163, 926, 1024, 1342, 1460, 250, 120, 327, 815, 1406, 531, 1600, // 16700
-651, 258, -470, -1430, 391, 1090, 1748, 1525, 385, 595, 457, -1199, 71, 216, -1281, 698, 126, -453, -1127, 192, // 16720
-619, -817, -244, 831, 123, -914, -24, -182, 500, 418, -859, -12, -133, -396, -308, 1256, 66, -524, 1002, 253, // 16740
// Out channel 93
-351, -373, -481, -448, -417, 416, 374, -738, -150, 330, 385, -1657, -447, -1874, -41, 1187, 1906, -170, -105, -1615, // 16760
-735, -1287, -1991, 340, 1260, 26, 1428, -481, 336, -654, 859, -1435, 653, 512, -710, -876, 985, 603, 306, -614, // 16780
699, 223, -2044, 163, -306, 552, -1001, 809, -1530, 578, 1340, 35, 37, 134, -415, 1179, 169, 1480, -132, 620, // 16800
-92, -1745, 1837, 1209, 1034, 712, 826, 322, -1790, 322, 501, -566, 346, -932, 512, 96, 628, 421, -250, -344, // 16820
483, 179, -268, -2279, -1559, 410, -2000, -42, -888, 28, 1213, 1504, 353, 1178, 1870, -2702, 3523, -97, 1059, -1363, // 16840
1910, -252, 1144, 2400, 115, 518, 644, 96, 250, -1044, 706, 888, -193, 185, 499, -746, 1011, -2686, -479, -1282, // 16860
-114, 329, 941, -4007, -317, 485, -1034, 1024, -1508, -432, -328, -433, 2074, -592, 562, -68, -240, -102, 244, -45, // 16880
1083, 580, 3929, 35, 88, 856, -844, 1783, 947, 2192, -366, -1397, 755, -418, -1998, 1385, -3183, 804, 243, -648, // 16900
653, -929, -1239, 1182, -969, -417, 537, 4089, -346, -175, -1305, 741, 262, 191, -468, -618, -697, 1071, 1216, 660, // 16920
// Out channel 94
-559, 947, 178, -548, -215, 868, -502, 509, 865, 664, 144, -122, 427, -1255, -242, 204, 1059, 154, 372, 438, // 16940
1580, -1059, -448, -5, -900, 646, -320, -1069, 342, -273, 284, -1514, 268, 1842, -2022, -639, 2229, 136, 216, 315, // 16960
-348, 579, -518, -343, 462, -335, 148, -429, 391, 408, -144, -867, -503, -408, -3058, 1069, 125, 520, 573, 910, // 16980
205, -1475, -35, -186, -779, -154, -473, 1973, 74, -227, 187, -157, 283, -372, -734, -512, 94, 293, 764, -1629, // 17000
-582, -1905, -173, -1941, 295, -409, -1993, 489, -1420, -955, 205, 887, 88, 675, 2299, 148, -181, -358, -107, 451, // 17020
-162, 346, 804, 244, -1325, -690, 460, -530, 133, -643, -83, -741, -553, -684, 380, -303, 14, -687, -76, 607, // 17040
-120, -195, 851, -227, -700, 817, -263, 1723, 71, 512, -608, -1230, 1467, 150, 76, 8, 46, 565, 1092, -787, // 17060
-49, -797, -595, 365, 536, 647, -722, 447, 1085, 554, -511, -3387, 1, 170, -242, 416, -21, 1104, 500, -837, // 17080
530, -259, -1113, 963, 698, 515, -615, 150, 561, -1288, -1711, -63, 27, -1322, 31, -698, -49, 986, 1527, 1410, // 17100
// Out channel 95
-176, 75, 76, 1099, 2252, 829, 877, -1234, 700, 24, -1658, 1842, 364, 1842, -478, -1432, 5, 421, -374, -932, // 17120
-2882, -425, -174, 1251, 650, 394, 993, 1259, -70, 567, 110, -573, -488, 291, 421, -533, -1204, -38, 134, -3588, // 17140
-550, 170, -1440, -338, 512, -1672, 925, -310, 198, 2115, 78, -1103, 1875, 128, 4093, 31, 266, -1737, -460, -1644, // 17160
-980, -1743, -916, -502, -437, -68, -196, -3120, -552, -1855, 190, 3423, -22, -1385, -165, -206, -113, -718, -4309, 1561, // 17180
1542, 683, 477, 84, 333, -773, 3025, -1014, -870, -374, 85, -1186, 624, 1677, -2333, -29, 262, 747, 39, 1052, // 17200
-109, 1022, -86, 76, -298, 800, 297, 765, 1003, -1061, -856, 1545, 383, 385, -938, 1136, -375, -527, 374, -102, // 17220
579, -721, -681, -295, 1049, -385, 70, -2877, 124, 164, 418, 666, -614, 1049, 348, 210, -780, 22, -4863, -378, // 17240
795, -464, 403, 68, 21, -210, -872, 1055, -202, 66, -98, 1954, 565, 535, -635, -2933, -284, 331, 1008, 1483, // 17260
168, 3282, 2385, -206, 195, 175, -292, 672, -848, 91, 1121, -322, 60, 2411, -716, -223, 6, -2731, -3019, -1265, // 17280
// Out channel 96
-63, -1362, 153, -495, -765, -785, 177, 37, -3414, -27, 922, -192, -161, -470, -98, -311, -713, 64, -45, -459, // 17300
1222, -464, 790, -1933, -819, 78, 199, 599, 3458, -497, 278, 1994, -976, -1464, 587, 1908, -96, 659, -447, 1669, // 17320
2009, -339, 722, -1451, 541, 2968, 844, 751, -594, -1105, 357, 20, -861, 240, -2122, 409, -173, 1547, -1822, 1, // 17340
-713, 1689, -436, 2478, 236, -690, 2087, 872, 190, 1746, -701, -775, -1747, 1618, 634, -416, 755, -109, -659, -996, // 17360
-649, 794, 491, -1441, -71, 209, -1275, 3597, -546, 633, -1063, -100, -1, 1098, 560, -145, 565, -143, 638, -5494, // 17380
736, -2534, 78, -1186, -318, 936, -96, 336, 101, 1491, 60, -2563, 499, -2409, 345, -196, -242, 394, 273, -701, // 17400
-111, 47, -285, -700, -1101, -443, 223, 2752, -765, -329, 462, -1220, 626, -1286, -335, -4, -2376, -71, 2469, 3248, // 17420
528, 2526, 156, -719, -464, -92, -371, 534, 175, -337, 283, -139, 233, 371, -92, 679, -556, -2271, -4558, -1396, // 17440
-599, -2866, -3944, -1085, -301, 878, 3085, -492, -615, 1732, -101, 28, -759, 28, 2141, 161, 575, 1374, 522, 2005, // 17460
// Out channel 97
96, -1016, -4046, 1466, -2890, -449, 163, -650, -653, 424, -1040, 409, 236, -557, -1057, -1654, 9, 335, -1248, -606, // 17480
-256, -711, 712, 525, -585, -1783, 986, 2, -1715, 393, -594, 143, -313, 609, -14, 879, 113, -68, -602, 150, // 17500
1415, 335, 2689, 1296, -1018, -1382, 671, -540, 763, -652, -1114, 1526, 894, 1840, 544, 5, 218, -285, -326, -2412, // 17520
-1412, 1474, -938, -687, 433, 1098, -844, -940, -1330, 110, 615, -5, -358, 1773, 594, 4875, -843, -826, -801, 289, // 17540
44, 202, -668, 3793, -370, -791, 990, -757, 230, -1011, 51, -861, 76, 726, -407, -332, -618, -1713, 1074, 1103, // 17560
-19, -890, 653, -648, -1155, -267, -590, 499, -235, 727, -1295, -1843, 2290, -1150, 933, 256, 91, 1347, 456, 793, // 17580
2120, 833, 394, -308, 927, -231, 928, -1665, -661, 375, -888, 1009, 102, 571, 2055, -274, 282, 242, -646, -1151, // 17600
581, 558, 614, 1877, -1620, 140, -411, 100, 392, -801, -2124, 177, -109, -427, 1110, -1522, -75, -669, -255, 2077, // 17620
196, 384, 2762, 40, 434, -117, -1427, 53, -1867, 1261, 114, -1167, -700, 991, 533, -1494, -1071, 485, -1639, -4137, // 17640
// Out channel 98
-1027, 2473, 421, 1876, 723, 99, 673, -631, 1174, 630, -570, -287, 1315, 339, -1716, -93, 804, 1051, -1895, 736, // 17660
-294, -506, 521, 127, -693, -395, -1101, -617, -383, 246, -461, -853, 1402, 801, -1050, -1531, 713, -1927, 3500, 23, // 17680
-1250, -285, 968, 15, -310, -948, 1000, -1269, 472, -288, -1127, 1221, -1266, 1540, 245, 647, 2225, 112, 8, -116, // 17700
-963, -148, 432, -535, -748, 250, -1687, 179, 228, -299, 1729, -578, 4396, -949, 397, -840, -1485, 94, 1266, -257, // 17720
-277, -867, -177, 605, 323, -381, -29, -426, 337, -1059, 66, 11, -1142, -52, -254, 90, -575, -351, -515, 1608, // 17740
158, 956, 6, 851, -814, -881, 237, -2875, 1802, 110, -723, 395, 1465, -73, 400, 529, -88, -941, 1144, 217, // 17760
948, -409, 1009, -87, 1391, 2959, 585, -731, 703, -1, -225, 821, -213, 1332, 1186, 1013, 1073, -101, -410, -2809, // 17780
-639, -3190, -1115, 472, -342, 521, -180, -9, 752, 922, -450, 80, -191, -2528, 92, -459, 50, 497, 583, 658, // 17800
-165, 731, 30, 33, 701, 586, -1852, -326, 1046, -499, -257, -1155, -427, -1320, -30, 93, -207, -301, 579, -1452, // 17820
// Out channel 99
-735, 1029, 913, 251, 1522, 1704, 1753, -227, 1089, -452, -1763, 14, 479, 543, 621, -379, 633, 784, -128, -1000, // 17840
-697, -1112, -1637, 1179, -141, -299, 412, 181, -511, 414, -911, -2487, 802, 654, -709, -2127, 845, -352, 722, -2207, // 17860
-1159, 166, -1677, -25, 423, -1252, 341, -730, 1447, 1227, -457, 502, 333, 681, 1565, 516, 154, -1081, -869, -57, // 17880
363, -64, -536, -367, -790, -814, -853, -430, -1236, -863, 220, 1353, 1310, -4413, 301, -742, -379, 1039, -308, 494, // 17900
48, 736, 663, -335, 115, -367, 1346, -1831, 353, -780, 881, -56, 140, 197, -725, -1139, 1420, 579, 1531, 880, // 17920
-265, 2056, 441, 2012, -678, -606, 1721, -793, 1656, -865, -299, 2388, 959, 830, -491, 1009, 584, -2548, -608, -261, // 17940
568, -653, 806, -1254, 1457, 968, -44, -1023, 229, -553, 40, 1607, 961, -73, 1308, -239, 1005, -316, -709, -2206, // 17960
1665, -3076, 2279, -576, -498, 511, 437, 182, 68, 1450, 275, 159, 93, -1107, -880, -397, -537, 762, 878, 827, // 17980
783, 2457, 2336, 2406, 38, 107, -157, 1724, 108, -264, 12, -54, 775, 743, -276, 333, 172, -2084, 126, -179, // 18000
};
const int16_t cg_MP_FC2bias[100] = { // Co,H,W,Ci: (100,)
-3752, 2652, 7092, 5486, 4392, -5060, 2451, 2349, 5073, 3649, 3333, -505, -1462, -2386, 1667, -1365, 8075, -1693, 1309, -1013, // 20
2984, -2545, -2252, 4013, 6011, 403, 1666, -7206, 1491, -3604, 2141, -1106, -1533, 4493, 4124, 4554, -2760, -2837, 111, -1070, // 40
3850, -4609, 15, 3310, -3188, -1065, -2656, 700, 2962, -1830, -5217, 2522, -4408, 465, -1360, -103, -1061, -588, -3510, 733, // 60
1278, -6200, 1123, -1518, 3861, 2386, 4850, 2420, -260, 2383, -5366, 4041, -1306, -3353, 222, -3338, -3054, -1630, 1019, 3487, // 80
2332, 2379, 1133, -2899, -1318, -2416, 1258, -3578, 3725, 930, -4261, 435, -2611, -680, -2614, -1443, 59, 480, 1833, -1559, // 100
};
const int16_t cg_MP_FC3weit[4000] = { // Co,H,W,Ci: (40, 100)
// Out channel 0
552, -108, 6, -391, -985, -608, -140, 0, 29, -1419, -187, -292, 1101, 36, -872, 592, -807, 303, -1659, -620, -1305, 1029, -889, 967, 877, 1033, -1595, -399, -774, -793, 655, 580, // 32
581, 1184, -417, 334, 1299, 220, -1696, -41, 2419, 1540, 170, -194, -1029, 22, -1114, -230, 2195, 309, 633, 1143, -354, -1918, 850, 57, -37, -1360, 258, -156, -632, 598, 80, 1042, // 64
492, 2137, -572, -245, -1274, -1102, 142, 541, -1516, 149, -723, 220, -212, -1582, -3811, -1143, 841, -821, 1050, -439, -38, -405, -196, -452, 488, 846, 2017, -1235, 147, 1042, 437, -1451, // 96
992, -610, -963, 892,
// Out channel 1
203, 605, -751, -629, 232, 791, 17, -149, -329, -1149, -256, -181, 238, 215, -424, 566, -1004, 100, -993, 38, -413, 160, -543, 159, -141, 56, -48, 373, -355, 248, -267, -43, // 132
622, -1267, -928, -549, 588, 365, -377, 91, -1298, 535, 802, 484, 730, 980, 411, -25, -46, 66, 881, -38, 451, -198, -46, 69, 540, 421, -209, 243, -265, 1112, -1141, 582, // 164
-90, 253, -255, -522, -478, -70, 206, -154, 350, 574, -571, 879, 187, -560, -449, -1187, 27, -1025, 167, 765, -75, 371, 591, 495, -481, -493, 626, -449, 753, -85, 77, 225, // 196
-254, -482, -285, 67,
// Out channel 2
434, 939, -1007, -993, 515, 110, -1070, -391, -1138, 82, -1043, -912, 274, -893, 415, 1343, -940, 353, -1209, 77, -107, 103, 385, 691, -443, 94, 585, 969, -457, 1456, 169, 741, // 232
-213, -1437, -349, -573, 1651, 1606, -879, 28, -1153, 942, 353, -618, -7, 247, -644, -91, 589, 9, 317, -988, 522, -1274, 933, -282, 161, 153, 657, -691, -776, 1379, -221, -690, // 264
299, -198, -511, -1074, -327, 549, 484, -638, -130, 1192, -118, 892, 797, -852, -1178, -398, -120, -813, -161, 802, 652, 1348, -764, 564, -504, 228, 1021, -1314, 1379, 16, 347, -457, // 296
417, -99, -1023, 133,
// Out channel 3
625, 453, -983, -33, -303, 726, -632, -172, -495, -775, -720, 668, 152, 142, -452, 461, -1795, -101, -674, -166, 463, 664, -180, -575, -170, 1001, -634, 1327, 367, 675, -241, -171, // 332
-220, -851, -460, -604, 1027, 35, -884, 260, -599, 901, -181, 687, 511, 32, 1028, -844, 191, 96, 1322, -316, 272, -283, 445, 319, 914, -161, 1060, 102, 473, 255, -660, 196, // 364
594, -25, -177, -252, -439, -528, 394, -817, -108, 903, -4, 601, -266, 220, -651, -673, -826, -447, -216, 659, 49, 1614, 498, 531, -947, -380, 712, -209, 496, 358, 181, -230, // 396
1221, -494, 318, -353,
// Out channel 4
-274, 1330, -2675, 944, -512, -342, -1369, -1082, -2049, -1880, 880, -694, 1664, -448, -147, -152, -2195, 1207, -986, 42, 1408, 2147, 639, 1367, -445, -1349, 354, 1744, -594, -1144, 1573, 416, // 432
447, 830, 1248, 2146, 1337, -1166, -795, -910, 2243, -1791, -226, -212, -434, -673, -884, -78, 2881, 89, 1700, -3687, 3035, -2024, 2746, -2592, 628, 468, -1589, 456, 2919, 1774, -1369, 111, // 464
625, 708, -1674, 1653, 78, -56, 371, 53, -1370, 4155, 518, -1366, 1154, -1073, -148, 2432, -1583, 384, 1138, 1837, -506, 1142, 323, -881, 847, 1230, 4, -1929, 2350, -284, 1469, -780, // 496
1910, -1354, 1540, -366,
// Out channel 5
261, 318, -1297, -469, -423, 267, -65, -815, -1077, -688, -268, 209, 702, 361, 586, 711, -750, 56, -706, -211, -13, 968, 228, 648, -722, -212, -968, 2071, 511, 756, 198, -766, // 532
-48, -1692, -1748, -328, 712, 539, -897, 444, -1076, 1447, 633, -615, 104, -349, 946, -671, 481, 295, 1348, -515, 878, -1645, 413, -469, 626, -717, 1462, -749, -482, 937, -388, -393, // 564
149, -264, -82, -1308, 78, -968, -18, -410, -669, -355, -765, 656, 897, 345, -428, -442, -743, -1140, 105, 1090, -59, 434, 219, 1434, -188, -479, 125, -1064, 1089, 274, -14, -783, // 596
121, 28, -629, 443,
// Out channel 6
-1035, -191, -1429, 127, -1198, 736, -2578, -2518, -1553, -2947, 228, -2274, -594, -2004, 867, 65, -2293, 2451, 379, -173, -1080, 730, 1019, 1015, -1704, 1002, -2072, 2233, -262, -507, -178, 580, // 632
-795, -1363, 198, 596, 1139, 310, -583, 2104, -1067, 2355, 2776, -1720, -1015, -427, -506, 1773, 534, 2040, 1275, 1570, -767, 80, 2375, 999, 20, -274, -450, 1573, 286, 2466, -78, -864, // 664
625, -1131, -1025, 1608, 621, -997, -73, -3216, -814, 44, -969, 162, 118, 8, -334, -179, -127, 1065, 1079, -1037, -2283, 311, 942, 218, 182, 660, 252, 536, 325, 217, -480, -406, // 696
-96, -710, -1368, -458,
// Out channel 7
404, 81, -828, -1885, -159, 702, -475, -134, -578, -721, -1059, 157, 6, -123, -1134, 431, -1166, 579, -398, 292, -502, 1077, -466, -476, -206, 44, 66, 860, 622, -708, -1034, -152, // 732
-141, -1316, -1028, -2107, 515, 1008, 352, 91, -1180, 488, -657, 203, 513, 1060, 1341, 283, 940, 547, 1113, -485, 624, 221, 442, 763, 216, -858, 1091, -142, -227, 1668, -10, 383, // 764
104, 168, -1072, -480, -874, -437, 801, -645, 987, -273, -853, -119, 214, -589, 615, -777, -650, -325, 184, 8, -490, 1660, -81, 1187, -438, 240, 160, -335, 1154, 661, -67, 694, // 796
560, -795, -404, 261,
// Out channel 8
571, 607, -75, -292, -111, 491, -708, -1480, -796, -816, -414, -515, 458, 550, -748, 613, -1765, 279, -445, -71, -30, 1234, -584, 238, -291, 319, 43, 1421, -248, 272, -175, 761, // 832
-60, -1128, 1, 197, -39, 789, -951, 697, -1532, 505, -555, 355, 912, -761, 12, 702, 145, 643, 928, -597, 509, 348, 441, 99, 1353, 295, 1384, -95, 130, 912, -373, 401, // 864
-258, 638, -204, -205, -181, -29, 658, -1588, 133, 760, -341, 1033, 356, -957, 182, -1020, -1025, -236, -577, 770, -534, 939, -215, 246, -107, -844, 131, 160, 830, 478, 1071, 100, // 896
653, -66, -192, 42,
// Out channel 9
2659, -2706, -208, 106, 1025, 1807, -332, 65, -1087, -433, -154, 1664, -1337, -2806, -1835, -1661, -1118, 73, -1281, 2306, -2210, -1671, -704, -1889, -3136, 701, -397, 801, 1726, 1189, 1749, -1493, // 932
-2141, -827, -391, -1524, -2203, 756, -174, -1841, -1228, -236, -558, -802, 1301, -1881, 774, 1277, -450, -918, 1474, -171, 498, -671, -97, 591, 1109, 2324, -24, -1823, 215, 1708, 2004, 663, // 964
-1168, -620, -417, 587, -177, -1324, -1254, -653, 54, -510, 2946, 37, 721, -270, -743, 1310, 196, 1056, -1467, 709, 2362, 203, -1644, 2037, -975, -1513, 258, 674, 738, 1336, -382, 977, // 996
-1651, -377, 2643, 1373,
// Out channel 10
-344, 1255, -340, -1574, -95, -77, -368, 341, -251, -243, -464, 220, -9, 670, -307, 1062, -1357, 803, -1000, 61, -563, 697, -527, 196, -1367, 272, -308, 624, -1416, 453, -381, -452, // 1032
-417, -1645, -627, -91, 532, 523, -231, 708, -1612, 34, 328, 223, 469, 827, -423, -871, 243, 323, 1129, -442, 609, 16, 563, -443, 629, -324, 297, 637, -260, 1381, -1116, 21, // 1064
1065, -160, -306, -171, -1749, 1490, 528, -1184, 224, -1, -1784, 1700, 614, -740, -579, 5, -864, -753, -446, -95, -280, 176, 148, 1376, -853, 867, 1009, 391, 937, 859, 922, 159, // 1096
516, -75, -608, 686,
// Out channel 11
-1047, -520, -1755, -757, -655, 666, -865, -127, -1445, 1203, 367, 2849, -624, 1176, 786, 1419, -2196, -167, 114, -446, 1473, 312, -1937, -2279, -613, 536, -2483, 2333, -839, -145, -600, -580, // 1132
244, -487, 44, -59, 893, -441, -1439, -394, 1616, -188, -1459, 1382, 2897, 490, 831, 354, 1198, 1734, 1131, 119, -341, -201, 823, 0, 1080, -168, -1148, 410, 2455, 1654, -492, -30, // 1164
1136, 1591, 2085, -1258, -333, -134, 774, -151, -644, -439, -462, -151, 3343, -1187, -1785, -938, -1260, -127, -407, -1100, -316, -224, 818, 58, -39, -608, 84, -483, -744, 67, 603, -1463, // 1196
1271, -216, -447, 209,
// Out channel 12
-69, 1103, -1315, -1662, -288, 155, -643, -391, -137, -278, -909, -800, 511, 865, -714, 329, -894, 448, 188, -73, -674, -552, 404, 365, -682, 178, -291, 1728, -214, 203, -408, 808, // 1232
365, -1619, -576, -375, 803, 1637, -1147, 169, -516, 1863, 711, -254, 1455, -121, 437, 111, -673, 685, -86, -724, 227, -1049, -705, 88, 195, -307, 542, -442, -333, 2435, 406, -124, // 1264
-594, -68, -114, -386, 191, -486, 251, 146, 390, 697, -340, -529, -296, -7, -562, -415, -1104, -1273, -851, -230, -682, 1014, -448, 461, -147, 249, 1275, -1147, 1465, 1175, 335, -173, // 1296
155, -265, -466, 534,
// Out channel 13
1246, -204, 613, -1707, -1166, 1306, -1020, -462, -1196, -1916, -354, -1090, 3272, -297, -186, -495, -1166, 1699, -1780, -1116, -1447, 694, 1968, 307, -752, -295, -81, 1284, -989, 514, 733, 2017, // 1332
-1877, -1584, -1415, 365, 304, 966, -741, -377, 91, 2220, -1455, -3568, 158, -573, -945, 1423, 417, 614, 598, -2349, 3136, -2772, 579, 32, 1358, -415, 232, -104, 1581, 1515, -257, 1334, // 1364
192, 248, -3139, 836, 557, -2054, -1122, -819, -443, 1860, -484, 1006, 13, -412, -569, -593, -1281, -124, -44, 1118, 500, 434, 1545, 910, -484, -1374, 1662, -923, 331, -1121, 1913, -1360, // 1396
202, -903, -513, 488,
// Out channel 14
21, -234, -456, -1629, -509, 40, -301, -506, 129, -984, -1216, 300, 450, 12, -91, 738, -1550, 1307, -516, -570, -1212, 865, -596, -571, -818, 800, -340, 1191, 106, -223, -330, -989, // 1432
-304, -340, -182, -1143, 575, 846, -644, 749, -1263, 1407, 576, 459, 169, -456, 95, -313, 354, 764, 260, -869, 254, 34, 287, -1371, 765, -207, 892, -683, -564, 98, -460, 742, // 1464
145, 164, -736, -1135, -837, 1561, 449, -961, 703, 137, -63, 867, 608, -173, -706, -914, -646, -279, -355, 123, -355, 329, -811, 442, -801, 277, 707, -565, 619, -358, 362, 265, // 1496
51, 58, 197, 1133,
// Out channel 15
527, 248, -1199, -1088, -574, 282, -642, -429, -957, -1228, -94, -70, 776, 325, -669, 922, -1107, 1081, 476, 69, 44, 1023, -321, 188, -777, 3, -166, 1662, -262, 64, -215, -342, // 1532
-718, -1064, -655, -778, 179, 673, -478, 991, -336, 599, -269, -235, 703, 803, 1249, -396, -456, 638, 682, -917, -107, 249, 103, 771, 564, -509, 499, 225, 296, 767, -872, 36, // 1564
10, 236, -988, -490, -1166, -790, 114, -329, -363, 129, 135, 357, 245, -360, 473, -918, -909, 391, 2, 205, 354, 961, 466, 1281, -328, -1125, 1204, -348, 496, 224, 628, 767, // 1596
54, 873, -762, 906,
// Out channel 16
-1177, 1617, -511, 468, -1364, -648, 805, 1089, -414, 610, 150, -140, 962, 2596, 1030, 1303, -1173, -767, -660, -1217, 2302, 316, -1077, -1965, -454, -733, 2232, 1503, -1154, -738, -163, 2013, // 1632
-58, 794, -362, -711, 829, 113, -243, 1030, -2374, 525, -447, -89, 1732, 1911, 1687, -640, -936, -17, -48, -1678, 1053, 399, -130, -1042, -1521, -837, -339, -1119, 199, 507, 63, 386, // 1664
-3004, -1494, -260, 72, -3027, 1480, 1204, -679, 827, 3062, -1067, 755, 798, -493, 1828, 140, -352, -328, 1167, 3561, 1241, -1113, 400, 220, 225, 1764, -26, -386, 2529, -517, -1011, -2104, // 1696
1531, 2193, -1549, -579,
// Out channel 17
802, 1526, -378, -488, 14, 1199, -1228, -938, -25, -964, -1330, 395, 126, -153, -752, 851, -1163, 1338, -1192, -319, 409, 416, 243, 339, -772, -547, -843, 1810, 726, 273, -290, 114, // 1732
-504, 165, -1848, -1344, -290, 1455, -1201, 260, -358, 723, -318, -732, 361, 415, 271, 598, 713, 593, 1158, -468, 670, -1118, 1317, -493, 1695, 418, 251, -1093, -104, 566, -704, 58, // 1764
-268, -87, -753, -365, 37, 605, -557, -749, 521, 1156, -504, 266, 1135, -307, -755, -1357, -820, -465, -1166, 1367, 899, 1235, -418, 920, -636, -1220, 539, 481, 1146, 1090, 1516, -1012, // 1796
801, -733, -653, -149,
// Out channel 18
151, -114, 323, -1631, -706, 1022, -1626, 27, -1072, -420, -355, -384, 878, 300, -331, 819, -1142, -107, -512, -635, -989, 709, 101, -581, -1011, -646, -124, 1314, 429, 114, -1094, 90, // 1832
-160, -1164, -742, -731, 273, 854, -439, 560, -1162, 1367, -38, -70, -313, 1350, 965, 68, -349, 723, 1279, -531, 501, -588, 881, -1557, 365, 423, 1185, 15, 297, 1748, -869, 375, // 1864
235, -647, -627, -773, -45, -554, 438, -314, 739, 474, -968, 1539, 306, 649, -229, 428, -483, -852, -354, 166, -65, 49, -284, 4, 320, -122, 15, -12, -14, 328, 48, -54, // 1896
1017, 102, 121, 303,
// Out channel 19
-801, 509, -74, -120, 939, -381, -699, -1366, -500, -1355, -265, 736, -1274, 117, -946, 885, -678, 620, -69, 935, -962, -987, 1102, 1771, 45, -369, -745, 484, -86, -302, -769, -786, // 1932
-581, -1777, 775, 467, -275, -814, -365, 120, -989, -5, 1004, 340, -1489, -130, 996, 1158, -1449, 36, 627, 793, -926, 147, 1231, 1113, 1116, 177, 1817, -444, -1273, 895, 98, 503, // 1964
1389, -1083, 422, -1564, 2390, -176, -544, -137, 1774, -1141, 912, -721, 405, -191, 313, -901, -441, -531, -757, -1227, 286, 1558, -1322, -279, 298, -1134, 103, 233, -246, 536, -196, 2426, // 1996
-54, -548, 772, -534,
// Out channel 20
1102, -165, -543, 1509, 487, 1422, 167, -778, -2054, -938, -2052, 1414, -1482, 1356, -1349, -696, -2201, 622, -706, 102, 229, -670, -901, -1402, -1099, -203, -936, 1620, 20, 2122, 77, -944, // 2032
-175, -865, -1585, 1243, 1022, 806, -1160, -1191, -365, 225, -816, 1379, 1000, -65, -443, -609, -1288, 2695, 93, -986, 497, -462, 813, -947, 686, 1053, 284, -1533, 184, 1206, 516, 1072, // 2064
-2293, -1074, -816, 396, 197, 1376, 346, -1073, 976, 628, 216, 436, 2048, -936, 186, 62, -2296, 1182, -1280, 1102, 987, 849, -535, 297, -1564, -1211, 59, 1502, 1478, 1191, -1094, 373, // 2096
-422, -529, -203, -391,
// Out channel 21
591, -46, 619, -3401, -801, 623, -234, 456, 415, -1415, -368, -1902, 2942, 515, -266, -658, -116, -178, -930, 153, -2599, 478, 1189, 164, -756, 27, 501, 108, -1580, 1036, -259, 1274, // 2132
-1637, -2175, -775, 239, -227, 1258, 568, -504, -236, 2319, -927, -3464, 274, -20, -1504, 1955, -924, -471, -373, -79, 1076, -1778, -171, 1507, 1939, -779, 193, 220, 607, 140, -888, 721, // 2164
258, 301, -2384, 678, 346, -2377, -995, -275, -199, -1098, -874, 1254, -634, -148, 537, -860, -21, -383, -692, 505, -8, -787, 1712, 572, -972, -432, 2986, -520, 608, -1902, 2211, -632, // 2196
-1227, 796, -520, 648,
// Out channel 22
795, -231, 1360, 1236, 615, 275, -698, -1140, -125, -718, -1777, 1433, 224, -809, -440, -686, -691, 955, -148, 494, 84, 496, -1096, -292, -63, 2911, -897, 584, -425, 1825, 2443, -277, // 2232
-190, -395, -2409, -1267, 467, 1444, -129, -2766, 1293, -41, 385, 1418, 394, -2101, 1587, -456, 1373, -58, 487, 384, -646, -91, 1044, -1322, 603, 1532, 122, -858, 907, 481, 131, 669, // 2264
-2747, 1450, 884, 500, 905, -630, -654, -561, 48, -945, -75, 2092, -1628, -657, -774, 842, -1258, -1517, -1747, -691, 685, 1155, -993, 878, -1593, -1673, 1852, 647, -748, 1670, -176, 378, // 2296
-870, -1207, 1629, 2221,
// Out channel 23
387, -1002, -527, -343, -741, 735, -1953, -2422, -1446, -2757, -1453, -160, 357, -1552, 447, 99, -1523, 2640, -624, 240, -492, 424, 1017, 814, -1220, 325, -2204, 1096, -342, 1070, 23, 628, // 2332
-172, 55, -625, 419, 382, 491, -1034, -107, 275, 1326, 1567, -63, -845, -891, 1846, -168, 1027, 989, 829, -331, 617, -801, 2391, 388, 815, -310, -3, 91, -203, 2540, 155, 196, // 2364
-487, -38, -633, -170, 624, -607, 160, -2397, 1090, 1332, 883, 351, -1281, -991, -378, -238, -2612, -784, -72, 249, -763, 1469, -508, 261, 715, -677, 1178, 558, 1203, 1249, 668, -194, // 2396
65, -1963, -293, 1451,
// Out channel 24
-790, -303, -1885, 1073, -617, -190, 2241, 155, -1146, 1101, 357, -884, -1170, -73, 2182, -1333, -1265, -1380, 1466, -858, -601, 2, 689, -69, -104, 238, 1437, 692, -407, 501, -177, -2849, // 2432
1390, -35, -231, 144, -156, 1321, 2149, -274, -363, -1196, 1343, -1405, -69, 77, -2044, -961, 1369, -856, 649, 729, -1977, 1201, -203, 1189, -1374, -1057, -1132, 329, 617, 524, 429, 147, // 2464
137, -107, 1770, 1061, 543, -804, 1343, 2979, -1480, -1051, 35, 528, -1373, 2490, 1177, 964, -310, -493, -237, -1877, 227, -505, 1435, 83, -140, -60, -679, -559, 681, -1560, -1197, 2329, // 2496
-1799, 998, 82, -590,
// Out channel 25
105, 1269, -566, -519, 307, -181, 193, 24, -1089, -1339, -698, 806, 1371, -274, 357, 517, -1234, -201, -1161, 894, 180, 660, -561, -185, -100, -798, -151, 933, -477, 329, -666, -529, // 2532
106, -507, -1605, -257, 1381, 245, -488, -83, -1419, 515, 1057, 523, 1415, -147, -283, -110, -616, 291, 977, -205, 158, -937, 918, 94, 839, -220, 1343, -816, -1019, 909, -504, 445, // 2564
-340, -489, -143, -1271, -587, -367, 1950, -1044, -242, 804, -267, 616, -93, -202, 477, -1456, 196, -400, -705, 334, -676, -681, -262, 1068, -618, 559, 354, -99, 1072, 276, -413, 131, // 2596
1767, -435, 106, 1110,
// Out channel 26
625, 783, 251, -1162, -396, 318, -766, -298, -1006, -1053, -1013, -150, -113, -111, 531, 684, -877, -472, -1098, -338, 118, 1477, -608, -177, -1713, -480, -617, 1473, -163, 339, -451, 54, // 2632
-57, -1262, -220, -492, 24, 498, -602, -283, -2007, 463, 451, -563, 723, 33, -137, -202, 566, 584, 1113, -1070, 477, -1563, 649, 303, 1174, -288, 195, 788, 481, 829, -488, -327, // 2664
-163, -126, -55, -744, -887, 16, -200, -1043, 409, -312, -469, 1091, 149, 332, -133, -784, -604, -539, -546, 679, -15, 1037, -565, 273, 252, -405, 1446, -665, 802, -91, 147, 616, // 2696
1196, -242, -537, 247,
// Out channel 27
-19, 788, -1541, -1, 30, 1210, -605, -1146, -349, -1651, -1354, -627, -417, 185, -256, 334, -1677, 193, -1455, -443, 406, -427, -948, 342, -168, 35, 543, 1257, -396, 735, -746, -797, // 2732
678, -1048, -692, -489, 517, 1489, -491, 70, -129, 932, -952, 276, 778, 543, 603, 329, -134, -260, 887, -1021, 685, 284, 618, 428, 839, -71, 1162, -46, -1305, 551, -75, -787, // 2764
-272, 11, -96, -257, 429, 373, 1293, -630, 430, 803, -9, 591, 1270, -1030, -983, 64, -603, -976, -473, 272, -138, -55, -285, 445, -1284, -339, 1184, -867, 1290, 681, 1281, 675, // 2796
-240, 305, -274, 799,
// Out channel 28
465, -2, -261, -900, 183, 630, -696, -285, -274, -1328, -569, -830, -402, -461, 128, 367, -820, 1046, -600, 167, -916, 722, 410, -822, -213, 412, -305, 1488, -365, 97, -1001, 526, // 2832
-608, -1295, -212, -589, 35, 810, 395, -75, -914, 328, 63, -355, 212, 1461, 181, -588, 36, 419, 169, -763, 1146, -1074, 826, -251, 448, 116, 615, 1030, 413, 1190, -758, 842, // 2864
-65, 296, -704, -260, -101, 22, 901, -144, -649, 536, -1672, 956, 76, -71, -463, -1058, 196, -921, -762, -4, 181, 322, 223, -66, -1040, 44, 933, -597, 284, 742, 280, 122, // 2896
552, -32, -785, -282,
// Out channel 29
1774, -2116, 246, -888, -2143, 1501, -1219, -1463, -317, -849, -2151, 151, 91, 1725, -858, -640, -533, 164, -1434, 222, 689, 1342, 1739, 154, 624, 1101, -27, 765, -1096, 1994, -152, 952, // 2932
-354, -188, -2076, 937, 747, 278, -661, -1266, -2385, 443, -1288, 309, -414, -772, 1696, -134, -1314, -888, 791, -789, 780, -790, 517, 39, 581, 669, 1045, 23, -1024, 643, 1103, 1614, // 2964
163, -2364, -2027, 43, 2412, 377, -459, -1018, 933, 377, -311, 1018, 158, -215, 696, -1125, 62, -2467, -611, 1836, 832, 1045, -688, -59, -1606, -251, -1170, -164, 179, 2915, -208, 106, // 2996
530, -616, 652, 1783,
// Out channel 30
691, -44, -558, -393, -1492, 1015, -202, -96, -1226, -586, -975, 1119, -549, 748, -263, 514, -824, -2, -46, 37, 161, 239, -514, -386, -551, 247, -286, 1003, 410, 356, -949, 214, // 3032
509, -1098, -508, 195, 704, 173, 60, -22, -1022, 1565, 472, 635, 64, 166, 437, -83, 314, 1013, 953, -730, 924, -58, -854, -578, -690, 266, 135, -746, -1427, 892, 317, -618, // 3064
94, -663, -1125, -348, -605, 128, 943, -1346, -889, 440, -267, 351, -285, -720, -591, -958, -579, -138, -306, 180, 992, 694, -1053, -176, -283, -396, 977, -334, 619, 573, 543, -26, // 3096
584, -55, 166, 75,
// Out channel 31
258, -2184, -152, 1002, -1432, 357, -624, -220, -975, -595, -719, 1943, -236, 1697, 103, 482, -1194, -591, -752, -513, 1569, -462, 871, -516, -1188, 202, 132, 698, -157, 1942, -503, -546, // 3132
-1573, -191, -2041, 540, -201, 1805, 32, 113, -341, 1426, -351, 549, 999, 163, 1826, 993, -368, -413, 1729, -1491, 1121, -881, 665, -349, 442, 517, 722, -706, -1213, 985, 1455, 1475, // 3164
-739, 55, -692, -1148, 387, 1143, -203, -1211, 858, 1140, 818, 2272, 322, -589, 1379, -218, -882, -1552, -1794, 1191, 506, 579, -2931, 436, -1145, -1860, 280, 804, 843, 1486, -823, 115, // 3196
-335, 1281, 688, 2844,
// Out channel 32
-588, 526, -990, -572, 823, -590, -1026, -2352, -613, -1729, 32, 897, 529, -330, -351, 1271, -1628, 1782, -1148, 696, -1380, -587, -917, 1619, -759, -1195, -28, 973, 161, -729, -350, -439, // 3232
-439, -1254, 659, -442, 40, 513, -897, 932, -1212, 542, -90, -194, -1767, -759, -40, 1483, -997, 572, 1110, 185, 601, -833, 1484, 1953, 2307, 1190, 2446, -1624, -906, 1427, 224, 555, // 3264
984, -821, -252, -1627, -267, -172, 86, -743, 784, 976, -185, -231, 68, -637, 391, -1159, -794, -787, -694, 89, 244, 2089, -1474, -29, 13, -1404, 1821, -464, 736, 455, 601, 717, // 3296
681, -906, 566, -1594,
// Out channel 33
353, -547, -516, -576, -122, -26, -467, 447, -133, -1128, -634, -205, 188, -782, -282, 539, -998, -222, -648, 387, 258, 710, -467, 117, -846, 15, -122, 1379, 376, 178, 161, 379, // 3332
578, -1747, -1619, -1260, 1372, 692, -1211, 30, -1477, -573, 175, 120, 359, -309, 433, 698, 1330, 1440, 582, -669, 624, -28, 204, 272, -172, 587, 1305, 617, -700, 980, -773, 360, // 3364
-153, -590, -485, -507, -829, -117, 641, -276, -108, 926, 144, 1980, -78, -37, -365, -564, -244, -765, -667, -47, -132, 407, -500, 426, -388, -597, 1041, -324, 1216, 348, 394, 1380, // 3396
-255, -294, -446, -343,
// Out channel 34
-2409, 1763, -1826, -520, -984, -1919, 310, 521, 151, 844, 1542, -1476, 134, -638, 1097, -1264, -527, -858, 356, -1623, 1725, 2357, -180, 2775, -243, 256, 1343, 1198, -1165, -1153, 939, -537, // 3432
-168, 2346, 1413, -33, 2275, 87, 1196, -1633, 2321, -2027, 948, 2223, -2879, -439, -44, 93, 2320, -645, 24, -367, 70, -437, 457, -480, -653, -327, -2185, 2647, 2119, 627, -2280, -1701, // 3464
2124, 2255, 1795, 1906, 321, 1182, 1580, 1061, -657, 360, -1577, -1060, -1429, 694, 2341, 3461, 1181, -434, 1619, -509, -1556, -246, 354, -712, 1242, 1351, -1251, -2548, 628, -121, 249, -142, // 3496
-1623, 596, 558, -931,
// Out channel 35
-197, -1318, -1536, 1774, -732, 1628, 146, -1416, -2894, 1343, -1149, -1557, -492, -205, 2469, 151, -1309, -913, 655, -2306, 1550, 861, 184, -289, -140, -1008, 1202, 1384, -231, 1520, -284, -740, // 3532
1731, 869, -1230, 667, 356, 1469, 461, -420, 1853, -806, -751, -395, 343, -356, -407, -1766, 1143, 501, 1537, -2178, 773, -273, 553, -784, -1247, -1120, -1063, 496, 1342, 479, -56, 328, // 3564
-2023, 912, 231, 411, 357, 484, 1353, 1398, -323, 2275, -213, 693, -1539, 779, -229, 880, -2440, -611, -698, 1147, 4, 1463, 1303, -57, -628, -304, -1660, -805, 2185, -201, -589, -146, // 3596
378, -333, -307, 1070,
// Out channel 36
663, -199, -1143, -630, -148, 1142, -1083, -98, -678, 548, 78, -231, 214, 1290, -165, 535, -1918, 791, -437, -558, 845, 355, -161, 84, -518, 238, -630, 904, 294, 575, 548, -207, // 3632
-759, -1109, -224, 666, -138, 1109, 407, -306, -366, 723, -215, 289, 1251, 328, 752, -146, -536, 796, 1455, -1072, 762, -813, 1537, -405, 523, -626, -71, -532, -575, 966, -1368, 416, // 3664
-149, 383, 355, -1477, 25, 484, 1012, -151, -307, 916, -309, 268, 328, 759, 56, -1201, -1579, -1327, -744, 68, 305, 988, -56, 1301, -305, -329, 862, -358, 1321, 415, -308, 1144, // 3696
366, 445, 258, 764,
// Out channel 37
1057, -444, 131, 173, 62, 856, -1201, -572, -569, -1435, -326, -299, 526, -763, -1354, 113, -88, 1564, -309, 1267, 267, 1352, -553, -296, -261, 171, -940, 27, -345, -28, 1021, -235, // 3732
-640, 235, 85, 515, 434, -1428, -928, -1177, -737, -1504, 60, 1829, 975, -855, 1824, 395, -84, 601, 127, 279, -1108, -1060, 326, -3500, 189, 1238, -638, 1262, -1828, 439, -1939, -874, // 3764
329, -813, 2515, 641, 579, 407, -544, -1498, 1903, -591, -1276, -1183, 1074, -1445, 90, 399, 233, -67, 1334, 321, -1577, 680, -814, 101, -906, 1400, 203, -1248, -190, 3039, 1454, -1852, // 3796
850, -759, 696, 572,
// Out channel 38
920, -261, -1777, -142, -110, 962, 26, 212, -997, -718, -407, 405, -333, -460, 275, 567, -790, 1364, -229, -81, -602, 814, -372, -403, 386, -481, -173, 1118, 487, 440, 363, -804, // 3832
668, -1060, -1158, -123, 578, 44, 139, 261, -1516, 596, 977, 372, 100, -482, 1602, -234, -71, 688, 1075, 64, 823, -450, -92, -110, 748, -255, 716, -170, -535, 954, -739, 881, // 3864
-511, -243, 202, -1784, 458, 120, 1490, -1206, 1332, 72, -510, 286, 32, 423, -521, -1141, 394, -994, -491, -61, 430, 1195, -374, 208, -132, -156, 458, 604, 1041, 1729, 347, -685, // 3896
750, 289, 60, 171,
// Out channel 39
-157, -624, -522, -493, 713, 2113, -158, -1974, -1720, -461, -883, 48, 56, 918, 1471, -313, -2260, 1899, -415, -696, -1393, 85, 1817, 278, -1137, 1153, -1164, 2196, 285, 312, 218, -679, // 3932
700, -2, 293, 801, -42, 520, 650, -417, -848, -262, 1350, -19, -486, -691, -516, -175, 1025, 2081, 1456, 1048, 283, -480, 227, 1215, 186, -1257, -536, 287, 724, 3740, -891, 609, // 3964
92, -766, -212, 152, 467, -924, 1207, -262, 617, -415, 1354, -208, -2293, 709, -1129, 372, -867, 657, -633, 4, -927, 842, 676, 328, -106, 335, 325, -1715, -92, 61, -492, -691, // 3996
-1288, -694, -272, -1079,
};
const int16_t cg_MP_FC3bias[40] = { // Co,H,W,Ci: (40,)
-3436, -2617, -3755, -3050, -3413, -2982, -4361, -2928, -3113, -4052, -3382, -7733, -2692, -1981, -3621, -2413, -4078, -2661, -2782, -669, -6888, -4376, 538, -2853, -5946, -3124, -2788, -3025, -2478, -4697, -2792, -6858, // 32
-3503, -2679, -3671, 1800, -3108, -3895, -2714, -2873,
};
const int16_t cg_MP_FC4weit[40] = { // Co,H,W,Ci: (1, 40)
// Out channel 0
-2145, 206, -70, 75, -5418, -570, -3629, -990, 940, -6707, 927, 5029, 653, 4187, -120, 667, -2510, -2315, 176, -4239, // 20
3684, -5607, -5897, 4352, 4372, 1654, -449, 581, -2519, 2479, -735, 4594, 3180, -2467, 4035, -5421, -1384, 3138, -2024, -3203, // 40
};
const int16_t cg_MP_FC4bias[1] = { // Co,H,W,Ci: (1,)
5463,
};
|
the_stack_data/20451387.c | //
// main.c
// helloWorld
//
// Created by Rodrigo Weber on 02/07/20.
// Copyright © 2020 Rodrigo Weber. All rights reserved.
//
#include <stdio.h>
int main() {
// insert code here...
printf("Hello, World!\n");
return 0;
}
|
the_stack_data/67326466.c | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <complex.h>
#ifdef complex
#undef complex
#endif
#ifdef I
#undef I
#endif
#if defined(_WIN64)
typedef long long BLASLONG;
typedef unsigned long long BLASULONG;
#else
typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif
#ifdef LAPACK_ILP64
typedef BLASLONG blasint;
#if defined(_WIN64)
#define blasabs(x) llabs(x)
#else
#define blasabs(x) labs(x)
#endif
#else
typedef int blasint;
#define blasabs(x) abs(x)
#endif
typedef blasint integer;
typedef unsigned int uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
#ifdef _MSC_VER
static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
#else
static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
#endif
#define pCf(z) (*_pCf(z))
#define pCd(z) (*_pCd(z))
typedef int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
typedef int flag;
typedef int ftnlen;
typedef int ftnint;
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (fabs(x))
#define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
#define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (f2cmin(a,b))
#define dmax(a,b) (f2cmax(a,b))
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
#define abort_() { sig_die("Fortran abort routine called", 1); }
#define c_abs(z) (cabsf(Cf(z)))
#define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
#ifdef _MSC_VER
#define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
#define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
#else
#define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
#define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
#endif
#define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
#define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
#define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
//#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
#define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
#define d_abs(x) (fabs(*(x)))
#define d_acos(x) (acos(*(x)))
#define d_asin(x) (asin(*(x)))
#define d_atan(x) (atan(*(x)))
#define d_atn2(x, y) (atan2(*(x),*(y)))
#define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
#define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
#define d_cos(x) (cos(*(x)))
#define d_cosh(x) (cosh(*(x)))
#define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
#define d_exp(x) (exp(*(x)))
#define d_imag(z) (cimag(Cd(z)))
#define r_imag(z) (cimagf(Cf(z)))
#define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define d_log(x) (log(*(x)))
#define d_mod(x, y) (fmod(*(x), *(y)))
#define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
#define d_nint(x) u_nint(*(x))
#define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
#define d_sign(a,b) u_sign(*(a),*(b))
#define r_sign(a,b) u_sign(*(a),*(b))
#define d_sin(x) (sin(*(x)))
#define d_sinh(x) (sinh(*(x)))
#define d_sqrt(x) (sqrt(*(x)))
#define d_tan(x) (tan(*(x)))
#define d_tanh(x) (tanh(*(x)))
#define i_abs(x) abs(*(x))
#define i_dnnt(x) ((integer)u_nint(*(x)))
#define i_len(s, n) (n)
#define i_nint(x) ((integer)u_nint(*(x)))
#define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
#define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
#define pow_si(B,E) spow_ui(*(B),*(E))
#define pow_ri(B,E) spow_ui(*(B),*(E))
#define pow_di(B,E) dpow_ui(*(B),*(E))
#define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
#define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
#define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
#define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
#define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
#define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
#define sig_die(s, kill) { exit(1); }
#define s_stop(s, n) {exit(0);}
static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
#define z_abs(z) (cabs(Cd(z)))
#define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
#define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
#define myexit_() break;
#define mycycle() continue;
#define myceiling(w) {ceil(w)}
#define myhuge(w) {HUGE_VAL}
//#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
#define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef logical (*L_fp)(...);
#else
typedef logical (*L_fp)();
#endif
static float spow_ui(float x, integer n) {
float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static double dpow_ui(double x, integer n) {
double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#ifdef _MSC_VER
static _Fcomplex cpow_ui(complex x, integer n) {
complex pow={1.0,0.0}; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
for(u = n; ; ) {
if(u & 01) pow.r *= x.r, pow.i *= x.i;
if(u >>= 1) x.r *= x.r, x.i *= x.i;
else break;
}
}
_Fcomplex p={pow.r, pow.i};
return p;
}
#else
static _Complex float cpow_ui(_Complex float x, integer n) {
_Complex float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#endif
#ifdef _MSC_VER
static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
_Dcomplex pow={1.0,0.0}; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
for(u = n; ; ) {
if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
else break;
}
}
_Dcomplex p = {pow._Val[0], pow._Val[1]};
return p;
}
#else
static _Complex double zpow_ui(_Complex double x, integer n) {
_Complex double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#endif
static integer pow_ii(integer x, integer n) {
integer pow; unsigned long int u;
if (n <= 0) {
if (n == 0 || x == 1) pow = 1;
else if (x != -1) pow = x == 0 ? 1/x : 0;
else n = -n;
}
if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
u = n;
for(pow = 1; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static integer dmaxloc_(double *w, integer s, integer e, integer *n)
{
double m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static integer smaxloc_(float *w, integer s, integer e, integer *n)
{
float m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Fcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
}
}
pCf(z) = zdotc;
}
#else
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
#endif
static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Dcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
}
}
pCd(z) = zdotc;
}
#else
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
#endif
static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Fcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
}
}
pCf(z) = zdotc;
}
#else
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i]) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
#endif
static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Dcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
}
}
pCd(z) = zdotc;
}
#else
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i]) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
#endif
/* -- translated by f2c (version 20000121).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
/* Table of constant values */
static integer c__13 = 13;
static integer c__15 = 15;
static integer c_n1 = -1;
static integer c__12 = 12;
static integer c__14 = 14;
static integer c__16 = 16;
static logical c_false = FALSE_;
static integer c__1 = 1;
static integer c__3 = 3;
/* > \brief \b CLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Sc
hur decomposition. */
/* =========== DOCUMENTATION =========== */
/* Online html documentation available at */
/* http://www.netlib.org/lapack/explore-html/ */
/* > \htmlonly */
/* > Download CLAQR4 + dependencies */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claqr4.
f"> */
/* > [TGZ]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claqr4.
f"> */
/* > [ZIP]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claqr4.
f"> */
/* > [TXT]</a> */
/* > \endhtmlonly */
/* Definition: */
/* =========== */
/* SUBROUTINE CLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, */
/* IHIZ, Z, LDZ, WORK, LWORK, INFO ) */
/* INTEGER IHI, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, LWORK, N */
/* LOGICAL WANTT, WANTZ */
/* COMPLEX H( LDH, * ), W( * ), WORK( * ), Z( LDZ, * ) */
/* > \par Purpose: */
/* ============= */
/* > */
/* > \verbatim */
/* > */
/* > CLAQR4 implements one level of recursion for CLAQR0. */
/* > It is a complete implementation of the small bulge multi-shift */
/* > QR algorithm. It may be called by CLAQR0 and, for large enough */
/* > deflation window size, it may be called by CLAQR3. This */
/* > subroutine is identical to CLAQR0 except that it calls CLAQR2 */
/* > instead of CLAQR3. */
/* > */
/* > CLAQR4 computes the eigenvalues of a Hessenberg matrix H */
/* > and, optionally, the matrices T and Z from the Schur decomposition */
/* > H = Z T Z**H, where T is an upper triangular matrix (the */
/* > Schur form), and Z is the unitary matrix of Schur vectors. */
/* > */
/* > Optionally Z may be postmultiplied into an input unitary */
/* > matrix Q so that this routine can give the Schur factorization */
/* > of a matrix A which has been reduced to the Hessenberg form H */
/* > by the unitary matrix Q: A = Q*H*Q**H = (QZ)*H*(QZ)**H. */
/* > \endverbatim */
/* Arguments: */
/* ========== */
/* > \param[in] WANTT */
/* > \verbatim */
/* > WANTT is LOGICAL */
/* > = .TRUE. : the full Schur form T is required; */
/* > = .FALSE.: only eigenvalues are required. */
/* > \endverbatim */
/* > */
/* > \param[in] WANTZ */
/* > \verbatim */
/* > WANTZ is LOGICAL */
/* > = .TRUE. : the matrix of Schur vectors Z is required; */
/* > = .FALSE.: Schur vectors are not required. */
/* > \endverbatim */
/* > */
/* > \param[in] N */
/* > \verbatim */
/* > N is INTEGER */
/* > The order of the matrix H. N >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in] ILO */
/* > \verbatim */
/* > ILO is INTEGER */
/* > \endverbatim */
/* > */
/* > \param[in] IHI */
/* > \verbatim */
/* > IHI is INTEGER */
/* > It is assumed that H is already upper triangular in rows */
/* > and columns 1:ILO-1 and IHI+1:N and, if ILO > 1, */
/* > H(ILO,ILO-1) is zero. ILO and IHI are normally set by a */
/* > previous call to CGEBAL, and then passed to CGEHRD when the */
/* > matrix output by CGEBAL is reduced to Hessenberg form. */
/* > Otherwise, ILO and IHI should be set to 1 and N, */
/* > respectively. If N > 0, then 1 <= ILO <= IHI <= N. */
/* > If N = 0, then ILO = 1 and IHI = 0. */
/* > \endverbatim */
/* > */
/* > \param[in,out] H */
/* > \verbatim */
/* > H is COMPLEX array, dimension (LDH,N) */
/* > On entry, the upper Hessenberg matrix H. */
/* > On exit, if INFO = 0 and WANTT is .TRUE., then H */
/* > contains the upper triangular matrix T from the Schur */
/* > decomposition (the Schur form). If INFO = 0 and WANT is */
/* > .FALSE., then the contents of H are unspecified on exit. */
/* > (The output value of H when INFO > 0 is given under the */
/* > description of INFO below.) */
/* > */
/* > This subroutine may explicitly set H(i,j) = 0 for i > j and */
/* > j = 1, 2, ... ILO-1 or j = IHI+1, IHI+2, ... N. */
/* > \endverbatim */
/* > */
/* > \param[in] LDH */
/* > \verbatim */
/* > LDH is INTEGER */
/* > The leading dimension of the array H. LDH >= f2cmax(1,N). */
/* > \endverbatim */
/* > */
/* > \param[out] W */
/* > \verbatim */
/* > W is COMPLEX array, dimension (N) */
/* > The computed eigenvalues of H(ILO:IHI,ILO:IHI) are stored */
/* > in W(ILO:IHI). If WANTT is .TRUE., then the eigenvalues are */
/* > stored in the same order as on the diagonal of the Schur */
/* > form returned in H, with W(i) = H(i,i). */
/* > \endverbatim */
/* > */
/* > \param[in] ILOZ */
/* > \verbatim */
/* > ILOZ is INTEGER */
/* > \endverbatim */
/* > */
/* > \param[in] IHIZ */
/* > \verbatim */
/* > IHIZ is INTEGER */
/* > Specify the rows of Z to which transformations must be */
/* > applied if WANTZ is .TRUE.. */
/* > 1 <= ILOZ <= ILO; IHI <= IHIZ <= N. */
/* > \endverbatim */
/* > */
/* > \param[in,out] Z */
/* > \verbatim */
/* > Z is COMPLEX array, dimension (LDZ,IHI) */
/* > If WANTZ is .FALSE., then Z is not referenced. */
/* > If WANTZ is .TRUE., then Z(ILO:IHI,ILOZ:IHIZ) is */
/* > replaced by Z(ILO:IHI,ILOZ:IHIZ)*U where U is the */
/* > orthogonal Schur factor of H(ILO:IHI,ILO:IHI). */
/* > (The output value of Z when INFO > 0 is given under */
/* > the description of INFO below.) */
/* > \endverbatim */
/* > */
/* > \param[in] LDZ */
/* > \verbatim */
/* > LDZ is INTEGER */
/* > The leading dimension of the array Z. if WANTZ is .TRUE. */
/* > then LDZ >= MAX(1,IHIZ). Otherwise, LDZ >= 1. */
/* > \endverbatim */
/* > */
/* > \param[out] WORK */
/* > \verbatim */
/* > WORK is COMPLEX array, dimension LWORK */
/* > On exit, if LWORK = -1, WORK(1) returns an estimate of */
/* > the optimal value for LWORK. */
/* > \endverbatim */
/* > */
/* > \param[in] LWORK */
/* > \verbatim */
/* > LWORK is INTEGER */
/* > The dimension of the array WORK. LWORK >= f2cmax(1,N) */
/* > is sufficient, but LWORK typically as large as 6*N may */
/* > be required for optimal performance. A workspace query */
/* > to determine the optimal workspace size is recommended. */
/* > */
/* > If LWORK = -1, then CLAQR4 does a workspace query. */
/* > In this case, CLAQR4 checks the input parameters and */
/* > estimates the optimal workspace size for the given */
/* > values of N, ILO and IHI. The estimate is returned */
/* > in WORK(1). No error message related to LWORK is */
/* > issued by XERBLA. Neither H nor Z are accessed. */
/* > \endverbatim */
/* > */
/* > \param[out] INFO */
/* > \verbatim */
/* > INFO is INTEGER */
/* > = 0: successful exit */
/* > > 0: if INFO = i, CLAQR4 failed to compute all of */
/* > the eigenvalues. Elements 1:ilo-1 and i+1:n of WR */
/* > and WI contain those eigenvalues which have been */
/* > successfully computed. (Failures are rare.) */
/* > */
/* > If INFO > 0 and WANT is .FALSE., then on exit, */
/* > the remaining unconverged eigenvalues are the eigen- */
/* > values of the upper Hessenberg matrix rows and */
/* > columns ILO through INFO of the final, output */
/* > value of H. */
/* > */
/* > If INFO > 0 and WANTT is .TRUE., then on exit */
/* > */
/* > (*) (initial value of H)*U = U*(final value of H) */
/* > */
/* > where U is a unitary matrix. The final */
/* > value of H is upper Hessenberg and triangular in */
/* > rows and columns INFO+1 through IHI. */
/* > */
/* > If INFO > 0 and WANTZ is .TRUE., then on exit */
/* > */
/* > (final value of Z(ILO:IHI,ILOZ:IHIZ) */
/* > = (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U */
/* > */
/* > where U is the unitary matrix in (*) (regard- */
/* > less of the value of WANTT.) */
/* > */
/* > If INFO > 0 and WANTZ is .FALSE., then Z is not */
/* > accessed. */
/* > \endverbatim */
/* Authors: */
/* ======== */
/* > \author Univ. of Tennessee */
/* > \author Univ. of California Berkeley */
/* > \author Univ. of Colorado Denver */
/* > \author NAG Ltd. */
/* > \date June 2017 */
/* > \ingroup complexOTHERauxiliary */
/* > \par Contributors: */
/* ================== */
/* > */
/* > Karen Braman and Ralph Byers, Department of Mathematics, */
/* > University of Kansas, USA */
/* > \par References: */
/* ================ */
/* > */
/* > K. Braman, R. Byers and R. Mathias, The Multi-Shift QR */
/* > Algorithm Part I: Maintaining Well Focused Shifts, and Level 3 */
/* > Performance, SIAM Journal of Matrix Analysis, volume 23, pages */
/* > 929--947, 2002. */
/* > \n */
/* > K. Braman, R. Byers and R. Mathias, The Multi-Shift QR */
/* > Algorithm Part II: Aggressive Early Deflation, SIAM Journal */
/* > of Matrix Analysis, volume 23, pages 948--973, 2002. */
/* > */
/* ===================================================================== */
/* Subroutine */ int claqr4_(logical *wantt, logical *wantz, integer *n,
integer *ilo, integer *ihi, complex *h__, integer *ldh, complex *w,
integer *iloz, integer *ihiz, complex *z__, integer *ldz, complex *
work, integer *lwork, integer *info)
{
/* System generated locals */
integer h_dim1, h_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5;
real r__1, r__2, r__3, r__4, r__5, r__6, r__7, r__8;
complex q__1, q__2, q__3, q__4, q__5;
/* Local variables */
integer ndec, ndfl, kbot, nmin;
complex swap;
integer ktop;
complex zdum[1] /* was [1][1] */;
integer kacc22, i__, k;
real s;
integer itmax, nsmax, nwmax, kwtop;
extern /* Subroutine */ int claqr2_(logical *, logical *, integer *,
integer *, integer *, integer *, complex *, integer *, integer *,
integer *, complex *, integer *, integer *, integer *, complex *,
complex *, integer *, integer *, complex *, integer *, integer *,
complex *, integer *, complex *, integer *), claqr5_(logical *,
logical *, integer *, integer *, integer *, integer *, integer *,
complex *, complex *, integer *, integer *, integer *, complex *,
integer *, complex *, integer *, complex *, integer *, integer *,
complex *, integer *, integer *, complex *, integer *);
complex aa, bb, cc, dd;
integer ld, nh, nibble, it, ks, kt, ku, kv, ls, ns, nw;
extern /* Subroutine */ int clahqr_(logical *, logical *, integer *,
integer *, integer *, complex *, integer *, complex *, integer *,
integer *, complex *, integer *, integer *), clacpy_(char *,
integer *, integer *, complex *, integer *, complex *, integer *);
extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
integer *, integer *, ftnlen, ftnlen);
char jbcmpz[2];
complex rtdisc;
integer nwupbd;
logical sorted;
integer lwkopt;
complex tr2, det;
integer inf, kdu, nho, nve, kwh, nsr, nwr, kwv;
/* -- LAPACK auxiliary routine (version 3.7.1) -- */
/* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
/* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
/* June 2017 */
/* ================================================================ */
/* ==== Matrices of order NTINY or smaller must be processed by */
/* . CLAHQR because of insufficient subdiagonal scratch space. */
/* . (This is a hard limit.) ==== */
/* ==== Exceptional deflation windows: try to cure rare */
/* . slow convergence by varying the size of the */
/* . deflation window after KEXNW iterations. ==== */
/* ==== Exceptional shifts: try to cure rare slow convergence */
/* . with ad-hoc exceptional shifts every KEXSH iterations. */
/* . ==== */
/* ==== The constant WILK1 is used to form the exceptional */
/* . shifts. ==== */
/* Parameter adjustments */
h_dim1 = *ldh;
h_offset = 1 + h_dim1 * 1;
h__ -= h_offset;
--w;
z_dim1 = *ldz;
z_offset = 1 + z_dim1 * 1;
z__ -= z_offset;
--work;
/* Function Body */
*info = 0;
/* ==== Quick return for N = 0: nothing to do. ==== */
if (*n == 0) {
work[1].r = 1.f, work[1].i = 0.f;
return 0;
}
if (*n <= 15) {
/* ==== Tiny matrices must use CLAHQR. ==== */
lwkopt = 1;
if (*lwork != -1) {
clahqr_(wantt, wantz, n, ilo, ihi, &h__[h_offset], ldh, &w[1],
iloz, ihiz, &z__[z_offset], ldz, info);
}
} else {
/* ==== Use small bulge multi-shift QR with aggressive early */
/* . deflation on larger-than-tiny matrices. ==== */
/* ==== Hope for the best. ==== */
*info = 0;
/* ==== Set up job flags for ILAENV. ==== */
if (*wantt) {
*(unsigned char *)jbcmpz = 'S';
} else {
*(unsigned char *)jbcmpz = 'E';
}
if (*wantz) {
*(unsigned char *)&jbcmpz[1] = 'V';
} else {
*(unsigned char *)&jbcmpz[1] = 'N';
}
/* ==== NWR = recommended deflation window size. At this */
/* . point, N .GT. NTINY = 15, so there is enough */
/* . subdiagonal workspace for NWR.GE.2 as required. */
/* . (In fact, there is enough subdiagonal space for */
/* . NWR.GE.4.) ==== */
nwr = ilaenv_(&c__13, "CLAQR4", jbcmpz, n, ilo, ihi, lwork, (ftnlen)6,
(ftnlen)2);
nwr = f2cmax(2,nwr);
/* Computing MIN */
i__1 = *ihi - *ilo + 1, i__2 = (*n - 1) / 3, i__1 = f2cmin(i__1,i__2);
nwr = f2cmin(i__1,nwr);
/* ==== NSR = recommended number of simultaneous shifts. */
/* . At this point N .GT. NTINY = 15, so there is at */
/* . enough subdiagonal workspace for NSR to be even */
/* . and greater than or equal to two as required. ==== */
nsr = ilaenv_(&c__15, "CLAQR4", jbcmpz, n, ilo, ihi, lwork, (ftnlen)6,
(ftnlen)2);
/* Computing MIN */
i__1 = nsr, i__2 = (*n - 3) / 6, i__1 = f2cmin(i__1,i__2), i__2 = *ihi -
*ilo;
nsr = f2cmin(i__1,i__2);
/* Computing MAX */
i__1 = 2, i__2 = nsr - nsr % 2;
nsr = f2cmax(i__1,i__2);
/* ==== Estimate optimal workspace ==== */
/* ==== Workspace query call to CLAQR2 ==== */
i__1 = nwr + 1;
claqr2_(wantt, wantz, n, ilo, ihi, &i__1, &h__[h_offset], ldh, iloz,
ihiz, &z__[z_offset], ldz, &ls, &ld, &w[1], &h__[h_offset],
ldh, n, &h__[h_offset], ldh, n, &h__[h_offset], ldh, &work[1],
&c_n1);
/* ==== Optimal workspace = MAX(CLAQR5, CLAQR2) ==== */
/* Computing MAX */
i__1 = nsr * 3 / 2, i__2 = (integer) work[1].r;
lwkopt = f2cmax(i__1,i__2);
/* ==== Quick return in case of workspace query. ==== */
if (*lwork == -1) {
r__1 = (real) lwkopt;
q__1.r = r__1, q__1.i = 0.f;
work[1].r = q__1.r, work[1].i = q__1.i;
return 0;
}
/* ==== CLAHQR/CLAQR0 crossover point ==== */
nmin = ilaenv_(&c__12, "CLAQR4", jbcmpz, n, ilo, ihi, lwork, (ftnlen)
6, (ftnlen)2);
nmin = f2cmax(15,nmin);
/* ==== Nibble crossover point ==== */
nibble = ilaenv_(&c__14, "CLAQR4", jbcmpz, n, ilo, ihi, lwork, (
ftnlen)6, (ftnlen)2);
nibble = f2cmax(0,nibble);
/* ==== Accumulate reflections during ttswp? Use block */
/* . 2-by-2 structure during matrix-matrix multiply? ==== */
kacc22 = ilaenv_(&c__16, "CLAQR4", jbcmpz, n, ilo, ihi, lwork, (
ftnlen)6, (ftnlen)2);
kacc22 = f2cmax(0,kacc22);
kacc22 = f2cmin(2,kacc22);
/* ==== NWMAX = the largest possible deflation window for */
/* . which there is sufficient workspace. ==== */
/* Computing MIN */
i__1 = (*n - 1) / 3, i__2 = *lwork / 2;
nwmax = f2cmin(i__1,i__2);
nw = nwmax;
/* ==== NSMAX = the Largest number of simultaneous shifts */
/* . for which there is sufficient workspace. ==== */
/* Computing MIN */
i__1 = (*n - 3) / 6, i__2 = (*lwork << 1) / 3;
nsmax = f2cmin(i__1,i__2);
nsmax -= nsmax % 2;
/* ==== NDFL: an iteration count restarted at deflation. ==== */
ndfl = 1;
/* ==== ITMAX = iteration limit ==== */
/* Computing MAX */
i__1 = 10, i__2 = *ihi - *ilo + 1;
itmax = 30 * f2cmax(i__1,i__2);
/* ==== Last row and column in the active block ==== */
kbot = *ihi;
/* ==== Main Loop ==== */
i__1 = itmax;
for (it = 1; it <= i__1; ++it) {
/* ==== Done when KBOT falls below ILO ==== */
if (kbot < *ilo) {
goto L80;
}
/* ==== Locate active block ==== */
i__2 = *ilo + 1;
for (k = kbot; k >= i__2; --k) {
i__3 = k + (k - 1) * h_dim1;
if (h__[i__3].r == 0.f && h__[i__3].i == 0.f) {
goto L20;
}
/* L10: */
}
k = *ilo;
L20:
ktop = k;
/* ==== Select deflation window size: */
/* . Typical Case: */
/* . If possible and advisable, nibble the entire */
/* . active block. If not, use size MIN(NWR,NWMAX) */
/* . or MIN(NWR+1,NWMAX) depending upon which has */
/* . the smaller corresponding subdiagonal entry */
/* . (a heuristic). */
/* . */
/* . Exceptional Case: */
/* . If there have been no deflations in KEXNW or */
/* . more iterations, then vary the deflation window */
/* . size. At first, because, larger windows are, */
/* . in general, more powerful than smaller ones, */
/* . rapidly increase the window to the maximum possible. */
/* . Then, gradually reduce the window size. ==== */
nh = kbot - ktop + 1;
nwupbd = f2cmin(nh,nwmax);
if (ndfl < 5) {
nw = f2cmin(nwupbd,nwr);
} else {
/* Computing MIN */
i__2 = nwupbd, i__3 = nw << 1;
nw = f2cmin(i__2,i__3);
}
if (nw < nwmax) {
if (nw >= nh - 1) {
nw = nh;
} else {
kwtop = kbot - nw + 1;
i__2 = kwtop + (kwtop - 1) * h_dim1;
i__3 = kwtop - 1 + (kwtop - 2) * h_dim1;
if ((r__1 = h__[i__2].r, abs(r__1)) + (r__2 = r_imag(&h__[
kwtop + (kwtop - 1) * h_dim1]), abs(r__2)) > (
r__3 = h__[i__3].r, abs(r__3)) + (r__4 = r_imag(&
h__[kwtop - 1 + (kwtop - 2) * h_dim1]), abs(r__4))
) {
++nw;
}
}
}
if (ndfl < 5) {
ndec = -1;
} else if (ndec >= 0 || nw >= nwupbd) {
++ndec;
if (nw - ndec < 2) {
ndec = 0;
}
nw -= ndec;
}
/* ==== Aggressive early deflation: */
/* . split workspace under the subdiagonal into */
/* . - an nw-by-nw work array V in the lower */
/* . left-hand-corner, */
/* . - an NW-by-at-least-NW-but-more-is-better */
/* . (NW-by-NHO) horizontal work array along */
/* . the bottom edge, */
/* . - an at-least-NW-but-more-is-better (NHV-by-NW) */
/* . vertical work array along the left-hand-edge. */
/* . ==== */
kv = *n - nw + 1;
kt = nw + 1;
nho = *n - nw - 1 - kt + 1;
kwv = nw + 2;
nve = *n - nw - kwv + 1;
/* ==== Aggressive early deflation ==== */
claqr2_(wantt, wantz, n, &ktop, &kbot, &nw, &h__[h_offset], ldh,
iloz, ihiz, &z__[z_offset], ldz, &ls, &ld, &w[1], &h__[kv
+ h_dim1], ldh, &nho, &h__[kv + kt * h_dim1], ldh, &nve, &
h__[kwv + h_dim1], ldh, &work[1], lwork);
/* ==== Adjust KBOT accounting for new deflations. ==== */
kbot -= ld;
/* ==== KS points to the shifts. ==== */
ks = kbot - ls + 1;
/* ==== Skip an expensive QR sweep if there is a (partly */
/* . heuristic) reason to expect that many eigenvalues */
/* . will deflate without it. Here, the QR sweep is */
/* . skipped if many eigenvalues have just been deflated */
/* . or if the remaining active block is small. */
if (ld == 0 || ld * 100 <= nw * nibble && kbot - ktop + 1 > f2cmin(
nmin,nwmax)) {
/* ==== NS = nominal number of simultaneous shifts. */
/* . This may be lowered (slightly) if CLAQR2 */
/* . did not provide that many shifts. ==== */
/* Computing MIN */
/* Computing MAX */
i__4 = 2, i__5 = kbot - ktop;
i__2 = f2cmin(nsmax,nsr), i__3 = f2cmax(i__4,i__5);
ns = f2cmin(i__2,i__3);
ns -= ns % 2;
/* ==== If there have been no deflations */
/* . in a multiple of KEXSH iterations, */
/* . then try exceptional shifts. */
/* . Otherwise use shifts provided by */
/* . CLAQR2 above or from the eigenvalues */
/* . of a trailing principal submatrix. ==== */
if (ndfl % 6 == 0) {
ks = kbot - ns + 1;
i__2 = ks + 1;
for (i__ = kbot; i__ >= i__2; i__ += -2) {
i__3 = i__;
i__4 = i__ + i__ * h_dim1;
i__5 = i__ + (i__ - 1) * h_dim1;
r__3 = ((r__1 = h__[i__5].r, abs(r__1)) + (r__2 =
r_imag(&h__[i__ + (i__ - 1) * h_dim1]), abs(
r__2))) * .75f;
q__1.r = h__[i__4].r + r__3, q__1.i = h__[i__4].i;
w[i__3].r = q__1.r, w[i__3].i = q__1.i;
i__3 = i__ - 1;
i__4 = i__;
w[i__3].r = w[i__4].r, w[i__3].i = w[i__4].i;
/* L30: */
}
} else {
/* ==== Got NS/2 or fewer shifts? Use CLAHQR */
/* . on a trailing principal submatrix to */
/* . get more. (Since NS.LE.NSMAX.LE.(N-3)/6, */
/* . there is enough space below the subdiagonal */
/* . to fit an NS-by-NS scratch array.) ==== */
if (kbot - ks + 1 <= ns / 2) {
ks = kbot - ns + 1;
kt = *n - ns + 1;
clacpy_("A", &ns, &ns, &h__[ks + ks * h_dim1], ldh, &
h__[kt + h_dim1], ldh);
clahqr_(&c_false, &c_false, &ns, &c__1, &ns, &h__[kt
+ h_dim1], ldh, &w[ks], &c__1, &c__1, zdum, &
c__1, &inf);
ks += inf;
/* ==== In case of a rare QR failure use */
/* . eigenvalues of the trailing 2-by-2 */
/* . principal submatrix. Scale to avoid */
/* . overflows, underflows and subnormals. */
/* . (The scale factor S can not be zero, */
/* . because H(KBOT,KBOT-1) is nonzero.) ==== */
if (ks >= kbot) {
i__2 = kbot - 1 + (kbot - 1) * h_dim1;
i__3 = kbot + (kbot - 1) * h_dim1;
i__4 = kbot - 1 + kbot * h_dim1;
i__5 = kbot + kbot * h_dim1;
s = (r__1 = h__[i__2].r, abs(r__1)) + (r__2 =
r_imag(&h__[kbot - 1 + (kbot - 1) *
h_dim1]), abs(r__2)) + ((r__3 = h__[i__3]
.r, abs(r__3)) + (r__4 = r_imag(&h__[kbot
+ (kbot - 1) * h_dim1]), abs(r__4))) + ((
r__5 = h__[i__4].r, abs(r__5)) + (r__6 =
r_imag(&h__[kbot - 1 + kbot * h_dim1]),
abs(r__6))) + ((r__7 = h__[i__5].r, abs(
r__7)) + (r__8 = r_imag(&h__[kbot + kbot *
h_dim1]), abs(r__8)));
i__2 = kbot - 1 + (kbot - 1) * h_dim1;
q__1.r = h__[i__2].r / s, q__1.i = h__[i__2].i /
s;
aa.r = q__1.r, aa.i = q__1.i;
i__2 = kbot + (kbot - 1) * h_dim1;
q__1.r = h__[i__2].r / s, q__1.i = h__[i__2].i /
s;
cc.r = q__1.r, cc.i = q__1.i;
i__2 = kbot - 1 + kbot * h_dim1;
q__1.r = h__[i__2].r / s, q__1.i = h__[i__2].i /
s;
bb.r = q__1.r, bb.i = q__1.i;
i__2 = kbot + kbot * h_dim1;
q__1.r = h__[i__2].r / s, q__1.i = h__[i__2].i /
s;
dd.r = q__1.r, dd.i = q__1.i;
q__2.r = aa.r + dd.r, q__2.i = aa.i + dd.i;
q__1.r = q__2.r / 2.f, q__1.i = q__2.i / 2.f;
tr2.r = q__1.r, tr2.i = q__1.i;
q__3.r = aa.r - tr2.r, q__3.i = aa.i - tr2.i;
q__4.r = dd.r - tr2.r, q__4.i = dd.i - tr2.i;
q__2.r = q__3.r * q__4.r - q__3.i * q__4.i,
q__2.i = q__3.r * q__4.i + q__3.i *
q__4.r;
q__5.r = bb.r * cc.r - bb.i * cc.i, q__5.i = bb.r
* cc.i + bb.i * cc.r;
q__1.r = q__2.r - q__5.r, q__1.i = q__2.i -
q__5.i;
det.r = q__1.r, det.i = q__1.i;
q__2.r = -det.r, q__2.i = -det.i;
c_sqrt(&q__1, &q__2);
rtdisc.r = q__1.r, rtdisc.i = q__1.i;
i__2 = kbot - 1;
q__2.r = tr2.r + rtdisc.r, q__2.i = tr2.i +
rtdisc.i;
q__1.r = s * q__2.r, q__1.i = s * q__2.i;
w[i__2].r = q__1.r, w[i__2].i = q__1.i;
i__2 = kbot;
q__2.r = tr2.r - rtdisc.r, q__2.i = tr2.i -
rtdisc.i;
q__1.r = s * q__2.r, q__1.i = s * q__2.i;
w[i__2].r = q__1.r, w[i__2].i = q__1.i;
ks = kbot - 1;
}
}
if (kbot - ks + 1 > ns) {
/* ==== Sort the shifts (Helps a little) ==== */
sorted = FALSE_;
i__2 = ks + 1;
for (k = kbot; k >= i__2; --k) {
if (sorted) {
goto L60;
}
sorted = TRUE_;
i__3 = k - 1;
for (i__ = ks; i__ <= i__3; ++i__) {
i__4 = i__;
i__5 = i__ + 1;
if ((r__1 = w[i__4].r, abs(r__1)) + (r__2 =
r_imag(&w[i__]), abs(r__2)) < (r__3 =
w[i__5].r, abs(r__3)) + (r__4 =
r_imag(&w[i__ + 1]), abs(r__4))) {
sorted = FALSE_;
i__4 = i__;
swap.r = w[i__4].r, swap.i = w[i__4].i;
i__4 = i__;
i__5 = i__ + 1;
w[i__4].r = w[i__5].r, w[i__4].i = w[i__5]
.i;
i__4 = i__ + 1;
w[i__4].r = swap.r, w[i__4].i = swap.i;
}
/* L40: */
}
/* L50: */
}
L60:
;
}
}
/* ==== If there are only two shifts, then use */
/* . only one. ==== */
if (kbot - ks + 1 == 2) {
i__2 = kbot;
i__3 = kbot + kbot * h_dim1;
q__2.r = w[i__2].r - h__[i__3].r, q__2.i = w[i__2].i -
h__[i__3].i;
q__1.r = q__2.r, q__1.i = q__2.i;
i__4 = kbot - 1;
i__5 = kbot + kbot * h_dim1;
q__4.r = w[i__4].r - h__[i__5].r, q__4.i = w[i__4].i -
h__[i__5].i;
q__3.r = q__4.r, q__3.i = q__4.i;
if ((r__1 = q__1.r, abs(r__1)) + (r__2 = r_imag(&q__1),
abs(r__2)) < (r__3 = q__3.r, abs(r__3)) + (r__4 =
r_imag(&q__3), abs(r__4))) {
i__2 = kbot - 1;
i__3 = kbot;
w[i__2].r = w[i__3].r, w[i__2].i = w[i__3].i;
} else {
i__2 = kbot;
i__3 = kbot - 1;
w[i__2].r = w[i__3].r, w[i__2].i = w[i__3].i;
}
}
/* ==== Use up to NS of the the smallest magnitude */
/* . shifts. If there aren't NS shifts available, */
/* . then use them all, possibly dropping one to */
/* . make the number of shifts even. ==== */
/* Computing MIN */
i__2 = ns, i__3 = kbot - ks + 1;
ns = f2cmin(i__2,i__3);
ns -= ns % 2;
ks = kbot - ns + 1;
/* ==== Small-bulge multi-shift QR sweep: */
/* . split workspace under the subdiagonal into */
/* . - a KDU-by-KDU work array U in the lower */
/* . left-hand-corner, */
/* . - a KDU-by-at-least-KDU-but-more-is-better */
/* . (KDU-by-NHo) horizontal work array WH along */
/* . the bottom edge, */
/* . - and an at-least-KDU-but-more-is-better-by-KDU */
/* . (NVE-by-KDU) vertical work WV arrow along */
/* . the left-hand-edge. ==== */
kdu = ns << 1;
ku = *n - kdu + 1;
kwh = kdu + 1;
nho = *n - kdu - 3 - (kdu + 1) + 1;
kwv = kdu + 4;
nve = *n - kdu - kwv + 1;
/* ==== Small-bulge multi-shift QR sweep ==== */
claqr5_(wantt, wantz, &kacc22, n, &ktop, &kbot, &ns, &w[ks], &
h__[h_offset], ldh, iloz, ihiz, &z__[z_offset], ldz, &
work[1], &c__3, &h__[ku + h_dim1], ldh, &nve, &h__[
kwv + h_dim1], ldh, &nho, &h__[ku + kwh * h_dim1],
ldh);
}
/* ==== Note progress (or the lack of it). ==== */
if (ld > 0) {
ndfl = 1;
} else {
++ndfl;
}
/* ==== End of main loop ==== */
/* L70: */
}
/* ==== Iteration limit exceeded. Set INFO to show where */
/* . the problem occurred and exit. ==== */
*info = kbot;
L80:
;
}
/* ==== Return the optimal value of LWORK. ==== */
r__1 = (real) lwkopt;
q__1.r = r__1, q__1.i = 0.f;
work[1].r = q__1.r, work[1].i = q__1.i;
/* ==== End of CLAQR4 ==== */
return 0;
} /* claqr4_ */
|
the_stack_data/307258.c | /*Exercise 3 - Repetition
Write a C program to calculate the sum of the numbers from 1 to n.
Where n is a keyboard input.
e.g.
n -> 100
sum = 1+2+3+....+ 99+100 = 5050
n -> 1-
sum = 1+2+3+...+10 = 55 */
#include <stdio.h>
int main()
{
int n;//Number
int sum=0;
int count=1;
printf("Enter Numbers:\n");
scanf("%d" ,&n);
while(count<=n)
{
sum=sum+count;
count=count+1;
}
printf("The sum of the numbers are: %d" ,sum);
return 0;
}
|
the_stack_data/61074475.c | /* { dg-do compile } */
/* { dg-options "-O3 -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-sra -fno-ipa-cp" } */
typedef struct S
{
int add_offset;
int (*call)(int);
} S;
static int
bar (const S *f, int x)
{
x = f->call(x);
return x;
}
static int
thisisthetarget (int x)
{
return x * x;
}
static const S s = {16, thisisthetarget};
int
outerfunction (int x)
{
return bar (&s, x);
}
int
obfuscate (int x)
{
return bar ((S *) 0, x);
}
/* { dg-final { scan-ipa-dump "thisisthetarget\[^\\n\]*inline copy in outerfunction" "inline" } } */
|
the_stack_data/89433.c | #include <stdio.h>
#define size 5
void insertq(int[], int);
void deleteq(int[]);
void display(int[]);
int front = - 1;
int rear = - 1;
int main()
{
int n, ch;
int queue[size];
do
{
printf("\n\n Circular Queue:\n1. Insert \n2. Delete\n3. Display\n0. Exit");
printf("\nEnter Choice 0-3? : ");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("\nEnter number: ");
scanf("%d", &n);
insertq(queue, n);
break;
case 2:
deleteq(queue);
break;
case 3:
display(queue);
break;
}
}while (ch != 0);
}
void insertq(int queue[], int item)
{
if ((front == 0 && rear == size - 1) || (front == rear + 1))
{
printf("queue is full");
return;
}
else if (rear == - 1) //Queue is Empty
{
rear++;
front++;
}
else if (rear == size - 1 && front > 0)
{
rear = 0;
}
else
{
rear++;
}
queue[rear] = item;
}
void display(int queue[])
{
int i;
printf("\n");
if (front > rear)
{
for (i = front; i < size; i++)
{
printf("%d ", queue[i]);
}
for (i = 0; i <= rear; i++)
printf("%d ", queue[i]);
}
else
{
for (i = front; i <= rear; i++)
printf("%d ", queue[i]);
}
}
void deleteq(int queue[])
{
if (front == - 1) //Queue is empty
{
printf("Queue is empty ");
}
else if (front == rear) //Only 1 element present
{
printf("\n %d deleted", queue[front]);
front = - 1;
rear = - 1;
}
else
{
printf("\n %d deleted", queue[front]);
front++;
}
} |
the_stack_data/175143770.c | extern int *glob;
void foo(void) { *glob = 2; }
|
the_stack_data/1016760.c | /*
* Initial implementation:
* Copyright (c) 2002 Robert Drehmel
* All rights reserved.
*
* As long as the above copyright statement and this notice remain
* unchanged, you can do what ever you want with this file.
*
* $FreeBSD: src/lib/libc/stdlib/lsearch.c,v 1.1 2002/10/16 14:29:22 robert Exp $
* $DragonFly: src/lib/libc/stdlib/lsearch.c,v 1.1 2008/05/19 10:06:34 corecode Exp $
*/
#include <sys/types.h>
#define _SEARCH_PRIVATE
#include <search.h>
#include <stdint.h> /* for uint8_t */
#include <stdlib.h> /* for NULL */
#include <string.h> /* for memcpy() prototype */
static void *lwork(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *), int);
void *lsearch(const void *key, void *base, size_t *nelp, size_t width,
int (*compar)(const void *, const void *))
{
return (lwork(key, base, nelp, width, compar, 1));
}
void *lfind(const void *key, const void *base, size_t *nelp, size_t width,
int (*compar)(const void *, const void *))
{
return (lwork(key, base, nelp, width, compar, 0));
}
static void *
lwork(const void *key, const void *base, size_t *nelp, size_t width,
int (*compar)(const void *, const void *), int addelem)
{
uint8_t *ep, *endp;
/*
* Cast to an integer value first to avoid the warning for removing
* 'const' via a cast.
*/
ep = (uint8_t *)(uintptr_t)base;
for (endp = (uint8_t *)(ep + width * *nelp); ep < endp; ep += width) {
if (compar(key, ep) == 0)
return (ep);
}
/* lfind() shall return when the key was not found. */
if (!addelem)
return (NULL);
/*
* lsearch() adds the key to the end of the table and increments
* the number of elements.
*/
memcpy(endp, key, width);
++*nelp;
return (endp);
}
|
the_stack_data/237643777.c | #include "stdio.h"
int x = 2;
int y = 3;
int z = 1;
int r;
int main() {
if (x > y)
{
if (x > z)
r = x;
else
r = z;
} else {
if (y > z)
r = y;
else
r = z;
}
printf("%d\n", r);
r;
return 0;
}
|
the_stack_data/76039.c | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[])
{
uint8_t* mallocme, *mallocme2, *mallocme3;
fprintf(stdout, "-- malloc test by Wolfgang Richter <[email protected]> --"
"\n");
mallocme = malloc(4096);
mallocme2 = malloc(4096);
mallocme3 = malloc(4096);
memset(mallocme, 0, 4096);
memset(mallocme2, 0xff, 4096);
memset(mallocme3, 0xee, 4096);
free(mallocme);
free(mallocme2);
free(mallocme3);
mallocme = malloc(4096);
mallocme2 = malloc(4096);
mallocme3 = malloc(4096);
memset(mallocme, 0, 4096);
memset(mallocme2, 0xff, 4096);
memset(mallocme3, 0xee, 4096);
free(mallocme3);
free(mallocme2);
free(mallocme);
return EXIT_SUCCESS;
}
|
the_stack_data/9678.c | /* Check that MAX_EXPR and MIN_EXPR are working properly. */
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
extern void abort (void);
int main()
{
int ll_bitsize, ll_bitpos;
int rl_bitsize, rl_bitpos;
int end_bit;
ll_bitpos = 32; ll_bitsize = 32;
rl_bitpos = 0; rl_bitsize = 32;
end_bit = MAX (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize);
if (end_bit != 64)
abort ();
end_bit = MAX (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize);
if (end_bit != 64)
abort ();
end_bit = MIN (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize);
if (end_bit != 32)
abort ();
end_bit = MIN (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize);
if (end_bit != 32)
abort ();
return 0;
}
|
the_stack_data/150142817.c | #if defined(CONFIG_DRM_AMD_DC_DSC_SUPPORT)
/*
* Copyright 2012-17 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "os_types.h"
#include <drm/drm_dsc.h>
#include "dscc_types.h"
#include "rc_calc.h"
static void copy_pps_fields(struct drm_dsc_config *to, const struct drm_dsc_config *from)
{
to->line_buf_depth = from->line_buf_depth;
to->bits_per_component = from->bits_per_component;
to->convert_rgb = from->convert_rgb;
to->slice_width = from->slice_width;
to->slice_height = from->slice_height;
to->simple_422 = from->simple_422;
to->native_422 = from->native_422;
to->native_420 = from->native_420;
to->pic_width = from->pic_width;
to->pic_height = from->pic_height;
to->rc_tgt_offset_high = from->rc_tgt_offset_high;
to->rc_tgt_offset_low = from->rc_tgt_offset_low;
to->bits_per_pixel = from->bits_per_pixel;
to->rc_edge_factor = from->rc_edge_factor;
to->rc_quant_incr_limit1 = from->rc_quant_incr_limit1;
to->rc_quant_incr_limit0 = from->rc_quant_incr_limit0;
to->initial_xmit_delay = from->initial_xmit_delay;
to->initial_dec_delay = from->initial_dec_delay;
to->block_pred_enable = from->block_pred_enable;
to->first_line_bpg_offset = from->first_line_bpg_offset;
to->second_line_bpg_offset = from->second_line_bpg_offset;
to->initial_offset = from->initial_offset;
memcpy(&to->rc_buf_thresh, &from->rc_buf_thresh, sizeof(from->rc_buf_thresh));
memcpy(&to->rc_range_params, &from->rc_range_params, sizeof(from->rc_range_params));
to->rc_model_size = from->rc_model_size;
to->flatness_min_qp = from->flatness_min_qp;
to->flatness_max_qp = from->flatness_max_qp;
to->initial_scale_value = from->initial_scale_value;
to->scale_decrement_interval = from->scale_decrement_interval;
to->scale_increment_interval = from->scale_increment_interval;
to->nfl_bpg_offset = from->nfl_bpg_offset;
to->nsl_bpg_offset = from->nsl_bpg_offset;
to->slice_bpg_offset = from->slice_bpg_offset;
to->final_offset = from->final_offset;
to->vbr_enable = from->vbr_enable;
to->slice_chunk_size = from->slice_chunk_size;
to->second_line_offset_adj = from->second_line_offset_adj;
to->dsc_version_minor = from->dsc_version_minor;
}
static void copy_rc_to_cfg(struct drm_dsc_config *dsc_cfg, const struct rc_params *rc)
{
int i;
dsc_cfg->rc_quant_incr_limit0 = rc->rc_quant_incr_limit0;
dsc_cfg->rc_quant_incr_limit1 = rc->rc_quant_incr_limit1;
dsc_cfg->initial_offset = rc->initial_fullness_offset;
dsc_cfg->initial_xmit_delay = rc->initial_xmit_delay;
dsc_cfg->first_line_bpg_offset = rc->first_line_bpg_offset;
dsc_cfg->second_line_bpg_offset = rc->second_line_bpg_offset;
dsc_cfg->flatness_min_qp = rc->flatness_min_qp;
dsc_cfg->flatness_max_qp = rc->flatness_max_qp;
for (i = 0; i < QP_SET_SIZE; ++i) {
dsc_cfg->rc_range_params[i].range_min_qp = rc->qp_min[i];
dsc_cfg->rc_range_params[i].range_max_qp = rc->qp_max[i];
/* Truncate 8-bit signed value to 6-bit signed value */
dsc_cfg->rc_range_params[i].range_bpg_offset = 0x3f & rc->ofs[i];
}
dsc_cfg->rc_model_size = rc->rc_model_size;
dsc_cfg->rc_edge_factor = rc->rc_edge_factor;
dsc_cfg->rc_tgt_offset_high = rc->rc_tgt_offset_hi;
dsc_cfg->rc_tgt_offset_low = rc->rc_tgt_offset_lo;
for (i = 0; i < QP_SET_SIZE - 1; ++i)
dsc_cfg->rc_buf_thresh[i] = rc->rc_buf_thresh[i];
}
int dscc_compute_dsc_parameters(const struct drm_dsc_config *pps, struct dsc_parameters *dsc_params)
{
int ret;
struct rc_params rc;
struct drm_dsc_config dsc_cfg;
dsc_params->bytes_per_pixel = calc_dsc_bytes_per_pixel(pps);
calc_rc_params(&rc, pps);
dsc_params->pps = *pps;
dsc_params->pps.initial_scale_value = 8 * rc.rc_model_size / (rc.rc_model_size - rc.initial_fullness_offset);
copy_pps_fields(&dsc_cfg, &dsc_params->pps);
copy_rc_to_cfg(&dsc_cfg, &rc);
dsc_cfg.mux_word_size = dsc_params->pps.bits_per_component <= 10 ? 48 : 64;
ret = drm_dsc_compute_rc_parameters(&dsc_cfg);
copy_pps_fields(&dsc_params->pps, &dsc_cfg);
dsc_params->rc_buffer_model_size = dsc_cfg.rc_bits;
return ret;
}
#endif
|
the_stack_data/212642810.c | void foo (int x, int c, char h);
int f(void) {
return 0;
}
int x = 3;
// int deklaracijaBezDefinicije(int x); // deklaracija bez definicije
int main(void) {
int a = 5;
const char c = 'i';
int niz[3];
void foo (int x, int c, char h);
int x = 5;
int y = x + 1;
a = a+3;
if (a > 2)
{
int a;
int b;
a = b;
x = 4;
}
return f();
}
int fact(int bzvz);
void foo (int x, int c, char h) {
int i = fact(x);
int a = a+1;
void foo3 (void);
int niz1[5] = { 1, 2, 3 };
// int niz[10] = a; // ne smije s desne strane biti niz, moze jedino biti konstantni niz
for (i = 0; i < 5; i++)
break;
while(1)
{
break;
i = i + 2;
}
// return 5; // vraca int a treba vracati void
return;
// break; // break izvan petlje
}
char proba3(void) {
x = 4; // globalni x;
if (0)
{
x = 6; // globalni x;
return 'a';
} else {
return (char)97;
// return 97; // int se ne moze implicitno u char castati
}
}
char proba(void) {
return (char)97;
}
int proba2(void) {
// i = 5; // nije deklarirano
return 'a';
}
int fact(int n) {
foo(1,2,'h');
if (n > 0)
return n * fact(n-1);
else
return 1;
}
void foo3(void) {
int i = 8;
// main2(); // funkcija main2 je definirana tek kasnije, a nema deklaracije prije koja bi popravila ovu gresku
return;
}
void f2(int x, int a[]){
x = x + 1;
a[0] = a[0] + 1;
}
/*
int f2(int y) // vec postoji definicija funkcije s istim imenom
{
return 5;
}
*/
// char f2; // vec postoji funkcija s istim imenom
int main2(void) {
int x = 2147483647, y;
// int a = 2147483648; // nije u rasponu int-a
(int)'a';
(const char)x;
(const int)'a';
(char)((const int)300 + (int)'a');
(int)(char)(const int)(const char)(x + y);
return 0;
}
|
the_stack_data/1100659.c | /**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#include <math.h>
float sinhf (float x)
{
return (float) sinh (x);
}
|
the_stack_data/170453312.c | #include <stdio.h>
#include <stdlib.h>
//
// Shift tests
//
int main(int argc, char *argv[]) {
unsigned b = 1;
printf("b = 0x%x\n", b);
for (int i = 0; i < 31; i++) {
unsigned a = b << i;
printf("b << 0x%x = 0x%x\n", i, a);
}
b <<= 16;
printf("b <<= 16 = 0x%x\n", b);
b = 0xFFFFFFFF;
printf("b = 0x%x\n", b);
for (int i = 0; i < 31; i++) {
unsigned a = b >> i;
printf("b >> 0x%x = 0x%x\n", i, a);
}
b >>= 16;
printf("b >>= 16 = 0x%x\n", b);
int c = 1;
printf("c = %i\n", c);
for (int i = 0; i < 31; i++) {
unsigned a = c << i;
printf("c << %i = %i\n", i, a);
}
c <<= 16;
printf("c <<= 16 = %i\n", c);
c = 0xFFFFFFFF;
printf("c = %i\n", c);
for (int i = 0; i < 31; i++) {
unsigned a = c >> i;
printf("c >> %i = %i\n", i, a);
}
b >>= 16;
printf("b >>= 16 = %i\n", b);
return 0;
}
|
the_stack_data/167331468.c | // INFO: suspicious RCU usage in fib6_del
// https://syzkaller.appspot.com/bug?id=37b4e066c212c4f2a6d9f5fe49d6d53e0a7e848b
// status:open
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <arpa/inet.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <sched.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <linux/if_addr.h>
#include <linux/if_ether.h>
#include <linux/if_link.h>
#include <linux/if_tun.h>
#include <linux/in6.h>
#include <linux/ip.h>
#include <linux/neighbour.h>
#include <linux/net.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/tcp.h>
#include <linux/veth.h>
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
static struct {
char* pos;
int nesting;
struct nlattr* nested[8];
char buf[1024];
} nlmsg;
static void netlink_init(int typ, int flags, const void* data, int size)
{
memset(&nlmsg, 0, sizeof(nlmsg));
struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg.buf;
hdr->nlmsg_type = typ;
hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
memcpy(hdr + 1, data, size);
nlmsg.pos = (char*)(hdr + 1) + NLMSG_ALIGN(size);
}
static void netlink_attr(int typ, const void* data, int size)
{
struct nlattr* attr = (struct nlattr*)nlmsg.pos;
attr->nla_len = sizeof(*attr) + size;
attr->nla_type = typ;
memcpy(attr + 1, data, size);
nlmsg.pos += NLMSG_ALIGN(attr->nla_len);
}
static int netlink_send(int sock)
{
if (nlmsg.pos > nlmsg.buf + sizeof(nlmsg.buf) || nlmsg.nesting)
exit(1);
struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg.buf;
hdr->nlmsg_len = nlmsg.pos - nlmsg.buf;
struct sockaddr_nl addr;
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
unsigned n = sendto(sock, nlmsg.buf, hdr->nlmsg_len, 0,
(struct sockaddr*)&addr, sizeof(addr));
if (n != hdr->nlmsg_len)
exit(1);
n = recv(sock, nlmsg.buf, sizeof(nlmsg.buf), 0);
if (n < sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))
exit(1);
if (hdr->nlmsg_type != NLMSG_ERROR)
exit(1);
return -((struct nlmsgerr*)(hdr + 1))->error;
}
static void netlink_device_change(int sock, const char* name, bool up,
const char* master, const void* mac,
int macsize)
{
struct ifinfomsg hdr;
memset(&hdr, 0, sizeof(hdr));
if (up)
hdr.ifi_flags = hdr.ifi_change = IFF_UP;
netlink_init(RTM_NEWLINK, 0, &hdr, sizeof(hdr));
netlink_attr(IFLA_IFNAME, name, strlen(name));
if (master) {
int ifindex = if_nametoindex(master);
netlink_attr(IFLA_MASTER, &ifindex, sizeof(ifindex));
}
if (macsize)
netlink_attr(IFLA_ADDRESS, mac, macsize);
int err = netlink_send(sock);
(void)err;
}
static int netlink_add_addr(int sock, const char* dev, const void* addr,
int addrsize)
{
struct ifaddrmsg hdr;
memset(&hdr, 0, sizeof(hdr));
hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6;
hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120;
hdr.ifa_scope = RT_SCOPE_UNIVERSE;
hdr.ifa_index = if_nametoindex(dev);
netlink_init(RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr));
netlink_attr(IFA_LOCAL, addr, addrsize);
netlink_attr(IFA_ADDRESS, addr, addrsize);
return netlink_send(sock);
}
static void netlink_add_addr4(int sock, const char* dev, const char* addr)
{
struct in_addr in_addr;
inet_pton(AF_INET, addr, &in_addr);
int err = netlink_add_addr(sock, dev, &in_addr, sizeof(in_addr));
(void)err;
}
static void netlink_add_addr6(int sock, const char* dev, const char* addr)
{
struct in6_addr in6_addr;
inet_pton(AF_INET6, addr, &in6_addr);
int err = netlink_add_addr(sock, dev, &in6_addr, sizeof(in6_addr));
(void)err;
}
static void netlink_add_neigh(int sock, const char* name, const void* addr,
int addrsize, const void* mac, int macsize)
{
struct ndmsg hdr;
memset(&hdr, 0, sizeof(hdr));
hdr.ndm_family = addrsize == 4 ? AF_INET : AF_INET6;
hdr.ndm_ifindex = if_nametoindex(name);
hdr.ndm_state = NUD_PERMANENT;
netlink_init(RTM_NEWNEIGH, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr));
netlink_attr(NDA_DST, addr, addrsize);
netlink_attr(NDA_LLADDR, mac, macsize);
int err = netlink_send(sock);
(void)err;
}
static int tunfd = -1;
static int tun_frags_enabled;
#define SYZ_TUN_MAX_PACKET_SIZE 1000
#define TUN_IFACE "syz_tun"
#define LOCAL_MAC 0xaaaaaaaaaaaa
#define REMOTE_MAC 0xaaaaaaaaaabb
#define LOCAL_IPV4 "172.20.20.170"
#define REMOTE_IPV4 "172.20.20.187"
#define LOCAL_IPV6 "fe80::aa"
#define REMOTE_IPV6 "fe80::bb"
#define IFF_NAPI 0x0010
#define IFF_NAPI_FRAGS 0x0020
static void initialize_tun(void)
{
tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK);
if (tunfd == -1) {
printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n");
printf("otherwise fuzzing or reproducing might not work as intended\n");
return;
}
const int kTunFd = 240;
if (dup2(tunfd, kTunFd) < 0)
exit(1);
close(tunfd);
tunfd = kTunFd;
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ);
ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS;
if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) {
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0)
exit(1);
}
if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0)
exit(1);
tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0;
char sysctl[64];
sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/accept_dad", TUN_IFACE);
write_file(sysctl, "0");
sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/router_solicitations", TUN_IFACE);
write_file(sysctl, "0");
int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sock == -1)
exit(1);
netlink_add_addr4(sock, TUN_IFACE, LOCAL_IPV4);
netlink_add_addr6(sock, TUN_IFACE, LOCAL_IPV6);
uint64_t macaddr = REMOTE_MAC;
struct in_addr in_addr;
inet_pton(AF_INET, REMOTE_IPV4, &in_addr);
netlink_add_neigh(sock, TUN_IFACE, &in_addr, sizeof(in_addr), &macaddr,
ETH_ALEN);
struct in6_addr in6_addr;
inet_pton(AF_INET6, REMOTE_IPV6, &in6_addr);
netlink_add_neigh(sock, TUN_IFACE, &in6_addr, sizeof(in6_addr), &macaddr,
ETH_ALEN);
macaddr = LOCAL_MAC;
netlink_device_change(sock, TUN_IFACE, true, 0, &macaddr, ETH_ALEN);
close(sock);
}
static void setup_common()
{
if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) {
}
}
static void loop();
static void sandbox_common()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
setsid();
struct rlimit rlim;
rlim.rlim_cur = rlim.rlim_max = (200 << 20);
setrlimit(RLIMIT_AS, &rlim);
rlim.rlim_cur = rlim.rlim_max = 32 << 20;
setrlimit(RLIMIT_MEMLOCK, &rlim);
rlim.rlim_cur = rlim.rlim_max = 136 << 20;
setrlimit(RLIMIT_FSIZE, &rlim);
rlim.rlim_cur = rlim.rlim_max = 1 << 20;
setrlimit(RLIMIT_STACK, &rlim);
rlim.rlim_cur = rlim.rlim_max = 0;
setrlimit(RLIMIT_CORE, &rlim);
rlim.rlim_cur = rlim.rlim_max = 256;
setrlimit(RLIMIT_NOFILE, &rlim);
if (unshare(CLONE_NEWNS)) {
}
if (unshare(CLONE_NEWIPC)) {
}
if (unshare(0x02000000)) {
}
if (unshare(CLONE_NEWUTS)) {
}
if (unshare(CLONE_SYSVSEM)) {
}
typedef struct {
const char* name;
const char* value;
} sysctl_t;
static const sysctl_t sysctls[] = {
{"/proc/sys/kernel/shmmax", "16777216"},
{"/proc/sys/kernel/shmall", "536870912"},
{"/proc/sys/kernel/shmmni", "1024"},
{"/proc/sys/kernel/msgmax", "8192"},
{"/proc/sys/kernel/msgmni", "1024"},
{"/proc/sys/kernel/msgmnb", "1024"},
{"/proc/sys/kernel/sem", "1024 1048576 500 1024"},
};
unsigned i;
for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++)
write_file(sysctls[i].name, sysctls[i].value);
}
int wait_for_loop(int pid)
{
if (pid < 0)
exit(1);
int status = 0;
while (waitpid(-1, &status, __WALL) != pid) {
}
return WEXITSTATUS(status);
}
static int do_sandbox_none(void)
{
if (unshare(CLONE_NEWPID)) {
}
int pid = fork();
if (pid != 0)
return wait_for_loop(pid);
setup_common();
sandbox_common();
if (unshare(CLONE_NEWNET)) {
}
initialize_tun();
loop();
exit(1);
}
uint64_t r[3] = {0xffffffffffffffff, 0x0, 0xffffffffffffffff};
void loop(void)
{
long res = 0;
res = syscall(__NR_socket, 0xa, 1, 0);
if (res != -1)
r[0] = res;
memcpy((void*)0x20000040,
"sit0\000\000\000\000\000\000\000\000\000\000\000\000", 16);
*(uint32_t*)0x20000050 = 0;
res = syscall(__NR_ioctl, r[0], 0x8933, 0x20000040);
if (res != -1)
r[1] = *(uint32_t*)0x20000050;
*(uint8_t*)0x20000100 = 0xfe;
*(uint8_t*)0x20000101 = 0x80;
*(uint8_t*)0x20000102 = 0;
*(uint8_t*)0x20000103 = 0;
*(uint8_t*)0x20000104 = 0;
*(uint8_t*)0x20000105 = 0;
*(uint8_t*)0x20000106 = 0;
*(uint8_t*)0x20000107 = 0;
*(uint8_t*)0x20000108 = 0;
*(uint8_t*)0x20000109 = 0;
*(uint8_t*)0x2000010a = 0;
*(uint8_t*)0x2000010b = 0;
*(uint8_t*)0x2000010c = 0;
*(uint8_t*)0x2000010d = 0;
*(uint8_t*)0x2000010e = 0;
*(uint8_t*)0x2000010f = 0xbb;
*(uint8_t*)0x20000110 = -1;
*(uint8_t*)0x20000111 = 2;
*(uint8_t*)0x20000112 = 0;
*(uint8_t*)0x20000113 = 0;
*(uint8_t*)0x20000114 = 0;
*(uint8_t*)0x20000115 = 0;
*(uint8_t*)0x20000116 = 0;
*(uint8_t*)0x20000117 = 0;
*(uint8_t*)0x20000118 = 0;
*(uint8_t*)0x20000119 = 0;
*(uint8_t*)0x2000011a = 0;
*(uint8_t*)0x2000011b = 0;
*(uint8_t*)0x2000011c = 0;
*(uint8_t*)0x2000011d = 0;
*(uint8_t*)0x2000011e = 0;
*(uint8_t*)0x2000011f = 1;
*(uint8_t*)0x20000120 = 0xfe;
*(uint8_t*)0x20000121 = 0x80;
*(uint8_t*)0x20000122 = 0;
*(uint8_t*)0x20000123 = 0;
*(uint8_t*)0x20000124 = 0;
*(uint8_t*)0x20000125 = 0;
*(uint8_t*)0x20000126 = 0;
*(uint8_t*)0x20000127 = 0;
*(uint8_t*)0x20000128 = 0;
*(uint8_t*)0x20000129 = 0;
*(uint8_t*)0x2000012a = 0;
*(uint8_t*)0x2000012b = 0;
*(uint8_t*)0x2000012c = 0;
*(uint8_t*)0x2000012d = 0;
*(uint8_t*)0x2000012e = 0;
*(uint8_t*)0x2000012f = 0xaa;
*(uint32_t*)0x20000130 = 0;
*(uint16_t*)0x20000134 = 0;
*(uint16_t*)0x20000136 = 0;
*(uint32_t*)0x20000138 = -1;
*(uint64_t*)0x20000140 = 0;
*(uint32_t*)0x20000148 = 0x83420003;
*(uint32_t*)0x2000014c = r[1];
syscall(__NR_ioctl, r[0], 0x890b, 0x20000100);
res = syscall(__NR_socket, 0x10, 2, 0);
if (res != -1)
r[2] = res;
*(uint64_t*)0x20000080 = 0;
*(uint32_t*)0x20000088 = 0;
*(uint64_t*)0x20000090 = 0x20000040;
*(uint64_t*)0x20000040 = 0x20000140;
memcpy((void*)0x20000140,
"\x24\x00\x00\x00\x18\x00\x07\x04\x1d\xff\xfd\x94\x6f\x61\x05\x00\x0a"
"\x00\x00\x00\x1f\x00\x00\x00\x00\x02\x08\x00\x08\x00\x06\x00\x04\x00"
"\xff\x7e\x28\x00\x00\x00\x11\x00\xff\xff\xba\x16\xa0\xaa\x1c\x09\x00"
"\x00\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\xef\xf2\x4d\x82\x38"
"\xcf\xa4\x7e\x23\xf7\xef\xbf\x54",
76);
*(uint64_t*)0x20000048 = 0x4c;
*(uint64_t*)0x20000098 = 1;
*(uint64_t*)0x200000a0 = 0;
*(uint64_t*)0x200000a8 = 0;
*(uint32_t*)0x200000b0 = 0;
syscall(__NR_sendmsg, r[2], 0x20000080, 0);
}
int main(void)
{
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
do_sandbox_none();
return 0;
}
|
the_stack_data/824850.c | #include <math.h>
double evlmem(double fdt, double d[], int m, double xms)
{
int i;
double sumr=1.0,sumi=0.0;
double wr=1.0,wi=0.0,wpr,wpi,wtemp,theta;
theta=6.28318530717959*fdt;
wpr=cos(theta);
wpi=sin(theta);
for (i=1;i<=m;i++) {
wr=(wtemp=wr)*wpr-wi*wpi;
wi=wi*wpr+wtemp*wpi;
sumr -= d[i]*wr;
sumi -= d[i]*wi;
}
return xms/(sumr*sumr+sumi*sumi);
}
/* (C) Copr. 1986-92 Numerical Recipes Software 9.1-5i. */
|
the_stack_data/23575937.c | /* Exercise 7-4. Write a private version of scanf analogous to minprintf from
* the previous section. */
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
int isalpha_p(char c)
{
return isalpha(c) || c == '%';
}
void minscanf(char *fmt, ...)
{
va_list vl;
va_start(vl, fmt);
char *pc;
int *pi;
float *pf;
for (char *p = fmt; *p; ++p) {
if (*p != '%') {
if (getchar() != *p);
printf("error: expect %c\n", *p);
continue;
}
else {
char spec[100];
char *q = spec;
*q++ = '%';
++p;
while (*p && !isalpha_p(*p)) {
*q++ = *p++;
}
if (*p)
*q++ = *p;
*q = '\0';
switch (*p) {
case 'c':
pc = va_arg(vl, char *);
scanf(spec, pc);
break;
case 'd':
case 'i':
pi = va_arg(vl, int *);
scanf(spec, pi);
break;
case 'f':
pf = va_arg(vl, float *);
scanf(spec, pf);
break;
default:
printf("error\n");
break;
}
}
}
va_end(vl);
}
int main()
{
char c;
int i;
float f;
minscanf("%cx%d%f", &c, &i, &f);
printf("c = %c\n", c);
printf("i = %d\n", i);
printf("f = %f\n", f);
return 0;
}
|
the_stack_data/150140544.c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_45__ TYPE_9__ ;
typedef struct TYPE_44__ TYPE_8__ ;
typedef struct TYPE_43__ TYPE_7__ ;
typedef struct TYPE_42__ TYPE_6__ ;
typedef struct TYPE_41__ TYPE_5__ ;
typedef struct TYPE_40__ TYPE_4__ ;
typedef struct TYPE_39__ TYPE_3__ ;
typedef struct TYPE_38__ TYPE_2__ ;
typedef struct TYPE_37__ TYPE_25__ ;
typedef struct TYPE_36__ TYPE_22__ ;
typedef struct TYPE_35__ TYPE_1__ ;
typedef struct TYPE_34__ TYPE_18__ ;
typedef struct TYPE_33__ TYPE_15__ ;
typedef struct TYPE_32__ TYPE_13__ ;
typedef struct TYPE_31__ TYPE_11__ ;
typedef struct TYPE_30__ TYPE_10__ ;
/* Type definitions */
union lpfc_sli4_cfg_shdr {int /*<<< orphan*/ response; } ;
typedef int uint32_t ;
struct TYPE_44__ {void* wqp; } ;
struct TYPE_45__ {TYPE_8__ sli4; } ;
struct lpfc_sli_ring {TYPE_9__ sli; } ;
struct lpfc_sli4_cfg_mhdr {int dummy; } ;
struct lpfc_sli {struct lpfc_sli_ring* ring; } ;
struct lpfc_mbx_query_fw_config {int dummy; } ;
struct TYPE_30__ {int fw_func_mode; int ulp0_mode; int ulp1_mode; int* fcp_cq_map; TYPE_25__** hba_eq; TYPE_15__** fcp_cq; TYPE_13__** fcp_wq; TYPE_15__* mbx_cq; TYPE_15__* els_cq; TYPE_22__* mbx_wq; TYPE_13__* els_wq; TYPE_18__* dat_rq; TYPE_18__* hdr_rq; } ;
struct lpfc_hba {int cfg_fcp_io_channel; int cfg_fcp_imax; TYPE_10__ sli4_hba; int /*<<< orphan*/ mbox_mem_pool; struct lpfc_sli sli; } ;
struct TYPE_39__ {int function_mode; int ulp0_mode; int ulp1_mode; } ;
struct TYPE_40__ {TYPE_3__ rsp; } ;
struct TYPE_35__ {int /*<<< orphan*/ cfg_shdr; } ;
struct TYPE_38__ {TYPE_1__ header; } ;
struct TYPE_41__ {TYPE_4__ query_fw_cfg; TYPE_2__ sli4_config; } ;
struct TYPE_42__ {TYPE_5__ un; } ;
struct TYPE_43__ {TYPE_6__ mqe; } ;
struct TYPE_37__ {int /*<<< orphan*/ queue_id; } ;
struct TYPE_36__ {int /*<<< orphan*/ queue_id; } ;
struct TYPE_34__ {int queue_id; } ;
struct TYPE_33__ {int queue_id; struct lpfc_sli_ring* pring; } ;
struct TYPE_32__ {int /*<<< orphan*/ queue_id; } ;
struct TYPE_31__ {TYPE_7__ u; } ;
typedef TYPE_11__ LPFC_MBOXQ_t ;
/* Variables and functions */
int ENOMEM ;
int ENXIO ;
int /*<<< orphan*/ GFP_KERNEL ;
int /*<<< orphan*/ KERN_ERR ;
int /*<<< orphan*/ KERN_INFO ;
int /*<<< orphan*/ LOG_INIT ;
int /*<<< orphan*/ LPFC_ELS ;
int /*<<< orphan*/ LPFC_ELS_HBQ ;
size_t LPFC_ELS_RING ;
int /*<<< orphan*/ LPFC_FCP ;
int /*<<< orphan*/ LPFC_MBOX ;
int /*<<< orphan*/ LPFC_MBOX_OPCODE_QUERY_FW_CFG ;
int /*<<< orphan*/ LPFC_MBOX_SUBSYSTEM_COMMON ;
int /*<<< orphan*/ LPFC_MCQ ;
int /*<<< orphan*/ LPFC_SLI4_MBX_EMBED ;
int /*<<< orphan*/ LPFC_USOL ;
int /*<<< orphan*/ LPFC_WCQ ;
int MAX_SLI3_CONFIGURED_RINGS ;
int /*<<< orphan*/ MBX_POLL ;
int MBX_TIMEOUT ;
int bf_get (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int lpfc_cq_create (struct lpfc_hba*,TYPE_15__*,TYPE_25__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ lpfc_cq_destroy (struct lpfc_hba*,TYPE_15__*) ;
int lpfc_eq_create (struct lpfc_hba*,TYPE_25__*,int) ;
int /*<<< orphan*/ lpfc_eq_destroy (struct lpfc_hba*,TYPE_25__*) ;
int /*<<< orphan*/ lpfc_mbox_hdr_add_status ;
int /*<<< orphan*/ lpfc_mbox_hdr_status ;
int lpfc_mq_create (struct lpfc_hba*,TYPE_22__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ lpfc_mq_destroy (struct lpfc_hba*,TYPE_22__*) ;
int /*<<< orphan*/ lpfc_printf_log (struct lpfc_hba*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ;
int /*<<< orphan*/ lpfc_rq_adjust_repost (struct lpfc_hba*,TYPE_18__*,int /*<<< orphan*/ ) ;
int lpfc_rq_create (struct lpfc_hba*,TYPE_18__*,TYPE_18__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ lpfc_sli4_config (struct lpfc_hba*,TYPE_11__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ;
int lpfc_sli_issue_mbox (struct lpfc_hba*,TYPE_11__*,int /*<<< orphan*/ ) ;
int lpfc_wq_create (struct lpfc_hba*,TYPE_13__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ lpfc_wq_destroy (struct lpfc_hba*,TYPE_13__*) ;
scalar_t__ mempool_alloc (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mempool_free (TYPE_11__*,int /*<<< orphan*/ ) ;
int
lpfc_sli4_queue_setup(struct lpfc_hba *phba)
{
struct lpfc_sli *psli = &phba->sli;
struct lpfc_sli_ring *pring;
int rc = -ENOMEM;
int fcp_eqidx, fcp_cqidx, fcp_wqidx;
int fcp_cq_index = 0;
uint32_t shdr_status, shdr_add_status;
union lpfc_sli4_cfg_shdr *shdr;
LPFC_MBOXQ_t *mboxq;
uint32_t length;
/* Check for dual-ULP support */
mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!mboxq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3249 Unable to allocate memory for "
"QUERY_FW_CFG mailbox command\n");
return -ENOMEM;
}
length = (sizeof(struct lpfc_mbx_query_fw_config) -
sizeof(struct lpfc_sli4_cfg_mhdr));
lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON,
LPFC_MBOX_OPCODE_QUERY_FW_CFG,
length, LPFC_SLI4_MBX_EMBED);
rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
shdr = (union lpfc_sli4_cfg_shdr *)
&mboxq->u.mqe.un.sli4_config.header.cfg_shdr;
shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
if (shdr_status || shdr_add_status || rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3250 QUERY_FW_CFG mailbox failed with status "
"x%x add_status x%x, mbx status x%x\n",
shdr_status, shdr_add_status, rc);
if (rc != MBX_TIMEOUT)
mempool_free(mboxq, phba->mbox_mem_pool);
rc = -ENXIO;
goto out_error;
}
phba->sli4_hba.fw_func_mode =
mboxq->u.mqe.un.query_fw_cfg.rsp.function_mode;
phba->sli4_hba.ulp0_mode = mboxq->u.mqe.un.query_fw_cfg.rsp.ulp0_mode;
phba->sli4_hba.ulp1_mode = mboxq->u.mqe.un.query_fw_cfg.rsp.ulp1_mode;
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"3251 QUERY_FW_CFG: func_mode:x%x, ulp0_mode:x%x, "
"ulp1_mode:x%x\n", phba->sli4_hba.fw_func_mode,
phba->sli4_hba.ulp0_mode, phba->sli4_hba.ulp1_mode);
if (rc != MBX_TIMEOUT)
mempool_free(mboxq, phba->mbox_mem_pool);
/*
* Set up HBA Event Queues (EQs)
*/
/* Set up HBA event queue */
if (phba->cfg_fcp_io_channel && !phba->sli4_hba.hba_eq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3147 Fast-path EQs not allocated\n");
rc = -ENOMEM;
goto out_error;
}
for (fcp_eqidx = 0; fcp_eqidx < phba->cfg_fcp_io_channel; fcp_eqidx++) {
if (!phba->sli4_hba.hba_eq[fcp_eqidx]) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0522 Fast-path EQ (%d) not "
"allocated\n", fcp_eqidx);
rc = -ENOMEM;
goto out_destroy_hba_eq;
}
rc = lpfc_eq_create(phba, phba->sli4_hba.hba_eq[fcp_eqidx],
(phba->cfg_fcp_imax / phba->cfg_fcp_io_channel));
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0523 Failed setup of fast-path EQ "
"(%d), rc = 0x%x\n", fcp_eqidx, rc);
goto out_destroy_hba_eq;
}
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2584 HBA EQ setup: "
"queue[%d]-id=%d\n", fcp_eqidx,
phba->sli4_hba.hba_eq[fcp_eqidx]->queue_id);
}
/* Set up fast-path FCP Response Complete Queue */
if (!phba->sli4_hba.fcp_cq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3148 Fast-path FCP CQ array not "
"allocated\n");
rc = -ENOMEM;
goto out_destroy_hba_eq;
}
for (fcp_cqidx = 0; fcp_cqidx < phba->cfg_fcp_io_channel; fcp_cqidx++) {
if (!phba->sli4_hba.fcp_cq[fcp_cqidx]) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0526 Fast-path FCP CQ (%d) not "
"allocated\n", fcp_cqidx);
rc = -ENOMEM;
goto out_destroy_fcp_cq;
}
rc = lpfc_cq_create(phba, phba->sli4_hba.fcp_cq[fcp_cqidx],
phba->sli4_hba.hba_eq[fcp_cqidx], LPFC_WCQ, LPFC_FCP);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0527 Failed setup of fast-path FCP "
"CQ (%d), rc = 0x%x\n", fcp_cqidx, rc);
goto out_destroy_fcp_cq;
}
/* Setup fcp_cq_map for fast lookup */
phba->sli4_hba.fcp_cq_map[fcp_cqidx] =
phba->sli4_hba.fcp_cq[fcp_cqidx]->queue_id;
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2588 FCP CQ setup: cq[%d]-id=%d, "
"parent seq[%d]-id=%d\n",
fcp_cqidx,
phba->sli4_hba.fcp_cq[fcp_cqidx]->queue_id,
fcp_cqidx,
phba->sli4_hba.hba_eq[fcp_cqidx]->queue_id);
}
/* Set up fast-path FCP Work Queue */
if (!phba->sli4_hba.fcp_wq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3149 Fast-path FCP WQ array not "
"allocated\n");
rc = -ENOMEM;
goto out_destroy_fcp_cq;
}
for (fcp_wqidx = 0; fcp_wqidx < phba->cfg_fcp_io_channel; fcp_wqidx++) {
if (!phba->sli4_hba.fcp_wq[fcp_wqidx]) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0534 Fast-path FCP WQ (%d) not "
"allocated\n", fcp_wqidx);
rc = -ENOMEM;
goto out_destroy_fcp_wq;
}
rc = lpfc_wq_create(phba, phba->sli4_hba.fcp_wq[fcp_wqidx],
phba->sli4_hba.fcp_cq[fcp_wqidx],
LPFC_FCP);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0535 Failed setup of fast-path FCP "
"WQ (%d), rc = 0x%x\n", fcp_wqidx, rc);
goto out_destroy_fcp_wq;
}
/* Bind this WQ to the next FCP ring */
pring = &psli->ring[MAX_SLI3_CONFIGURED_RINGS + fcp_wqidx];
pring->sli.sli4.wqp = (void *)phba->sli4_hba.fcp_wq[fcp_wqidx];
phba->sli4_hba.fcp_cq[fcp_wqidx]->pring = pring;
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2591 FCP WQ setup: wq[%d]-id=%d, "
"parent cq[%d]-id=%d\n",
fcp_wqidx,
phba->sli4_hba.fcp_wq[fcp_wqidx]->queue_id,
fcp_cq_index,
phba->sli4_hba.fcp_cq[fcp_wqidx]->queue_id);
}
/*
* Set up Complete Queues (CQs)
*/
/* Set up slow-path MBOX Complete Queue as the first CQ */
if (!phba->sli4_hba.mbx_cq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0528 Mailbox CQ not allocated\n");
rc = -ENOMEM;
goto out_destroy_fcp_wq;
}
rc = lpfc_cq_create(phba, phba->sli4_hba.mbx_cq,
phba->sli4_hba.hba_eq[0], LPFC_MCQ, LPFC_MBOX);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0529 Failed setup of slow-path mailbox CQ: "
"rc = 0x%x\n", rc);
goto out_destroy_fcp_wq;
}
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2585 MBX CQ setup: cq-id=%d, parent eq-id=%d\n",
phba->sli4_hba.mbx_cq->queue_id,
phba->sli4_hba.hba_eq[0]->queue_id);
/* Set up slow-path ELS Complete Queue */
if (!phba->sli4_hba.els_cq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0530 ELS CQ not allocated\n");
rc = -ENOMEM;
goto out_destroy_mbx_cq;
}
rc = lpfc_cq_create(phba, phba->sli4_hba.els_cq,
phba->sli4_hba.hba_eq[0], LPFC_WCQ, LPFC_ELS);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0531 Failed setup of slow-path ELS CQ: "
"rc = 0x%x\n", rc);
goto out_destroy_mbx_cq;
}
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2586 ELS CQ setup: cq-id=%d, parent eq-id=%d\n",
phba->sli4_hba.els_cq->queue_id,
phba->sli4_hba.hba_eq[0]->queue_id);
/*
* Set up all the Work Queues (WQs)
*/
/* Set up Mailbox Command Queue */
if (!phba->sli4_hba.mbx_wq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0538 Slow-path MQ not allocated\n");
rc = -ENOMEM;
goto out_destroy_els_cq;
}
rc = lpfc_mq_create(phba, phba->sli4_hba.mbx_wq,
phba->sli4_hba.mbx_cq, LPFC_MBOX);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0539 Failed setup of slow-path MQ: "
"rc = 0x%x\n", rc);
goto out_destroy_els_cq;
}
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2589 MBX MQ setup: wq-id=%d, parent cq-id=%d\n",
phba->sli4_hba.mbx_wq->queue_id,
phba->sli4_hba.mbx_cq->queue_id);
/* Set up slow-path ELS Work Queue */
if (!phba->sli4_hba.els_wq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0536 Slow-path ELS WQ not allocated\n");
rc = -ENOMEM;
goto out_destroy_mbx_wq;
}
rc = lpfc_wq_create(phba, phba->sli4_hba.els_wq,
phba->sli4_hba.els_cq, LPFC_ELS);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0537 Failed setup of slow-path ELS WQ: "
"rc = 0x%x\n", rc);
goto out_destroy_mbx_wq;
}
/* Bind this WQ to the ELS ring */
pring = &psli->ring[LPFC_ELS_RING];
pring->sli.sli4.wqp = (void *)phba->sli4_hba.els_wq;
phba->sli4_hba.els_cq->pring = pring;
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2590 ELS WQ setup: wq-id=%d, parent cq-id=%d\n",
phba->sli4_hba.els_wq->queue_id,
phba->sli4_hba.els_cq->queue_id);
/*
* Create Receive Queue (RQ)
*/
if (!phba->sli4_hba.hdr_rq || !phba->sli4_hba.dat_rq) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0540 Receive Queue not allocated\n");
rc = -ENOMEM;
goto out_destroy_els_wq;
}
lpfc_rq_adjust_repost(phba, phba->sli4_hba.hdr_rq, LPFC_ELS_HBQ);
lpfc_rq_adjust_repost(phba, phba->sli4_hba.dat_rq, LPFC_ELS_HBQ);
rc = lpfc_rq_create(phba, phba->sli4_hba.hdr_rq, phba->sli4_hba.dat_rq,
phba->sli4_hba.els_cq, LPFC_USOL);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0541 Failed setup of Receive Queue: "
"rc = 0x%x\n", rc);
goto out_destroy_fcp_wq;
}
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"2592 USL RQ setup: hdr-rq-id=%d, dat-rq-id=%d "
"parent cq-id=%d\n",
phba->sli4_hba.hdr_rq->queue_id,
phba->sli4_hba.dat_rq->queue_id,
phba->sli4_hba.els_cq->queue_id);
return 0;
out_destroy_els_wq:
lpfc_wq_destroy(phba, phba->sli4_hba.els_wq);
out_destroy_mbx_wq:
lpfc_mq_destroy(phba, phba->sli4_hba.mbx_wq);
out_destroy_els_cq:
lpfc_cq_destroy(phba, phba->sli4_hba.els_cq);
out_destroy_mbx_cq:
lpfc_cq_destroy(phba, phba->sli4_hba.mbx_cq);
out_destroy_fcp_wq:
for (--fcp_wqidx; fcp_wqidx >= 0; fcp_wqidx--)
lpfc_wq_destroy(phba, phba->sli4_hba.fcp_wq[fcp_wqidx]);
out_destroy_fcp_cq:
for (--fcp_cqidx; fcp_cqidx >= 0; fcp_cqidx--)
lpfc_cq_destroy(phba, phba->sli4_hba.fcp_cq[fcp_cqidx]);
out_destroy_hba_eq:
for (--fcp_eqidx; fcp_eqidx >= 0; fcp_eqidx--)
lpfc_eq_destroy(phba, phba->sli4_hba.hba_eq[fcp_eqidx]);
out_error:
return rc;
} |
the_stack_data/734129.c | #include <stdio.h>
#define N 200000
#define tam 16*1024*1024
int i, j, step;
unsigned char v[tam];
void InitCache(int cod);
void Referencia(unsigned char *dir);
int Referencias();
int Fallos();
int main()
{ int i, j, step;
int refs, misses;
for (step=1; step<=12; step++) {
InitCache(0x7A3A90C5);
i = 0;
for (j=0; j<N; j++) {
Referencia((unsigned char *)&v[i]); // acceso a v[i]
i = i + step;
if (i >= tam) i = 0;
}
refs = Referencias();
misses = Fallos();
printf("LineSize? step=%3d ; fallos=%6d ; referencias=%6d\n", step, misses, refs);
}
return 0;
}
|
the_stack_data/59512187.c | /*
* Copyright (c) 2017 Advanced Micro Devices, Inc.
* All rights reserved.
*
* For use for simulation and test purposes only
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Brandon Potter
*/
#include <elf.h>
#include <stdio.h>
int main(int argc, char **argv, char **envp)
{
int i;
printf("%p: argc: [%d]\n", (void*)&argc, argc);
printf("\n");
for (i = 0; i < argc; i++)
printf("%p: argv[%d]: [%s]\n", (void*)&argv[i], i, argv[i]);
printf("\n");
i = 0;
while (envp[i] != NULL) {
printf("%p: envp[%d]: [%s]\n", (void*)&envp[i], i, envp[i]);
i++;
}
printf("\n");
Elf64_auxv_t *auxv = (Elf64_auxv_t*)&envp[--i];
while (auxv++) {
char *type;
switch(auxv->a_type) {
case AT_IGNORE:
type = "AT_IGNORE";
break;
case AT_EXECFD:
type = "AT_EXECFD";
break;
case AT_PHDR:
type = "AT_PHDR";
break;
case AT_PHENT:
type = "AT_PHENT";
break;
case AT_PHNUM:
type = "AT_PHNUM";
break;
case AT_PAGESZ:
type = "AT_PAGESZ";
break;
case AT_BASE:
type = "AT_BASE";
break;
case AT_FLAGS:
type = "AT_FLAGS";
break;
case AT_ENTRY:
type = "AT_ENTRY";
break;
case AT_NOTELF:
type = "AT_NOTELF";
break;
case AT_UID:
type = "AT_UID";
break;
case AT_EUID:
type = "AT_EUID";
break;
case AT_GID:
type = "AT_GID";
break;
case AT_EGID:
type = "AT_EGID";
break;
case AT_CLKTCK:
type = "AT_CLKTCK";
break;
case AT_PLATFORM:
type = "AT_PLATFORM";
break;
case AT_HWCAP:
type = "AT_HWCAP";
break;
case AT_FPUCW:
type = "AT_FPUCW";
break;
case AT_DCACHEBSIZE:
type = "AT_DCACHEBSIZE";
break;
case AT_ICACHEBSIZE:
type = "AT_ICACHEBSIZE";
break;
case AT_UCACHEBSIZE:
type = "AT_UCACHEBSIZE";
break;
case AT_IGNOREPPC:
type = "AT_IGNOREPPC";
break;
case AT_SECURE:
type = "AT_SECURE";
break;
case AT_BASE_PLATFORM:
type = "AT_BASE_PLATFORM";
break;
case AT_RANDOM:
type = "AT_RANDOM";
break;
case AT_EXECFN:
type = "AT_EXECFN";
break;
case AT_SYSINFO:
type = "AT_SYSINFO";
break;
case AT_SYSINFO_EHDR:
type = "AT_SYSINFO_EHDR";
break;
case AT_L1I_CACHESHAPE:
type = "AT_L1I_CACHESHAPE";
break;
case AT_L1D_CACHESHAPE:
type = "AT_L1D_CACHESHAPE";
break;
case AT_L2_CACHESHAPE:
type = "AT_L2_CACHESHAPE";
break;
case AT_L3_CACHESHAPE:
type = "AT_L3_CACHESHAPE";
break;
case AT_NULL:
default:
printf("\n");
return 0;
}
printf("%p: %s: [%jx]\n", (void *)auxv, type, (uintmax_t)auxv->a_un.a_val);
}
}
|
the_stack_data/132657.c | #include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
int main()
{
int socketD = socket(AF_INET, SOCK_DGRAM, 0);
int size;
char buffer[1000], message[] = "Execution Successful!";
struct sockaddr_in clientAddress, serverAddress;
socklen_t clientLength = sizeof(clientAddress);
serverAddress.sin_family = AF_INET;
serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);
serverAddress.sin_port = htons(1234);
bind(socketD, (struct sockaddr *)&serverAddress, sizeof(serverAddress));
while (1)
{
memset(buffer, 0, sizeof(buffer));
recvfrom(socketD, buffer, sizeof(buffer), 0, (struct sockaddr *)&clientAddress, &clientLength);
system(buffer);
printf("Successfully executed Command : %s ", buffer);
sendto(socketD, message, sizeof(message), 0, (struct sockaddr *)&clientAddress, clientLength);
}
close(socketD);
return 0;
} |
the_stack_data/115111.c | int a = 3;
int b = 4;
int main() {
return a * b;
} |
the_stack_data/355343.c | extern /*@out@*/ /*@only@*/ void *smalloc (unsigned int size);
typedef int mint;
typedef struct _st
{
int a;
/*@only@*/ int *b;
/*@shared@*/ mint *c;
int d;
} *st;
/*@only@*/ st st_create1 ()
{
st res = (st) smalloc (sizeof(struct _st));
int *z;
res->a = 3;
z = res->b; /* res->b not defined */
z = (*res).c; /* (*res).c not defined */
return res; /* res->d not defined */
}
void f1(/*@only@*/ st x)
{
free (x->b);
free (x);
} /* correct */
void f2(/*@only@*/ st x)
{
free (x);
} /* bad --- didn't release x->b */
void f3(/*@only@*/ st x)
{
free (x->c); /* bad --- x->c is shared */
} /* bad --- didn't release x */
/*@only@*/ st st_create ()
{
st res = (st) smalloc(sizeof(struct _st));
res->a = 3;
return res; /* 6, 7, 8. res->b, res->c, res->d not defined */
}
|
the_stack_data/960872.c | // clang-format off
// RUN: %c-to-llvm -fno-discard-value-names %omp_c_flags %s | %apply-typeart -typeart-alloca -call-filter -typeart-filter-pointer-alloca=false -S 2>&1 | %filecheck %s
// RUN: %c-to-llvm -fno-discard-value-names %omp_c_flags %s | %apply-typeart -typeart-alloca -call-filter -typeart-filter-pointer-alloca=false -S | %filecheck %s --check-prefix=check-inst
// REQUIRES: openmp
// clang-format on
// NOTE: This test has limited applicability in this scenario:
// lastprivate(x) copies address used in the MPI_send, and subsequently copies the result back to "x*".
// The data flow tracker detects only the usage of the copy in the context of MPI (see "foo() and func(...)")
// NOTE 2: with optimization the parameter "x" of MPI_Send mock call in the parallel loop gets "undef"
#include "omp.h"
extern void MPI_Send(void*, int);
void func(int* x, int* e) {
// lastprivate - addr(!) value of x is copied to "private_val" (which is tracked) in outlined region
// , and "int x=1;" is thus not tracked.
// check-inst: define {{.*}} @func
// check-inst: define {{.*}} @.omp_outlined
// check-inst: call void @__typeart_alloc_stack_omp(i8* %0, i32 10, i64 1)
#pragma omp parallel for lastprivate(x), shared(e)
for (int i = 0; i < 10; ++i) {
// Analysis should not filter x, but e...
MPI_Send((void*)x, *e);
}
}
void foo() {
// check-inst: define {{.*}} @foo
// check-inst-NOT: call void @__typeart_alloc_stack
int x = 1;
int y = 2;
#pragma omp parallel
{ func(&x, &y); }
}
void func_other(int* x, int* e) {
// lastprivate - addr(!) value of x is copied to "private_val" (which is tracked) in outlined region
// check-inst: define {{.*}} @func_other
// check-inst: define {{.*}} @.omp_outlined
// check-inst: call void @__typeart_alloc_stack_omp(i8* %0, i32 10, i64 1)
#pragma omp parallel for lastprivate(x), shared(e)
for (int i = 0; i < 10; ++i) {
// Analysis should not filter x, but e...
MPI_Send(x, *e);
}
MPI_Send(x, *e);
}
void bar(int x_other) {
// check-inst: define {{.*}} @bar
// check-inst: call void @__typeart_alloc_stack(i8* %0, i32 2, i64 1)
int x = x_other;
int y = 2;
#pragma omp parallel
{ func_other(&x, &y); }
}
// CHECK: TypeArtPass [Heap & Stack]
// CHECK-NEXT: Malloc : 0
// CHECK-NEXT: Free : 0
// CHECK-NEXT: Alloca : 3
// CHECK-NEXT: Global : 0
|
the_stack_data/64200385.c | // Example 14-6. Using a thread-local object
// thread-local.c
#include <stdio.h>
#include <threads.h>
thread_local int var = 10;
void print_var(void){ printf("var = %d\n", var); }
int func(void *); // Thread function
int main(int argc, char *argv[])
{
thrd_t th1;
if ( thrd_create( &th1, func, NULL ) != thrd_success ){
fprintf(stderr,"Error creating thread.\n");
return 0xff;
}
print_var(); // Output: var = 10
thrd_join(th1, NULL);
return 0;
}
int func(void *arg) // Thread function
{
var += 10; // Thread-local variable
print_var(); // Output: var = 20
return 0;
}
|
the_stack_data/114299.c | #include<stdio.h>
int Combination(int n, int r);
int main()
{
int num_right_site, num_left_site;
int num_test_case;
int i;
scanf("%d", &num_test_case);
for(i = 0; i<num_test_case; i++){
scanf("%d %d", &num_left_site, &num_right_site);
printf("%d\n", Combination(num_right_site, num_left_site));
}
}
int Combination(int n, int r)
{
if(r==0)
return 1;
else if(n == r)
return 1;
else
return Combination(n-1, r-1)+Combination(n-1, r);
} |
the_stack_data/87637783.c | //2048.c - 2048 (C style)
//Author: Shane Barratt, 1/9/2015
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <float.h>
typedef int64_t int64;
uint32_t d[65536];
#define UP 0
#define DOWN 1
#define LEFT 2
#define RIGHT 3
/*
0000000000000000
0000000000000000
0000000000000000
0000000000000000
*/
int get_col(int64 b, int c) {
int r = (b >> (c*4)) & 0xF;
r |= ((b >> (c*4+16)) & 0xF) << 4;
r |= ((b >> (c*4+32)) & 0xF) << 8;
r |= ((b >> (c*4+48)) & 0xF) << 12;
return r;
}
int get_row(int64 b, int r) {
return (b >> r*16) & 0xFFFF;
}
int64 board_from_rows(char row_0[], char row_1[], char row_2[], char row_3[]) {
int64 b = 0;
for (int i = 0; i < 4; i++) {
b |= (int64)row_0[i] << i*4;
}
for (int i = 0; i < 4; i++) {
b |= (int64)row_1[i] << (16+i*4);
}
for (int i = 0; i < 4; i++) {
b |= (int64)row_2[i] << (32+i*4);
}
for (int i = 0; i < 4; i++) {
b |= (int64)row_3[i] << (48+i*4);
}
return b;
}
void print_board(int64 b) {
for(int i = 0; i < 4; i++) {
printf("+-------------------------------+\n| | | | |\n");
for(int j = 0; j < 4; j++) {
if ((0xF & (int)(b >> (i*16+j*4))) == 0) {
printf("| ");
} else {
printf("| %d ", 0xF & (int)(b >> (i*16+j*4)));
}
}
printf("|\n| | | | |\n");
}
printf("+-------------------------------+\n");
}
int reverse_fourbits(int num) {
int new_num = 0;
new_num |= (num&0xF000) >> 12;
new_num |= (num&0x0F00) >> 4;
new_num |= (num&0x00F0) << 4;
new_num |= (num&0x000F) << 12;
return new_num;
}
//TODO - move lookup table for moving the other direction.
int64 move_right(int64 b) {
int r = 0;
int64 new_b = 0;
for(int i = 0; i < 4; i++) {
r = get_row(b,i);
new_b |= (int64)reverse_fourbits(d[reverse_fourbits(r)]) << i*16;
}
return new_b;
}
int64 move_left(int64 b) {
int r = 0;
int64 new_b = 0;
for(int i = 0; i < 4; i++) {
r = get_row(b,i);
new_b |= (int64)d[r] << i*16;
}
return new_b;
}
int64 move_up(int64 b) {
int c = 0;
int64 new_b = 0;
for(int i = 0; i < 4; i++) {
c = get_col(b,i);
int new_col = d[c];
new_b |= (int64)((new_col & 0xF000) >> 12) << (48+ i*4);
new_b |= (int64)((new_col & 0x0F00) >> 8) << (32+i*4);
new_b |= (int64)((new_col & 0x00F0) >> 4) << (16+i*4);
new_b |= (int64)((new_col & 0x000F)) << (0+i*4);
}
return new_b;
}
//TODO - alternate move lookup table
int64 move_down(int64 b) {
int c = 0;
int64 new_b = 0;
for(int i = 0; i < 4; i++) {
c = get_col(b,i);
int new_col = reverse_fourbits(d[reverse_fourbits(c)]);
new_b |= (int64)((new_col & 0xF000) >> 12) << (48+i*4);
new_b |= (int64)((new_col & 0x0F00) >> 8) << (32+i*4);
new_b |= (int64)((new_col & 0x00F0) >> 4) << (16+i*4);
new_b |= (int64)((new_col & 0x000F)) << (0+i*4);
}
return new_b;
}
int64 rand_piece(int64 b, int seed_offset) {
srand(time(NULL) + seed_offset);
int p = 1;
if (rand()%10 == 0) {
p = 2;
}
int zero_count = 0;
for(int i = 0; i < 16; ++i) {
zero_count += (((b >> 4*i) & 0xF) == 0);
}
int zero_places[zero_count];
int j = 0;
for(int i = 0; i < 16; i++) {
if (((b >> 4*i) & 0xF) == 0) {
zero_places[j++] = 4*i;
}
}
if (zero_count == 0) {
printf("no zeros\n");
return b;
}
else {
int r = rand()%zero_count;
return b | ((int64)p << zero_places[r]);
}
}
int64 makemovenum(int64 b, int move) {
if (move == UP) {
return move_up(b);
}
else if (move == RIGHT) {
return move_right(b);
}
else if (move == DOWN) {
return move_down(b);
}
else {
return move_left(b);
}
}
int64 makemove(int64 b, char move) {
if (move == 'w') {
return move_up(b);
}
else if (move == 'd') {
return move_right(b);
}
else if (move == 's') {
return move_down(b);
}
else {
return move_left(b);
}
}
void playgame() {
int64 b = 0;
b = rand_piece(b,0);
b = rand_piece(b,1);
// char row_0[4] = {1,2,3,4};
// char row_1[4] = {2,1,4,3};
// char row_2[4] = {1,2,3,4};
// char row_3[4] = {2,1,4,3};
// b = board_from_rows(row_0,row_1,row_2,row_3);
char row_0[4] = {3,4,0,0};
char row_1[4] = {3,4,0,1};
char row_2[4] = {7,0,0,0};
char row_3[4] = {2,0,0,0};
b = board_from_rows(row_0,row_1,row_2,row_3);
printf("\n");
print_board(b);
getchar();
int move_ct = 0;
while (1) {
char move;
printf("Make Move:");
scanf("%c",&move);
int skip_move = 0;
int64 newb = 0;
if (move == EOF) {
printf("\n");
exit(0);
}
else if (move == 'w' || move == 'd' || move == 's' || move == 'a') {
newb = makemove(b,move);
if (newb == b) {
skip_move = 1;
}
else {
b = newb;
}
}
else {
skip_move = 1;
}
if (skip_move == 0) {
printf("\n\n");
print_board(b);
b = rand_piece(b, move_ct);
++move_ct;
printf("\n\n");
print_board(b);
}
}
}
int getrandommove(int64 b, int seed) {
srand(time(NULL) + seed);
int r = rand() % 4;
if (r == UP) {
return 'w';
}
else if (r == DOWN) {
return 's';
}
else if (r == RIGHT) {
return 'd';
}
else {
return 'a';
}
}
//TODO - better eval function
int eval(int64 b) {
int s = 0;
for(int i = 0; i < 16; i++) {
s += (((b >> (i*4)) & 0xF) == 0);
}
int toprow = get_row(b, 0);
int bottomrow = get_row(b, 3);
int leftcol = get_col(b, 0);
int rightcol = get_col(b, 3);
int tr = toprow & 0xF;
int br = bottomrow & 0xF;
int lc = leftcol & 0xF;
int rc = rightcol & 0xF;
int ct = 0;
for(int i = 1; i < 4; i++) {
if (((toprow >> i*4) & 0xF) > tr) {
// ct++;
}
if (((bottomrow >> i*4) & 0xF) > br) {
ct++;
}
if (((leftcol >> i*4) & 0xF) > lc) {
// ct++;
}
if (((rightcol >> i*4) & 0xF) > rc) {
// ct++;
}
tr = ((toprow >> i*4) & 0xF);
br = ((bottomrow >> i*4) & 0xF);
lc = ((leftcol >> i*4) & 0xF);
rc = ((rightcol >> i*4) & 0xF);
}
return s*2 + ct;
}
//TODO - incorporate 4's in expectimax (right now it only does 2's for speed).
double expectimax(int64 b, int depth, int maximizingPlayer) {
if (depth == 0) {
return eval(b);
}
if (maximizingPlayer) {
double bestValue = -1;
int64 newb;
for(int i = 0; i < 4; ++i) {
newb = makemovenum(b,i);
if (newb != b) {
double newValue = expectimax(newb,depth-1,1-maximizingPlayer);
if (newValue > bestValue) {
bestValue = newValue;
}
}
}
return bestValue;
}
else {
double s = 0;
int64 newb;
double ct = 0;
for(int i = 0; i < 16; ++i) {
if (((b >> i*4) & 0xF) == 0) {
newb = b | ((int64)1 << i*4);
s += expectimax(newb, depth-1, 1-maximizingPlayer);
ct++;
}
}
return s*1.0/ct;
}
}
int getmove(int64 b, int seed) {
int best_move = -1;
double best_score = -1;
for(int i = 0; i < 4; i++) {
int64 newb = makemovenum(b,i);
double competing_score = expectimax(newb,7,0);
if (competing_score >= best_score && newb != b) {
best_move = i;
best_score = competing_score;
}
}
return best_move;
}
void aiplay() {
int64 b = 0;
b = rand_piece(b,0);
b = rand_piece(b,1);
// char row_0[4] = {3,4,0,0};
// char row_1[4] = {3,4,0,1};
// char row_2[4] = {7,0,0,0};
// char row_3[4] = {2,0,0,0};
// b = board_from_rows(row_0,row_1,row_2,row_3);
printf("\n");
print_board(b);
int move_ct = 0;
for(int i = 0; i < 2000; i++) {
int skip_move = 0;
int64 newb = makemovenum(b,getmove(b, i));
if (newb == b){
skip_move = 1;
} else {
b = newb;
}
if (skip_move == 0) {
b = rand_piece(b, move_ct);
++move_ct;
}
printf("\n\n");
print_board(b);
// getchar();
}
}
int main() {
//fill move table
for(int i = 0; i < 65536; i++) {
char rc[4];
rc[3] = (i >> 12) & 0xF;
rc[2] = (i >> 8) & 0xF;
rc[1] = (i >> 4) & 0xF;
rc[0] = i & 0xF;
for(int z = 0; z < 3; z++) {
for(int j = 0; j < 3; j++) {
if (rc[j] == 0 && rc[j+1] != 0) {
rc[j] = rc[j+1];
rc[j+1] = 0;
}
}
}
if (rc[0] == rc[1] && rc[0] != 0) {
rc[0] += 1;
rc[1] = rc[2];
rc[2] = rc[3];
rc[3] = 0;
}
if (rc[1] == rc[2] && rc[2] != 0) {
rc[1] += 1;
rc[2] = rc[3];
rc[3] = 0;
}
if (rc[2] == rc[3] && rc[3] != 0) {
rc[2] += 1;
rc[3] = 0;
}
d[i] = (rc[3] << 12) | (rc[2] << 8) | (rc[1] << 4) | (rc[0]);
}
//game logic
// char row_0[4] = {2,2,1,1};
// char row_1[4] = {1,2,1,1};
// char row_2[4] = {2,1,3,4};
// char row_3[4] = {1,2,4,6};
// int64 b = board_from_rows(row_0,row_1,row_2,row_3);
aiplay();
// playgame();
} |
the_stack_data/67324935.c | #include <stdio.h>
void get_odd_sum(int *arr);
void get_even_sum(int *arr);
int main(void)
{
int input[10];
int i;
printf("입력한 값까지 짝수 or 홀수끼리의 합을 구하는 문제\n\n");
printf("총 10개의 숫자 입력: ");
for (i = 0; i < 10; i++)
scanf("%d", &input[i]);
printf("\n");
get_odd_sum(input);
get_even_sum(input);
return 0;
}
void get_odd_sum(int *arr)
{
int sum = 0;
int i;
printf("입력값 중 홀수: ");
for (i = 0; i < 10; i++)
if (*(arr + i) % 2 == 1) {
printf("%d ", *(arr + i));
sum += *(arr + i);
}
printf("\n");
printf("입력값의 홀수 합: %d\n\n", sum);
}
void get_even_sum(int *arr)
{
int sum = 0;
int i;
printf("입력값 중 짝수: ");
for (i = 0; i < 10; i++)
if (*(arr + i) % 2 == 0) {
printf("%d ", *(arr + i));
sum += *(arr + i);
}
printf("\n");
printf("입력값의 짝수 합: %d\n\n", sum);
} |
the_stack_data/1152742.c | #include <string.h>
#include <stdio.h>
/*
Attributes: FUNC IPARAM
*/
void func(int param1, int param2, int param3)
{
char buf[8];
gets(buf);
printf("%d %d %d %s\n", param1, param2, param3, buf);
}
int main()
{
func(1, 2, 3);
return 0;
}
|
the_stack_data/178265307.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lteresia <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/04 18:11:55 by lteresia #+# #+# */
/* Updated: 2021/09/04 18:26:54 by lteresia ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
|
the_stack_data/89199780.c | typedef enum {false,true} bool;
extern int __VERIFIER_nondet_int(void);
int main() {
int x;
int y;
int t;
x = __VERIFIER_nondet_int();
y = __VERIFIER_nondet_int();
while (x > y) {
t = x;
x = y;
y = t;
}
return 0;
}
|
the_stack_data/24122.c | #include <stdio.h>
#include <stdint.h>
char *format_phone(uint32_t phone) {
static char phoneStr[21] = "";
if (phone >= 100000000 && phone <= 999999999) {
sprintf(phoneStr,"0%u.%02u.%02u.%02u.%02u",
phone / 100000000,
(phone / 1000000) % 100,
(phone / 10000) % 100,
(phone / 100) % 100,
phone % 100
);
} else if(phone >= 100000 && phone <= 999999) {
sprintf(phoneStr,"%03u %03u",
(phone / 1000) % 1000,
phone % 1000
);
} else if(phone >= 1000 && phone <= 9999) {
sprintf(phoneStr,"%02u %02u",
(phone / 100) % 100,
phone % 100
);
} else {
sprintf(phoneStr, "%u", phone);
}
return phoneStr;
} |
the_stack_data/623398.c | /* bug seen in Expressions/partial_eval01.c, but not reproduced here */
int foo(int i)
{
int j;
int n;
if(n>0)
return j = i++ + 0;
else if(n<0)
return i++ + 0;
else
return 1+2+3;
}
|
the_stack_data/1093521.c | /*
* Unit test for compound literal C99-to-C89 replacement.
*/
typedef struct AVRational { int num, den; } AVRational;
struct AVRational2 { int num; int den; char **test[3]; };
typedef struct AVRational2 AVRational2;
typedef struct AVRational4 AVRational4;
typedef struct { int num, den; struct AVRational test; } AVRational3;
static AVRational gap_test() {
AVRational gap = { .den = 4 };
gap.num = 1;
return gap;
}
static AVRational call_function_2(AVRational x)
{
AVRational y = (struct AVRational) { x.den, x.num };
int z = -1; // unused
y = (AVRational) { y.den, y.num };
if (z == 0)
return (AVRational) { 5, -5 };
else
return x.num > 0 ? (AVRational) { x.num, x.den } :
x.den > 0 ? (AVRational) { x.den, x.num } :
(AVRational) { 0, 0 };
}
static int call_function_3(AVRational x)
{
return x.num ^ x.den;
}
static int call_function(AVRational x)
{
AVRational y = x.num > 0 ? call_function_2((AVRational) { x.num, x.den }) :
x.den > 0 ? call_function_2((AVRational) { x.den, x.num }) :
call_function_2((AVRational) { 0, 0 });
int res;
if ((res = call_function_3((AVRational) { 5, -5 }) > 0)) {
return ((AVRational) { -8, 8 }).den;
} else if (1 && (res = call_function_3((AVRational) { 6, -6 }) > 0)) {
return call_function_3((AVRational) { -5, 5 });
} else
return 0;
}
#define lut_vals(x) x, x+1, x+2, x+3
#define lut(x) { lut_vals(x), lut_vals(x+4) }
static const int l[][8] = {
lut(0),
lut(16),
lut(32),
lut(48)
};
typedef struct AVCodec {
int (*decode) (AVRational x);
const int *samplefmts;
} AVCodec;
static AVCodec decoder = {
.samplefmts = (const int[]) { 0, 1 },
.decode = call_function,
};
typedef struct AVFilterPad {
const char *name;
} AVFilterPad;
typedef struct AVFilter {
const char *name;
const AVFilterPad *inputs;
} AVFilter;
AVFilter filter = {
.name = "filter",
.inputs = (const AVFilterPad[]) {{.name="pad",},{.name=(void*)0,},},
};
int main(int argc, char *argv[])
{
int var;
#define X 3
switch (call_function((AVRational){1, 1})) {
case 0:
call_function((AVRational){2, 2});
break;
default:
call_function((AVRational){3, 3});
break;
}
var = ((const int[2]){1,2})[argc];
var = call_function((AVRational){1, 2});
if (var == 0) return call_function((AVRational){X, 2});
else return call_function((AVRational){2, X});
#undef X
}
|
the_stack_data/836459.c | /*
* Copyright (c) 1987 Fujitsu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef lint
static char sccsid[] = "@(#)malloc.c 1.2 (Lucasfilm) 84/10/17";
/* from malloc.c 4.3 (Berkeley) 9/16/83 */
#endif
/*
* malloc.c (Caltech) 2/21/82
* Chris Kingsley, kingsley@cit-20.
*
* This is a very fast storage allocator. It allocates blocks of a small
* number of different sizes, and keeps free lists of each size. Blocks that
* don't exactly fit are passed up to the next larger size. In this
* implementation, the available sizes are 2^n-4 (or 2^n-12) bytes long.
* This is designed for use in a program that uses vast quantities of memory,
* but bombs when it runs out.
*/
#include <sys/types.h>
#define NULL 0
/*
* The overhead on a block is at least 4 bytes. When free, this space
* contains a pointer to the next free block, and the bottom two bits must
* be zero. When in use, the first byte is set to MAGIC, and the second
* byte is the size index. The remaining bytes are for alignment.
* If range checking is enabled and the size of the block fits
* in two bytes, then the top two bytes hold the size of the requested block
* plus the range checking words, and the header word MINUS ONE.
*/
union overhead {
union overhead *ov_next; /* when free */
struct {
u_char ovu_magic; /* magic number */
u_char ovu_index; /* bucket # */
#ifdef RCHECK
u_short ovu_size; /* actual block size */
u_int ovu_rmagic; /* range magic number */
#endif
} ovu;
#define ov_magic ovu.ovu_magic
#define ov_index ovu.ovu_index
#define ov_size ovu.ovu_size
#define ov_rmagic ovu.ovu_rmagic
};
#define MAGIC 0xff /* magic # on accounting info */
#define RMAGIC 0x55555555 /* magic # on range info */
#ifdef RCHECK
#define RSLOP sizeof (u_int)
#else
#define RSLOP 0
#endif
/*
* nextf[i] is the pointer to the next free block of size 2^(i+3). The
* smallest allocatable block is 8 bytes. The overhead information
* precedes the data area returned to the user.
*/
#define NBUCKETS 30
static union overhead *nextf[NBUCKETS];
extern char *sbrk(int);
#ifdef MSTATS
/*
* nmalloc[i] is the difference between the number of mallocs and frees
* for a given block size.
*/
static u_int nmalloc[NBUCKETS];
#include <stdio.h>
#endif
#ifdef debug
#define ASSERT(p) if (!(p)) botch("p"); else
static
botch(s)
char *s;
{
printf("assertion botched: %s\n", s);
abort();
}
#else
#define ASSERT(p)
#endif
static void morecore(int);
static int findbucket(union overhead *, int);
char *
malloc(register unsigned int nbytes)
{
register union overhead *p;
register int bucket = 0;
register unsigned shiftr;
/*
* Convert amount of memory requested into
* closest block size stored in hash buckets
* which satisfies request. Account for
* space used per block for accounting.
*/
nbytes += sizeof (union overhead) + RSLOP;
nbytes = (nbytes + 3) &~ 3;
shiftr = (nbytes - 1) >> 2;
/* apart from this loop, this is O(1) */
while (shiftr >>= 1)
bucket++;
/*
* If nothing in hash bucket right now,
* request more memory from the system.
*/
if (nextf[bucket] == NULL)
morecore(bucket);
if ((p = (union overhead *)nextf[bucket]) == NULL)
return (NULL);
/* remove from linked list */
nextf[bucket] = nextf[bucket]->ov_next;
p->ov_magic = MAGIC;
p->ov_index= bucket;
#ifdef MSTATS
nmalloc[bucket]++;
#endif
#ifdef RCHECK
/*
* Record allocated size of block and
* bound space with magic numbers.
*/
if (nbytes <= 0x10000)
p->ov_size = nbytes - 1;
p->ov_rmagic = RMAGIC;
*((u_int *)((caddr_t)p + nbytes - RSLOP)) = RMAGIC;
#endif
return ((char *)(p + 1));
}
/*
* Allocate more memory to the indicated bucket.
*/
static void
morecore(register int bucket)
{
register union overhead *op;
register int rnu; /* 2^rnu bytes will be requested */
register int nblks; /* become nblks blocks of the desired size */
register int siz;
if (nextf[bucket])
return;
/*
* Insure memory is allocated
* on a page boundary. Should
* make getpageize call?
*/
op = (union overhead *)sbrk(0);
if ((int)op & 0x3ff)
sbrk(1024 - ((int)op & 0x3ff));
/* take 2k unless the block is bigger than that */
/* rnu = (bucket <= 8) ? 11 : bucket + 3; */
rnu = (bucket <= 10) ? 13 : bucket + 3; /* now grab 8k 'cbm' */
nblks = 1 << (rnu - (bucket + 3)); /* how many blocks to get */
if (rnu < bucket)
rnu = bucket;
op = (union overhead *)sbrk(1 << rnu);
/* no more room! */
if ((int)op == -1)
return;
/*
* Round up to minimum allocation size boundary
* and deduct from block count to reflect.
*/
if ((int)op & 7) {
op = (union overhead *)(((int)op + 8) &~ 7);
nblks--;
}
/*
* Add new memory allocated to that on
* free list for this hash bucket.
*/
nextf[bucket] = op;
siz = 1 << (bucket + 3);
while (--nblks > 0) {
op->ov_next = (union overhead *)((caddr_t)op + siz);
op = (union overhead *)((caddr_t)op + siz);
}
}
void
free(char *cp)
{
register int size;
register union overhead *op;
if (cp == NULL)
return;
op = (union overhead *)((caddr_t)cp - sizeof (union overhead));
#ifdef debug
ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */
#else
if (op->ov_magic != MAGIC)
return; /* sanity */
#endif
#ifdef RCHECK
ASSERT(op->ov_rmagic == RMAGIC);
if (op->ov_index <= 13)
ASSERT(*(u_int *)((caddr_t)op + op->ov_size + 1 - RSLOP) == RMAGIC);
#endif
ASSERT(op->ov_index < NBUCKETS);
size = op->ov_index;
op->ov_next = nextf[size];
nextf[size] = op;
#ifdef MSTATS
nmalloc[size]--;
#endif
}
/*
* When a program attempts "storage compaction" as mentioned in the
* old malloc man page, it realloc's an already freed block. Usually
* this is the last block it freed; occasionally it might be farther
* back. We have to search all the free lists for the block in order
* to determine its bucket: 1st we make one pass thru the lists
* checking only the first block in each; if that fails we search
* ``realloc_srchlen'' blocks in each list for a match (the variable
* is extern so the caller can modify it). If that fails we just copy
* however many bytes was given to realloc() and hope it's not huge.
*/
int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */
char *
realloc(char *cp, unsigned int nbytes)
{
register u_int onb;
union overhead *op;
char *res;
register int i;
int was_alloced = 0;
if (cp == NULL)
return (malloc(nbytes));
op = (union overhead *)((caddr_t)cp - sizeof (union overhead));
if (op->ov_magic == MAGIC) {
was_alloced++;
i = op->ov_index;
} else {
/*
* Already free, doing "compaction".
*
* Search for the old block of memory on the
* free list. First, check the most common
* case (last element free'd), then (this failing)
* the last ``realloc_srchlen'' items free'd.
* If all lookups fail, then assume the size of
* the memory block being realloc'd is the
* smallest possible.
*/
if ((i = findbucket(op, 1)) < 0 &&
(i = findbucket(op, realloc_srchlen)) < 0)
i = 0;
}
onb = (1 << (i + 3)) - sizeof (*op) - RSLOP;
/* avoid the copy if same size block */
if (was_alloced &&
nbytes <= onb && nbytes > (onb >> 1) - sizeof(*op) - RSLOP)
return(cp);
if ((res = malloc(nbytes)) == NULL)
return (NULL);
if (cp != res) /* common optimization */
bcopy(cp, res, (nbytes < onb) ? nbytes : onb);
if (was_alloced)
free(cp);
return (res);
}
/*
* Search ``srchlen'' elements of each free list for a block whose
* header starts at ``freep''. If srchlen is -1 search the whole list.
* Return bucket number, or -1 if not found.
*/
static
findbucket(union overhead *freep, int srchlen)
{
register union overhead *p;
register int i, j;
for (i = 0; i < NBUCKETS; i++) {
j = 0;
for (p = nextf[i]; p && j != srchlen; p = p->ov_next) {
if (p == freep)
return (i);
j++;
}
}
return (-1);
}
#ifdef MSTATS
/*
* mstats - print out statistics about malloc
*
* Prints two lines of numbers, one showing the length of the free list
* for each size category, the second showing the number of mallocs -
* frees for each size category.
*/
mstats(s)
char *s;
{
register int i, j;
register union overhead *p;
int totfree = 0,
totused = 0;
fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s);
for (i = 0; i < NBUCKETS; i++) {
for (j = 0, p = nextf[i]; p; p = p->ov_next, j++)
;
fprintf(stderr, " %d", j);
totfree += j * (1 << (i + 3));
}
fprintf(stderr, "\nused:\t");
for (i = 0; i < NBUCKETS; i++) {
fprintf(stderr, " %d", nmalloc[i]);
totused += nmalloc[i] * (1 << (i + 3));
}
fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n",
totused, totfree);
}
#endif
|
the_stack_data/123485.c | #include <stdio.h>
#include <stdlib.h>
#define SWAP(a , b) do{int temp=a;a=b;b=temp;}while(0)
static void ssort(int *array , int n){
int i = 0,
j = 0,
pos = 0;
while(i<n){
pos = i;
j = i + 1;
while(j<n){
if(*(array + j) < *(array + pos)){
pos = j;
}
++j;
}
if(pos != i){
SWAP(*(array + i),
*(array + pos));
}
++i;
}
}
int main(int ac , char **av){
int n = ac - 1,
*arr = NULL,
*p = NULL;
if(!n){
printf("Usage: %s [NUMBERS.... ]\n" , *av);
return -1;
}
p = arr = calloc(n + 1 , sizeof(*arr));
++av;
while(*av){
*p++ = atoi(*av);
++av;
}
ssort(arr , n);
p = arr;
while(*p){
printf(" %d " , *p++);
}
putchar('\n');
free(arr);
return 0;
}
|
the_stack_data/48574298.c |
/* text version of maze 'mazefiles/binary/mont88a.maz'
generated by mazetool (c) Peter Harrison 2018
o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o
| | | | | |
o o o o o o o---o---o---o---o---o---o o---o o o
| | | | | | | | | | |
o o o o o---o---o o o o---o o o---o o---o o
| | | | | | | | | | |
o o o o o---o o o o o o o o---o---o o o
| | | | | | | | | | |
o o---o---o o o o---o---o---o---o o---o---o---o---o o
| | | | | | | |
o o o o o---o o o o o---o---o o---o---o o o
| | | | | | | | | |
o o o o---o o---o o o o o---o---o---o o o o
| | | | | | | | | | |
o o o o o---o o---o---o---o---o---o o o---o o o
| | | | | | | | | | |
o o o o---o o---o o o o o o---o o---o---o---o
| | | | | | | | |
o o o o o---o o o---o---o---o---o---o---o---o---o o
| | | | | | |
o o o o o o o---o o o---o---o---o---o---o---o---o
| | | | | | | |
o o o o o o o---o---o---o---o---o o---o---o---o---o
| | | | | | | |
o o o o o o o---o---o---o---o---o o o o o o
| | | | | | | | | | |
o---o---o o o o---o o---o---o---o---o---o---o---o o o
| | | | | | | | | | |
o o---o o o o o---o o---o o o o o o---o o
| | | | | | | |
o o o o o---o o o---o---o o o o o o o o
| | | | | | | | | | | |
o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o
*/
int mont88a_maz[] ={
0x0E, 0x0A, 0x09, 0x0E, 0x08, 0x0A, 0x08, 0x0A, 0x08, 0x0A, 0x0A, 0x0A, 0x0A, 0x08, 0x0A, 0x09,
0x0C, 0x0B, 0x05, 0x0E, 0x02, 0x0A, 0x02, 0x0A, 0x02, 0x0A, 0x0A, 0x09, 0x0C, 0x02, 0x0A, 0x03,
0x06, 0x0A, 0x00, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x08, 0x0A, 0x03, 0x06, 0x0A, 0x0A, 0x09,
0x0C, 0x0A, 0x02, 0x0A, 0x0A, 0x0A, 0x08, 0x0B, 0x0C, 0x03, 0x0C, 0x0A, 0x0A, 0x0A, 0x08, 0x03,
0x07, 0x0E, 0x0A, 0x0A, 0x0A, 0x0A, 0x03, 0x0C, 0x03, 0x0C, 0x01, 0x0C, 0x0B, 0x0D, 0x04, 0x0B,
0x0E, 0x08, 0x0B, 0x0C, 0x08, 0x08, 0x0A, 0x03, 0x0C, 0x03, 0x06, 0x00, 0x0A, 0x01, 0x06, 0x09,
0x0C, 0x03, 0x0C, 0x03, 0x05, 0x05, 0x0C, 0x0A, 0x03, 0x0E, 0x0A, 0x01, 0x0C, 0x02, 0x0B, 0x05,
0x05, 0x0C, 0x01, 0x0D, 0x07, 0x06, 0x03, 0x0C, 0x09, 0x0C, 0x0A, 0x03, 0x06, 0x0A, 0x09, 0x05,
0x05, 0x05, 0x07, 0x05, 0x0D, 0x0C, 0x09, 0x04, 0x03, 0x06, 0x0A, 0x09, 0x0E, 0x08, 0x03, 0x05,
0x06, 0x00, 0x0B, 0x05, 0x05, 0x05, 0x05, 0x06, 0x09, 0x0C, 0x09, 0x07, 0x0C, 0x03, 0x0D, 0x05,
0x0E, 0x00, 0x0B, 0x05, 0x05, 0x05, 0x05, 0x0C, 0x03, 0x05, 0x05, 0x0C, 0x02, 0x0A, 0x03, 0x05,
0x0E, 0x00, 0x0B, 0x04, 0x02, 0x01, 0x05, 0x05, 0x0E, 0x03, 0x04, 0x01, 0x0C, 0x08, 0x09, 0x05,
0x0E, 0x00, 0x0B, 0x06, 0x09, 0x05, 0x05, 0x04, 0x0A, 0x09, 0x05, 0x05, 0x05, 0x07, 0x06, 0x03,
0x0E, 0x00, 0x09, 0x0E, 0x01, 0x05, 0x05, 0x05, 0x0D, 0x06, 0x03, 0x05, 0x05, 0x0C, 0x09, 0x0D,
0x0E, 0x01, 0x06, 0x0A, 0x01, 0x05, 0x05, 0x05, 0x06, 0x0A, 0x08, 0x03, 0x06, 0x03, 0x06, 0x01,
0x0E, 0x02, 0x0A, 0x0A, 0x03, 0x07, 0x06, 0x03, 0x0E, 0x0A, 0x02, 0x0A, 0x0A, 0x0A, 0x0A, 0x03,
};
/* end of mazefile */
|
the_stack_data/84976.c | #include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <signal.h>
int hijos;
void Usage() {
printf("Usage:signals00 ejecutable [arg2..argn]\n");
printf("Este programa crea tantos procesos como argumentos recibe menos 1 que luego mutan al programa especificado\n");
}
void error_y_exit(char *s, int error) {
perror(s);
exit(error);
}
void print_child(int pid, int status) {
if (WIFEXITED(status))
{
// Ha terminado por culpa de un exit
int exitcode = WEXITSTATUS(status);
printf("El proceso %d termina con exit code %d\n", pid, exitcode);
}
else {
// Ha terminado por un signal
int signalcode = WTERMSIG(status);
printf("El proceso %d termina con signal code %d\n", pid, signalcode);
}
}
void ras(int s) {
if (s == SIGCHLD) {
int res;
int status;
while ((res = waitpid(-1, &status, WNOHANG)) > 0) {
print_child(res, status);
--hijos;
}
}
}
int main(int argc, char *argv[])
{
if (argc >= 2) {
char *programa = argv[1];
argv++;
hijos = argc - 1;
sigset_t mask;
struct sigaction sa;
// Block signals
sigemptyset(&mask);
sigaddset(&mask, SIGCHLD);
sigprocmask(SIG_BLOCK, &mask, NULL);
// Reprogram SIGCHLD
sa.sa_handler = ras;
sa.sa_flags = SA_RESTART;
sigaction(SIGCHLD, &sa, NULL);
for (int i = 1; i < argc; ++i) {
int pid = fork();
if (pid == 0) {
// Como el proceso muta, se pierde la reprogramación de los signals
execvp(programa, argv);
error_y_exit("Error en el execvp", 1);
}
if (pid < 0) {
error_y_exit("Error en el fork", 1);
}
}
sigprocmask(SIG_UNBLOCK, &mask, NULL);
while (hijos > 0);
}
else {
Usage();
}
} |
the_stack_data/405816.c | /*This code shows the use of file handling which is
*very useful when it comes to projects in C
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int primeTest(int n)
{
int j, flag = -1;
for (j = 2; j <= sqrt(n); j++)
{
if (n % j == 0)
{
flag = 1;
break;
}
}
if (flag == 1)
return 0;
else
return 1;
}
int main()
{
int i;
char c;
FILE *src, *trg;
src = fopen("source.txt", "w");
if (src == NULL)
{
printf("ERROR IN OPENING FILE\n");
return 0;
}
for (i = 1001; i < 10000; i++)
fprintf(src, "%d ", i);
fclose(src);
trg = fopen("target.txt", "w");
src = fopen("source.txt", "r");
if (trg == NULL || src == NULL)
{
printf("ERROR IN OPENING FILE\n");
return 0;
}
while ((fscanf(src, "%d", &i)) != -1)
{
if (primeTest(i))
fprintf(trg, "%d ", i);
}
fclose(src);
fclose(trg);
}
|
the_stack_data/810097.c | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
const int INVALID_PID = -99999;
void printprocessid(int pid1, int pid2, int pid3)
{
printf("real pid: %d; real parent pid: %d; pid1: %d; pid2: %d; pid3: %d; (%d means pid not assigned); ",
getpid(), getppid(), pid1, pid2, pid3, INVALID_PID);
}
int main(int argc, char *argv[])
{
char command[64];
pid_t pidA, pidB, pidC;
pidA =0; pidB = 0; pidC = 0;
pidB = fork();
if (pidB == 0) {
pidA = fork();
pidC = fork();
}
else {
pidC = fork();
if (pidC == 0)
pidA = fork();
}
while(wait(NULL) > 0);
// snprintf(command, sizeof command, "ps -aef --forest | grep %s | grep -v grep", argv[0]);
// system(command);
if (pidA == 0 && pidB == 0)
{
snprintf(command, sizeof command, "ps -aef --forest | grep %s | grep -v grep", argv[0]);
system(command);
}
if (pidB == 0 && pidC == 0)
{
snprintf(command, sizeof command, "ps -aef --forest | grep %s | grep -v grep", argv[0]);
system(command);
}
} |
the_stack_data/90765213.c | /****************************************************************************//**
\file extMemReader.c
\brief Look through action, check image crc and read data from external memory.
\author
Atmel Corporation: http://www.atmel.com \n
Support email: [email protected]
Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
Licensed under Atmel's Limited License Agreement (BitCloudTM).
\internal
History:
17/08/09 A. Khromykh - Created
*******************************************************************************/
/******************************************************************************
Includes section
******************************************************************************/
#ifdef EXT_MEMORY
#include <types.h>
#include <extMemReader.h>
#include <spiMemInterface.h>
#include <bootStructure.h>
#include <eepromLoader.h>
#include <flashLoader.h>
#include <abstractSerializer.h>
/******************************************************************************
External global variables section
******************************************************************************/
extern const uint32_t imageStartAddress[POSITION_MAX];
extern BootBuffer_t dataBuffer;
/******************************************************************************
Global variables section
******************************************************************************/
uint8_t readCrc;
uint8_t countedCrc = CRC_INITIALIZATION_VALUE;
ImagePosition_t imageNumber;
uint8_t eepromServiceArea[SERVICE_INFO_SIZE];
/******************************************************************************
Prototypes section
******************************************************************************/
static inline uint8_t extMemCrc(uint8_t crc, uint8_t *pcBlock, uint8_t length);
static inline void extCleanServiceEepromArea(void);
static inline bool extCheckAction(void);
static inline bool extCheckCrc(void);
static inline void extReadDataForFlashArea(void);
static inline void extReadDataForEepromArea(void);
/******************************************************************************
Implementations section
******************************************************************************/
/**************************************************************************//**
\brief Counts crc current memory area. CRC-8. Polynom 0x31 x^8 + x^5 + x^4 + 1.
\param[in]
crc - first crc state
\param[in]
pcBlock - pointer to the memory for crc counting
\param[in]
length - memory size
\return
current area crc
******************************************************************************/
static inline uint8_t extMemCrc(uint8_t crc, uint8_t *pcBlock, uint8_t length)
{
uint8_t i;
while (length--)
{
crc ^= *pcBlock++;
for (i = 0; i < 8; i++)
crc = crc & 0x80 ? (crc << 1) ^ 0x31 : crc << 1;
}
return crc;
}
/**************************************************************************//**
\brief Clears eeprom service area.
******************************************************************************/
static inline void extCleanServiceEepromArea(void)
{
memset(dataBuffer.data, EMPTY_EEPROM_VALUE, SERVICE_INFO_SIZE);
dataBuffer.address = EEPROM_START_ADDRESS;
dataBuffer.dataSize = SERVICE_INFO_SIZE;
eepromPacketToPage();
eepromFlushPage();
}
/**************************************************************************//**
\brief Checks bootloader action. Clears service area if incorrect action.
\return
true - correct action, \n
false - other
******************************************************************************/
static inline bool extCheckAction(void)
{
uint8_t i;
for (i = 0; i < SERVICE_INFO_SIZE; i++)
eepromServiceArea[i] = eepromReadData(i);
imageNumber = (ImagePosition_t)eepromServiceArea[ACTION_POSITION];
// check eeprom service area
if (!(imageNumber < POSITION_MAX))
{
if (EMPTY_EEPROM_VALUE != eepromServiceArea[ACTION_POSITION])
{ // clear service eeprom area
extCleanServiceEepromArea();
}
return false;
}
readCrc = eepromServiceArea[imageNumber+1];
return true;
}
/**************************************************************************//**
\brief Checks image crc. Clears service area if incorrect crc.
\return
true - correct crc, \n
false - other
******************************************************************************/
static inline bool extCheckCrc(void)
{
uint32_t address = 0ul;
while (address < IMAGE_SIZE)
{
memReadData(address+imageStartAddress[imageNumber], dataBuffer.data, SREC_DATA_LENGTH);
countedCrc = extMemCrc(countedCrc, dataBuffer.data, SREC_DATA_LENGTH);
address += SREC_DATA_LENGTH;
}
if (countedCrc == readCrc)
{
return true;
}
else
{ // clear service eeprom area
extCleanServiceEepromArea();
return false;
}
}
/**************************************************************************//**
\brief Reads data from external flash and loads to internal flash.
******************************************************************************/
static inline void extReadDataForFlashArea(void)
{
uint32_t address = 0ul;
while (address < MCU_FLASH_SIZE)
{
memReadData(address+imageStartAddress[imageNumber], dataBuffer.data, SREC_DATA_LENGTH);
dataBuffer.address = address;
dataBuffer.dataSize = SREC_DATA_LENGTH;
flashPacketToPage();
address += SREC_DATA_LENGTH;
}
flashFlushPage();
}
/**************************************************************************//**
\brief Reads data from external flash and loads to internal eeprom.
******************************************************************************/
static inline void extReadDataForEepromArea(void)
{
uint32_t address = MCU_FLASH_SIZE;
uint32_t eepromAddres = EEPROM_START_ADDRESS;
while (address < IMAGE_SIZE)
{
memReadData(address+imageStartAddress[imageNumber], dataBuffer.data, SREC_DATA_LENGTH);
dataBuffer.address = eepromAddres;
dataBuffer.dataSize = SREC_DATA_LENGTH;
if (EEPROM_START_ADDRESS == eepromAddres)
{ // delete bootloader action
eepromServiceArea[ACTION_POSITION] = EMPTY_EEPROM_VALUE;
memcpy(dataBuffer.data, eepromServiceArea, SERVICE_INFO_SIZE);
}
eepromPacketToPage();
eepromAddres += SREC_DATA_LENGTH;
address += SREC_DATA_LENGTH;
}
eepromFlushPage();
}
/**************************************************************************//**
\brief Starts external flash loader. Makes all tests and loads image.
******************************************************************************/
void extLoadDataFromExtMem(void)
{
// init serial interface
spiMemInit();
// check availability of the external flash
if (false == memCheckMem())
{
spiMemUnInit();
return;
}
// checks action
if (false == extCheckAction())
{
spiMemUnInit();
return;
}
// checks crc
if (false == extCheckCrc())
{
spiMemUnInit();
return;
}
// load internal flash
extReadDataForFlashArea();
// load internal eeprom
extReadDataForEepromArea();
// clear spi interface
spiMemUnInit();
// clear low level initialization
lowLevelUnInit();
// go to NULL address
void(* startAddress)(void) =(void(*)(void))NULL;
// nulling extended indirect register for indirect call out memory
CLEAR_EIND();
// go to NULL address
startAddress();
}
#endif //EXT_MEMORY
// eof extMemReader.c
|
the_stack_data/48575110.c | /*Programmer Chase Singhofen
date 10/25/2016
Specifications:in class work*/
#include<stdio.h>
#include<stdlib.h>
main() {
int num = 1, sum = 0, i = 0, total = 4;
double avg = 0;
printf("enter four numbers\n");
for (i = 1; i < 4; i++)
{
scanf_s("%i\n", &num);
sum = sum + num;//sum = sum + new number
}
avg = (double)sum / 4;//type casting
printf("print average %lf\n", avg);
system("pause");
}
//end main |
the_stack_data/383391.c | #include "stdio.h"
int main(int argc, char const *argv[])
{
unsigned int limit = 10;
unsigned int sumOfSquare = 0;
unsigned int squareOfSum = 0;
for (unsigned int i = 1; i <= limit; i++)
{
sumOfSquare+=(i * i);
squareOfSum+=i;
}
squareOfSum*=squareOfSum;
printf("diff = %u - %u = %u", squareOfSum , sumOfSquare, squareOfSum - sumOfSquare);
return 0;
}
|
the_stack_data/682844.c | /*
* Phoenix-RTOS
*
* libphoenix
*
* in6.c
*
* Copyright 2019 Phoenix Systems
* Author: Kamil Amanowicz
*
* This file is part of Phoenix-RTOS.
*
* %LICENSE%
*/
#include <netinet/in.h>
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
|
the_stack_data/907226.c | #include <stdio.h>
int main() {
int b, w, b_even, w_even, two_even, two_odd;
scanf("%d", &b);
scanf("%d", &w);
b_even = (b % 2) == 0;
w_even = (w % 2) == 0;
two_even = (b_even && w_even);
two_odd = (!b_even && !w_even);
if (two_even || two_odd) {
printf("1\n");
} else {
printf("0\n");
}
return 0;
}
|
the_stack_data/87638795.c | //Sean Staz
//CSci 423
//Operating Systems
//Dr. Feng Wang
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
printf("\n\nWelcome to Hailstone, by Sean Staz\n");
int n=0;
int k=0;
pid_t pid;
do
{
printf("Please enter a number greater than 0 to run the Collatz Conjecture.\n");
scanf("%d", &k);
}while (k <= 0);
pid = fork();
if (pid == 0)
{
printf("Child is working...\n");
printf("%d\n",k);
while (k!=1)
{
if (k%2 == 0)
{
k = k/2;
}
else if (k%2 == 1)
{
k = 3 * (k) + 1;
}
printf("%d\n",k);
}
printf("Child process is done.\n");
}
else
{
printf("Parents is waiting on child process...\n");
wait();
printf("Parent process is done.\n");
}
return 0;
}
|
the_stack_data/34078.c | int h_var __attribute__((visibility("hidden")));
int p_var __attribute__((visibility("protected")));
int i_var __attribute__((visibility("internal")));
int d_var __attribute__((visibility("default")));
__attribute__((visibility("hidden"))) void h_rout();
__attribute__((visibility("protected"))) void p_rout();
__attribute__((visibility("internal"))) void i_rout();
__attribute__((visibility("default"))) void d_rout();
struct __attribute__((visibility("hidden"))) h_type {};
struct __attribute__((visibility("protected"))) p_type {};
struct __attribute__((visibility("internal"))) i_type {};
struct __attribute__((visibility("default"))) d_type {};
|
the_stack_data/472318.c | // C rmsbolt starter file
// Local Variables:
// rmsbolt-command: "/opt/riscv/bin/riscv32-unknown-elf-gcc -O3"
// rmsbolt-disassemble: nil
// End:
/**
* Represents a binary tree
*/
typedef struct {
unsigned int hasLeft : 1;
unsigned int leftIndex : 7;
unsigned int hasRight : 1;
unsigned int rightIndex : 7;
int value : 16;
} node;
int find(int findMe){
int found = 0;
node* currentNodeIdx = (node*)4;
int currentValue = 0;
while(!found){
currentValue = currentNodeIdx->value;
if(currentValue == findMe){
return (int)currentNodeIdx;
}
if((currentValue > findMe) && currentNodeIdx->hasLeft){
int nextNodeIdx = currentNodeIdx->leftIndex;
currentNodeIdx = (node*)(4 + (nextNodeIdx << 2));
continue;
}
if((currentValue < findMe) && currentNodeIdx->hasRight){
int nextNodeIdx = currentNodeIdx->rightIndex;
currentNodeIdx = (node*)(4 + (nextNodeIdx << 2));
continue;
}
return -1;
}
}
int main() {
int needle = *(int*)0;
return find(needle);
}
|
the_stack_data/99569.c | /* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <complex.h>
#ifdef complex
#undef complex
#endif
#ifdef I
#undef I
#endif
#if defined(_WIN64)
typedef long long BLASLONG;
typedef unsigned long long BLASULONG;
#else
typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif
#ifdef LAPACK_ILP64
typedef BLASLONG blasint;
#if defined(_WIN64)
#define blasabs(x) llabs(x)
#else
#define blasabs(x) labs(x)
#endif
#else
typedef int blasint;
#define blasabs(x) abs(x)
#endif
typedef blasint integer;
typedef unsigned int uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
#define pCf(z) (*_pCf(z))
#define pCd(z) (*_pCd(z))
typedef int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
typedef int flag;
typedef int ftnlen;
typedef int ftnint;
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (fabs(x))
#define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
#define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (f2cmin(a,b))
#define dmax(a,b) (f2cmax(a,b))
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
#define abort_() { sig_die("Fortran abort routine called", 1); }
#define c_abs(z) (cabsf(Cf(z)))
#define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
#define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
#define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
#define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
#define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
#define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
//#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
#define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
#define d_abs(x) (fabs(*(x)))
#define d_acos(x) (acos(*(x)))
#define d_asin(x) (asin(*(x)))
#define d_atan(x) (atan(*(x)))
#define d_atn2(x, y) (atan2(*(x),*(y)))
#define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
#define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); }
#define d_cos(x) (cos(*(x)))
#define d_cosh(x) (cosh(*(x)))
#define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
#define d_exp(x) (exp(*(x)))
#define d_imag(z) (cimag(Cd(z)))
#define r_imag(z) (cimag(Cf(z)))
#define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define d_log(x) (log(*(x)))
#define d_mod(x, y) (fmod(*(x), *(y)))
#define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
#define d_nint(x) u_nint(*(x))
#define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
#define d_sign(a,b) u_sign(*(a),*(b))
#define r_sign(a,b) u_sign(*(a),*(b))
#define d_sin(x) (sin(*(x)))
#define d_sinh(x) (sinh(*(x)))
#define d_sqrt(x) (sqrt(*(x)))
#define d_tan(x) (tan(*(x)))
#define d_tanh(x) (tanh(*(x)))
#define i_abs(x) abs(*(x))
#define i_dnnt(x) ((integer)u_nint(*(x)))
#define i_len(s, n) (n)
#define i_nint(x) ((integer)u_nint(*(x)))
#define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
#define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
#define pow_si(B,E) spow_ui(*(B),*(E))
#define pow_ri(B,E) spow_ui(*(B),*(E))
#define pow_di(B,E) dpow_ui(*(B),*(E))
#define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
#define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
#define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
#define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
#define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
#define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
#define sig_die(s, kill) { exit(1); }
#define s_stop(s, n) {exit(0);}
static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
#define z_abs(z) (cabs(Cd(z)))
#define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
#define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
#define myexit_() break;
#define mycycle() continue;
#define myceiling(w) {ceil(w)}
#define myhuge(w) {HUGE_VAL}
//#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
#define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef logical (*L_fp)(...);
#else
typedef logical (*L_fp)();
#endif
static float spow_ui(float x, integer n) {
float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static double dpow_ui(double x, integer n) {
double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static _Complex float cpow_ui(_Complex float x, integer n) {
_Complex float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static _Complex double zpow_ui(_Complex double x, integer n) {
_Complex double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static integer pow_ii(integer x, integer n) {
integer pow; unsigned long int u;
if (n <= 0) {
if (n == 0 || x == 1) pow = 1;
else if (x != -1) pow = x == 0 ? 1/x : 0;
else n = -n;
}
if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
u = n;
for(pow = 1; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static integer dmaxloc_(double *w, integer s, integer e, integer *n)
{
double m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static integer smaxloc_(float *w, integer s, integer e, integer *n)
{
float m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i]) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i]) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
#endif
/* -- translated by f2c (version 20000121).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
/* Table of constant values */
static complex c_b1 = {0.f,0.f};
static complex c_b2 = {1.f,0.f};
static integer c__1 = 1;
/* > \brief \b CHBGVX */
/* =========== DOCUMENTATION =========== */
/* Online html documentation available at */
/* http://www.netlib.org/lapack/explore-html/ */
/* > \htmlonly */
/* > Download CHBGVX + dependencies */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chbgvx.
f"> */
/* > [TGZ]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chbgvx.
f"> */
/* > [ZIP]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgvx.
f"> */
/* > [TXT]</a> */
/* > \endhtmlonly */
/* Definition: */
/* =========== */
/* SUBROUTINE CHBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB, */
/* LDBB, Q, LDQ, VL, VU, IL, IU, ABSTOL, M, W, Z, */
/* LDZ, WORK, RWORK, IWORK, IFAIL, INFO ) */
/* CHARACTER JOBZ, RANGE, UPLO */
/* INTEGER IL, INFO, IU, KA, KB, LDAB, LDBB, LDQ, LDZ, M, */
/* $ N */
/* REAL ABSTOL, VL, VU */
/* INTEGER IFAIL( * ), IWORK( * ) */
/* REAL RWORK( * ), W( * ) */
/* COMPLEX AB( LDAB, * ), BB( LDBB, * ), Q( LDQ, * ), */
/* $ WORK( * ), Z( LDZ, * ) */
/* > \par Purpose: */
/* ============= */
/* > */
/* > \verbatim */
/* > */
/* > CHBGVX computes all the eigenvalues, and optionally, the eigenvectors */
/* > of a complex generalized Hermitian-definite banded eigenproblem, of */
/* > the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian */
/* > and banded, and B is also positive definite. Eigenvalues and */
/* > eigenvectors can be selected by specifying either all eigenvalues, */
/* > a range of values or a range of indices for the desired eigenvalues. */
/* > \endverbatim */
/* Arguments: */
/* ========== */
/* > \param[in] JOBZ */
/* > \verbatim */
/* > JOBZ is CHARACTER*1 */
/* > = 'N': Compute eigenvalues only; */
/* > = 'V': Compute eigenvalues and eigenvectors. */
/* > \endverbatim */
/* > */
/* > \param[in] RANGE */
/* > \verbatim */
/* > RANGE is CHARACTER*1 */
/* > = 'A': all eigenvalues will be found; */
/* > = 'V': all eigenvalues in the half-open interval (VL,VU] */
/* > will be found; */
/* > = 'I': the IL-th through IU-th eigenvalues will be found. */
/* > \endverbatim */
/* > */
/* > \param[in] UPLO */
/* > \verbatim */
/* > UPLO is CHARACTER*1 */
/* > = 'U': Upper triangles of A and B are stored; */
/* > = 'L': Lower triangles of A and B are stored. */
/* > \endverbatim */
/* > */
/* > \param[in] N */
/* > \verbatim */
/* > N is INTEGER */
/* > The order of the matrices A and B. N >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in] KA */
/* > \verbatim */
/* > KA is INTEGER */
/* > The number of superdiagonals of the matrix A if UPLO = 'U', */
/* > or the number of subdiagonals if UPLO = 'L'. KA >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in] KB */
/* > \verbatim */
/* > KB is INTEGER */
/* > The number of superdiagonals of the matrix B if UPLO = 'U', */
/* > or the number of subdiagonals if UPLO = 'L'. KB >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in,out] AB */
/* > \verbatim */
/* > AB is COMPLEX array, dimension (LDAB, N) */
/* > On entry, the upper or lower triangle of the Hermitian band */
/* > matrix A, stored in the first ka+1 rows of the array. The */
/* > j-th column of A is stored in the j-th column of the array AB */
/* > as follows: */
/* > if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for f2cmax(1,j-ka)<=i<=j; */
/* > if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=f2cmin(n,j+ka). */
/* > */
/* > On exit, the contents of AB are destroyed. */
/* > \endverbatim */
/* > */
/* > \param[in] LDAB */
/* > \verbatim */
/* > LDAB is INTEGER */
/* > The leading dimension of the array AB. LDAB >= KA+1. */
/* > \endverbatim */
/* > */
/* > \param[in,out] BB */
/* > \verbatim */
/* > BB is COMPLEX array, dimension (LDBB, N) */
/* > On entry, the upper or lower triangle of the Hermitian band */
/* > matrix B, stored in the first kb+1 rows of the array. The */
/* > j-th column of B is stored in the j-th column of the array BB */
/* > as follows: */
/* > if UPLO = 'U', BB(kb+1+i-j,j) = B(i,j) for f2cmax(1,j-kb)<=i<=j; */
/* > if UPLO = 'L', BB(1+i-j,j) = B(i,j) for j<=i<=f2cmin(n,j+kb). */
/* > */
/* > On exit, the factor S from the split Cholesky factorization */
/* > B = S**H*S, as returned by CPBSTF. */
/* > \endverbatim */
/* > */
/* > \param[in] LDBB */
/* > \verbatim */
/* > LDBB is INTEGER */
/* > The leading dimension of the array BB. LDBB >= KB+1. */
/* > \endverbatim */
/* > */
/* > \param[out] Q */
/* > \verbatim */
/* > Q is COMPLEX array, dimension (LDQ, N) */
/* > If JOBZ = 'V', the n-by-n matrix used in the reduction of */
/* > A*x = (lambda)*B*x to standard form, i.e. C*x = (lambda)*x, */
/* > and consequently C to tridiagonal form. */
/* > If JOBZ = 'N', the array Q is not referenced. */
/* > \endverbatim */
/* > */
/* > \param[in] LDQ */
/* > \verbatim */
/* > LDQ is INTEGER */
/* > The leading dimension of the array Q. If JOBZ = 'N', */
/* > LDQ >= 1. If JOBZ = 'V', LDQ >= f2cmax(1,N). */
/* > \endverbatim */
/* > */
/* > \param[in] VL */
/* > \verbatim */
/* > VL is REAL */
/* > */
/* > If RANGE='V', the lower bound of the interval to */
/* > be searched for eigenvalues. VL < VU. */
/* > Not referenced if RANGE = 'A' or 'I'. */
/* > \endverbatim */
/* > */
/* > \param[in] VU */
/* > \verbatim */
/* > VU is REAL */
/* > */
/* > If RANGE='V', the upper bound of the interval to */
/* > be searched for eigenvalues. VL < VU. */
/* > Not referenced if RANGE = 'A' or 'I'. */
/* > \endverbatim */
/* > */
/* > \param[in] IL */
/* > \verbatim */
/* > IL is INTEGER */
/* > */
/* > If RANGE='I', the index of the */
/* > smallest eigenvalue to be returned. */
/* > 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. */
/* > Not referenced if RANGE = 'A' or 'V'. */
/* > \endverbatim */
/* > */
/* > \param[in] IU */
/* > \verbatim */
/* > IU is INTEGER */
/* > */
/* > If RANGE='I', the index of the */
/* > largest eigenvalue to be returned. */
/* > 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. */
/* > Not referenced if RANGE = 'A' or 'V'. */
/* > \endverbatim */
/* > */
/* > \param[in] ABSTOL */
/* > \verbatim */
/* > ABSTOL is REAL */
/* > The absolute error tolerance for the eigenvalues. */
/* > An approximate eigenvalue is accepted as converged */
/* > when it is determined to lie in an interval [a,b] */
/* > of width less than or equal to */
/* > */
/* > ABSTOL + EPS * f2cmax( |a|,|b| ) , */
/* > */
/* > where EPS is the machine precision. If ABSTOL is less than */
/* > or equal to zero, then EPS*|T| will be used in its place, */
/* > where |T| is the 1-norm of the tridiagonal matrix obtained */
/* > by reducing AP to tridiagonal form. */
/* > */
/* > Eigenvalues will be computed most accurately when ABSTOL is */
/* > set to twice the underflow threshold 2*SLAMCH('S'), not zero. */
/* > If this routine returns with INFO>0, indicating that some */
/* > eigenvectors did not converge, try setting ABSTOL to */
/* > 2*SLAMCH('S'). */
/* > \endverbatim */
/* > */
/* > \param[out] M */
/* > \verbatim */
/* > M is INTEGER */
/* > The total number of eigenvalues found. 0 <= M <= N. */
/* > If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1. */
/* > \endverbatim */
/* > */
/* > \param[out] W */
/* > \verbatim */
/* > W is REAL array, dimension (N) */
/* > If INFO = 0, the eigenvalues in ascending order. */
/* > \endverbatim */
/* > */
/* > \param[out] Z */
/* > \verbatim */
/* > Z is COMPLEX array, dimension (LDZ, N) */
/* > If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of */
/* > eigenvectors, with the i-th column of Z holding the */
/* > eigenvector associated with W(i). The eigenvectors are */
/* > normalized so that Z**H*B*Z = I. */
/* > If JOBZ = 'N', then Z is not referenced. */
/* > \endverbatim */
/* > */
/* > \param[in] LDZ */
/* > \verbatim */
/* > LDZ is INTEGER */
/* > The leading dimension of the array Z. LDZ >= 1, and if */
/* > JOBZ = 'V', LDZ >= N. */
/* > \endverbatim */
/* > */
/* > \param[out] WORK */
/* > \verbatim */
/* > WORK is COMPLEX array, dimension (N) */
/* > \endverbatim */
/* > */
/* > \param[out] RWORK */
/* > \verbatim */
/* > RWORK is REAL array, dimension (7*N) */
/* > \endverbatim */
/* > */
/* > \param[out] IWORK */
/* > \verbatim */
/* > IWORK is INTEGER array, dimension (5*N) */
/* > \endverbatim */
/* > */
/* > \param[out] IFAIL */
/* > \verbatim */
/* > IFAIL is INTEGER array, dimension (N) */
/* > If JOBZ = 'V', then if INFO = 0, the first M elements of */
/* > IFAIL are zero. If INFO > 0, then IFAIL contains the */
/* > indices of the eigenvectors that failed to converge. */
/* > If JOBZ = 'N', then IFAIL is not referenced. */
/* > \endverbatim */
/* > */
/* > \param[out] INFO */
/* > \verbatim */
/* > INFO is INTEGER */
/* > = 0: successful exit */
/* > < 0: if INFO = -i, the i-th argument had an illegal value */
/* > > 0: if INFO = i, and i is: */
/* > <= N: then i eigenvectors failed to converge. Their */
/* > indices are stored in array IFAIL. */
/* > > N: if INFO = N + i, for 1 <= i <= N, then CPBSTF */
/* > returned INFO = i: B is not positive definite. */
/* > The factorization of B could not be completed and */
/* > no eigenvalues or eigenvectors were computed. */
/* > \endverbatim */
/* Authors: */
/* ======== */
/* > \author Univ. of Tennessee */
/* > \author Univ. of California Berkeley */
/* > \author Univ. of Colorado Denver */
/* > \author NAG Ltd. */
/* > \date June 2016 */
/* > \ingroup complexOTHEReigen */
/* > \par Contributors: */
/* ================== */
/* > */
/* > Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA */
/* ===================================================================== */
/* Subroutine */ int chbgvx_(char *jobz, char *range, char *uplo, integer *n,
integer *ka, integer *kb, complex *ab, integer *ldab, complex *bb,
integer *ldbb, complex *q, integer *ldq, real *vl, real *vu, integer *
il, integer *iu, real *abstol, integer *m, real *w, complex *z__,
integer *ldz, complex *work, real *rwork, integer *iwork, integer *
ifail, integer *info)
{
/* System generated locals */
integer ab_dim1, ab_offset, bb_dim1, bb_offset, q_dim1, q_offset, z_dim1,
z_offset, i__1, i__2;
/* Local variables */
integer indd, inde;
char vect[1];
logical test;
integer itmp1, i__, j, indee;
extern logical lsame_(char *, char *);
extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex *
, complex *, integer *, complex *, integer *, complex *, complex *
, integer *);
integer iinfo;
char order[1];
extern /* Subroutine */ int ccopy_(integer *, complex *, integer *,
complex *, integer *), cswap_(integer *, complex *, integer *,
complex *, integer *);
logical upper;
extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *,
integer *);
logical wantz;
integer jj;
logical alleig, indeig;
integer indibl;
extern /* Subroutine */ int chbtrd_(char *, char *, integer *, integer *,
complex *, integer *, real *, real *, complex *, integer *,
complex *, integer *);
logical valeig;
extern /* Subroutine */ int chbgst_(char *, char *, integer *, integer *,
integer *, complex *, integer *, complex *, integer *, complex *,
integer *, complex *, real *, integer *), clacpy_(
char *, integer *, integer *, complex *, integer *, complex *,
integer *), xerbla_(char *, integer *, ftnlen), cpbstf_(
char *, integer *, integer *, complex *, integer *, integer *);
integer indiwk, indisp;
extern /* Subroutine */ int cstein_(integer *, real *, real *, integer *,
real *, integer *, integer *, complex *, integer *, real *,
integer *, integer *, integer *);
integer indrwk, indwrk;
extern /* Subroutine */ int csteqr_(char *, integer *, real *, real *,
complex *, integer *, real *, integer *), ssterf_(integer
*, real *, real *, integer *);
integer nsplit;
extern /* Subroutine */ int sstebz_(char *, char *, integer *, real *,
real *, integer *, integer *, real *, real *, real *, integer *,
integer *, real *, integer *, integer *, real *, integer *,
integer *);
real tmp1;
/* -- LAPACK driver routine (version 3.7.0) -- */
/* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
/* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
/* June 2016 */
/* ===================================================================== */
/* Test the input parameters. */
/* Parameter adjustments */
ab_dim1 = *ldab;
ab_offset = 1 + ab_dim1 * 1;
ab -= ab_offset;
bb_dim1 = *ldbb;
bb_offset = 1 + bb_dim1 * 1;
bb -= bb_offset;
q_dim1 = *ldq;
q_offset = 1 + q_dim1 * 1;
q -= q_offset;
--w;
z_dim1 = *ldz;
z_offset = 1 + z_dim1 * 1;
z__ -= z_offset;
--work;
--rwork;
--iwork;
--ifail;
/* Function Body */
wantz = lsame_(jobz, "V");
upper = lsame_(uplo, "U");
alleig = lsame_(range, "A");
valeig = lsame_(range, "V");
indeig = lsame_(range, "I");
*info = 0;
if (! (wantz || lsame_(jobz, "N"))) {
*info = -1;
} else if (! (alleig || valeig || indeig)) {
*info = -2;
} else if (! (upper || lsame_(uplo, "L"))) {
*info = -3;
} else if (*n < 0) {
*info = -4;
} else if (*ka < 0) {
*info = -5;
} else if (*kb < 0 || *kb > *ka) {
*info = -6;
} else if (*ldab < *ka + 1) {
*info = -8;
} else if (*ldbb < *kb + 1) {
*info = -10;
} else if (*ldq < 1 || wantz && *ldq < *n) {
*info = -12;
} else {
if (valeig) {
if (*n > 0 && *vu <= *vl) {
*info = -14;
}
} else if (indeig) {
if (*il < 1 || *il > f2cmax(1,*n)) {
*info = -15;
} else if (*iu < f2cmin(*n,*il) || *iu > *n) {
*info = -16;
}
}
}
if (*info == 0) {
if (*ldz < 1 || wantz && *ldz < *n) {
*info = -21;
}
}
if (*info != 0) {
i__1 = -(*info);
xerbla_("CHBGVX", &i__1, (ftnlen)6);
return 0;
}
/* Quick return if possible */
*m = 0;
if (*n == 0) {
return 0;
}
/* Form a split Cholesky factorization of B. */
cpbstf_(uplo, n, kb, &bb[bb_offset], ldbb, info);
if (*info != 0) {
*info = *n + *info;
return 0;
}
/* Transform problem to standard eigenvalue problem. */
chbgst_(jobz, uplo, n, ka, kb, &ab[ab_offset], ldab, &bb[bb_offset], ldbb,
&q[q_offset], ldq, &work[1], &rwork[1], &iinfo);
/* Solve the standard eigenvalue problem. */
/* Reduce Hermitian band matrix to tridiagonal form. */
indd = 1;
inde = indd + *n;
indrwk = inde + *n;
indwrk = 1;
if (wantz) {
*(unsigned char *)vect = 'U';
} else {
*(unsigned char *)vect = 'N';
}
chbtrd_(vect, uplo, n, ka, &ab[ab_offset], ldab, &rwork[indd], &rwork[
inde], &q[q_offset], ldq, &work[indwrk], &iinfo);
/* If all eigenvalues are desired and ABSTOL is less than or equal */
/* to zero, then call SSTERF or CSTEQR. If this fails for some */
/* eigenvalue, then try SSTEBZ. */
test = FALSE_;
if (indeig) {
if (*il == 1 && *iu == *n) {
test = TRUE_;
}
}
if ((alleig || test) && *abstol <= 0.f) {
scopy_(n, &rwork[indd], &c__1, &w[1], &c__1);
indee = indrwk + (*n << 1);
i__1 = *n - 1;
scopy_(&i__1, &rwork[inde], &c__1, &rwork[indee], &c__1);
if (! wantz) {
ssterf_(n, &w[1], &rwork[indee], info);
} else {
clacpy_("A", n, n, &q[q_offset], ldq, &z__[z_offset], ldz);
csteqr_(jobz, n, &w[1], &rwork[indee], &z__[z_offset], ldz, &
rwork[indrwk], info);
if (*info == 0) {
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
ifail[i__] = 0;
/* L10: */
}
}
}
if (*info == 0) {
*m = *n;
goto L30;
}
*info = 0;
}
/* Otherwise, call SSTEBZ and, if eigenvectors are desired, */
/* call CSTEIN. */
if (wantz) {
*(unsigned char *)order = 'B';
} else {
*(unsigned char *)order = 'E';
}
indibl = 1;
indisp = indibl + *n;
indiwk = indisp + *n;
sstebz_(range, order, n, vl, vu, il, iu, abstol, &rwork[indd], &rwork[
inde], m, &nsplit, &w[1], &iwork[indibl], &iwork[indisp], &rwork[
indrwk], &iwork[indiwk], info);
if (wantz) {
cstein_(n, &rwork[indd], &rwork[inde], m, &w[1], &iwork[indibl], &
iwork[indisp], &z__[z_offset], ldz, &rwork[indrwk], &iwork[
indiwk], &ifail[1], info);
/* Apply unitary matrix used in reduction to tridiagonal */
/* form to eigenvectors returned by CSTEIN. */
i__1 = *m;
for (j = 1; j <= i__1; ++j) {
ccopy_(n, &z__[j * z_dim1 + 1], &c__1, &work[1], &c__1);
cgemv_("N", n, n, &c_b2, &q[q_offset], ldq, &work[1], &c__1, &
c_b1, &z__[j * z_dim1 + 1], &c__1);
/* L20: */
}
}
L30:
/* If eigenvalues are not in order, then sort them, along with */
/* eigenvectors. */
if (wantz) {
i__1 = *m - 1;
for (j = 1; j <= i__1; ++j) {
i__ = 0;
tmp1 = w[j];
i__2 = *m;
for (jj = j + 1; jj <= i__2; ++jj) {
if (w[jj] < tmp1) {
i__ = jj;
tmp1 = w[jj];
}
/* L40: */
}
if (i__ != 0) {
itmp1 = iwork[indibl + i__ - 1];
w[i__] = w[j];
iwork[indibl + i__ - 1] = iwork[indibl + j - 1];
w[j] = tmp1;
iwork[indibl + j - 1] = itmp1;
cswap_(n, &z__[i__ * z_dim1 + 1], &c__1, &z__[j * z_dim1 + 1],
&c__1);
if (*info != 0) {
itmp1 = ifail[i__];
ifail[i__] = ifail[j];
ifail[j] = itmp1;
}
}
/* L50: */
}
}
return 0;
/* End of CHBGVX */
} /* chbgvx_ */
|
the_stack_data/62639012.c | #include <stdio.h>
#include <string.h>
#include <fcntl.h> /* flags for read and write */
#include <sys/types.h> /* typedefs */
#include <sys/stat.h> /* structure returned by stat */
#include "dirent.h"
#include <sys/dir.h> /* local directory structure */
#include <stdlib.h>
#include <unistd.h>
#ifndef DIRSIZ
#define DIRSIZ 14
#define MAX_PATH 1024
#endif
/* system-dependent */
typedef struct { /* portable directory entry */
long ino; /* inode number */
char name[NAME_MAX+1]; /* name + '\0' terminator */
} Direnti;
typedef struct { /* minimal DIR: no buffering, etc. */
int fd; /* file descriptor for the directory */
Direnti d; /* the directory entry */
} DIRi;
void fsize(char *);
void dirwalk(char *, void (*fcn)(char *));
/* opendir: open a directory for readdir calls */
DIRi *opendiri(char *dirname)
{
int fd;
struct stat stbuf;
DIRi *dp;
if ((fd = open(dirname, O_RDONLY, 0)) == -1
|| fstat(fd, &stbuf) == -1
|| (stbuf.st_mode & S_IFMT) != S_IFDIR
|| (dp = (DIRi *) malloc(sizeof(DIRi))) == NULL)
return NULL;
dp->fd = fd;
return dp;
}
/* closedir: close directory opened by opendir */
void closediri(DIRi *dp) {
if (dp) {
close(dp->fd);
free(dp);
}
}
/* readdir: read directory entries in sequence */
Direnti *readdiri(DIRi *dp)
{
struct direct dirbuf; /* local directory structure */
static Direnti d; /* return: portable structure */
while (read(dp->fd, (char *) &dirbuf, sizeof(dirbuf)) == sizeof(dirbuf)) {
if (dirbuf.d_ino == 0) /* slot not in use */
continue;
d.ino = dirbuf.d_ino;
strncpy(d.name, dirbuf.d_name, DIRSIZ);
d.name[DIRSIZ] = '\0'; /* ensure termination */
return &d;
}
return NULL;
}
/* print file name */
int main(int argc, char **argv)
{
if (argc == 1) /* default: current directory */
fsize(".");
else
while (--argc > 0)
fsize(*++argv);
return 0;
}
/* fsize: print the name of file "name" */
void fsize(char *name)
{
struct stat stbuf;
if (stat(name, &stbuf) == -1) {
fprintf(stderr, "fsize: can't access %s\n", name);
return;
}
if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
dirwalk(name, fsize);
printf("size: %8ld and inode:%d for name: %s\n", stbuf.st_size, (int)stbuf.st_ino, name);
}
/* dirwalk: apply fcn to all files in dir */
void dirwalk(char *dir, void (*fcn)(char *)) {
char name[MAX_PATH];
Direnti *dp;
DIRi *dfd;
if ((dfd = opendiri(dir)) == NULL) {
fprintf(stderr, "dirwalk: can't open %s\n", dir);
return;
}
while ((dp = readdiri(dfd)) != NULL) {
if (strcmp(dp->name, ".") == 0
|| strcmp(dp->name, ".."))
continue; /* skip self and parent */
if (strlen(dir)+strlen(dp->name)+2 > sizeof(name))
fprintf(stderr, "dirwalk: name %s %s too long\n", dir, dp->name);
else {
sprintf(name, "%s/%s", dir, dp->name);
(*fcn)(name);
}
}
closediri(dfd);
}
|
the_stack_data/154829373.c | int main() {
// variable declarations
int n;
int x;
int y;
// pre-conditions
assume((n >= 0));
(x = n);
(y = 0);
// loop body
while ((x > 0)) {
{
(y = (y + 1));
(x = (x - 1));
}
}
// post-condition
assert( (y == n) );
}
|
the_stack_data/9513319.c | #include<stdio.h>
int main(){
int arr[4][8] = {
{1,1,1,1,1,1,1,1},
{1,1,0,1,1,1,1,1},
{1,1,1,1,1,0,0,1},
{1,1,1,1,1,1,1,1}
};
int i,j,pool = 0,len = 7,startj,count = 0;
for(i=0;i<4;i++){
for(j=0;j<8;j++){
if(i==0 || j == 0){
//printf("%d %d\n",i,j);
continue;
}
if(j==8-1){
//printf("%d %d\n",i,j);
continue;
}
if(i==4-1){
//printf("%d %d\n",i, j);
continue;
}
printf("Allowed i and j are %d %d\n", i,j);
if(arr[i][j] == 0 && arr[i][j+1] == 1){
//printf("i and j are \n", i,j);
printf("Entered\n");
if(arr[i][j-1] == 1 && arr[i][j+1] == 1 && arr[i-1][j] == 1 && arr[i-1][j-1] ==1
&& arr[i-1][j+1] == 1 && arr[i+1][j] == 1 && arr[i+1][j-1] ==1 && arr[i+1][j+1] ==1){
pool++;
}
printf("Inside for\n");
}
else if(arr[i][j] == 0 && arr[i][j+1] == 0){
startj = j;
printf("Startj is %d\n", startj);
for(j; j<=len;j++){
printf("Else for startj and j is %d %d\n",startj,j);
if(arr[i][j] == 0 && arr[i][j+1] == 1){
printf("Entered i , j , startj are %d %d %d\n", i,j,startj);
if(arr[i][startj-1] == 1 && arr[i-1][startj] == 1 && arr[i+1][startj] &&
arr[i][j+1] == 1 && arr[i-1][j] == 1 && arr[i+1][j] == 1 && arr[i-1][j+1] == 1 &&
arr[i+1][j+1] == 1 && arr[i-1][startj-1] == 1 && arr[i+1][startj-1] == 1){
count = j - startj -1;
printf("count : %d\n",count);
while(count){
if(arr[i-1][startj + count] == 1 && arr[i+1][startj + count] == 1){
count--;
}
else{
break;
}
}
if(count == 0){
pool++;
break;
}
}
}
}
}
}
//printf("first for\n");
}
/*for(i = 0; i<3; i++){
for(j = 0; j<8; j++){
if(i==0 || j == 0){
//printf("%d %d\n",i,j);
continue;
}
if(j==8-1){
//printf("%d %d\n",i,j);
continue;
}
if(i==3-1){
//printf("%d %d\n",i, j);
continue;
}
if(arr[j][i] == 0 && arr[j+1][i] == 0){
starti = i;
for(i;i<=len;i++){
if(arr[j][i] == 0 && arr[j][i+1] == 1){
if(arr[j][starti-1] == 1 && arr[])
}
}
}
}
}*/
printf("Pool : %d",pool);
return 0;
}
|
the_stack_data/86425.c |
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter numbers:");
scanf("%d %d %d",&a,&b,&c);
if ((a>=b)&&(a>=c)) {
if (b>=c) {
printf("\nDesc : %d %d %d",a,b,c);
printf("\nAsc : %d %d %d",c,b,a);
} else {
printf("\nDesc : %d %d %d",a,c,b);
printf("\nAsc : %d %d %d",b,c,a);
}
} else if ((b>=a)&&(b>=c)) {
if (a>=c) {
printf("\nDesc : %d %d %d",b,a,c);
}
} else {
if (b>=a) {
printf("\nDesc : %d %d %d",c,b,a);
printf("\nAsc : %d %d %d",a,b,c);
} else {
printf("\nDesc : %d %d %d",c,a,b);
printf("\nAsc : %d %d %d",b,a,c);
}
}
}
/*ascending order and descending order
if else
DAY_11*/ |
the_stack_data/1091872.c | #include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
int
debug_printf(const char* const format, ...) {
va_list args;
int args_printed;
const char* const debug_env_var = getenv("MRUBY_RUBY_COMPAT_DEBUG");
if(debug_env_var != NULL && strncmp(debug_env_var, "on", 3) == 0) {
va_start(args, format);
fprintf(stderr, "[mruby-require] ");
args_printed = vfprintf(stderr, format, args);
va_end(args);
return args_printed;
} else {
return 0;
}
}
|
the_stack_data/529276.c | #include <stdio.h>
#include <assert.h>
#include <math.h>
// inputs
int inputD = 4;
int inputB = 2;
int inputE = 5;
int inputA = 1;
int inputF = 6;
int inputC = 3;
int a4 = -89;
int a29 = -127;
int a2 = 1;
int a0 = -44;
int calculate_output(int input) {
if(((((a2==1) && a4 <= -86 ) && a0 <= -147 ) && ((-144 < a29) && (-16 >= a29)) )){
error_0: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && a0 <= -147 ) && ((-16 < a29) && (43 >= a29)) )){
error_9: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && a0 <= -147 ) && 43 < a29 )){
error_18: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && a29 <= -144 )){
error_47: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && a0 <= -147 ) && a29 <= -144 )){
error_7: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && a29 <= -144 )){
error_39: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && 43 < a29 )){
error_50: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && 43 < a29 )){
error_34: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && 43 < a29 )){
error_30: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && a0 <= -147 ) && 43 < a29 )){
error_14: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && a29 <= -144 )){
error_51: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )){
error_23: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && 43 < a29 )){
error_22: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && a0 <= -147 ) && a29 <= -144 )){
error_15: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_37: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_29: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_33: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && a0 <= -147 ) && a29 <= -144 )){
error_3: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_25: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_41: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_40: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_48: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && a0 <= -147 ) && 43 < a29 )){
error_2: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_45: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && 43 < a29 )){
error_38: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && a0 <= -147 ) && ((-144 < a29) && (-16 >= a29)) )){
error_4: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_28: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_56: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && a0 <= -147 ) && 43 < a29 )){
error_10: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && a0 <= -147 ) && a29 <= -144 )){
globalError: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )){
error_35: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )){
error_27: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_24: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_52: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && 43 < a29 )){
error_54: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_57: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_20: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && 43 < a29 )){
error_46: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && a0 <= -147 ) && ((-16 < a29) && (43 >= a29)) )){
error_1: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )){
error_19: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && 43 < a29 )){
error_42: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_53: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && a0 <= -147 ) && ((-16 < a29) && (43 >= a29)) )){
error_13: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_32: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && 43 < a29 )){
error_58: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && a0 <= -147 ) && ((-144 < a29) && (-16 >= a29)) )){
error_8: assert(0);
}
if(((((a2==3) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_49: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && 43 < a29 )){
error_26: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && -61 < a0 ) && a29 <= -144 )){
error_59: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && a0 <= -147 ) && a29 <= -144 )){
error_11: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && a0 <= -147 ) && 43 < a29 )){
error_6: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && a29 <= -144 )){
error_55: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && a29 <= -144 )){
error_43: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && a0 <= -147 ) && ((-144 < a29) && (-16 >= a29)) )){
error_12: assert(0);
}
if(((((a2==1) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-16 < a29) && (43 >= a29)) )){
error_21: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_36: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && a0 <= -147 ) && ((-144 < a29) && (-16 >= a29)) )){
error_16: assert(0);
}
if(((((a2==5) && a4 <= -86 ) && a0 <= -147 ) && ((-16 < a29) && (43 >= a29)) )){
error_17: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && a0 <= -147 ) && ((-16 < a29) && (43 >= a29)) )){
error_5: assert(0);
}
if(((((a2==4) && a4 <= -86 ) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )){
error_31: assert(0);
}
if(((((a2==2) && a4 <= -86 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
error_44: assert(0);
}
if(( -61 < a0 && ( a4 <= -86 && ((input == 1) && (((a2==3) && a29 <= -144 ) || (((a2==2) && ((-16 < a29) && (43 >= a29)) ) || ( 43 < a29 && (a2==2)))))))){
a0 = (((((a0 % 299926)+ -300072) / 5) * 5) - 2);
a29 = (((a29 / 5) - 403019) / 5);
a2 = 1;
return -1;
} else if(((( ((-86 < a4) && (-42 >= a4)) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 4))) && (a2==1)) && ((-147 < a0) && (-98 >= a0)) )){
a4 = ((((a4 * 10)/ 4) - 105635) * 5);
a0 = (((a0 / 5) + -535974) * 1);
a29 = ((((a29 % 299928)+ -144) + -127007) * 1);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((a2==2) && ( a29 <= -144 && (input == 3))) && ((-98 < a0) && (-61 >= a0)) ))){
if( a0 <= -147 ){
a4 = (((a4 / 5) + 230984) + -520005);
a0 = (((a0 * 5) - 170894) / -5);
a29 = ((((a29 % 29)+ 13) / 5) / 5);
a2 = 3;
} else{
a29 = ((((a29 - 0) % 29)+ 23) + -9);
} return 21;
} else if((( a0 <= -147 && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 2)) && (a2==1))) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 - 373993) - 156849) + 1087366) + -662739);
a0 = (((((a0 * 9)/ 10) + -38819) % 24)+ -99);
a29 = ((((((a29 % 299978)+ 300021) / 5) - 494390) * -1)/ 10);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 3)) && ((-98 < a0) && (-61 >= a0)) ) && (a2==4)))){
a4 = (((a4 + -343035) + 587291) - 275194);
a0 = (((a0 + 390619) - 403210) - -569718);
a29 = (((((a29 % 299978)- -300021) - -1) / 5) + 444143);
a2 = 2;
return 22;
} else if(((((a2==3) && ((input == 3) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ))) && -61 < a0 ) && a4 <= -86 )){
a0 = ((((a0 % 299926)- 300072) * 1) - 1);
a29 = (((a29 - 382960) - 74074) * 1);
a2 = 1;
return -1;
} else if(((((input == 5) && (( ((-144 < a29) && (-16 >= a29)) && (a2==2)) || (( 43 < a29 && (a2==1)) || ((a2==2) && a29 <= -144 )))) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = (((((a4 * 10)/ 4) * 10)/ 9) + -71483);
a29 = (((((a29 % 299928)- 300071) + -1) / 5) - 280609);
a2 = 1;
return -1;
} else if(((((( ((-144 < a29) && (-16 >= a29)) && (a2==4)) || (( 43 < a29 && (a2==3)) || ((a2==4) && a29 <= -144 ))) && (input == 2)) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = (((((a4 + -149009) - -316415) * 3) * -1)/ 10);
a0 = ((((a0 - 0) % 24)- 121) + -1);
a29 = ((((a29 % 299978)- -300021) / 5) - -378565);
a2 = 3;
return -1;
} else if((( -61 < a0 && ((((a2==3) && a29 <= -144 ) || (( ((-16 < a29) && (43 >= a29)) && (a2==2)) || ( 43 < a29 && (a2==2)))) && (input == 2))) && a4 <= -86 )){
a0 = ((((a0 / 5) - -215080) * 10)/ -9);
a29 = ((((((a29 - 0) * 9)/ 10) + -50638) % 299928)- 300071);
a2 = 1;
return -1;
} else if(((((a2==4) && ((input == 1) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = (((a4 * 5) + -228988) / 5);
a0 = ((((((a0 % 18)+ -78) * 9)/ 10) * 9)/ 10);
a29 = ((((((a29 * 9)/ 10) / 5) + 262161) % 29)- -15);
a2 = 1;
return -1;
} else if((((((input == 4) && 43 < a29 ) && (a2==1)) && ((-98 < a0) && (-61 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) )){
a29 = ((((a29 % 29)- -15) / 5) + -16);
a2 = 5;
return -1;
} else if((( -61 < a0 && (((( 43 < a29 && (a2==4)) || ((a2==5) && a29 <= -144 )) || ( ((-144 < a29) && (-16 >= a29)) && (a2==5))) && (input == 1))) && a4 <= -86 )){
a4 = ((((a4 - 0) - -490407) % 21)+ -62);
a0 = ((((a0 - 153310) * 1) % 299926)- 300072);
a29 = ((((a29 % 299978)+ 300021) + 1) - 0);
a2 = 4;
return 22;
} else if((( ((-147 < a0) && (-98 >= a0)) && (((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) )) && (a2==3))){
a4 = (((a4 + -155747) - 133657) - 35383);
a0 = ((((a0 / 5) + 135798) * 4) - 984812);
a29 = (((a29 + -315762) / 5) + -109484);
a2 = 1;
return -1;
} else if((((a2==2) && (((input == 5) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) )) && ((-16 < a29) && (43 >= a29)) )){
a4 = ((((((a4 * 21)/ 10) + 71298) / 5) * -1)/ 10);
a0 = (((a0 - 162900) - 383694) - 31566);
a29 = (((a29 / 5) - -341315) + 150076);
a2 = 5;
return -1;
} else if((((((input == 5) && ( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && (a2==1)) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((a4 + -44548) - -443306) + -696410);
a0 = ((((a0 / 5) * 123)/ 10) - 36241);
a29 = ((((a29 - 0) * 9)/ 10) + 573486);
a2 = 5;
return -1;
} else if(((a2==4) && ( -61 < a0 && ( a4 <= -86 && ((input == 5) && ( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))))))){
if( 43 < a29 ){
a4 = (((((a4 / 5) % 21)+ -60) * 9)/ 10);
a0 = ((((a0 % 24)- 121) + -205117) - -205116);
a29 = ((((a29 % 29)+ 14) / 5) + 22);
a2 = 2;
} else{
a4 = ((((a4 % 21)+ -46) * 1) + -5);
a0 = ((((a0 + 0) % 299926)+ -300072) * 1);
a29 = ((((a29 + 371124) % 29)- -13) + 2);
a2 = 3;
} return 22;
} else if((((((input == 3) && -61 < a0 ) && a4 <= -86 ) && ((-16 < a29) && (43 >= a29)) ) && (a2==5))){
a4 = (((((a4 - -446919) % 21)+ -64) / 5) + -48);
a0 = (((((a0 - 0) % 24)- 122) - 24975) - -24975);
a29 = ((((a29 - -264394) + -320129) - 442766) - -778920);
a2 = 2;
return 22;
} else if(((a2==1) && ( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && ((input == 4) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))))){
a4 = (((a4 - 226504) - 71806) * 2);
a29 = ((((a29 % 299928)- 144) - 38153) + -135408);
a2 = 5;
return -1;
} else if((( -61 < a0 && ( 43 < a29 && ((input == 4) && (a2==5)))) && a4 <= -86 )){
return 22;
} else if(((((((a2==4) && ((-144 < a29) && (-16 >= a29)) ) || (((a2==3) && 43 < a29 ) || ( a29 <= -144 && (a2==4)))) && (input == 5)) && a0 <= -147 ) && ((-86 < a4) && (-42 >= a4)) )){
a29 = ((((a29 % 299928)+ -300071) * 1) - 2);
a2 = 3;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 3) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )) && a0 <= -147 )) && (a2==3))){
if( ((-16 < a29) && (43 >= a29)) ){
a0 = ((((a0 + 125283) % 24)- 122) + 1);
a29 = (((((a29 / 5) - -520121) * 1) % 29)- -2);
a2 = 2;
} else{
a29 = (((((a29 * 9)/ 10) + 5268) % 63)+ -79);
} return -1;
} else if(( 43 < a29 && (( -61 < a0 && ( a4 <= -86 && (input == 1))) && (a2==5)))){
a29 = ((((a29 + -556242) % 299928)- 300071) * 1);
a2 = 2;
return 26;
} else if((( a4 <= -86 && ( 43 < a29 && ((input == 2) && -61 < a0 ))) && (a2==3))){
a0 = (((a0 / 5) / 5) + -266659);
a29 = ((((a29 - 118281) + 14305) % 299928)- 300071);
a2 = 1;
return -1;
} else if(((((input == 6) && ((((a2==1) && 43 < a29 ) || ( a29 <= -144 && (a2==2))) || ((a2==2) && ((-144 < a29) && (-16 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = (((a4 / 5) - 468667) / 5);
a29 = ((((((a29 * 9)/ 10) % 299928)+ -300071) + 121344) + -121344);
a2 = 1;
return -1;
} else if((((( ((-98 < a0) && (-61 >= a0)) && (input == 3)) && (a2==2)) && ((-86 < a4) && (-42 >= a4)) ) && 43 < a29 )){
a4 = (((a4 - 174071) * 3) / 5);
a29 = ((((((a29 * 9)/ 10) * 1) + -195948) % 29)- -14);
a2 = 3;
return -1;
} else if(((( ((-147 < a0) && (-98 >= a0)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 5))) && (a2==4)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 * 5) + 579823) + 11517) + -660876);
a0 = (((a0 * 5) - 6100) * 5);
a29 = (((a29 / 5) + 176253) - -181921);
a2 = 5;
return -1;
} else if(((( a4 <= -86 && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 1))) && (a2==1)) && -61 < a0 )){
a0 = ((((a0 - 217743) % 299926)+ -300072) * 1);
a29 = (((a29 + -396156) + -5222) * 1);
return -1;
} else if(( -61 < a0 && ((( 43 < a29 && (input == 6)) && (a2==5)) && a4 <= -86 ))){
a0 = (((((a0 % 18)- 78) * 1) / 5) + -63);
a29 = ((((a29 % 63)- 97) - 20) + 4);
a2 = 3;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-98 < a0) && (-61 >= a0)) && (((input == 3) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (a2==5))))){
if((a2==4)){
a4 = (((a4 - 95607) + -173954) + -12748);
a0 = ((((a0 * 25)/ 10) + -439586) - -307849);
a29 = ((((a29 % 299928)+ -144) - 72109) - 18545);
a2 = 4;
} else{
a4 = (((a4 + -172293) / 5) * 5);
a29 = ((((a29 + 0) * 9)/ 10) - -585169);
a2 = 4;
} return 22;
} else if((( ((-98 < a0) && (-61 >= a0)) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 5)) && ((-86 < a4) && (-42 >= a4)) )) && (a2==4))){
a4 = (((a4 * 5) - -527193) + -830547);
a0 = (((a0 / 5) - 111795) * 5);
a29 = (((((a29 % 299928)- 300071) + 0) - -381711) + -381711);
return -1;
} else if(( a4 <= -86 && ( -61 < a0 && (((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 4)) && (a2==4))))){
a4 = (((((a4 / 5) % 21)- 43) + 72580) - 72601);
a0 = ((((a0 % 299926)- 300072) + 505424) - 505425);
a29 = ((((a29 * 9)/ 10) + 571994) / 5);
a2 = 2;
return 26;
} else if((((((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) || 43 < a29 ) && (input == 6)) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) ) && (a2==5))){
a4 = ((((a4 + -159160) / 5) * 10)/ 9);
a0 = (((a0 / 5) + -450837) * 1);
a29 = (((((a29 % 299928)- 300071) - 1) / 5) + -101068);
a2 = 2;
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ((a2==3) && (((input == 2) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) )))){
a4 = (((a4 + -31484) + -538040) + -21692);
a29 = ((((a29 % 299928)+ -144) + -155078) * 1);
a2 = 4;
return 21;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 5) && ((-147 < a0) && (-98 >= a0)) ) && a29 <= -144 )) && (a2==5))){
a4 = (((a4 - 159432) - 109407) * 2);
a0 = ((((a0 + 490072) + 32090) * 10)/ 9);
a29 = ((((((a29 % 29)+ 23) + 1) * 5) % 29)- -13);
return -1;
} else if(( -61 < a0 && ( a4 <= -86 && ((a2==3) && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 2)))))){
a0 = ((((a0 / 5) * 4) - -113559) + -665939);
a29 = (((a29 - 148272) + 252167) + -411458);
a2 = 1;
return -1;
} else if(((((a2==3) && (( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (input == 2))) && a0 <= -147 ) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((a4 + -287863) + -192250) * 1);
a29 = ((((a29 / 5) % 63)+ -80) - 1);
a2 = 1;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 5)) && (a2==5)) && ((-98 < a0) && (-61 >= a0)) ))){
a0 = (((a0 - 45) / 5) + -99);
a29 = ((((a29 % 299928)+ -300071) / 5) + -203345);
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 1) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-147 < a0) && (-98 >= a0)) )) && (a2==4))){
a4 = (((((a4 * 21)/ 10) - 87347) * 10)/ 9);
a0 = (((((a0 % 18)+ -61) - 19) / 5) + -77);
a29 = (((a29 / 5) * 4) - 587483);
a2 = 3;
return -1;
} else if(((((((a2==5) && ((-144 < a29) && (-16 >= a29)) ) || (( 43 < a29 && (a2==4)) || ((a2==5) && a29 <= -144 ))) && (input == 2)) && a4 <= -86 ) && -61 < a0 )){
a0 = ((((a0 + -267162) % 299926)- 300072) * 1);
a29 = (((a29 + 0) / 5) - 428483);
a2 = 1;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && (( ((-98 < a0) && (-61 >= a0)) && (input == 6)) && (a2==2))) && a29 <= -144 )){
a4 = ((((a4 + -196449) - -594193) * 10)/ -9);
a0 = ((((a0 / 5) / 5) * 735)/ 10);
a2 = 1;
return -1;
} else if(( ((-16 < a29) && (43 >= a29)) && ( a4 <= -86 && (((input == 6) && -61 < a0 ) && (a2==5))))){
a0 = (((a0 / 5) + -324699) - 172683);
a29 = (((((a29 - 531416) + -35692) - -697447) * -1)/ 10);
a2 = 1;
return -1;
} else if((( ((-16 < a29) && (43 >= a29)) && (((input == 4) && -61 < a0 ) && a4 <= -86 )) && (a2==5))){
a4 = ((((a4 / 5) - -571961) % 21)+ -67);
a0 = ((((a0 % 299926)+ -300072) * 1) - 2);
a29 = ((((a29 - -174449) * 10)/ 9) / 5);
return 22;
} else if(( -61 < a0 && ( a4 <= -86 && ((input == 5) && ((( ((-16 < a29) && (43 >= a29)) && (a2==2)) || ((a2==2) && 43 < a29 )) || ( a29 <= -144 && (a2==3))))))){
a4 = (((((a4 % 21)+ -47) + 367614) + 116418) + -484038);
a0 = ((((a0 / 5) / 5) % 24)+ -122);
a29 = (((a29 / 5) + 298882) - 164223);
a2 = 3;
return 21;
} else if((( ((-98 < a0) && (-61 >= a0)) && (((input == 1) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) )) && (a2==2))){
a29 = (((((a29 % 63)- 79) * 1) + -90558) + 90558);
a2 = 5;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-98 < a0) && (-61 >= a0)) && (((input == 6) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) )) && (a2==2))))){
a0 = (((((a0 - 46) * 5) * 5) % 24)+ -121);
a29 = ((((a29 - -1321) - 315533) * -1)/ 10);
a2 = 3;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-147 < a0) && (-98 >= a0)) && ((input == 3) && ((( ((-16 < a29) && (43 >= a29)) && (a2==1)) || ( 43 < a29 && (a2==1))) || ((a2==2) && a29 <= -144 )))))){
a29 = (((((a29 * 9)/ 10) - -17657) / 5) - 139328);
a2 = 1;
return 21;
} else if(((( a0 <= -147 && ((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && (a2==4)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 - 480316) - 19307) * 10)/ 9);
a0 = (((((a0 * 9)/ 10) % 24)- 119) - -21);
a29 = (((((a29 % 29)- -14) + -78248) / 5) + 15680);
return -1;
} else if(((( ((-86 < a4) && (-42 >= a4)) && ((input == 4) && ( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))) && ((-98 < a0) && (-61 >= a0)) ) && (a2==1))){
a4 = ((((a4 - 168143) + 137012) * 10)/ 9);
a0 = (((a0 - 77791) - -335670) - -161975);
a29 = ((((a29 % 299928)- 300071) / 5) - 343834);
a2 = 4;
return -1;
} else if(( ((-147 < a0) && (-98 >= a0)) && ( a29 <= -144 && ( ((-86 < a4) && (-42 >= a4)) && ((input == 3) && (a2==5)))))){
a4 = (((((a4 + 514012) / 5) / 5) * -1)/ 10);
a0 = (((a0 - 351273) / 5) - 16153);
a2 = 1;
return -1;
} else if(((a2==4) && ( ((-86 < a4) && (-42 >= a4)) && (((input == 5) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && a0 <= -147 )))){
if( a0 <= -147 ){
a0 = (((((a0 + 512655) % 24)- 121) + 294399) - 294399);
a29 = ((((a29 % 29)+ 13) + 1) / 5);
a2 = 5;
} else{
a29 = ((((a29 % 29)- -14) - 188513) + 188512);
} return 22;
} else if((((a2==5) && ( ((-98 < a0) && (-61 >= a0)) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 2)))) && ((-86 < a4) && (-42 >= a4)) )){
if( -61 < a0 ){
a0 = ((((a0 / 5) * 123)/ 10) * 5);
a29 = ((((a29 - -515249) % 299978)+ 300021) + 0);
a2 = 3;
} else{
a4 = (((a4 - 159459) + -255924) * 1);
a0 = (((a0 + 311576) / 5) + 362176);
a29 = (((((a29 * 9)/ 10) / 5) * 5) - -587636);
a2 = 4;
} return 22;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==1) && ( a0 <= -147 && ( ((-16 < a29) && (43 >= a29)) && (input == 5)))))){
a4 = ((((a4 * 21)/ 10) + -400646) * 1);
a29 = ((((a29 - 462276) * 10)/ 9) + -52624);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( a0 <= -147 && ((( ((-144 < a29) && (-16 >= a29)) && (a2==2)) || (((a2==1) && 43 < a29 ) || ( a29 <= -144 && (a2==2)))) && (input == 4))))){
if( a29 <= -144 ){
a0 = ((((a0 % 24)- 121) + 467846) + -467826);
a29 = ((((a29 + 0) % 29)+ 13) - -2);
a2 = 2;
} else{
a29 = (((((a29 % 299928)+ -300071) - 2) - -592405) + -592403);
a2 = 3;
} return 21;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==2) && ((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 2)) && ((-98 < a0) && (-61 >= a0)) )))){
if((a2==4)){
a29 = (((a29 - -453579) + -1007224) + 776721);
a2 = 5;
} else{
a4 = ((((a4 * 5) / 5) * 10)/ 4);
a0 = (((((a0 * 5) % 24)- 121) + -360939) + 360945);
a29 = (((((a29 % 63)+ -79) + -2) - -160900) - 160899);
a2 = 4;
} return -1;
} else if(( -61 < a0 && ( a4 <= -86 && ((a2==5) && ( 43 < a29 && (input == 3)))))){
a0 = ((((a0 - 0) + -259726) % 299926)- 300072);
a2 = 1;
return -1;
} else if(( -61 < a0 && ( a4 <= -86 && (((a2==3) && (input == 4)) && 43 < a29 )))){
if((a2==1)){
a4 = (((((a4 % 21)- 62) - 2) + 429144) + -429136);
a0 = ((((a0 + -428046) - -377265) % 24)- 122);
a29 = ((((a29 % 299928)+ -300071) * 1) * 1);
a2 = 2;
} else{
a4 = ((((a4 + 0) - -403065) % 21)+ -62);
a0 = ((((a0 + 0) % 299926)+ -300072) - 3);
a2 = 1;
} return 26;
} else if((( ((-147 < a0) && (-98 >= a0)) && (((( ((-16 < a29) && (43 >= a29)) && (a2==1)) || ((a2==1) && 43 < a29 )) || ((a2==2) && a29 <= -144 )) && (input == 6))) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 + 432335) / 5) - -297443) + -770462);
a0 = ((((a0 * 5) - 438552) * 10)/ 9);
a29 = ((((a29 - 0) % 299928)+ -300071) + -2);
a2 = 1;
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ((((input == 1) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && (a2==3)) && ((-86 < a4) && (-42 >= a4)) ))){
if( 136 < a4 ){
a0 = (((a0 + -330918) / 5) / 5);
a29 = ((((((a29 % 63)- 78) - -182185) * 3) % 63)- 138);
a2 = 5;
} else{
a0 = (((a0 - -161415) + -161458) * 1);
a29 = ((((a29 / 5) - -215380) % 29)- 2);
a2 = 2;
} return -1;
} else if((((a2==2) && (( ((-144 < a29) && (-16 >= a29)) && (input == 1)) && ((-86 < a4) && (-42 >= a4)) )) && ((-147 < a0) && (-98 >= a0)) )){
a4 = (((a4 / 5) + -51623) + -420756);
a0 = ((((a0 * 5) % 18)+ -77) - 1);
a29 = (((((a29 + -36495) - -410490) / 5) * -1)/ 10);
a2 = 3;
return -1;
} else if(( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && ((input == 6) && (((a2==4) && ((-144 < a29) && (-16 >= a29)) ) || (( 43 < a29 && (a2==3)) || ((a2==4) && a29 <= -144 ))))))){
a4 = (((a4 - 511089) / 5) * 5);
a0 = ((((((a0 / 5) % 18)- 72) * 5) % 18)+ -69);
a29 = ((((((a29 % 299928)- 300071) + -2) * 9)/ 10) + -51962);
a2 = 4;
return -1;
} else if(((((a2==1) && ((input == 5) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 - 299758) * 10)/ 9) - 263514);
a0 = (((a0 + -189742) * -3) / 5);
a29 = (((((a29 - 0) + 0) - -419093) % 299978)- -300021);
a2 = 2;
return -1;
} else if((( ((-98 < a0) && (-61 >= a0)) && ( ((-86 < a4) && (-42 >= a4)) && ((input == 4) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) )))) && (a2==2))){
a4 = (((a4 - 367509) * 1) + -165889);
a0 = (((((a0 / 5) * 123)/ 10) * 10)/ 9);
a29 = (((a29 + -128272) * 4) - 50089);
a2 = 3;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==5) && (( a0 <= -147 && (input == 2)) && 43 < a29 )))){
a4 = (((a4 - 332092) + -246937) * 1);
a0 = (((((a0 % 18)- 62) / 5) * 5) - 6);
a29 = (((((a29 - 0) + 0) + -143280) % 29)+ 14);
a2 = 2;
return -1;
} else if(((a2==1) && ( ((-86 < a4) && (-42 >= a4)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 3)) && a0 <= -147 )))){
if( a29 <= -144 ){
a0 = ((((a0 % 24)+ -106) + -118072) + 118060);
a29 = ((((a29 % 299978)+ 300021) + 39812) + 4757);
a2 = 2;
} else{
a29 = (((((a29 * 9)/ 10) + -26438) % 63)+ -80);
a2 = 5;
} return 21;
} else if(((((a2==1) && ((input == 6) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 * 21)/ 10) + -313003) - 8733);
a0 = ((((a0 / 5) * 78)/ 10) + -182482);
a29 = (((a29 - -141759) / 5) + -312469);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((a2==1) && ((input == 2) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-147 < a0) && (-98 >= a0)) ))){
a4 = ((((a4 + -92205) * 10)/ 9) * 5);
a0 = (((a0 + -14362) + -530976) + -39701);
a29 = ((((((a29 % 299928)+ -144) / 5) + 115683) * -1)/ 10);
return -1;
} else if(( a0 <= -147 && ((a2==2) && ( ((-86 < a4) && (-42 >= a4)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 2)))))){
a4 = (((a4 * 5) + -390730) / 5);
a29 = (((a29 / 5) + -339257) + -242099);
a2 = 1;
return -1;
} else if(( ((-147 < a0) && (-98 >= a0)) && ((((( 43 < a29 && (a2==2)) || ((a2==3) && a29 <= -144 )) || ((a2==3) && ((-144 < a29) && (-16 >= a29)) )) && (input == 4)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 * 5) + -596150) + -2176);
a0 = ((((a0 * -5) * 5) * 10)/ 9);
a29 = (((((a29 + 0) / 5) * 4) % 299978)- -300021);
a2 = 2;
return 22;
} else if(((((a2==5) && ((input == 4) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((a4 / 5) + -480007) - 49681);
a29 = ((((((a29 % 63)- 40) * 9)/ 10) - -63664) + -63691);
a2 = 3;
return -1;
} else if(((a2==2) && ( ((-98 < a0) && (-61 >= a0)) && (( a29 <= -144 && (input == 1)) && ((-86 < a4) && (-42 >= a4)) )))){
a0 = (((((a0 * 25)/ 10) - 475114) * 10)/ 9);
a29 = (((((a29 + 0) % 29)+ 34) - -250200) + -250207);
a2 = 1;
return 26;
} else if(((( a4 <= -86 && ( -61 < a0 && (input == 5))) && (a2==5)) && ((-16 < a29) && (43 >= a29)) )){
a0 = ((((a0 % 299926)+ -300072) + -1) * 1);
a29 = (((a29 + -335818) + -248420) / 5);
a2 = 1;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 6)) && (a2==4)) && ((-98 < a0) && (-61 >= a0)) ))){
if( a4 <= -86 ){
a4 = ((((a4 * 21)/ 10) + 345448) + -402040);
a0 = (((a0 - 104609) / -5) - -278005);
a29 = ((((a29 % 29)+ 34) + 10997) - 11008);
a2 = 3;
} else{
a4 = ((((a4 / 5) * 5) - -85502) - 357269);
a0 = ((((a0 - 38) + -11) + -393003) + 393006);
a29 = ((((a29 % 299928)+ -144) * 1) + -134411);
a2 = 3;
} return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==5) && ( ((-98 < a0) && (-61 >= a0)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 4)))))){
a4 = ((((a4 * 10)/ 4) - -531993) + -849572);
a0 = (((((a0 / 5) * 9)/ 10) - 551674) * -1);
a29 = (((((a29 + 0) % 299978)- -300021) / 5) + 138947);
return 26;
} else if(((( ((-86 < a4) && (-42 >= a4)) && ((input == 4) && ((-98 < a0) && (-61 >= a0)) )) && a29 <= -144 ) && (a2==2))){
a4 = ((((a4 + 545933) * -1)/ 10) * 5);
a0 = ((((a0 + -122294) * -4) * 10)/ 9);
a2 = 4;
return 21;
} else if(((a2==1) && ((((input == 1) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && a0 <= -147 ) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 - 583803) / 5) / 5);
a0 = (((((a0 / 5) % 24)+ -100) - 190928) - -190917);
a29 = ((((a29 % 29)- -33) + 470403) + -470405);
a2 = 3;
return -1;
} else if(( a4 <= -86 && ( -61 < a0 && (((((a2==4) && 43 < a29 ) || ((a2==5) && a29 <= -144 )) || ( ((-144 < a29) && (-16 >= a29)) && (a2==5))) && (input == 3))))){
a4 = (((((a4 % 21)+ -44) * 1) / 5) - 48);
a0 = ((((a0 % 299926)- 300072) * 1) - 3);
a29 = ((((a29 % 299978)+ 300021) * 1) * 1);
a2 = 3;
return 22;
} else if((((a2==5) && (((input == 5) && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) || 43 < a29 )) && ((-147 < a0) && (-98 >= a0)) )) && ((-86 < a4) && (-42 >= a4)) )){
a29 = (((((a29 % 299978)+ 300021) * 1) - 479458) + 479460);
return 22;
} else if(((( ((-16 < a29) && (43 >= a29)) && ((input == 1) && ((-147 < a0) && (-98 >= a0)) )) && (a2==2)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((((a4 * 10)/ 4) - 371477) * 10)/ 9);
a0 = (((((a0 * 10)/ 15) - 0) / 5) + -57);
a29 = (((a29 * 5) / 5) - 552027);
a2 = 3;
return -1;
} else if((( a4 <= -86 && ((input == 6) && ((((a2==2) && ((-16 < a29) && (43 >= a29)) ) || ((a2==2) && 43 < a29 )) || ((a2==3) && a29 <= -144 )))) && -61 < a0 )){
a0 = (((a0 / 5) + -278887) / 5);
a29 = ((((a29 % 299928)+ -300071) - -514060) - 514060);
a2 = 1;
return -1;
} else if(((( -61 < a0 && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 5))) && a4 <= -86 ) && (a2==3))){
a0 = ((((a0 + -325280) + -120034) % 299926)+ -300072);
a29 = (((a29 + -112448) + -33410) * 4);
a2 = 1;
return -1;
} else if(( ((-147 < a0) && (-98 >= a0)) && ( ((-86 < a4) && (-42 >= a4)) && ((((a2==3) && ((-144 < a29) && (-16 >= a29)) ) || (( 43 < a29 && (a2==2)) || ((a2==3) && a29 <= -144 ))) && (input == 5))))){
a4 = (((a4 - 179640) + -196180) * 1);
a0 = (((((a0 * 5) % 18)+ -68) * 10)/ 9);
a29 = ((((a29 / 5) * 4) % 299978)+ 300021);
a2 = 3;
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ((((input == 6) && ((-86 < a4) && (-42 >= a4)) ) && (a2==1)) && 43 < a29 ))){
a4 = ((((a4 * 10)/ 4) * 5) + -460043);
a0 = ((((a0 - 39) - -1) / 5) - 102);
a29 = (((a29 / 5) * 4) - 486694);
a2 = 2;
return -1;
} else if(( a0 <= -147 && ((((input == 6) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && (a2==4)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 - 124968) - 172519) + -276986);
a29 = (((((a29 % 299928)- 300071) - -241689) + 178566) + -420255);
a2 = 2;
return -1;
} else if(((((a2==1) && ((input == 2) && ( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((a4 + 4337) - 75733) * 5);
a0 = ((((a0 * 10)/ 4) + -416474) * 1);
a29 = ((((((a29 % 63)- 79) * 1) * 5) % 63)- 77);
return -1;
} else if((( ((-98 < a0) && (-61 >= a0)) && ((a2==4) && ((input == 4) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((a4 - 5349) - 71855) - 8649);
a0 = ((((a0 - 80857) * 10)/ 9) / 5);
a29 = ((((((a29 % 63)+ -58) * 9)/ 10) - 554414) + 554401);
a2 = 2;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 4) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )) && a0 <= -147 )) && (a2==3))){
a4 = (((a4 + -429677) * 1) * 1);
a0 = (((a0 - -600060) + 7) / 5);
a29 = (((((a29 * 9)/ 10) % 63)- 78) - 2);
a2 = 4;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((( a29 <= -144 && (a2==2)) || (( ((-16 < a29) && (43 >= a29)) && (a2==1)) || ((a2==1) && 43 < a29 ))) && (input == 4))) && ((-147 < a0) && (-98 >= a0)) )){
if( ((-42 < a4) && (136 >= a4)) ){
a29 = ((((a29 - 0) - 0) % 299978)+ 300021);
a2 = 4;
} else{
a0 = (((((a0 % 18)+ -72) + 11) * 10)/ 9);
a29 = (((((a29 % 63)- 78) + 354675) - 303746) - 50931);
a2 = 1;
} return 21;
} else if(( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && ((input == 1) && (( ((-144 < a29) && (-16 >= a29)) && (a2==4)) || (( 43 < a29 && (a2==3)) || ((a2==4) && a29 <= -144 ))))))){
a4 = ((((a4 + -38853) + -127579) * 10)/ 9);
a0 = (((a0 - -600019) * 1) - -48);
a29 = ((((a29 % 299928)+ -300071) + -1) * 1);
a2 = 3;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 5)) && (a2==2))) && a0 <= -147 )){
a4 = ((((a4 - 432014) * 1) * 10)/ 9);
a29 = ((((a29 % 299928)- 300071) * 1) * 1);
a2 = 1;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==3) && ( ((-147 < a0) && (-98 >= a0)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 5)))))){
a4 = (((a4 + -445432) - 38917) / 5);
a0 = (((a0 + -523061) * 1) / 5);
a29 = ((((a29 % 299928)+ -300071) - 1) + -1);
a2 = 1;
return -1;
} else if(((a2==5) && ((( a0 <= -147 && (input == 5)) && 43 < a29 ) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 - 571896) + -12207) * 1);
a0 = (((a0 + 600032) - -112) / 5);
a29 = (((((a29 % 29)+ -10) + -1) + -180973) + 180992);
return -1;
} else if(( ((-16 < a29) && (43 >= a29)) && (( ((-86 < a4) && (-42 >= a4)) && ((a2==1) && (input == 3))) && a0 <= -147 ))){
if( ((-144 < a29) && (-16 >= a29)) ){
a0 = (((((a0 % 24)+ -116) - -428496) + 96525) + -525025);
a29 = (((((a29 / 5) - -588420) - -8138) * -1)/ 10);
a2 = 5;
} else{
a29 = (((a29 - -367691) + 130494) - -35139);
a2 = 5;
} return 22;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-147 < a0) && (-98 >= a0)) && ((a2==4) && ((input == 4) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )))))){
a4 = (((((a4 * 10)/ 4) + 147908) - -409340) + -1095280);
a0 = (((a0 * -5) / 5) - -445352);
a29 = ((((((a29 + -342777) % 29)+ 14) * 5) % 29)- -14);
return -1;
} else if((( a4 <= -86 && ((input == 3) && ((((a2==1) && 43 < a29 ) || ( a29 <= -144 && (a2==2))) || ((a2==2) && ((-144 < a29) && (-16 >= a29)) )))) && -61 < a0 )){
a0 = ((((a0 % 299926)- 300072) + 0) - 0);
a29 = ((((a29 % 299928)+ -300071) * 1) * 1);
a2 = 1;
return -1;
} else if(((a2==4) && ((((input == 6) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) ))){
a0 = (((a0 * 5) * 5) * 5);
a29 = ((((a29 - 587266) % 29)+ 13) + 2);
return -1;
} else if(((a2==5) && ((((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 3)) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 ))){
a4 = ((((((a4 * 21)/ 10) * 10)/ 9) / 5) - 395341);
a0 = ((((a0 - -158225) % 18)- 78) - 1);
a29 = (((((a29 + 522034) % 299928)+ -300071) + 203886) + -203887);
a2 = 1;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((((a2==3) && ((-144 < a29) && (-16 >= a29)) ) || (((a2==2) && 43 < a29 ) || ( a29 <= -144 && (a2==3)))) && (input == 1))) && ((-147 < a0) && (-98 >= a0)) )){
a4 = ((((a4 - 71431) + 461687) - -176106) + -1067274);
a29 = ((((a29 + 0) % 299978)+ 300021) * 1);
a2 = 4;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (input == 2)) && a0 <= -147 ) && (a2==5)))){
a4 = ((((a4 * 5) + -282138) * 10)/ 9);
a29 = (((a29 / 5) - 228236) * 1);
a2 = 3;
return -1;
} else if(( a4 <= -86 && ( -61 < a0 && ((input == 5) && ((( 43 < a29 && (a2==4)) || ( a29 <= -144 && (a2==5))) || ((a2==5) && ((-144 < a29) && (-16 >= a29)) )))))){
a0 = (((a0 / 5) + -531058) + -5391);
a29 = ((((a29 % 299928)- 300071) - 1) + -1);
a2 = 1;
return -1;
} else if(((a2==3) && ( a4 <= -86 && ((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 1)) && -61 < a0 )))){
a29 = (((a29 * 5) - -271226) / 5);
a2 = 5;
return 21;
} else if(((a2==5) && ((((input == 1) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) ))){
if( ((-147 < a0) && (-98 >= a0)) ){
a29 = ((((a29 % 299928)+ -144) * 1) - 299526);
a2 = 3;
} else{
a29 = ((((a29 % 29)- -25) + -3) - 3);
a2 = 4;
} return -1;
} else if((((( -61 < a0 && (input == 2)) && 43 < a29 ) && a4 <= -86 ) && (a2==5))){
a0 = (((((a0 - 0) % 18)- 79) + -287852) - -287851);
a29 = ((((a29 + -432842) % 63)+ -79) * 1);
a2 = 1;
return -1;
} else if((((((input == 1) && (a2==1)) && 43 < a29 ) && ((-98 < a0) && (-61 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((((a4 * 10)/ 4) - 50479) + 331538) - 286662);
a0 = (((a0 + -221394) * 2) - 61944);
a2 = 5;
return 22;
} else if(((((a2==2) && ((input == 4) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = ((((a4 / 5) * 108)/ 10) + -99001);
a0 = (((a0 + 600024) * 1) - -69);
a29 = (((((a29 * 9)/ 10) % 29)+ 13) + 1);
return 22;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 6) && 43 < a29 ) && (a2==2))) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((a4 / 5) + -431166) * 1);
a0 = ((((((a0 * 25)/ 10) + 207162) * 2) * -1)/ 10);
a29 = ((((a29 % 299928)- 300071) / 5) + -301321);
a2 = 1;
return 21;
} else if(( ((-147 < a0) && (-98 >= a0)) && (((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 3)) && ((-86 < a4) && (-42 >= a4)) ) && (a2==3)))){
a0 = ((((a0 - -11543) + -341421) * 10)/ 9);
a29 = ((((a29 / 5) % 63)+ -79) * 1);
a2 = 4;
return 22;
} else if((( ((-147 < a0) && (-98 >= a0)) && (((input == 1) && (a2==5)) && ((-86 < a4) && (-42 >= a4)) )) && a29 <= -144 )){
a4 = (((a4 / 5) - 552897) * 1);
a0 = (((a0 + 155241) + 354784) / 5);
a29 = (((((a29 * 9)/ 10) - 55038) % 29)+ 15);
return 26;
} else if((((a2==1) && ( a0 <= -147 && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 6)))) && ((-86 < a4) && (-42 >= a4)) )){
a29 = ((((a29 + 0) % 299978)+ 300021) - -243945);
a2 = 5;
return 22;
} else if(((((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 2)) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) ) && (a2==4))){
a4 = ((((a4 - -387581) * 10)/ -9) - 92057);
a0 = ((((a0 - 206221) - -444674) / 5) + -346446);
a29 = (((((a29 - -129597) * 1) + -62679) % 299928)+ -300071);
a2 = 1;
return -1;
} else if((((a2==1) && (((input == 5) && ((-86 < a4) && (-42 >= a4)) ) && 43 < a29 )) && ((-98 < a0) && (-61 >= a0)) )){
a4 = ((((a4 * 21)/ 10) - 513244) - 63334);
a29 = ((((a29 % 29)- 14) + 8) - -20);
a2 = 5;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ( ((-98 < a0) && (-61 >= a0)) && ((input == 5) && (a2==2)))) && a29 <= -144 )){
a4 = ((((a4 + -126587) * 10)/ 9) * 4);
a0 = (((((a0 * 25)/ 10) * 10)/ 9) - 138870);
a29 = (((((a29 * 9)/ 10) * 1) % 29)- -18);
a2 = 1;
return -1;
} else if((( -61 < a0 && ((a2==1) && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 3)))) && a4 <= -86 )){
a0 = (((((a0 % 299926)- 300072) * 1) - -96529) - 96530);
a29 = (((a29 * 5) + -30526) + -238122);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((((((a2==1) && ((-16 < a29) && (43 >= a29)) ) || ( 43 < a29 && (a2==1))) || ((a2==2) && a29 <= -144 )) && (input == 5)) && ((-147 < a0) && (-98 >= a0)) ))){
a4 = ((((a4 * 10)/ 4) * 5) / 5);
a0 = ((((a0 * 10)/ 6) - 118188) + -397063);
a29 = ((((a29 % 299928)- 300071) + -1) + -1);
a2 = 1;
return -1;
} else if((((( ((-147 < a0) && (-98 >= a0)) && (input == 4)) && ((-16 < a29) && (43 >= a29)) ) && (a2==2)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 / 5) - 192549) * 10)/ 9);
a0 = (((a0 + 287869) * 2) * 1);
a29 = (((a29 - -35786) + 395553) - 630549);
a2 = 4;
return -1;
} else if(( a4 <= -86 && ((( 43 < a29 && (input == 5)) && -61 < a0 ) && (a2==3)))){
a0 = ((((a0 % 299926)- 300072) - 1) + -2);
a29 = (((((a29 - 0) * 9)/ 10) / 5) - 544016);
a2 = 1;
return -1;
} else if((((a2==4) && ( a4 <= -86 && ((input == 3) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )))) && -61 < a0 )){
a0 = ((((a0 % 299926)+ -300072) * 1) + -3);
a29 = ((((a29 % 299928)+ -300071) + -2) + 0);
a2 = 1;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (((( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (input == 6)) && ((-98 < a0) && (-61 >= a0)) ) && (a2==1)))){
a4 = ((((a4 / 5) / 5) * 861)/ 10);
a0 = (((a0 - -100650) / 5) + -453515);
a29 = ((((a29 % 29)+ 13) / 5) - -27);
a2 = 3;
return -1;
} else if(((((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 6)) && ((-86 < a4) && (-42 >= a4)) ) && (a2==2)) && a0 <= -147 )){
a4 = (((a4 / 5) - 522593) + -49139);
a29 = (((a29 / 5) + -408943) - 141073);
a2 = 1;
return -1;
} else if(( -61 < a0 && ( a4 <= -86 && ((( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (input == 2)) && (a2==4))))){
a0 = ((((a0 % 299926)+ -300072) - 2) * 1);
a29 = ((((a29 - 0) * 9)/ 10) + -22730);
a2 = 1;
return -1;
} else if((((((input == 1) && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) || 43 < a29 )) && ((-147 < a0) && (-98 >= a0)) ) && (a2==5)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((a4 - 464292) / 5) + -349277);
a0 = (((((a0 - -292898) % 18)- 83) * 10)/ 9);
a29 = (((((a29 * 9)/ 10) % 29)- -13) - -1);
a2 = 1;
return -1;
} else if(((( ((-98 < a0) && (-61 >= a0)) && ((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && (a2==3)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 - -392870) * 1) * 1) + -704326);
a0 = (((a0 - 3611) * 5) / 5);
a29 = ((((((a29 * 9)/ 10) % 29)+ 14) + -564199) - -564199);
return 26;
} else if((((a2==4) && ( ((-86 < a4) && (-42 >= a4)) && ((input == 1) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )))) && ((-98 < a0) && (-61 >= a0)) )){
a29 = ((((((a29 % 63)- 80) + -1) * 5) % 63)+ -70);
return 22;
} else if((((a2==2) && (( ((-147 < a0) && (-98 >= a0)) && (input == 4)) && ((-86 < a4) && (-42 >= a4)) )) && ((-144 < a29) && (-16 >= a29)) )){
a4 = (((((a4 * 10)/ 4) * 5) * 10)/ 9);
a0 = (((a0 - 286794) / -5) * 5);
a29 = (((((a29 * 5) % 29)- -15) - -348140) + -348131);
a2 = 4;
return -1;
} else if(((a2==5) && ( ((-86 < a4) && (-42 >= a4)) && (( ((-147 < a0) && (-98 >= a0)) && (input == 4)) && a29 <= -144 )))){
a4 = (((a4 * 5) / 5) + -406842);
a29 = ((((a29 - -600125) + 18) - 208856) + 208841);
return -1;
} else if(( a4 <= -86 && ((((((a2==2) && ((-16 < a29) && (43 >= a29)) ) || ( 43 < a29 && (a2==2))) || ((a2==3) && a29 <= -144 )) && (input == 3)) && -61 < a0 ))){
a29 = ((((a29 + 0) + 0) % 29)+ 14);
a2 = 4;
return 22;
} else if(((a2==2) && ( ((-86 < a4) && (-42 >= a4)) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 1)) && a0 <= -147 )))){
a29 = ((((a29 % 29)- -14) / 5) / 5);
return 26;
} else if(( a0 <= -147 && ((((((a2==3) && 43 < a29 ) || ( a29 <= -144 && (a2==4))) || ((a2==4) && ((-144 < a29) && (-16 >= a29)) )) && (input == 4)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 - -368988) + -509555) * 4);
a29 = (((a29 / 5) - 269560) - -609922);
a2 = 4;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && (( a0 <= -147 && ((a2==5) && (input == 1))) && 43 < a29 ))){
a4 = ((((a4 - 527117) * 10)/ 9) + -13727);
a0 = (((a0 - -361747) - -238361) - -15);
a29 = ((((((a29 - 0) * 9)/ 10) / 5) % 29)+ -13);
return 26;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 3)) && ((-98 < a0) && (-61 >= a0)) )) && (a2==5))){
if( ((-144 < a29) && (-16 >= a29)) ){
a0 = (((a0 - -265548) + 287278) + -1007061);
a29 = ((((a29 % 63)+ -78) * 1) + -3);
a2 = 2;
} else{
a4 = (((a4 + -300226) / 5) + -5161);
a0 = (((a0 - 211989) + -343212) / 5);
a29 = (((((a29 / 5) / 5) + -325965) % 63)+ -68);
a2 = 1;
} return 22;
} else if((((a2==2) && (((input == 4) && ((-86 < a4) && (-42 >= a4)) ) && 43 < a29 )) && ((-98 < a0) && (-61 >= a0)) )){
if((a2==2)){
a4 = (((a4 / 5) - -464382) - 647516);
a0 = ((((a0 / 5) / -5) * 10)/ 9);
a2 = 5;
} else{
a0 = ((((a0 - 280318) + -109923) + 576736) + -186541);
a29 = ((((a29 + -496909) * 1) % 29)- -14);
a2 = 4;
} return -1;
} else if((((((( ((-16 < a29) && (43 >= a29)) && (a2==1)) || ( 43 < a29 && (a2==1))) || ((a2==2) && a29 <= -144 )) && (input == 2)) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) )){
a4 = (((((a4 * 10)/ 4) * 5) - -131007) - 193084);
a0 = (((a0 / 5) - 548765) - 28905);
a29 = ((((a29 % 299928)+ -300071) + -1) * 1);
a2 = 1;
return -1;
} else if(( a4 <= -86 && (((input == 6) && ((( 43 < a29 && (a2==1)) || ( a29 <= -144 && (a2==2))) || ((a2==2) && ((-144 < a29) && (-16 >= a29)) ))) && -61 < a0 ))){
a29 = ((((((a29 * 9)/ 10) % 29)- -14) + -303719) + 303718);
a2 = 3;
return 26;
} else if(((a2==1) && (( 43 < a29 && ((input == 2) && ((-98 < a0) && (-61 >= a0)) )) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 * 5) + -378206) * 1);
a0 = (((((a0 + -41) + 3) * 5) % 24)- 116);
a29 = (((((a29 % 299928)- 300071) * 10)/ 9) + -191104);
return -1;
} else if((((((input == 4) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) )) && a4 <= -86 ) && (a2==3)) && -61 < a0 )){
a4 = ((((((a4 % 21)- 48) * 9)/ 10) / 5) + -43);
a0 = (((((a0 % 299926)+ -300072) * 1) / 5) - 339337);
a29 = (((((a29 % 63)- 79) + -57784) - -570548) - 512763);
a2 = 1;
return 22;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && (a2==4))) && ((-98 < a0) && (-61 >= a0)) )){
if( ((-16 < a29) && (43 >= a29)) ){
a29 = ((((a29 % 299978)- -300021) + 0) * 1);
} else{
a4 = (((a4 * 5) - 209138) * 2);
a0 = (((a0 - -253752) + -726068) - 17929);
a29 = ((((a29 % 299928)+ -300071) + -1) - 1);
a2 = 3;
} return -1;
} else if(((a2==2) && (((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 3)) && ((-98 < a0) && (-61 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = ((((a4 * 10)/ 4) / 5) * 5);
a0 = (((a0 + 570549) + 7739) + 17884);
a29 = ((((a29 - -418570) / 5) - 588464) - -504725);
a2 = 4;
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ((((input == 2) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (a2==4)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 - 175972) - 86348) + -117422);
a0 = (((a0 + -58554) + -305933) - 232165);
a29 = (((((a29 + 0) - 0) - 0) % 29)- -29);
a2 = 1;
return 26;
} else if(( ((-147 < a0) && (-98 >= a0)) && ( ((-86 < a4) && (-42 >= a4)) && (((input == 2) && (( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) || 43 < a29 )) && (a2==5))))){
a4 = (((a4 + 316167) + -662467) * 1);
a29 = ((((a29 % 29)- -13) + 0) - 0);
a2 = 4;
return -1;
} else if(( 43 < a29 && ( a4 <= -86 && ( -61 < a0 && ((a2==3) && (input == 3)))))){
a0 = ((((a0 % 299926)- 300072) - 0) - 1);
a29 = ((((a29 % 299928)- 300071) + 99924) + -200774);
a2 = 1;
return -1;
} else if((((((input == 1) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) ) && (a2==3))){
if( ((-98 < a0) && (-61 >= a0)) ){
a29 = ((((((a29 % 29)- -13) + -61659) * 5) % 29)+ 24);
a2 = 5;
} else{
a0 = (((a0 - 401265) / 5) + -135803);
a29 = ((((a29 % 299978)+ 300021) - 0) * 1);
a2 = 4;
} return 22;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( a0 <= -147 && ((( ((-144 < a29) && (-16 >= a29)) && (a2==2)) || (( 43 < a29 && (a2==1)) || ((a2==2) && a29 <= -144 ))) && (input == 1))))){
a29 = ((((((a29 - 0) - 0) * 9)/ 10) % 29)- -13);
a2 = 2;
return 21;
} else if(((a2==4) && ((((input == 3) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) ))){
a0 = ((((a0 * 5) - 152016) * 10)/ 9);
a29 = ((((a29 % 299928)+ -300071) + 0) * 1);
a2 = 3;
return -1;
} else if(((a2==4) && ((((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 1)) && a4 <= -86 ) && -61 < a0 ))){
a0 = (((((a0 - 0) % 299926)- 300072) + 580975) - 580976);
a29 = (((a29 - 0) / 5) - 197811);
a2 = 1;
return -1;
} else if((((a2==4) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 4)) && ((-98 < a0) && (-61 >= a0)) )) && ((-86 < a4) && (-42 >= a4)) )){
a0 = ((((a0 - 43) * 5) % 24)+ -121);
a29 = ((((a29 % 63)- 79) - -14650) + -14651);
a2 = 2;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ( 43 < a29 && ((input == 3) && (a2==1)))) && ((-98 < a0) && (-61 >= a0)) )){
a0 = (((((a0 * 5) - 204273) * 2) % 24)- 115);
a29 = ((((a29 + 0) / 5) % 29)+ -10);
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ((a2==1) && ( ((-86 < a4) && (-42 >= a4)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 3)))))){
a0 = (((a0 - 558048) + -12197) - 637);
a29 = ((((a29 % 63)- 78) + -41396) - -41393);
a2 = 3;
return -1;
} else if(( a0 <= -147 && (((((a2==2) && ((-144 < a29) && (-16 >= a29)) ) || (( 43 < a29 && (a2==1)) || ( a29 <= -144 && (a2==2)))) && (input == 2)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = ((((a4 * 10)/ 4) - 138332) + -409121);
a29 = (((((a29 % 299928)+ -300071) + 218992) * 1) + -218992);
a2 = 1;
return -1;
} else if(((( ((-86 < a4) && (-42 >= a4)) && ((input == 2) && (a2==2))) && ((-147 < a0) && (-98 >= a0)) ) && ((-144 < a29) && (-16 >= a29)) )){
a4 = (((a4 / 5) - 28051) / 5);
a0 = (((a0 - -70089) + 469661) + -953384);
a2 = 1;
return -1;
} else if((((( ((-98 < a0) && (-61 >= a0)) && (input == 2)) && a29 <= -144 ) && (a2==2)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = (((a4 + -494899) * 1) - 70550);
a0 = ((((a0 - -314354) + 111880) * 10)/ 9);
a29 = ((((a29 + 0) / 5) % 63)- 54);
a2 = 1;
return -1;
} else if((((a2==5) && ( -61 < a0 && ((input == 5) && 43 < a29 ))) && a4 <= -86 )){
a4 = ((((((a4 % 21)- 62) - 1) * 5) % 21)- 47);
a0 = ((((a0 / 5) + 345979) * 10)/ -9);
a2 = 3;
return 22;
} else if((((( a0 <= -147 && (input == 6)) && (a2==5)) && 43 < a29 ) && ((-86 < a4) && (-42 >= a4)) )){
a2 = 2;
return -1;
} else if(( 43 < a29 && ((((input == 4) && a0 <= -147 ) && ((-86 < a4) && (-42 >= a4)) ) && (a2==5)))){
a4 = ((((a4 * 21)/ 10) * 5) - 593094);
a0 = ((((((a0 % 24)- 122) + -1) * 5) % 24)+ -109);
return -1;
} else if((( ((-147 < a0) && (-98 >= a0)) && ((a2==1) && ((input == 3) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))) && ((-86 < a4) && (-42 >= a4)) )){
a0 = (((a0 + -127384) / 5) + -187730);
a29 = (((((a29 - -345279) + -27646) * 1) % 299928)- 300071);
a2 = 4;
return -1;
} else if(( -61 < a0 && (((input == 1) && ((( 43 < a29 && (a2==1)) || ( a29 <= -144 && (a2==2))) || ( ((-144 < a29) && (-16 >= a29)) && (a2==2)))) && a4 <= -86 ))){
a0 = (((((a0 % 299926)+ -300072) / 5) - -67866) - 413054);
a29 = ((((a29 % 299928)+ -300071) + -1) - 1);
a2 = 1;
return -1;
} else if(((( ((-98 < a0) && (-61 >= a0)) && ((input == 6) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && (a2==3)) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 - 339023) + -231980) - -829860) - 719049);
a0 = (((a0 / 5) * 5) + -38);
a29 = ((((a29 - 0) + 561071) % 299978)- -300021);
a2 = 5;
return -1;
} else if(((a2==3) && (( ((-98 < a0) && (-61 >= a0)) && ((input == 4) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = ((((a4 * 10)/ 4) - -506734) - 541845);
a29 = ((((a29 % 63)- 80) + 2) + -3);
a2 = 1;
return 22;
} else if(( -61 < a0 && ((((( 43 < a29 && (a2==1)) || ( a29 <= -144 && (a2==2))) || ( ((-144 < a29) && (-16 >= a29)) && (a2==2))) && (input == 2)) && a4 <= -86 ))){
a0 = (((((a0 % 299926)+ -300072) - 2) + 355893) - 355891);
a29 = (((((a29 % 299928)- 300071) + 0) / 5) + -174546);
a2 = 1;
return -1;
} else if(((((input == 1) && (( a29 <= -144 && (a2==2)) || (( ((-16 < a29) && (43 >= a29)) && (a2==1)) || ((a2==1) && 43 < a29 )))) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) )){
a0 = ((((a0 * 10)/ 6) * 5) + -500106);
a29 = (((a29 / 5) + 469185) + 438);
a2 = 2;
return 21;
} else if(((( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && (input == 3))) && (a2==5)) && 43 < a29 )){
a4 = (((a4 - 205078) * 2) + -14481);
a29 = (((((a29 % 299928)+ -300071) + -41059) * 10)/ 9);
a2 = 1;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 5)) && a0 <= -147 )) && (a2==3))){
a4 = ((((a4 * 21)/ 10) + -45471) - 243489);
a29 = (((a29 / 5) - -107734) + 61057);
a2 = 5;
return -1;
} else if(((a2==2) && ((((input == 3) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 ))){
a29 = ((((a29 % 299978)- -300021) - -1) + 0);
return 26;
} else if(((( ((-86 < a4) && (-42 >= a4)) && ( ((-147 < a0) && (-98 >= a0)) && (input == 2))) && (a2==5)) && a29 <= -144 )){
a4 = (((a4 + 50595) + -107412) + -84938);
a0 = (((((a0 % 18)- 61) - 8) + -274611) - -274610);
a29 = ((((((a29 * 9)/ 10) / 5) * 5) % 29)+ 42);
a2 = 2;
return -1;
} else if((( -61 < a0 && ((input == 5) && ((((a2==1) && 43 < a29 ) || ((a2==2) && a29 <= -144 )) || ( ((-144 < a29) && (-16 >= a29)) && (a2==2))))) && a4 <= -86 )){
a0 = (((((a0 % 299926)- 300072) * 1) / 5) + -364241);
a29 = ((((a29 % 299928)+ -300071) * 1) + -2);
a2 = 1;
return -1;
} else if(((a2==1) && ((((input == 1) && ( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) ))){
a4 = ((((a4 * 10)/ 4) * 5) / 5);
a29 = ((((a29 % 299928)+ -300071) + 0) * 1);
a2 = 3;
return -1;
} else if(((( ((-147 < a0) && (-98 >= a0)) && ((a2==2) && (input == 6))) && ((-86 < a4) && (-42 >= a4)) ) && ((-16 < a29) && (43 >= a29)) )){
a4 = (((a4 / 5) + 304026) - 427802);
a0 = (((a0 * 5) - 577550) * 1);
a2 = 3;
return -1;
} else if(( ((-98 < a0) && (-61 >= a0)) && ( 43 < a29 && (((a2==2) && (input == 2)) && ((-86 < a4) && (-42 >= a4)) )))){
if((a2==3)){
a2 = 1;
} else{
a0 = ((((a0 + -367017) - -366972) + -502345) + 502343);
a29 = ((((a29 * 9)/ 10) - 582444) - 2215);
a2 = 1;
} return -1;
} else if(((((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 3)) && ((-86 < a4) && (-42 >= a4)) ) && ((-98 < a0) && (-61 >= a0)) ) && (a2==3))){
a4 = (((a4 + 359989) / 5) + -145327);
a29 = (((((a29 % 63)+ -80) - 1) * 9)/ 10);
a2 = 1;
return -1;
} else if(( ((-147 < a0) && (-98 >= a0)) && (( ((-86 < a4) && (-42 >= a4)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 4))) && (a2==3)))){
a4 = ((((a4 * 5) * 10)/ 9) - 472916);
a0 = (((a0 * 5) + -199603) + -185614);
a29 = ((((a29 % 299928)- 300071) + -1) * 1);
a2 = 1;
return -1;
} else if(((a2==1) && (((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 6)) && a4 <= -86 ) && -61 < a0 ))){
a0 = ((((a0 * 9)/ 10) - 587044) + -1747);
a29 = (((a29 - 138235) - 4077) / 5);
return -1;
} else if(( -61 < a0 && ( a4 <= -86 && (((input == 5) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) )) && (a2==1))))){
a0 = (((((a0 % 299926)- 300072) - 3) + 505433) - 505432);
a29 = (((a29 - 76359) - 240588) * 1);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((((input == 5) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && ((-98 < a0) && (-61 >= a0)) ) && (a2==4)))){
if( ((-16 < a29) && (43 >= a29)) ){
a4 = (((a4 + -550870) - 30700) + -8946);
a0 = (((a0 - 347957) - -538641) + 141803);
a29 = ((((((a29 * 9)/ 10) % 29)- -38) + 300246) + -300253);
a2 = 1;
} else{
a29 = ((((a29 / 5) % 29)- -23) + -10);
a2 = 3;
} return -1;
} else if((( a0 <= -147 && (((input == 1) && ((-86 < a4) && (-42 >= a4)) ) && (a2==1))) && ((-16 < a29) && (43 >= a29)) )){
a29 = (((a29 + 573320) + 18246) * 1);
a2 = 4;
return 22;
} else if((( -61 < a0 && ((((a2==5) && ((-144 < a29) && (-16 >= a29)) ) || (( 43 < a29 && (a2==4)) || ((a2==5) && a29 <= -144 ))) && (input == 6))) && a4 <= -86 )){
a0 = ((((a0 % 299926)+ -300072) / 5) + -390280);
a29 = (((((a29 % 299928)+ -300071) / 5) * 5) - 4);
a2 = 1;
return -1;
} else if(( ((-147 < a0) && (-98 >= a0)) && ((a2==5) && (((input == 4) && ( 43 < a29 || ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) )))){
a0 = (((((a0 * 10)/ 6) + 363321) * -1)/ 10);
a29 = ((((a29 % 299978)- -300021) - 439759) - -439760);
a2 = 4;
return 22;
} else if((( a0 <= -147 && (((input == 4) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) )) && (a2==4))){
if( a0 <= -147 ){
a0 = (((((a0 / 5) - 10779) * 4) % 24)- 116);
a29 = (((((a29 % 63)- 78) * 1) - 400269) - -400266);
a2 = 5;
} else{
a29 = (((((a29 / 5) - -358331) - 904415) * -1)/ 10);
} return 22;
} else if(((((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 6)) && a4 <= -86 ) && (a2==3)) && -61 < a0 )){
a0 = ((((a0 % 299926)- 300072) + -2) + -1);
a29 = ((((a29 - 117398) + 20287) * 10)/ 9);
a2 = 1;
return -1;
} else if((((((input == 6) && a29 <= -144 ) && ((-86 < a4) && (-42 >= a4)) ) && (a2==5)) && ((-147 < a0) && (-98 >= a0)) )){
a0 = ((((a0 * 15)/ 10) * 5) * 5);
a29 = (((((((a29 % 29)- -32) * 9)/ 10) * 5) % 29)+ 5);
a2 = 2;
return -1;
} else if((((((input == 4) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) ) && (a2==5)) && a0 <= -147 )){
a4 = ((((a4 / 5) - 475134) * 10)/ 9);
a0 = (((a0 + 600138) + 8) * 1);
a29 = ((((a29 % 299978)- -300021) * 1) * 1);
a2 = 2;
return 22;
} else if(( -61 < a0 && (((a2==3) && ( a4 <= -86 && (input == 1))) && 43 < a29 ))){
a4 = ((((a4 % 21)- 60) - 76016) + 76016);
a0 = ((((a0 + 0) * 9)/ 10) - 595384);
a29 = (((((a29 * 9)/ 10) + -532371) % 29)+ 13);
a2 = 1;
return 21;
} else if((( ((-86 < a4) && (-42 >= a4)) && (((input == 6) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )) && (a2==5))) && a0 <= -147 )){
a29 = (((((a29 % 29)- -14) + -387824) + 752212) + -364388);
return 22;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((a2==4) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 4)))) && ((-147 < a0) && (-98 >= a0)) )){
a0 = ((((a0 - 283784) + -203187) * 10)/ 9);
a29 = ((((a29 * 9)/ 10) - 36588) - -616793);
a2 = 5;
return 22;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 5)) && ((-98 < a0) && (-61 >= a0)) )) && (a2==3))){
if( a0 <= -147 ){
a4 = (((a4 - 538200) * 1) + -6027);
a0 = (((((a0 + 338124) + -338172) * 5) % 24)- 116);
a29 = (((((a29 + 217515) * 1) * 1) % 29)- -13);
a2 = 4;
} else{
a4 = (((a4 + -350456) * 1) + -153833);
a0 = (((a0 - 245704) + 245659) - -1);
a29 = ((((a29 - 0) / 5) % 63)+ -53);
a2 = 5;
} return -1;
} else if(( a4 <= -86 && ((((((a2==1) && 43 < a29 ) || ((a2==2) && a29 <= -144 )) || ( ((-144 < a29) && (-16 >= a29)) && (a2==2))) && (input == 4)) && -61 < a0 ))){
a29 = ((((a29 % 299978)- -300021) - 0) + 0);
a2 = 3;
return 21;
} else if((((a2==3) && (((input == 5) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && ((-86 < a4) && (-42 >= a4)) )) && ((-98 < a0) && (-61 >= a0)) )){
a4 = ((((a4 * 10)/ 4) + -494230) / 5);
a29 = ((((a29 + -416279) % 29)- -14) - 1);
a2 = 2;
return 21;
} else if(( ((-98 < a0) && (-61 >= a0)) && (((a2==3) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 6))) && ((-86 < a4) && (-42 >= a4)) ))){
if( -61 < a0 ){
a0 = ((((a0 + 145127) + 195081) * 10)/ -9);
a29 = ((((a29 + -380697) % 299978)- -300021) * 1);
a2 = 5;
} else{
a0 = ((((a0 + 207710) - 207755) + 233903) + -233904);
a29 = ((((a29 % 29)- -14) / 5) + 7);
a2 = 1;
} return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-147 < a0) && (-98 >= a0)) && ((a2==2) && ( ((-144 < a29) && (-16 >= a29)) && (input == 5)))))){
a4 = (((a4 - 7082) / 5) * 5);
a0 = (((a0 / 5) + -422618) - 20096);
a29 = ((((a29 * 5) * -6)/ 10) * 5);
a2 = 5;
return -1;
} else if(((((((a2==3) && ((-144 < a29) && (-16 >= a29)) ) || (((a2==2) && 43 < a29 ) || ((a2==3) && a29 <= -144 ))) && (input == 6)) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) )){
if( ((-147 < a0) && (-98 >= a0)) ){
a29 = (((((a29 - 0) + 0) + 0) % 299978)+ 300021);
a2 = 2;
} else{
a0 = (((a0 + -433671) / 5) * 5);
a29 = (((((a29 + 0) % 63)- 80) / 5) + -92);
a2 = 5;
} return 22;
} else if(((a2==3) && ( ((-147 < a0) && (-98 >= a0)) && ((( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 6)) && ((-86 < a4) && (-42 >= a4)) )))){
a4 = ((((a4 * 5) * 5) * 10)/ 9);
a0 = ((((a0 / 5) * 78)/ 10) - 489010);
a29 = ((((a29 * 9)/ 10) - 579679) * 1);
a2 = 1;
return -1;
} else if(((((( ((-16 < a29) && (43 >= a29)) || ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && (input == 1)) && (a2==3)) && ((-86 < a4) && (-42 >= a4)) ) && a0 <= -147 )){
a4 = (((a4 * 5) + -32547) * 5);
a0 = ((((a0 / 5) % 18)- 77) - 2);
a29 = ((((a29 + 577364) % 299928)- 300071) + -2);
return -1;
} else if(((a2==2) && (( ((-98 < a0) && (-61 >= a0)) && ((input == 5) && ( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ))){
a29 = ((((((a29 % 63)- 80) * 5) * 5) % 63)+ -45);
a2 = 3;
return -1;
} else if(( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && ((a2==1) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 5)))))){
a4 = (((a4 / 5) + -69516) / 5);
a0 = (((((a0 % 24)- 100) / 5) * 61)/ 10);
a29 = ((((a29 + 0) % 29)- -25) / 5);
a2 = 5;
return -1;
} else if(((((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 1)) && ((-147 < a0) && (-98 >= a0)) ) && ((-86 < a4) && (-42 >= a4)) ) && (a2==4))){
a29 = ((((a29 % 299928)- 144) + -181525) + 96009);
a2 = 1;
return 26;
} else if((((((input == 6) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) ) && (a2==5)) && ((-98 < a0) && (-61 >= a0)) )){
a0 = (((((a0 * 10)/ 4) * 10)/ 9) - 507512);
a29 = (((((a29 / 5) - 91161) / 5) % 63)- 80);
return 22;
} else if((( a0 <= -147 && ((input == 3) && ((( 43 < a29 && (a2==1)) || ( a29 <= -144 && (a2==2))) || ((a2==2) && ((-144 < a29) && (-16 >= a29)) )))) && ((-86 < a4) && (-42 >= a4)) )){
a0 = ((((a0 - -170985) - 169742) % 24)+ -121);
a29 = (((((a29 + 0) % 63)- 80) - -45522) + -45522);
a2 = 1;
return 21;
} else if(( -61 < a0 && (((input == 4) && (( ((-144 < a29) && (-16 >= a29)) && (a2==5)) || (((a2==4) && 43 < a29 ) || ((a2==5) && a29 <= -144 )))) && a4 <= -86 ))){
a0 = ((((a0 % 299926)+ -300072) / 5) - 264648);
a29 = ((((a29 + 0) % 299928)- 300071) - 0);
a2 = 1;
return -1;
} else if(((a2==4) && ( ((-147 < a0) && (-98 >= a0)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 5)) && ((-86 < a4) && (-42 >= a4)) )))){
a4 = ((((a4 * 10)/ 4) - 249415) - 6157);
a0 = ((((a0 * 10)/ 6) / 5) + -139723);
a29 = ((((a29 + 0) % 299928)- 144) * 1);
a2 = 1;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-98 < a0) && (-61 >= a0)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 1)) && (a2==4))))){
a4 = (((a4 + -3562) - 172744) + -275564);
a0 = (((a0 + -141190) + -295915) / 5);
a29 = (((((a29 % 63)+ -63) + 12) - -297123) - 297094);
a2 = 2;
return -1;
} else if((((( ((-86 < a4) && (-42 >= a4)) && (input == 5)) && ((-98 < a0) && (-61 >= a0)) ) && (a2==2)) && 43 < a29 )){
a4 = (((a4 * 5) * 5) + -392587);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==2) && (( 43 < a29 && (input == 1)) && ((-98 < a0) && (-61 >= a0)) )))){
a4 = ((((a4 * 10)/ 4) * 5) + -539534);
a0 = (((a0 / 5) + 96252) / 5);
a29 = (((((a29 / 5) + 107358) * 2) % 63)+ -112);
return 22;
} else if(((a2==5) && ( ((-86 < a4) && (-42 >= a4)) && ( ((-98 < a0) && (-61 >= a0)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 6)))))){
a4 = (((((a4 - -92469) / 5) / 5) * -1)/ 10);
a29 = (((((a29 % 299978)- -300021) + -100467) / 5) - -264530);
a2 = 3;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==5) && ( ((-98 < a0) && (-61 >= a0)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 1)))))){
a4 = ((((a4 + -469882) * 10)/ 9) - 73224);
a29 = (((a29 / 5) - 149597) + -40814);
a2 = 3;
return 22;
} else if(( ((-147 < a0) && (-98 >= a0)) && (((a2==1) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 1))) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 + -119083) / 5) - 259714);
a0 = (((((a0 * 15)/ 10) * 10)/ 9) + -14455);
a29 = (((a29 / 5) + -325971) * 1);
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((((((a2==2) && 43 < a29 ) || ((a2==3) && a29 <= -144 )) || ((a2==3) && ((-144 < a29) && (-16 >= a29)) )) && (input == 3)) && ((-147 < a0) && (-98 >= a0)) ))){
a4 = (((a4 + -513094) + -85153) - 1529);
a0 = ((((a0 % 18)- 68) - -263551) - 263549);
a29 = ((((a29 % 299928)+ -300071) * 1) - 1);
a2 = 1;
return -1;
} else if(( a0 <= -147 && ((((a2==1) && (input == 4)) && ((-86 < a4) && (-42 >= a4)) ) && ((-16 < a29) && (43 >= a29)) ))){
a4 = (((a4 - 467094) - -9544) * 1);
a0 = (((a0 - -542155) - -57832) + 130);
a29 = ((((a29 - 101) / 5) + 573816) - 573849);
a2 = 2;
return 26;
} else if(( ((-16 < a29) && (43 >= a29)) && ( ((-147 < a0) && (-98 >= a0)) && ((a2==2) && ((input == 2) && ((-86 < a4) && (-42 >= a4)) ))))){
a4 = ((((a4 * 10)/ 4) / 5) - 538737);
a0 = (((a0 / 5) + -413860) + 135682);
a29 = (((((a29 + -84) + 101720) * 5) % 63)- 111);
a2 = 1;
return -1;
} else if((((a2==1) && ((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 2)) && a4 <= -86 )) && -61 < a0 )){
a29 = ((((a29 - -384948) * -1)/ 10) * 5);
a2 = 2;
return 21;
} else if(((a2==4) && (( ((-86 < a4) && (-42 >= a4)) && ((input == 6) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 ))) && ((-147 < a0) && (-98 >= a0)) ))){
a4 = ((((a4 * 21)/ 10) * 5) / 5);
a0 = (((((a0 / 5) * 78)/ 10) / 5) + -577837);
a29 = (((((a29 % 29)+ 13) / 5) + 56090) - 56081);
a2 = 3;
return -1;
} else if((( a0 <= -147 && (((input == 6) && ((-86 < a4) && (-42 >= a4)) ) && (a2==1))) && ((-16 < a29) && (43 >= a29)) )){
a4 = (((((a4 * 10)/ 4) * 5) - -461601) - 1009325);
a29 = (((a29 - 154537) * 3) / 5);
return -1;
} else if(( a4 <= -86 && (((((a2==3) && a29 <= -144 ) || (((a2==2) && ((-16 < a29) && (43 >= a29)) ) || ( 43 < a29 && (a2==2)))) && (input == 4)) && -61 < a0 ))){
if((a2==1)){
a4 = ((((((a4 - 0) % 21)+ -46) / 5) * 59)/ 10);
a0 = (((((a0 % 24)+ -121) + -1) / 5) + -107);
a29 = (((((a29 % 299928)+ -300071) * 1) + 266435) - 266436);
a2 = 4;
} else{
a29 = (((((a29 * 9)/ 10) / 5) % 29)- -13);
a2 = 5;
} return 26;
} else if(( ((-144 < a29) && (-16 >= a29)) && ((a2==2) && (( ((-86 < a4) && (-42 >= a4)) && (input == 6)) && ((-147 < a0) && (-98 >= a0)) )))){
a4 = ((((a4 * 5) - -277812) + 281460) + -586903);
a0 = (((a0 + -590086) + -3070) * 1);
a29 = ((((a29 - -298590) % 29)- -11) + 1);
a2 = 3;
return -1;
} else if(( ((-86 < a4) && (-42 >= a4)) && ( ((-147 < a0) && (-98 >= a0)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 3)) && (a2==4))))){
a0 = (((a0 * 5) * 5) + -226030);
a29 = (((((a29 % 29)- -31) + -437215) + -100009) + 537223);
a2 = 5;
return 22;
} else if(( ((-86 < a4) && (-42 >= a4)) && ((a2==5) && (((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 1)) && a0 <= -147 )))){
a4 = ((((((a4 * 10)/ 4) - 219251) + 313842) * -1)/ 10);
a0 = (((((a0 % 24)+ -114) * 5) % 24)+ -100);
a29 = (((((a29 % 299978)- -300021) + 0) / 5) - -56448);
a2 = 4;
return -1;
} else if(((( ((-16 < a29) && (43 >= a29)) && ( ((-86 < a4) && (-42 >= a4)) && (input == 2))) && a0 <= -147 ) && (a2==1))){
a4 = (((a4 / 5) - 423836) / 5);
a29 = (((a29 / 5) + -232495) + -191727);
return -1;
} else if((( ((-147 < a0) && (-98 >= a0)) && (( ((-16 < a29) && (43 >= a29)) && (input == 3)) && (a2==2))) && ((-86 < a4) && (-42 >= a4)) )){
a0 = (((a0 - 182793) - 17271) + -5363);
a29 = ((((a29 + -61) - -1) / 5) - 18);
a2 = 3;
return -1;
} else if(((a2==3) && ( ((-98 < a0) && (-61 >= a0)) && ( ((-86 < a4) && (-42 >= a4)) && ((input == 1) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )))))){
if((a2==4)){
a4 = ((((a4 + -299499) - 63850) * 10)/ 9);
a29 = (((a29 / 5) + -305253) * 1);
} else{
a4 = ((((((a4 * 21)/ 10) + 263628) / 5) * -1)/ 10);
a0 = (((((a0 * 10)/ 4) * 5) - -456731) - 842965);
a29 = ((((a29 - 0) + 0) % 299978)+ 300021);
a2 = 2;
} return -1;
} else if(( a4 <= -86 && (( -61 < a0 && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 6))) && (a2==4)))){
a0 = (((((a0 + 0) % 299926)+ -300072) + 120564) - 120564);
a29 = (((((a29 % 299928)- 300071) + 122297) * 1) - 122298);
a2 = 1;
return -1;
} else if(( a4 <= -86 && ( ((-16 < a29) && (43 >= a29)) && (( -61 < a0 && (input == 2)) && (a2==5))))){
a0 = ((((a0 * 9)/ 10) + 1586) - 558159);
a29 = ((((a29 - -259897) * 10)/ -9) * 2);
a2 = 1;
return -1;
} else if((((a2==1) && ((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) && (input == 4)) && a4 <= -86 )) && -61 < a0 )){
a29 = (((a29 / 5) / 5) + 4459);
a2 = 2;
return 22;
} else if((( ((-16 < a29) && (43 >= a29)) && ( a4 <= -86 && ( -61 < a0 && (input == 1)))) && (a2==5))){
a4 = ((((((a4 % 21)- 54) - 6) / 5) * 49)/ 10);
a0 = (((((a0 % 24)- 122) - 1) + -244070) + 244070);
a29 = ((((a29 - 83) * 10)/ 9) + 25);
a2 = 1;
return 26;
} else if(( ((-98 < a0) && (-61 >= a0)) && ( ((-86 < a4) && (-42 >= a4)) && (((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )) && (a2==5))))){
a4 = (((a4 - 3094) + -312684) - 267039);
a0 = (((a0 - 345188) * 1) - -345143);
a29 = (((((a29 % 29)- -13) + 0) - 546639) - -546639);
a2 = 2;
return -1;
}
return calculate_output2(input);
}
int calculate_output2(int input) {
if(((( ((-86 < a4) && (-42 >= a4)) && ((input == 3) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && (a2==4)) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((((a4 * 10)/ 4) * 10)/ 9) - 397224);
a0 = (((a0 - 215873) - 88181) - 261733);
a29 = (((((a29 / 5) + -97608) / 5) % 63)+ -45);
a2 = 5;
return -1;
} else if((((a2==3) && ( ((-86 < a4) && (-42 >= a4)) && ((input == 6) && (( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) )))) && a0 <= -147 )){
a4 = ((((a4 / 5) + -351472) * 10)/ 9);
a29 = ((((a29 % 29)+ 13) - -213179) + -213178);
return -1;
} else if(( -61 < a0 && ( a4 <= -86 && (( 43 < a29 && (input == 6)) && (a2==3))))){
a0 = ((((a0 % 299926)- 300072) + -3) + 0);
a29 = (((a29 / 5) - 393067) + -7867);
a2 = 1;
return -1;
} else if(( a0 <= -147 && ((((((a2==3) && 43 < a29 ) || ((a2==4) && a29 <= -144 )) || ( ((-144 < a29) && (-16 >= a29)) && (a2==4))) && (input == 3)) && ((-86 < a4) && (-42 >= a4)) ))){
a4 = (((a4 * 5) - 228549) * 2);
a0 = ((((a0 - -354541) / 5) % 24)+ -121);
a29 = (((((a29 + 0) % 299928)- 300071) / 5) - 431072);
a2 = 2;
return -1;
} else if(((a2==2) && ( ((-144 < a29) && (-16 >= a29)) && ( ((-86 < a4) && (-42 >= a4)) && ((input == 3) && ((-147 < a0) && (-98 >= a0)) ))))){
if( ((-98 < a0) && (-61 >= a0)) ){
} else{
a0 = (((a0 - 548873) + -8551) - 28143);
a29 = ((((a29 * 91)/ 10) + -24030) * 5);
a2 = 3;
} return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((a2==4) && ((input == 2) && ( ((-16 < a29) && (43 >= a29)) || 43 < a29 )))) && ((-147 < a0) && (-98 >= a0)) )){
a4 = (((a4 - 284947) + -248704) / 5);
a0 = (((a0 - 252835) * 2) + -2618);
a29 = (((((a29 + 0) - 575700) * 1) % 63)- 79);
a2 = 1;
return -1;
} else if((((((input == 4) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) )) && ((-86 < a4) && (-42 >= a4)) ) && (a2==3)) && ((-98 < a0) && (-61 >= a0)) )){
a4 = (((a4 - 252198) / 5) * 5);
a0 = (((a0 - 552451) * 1) + -37368);
a29 = ((((a29 - 0) - -265598) % 299978)- -300021);
return 26;
} else if((( ((-98 < a0) && (-61 >= a0)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) && (input == 3)) && ((-86 < a4) && (-42 >= a4)) )) && (a2==3))){
a29 = ((((a29 % 29)- -28) - 5) - 3);
return 26;
} else if(( ((-98 < a0) && (-61 >= a0)) && (((a2==5) && ((input == 5) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ))){
if( ((-144 < a29) && (-16 >= a29)) ){
a0 = (((((a0 - 391159) / 5) + 474417) * -1)/ 10);
a29 = ((((a29 + 321043) - 44655) % 299928)+ -300071);
a2 = 2;
} else{
a4 = ((((a4 * 10)/ 4) / 5) - 33144);
a0 = ((((a0 / 5) * 123)/ 10) * 5);
a29 = (((((a29 * 9)/ 10) + 432860) + -149935) - 317631);
a2 = 3;
} return 26;
} else if((( ((-147 < a0) && (-98 >= a0)) && ((input == 2) && (((a2==3) && ((-144 < a29) && (-16 >= a29)) ) || (((a2==2) && 43 < a29 ) || ( a29 <= -144 && (a2==3)))))) && ((-86 < a4) && (-42 >= a4)) )){
a4 = ((((a4 / 5) / 5) / 5) + -458972);
a0 = (((((a0 * 15)/ 10) + -283184) * 10)/ 9);
a29 = (((a29 / 5) - 94068) + -91929);
a2 = 3;
return -1;
} else if((( ((-86 < a4) && (-42 >= a4)) && ((a2==5) && ((( ((-144 < a29) && (-16 >= a29)) || ((-16 < a29) && (43 >= a29)) ) || 43 < a29 ) && (input == 3)))) && ((-147 < a0) && (-98 >= a0)) )){
a4 = (((a4 - 65033) - 174567) * 2);
a29 = (((((a29 * 9)/ 10) % 29)- -14) + -1);
a2 = 2;
return -1;
} else if(((((a2==4) && ((input == 6) && ( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ))) && ((-86 < a4) && (-42 >= a4)) ) && ((-147 < a0) && (-98 >= a0)) )){
a4 = (((a4 + 416590) + -672129) * 2);
a0 = (((a0 + -331324) + -72862) + -9547);
a29 = ((((a29 + 0) / 5) / 5) + -415155);
a2 = 1;
return -1;
} else if((((a2==5) && ( ((-86 < a4) && (-42 >= a4)) && ((( a29 <= -144 || ((-144 < a29) && (-16 >= a29)) ) || ((-16 < a29) && (43 >= a29)) ) && (input == 5)))) && a0 <= -147 )){
a4 = (((a4 * 5) + -29347) + -97982);
a0 = (((((a0 % 18)+ -74) / 5) * 49)/ 10);
a29 = ((((a29 - -237985) % 299978)+ 300021) * 1);
a2 = 3;
return -1;
} else if(((a2==4) && ( a0 <= -147 && ( ((-86 < a4) && (-42 >= a4)) && (( ((-16 < a29) && (43 >= a29)) || 43 < a29 ) && (input == 3)))))){
a4 = (((a4 / 5) + -251576) * 2);
a0 = (((((a0 + 0) % 24)+ -113) / 5) - 105);
a29 = (((((a29 / 5) - -479587) - -287) % 29)+ 3);
a2 = 2;
return -1;
}
return -2;
}
int main()
{
// default output
int output = -1;
// main i/o-loop
while(1)
{
// read input
int input;
scanf("%d", &input);
// operate eca engine
output = calculate_output(input);
if(output == -2)
fprintf(stderr, "Invalid input: %d\n", input);
else if(output != -1)
printf("%d\n", output);
}
} |
the_stack_data/769024.c | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#define check(cond, errmsg) if(!(cond)){perror(errmsg); exit(EXIT_FAILURE);}
#define require(cond) if(!(cond)){usage(stderr); exit(EXIT_FAILURE);}
#define NAME_BYTES 32
#define AGE_BYTES 2
char* bkpFileName=".backup";
struct Person{
char name[NAME_BYTES];
char age[AGE_BYTES];
struct Person* next;
struct Person* prev;
};
void usage(FILE* f) {
fprintf(f, "Usage: ...\n");
}
void printPerson(struct Person* person) {}
int readPerson(int fd, struct Person* person) {
check(
read(fd, &person->name, NAME_BYTES) == NAME_BYTES,
"Error while reading name: "
);
person->name[NAME_BYTES-1] = 0;
// Skipping empty space
lseek(fd, 1, SEEK_CUR);
check(
read(fd, &person->age, AGE_BYTES) == AGE_BYTES,
"Error while reading age: "
);
person->age[AGE_BYTES-1] = 0;
person->next=NULL;
person->prev=NULL;
char tmp;
return read(fd, &tmp, 1) == 1;
}
int main(int argc, const char** argv) {
int fd;
char* fContent;
struct Person *personList,
*ptrToLast;
check((fd=open(bkpFileName, O_RDONLY)) >= 0, "Error opening file descriptor");
personList = malloc(sizeof(struct Person));
ptrToLast = personList;
while (readPerson(fd, ptrToLast)){
ptrToLast->next = malloc(sizeof(struct Person));
ptrToLast->next->prev = ptrToLast;
ptrToLast = ptrToLast->next;
}
// Deallocate person list
close(fd);
return 0;
}
|
the_stack_data/9512091.c | /* "bug 8": promotion of arrays inside ?: */
void printf();
int main() {
int *ip;
int *jp;
int ia[3];
jp = (1 ? ia : ip);
}
|
the_stack_data/680517.c | long
upa1(pk01, pk11, a11, sigpk1)
long pk01, pk11, a11, sigpk1;
{
long pks, uga1, a1s, ula1, ua1, a1t;
pks = pk01 ^ pk11;
if ((pks == 0) && (sigpk1 == 0))
uga1 = 192;
else if ((pks == 1) && (sigpk1 == 0))
uga1 = 65344;
else
uga1 = 0;
a1s = (a11 >> 15) ;
ula1 = a1s ? (65536 - (( a11 >> 8) + 65280)) & 65535
: (65536 - (a11 >> 8)) & 65535;
ua1 = (uga1 + ula1) & 65535;
a1t = ( a11 + ua1) & 65535;
return(a1t);
}
|
the_stack_data/187644302.c | /**
\file STM32F0xx.c
\author Andy Gock
\brief Functions specific to STM32 F0 ARM Cortex-M0 devices.
*/
/*
Copyright (c) 2012, Andy Gock
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Andy Gock nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if defined(GLCD_DEVICE_STM32F0XX)
/* Includes from CMSIS and Peripheral Library */
#include "stm32f0xx.h"
#include "stm32f0xx_gpio.h"
#include "stm32f0xx_spi.h"
#include "stm32f0xx_rcc.h"
#include "stm32f0xx_misc.h"
/* Includes from GLCD */
#include "../glcd.h"
#include "inc/STM32F0xx.h"
void glcd_init(void)
{
/* Declare GPIO and SPI init structures */
GPIO_InitTypeDef GPIO_InitStructure;
SPI_InitTypeDef SPI_InitStructure;
/* NVIC_InitTypeDef NVIC_InitStructure; */
/* Initialise structures (which we will overide later) */
GPIO_StructInit(&GPIO_InitStructure);
SPI_StructInit(&SPI_InitStructure);
/* Need to make start up the correct peripheral clocks */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);
/* SS pin */
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SS_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_Init(CONTROLLER_SPI_SS_PORT, &GPIO_InitStructure);
/* DC pin */
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_DC_PIN;
GPIO_Init(CONTROLLER_SPI_DC_PORT, &GPIO_InitStructure);
/* RESET pin */
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_RST_PIN;
GPIO_Init(CONTROLLER_SPI_RST_PORT, &GPIO_InitStructure);
/* Make sure chip is de-selected by default */
GLCD_DESELECT();
/* Set up GPIO for SPI pins */
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SCK_PIN | CONTROLLER_SPI_MISO_PIN | CONTROLLER_SPI_MOSI_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_Init(CONTROLLER_SPI_PORT, &GPIO_InitStructure);
/* Configure alternate function mode for SPI pins */
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_SCK_PINSRC,GPIO_AF_0);
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_MOSI_PINSRC,GPIO_AF_0);
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_MISO_PINSRC,GPIO_AF_0);
/* Initialise SPI */
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32; /* Set clock speed! */
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(CONTROLLER_SPI_NUMBER, &SPI_InitStructure);
/* Enable SPI interupts */
/*
SPI_I2S_ITConfig(CONTROLLER_SPI_NUMBER, SPI_I2S_IT_TXE, ENABLE);
NVIC_InitStructure.NVIC_IRQChannel = SPI1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_InitStructure.NVIC_IRQChannelPriority = 0x00;
NVIC_Init(&NVIC_InitStructure);
*/
/* Enable SPI */
SPI_Cmd(CONTROLLER_SPI_NUMBER, ENABLE);
#if defined(GLCD_CONTROLLER_PCD8544)
/* Initialisation for PCD8544 controller */
glcd_PCD8544_init();
#else
#error "Controller not supported by STM32F0xx"
#endif
glcd_select_screen((uint8_t *)&glcd_buffer,&glcd_bbox);
glcd_clear();
}
void glcd_spi_write(uint8_t c)
{
GLCD_SELECT();
SPI_SendData8(CONTROLLER_SPI_NUMBER, (uint16_t) c);
/* Wait until entire byte has been read (which we discard anyway) */
while(SPI_I2S_GetFlagStatus(CONTROLLER_SPI_NUMBER, SPI_I2S_FLAG_BSY) != RESET);
GLCD_DESELECT();
}
void glcd_reset(void)
{
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
GLCD_SELECT();
GLCD_RESET_LOW();
delay_ms(GLCD_RESET_TIME);
GLCD_RESET_HIGH();
GLCD_DESELECT();
}
#endif
|
the_stack_data/41625.c | /* { dg-do compile } */
typedef long
(*bla)(int *node);
static long F2(void *tree, long blk, bla after_node_func)
{
long call_result = 0;
int *node;
if (call_result = after_node_func(node))
goto error_free_node;
T(node);
return 0;
error_free_node:
T(node);
error:
return call_result;
}
long F1(void *tree)
{
return F2(tree, F3(tree), (void *)0);
}
|
the_stack_data/66163.c | /*
Autor: Dayrin Cardona
Compilador: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Compilado: gcc Programa6.c -o Programa6
Fecha: Fri Apr 16 15:09:25 CST 2021
Librerías: stdio (u otras)
Resumen: Programa que realiza sumatorias
Entradas: El número n que ingresa el usuario, límite de la sumatoria
Salidas: Cuatro sumatorias de cuatro diferentes funciones
*/
//Librerías
#include <stdio.h>
#include <math.h>
//Declaración de variables
int n;
//Prototipos de funciones
void funciona(), funcionb(), funcionc(), funciond();
//Función principal
int main(){
//El programa muestra en pantalla los resultados de las sumatorias.
printf("Ingrese un número n para realizar las sumatorias ");
scanf("%d",&n);
puts("La sumatoria de la función a) es ");
funciona();
puts("La sumatoria de la función b) es ");
funcionb();
puts("La sumatoria de la función c) es ");
funcionc();
puts("La sumatoria de la función d) es ");
funciond();
}
void funciona(){
//Declaración de variable que almacena la sumatoria.
int a=0;
for(int k=1;k<=n;k++)
{
//Función de la primera sumatoria.
a+=k*k*(k-3);
}
printf("%d \n",a);
}
void funcionb(){
//Declaración de variable que almacena la sumatoria.
double b=0;
for(int k=2;k<=n;k++)
{
//Función de la segunda sumatoria.
b+=(double)3/(k-1);
}
printf("%.2lf \n",b);
}
void funcionc(){
//Declaración de variable que almacena la sumatoria.
double c=0;
for(int k=1;k<=n;k++)
{
double exp,exp1,exp2,exp3;
exp1=(double)sqrt(5);
exp2=(double)(1+exp1)/2;
exp3=(double)(1-exp1)/2;
//Función de la tercera sumatoria.
c+=(double) (1/exp1)*((pow((double)exp2,(double)k)) - pow((double)exp3,(double)k));
}
printf("%.2lf \n",c);
}
void funciond(){
//Declaración de variable que almacena la sumatoria.
double d=0;
for(int k=2;k<=n;k++)
{
//Función de la cuarta sumatoria.
int exp;
exp= pow((double)2,(double)k-2);
d += 3*exp+4;
}
d=(double)d*0.1;
printf("%.2lf \n",d);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.