file
stringlengths 18
26
| data
stringlengths 2
1.05M
|
---|---|
the_stack_data/11075800.c
|
#include <stdio.h>
#include <dlfcn.h>
int my_printf(char *format, ...);
int main(int ac, char **av)
{
int res;
// void *handle;
// int (*my_printf)(char *str, ...);
// if (!(handle = dlopen("./libmy_printf_x86_64-Linux.so", RTLD_LAZY | RTLD_GLOBAL | RTLD_NOW)))
// return 1;
// my_printf = dlsym(handle, "my_printf");
res = 0;
res = my_printf("1 - une chaine\n");
my_printf("%d\n", res);
res = my_printf("2 - %s\n", "une autre chaine");
my_printf("%d\n", res);
res = my_printf("3 - %i\n", 42);
my_printf("%d\n", res);
res = my_printf("4 - %s %d %s%c\n", "avec", 4, "parametres", '\n');
my_printf("%d\n", res);
res = my_printf("1 - %o\n", 42); /* unsigned octal */
my_printf("%d\n", res);
res = my_printf("2 - %u\n", 4200000000); /* unsigned decimal */
my_printf("%d\n", res);
res = my_printf("3 - %x\n", 42); /* unsigned hexadecimal */
my_printf("%d\n", res);
res = my_printf("4 - %X\n", 42); /* unsigned hexadecimal */
my_printf("%d\n", res);
res = my_printf("5 - %d%%\n", 42);
my_printf("%d\n", res);
}
|
the_stack_data/1173169.c
|
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define STEP 4
bool is_valid_opcode(int o) {
if(o == 1 || o == 2 || o == 99) {
return true;
}
return false;
}
int main() {
// puzzle input
int code[] = {1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,6,1,19,1,19,5,23,2,10,23
,27,2,27,13,31,1,10,31,35,1,35,9,39,2,39,13,43,1,43,5,47
,1,47,6,51,2,6,51,55,1,5,55,59,2,9,59,63,2,6,63,67,1,13
,67,71,1,9,71,75,2,13,75,79,1,79,10,83,2,83,9,87,1,5,87
,91,2,91,6,95,2,13,95,99,1,99,5,103,1,103,2,107,1,107
,10,0,99,2,0,14,0};
// change input as instructed
code[1] = 12;
code[2] = 2;
int size = sizeof(code) / sizeof(code[0]);
for(int i = 0; i < size; i += STEP) {
int op = code[i];
int addr_a = code[i+1];
int addr_b = code[i+2];
int addr_c = code[i+3];
if(is_valid_opcode(op)) {
if(op == 99) { // exit
printf("value at postion 0: %d\n", code[0]);
exit(EXIT_SUCCESS);
} else if(op == 1) { // add
code[addr_c] = code[addr_a] + code[addr_b];
} else if(op == 2) { // multiply
code[addr_c] = code[addr_a] * code[addr_b];
}
} else {
printf("Error: %d is not a valid opcode\n", op);
exit(EXIT_FAILURE);
}
}
}
|
the_stack_data/182952673.c
|
#include <stdio.h>
#include <stdbool.h>
bool is_prime(int n) {
if (n <= 1) {
return false;
}
for (int i = 2, step = 1; i * i <= n;) {
if (n % i == 0) {
return false;
}
i += step;
step = 2;
}
return true;
}
bool is_twin_prime(int n) {
return is_prime(n) && (is_prime(n - 2) || is_prime(n + 2));
}
int test_is_prime() {
for (int i = 0; i != 100; i++) {
if (is_prime(i)) {
printf("%d ", i);
}
}
printf("\n");
return 0;
}
int test_is_twin_prime() {
for (int i = 0; i != 100; i++) {
if (is_twin_prime(i)) {
printf("%d ", i);
}
}
printf("\n");
return 0;
}
int main() {
test_is_prime();
test_is_twin_prime();
return 0;
}
|
the_stack_data/198581408.c
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int *Prefix(char *s)
{
int i,l=strlen(s),*pi=(int*)malloc(l*sizeof(int)),t=0;
pi[0]=t;
for(i=1;i<l;i++)
{
for(;t>0 && s[t]!=s[i];t=pi[t-1]);
if(s[t]==s[i]) t++;
pi[i]=t;
}
return pi;
}
int Rec(int ***ps, int n, int m, int c)
{
int i,j,r=0,b;
if(m==n) return r;
for(i=0;i<n;i++) ps[i][c][1]++;
for(i=0;i<n;i++)
{
if(ps[c][i][1]==0)
{
for(j=0;j<n;j++) ps[c][j][1]++;
b=Rec(ps,n,m+1,i)+ps[c][i][0];
if(b>r) r=b;
for(j=0;j<n;j++) ps[c][j][1]--;
}
}
for(i=0;i<n;i++) ps[i][c][1]--;
return r;
}
int Max(int ***ps, int n)
{
int i,r=0,b;
for(i=0;i<n;i++)
{
b=Rec(ps,n,1,i);
if(b>r) r=b;
}
return r;
}
int main()
{
int n,i,j,***ps,*pi,l=0;
char **s,*b=(char*)malloc(1024*sizeof(char));
scanf("%d%*c",&n);
ps=(int***)malloc(n*sizeof(int**));
s=(char**)malloc(n*sizeof(char*));
for(i=0;i<n;i++)
{
s[i]=(char*)malloc(512*sizeof(char));
ps[i]=(int**)malloc(n*sizeof(int*));
for(j=0;j<n;j++) ps[i][j]=(int*)calloc(2,sizeof(int));
gets(s[i]);
l+=strlen(s[i]);
}
//////////////м. пер.////////////////////
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
strcpy(b,s[i]);
strcat(b,s[j]);
pi=Prefix(b);
ps[j][i][0]=pi[strlen(b)-1];
free(pi);
strcpy(b,s[j]);
strcat(b,s[i]);
pi=Prefix(b);
ps[i][j][0]=pi[strlen(b)-1];
free(pi);
}
}
/*for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
printf("%2d ",ps[i][j][0]);
printf("\n");
}*/
//////////////////собсно пересчёт////////
i=Max(ps,n);
l-=i;
printf("%d",l);
/////////////////////////////////////////
for(i=0;i<n;i++)
{
for(j=0;j<n;j++) free(ps[i][j]);
free(ps[i]);
free(s[i]);
}
free(ps);
free(b);
free(s);
return 0;
}
|
the_stack_data/870826.c
|
#include<stdio.h>
int main()
{
int i,j,n;
char c;
scanf("%c%d",&c,&n);
for(i=0;i<n;i++)
{
for(j=0;j<n+i;j++)
{
if(j==n-i-1||j==n+i-1)
{
printf("%c",c+i);
}
else
{
printf(" ");
}
}
printf("\n");
}
for(i=n;i<2*n-1;i++)
{
for(j=0;j<3*n-i-2;j++)
{
if(j==3*n-i-3||j==i-n+1)
printf("%c",c+n-1-(i-n+1));
else
printf(" ");
}
printf("\n");
}
return 0;
}
|
the_stack_data/103266390.c
|
// RUN: %clang_cc1 -verify=host -Rpass=openmp-opt -Rpass-analysis=openmp-opt -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -Rpass=openmp-opt -Rpass-analysis=openmp-opt -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out
// RUN: %clang_cc1 -fexperimental-new-pass-manager -verify -Rpass=openmp-opt -Rpass-analysis=openmp-opt -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out
// host-no-diagnostics
void baz(void) __attribute__((assume("omp_no_openmp")));
void bar(void) {
#pragma omp parallel // #1 \
// expected-remark@#1 {{Found a parallel region that is called in a target region but not part of a combined target construct nor nested inside a target construct without intermediate code. This can lead to excessive register usage for unrelated target regions in the same translation unit due to spurious call edges assumed by ptxas.}} \
// expected-remark@#1 {{Parallel region is used in unknown ways; will not attempt to rewrite the state machine.}}
{
}
}
void foo(void) {
#pragma omp target teams // #2 \
// expected-remark@#2 {{Generic-mode kernel is executed with a customized state machine [3 known parallel regions] (good).}}
// expected-remark@#2 {{Target region containing the parallel region that is specialized. (parallel region ID: __omp_outlined__1_wrapper, kernel ID: __omp_offloading}} \
// expected-remark@#2 {{Target region containing the parallel region that is specialized. (parallel region ID: __omp_outlined__2_wrapper, kernel ID: __omp_offloading}}
{
baz(); // expected-remark {{Kernel will be executed in generic-mode due to this potential side-effect, consider to add `__attribute__((assume("ompx_spmd_amenable")))` to the called function '_Z3bazv'.}}
#pragma omp parallel // #3 \
// expected-remark@#3 {{Found a parallel region that is called in a target region but not part of a combined target construct nor nested inside a target construct without intermediate code. This can lead to excessive register usage for unrelated target regions in the same translation unit due to spurious call edges assumed by ptxas.}} \
// expected-remark@#3 {{Specialize parallel region that is only reached from a single target region to avoid spurious call edges and excessive register usage in other target regions. (parallel region ID: __omp_outlined__1_wrapper, kernel ID: __omp_offloading}}
{
}
bar();
#pragma omp parallel // #4 \
// expected-remark@#4 {{Found a parallel region that is called in a target region but not part of a combined target construct nor nested inside a target construct without intermediate code. This can lead to excessive register usage for unrelated target regions in the same translation unit due to spurious call edges assumed by ptxas.}} \
// expected-remark@#4 {{Specialize parallel region that is only reached from a single target region to avoid spurious call edges and excessive register usage in other target regions. (parallel region ID: __omp_outlined__2_wrapper, kernel ID: __omp_offloading}}
{
}
}
}
void spmd(void) {
// Verify we do not emit the remarks above for "SPMD" regions.
#pragma omp target teams
#pragma omp parallel
{
}
#pragma omp target teams distribute parallel for
for (int i = 0; i < 100; ++i) {
}
}
// expected-remark@* {{OpenMP runtime call __kmpc_global_thread_num moved to beginning of OpenMP region}}
// expected-remark@* {{OpenMP runtime call __kmpc_global_thread_num deduplicated}}
|
the_stack_data/92941.c
|
/* Copyright 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Disabled functions */
#define DISABLED(proto) proto { }
DISABLED(void clock_init(void));
|
the_stack_data/1085516.c
|
/* Test sigaction wrapper. */
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <[email protected]>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
int
main (int argc, char *argv[])
{
struct sigaction old_sa, new_sa;
printf ("sigaction (SIGHUP, NULL, &old_sa)...\n");
if (sigaction (SIGHUP, NULL, &old_sa) < 0)
{
printf ("cannot get signal action for SIGHUP: %m\n");
exit (1);
}
if (old_sa.sa_handler != SIG_IGN && old_sa.sa_handler != SIG_DFL)
{
printf ("SIGHUP action should be SIG_IGN, is %p\n",
(void *) old_sa.sa_handler);
exit (1);
}
printf ("sigaction (SIGHUP, &new_sa, NULL)...\n");
new_sa.sa_handler = SIG_DFL;
if (sigaction (SIGHUP, &new_sa, NULL) < 0)
{
printf ("cannot set signal action for SIGHUP: %m\n");
exit (1);
}
printf ("sigaction (SIGHUP, NULL, &old_sa)...\n");
if (sigaction (SIGHUP, NULL, &old_sa) < 0)
{
printf ("cannot get signal action for SIGHUP: %m\n");
exit (1);
}
if (old_sa.sa_handler != SIG_DFL )
{
printf ("SIGHUP action should be SIG_DFL, is %p\n",
(void *) old_sa.sa_handler);
exit (1);
}
return 0;
}
|
the_stack_data/807328.c
|
/* PR opt/7409. */
extern void abort (void);
char g_list[] = { '1' };
void g (void *p, char *list, int length, char **elementPtr, char **nextPtr)
{
if (*nextPtr != g_list)
abort ();
**nextPtr = 0;
}
int main (void)
{
char *list = g_list;
char *element;
int i, length = 100;
for (i = 0; *list != 0; i++)
{
char *prevList = list;
g (0, list, length, &element, &list);
length -= (list - prevList);
}
return 0;
}
|
the_stack_data/75138102.c
|
/* $Header: /cvsup/minix/src/lib/ack/libp/abi.c,v 1.1 2005/10/10 15:27:46 beng Exp $ */
/*
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
*
* This product is part of the Amsterdam Compiler Kit.
*
* Permission to use, sell, duplicate or disclose this software must be
* obtained in writing. Requests for such permissions may be sent to
*
* Dr. Andrew S. Tanenbaum
* Wiskundig Seminarium
* Vrije Universiteit
* Postbox 7161
* 1007 MC Amsterdam
* The Netherlands
*
*/
/* Author: J.W. Stevenson */
int _abi(i) int i; {
return(i>=0 ? i : -i);
}
|
the_stack_data/26699197.c
|
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int r=0,c=0;
char item[50],item[50];
char a[25][25][11]={
{"S","K","$"},
{"K","int","A","$"},
{"K","begin","$"},
{"K","endif","$"},
{"K","end","$"},
{"K","return ","R","D","R","$"},
{"K","if","B","$"},
{"A","main","(",")","$"},
{"A","D","R","10","R",";","$"},
{"A","T","R","0",";","$"},
{"A","M","R","D","R","10","R",";","$"},
{"B","D","R","T","R","R","M","$"},
{"D","l","$"},
{"T","i","$"},
{"M","maxval","$"},
{"R","[","$"},
{"R","]","$"},
{"R","(","$"},
{"R",")","$"},
{"R","=","$"},
{"R",">","$"},
{"K","maxval","R","D","R","T","R",";","$"}
};
char b[40][40][10]={
{"S","int","0"},
{"S","if","0"},
{"S","begin","0"},
{"S","end","0"},
{"S","endif","0"},
{"S","return","0"},
{"S","maxval","0"},
{"K","int","1"},
{"K","begin","2"},
{"K","maxval","21"},
{"K","endif","3"},
{"K","end","4"},
{"K","return","5"},
{"K","if","6"},
{"A","main","7"},
{"A","l","8"},
{"A","i","9"},
{"A","maxval","10"},
{"B","l","11"},
{"D","l","12"},
{"T","i","13"},
{"M","maxval","14"},
{"R","[","15"},
{"R","]","16"},
{"R","(","17"},
{"R",")","18"},
{"R","=","19"},
{"R",">","20"},
};
int prod(int x , char str[]);
char stack[10][110];
char queue[10][100];
char *token;
int count;
int l=0,i,k,front=0,rear=-1,state=1,r;
char str[50],stp[100];
int main()
{
int x;
strcpy(stack[r],"S");//intialization
printf("\n Enter the line to be parsed\n Enter $ to indicate your termination\n");
while(strcmp(queue[rear],"$")!=0)
{
rear++;
scanf("%s",queue[rear]);
}
l1:
strcpy(stp,queue[front]);//
if((strcmp(stp,")")==0)||(strcmp(stp,"(")==0)||(strcmp(stp,";")==0)||(strcmp(stp,",")==0)||
(strcmp(stp,"1")==0)||(strcmp(stp,"0")==0))
{
printf("%s parsed\n",stp);
front++;
r++;
goto l1;
}
while(strcmp(stp,"$")!=0)
{
for(i=0;i<40;i++)
{
strcpy(str,stack[r]);
strcpy(stp,queue[front]);
if((strcmp(b[i][0],str)==0)&&(strcmp(b[i][1],stp)==0))// comparing from the starting production
{
x=atoi(b[i][2]);//you have taken the prod no now
r=prod(x,str);
}
else if((strcmp(str,stp))==0)
{
strcpy(item,queue[front]);
printf("%s parsed\n",item);
front++;
strcpy(str,queue[front]);
strcpy(item,stack[r]);
r++;
goto l1;
}
}
}
if(strcmp(stack[r],"\0")!=0)
{
printf("\n not correct syntax\n");
}
printf("line code is Accepted\n");
return 0;
}
int prod(int x,char str[])
{
char stq[100];
int y=1,count=0;
printf("%s ->",a[x][0]);//outputing the non terminal eg X->
l2 : strcpy(stq,a[x][y]);//terminal symbols in stq
while(strcmp(stq,"$")!=0)//comparing till the $
{
strcpy(str,stq);
printf("%s",str);//printing the productions
strcpy(stack[r],str);
count++;
r++;
y++;
goto l2;
}
if(count>r)
{
r = count-r;
}
else
{
r = r-count;
}
printf("\n");
return r;
}
|
the_stack_data/132954003.c
|
#include <stdio.h>
#define TEST 0
int gcd(int a, int b)
{
int c = a % b;
if(c != 0)
{
return gcd(b, c);
}
return b;
}
unsigned long long solve(int a, int b)
{
int g = 0;
unsigned long long lcm = 0;
g = gcd(a, b);
lcm = (unsigned long long)a *(unsigned long long)b / g;
return lcm;
}
int test()
{
}
int main()
{
int a = 0, b = 0, res = 0;
#if TEST == 0
res = scanf("%d %d", &a, &b);
printf("%llu", solve(a, b));
#else
test();
#endif
return 0;
}
|
the_stack_data/200143465.c
|
/*********************************************************
* From C PROGRAMMING: A MODERN APPROACH, Second Edition *
* By K. N. King *
* Copyright (c) 2008, 1996 W. W. Norton & Company, Inc. *
* All rights reserved. *
* This program may be freely distributed for class use, *
* provided that this copyright notice is retained. *
*********************************************************/
/* length2.c (Chapter 7, page 142) */
/* Determines the length of a message */
#include <stdio.h>
int main() {
int len = 0;
printf("Enter a message: ");
while (getchar() != '\n') {
len++;
}
// Enter a message: 123 56?8!01 456@#$0
printf("Your message was %d character(s) long.\n", len);
// Your message was 20 character(s) long.
/*
* The length includes spaces and punctuation, but not the new-line
* character at the end of the message.
*/
return 0;
}
|
the_stack_data/98576140.c
|
__attribute__((export_name("A1"))) int
A1()
{
return 11;
}
int
A2()
{
return 12;
}
/* mA is a reactor. it doesn't need a main() */
|
the_stack_data/1225202.c
|
#include <stdio.h>
int main()
{
int i,j,k,c=0;
for(int i=0;i<=4;i++)
{
for(int j=0;j<=2;j++)
{
for(int k=0;k<=j-1;k++)
{
printf("A");
c++;
}
}
}
printf("\nCount: %d",c);
return 0;
}
//o/p
//AAAAAAAAAAAAAAA
//Count: 15
|
the_stack_data/206392654.c
|
#include<stdio.h>
int main()
{
int i,j,n,t,temp,res;
scanf("%d",&t);
for(i = 0; i<t; i++)
{
scanf("%d",&n);
temp = (((((n*567)/9)+7492)*235)/47)-498;
// printf("%d\n",temp);
for(j =0; j<2; j++)
{
res = temp % 10;
temp = temp/10;
}
printf("%d\n",abs(res));
}
return 0;
}
|
the_stack_data/518507.c
|
/* PNPOLY - Test if a point is contained in a 2D polygon. */
#include <stdio.h>
/*
The code below is from Wm. Randolph Franklin <[email protected]>
with some minor modifications for speed and style.
comp.graphics.algorithms FAQ
References:
[Gems IV] pp. 24-46
[O'Rourke] pp. 233-238
[Glassner:RayTracing]
*/
static int pnpoly(int npol, double *xp, double *yp, double x, double y)
{
int i, j, c = 0;
for (i = 0, j = npol-1; i < npol; j = i++)
{
if ((((yp[i]<=y) && (y<yp[j])) ||
((yp[j]<=y) && (y<yp[i]))) &&
(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
c = !c;
}
return c;
}
static double xp[20] = {0.0,1.0,1.0,0.0,0.0,1.0,-.5,-1.0,-1.0,-2.0,
-2.5,-2.0,-1.5,-.5,1.0,1.0,0.0,-.5,-1.0,-.5};
static double yp[20] = {0.0,0.0,1.0,1.0,2.0,3.0,2.0,3.0,0.0,-.5,
-1.0,-1.5,-2.0,-2.0,-1.5,-1.0,-.5,-1.0,-1.0,-.5};
static int run ()
{
int npol=20, count=0;
if (pnpoly(npol,xp,yp,0.5,0.5)) count++;
if (pnpoly(npol,xp,yp,0.5,1.5)) count++;
if (pnpoly(npol,xp,yp,-.5,1.5)) count++;
if (pnpoly(npol,xp,yp,0.75,2.25)) count++;
if (pnpoly(npol,xp,yp,0,2.01)) count++;
if (pnpoly(npol,xp,yp,-.5,2.5)) count++;
if (pnpoly(npol,xp,yp,-1.0,-.5)) count++;
if (pnpoly(npol,xp,yp,-1.5,.5)) count++;
if (pnpoly(npol,xp,yp,-2.25,-1.0)) count++;
if (pnpoly(npol,xp,yp,0.5,-.25)) count++;
if (pnpoly(npol,xp,yp,0.5,-1.25)) count++;
if (pnpoly(npol,xp,yp,-.5,-2.5)) count++;
return count;
}
int main (argc, argv)
int argc;
char *argv[];
{
int i;
int result;
for (i=0; i<10000; i++)
result = run ();
if (result != 6)
printf ("*** wrong result ***\n");
return 0;
}
|
the_stack_data/90412.c
|
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[], char* envp[] ){
printf("\nIN Hello\n");
if(argc > 1){
printf("\nIN Hello2\n");
int pid1 = fork();
if(pid1 == 0){
printf("In child Hello2\n");
//char *args[] = {"bin/ps", NULL};
char *en[] = {"PATH=/rootfs/bin", "CWD=/rootfs", NULL};
//execve("bin/ps", args, en);
execve("bin/ps", argv, en);
}else{
waitpid(pid1, 0, 0);
printf("Back in hello2 parent pid: %d\n", getpid());
}
}
else{
int pid = fork();
if(pid == 0){
printf("In child Hello\n");
char *args[] = {"bin/hello", "bin/ps", NULL};
char *en[] = {"PATH=/rootfs/bin", "CWD=/rootfs", NULL};
execve("bin/hello", args, en);
}else{
waitpid(pid, 0, 0);
printf("Back in hello parent pid: %d\n", getpid());
}
}
//while(1);
return 0;
}
|
the_stack_data/942082.c
|
/*
* =====================================================================================
*
* Created: 17/05/2020
* Compiler:
* Apple clang version 11.0.3 (clang-1103.0.32.29)
* Target: x86_64-apple-darwin19.4.0
* Thread model: posix
* Description: Revise the main routine of the longest-line program so it will correctly
* print the length of arbitrary long input lines, and as much as possible of the text.
* =====================================================================================
*/
#include <stdio.h>
#define MAXLINE 10
/* named it getLine due to getline is now a POSIX function declared in stdio.h */
int getLine(char line[], int maxline);
void copy(char to[], char from[]);
int main(){
int len;
int max;
char line[MAXLINE];
char longest[MAXLINE];
max = 0;
while((len = getLine(line, MAXLINE)) > 0){
if (len > max){
max = len;
copy(longest, line);
}
}
if (max > 0)
printf("%d", max);
return 0;
}
int getLine(char s[], int lim){
int c, i;
for(i = 0 ; i < lim-1 && (c=getchar()) != EOF && c!= '\n'; ++i)
s[i]=c;
if(i == (lim-1)){
s[i] = '\0';
while((c=getchar()) != EOF && c !='\n')
++i;
}
else{
if(c == '\n'){
s[i] = c;
++i;
}
s[i] = '\0';
}
return i;
}
void copy(char to[], char from[]){
int i;
i = 0;
while((to[i] = from[i]) != '\0')
++i;
}
|
the_stack_data/200141936.c
|
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/input.h>
#include <string.h>
#include <stdio.h>
#define MAX_DEVICES 32 /* Maximum number of devices marked as event# */
#define SET_DEVICE_PATH(INDEX,STR) sprintf(STR, "/dev/input/event%d", INDEX)
static const char *const evval[3] = {
"RELEASED",
"PRESSED ",
"REPEATED"
};
/*
* Opens a device.
*
* index: The index of the device to open
*
* Return: The file descriptor or -1 if failed
*/
int open_device(int index)
{
int fd; {
char path[256];
SET_DEVICE_PATH(index, path);
if ((fd = open(path, O_RDONLY | O_NONBLOCK)) < 0)
fprintf(stderr, "Cannot open %s: %s.\n",
path, strerror(errno));
}
return fd;
}
/*
*
*/
int event_occurred(int f, struct input_event* event)
{
ssize_t n;
n = read(f, event, sizeof *event);
// Ignore potential errors and pass false as return
if (n == (ssize_t) -1) return 0;
if (n != sizeof *event) { return 0; }
return 1;
}
/*
*
*/
int event_is_keyboard(struct input_event* event)
{
return (event->type == EV_KEY && event->value >= 0 && event->value <= 2);
}
// ============================================================================
// = MAIN PROGRAM
// ============================================================================
int main(int argc, char** argv)
{
struct input_event ev;
int fd;
if ((fd = open_device(2)) < 0)
return EXIT_FAILURE;
for(;;) {
if (event_occurred(fd, &ev) && event_is_keyboard(&ev)) {
printf("%s 0x%04x (%d)\n", evval[ev.value], (int)ev.code, (int)ev.code);
}
}
fflush(stdout);
fprintf(stderr, "%s.\n", strerror(errno));
return EXIT_FAILURE;
}
|
the_stack_data/57612.c
|
#include <stdio.h>
#include <stdlib.h>
int main (int argc , char* argv[] ){
char c;
while((c=getchar())){
putchar(c);
}
return 0;
}
|
the_stack_data/70154.c
|
/*
(C) Copyright IBM Corp. 2005, 2006
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 IBM 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 OWNER 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: Andreas Neukoetter ([email protected])
*/
#include <unistd.h>
int
kill (int pid, int sig)
{
if (pid == 1)
{
_exit (sig);
}
}
|
the_stack_data/22012796.c
|
//! 000.....: p := malloc()
//! 000.....: when c jmp _
//! Coverage: .* 100%
#include <stdlib.h>
int main(int argc, const char* argv[]) {
char *ptr = NULL;
int i;
for (i; i < argc + 1; i++) {
if (argv[i][0] == '1') {
ptr = malloc(1);
} else {
if (i == 0) {
ptr = malloc(42);
} else {
ptr = malloc(56);
}
}
}
if (ptr)
free(ptr);
}
|
the_stack_data/141167.c
|
/*****************************************************************************
* Name: function_ptr.c
*
* Summary: Demo of using pointers to functions.
*
* Adapted: Fri, 22 Dec 2000 23:07:29 (Bob Heckel -- New C Primer Plus,
* Prata p. 505)
*****************************************************************************
*/
#include <stdio.h>
#include <stdlib.h>
int rputs(const char*);
void show(int (* fp)(const char*), char*);
/* Crashes w/o args passed to it. */
int main(int argc, char* argv[]) {
/* The name of a function used without parenthesis yields the address of
* that function.
*/
show(puts, argv[1]); /* Using the C library puts function here. */
show(rputs, argv[1]);
return 0;
}
/* fp points to function returning int. */
void show(int (*fp)(const char * ps), char* str) {
/* Pass str to the pointed-to function. */
(*fp)(str);
}
int rputs(const char* str ) {
const char* start = str;
while ( *str != '\0' )
str++;
while ( str != start )
putchar(*--str);
return putchar('\n');
}
|
the_stack_data/93888010.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BEGIN 0
#define END 1
typedef struct _linkNode{
int ok;
int v[2];
struct _linkNode *next[2];
} LinkNode;
int main()
{
int _n, n;
int i;
LinkNode *pHead[2], *pNode, *pNode1, *pNode2;
while( (scanf("%d",&_n)==1) && _n )
{
pHead[BEGIN]=pHead[END]=NULL;
pNode=pNode1=pNode2=NULL;
i=n=0;
while(n++<_n)
{
pNode = (LinkNode *)malloc(sizeof(LinkNode));
memset(pNode, 0x00, sizeof(LinkNode));
pNode->ok = 1;
scanf("%d %d", &pNode->v[BEGIN], &pNode->v[END]);
if(pNode->v[BEGIN] > pNode->v[END] ){
i = pNode->v[END];
pNode->v[END] = pNode->v[BEGIN];
pNode->v[BEGIN]=i;
}
// begin
for(i=BEGIN; i<=END; i++)
{
pNode1=pNode2=pHead[i];
while( pNode2 && pNode->v[i] > pNode2->v[i] )
{
pNode1 = pNode2;
pNode2 = pNode2->next[i];
}
if(pNode1==pNode2)
{
if(pHead[i]==NULL) pHead[i]=pNode;
else
{
pNode->next[i] = pHead[i];
pHead[i] = pNode;
}
}
else
{
pNode->next[i]=pNode2;
pNode1->next[i]=pNode;
}
}
//printf("pHead[%d] pNode->next[%d, %d] pNode->v[%d,%d]\n",
// pHead[BEGIN], pNode->next[BEGIN], pNode->next[END], pNode->v[BEGIN], pNode->v[END]);
}
int j=0;
pNode1=pHead[BEGIN];
pNode2=pHead[END];
while(pNode2)
{
if(!pNode2->ok)
{
pNode2 = pNode2->next[END];
continue;
}
while( pNode1 && pNode1->v[BEGIN] < pNode2->v[END] )
{
//输出可以看到电影
//if(pNode1==pNode2)
//{
// printf("[%d,%d]\n", pNode1->v[BEGIN], pNode1->v[END]);
//}
pNode1->ok = 0;
pNode1 = pNode1->next[BEGIN];
}
j++;
pNode2 = pNode2->next[END];
}
printf("%d\n", j);
pNode1=pNode2=pHead[BEGIN];
while(pNode2)
{
//printf("BEGIN[%d] next[%d,%d] v[%d,%d]\n", pNode, pNode->next[BEGIN], pNode->next[END], pNode->v[BEGIN], pNode->v[END]);
pNode1=pNode2;
pNode2 = pNode2->next[BEGIN];
free(pNode1);
}
}
return 0;
}
|
the_stack_data/93887006.c
|
#include<stdio.h>
main()
{
int n=0;
int digits=0;
int sum=0, temp=0, r=0;
printf("enter the number of your choice:");
scanf("%d", &n);
temp=n;
//calculating the number of digits
while(n!=0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
digits++;
}
printf("total number of digits in the entered number are: %d\n", digits);
if(sum==temp)
{
printf("the given number is a armstrong number");
}
else
{
printf("the given number is not a armstrong number");
}
}
|
the_stack_data/211080196.c
|
int g;
int f(int* i);
void _start() {
int *i = &g;
f(&g);
}
int f(int* i) {
*i = 1;
return 1;
}
|
the_stack_data/145453996.c
|
int mul(int a, int b) { return a * b; }
int div(int a, int b) { return a / b; }
|
the_stack_data/154830352.c
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
int i;
struct timespec start, end;
for(i = 0; i < 200; i++) {
char* ptr = malloc(4096);
if(!ptr) printf("failed to alloc at iteration %d\n", i);
ptr[0] = 0;
free(ptr);
}
}
|
the_stack_data/974516.c
|
/* Generated by CIL v. 1.7.3 */
/* print_CIL_Input is false */
struct l_struct___bss_start_type;
struct l_struct___bss_start_type;
struct l_struct_union_OC_anon;
struct l_struct_union_OC_anon;
struct l_struct_struct_OC_ArchState;
struct l_struct_struct_OC_ArchState;
struct l_struct_struct_OC_uint64v8_t;
struct l_struct_struct_OC_uint64v8_t;
struct l_struct_union_OC_vec512_t;
struct l_struct_union_OC_vec512_t;
struct l_struct_union_OC_VectorReg;
struct l_struct_union_OC_VectorReg;
struct l_struct_struct_OC_ArithFlags;
struct l_struct_struct_OC_ArithFlags;
struct l_struct_union_OC_SegmentSelector;
struct l_struct_union_OC_SegmentSelector;
struct l_struct_struct_OC_Segments;
struct l_struct_struct_OC_Segments;
struct l_struct_struct_OC_Reg;
struct l_struct_struct_OC_Reg;
struct l_struct_struct_OC_AddressSpace;
struct l_struct_struct_OC_AddressSpace;
struct l_struct_struct_OC_GPR;
struct l_struct_struct_OC_GPR;
struct l_struct_struct_OC_anon_OC_3;
struct l_struct_struct_OC_anon_OC_3;
struct l_struct_struct_OC_X87Stack;
struct l_struct_struct_OC_X87Stack;
struct l_struct_struct_OC_uint64v1_t;
struct l_struct_struct_OC_uint64v1_t;
struct l_struct_union_OC_vec64_t;
struct l_struct_union_OC_vec64_t;
struct l_struct_struct_OC_anon_OC_4;
struct l_struct_struct_OC_anon_OC_4;
struct l_struct_struct_OC_MMX;
struct l_struct_struct_OC_MMX;
struct l_struct_struct_OC_FPUStatusFlags;
struct l_struct_struct_OC_FPUStatusFlags;
struct l_struct_union_OC_FPUAbridgedTagWord;
struct l_struct_union_OC_FPUAbridgedTagWord;
struct l_struct_union_OC_FPUControlStatus;
struct l_struct_union_OC_FPUControlStatus;
struct l_struct_struct_OC_float80_t;
struct l_struct_struct_OC_float80_t;
struct l_struct_union_OC_anon_OC_11;
struct l_struct_union_OC_anon_OC_11;
struct l_struct_struct_OC_FPUStackElem;
struct l_struct_struct_OC_FPUStackElem;
struct l_struct_struct_OC_uint128v1_t;
struct l_struct_struct_OC_uint128v1_t;
struct l_struct_union_OC_vec128_t;
struct l_struct_union_OC_vec128_t;
struct l_struct_struct_OC_FpuFXSAVE;
struct l_struct_struct_OC_FpuFXSAVE;
struct l_array_8_ureplace_u8int {
int array[8] ;
};
struct l_struct___bss_start_type {
struct l_array_8_ureplace_u8int field0 ;
};
struct l_struct_union_OC_anon {
int field0 ;
};
struct l_struct_struct_OC_ArchState {
int field0 ;
int field1 ;
struct l_struct_union_OC_anon field2 ;
};
struct l_array_8_ureplace_u64int {
int array[8] ;
};
struct l_struct_struct_OC_uint64v8_t {
struct l_array_8_ureplace_u64int field0 ;
};
struct l_struct_union_OC_vec512_t {
struct l_struct_struct_OC_uint64v8_t field0 ;
};
struct l_struct_union_OC_VectorReg {
struct l_struct_union_OC_vec512_t field0 ;
};
struct l_array_32_struct_AC_l_struct_union_OC_VectorReg {
struct l_struct_union_OC_VectorReg array[32] ;
};
struct l_struct_struct_OC_ArithFlags {
int field0 ;
int field1 ;
int field2 ;
int field3 ;
int field4 ;
int field5 ;
int field6 ;
int field7 ;
int field8 ;
int field9 ;
int field10 ;
int field11 ;
int field12 ;
int field13 ;
int field14 ;
int field15 ;
};
struct l_struct_union_OC_SegmentSelector {
int field0 ;
};
struct l_struct_struct_OC_Segments {
int field0 ;
struct l_struct_union_OC_SegmentSelector field1 ;
int field2 ;
struct l_struct_union_OC_SegmentSelector field3 ;
int field4 ;
struct l_struct_union_OC_SegmentSelector field5 ;
int field6 ;
struct l_struct_union_OC_SegmentSelector field7 ;
int field8 ;
struct l_struct_union_OC_SegmentSelector field9 ;
int field10 ;
struct l_struct_union_OC_SegmentSelector field11 ;
};
struct l_struct_struct_OC_Reg {
struct l_struct_union_OC_anon field0 ;
};
struct l_struct_struct_OC_AddressSpace {
int field0 ;
struct l_struct_struct_OC_Reg field1 ;
int field2 ;
struct l_struct_struct_OC_Reg field3 ;
int field4 ;
struct l_struct_struct_OC_Reg field5 ;
int field6 ;
struct l_struct_struct_OC_Reg field7 ;
int field8 ;
struct l_struct_struct_OC_Reg field9 ;
int field10 ;
struct l_struct_struct_OC_Reg field11 ;
};
struct l_struct_struct_OC_GPR {
int field0 ;
struct l_struct_struct_OC_Reg field1 ;
int field2 ;
struct l_struct_struct_OC_Reg field3 ;
int field4 ;
struct l_struct_struct_OC_Reg field5 ;
int field6 ;
struct l_struct_struct_OC_Reg field7 ;
int field8 ;
struct l_struct_struct_OC_Reg field9 ;
int field10 ;
struct l_struct_struct_OC_Reg field11 ;
int field12 ;
struct l_struct_struct_OC_Reg field13 ;
int field14 ;
struct l_struct_struct_OC_Reg field15 ;
int field16 ;
struct l_struct_struct_OC_Reg field17 ;
int field18 ;
struct l_struct_struct_OC_Reg field19 ;
int field20 ;
struct l_struct_struct_OC_Reg field21 ;
int field22 ;
struct l_struct_struct_OC_Reg field23 ;
int field24 ;
struct l_struct_struct_OC_Reg field25 ;
int field26 ;
struct l_struct_struct_OC_Reg field27 ;
int field28 ;
struct l_struct_struct_OC_Reg field29 ;
int field30 ;
struct l_struct_struct_OC_Reg field31 ;
int field32 ;
struct l_struct_struct_OC_Reg field33 ;
};
struct l_struct_struct_OC_anon_OC_3 {
int field0 ;
double field1 ;
};
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_3 {
struct l_struct_struct_OC_anon_OC_3 array[8] ;
};
struct l_struct_struct_OC_X87Stack {
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_3 field0 ;
};
struct l_array_1_ureplace_u64int {
int array[1] ;
};
struct l_struct_struct_OC_uint64v1_t {
struct l_array_1_ureplace_u64int field0 ;
};
struct l_struct_union_OC_vec64_t {
struct l_struct_struct_OC_uint64v1_t field0 ;
};
struct l_struct_struct_OC_anon_OC_4 {
int field0 ;
struct l_struct_union_OC_vec64_t field1 ;
};
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_4 {
struct l_struct_struct_OC_anon_OC_4 array[8] ;
};
struct l_struct_struct_OC_MMX {
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_4 field0 ;
};
struct l_array_4_ureplace_u8int {
int array[4] ;
};
struct l_struct_struct_OC_FPUStatusFlags {
int field0 ;
int field1 ;
int field2 ;
int field3 ;
int field4 ;
int field5 ;
int field6 ;
int field7 ;
int field8 ;
int field9 ;
int field10 ;
int field11 ;
int field12 ;
int field13 ;
int field14 ;
int field15 ;
int field16 ;
int field17 ;
int field18 ;
int field19 ;
struct l_array_4_ureplace_u8int field20 ;
};
struct l_struct_union_OC_FPUAbridgedTagWord {
int field0 ;
};
struct l_struct_union_OC_FPUControlStatus {
int field0 ;
};
struct l_array_10_ureplace_u8int {
int array[10] ;
};
struct l_struct_struct_OC_float80_t {
struct l_array_10_ureplace_u8int field0 ;
};
struct l_struct_union_OC_anon_OC_11 {
struct l_struct_struct_OC_float80_t field0 ;
};
struct l_array_6_ureplace_u8int {
int array[6] ;
};
struct l_struct_struct_OC_FPUStackElem {
struct l_struct_union_OC_anon_OC_11 field0 ;
struct l_array_6_ureplace_u8int field1 ;
};
struct l_array_8_struct_AC_l_struct_struct_OC_FPUStackElem {
struct l_struct_struct_OC_FPUStackElem array[8] ;
};
struct l_array_96_ureplace_u8int {
int array[96] ;
};
struct l_struct_struct_OC_SegmentShadow {
struct l_struct_union_OC_anon field0 ;
int field1 ;
int field2 ;
};
struct l_struct_struct_OC_SegmentCaches {
struct l_struct_struct_OC_SegmentShadow field0 ;
struct l_struct_struct_OC_SegmentShadow field1 ;
struct l_struct_struct_OC_SegmentShadow field2 ;
struct l_struct_struct_OC_SegmentShadow field3 ;
struct l_struct_struct_OC_SegmentShadow field4 ;
struct l_struct_struct_OC_SegmentShadow field5 ;
};
struct l_struct_struct_OC_State {
struct l_struct_struct_OC_ArchState field0 ;
struct l_array_32_struct_AC_l_struct_union_OC_VectorReg field1 ;
struct l_struct_struct_OC_ArithFlags field2 ;
struct l_struct_union_OC_anon field3 ;
struct l_struct_struct_OC_Segments field4 ;
struct l_struct_struct_OC_AddressSpace field5 ;
struct l_struct_struct_OC_GPR field6 ;
struct l_struct_struct_OC_X87Stack field7 ;
struct l_struct_struct_OC_MMX field8 ;
struct l_struct_struct_OC_FPUStatusFlags field9 ;
struct l_struct_union_OC_anon field10 ;
struct l_struct_struct_OC_SegmentCaches field12 ;
};
/* compiler builtin:
void __builtin_va_copy(__builtin_va_list , __builtin_va_list ) ; */
/* compiler builtin:
double __builtin_huge_val(void) ; */
/* compiler builtin:
int __builtin_clzl(unsigned long ) ; */
/* compiler builtin:
float __builtin_frexpf(float , int * ) ; */
/* compiler builtin:
long double __builtin_fmodl(long double ) ; */
/* compiler builtin:
double __builtin_atan(double ) ; */
/* compiler builtin:
int __builtin___fprintf_chk(void * , int , char const * , ...) ; */
/* compiler builtin:
float __builtin_ceilf(float ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_and_and_fetch(...) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_or(...) ; */
/* compiler builtin:
void __builtin_return(void const * ) ; */
/* compiler builtin:
int __builtin_popcountll(unsigned long long ) ; */
/* compiler builtin:
long double __builtin_asinl(long double ) ; */
/* compiler builtin:
float __builtin_atanf(float ) ; */
/* compiler builtin:
int __builtin_ffsll(unsigned long long ) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_addps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
unsigned long __builtin_strcspn(char const * , char const * ) ; */
/* compiler builtin:
float __builtin_asinf(float ) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_maxps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_unpckhps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
double __builtin_acos(double ) ; */
/* compiler builtin:
int __builtin_va_arg_pack(void) ; */
/* compiler builtin:
char *__builtin___strncpy_chk(char * , char const * , unsigned long , unsigned long ) ; */
/* compiler builtin:
int __builtin___sprintf_chk(char * , int , unsigned long , char const * , ...) ; */
/* compiler builtin:
double __builtin_powi(double , int ) ; */
/* compiler builtin:
char *__builtin_strchr(char * , int ) ; */
/* compiler builtin:
char *__builtin___strncat_chk(char * , char const * , unsigned long , unsigned long ) ; */
/* compiler builtin:
long double __builtin_huge_vall(void) ; */
/* compiler builtin:
int __builtin_ffsl(unsigned long ) ; */
/* compiler builtin:
int __builtin___vprintf_chk(int , char const * , __builtin_va_list ) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_unpcklps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
char *__builtin_strncat(char * , char const * , unsigned long ) ; */
/* compiler builtin:
int __builtin_ctzll(unsigned long long ) ; */
/* compiler builtin:
double __builtin_cosh(double ) ; */
/* compiler builtin:
void __builtin_stdarg_start(__builtin_va_list ) ; */
/* compiler builtin:
float __builtin_tanhf(float ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_xor(...) ; */
/* compiler builtin:
void *__builtin_mempcpy(void * , void const * , unsigned long ) ; */
/* compiler builtin:
long double __builtin_frexpl(long double , int * ) ; */
/* compiler builtin:
float __builtin_tanf(float ) ; */
/* compiler builtin:
long double __builtin_logl(long double ) ; */
/* compiler builtin:
long double __builtin_sqrtl(long double ) ; */
/* compiler builtin:
int __builtin_parity(unsigned int ) ; */
/* compiler builtin:
void __builtin_va_arg(__builtin_va_list , unsigned long , void * ) ; */
/* compiler builtin:
long __builtin_expect(long , long ) ; */
/* compiler builtin:
long double __builtin_coshl(long double ) ; */
/* compiler builtin:
long double __builtin_cosl(long double ) ; */
/* compiler builtin:
float __builtin_cosf(float ) ; */
/* compiler builtin:
int __builtin___printf_chk(int , char const * , ...) ; */
/* compiler builtin:
void __sync_synchronize(...) ; */
/* compiler builtin:
long double __builtin_acosl(long double ) ; */
/* compiler builtin:
int __builtin___vfprintf_chk(void * , int , char const * , __builtin_va_list ) ; */
/* compiler builtin:
void *__builtin___mempcpy_chk(void * , void const * , unsigned long , unsigned long ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_or_and_fetch(...) ; */
/* compiler builtin:
void __builtin_prefetch(void const * , ...) ; */
/* compiler builtin:
long double __builtin_nansl(char const * ) ; */
/* compiler builtin:
double __builtin_fmod(double ) ; */
/* compiler builtin:
int __builtin_clz(unsigned int ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_val_compare_and_swap(...) ; */
/* compiler builtin:
double __builtin_log10(double ) ; */
/* compiler builtin:
char *__builtin___strcat_chk(char * , char const * , unsigned long ) ; */
/* compiler builtin:
double __builtin_tanh(double ) ; */
/* compiler builtin:
float __builtin_modff(float , float * ) ; */
/* compiler builtin:
double __builtin_sin(double ) ; */
/* compiler builtin:
double __builtin_frexp(double , int * ) ; */
/* compiler builtin:
float __builtin_acosf(float ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_add_and_fetch(...) ; */
/* compiler builtin:
long double __builtin_sinhl(long double ) ; */
/* compiler builtin:
char *__builtin___stpcpy_chk(char * , char const * , unsigned long ) ; */
/* compiler builtin:
long double __builtin_ldexpl(long double , int ) ; */
/* compiler builtin:
double __builtin_fabs(double ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_nand(...) ; */
/* compiler builtin:
void *__builtin_apply(void (*)() , void * , unsigned long ) ; */
/* compiler builtin:
float __builtin_sinf(float ) ; */
/* compiler builtin:
double __builtin_ceil(double ) ; */
/* compiler builtin:
long double __builtin_powil(long double , int ) ; */
/* compiler builtin:
void __builtin_va_start(__builtin_va_list ) ; */
/* compiler builtin:
long double __builtin_expl(long double ) ; */
/* compiler builtin:
int __builtin_constant_p(int ) ; */
/* compiler builtin:
double __builtin_log(double ) ; */
/* compiler builtin:
float __builtin_expf(float ) ; */
/* compiler builtin:
int __builtin_types_compatible_p(unsigned long , unsigned long ) ; */
/* compiler builtin:
int __builtin_ctz(unsigned int ) ; */
/* compiler builtin:
long double __builtin_atan2l(long double , long double ) ; */
/* compiler builtin:
void *__builtin_apply_args(void) ; */
/* compiler builtin:
char *__builtin_strpbrk(char const * , char const * ) ; */
/* compiler builtin:
char *__builtin_strcpy(char * , char const * ) ; */
/* compiler builtin:
double __builtin_sqrt(double ) ; */
/* compiler builtin:
__builtin_va_list __builtin_next_arg(void) ; */
/* compiler builtin:
float __builtin_logf(float ) ; */
/* compiler builtin:
float __builtin_log10f(float ) ; */
/* compiler builtin:
long double __builtin_fabsl(long double ) ; */
/* compiler builtin:
unsigned long __builtin_strlen(char const * ) ; */
/* compiler builtin:
long double __builtin_floorl(long double ) ; */
/* compiler builtin:
int __builtin_ffs(unsigned int ) ; */
/* compiler builtin:
double __builtin_inf(void) ; */
/* compiler builtin:
float __builtin_floorf(float ) ; */
/* compiler builtin:
void *__builtin_memcpy(void * , void const * , unsigned long ) ; */
/* compiler builtin:
void *__builtin___memcpy_chk(void * , void const * , unsigned long , unsigned long ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_sub_and_fetch(...) ; */
/* compiler builtin:
int __builtin_parityl(unsigned long ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_nand_and_fetch(...) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_subps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_lock_test_and_set(...) ; */
/* compiler builtin:
unsigned long __builtin_strspn(char const * , char const * ) ; */
/* compiler builtin:
void __builtin_varargs_start(__builtin_va_list ) ; */
/* compiler builtin:
int __builtin_parityll(unsigned long long ) ; */
/* compiler builtin:
void __builtin_va_end(__builtin_va_list ) ; */
/* compiler builtin:
void __builtin_bzero(void * , unsigned long ) ; */
/* compiler builtin:
int __builtin_strncmp(char const * , char const * , unsigned long ) ; */
/* compiler builtin:
double __builtin_nan(char const * ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_xor_and_fetch(...) ; */
/* compiler builtin:
int __builtin___vsprintf_chk(char * , int , unsigned long , char const * ,
__builtin_va_list ) ; */
/* compiler builtin:
int __builtin___snprintf_chk(char * , unsigned long , int , unsigned long ,
char const * , ...) ; */
/* compiler builtin:
float __builtin_sqrtf(float ) ; */
/* compiler builtin:
double __builtin_nans(char const * ) ; */
/* compiler builtin:
long double __builtin_atanl(long double ) ; */
/* compiler builtin:
double __builtin_exp(double ) ; */
/* compiler builtin:
int __builtin_clzll(unsigned long long ) ; */
/* compiler builtin:
float __builtin_huge_valf(void) ; */
/* compiler builtin:
float __builtin_coshf(float ) ; */
/* compiler builtin:
float __builtin_nansf(char const * ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_add(...) ; */
/* compiler builtin:
int __builtin___vsnprintf_chk(char * , unsigned long , int , unsigned long ,
char const * , __builtin_va_list ) ; */
/* compiler builtin:
float __builtin_nanf(char const * ) ; */
/* compiler builtin:
int __builtin_strcmp(char const * , char const * ) ; */
/* compiler builtin:
_Bool __sync_bool_compare_and_swap(...) ; */
/* compiler builtin:
float __builtin_ldexpf(float , int ) ; */
/* compiler builtin:
double __builtin_atan2(double , double ) ; */
/* compiler builtin:
int __builtin_popcountl(unsigned long ) ; */
/* compiler builtin:
float __builtin_powif(float , int ) ; */
/* compiler builtin:
long double __builtin_ceill(long double ) ; */
/* compiler builtin:
char *__builtin___strcpy_chk(char * , char const * , unsigned long ) ; */
/* compiler builtin:
long double __builtin_log10l(long double ) ; */
/* compiler builtin:
void *__builtin___memmove_chk(void * , void const * , unsigned long , unsigned long ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_and(...) ; */
/* compiler builtin:
void *__builtin_return_address(unsigned int ) ; */
/* compiler builtin:
float __builtin_fabsf(float ) ; */
/* compiler builtin:
double __builtin_floor(double ) ; */
/* compiler builtin:
double __builtin_cos(double ) ; */
/* compiler builtin:
void __attribute__((__overloaded__)) __sync_fetch_and_sub(...) ; */
/* compiler builtin:
unsigned long __builtin_object_size(void * , int ) ; */
/* compiler builtin:
void *__builtin_memset(void * , int , int ) ; */
/* compiler builtin:
void *__builtin_alloca(unsigned long ) ; */
/* compiler builtin:
long double __builtin_nanl(char const * ) ; */
/* compiler builtin:
float __builtin_atan2f(float , float ) ; */
/* compiler builtin:
int __builtin_popcount(unsigned int ) ; */
/* compiler builtin:
int __builtin_va_arg_pack_len(void) ; */
/* compiler builtin:
long double __builtin_tanl(long double ) ; */
/* compiler builtin:
double __builtin_sinh(double ) ; */
/* compiler builtin:
void __builtin_bcopy(void const * , void * , unsigned long ) ; */
/* compiler builtin:
void __sync_lock_release(...) ; */
/* compiler builtin:
long double __builtin_modfl(long double , long double * ) ; */
/* compiler builtin:
char *__builtin_stpcpy(char * , char const * ) ; */
/* compiler builtin:
long double __builtin_sinl(long double ) ; */
/* compiler builtin:
double __builtin_asin(double ) ; */
/* compiler builtin:
float __builtin_sinhf(float ) ; */
/* compiler builtin:
int __builtin_ctzl(unsigned long ) ; */
/* compiler builtin:
long double __builtin_tanhl(long double ) ; */
/* compiler builtin:
int __builtin_bswap32(int ) ; */
/* compiler builtin:
double __builtin_ldexp(double , int ) ; */
/* compiler builtin:
long double __builtin_infl(void) ; */
/* compiler builtin:
long __builtin_bswap64(long ) ; */
/* compiler builtin:
float __builtin_fmodf(float ) ; */
/* compiler builtin:
float __attribute__((____vector_size____(16))) __builtin_ia32_mulps(float __attribute__((____vector_size____(16))) ,
float __attribute__((____vector_size____(16))) ) ; */
/* compiler builtin:
double __builtin_tan(double ) ; */
/* compiler builtin:
char *__builtin_strncpy(char * , char const * , unsigned long ) ; */
/* compiler builtin:
float __builtin_inff(void) ; */
/* compiler builtin:
void *__builtin___memset_chk(void * , int , unsigned long , unsigned long ) ; */
/* compiler builtin:
void *__builtin_frame_address(unsigned int ) ; */
struct l_struct_struct_OC_State *globalState ;
extern void __VERIFIER_error() ;
void *main(struct l_struct_struct_OC_State *tmp__1 , int tmp__2 , void *tmp__3 ) ;
void *sub_401106___VERIFIER_nondet_int(struct l_struct_struct_OC_State *tmp__39 ,
int tmp__40 , void *tmp__41 ) ;
extern void __mcsema_constructor(void) ;
extern void __mcsema_destructor(void) ;
struct l_struct___bss_start_type __bss_start ;
int STATE_REG_RAX ;
int STATE_REG_RBX ;
int STATE_REG_RCX ;
int STATE_REG_RDX ;
int STATE_REG_RSI ;
int STATE_REG_RDI ;
int STATE_REG_RSP ;
int STATE_REG_RBP ;
int STATE_REG_R8 ;
int STATE_REG_R9 ;
int STATE_REG_R10 ;
int STATE_REG_R11 ;
int STATE_REG_R12 ;
int STATE_REG_R13 ;
int STATE_REG_R14 ;
int STATE_REG_R15 ;
int STATE_REG_IP ;
static int llvm_OC_ctpop_OC_i32(int x )
{
int c ;
{
c = 0;
while (x != 0) {
if (x & 1) {
c ++;
}
x >>= 1;
}
return (c);
}
}
static int llvm_add_u32(int a , int b )
{
int r ;
{
r = a + b;
return (r);
}
}
static int llvm_add_u64(int a , int b )
{
int r ;
{
r = a + b;
return (r);
}
}
static int llvm_lshr_u64(int a , int b )
{
int r ;
{
r = a >> b;
return (r);
}
}
static int llvm_and_u8(int a , int b )
{
int r ;
{
r = a & b;
return (r);
}
}
static int llvm_xor_u8(int a , int b )
{
int r ;
{
r = a ^ b;
return (r);
}
}
struct l_struct_struct_OC_State global_state ;
struct l_struct_struct_OC_State *globalState = & global_state;
void *main(struct l_struct_struct_OC_State *tmp__1 , int tmp__2 , void *tmp__3 )
{
struct l_struct_struct_OC_State *tmp__4 ;
int tmp__5 ;
int tmp__6 ;
int tmp__7 ;
int tmp__8 ;
int *tmp__9 ;
int tmp__10 ;
int *tmp__11 ;
int *tmp__12 ;
int *tmp__13 ;
int tmp__14 ;
int *tmp__15 ;
int tmp__16 ;
int *tmp__17 ;
int tmp__18 ;
void *tmp__19 ;
int tmp__20 ;
int tmp__21 ;
int tmp__22 ;
int tmp__23 ;
int tmp__24 ;
void *tmp__25 ;
int tmp__26 ;
int tmp__27 ;
int *tmp__28 ;
int *tmp__29 ;
int tmp__30 ;
int tmp__31 ;
int tmp__31__PHI_TEMPORARY ;
int tmp__32 ;
int tmp__32__PHI_TEMPORARY ;
int tmp__33 ;
int tmp__34 ;
int tmp__35 ;
int _2e_lcssa1 ;
int _2e_lcssa1__PHI_TEMPORARY ;
int tmp__36 ;
int tmp__37 ;
int tmp__38 ;
int tmp ;
int tmp___0 ;
int tmp___1 ;
int tmp___2 ;
int tmp___3 ;
int tmp___4 ;
int tmp___5 ;
int tmp___6 ;
{
tmp__4 = globalState;
tmp__5 = STATE_REG_RBP;
tmp__6 = STATE_REG_RSP;
tmp__7 = tmp__6 + -8;
*((int *)tmp__7) = tmp__5;
STATE_REG_RBP = tmp__7;
tmp__8 = tmp__6 + -24;
tmp__9 = & tmp__4->field2.field1;
*tmp__9 = (tmp__7 < 16) & 1;
tmp__10 = llvm_OC_ctpop_OC_i32(tmp__8 & 255);
tmp__11 = & tmp__4->field2.field3;
tmp = tmp__10 & 1;
*tmp__11 = tmp ^ 1;
tmp__12 = & tmp__4->field2.field5;
tmp___0 = (int )(((unsigned long )tmp__7 ^ 16UL) ^ (unsigned long )tmp__8) >> 4;
*tmp__12 = tmp___0 & 1;
tmp__13 = & tmp__4->field2.field7;
*tmp__13 = ((unsigned long )tmp__8 == 0UL) & 1;
tmp__14 = tmp__8 >> 63;
tmp__15 = & tmp__4->field2.field9;
*tmp__15 = tmp__14;
tmp__16 = tmp__7 >> 63;
tmp__17 = & tmp__4->field2.field13;
tmp___1 = (tmp__14 ^ tmp__16) + tmp__16;
*tmp__17 = ((unsigned long )tmp___1 == 2UL) & 1;
STATE_REG_RAX = 0;
tmp__18 = tmp__6 + -32;
*((int *)tmp__18) = tmp__2 + 22;
STATE_REG_RSP = tmp__18;
STATE_REG_RAX = __VERIFIER_nondet_int();
tmp__20 = STATE_REG_RBP;
tmp__21 = STATE_REG_RAX;
tmp__22 = STATE_REG_IP;
tmp___2 = tmp__20 + -4;
*((int *)tmp___2) = tmp__21;
STATE_REG_RAX = 0;
tmp__23 = STATE_REG_RSP;
tmp__24 = tmp__23 + -8;
*((int *)tmp__24) = tmp__22 + 13;
STATE_REG_RSP = tmp__24;
STATE_REG_RAX = __VERIFIER_nondet_int();
tmp__26 = STATE_REG_RBP;
tmp__27 = STATE_REG_RAX;
tmp___3 = tmp__26 + -8;
tmp__28 = (int *)tmp___3;
*tmp__28 = tmp__27;
tmp___4 = tmp__26 + -4;
tmp__29 = (int *)tmp___4;
tmp__30 = *tmp__29;
if ((tmp__30 > -1) & 1) {
tmp__31__PHI_TEMPORARY = tmp__27;
tmp__32__PHI_TEMPORARY = tmp__30;
goto block_401139;
} else {
_2e_lcssa1__PHI_TEMPORARY = tmp__30;
goto block_401157;
}
while (1) {
block_401139:
tmp__31 = tmp__31__PHI_TEMPORARY;
tmp__32 = tmp__32__PHI_TEMPORARY;
*tmp__29 = tmp__31 + tmp__32;
tmp__33 = *tmp__28;
STATE_REG_RDX = tmp__33;
tmp__34 = ~ (tmp__33 << 1);
*tmp__28 = tmp__34;
tmp__35 = *tmp__29;
if ((tmp__35 > -1) & 1) {
tmp__31__PHI_TEMPORARY = tmp__34;
tmp__32__PHI_TEMPORARY = tmp__35;
goto block_401139;
} else {
_2e_lcssa1__PHI_TEMPORARY = tmp__35;
goto block_401157;
}
}
block_401157:
_2e_lcssa1 = _2e_lcssa1__PHI_TEMPORARY;
tmp__36 = llvm_OC_ctpop_OC_i32(_2e_lcssa1 & 255);
*tmp__9 = 0;
tmp___5 = tmp__36 & 1;
*tmp__11 = tmp___5 ^ 1;
*tmp__12 = 0;
*tmp__13 = ((unsigned int )_2e_lcssa1 == 0U) & 1;
*tmp__15 = 1;
*tmp__17 = 0;
STATE_REG_RAX = 0;
tmp__37 = *((int *)tmp__26);
STATE_REG_RBP = tmp__37;
tmp___6 = tmp__26 + 8;
tmp__38 = *((int *)tmp___6);
STATE_REG_IP = tmp__38;
STATE_REG_RSP = tmp__26 + 16;
return (tmp__25);
}
}
void *sub_401106___VERIFIER_nondet_int(struct l_struct_struct_OC_State *tmp__39 ,
int tmp__40 , void *tmp__41 )
{
int tmp__42 ;
int tmp__43 ;
int tmp__44 ;
int tmp ;
{
tmp__42 = STATE_REG_RBP;
tmp__43 = STATE_REG_RSP;
tmp = tmp__43 + -8;
*((int *)tmp) = tmp__42;
STATE_REG_RBP = tmp__42;
tmp__44 = *((int *)tmp__43);
STATE_REG_IP = tmp__44;
STATE_REG_RSP = tmp__43 + 8;
return (tmp__41);
}
}
|
the_stack_data/47748.c
|
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR: goto ERROR;
}
return;
}
int main(void) {
float a = 2.5;
float b = 2.5;
__VERIFIER_assert(a != b);
return 0;
}
|
the_stack_data/168894286.c
|
#include <stdio.h>
#include <termios.h>
main()
{
struct termios info;
int rv;
rv = tcgetattr(0,&info); // read values from driver
if(rv == -1){
perror("tcgetattr");
exit(1);
}
if(info.c_lflag &ECHO)
printf("echo is on, since its bits is 1\n");
else
printf("echo is OFF, since its bits is 0\n");
}
|
the_stack_data/220410.c
|
/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <[email protected]>, 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <wchar.h>
#ifndef WCSNCAT
# define WCSNCAT wcsncat
#endif
/* Append no more than N wide-character of SRC onto DEST. */
wchar_t *
WCSNCAT (wchar_t *dest, const wchar_t *src, size_t n)
{
wchar_t c;
wchar_t * const s = dest;
/* Find the end of DEST. */
do
c = *dest++;
while (c != L'\0');
/* Make DEST point before next character, so we can increment
it while memory is read (wins on pipelined cpus). */
dest -= 2;
if (n >= 4)
{
size_t n4 = n >> 2;
do
{
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
} while (--n4 > 0);
n &= 3;
}
while (n > 0)
{
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
n--;
}
if (c != L'\0')
*++dest = L'\0';
return s;
}
|
the_stack_data/126703025.c
|
void foo(void);
void foo(void)
{
char c = 1 != 2;
}
|
the_stack_data/61386.c
|
// Copyright 2018 Adam Robinson
// 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.
#include <stdio.h>
#include <stdlib.h>
#include <semaphore.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdbool.h>
// Stores all state information for communication between
// two processes.
struct Axon {
char * system_name; // Stores a name, specified when initializing
// an instance. Should be unique. Used as the
// prefix to the names of the four semaphores
// used for communication.
bool is_controller; // TRUE when initialized as controller,
// FALSE when initialized as child.
sem_t * controllerSent; // Waited on by the child and triggered
// by the controller when a message is sent.
sem_t * childReceived; // Waited on by the controller after a
// message is sent. The child will trigger
// this when it receives the message.
// This is used so that the controller can
// wait for proper message receipt before
// continuing execution.
sem_t * childSent; // Waited on by the parent to receive messages
// from the child.
sem_t * controllerReceived; // Waited on by the child to ensure that
// messages are received by the parent
// before execution continues.
int fd; // File descriptor attached to the shared memory
// that is used to pass message contents.
int * messageCode; // Stores the number used to identify the type
// of message being sent. Meaning is used defined.
int * messageSize; // This is populated with the size of the message
// everytime a message is passed.
int * messageKind; // This is populated with the message type every
// time a message is passed. See the #define
// statements at the top of the file.
};
// This function allocates shared memory of the specified
// size and returns a pointer to it. Since the same function
// needs to be called in other processes using the same name
// to get access to the shared memory, a name paramter must
// be passed.
void * mallocShared(size_t size, char * name) {
// readable and writeable.
int protection = PROT_READ | PROT_WRITE;
int visibility = MAP_SHARED;
// We need to create a file descriptor for this memory
// if one has not already been created. This allows
// other processes to open the same memory by calling
// the same function with the same name argument.
int fd = shm_open(name, O_RDWR | O_CREAT, 0777);
if (fd == -1) {
printf("%d\n", errno);
printf("shm_open failed\n");
}
struct stat s;
if (fstat(fd, &s) == -1) {
printf("fstat failed\n");
}
// If the size of the file descriptor doesn't match
// up, resize it.
if (s.st_size != size) {
// This ensures that the size of the memory and
// the size of the file descriptor match up.
if (ftruncate(fd, size) == -1) {
// printf("malloc ftruncate failed\n");
// Doesn't seem to matter
}
}
void * result = mmap(NULL, size, protection, visibility, fd, 0);
if (result == (void *)-1) {
printf("mmap failed\n");
}
return result;
}
// Used to reallocate memory associated with the file
// descriptor that is assigned to the instance. This
// memory is used for passing messages between the
// controller and the child.
void * reallocShared(size_t size, int fd) {
// Resize the fd
if (ftruncate(fd, size) == -1) {
// printf("realloc ftruncate failed\n");
// Doesn't seem to matter
}
// readable and writeable.
int protection = PROT_READ | PROT_WRITE;
int visibility = MAP_SHARED;
// reallocate the shared memory
void * result = mmap(NULL, size, protection, visibility, fd, 0);
if (result == (void *)-1) {
printf("mmap failed\n");
printf("errno: %d\n", errno);
}
return result;
}
// Constructs the name that should be used to identify
// the file descriptor for the shared memory used as
// a location for addresses being passed between
// processes.
// YES, I know the name of this function is confusing.
char * getMessageFDNameLocationFDName(char * base) {
char * addrFDName = malloc(sizeof(char) * 128);
memset(addrFDName, 0, sizeof(char) * 128);
strcat(addrFDName, "/");
strcat(addrFDName, base);
strcat(addrFDName, "_fd_message_fd_name");
return addrFDName;
}
// Constructs the name that should be used to identify
// the file descriptor for the shared memory used as
// a location for message size indicators being passed
// between processes.
char * getMessageSizeFDName(char * base) {
char * sizeFDName = malloc(sizeof(char) * 128);
memset(sizeFDName, 0, sizeof(char) * 128);
strcat(sizeFDName, "/");
strcat(sizeFDName, base);
strcat(sizeFDName, "_fd_message_size");
return sizeFDName;
}
// Constructs the name that should be used to identify
// the file descriptor for the shared memory used as
// a location for message code indicators being passed
// between processes.
char * getMessageCodeFDName(char * base) {
char * sizeFDName = malloc(sizeof(char) * 128);
memset(sizeFDName, 0, sizeof(char) * 128);
strcat(sizeFDName, "/");
strcat(sizeFDName, base);
strcat(sizeFDName, "_fd_message_code");
return sizeFDName;
}
// Constructs the name that should be used to identify
// the file descriptor for the shared memory used as
// a location for message type indicators being passed
// between processes.
char * getMessageTypeFDName(char * base) {
char * typeFDName = malloc(sizeof(char) * 128);
memset(typeFDName, 0, sizeof(char) * 128);
strcat(typeFDName, "/");
strcat(typeFDName, base);
strcat(typeFDName, "_fd_message_type");
return typeFDName;
}
// ----------------------------------------------
// Initialization functions
// ----------------------------------------------
// These two functions need to be called in the
// controller application and the child application.
//
// Once called, both processes will be able to access
// the shared memory for communication and the
// semphores for synchronization.
// Called in the controlling program.
// Will then wait for the child process to call createChildInstance with
// the same name argument. CreateChildInstance will trigger the
// childReceived semaphore and the controller instance will
// know that the child has started.
//
// parameters:
// - name: user defined unique string
// must be the same in both the controller and child processes
struct Axon * createControllerInstance(char * name) {
// We need to do the following:
// 1) create and instance of Axon
// 2) initialize the named semaphores
// 3) create the shared memory
// 4) wait for the child process to start up
// and trigger its own semaphore
struct Axon * instance = malloc(sizeof(struct Axon));
instance->is_controller = true;
instance->system_name = name;
// initialize the semaphores
char * conSentName = malloc(sizeof(char) * 128);
memset(conSentName, 0, sizeof(char) * 128);
strcat(conSentName, "/");
strcat(conSentName, name);
strcat(conSentName, "_con_sent");
instance->controllerSent = sem_open(conSentName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0);
char * childRecvName = malloc(sizeof(char) * 128);
memset(childRecvName, 0, sizeof(char) * 128);
strcat(childRecvName, "/");
strcat(childRecvName, name);
strcat(childRecvName, "_child_recv");
instance->childReceived = sem_open(childRecvName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0);
char * childSentName = malloc(sizeof(char) * 128);
memset(childSentName, 0, sizeof(char) * 128);
strcat(childSentName, "/");
strcat(childSentName, name);
strcat(childSentName, "_child_sent");
instance->childSent = sem_open(childSentName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0);
char * conRecvName = malloc(sizeof(char) * 128);
memset(conRecvName, 0, sizeof(char) * 128);
strcat(conRecvName, "/");
strcat(conRecvName, name);
strcat(conRecvName, "_con_recv");
instance->controllerReceived = sem_open(conRecvName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0);
// Now that the instance members are initialized, we need
// to allocate the shared memory used to pass parameters
// between the processes.
char * msgFDName = getMessageFDNameLocationFDName(name);
instance->fd = shm_open(msgFDName, O_RDWR | O_CREAT, 0777);
free(msgFDName);
char * msgCodeFD = getMessageCodeFDName(name);
instance->messageCode = mallocShared(sizeof(int), msgCodeFD);
free(msgCodeFD);
char * msgSizeFD = getMessageSizeFDName(name);
instance->messageSize = mallocShared(sizeof(int), msgSizeFD);
free(msgSizeFD);
char * msgTypeFD = getMessageTypeFDName(name);
instance->messageKind = mallocShared(sizeof(int), msgTypeFD);
free(msgTypeFD);
// Now we wait on the instance->childReceived member,
// which will be set by the child process once it
// starts up.
sem_wait(instance->childReceived);
// If we get to here, the child process has started.
// Time to return the instance.
return instance;
}
// Called by the child process.
//
// parameters:
// - name: user defined unique string
// must be the same in both the controller and child processes
//
struct Axon * createChildInstance(char * name) {
// We need to do the following:
// 1) create and instance of MPIController
// 2) get copies of the semaphores from the system
// they should have already been initialized by the
// controller
// 3) get a pointer to each chunk of shared memory
// 4) trigger the instance->childReceived semaphore
// to inform the controller that the system has
// initialized
struct Axon * instance = malloc(sizeof(struct Axon));
instance->is_controller = false;
instance->system_name = name;
// initialize the semaphores
char * conSentName = malloc(sizeof(char) * 128);
memset(conSentName, 0, sizeof(char) * 128);
strcat(conSentName, "/");
strcat(conSentName, name);
strcat(conSentName, "_con_sent");
instance->controllerSent = sem_open(conSentName, 0);
char * childRecvName = malloc(sizeof(char) * 128);
memset(childRecvName, 0, sizeof(char) * 128);
strcat(childRecvName, "/");
strcat(childRecvName, name);
strcat(childRecvName, "_child_recv");
instance->childReceived = sem_open(childRecvName, 0);
char * childSentName = malloc(sizeof(char) * 128);
memset(childSentName, 0, sizeof(char) * 128);
strcat(childSentName, "/");
strcat(childSentName, name);
strcat(childSentName, "_child_sent");
instance->childSent = sem_open(childSentName, 0);
char * conRecvName = malloc(sizeof(char) * 128);
memset(conRecvName, 0, sizeof(char) * 128);
strcat(conRecvName, "/");
strcat(conRecvName, name);
strcat(conRecvName, "_con_recv");
instance->controllerReceived = sem_open(conRecvName, 0);
// Now we map the shared memory.
char * msgFDName = getMessageFDNameLocationFDName(name);
instance->fd = shm_open(msgFDName, O_RDWR | O_CREAT, 0777);
free(msgFDName);
char * msgCodeFD = getMessageCodeFDName(name);
instance->messageCode = mallocShared(sizeof(int), msgCodeFD);
free(msgCodeFD);
char * msgSizeFD = getMessageSizeFDName(name);
instance->messageSize = mallocShared(sizeof(int), msgSizeFD);
free(msgSizeFD);
char * msgTypeFD = getMessageTypeFDName(name);
instance->messageKind = mallocShared(sizeof(int), msgTypeFD);
free(msgTypeFD);
// Now we trigger the semaphore to inform the controller
// that we have succeeded.
sem_post(instance->childReceived);
return instance;
}
// Sends a message.
// Can be called on either a child or controller, doesn't matter.
// Internally the function will allocate some shared memory and
// copy the message to it before triggering a semaphore. The caller
// is responsible for deallocating the message that they pass in.
// This function will halt execution until the receiver confirms
// that they have received the message.
void sendMessage(struct Axon * instance, void * message, int code, int length, int kind) {
void * sharedMessage = reallocShared(length, instance->fd);
memcpy(sharedMessage, message, length);
*instance->messageCode = code;
*instance->messageSize = length;
*instance->messageKind = kind;
if (instance->is_controller) {
sem_post(instance->controllerSent);
sem_wait(instance->childReceived);
} else {
sem_post(instance->childSent);
sem_wait(instance->controllerReceived);
}
// Now we free the memory.
// By this point the receiver will already
// have it copied to non-shared memory.
munmap(sharedMessage, length);
}
// Halts until revceiving a message. When a message is received, it
// will be copied from shared memory into local memory. The returned
// pointer is the responsibility of the caller to free.
void * recvMessage(struct Axon * instance, int * code, int * length, int * kind) {
// wait for a message to come in
if (instance->is_controller) {
sem_wait(instance->childSent);
} else {
sem_wait(instance->controllerSent);
}
*code = *instance->messageCode;
*length = *instance->messageSize;
*kind = *instance->messageKind;
// Now we need to map the new data coming in
// so that it can be accessed.
void * msg = reallocShared(*length, instance->fd);
// Allocate some process memory for it and copy it into
// the new memory.
void * result = malloc(*length);
memcpy(result, msg, *length);
if (instance->is_controller) {
sem_post(instance->controllerReceived);
} else {
sem_post(instance->childReceived);
}
munmap(msg, *length);
return result;
}
// Removes all semaphores, frees shared memory and
// unlinks shared memory file descriptors. Call this in
// the controller program before it exits. Do not call
// in the child program. More than one call might cause
// a problem.
void destroyInstance(struct Axon * instance) {
// remove all of the semaphores from the system
char * conSentName = malloc(sizeof(char) * 128);
memset(conSentName, 0, sizeof(char) * 128);
strcat(conSentName, "/");
strcat(conSentName, instance->system_name);
strcat(conSentName, "_con_sent");
char * childRecvName = malloc(sizeof(char) * 128);
memset(childRecvName, 0, sizeof(char) * 128);
strcat(childRecvName, "/");
strcat(childRecvName, instance->system_name);
strcat(childRecvName, "_child_recv");
char * childSentName = malloc(sizeof(char) * 128);
memset(childSentName, 0, sizeof(char) * 128);
strcat(childSentName, "/");
strcat(childSentName, instance->system_name);
strcat(childSentName, "_child_sent");
char * conRecvName = malloc(sizeof(char) * 128);
memset(conRecvName, 0, sizeof(char) * 128);
strcat(conRecvName, "/");
strcat(conRecvName, instance->system_name);
strcat(conRecvName, "_con_recv");
sem_unlink(conSentName);
sem_unlink(childRecvName);
sem_unlink(childSentName);
sem_unlink(conRecvName);
char * msgFDName = getMessageFDNameLocationFDName(instance->system_name);
shm_unlink(msgFDName);
free(msgFDName);
char * msgCodeFD = getMessageCodeFDName(instance->system_name);
shm_unlink(msgCodeFD);
free(msgCodeFD);
char * msgSizeFD = getMessageSizeFDName(instance->system_name);
shm_unlink(msgSizeFD);
free(msgSizeFD);
char * msgTypeFD = getMessageTypeFDName(instance->system_name);
shm_unlink(msgTypeFD);
free(msgTypeFD);
// deallocate the shared memory and the instance itself
munmap(instance->messageCode, sizeof(int));
munmap(instance->messageSize, sizeof(int));
munmap(instance->messageKind, sizeof(int));
free(instance->system_name);
free(instance);
}
|
the_stack_data/80548.c
|
/** @file
@ingroup test_src
@brief Hear the latency caused by big buffers.
Play a sine wave and change frequency based on letter input.
@author Phil Burk <[email protected]>, and Darren Gibbs
*/
/*
* $Id: patest_latency.c 1097 2006-08-26 08:27:53Z rossb $
*
* This program uses the PortAudio Portable Audio Library.
* For more information see: http://www.portaudio.com
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* 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.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
#include <stdio.h>
#include <math.h>
#include "portaudio.h"
#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice())
#define SAMPLE_RATE (44100)
#define FRAMES_PER_BUFFER (64)
#define MIN_FREQ (100.0f)
#define CalcPhaseIncrement(freq) ((freq)/SAMPLE_RATE)
#ifndef M_PI
#define M_PI (3.14159265)
#endif
#define TABLE_SIZE (400)
typedef struct
{
float sine[TABLE_SIZE + 1]; /* add one for guard point for interpolation */
float phase_increment;
float left_phase;
float right_phase;
}
paTestData;
float LookupSine( paTestData *data, float phase );
/* Convert phase between and 1.0 to sine value
* using linear interpolation.
*/
float LookupSine( paTestData *data, float phase )
{
float fIndex = phase*TABLE_SIZE;
int index = (int) fIndex;
float fract = fIndex - index;
float lo = data->sine[index];
float hi = data->sine[index+1];
float val = lo + fract*(hi-lo);
return val;
}
/* This routine will be called by the PortAudio engine when audio is needed.
** It may called at interrupt level on some machines so don't do anything
** that could mess up the system like calling malloc() or free().
*/
static int patestCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
paTestData *data = (paTestData*)userData;
float *out = (float*)outputBuffer;
int i;
(void) inputBuffer; /* Prevent unused variable warning. */
for( i=0; i<framesPerBuffer; i++ )
{
*out++ = LookupSine(data, data->left_phase); /* left */
*out++ = LookupSine(data, data->right_phase); /* right */
data->left_phase += data->phase_increment;
if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f;
data->right_phase += (data->phase_increment * 1.5f); /* fifth above */
if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f;
}
return 0;
}
/*******************************************************************/
int main(void);
int main(void)
{
PaStream *stream;
PaStreamParameters outputParameters;
PaError err;
paTestData data;
int i;
int done = 0;
printf("PortAudio Test: enter letter then hit ENTER.\n" );
/* initialise sinusoidal wavetable */
for( i=0; i<TABLE_SIZE; i++ )
{
data.sine[i] = 0.90f * (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. );
}
data.sine[TABLE_SIZE] = data.sine[0]; /* set guard point. */
data.left_phase = data.right_phase = 0.0;
data.phase_increment = CalcPhaseIncrement(MIN_FREQ);
err = Pa_Initialize();
if( err != paNoError ) goto error;
printf("PortAudio Test: output device = %d\n", OUTPUT_DEVICE );
outputParameters.device = OUTPUT_DEVICE;
outputParameters.channelCount = 2; /* stereo output */
outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */
outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency;
outputParameters.hostApiSpecificStreamInfo = NULL;
printf("Requested output latency = %.4f seconds.\n", outputParameters.suggestedLatency );
printf("%d frames per buffer.\n.", FRAMES_PER_BUFFER );
err = Pa_OpenStream(
&stream,
NULL, /* no input */
&outputParameters,
SAMPLE_RATE,
FRAMES_PER_BUFFER,
paClipOff|paDitherOff, /* we won't output out of range samples so don't bother clipping them */
patestCallback,
&data );
if( err != paNoError ) goto error;
err = Pa_StartStream( stream );
if( err != paNoError ) goto error;
printf("Play ASCII keyboard. Hit 'q' to stop. (Use RETURN key on Mac)\n");
fflush(stdout);
while ( !done )
{
float freq;
int index;
char c;
do
{
c = getchar();
}
while( c < ' '); /* Strip white space and control chars. */
if( c == 'q' ) done = 1;
index = c % 26;
freq = MIN_FREQ + (index * 40.0);
data.phase_increment = CalcPhaseIncrement(freq);
}
printf("Call Pa_StopStream()\n");
err = Pa_StopStream( stream );
if( err != paNoError ) goto error;
Pa_Terminate();
printf("Test finished.\n");
return err;
error:
Pa_Terminate();
fprintf( stderr, "An error occured while using the portaudio stream\n" );
fprintf( stderr, "Error number: %d\n", err );
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
return err;
}
|
the_stack_data/558815.c
|
/*-------------------------------------------------------------
ipc.c -- Interprocess Communication with Starlet
Copyright (C) 2008
Michael Wiedenbauer (shagkur)
Dave Murphy (WinterMute)
Hector Martin (marcan)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
-------------------------------------------------------------*/
#if defined(HW_RVL)
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <malloc.h>
#include <time.h>
#include <gcutil.h>
#include "asm.h"
#include "processor.h"
#include "lwp.h"
#include "irq.h"
#include "ipc.h"
#include "cache.h"
#include "system.h"
#include "lwp_heap.h"
#include "lwp_wkspace.h"
//#define DEBUG_IPC
#define IPC_REQ_MAGIC 0x4C4F4743
#define IPC_HEAP_SIZE 4096
#define IPC_REQUESTSIZE 64
#define IPC_NUMHEAPS 8
#define IOS_MAXFMT_PARAMS 32
#define IOS_OPEN 0x01
#define IOS_CLOSE 0x02
#define IOS_READ 0x03
#define IOS_WRITE 0x04
#define IOS_SEEK 0x05
#define IOS_IOCTL 0x06
#define IOS_IOCTLV 0x07
#define RELNCH_RELAUNCH 1
#define RELNCH_BACKGROUND 2
struct _ipcreq
{ //ipc struct size: 32
u32 cmd; //0
s32 result; //4
union { //8
s32 fd;
u32 req_cmd;
};
union {
struct {
char *filepath;
u32 mode;
} open;
struct {
void *data;
u32 len;
} read, write;
struct {
s32 where;
s32 whence;
} seek;
struct {
u32 ioctl;
void *buffer_in;
u32 len_in;
void *buffer_io;
u32 len_io;
} ioctl;
struct {
u32 ioctl;
u32 argcin;
u32 argcio;
struct _ioctlv *argv;
} ioctlv;
u32 args[5];
};
ipccallback cb; //32
void *usrdata; //36
u32 relnch; //40
lwpq_t syncqueue; //44
u32 magic; //48 - used to avoid spurious responses, like from zelda.
u8 pad1[12]; //52 - 60
} ATTRIBUTE_PACKED;
struct _ipcreqres
{
u32 cnt_sent;
u32 cnt_queue;
u32 req_send_no;
u32 req_queue_no;
struct _ipcreq *reqs[16];
};
struct _ipcheap
{
void *membase;
u32 size;
heap_cntrl heap;
};
struct _ioctlvfmt_bufent
{
void *ipc_buf;
void *io_buf;
s32 copy_len;
};
struct _ioctlvfmt_cbdata
{
ipccallback user_cb;
void *user_data;
s32 num_bufs;
u32 hId;
struct _ioctlvfmt_bufent *bufs;
};
static s32 _ipc_hid = -1;
static s32 _ipc_mailboxack = 1;
static u32 _ipc_relnchFl = 0;
static u32 _ipc_initialized = 0;
static u32 _ipc_clntinitialized = 0;
static u64 _ipc_spuriousresponsecnt = 0;
static struct _ipcreq *_ipc_relnchRpc = NULL;
static void *_ipc_bufferlo = NULL;
static void *_ipc_bufferhi = NULL;
static void *_ipc_currbufferlo = NULL;
static void *_ipc_currbufferhi = NULL;
static struct _ipcreqres _ipc_responses;
static struct _ipcheap _ipc_heaps[IPC_NUMHEAPS] =
{
{NULL, 0, {}} // all other elements should be inited to zero, says C standard, so this should do
};
static vu32 *_ipcReg = (u32*)0xCD000000;
extern void __MaskIrq(u32 nMask);
extern void __UnmaskIrq(u32 nMask);
extern void* __SYS_GetIPCBufferLo();
extern void* __SYS_GetIPCBufferHi();
static __inline__ u32 IPC_ReadReg(u32 reg)
{
return _ipcReg[reg];
}
static __inline__ void IPC_WriteReg(u32 reg,u32 val)
{
_ipcReg[reg] = val;
}
static __inline__ void ACR_WriteReg(u32 reg,u32 val)
{
_ipcReg[reg>>2] = val;
}
static __inline__ void* __ipc_allocreq()
{
return iosAlloc(_ipc_hid,IPC_REQUESTSIZE);
}
static __inline__ void __ipc_freereq(void *ptr)
{
iosFree(_ipc_hid,ptr);
}
static s32 __ioctlvfmtCB(s32 result,void *userdata)
{
ipccallback user_cb;
void *user_data;
struct _ioctlvfmt_cbdata *cbdata;
struct _ioctlvfmt_bufent *pbuf;
cbdata = (struct _ioctlvfmt_cbdata*)userdata;
// deal with data buffers
if(cbdata->bufs) {
pbuf = cbdata->bufs;
while(cbdata->num_bufs--) {
if(pbuf->ipc_buf) {
// copy data if needed
if(pbuf->io_buf && pbuf->copy_len)
memcpy(pbuf->io_buf, pbuf->ipc_buf, pbuf->copy_len);
// then free the buffer
iosFree(cbdata->hId, pbuf->ipc_buf);
}
pbuf++;
}
}
user_cb = cbdata->user_cb;
user_data = cbdata->user_data;
// free buffer list
__lwp_wkspace_free(cbdata->bufs);
// free callback data
__lwp_wkspace_free(cbdata);
// call the user callback
if(user_cb)
return user_cb(result, user_data);
return result;
}
static s32 __ipc_queuerequest(struct _ipcreq *req)
{
u32 cnt;
u32 level;
#ifdef DEBUG_IPC
printf("__ipc_queuerequest(0x%p)\n",req);
#endif
_CPU_ISR_Disable(level);
cnt = (_ipc_responses.cnt_queue - _ipc_responses.cnt_sent);
if(cnt>=16) {
_CPU_ISR_Restore(level);
return IPC_EQUEUEFULL;
}
_ipc_responses.reqs[_ipc_responses.req_queue_no] = req;
_ipc_responses.req_queue_no = ((_ipc_responses.req_queue_no+1)&0x0f);
_ipc_responses.cnt_queue++;
_CPU_ISR_Restore(level);
return IPC_OK;
}
static s32 __ipc_syncqueuerequest(struct _ipcreq *req)
{
u32 cnt;
#ifdef DEBUG_IPC
printf("__ipc_syncqueuerequest(0x%p)\n",req);
#endif
cnt = (_ipc_responses.cnt_queue - _ipc_responses.cnt_sent);
if(cnt>=16) {
return IPC_EQUEUEFULL;
}
_ipc_responses.reqs[_ipc_responses.req_queue_no] = req;
_ipc_responses.req_queue_no = ((_ipc_responses.req_queue_no+1)&0x0f);
_ipc_responses.cnt_queue++;
return IPC_OK;
}
static void __ipc_sendrequest()
{
u32 cnt;
u32 ipc_send;
struct _ipcreq *req;
#ifdef DEBUG_IPC
printf("__ipc_sendrequest()\n");
#endif
cnt = (_ipc_responses.cnt_queue - _ipc_responses.cnt_sent);
if(cnt>0) {
req = _ipc_responses.reqs[_ipc_responses.req_send_no];
if(req!=NULL) {
req->magic = IPC_REQ_MAGIC;
if(req->relnch&RELNCH_RELAUNCH) {
_ipc_relnchFl = 1;
_ipc_relnchRpc = req;
if(!(req->relnch&RELNCH_BACKGROUND))
_ipc_mailboxack--;
}
DCFlushRange(req,sizeof(struct _ipcreq));
IPC_WriteReg(0,MEM_VIRTUAL_TO_PHYSICAL(req));
_ipc_responses.req_send_no = ((_ipc_responses.req_send_no+1)&0x0f);
_ipc_responses.cnt_sent++;
_ipc_mailboxack--;
ipc_send = ((IPC_ReadReg(1)&0x30)|0x01);
IPC_WriteReg(1,ipc_send);
}
}
}
static void __ipc_replyhandler()
{
u32 ipc_ack,cnt;
struct _ipcreq *req = NULL;
ioctlv *v = NULL;
#ifdef DEBUG_IPC
printf("__ipc_replyhandler()\n");
#endif
req = (struct _ipcreq*)IPC_ReadReg(2);
if(req==NULL) return;
ipc_ack = ((IPC_ReadReg(1)&0x30)|0x04);
IPC_WriteReg(1,ipc_ack);
ACR_WriteReg(48,0x40000000);
req = MEM_PHYSICAL_TO_K0(req);
DCInvalidateRange(req,32);
if(req->magic==IPC_REQ_MAGIC) {
#ifdef DEBUG_IPC
printf("IPC res: cmd %08x rcmd %08x res %08x\n",req->cmd,req->req_cmd,req->result);
#endif
if(req->req_cmd==IOS_READ) {
if(req->read.data!=NULL) {
req->read.data = MEM_PHYSICAL_TO_K0(req->read.data);
if(req->result>0) DCInvalidateRange(req->read.data,req->result);
}
} else if(req->req_cmd==IOS_IOCTL) {
if(req->ioctl.buffer_io!=NULL) {
req->ioctl.buffer_io = MEM_PHYSICAL_TO_K0(req->ioctl.buffer_io);
DCInvalidateRange(req->ioctl.buffer_io,req->ioctl.len_io);
}
DCInvalidateRange(req->ioctl.buffer_in,req->ioctl.len_in);
} else if(req->req_cmd==IOS_IOCTLV) {
if(req->ioctlv.argv!=NULL) {
req->ioctlv.argv = MEM_PHYSICAL_TO_K0(req->ioctlv.argv);
DCInvalidateRange(req->ioctlv.argv,((req->ioctlv.argcin+req->ioctlv.argcio)*sizeof(struct _ioctlv)));
}
cnt = 0;
v = (ioctlv*)req->ioctlv.argv;
while(cnt<(req->ioctlv.argcin+req->ioctlv.argcio)) {
if(v[cnt].data!=NULL) {
v[cnt].data = MEM_PHYSICAL_TO_K0(v[cnt].data);
DCInvalidateRange(v[cnt].data,v[cnt].len);
}
cnt++;
}
if(_ipc_relnchFl && _ipc_relnchRpc==req) {
_ipc_relnchFl = 0;
if(_ipc_mailboxack<1) _ipc_mailboxack++;
}
}
if(req->cb!=NULL) {
req->cb(req->result,req->usrdata);
__ipc_freereq(req);
} else
LWP_ThreadSignal(req->syncqueue);
} else {
// NOTE: we really want to find out if this ever happens
// and take steps to prevent it beforehand (because it will
// clobber memory, among other things). I suggest leaving this in
// even in non-DEBUG mode. Maybe even cause a system halt.
// It is the responsibility of the loader to clear these things,
// but we want to find out if they happen so loaders can be fixed.
#ifdef DEBUG_IPC
printf("Received unknown IPC response (magic %08x):\n", req->magic);
printf(" CMD %08x RES %08x REQCMD %08x\n", req->cmd, req->result, req->req_cmd);
printf(" Args: %08x %08x %08x %08x %08x\n", req->args[0], req->args[1], req->args[2], req->args[3], req->args[4]);
printf(" CB %08x DATA %08x REL %08x QUEUE %08x\n", (u32)req->cb, (u32)req->usrdata, req->relnch, (u32)req->syncqueue);
#endif
_ipc_spuriousresponsecnt++;
}
ipc_ack = ((IPC_ReadReg(1)&0x30)|0x08);
IPC_WriteReg(1,ipc_ack);
}
static void __ipc_ackhandler()
{
u32 ipc_ack;
#ifdef DEBUG_IPC
printf("__ipc_ackhandler()\n");
#endif
ipc_ack = ((IPC_ReadReg(1)&0x30)|0x02);
IPC_WriteReg(1,ipc_ack);
ACR_WriteReg(48,0x40000000);
if(_ipc_mailboxack<1) _ipc_mailboxack++;
if(_ipc_mailboxack>0) {
if(_ipc_relnchFl){
_ipc_relnchRpc->result = 0;
_ipc_relnchFl = 0;
LWP_ThreadSignal(_ipc_relnchRpc->syncqueue);
ipc_ack = ((IPC_ReadReg(1)&0x30)|0x08);
IPC_WriteReg(1,ipc_ack);
}
__ipc_sendrequest();
}
}
static void __ipc_interrupthandler(u32 irq,void *ctx)
{
u32 ipc_int;
#ifdef DEBUG_IPC
printf("__ipc_interrupthandler(%d)\n",irq);
#endif
ipc_int = IPC_ReadReg(1);
if((ipc_int&0x0014)==0x0014) __ipc_replyhandler();
ipc_int = IPC_ReadReg(1);
if((ipc_int&0x0022)==0x0022) __ipc_ackhandler();
}
static s32 __ios_ioctlvformat_parse(const char *format,va_list args,struct _ioctlvfmt_cbdata *cbdata,s32 *cnt_in,s32 *cnt_io,struct _ioctlv **argv,s32 hId)
{
s32 ret,i;
void *pdata;
void *iodata;
char type,*ps;
s32 len,maxbufs = 0;
ioctlv *argp = NULL;
struct _ioctlvfmt_bufent *bufp;
if(hId == IPC_HEAP) hId = _ipc_hid;
if(hId < 0) return IPC_EINVAL;
maxbufs = strnlen(format,IOS_MAXFMT_PARAMS);
if(maxbufs>=IOS_MAXFMT_PARAMS) return IPC_EINVAL;
cbdata->hId = hId;
cbdata->bufs = __lwp_wkspace_allocate((sizeof(struct _ioctlvfmt_bufent)*(maxbufs+1)));
if(cbdata->bufs==NULL) return IPC_ENOMEM;
argp = iosAlloc(hId,(sizeof(struct _ioctlv)*(maxbufs+1)));
if(argp==NULL) {
__lwp_wkspace_free(cbdata->bufs);
return IPC_ENOMEM;
}
*argv = argp;
bufp = cbdata->bufs;
memset(argp,0,(sizeof(struct _ioctlv)*(maxbufs+1)));
memset(bufp,0,(sizeof(struct _ioctlvfmt_bufent)*(maxbufs+1)));
cbdata->num_bufs = 1;
bufp->ipc_buf = argp;
bufp++;
*cnt_in = 0;
*cnt_io = 0;
ret = IPC_OK;
while(*format) {
type = tolower(*format);
switch(type) {
case 'b':
pdata = iosAlloc(hId,sizeof(u8));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
*(u8*)pdata = va_arg(args,u32);
argp->data = pdata;
argp->len = sizeof(u8);
bufp->ipc_buf = pdata;
cbdata->num_bufs++;
(*cnt_in)++;
argp++;
bufp++;
break;
case 'h':
pdata = iosAlloc(hId,sizeof(u16));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
*(u16*)pdata = va_arg(args,u32);
argp->data = pdata;
argp->len = sizeof(u16);
bufp->ipc_buf = pdata;
cbdata->num_bufs++;
(*cnt_in)++;
argp++;
bufp++;
break;
case 'i':
pdata = iosAlloc(hId,sizeof(u32));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
*(u32*)pdata = va_arg(args,u32);
argp->data = pdata;
argp->len = sizeof(u32);
bufp->ipc_buf = pdata;
cbdata->num_bufs++;
(*cnt_in)++;
argp++;
bufp++;
break;
case 'q':
pdata = iosAlloc(hId,sizeof(u64));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
*(u64*)pdata = va_arg(args,u64);
argp->data = pdata;
argp->len = sizeof(u64);
bufp->ipc_buf = pdata;
cbdata->num_bufs++;
(*cnt_in)++;
argp++;
bufp++;
break;
case 'd':
argp->data = va_arg(args, void*);
argp->len = va_arg(args, u32);
(*cnt_in)++;
argp++;
break;
case 's':
ps = va_arg(args, char*);
len = strnlen(ps,256);
if(len>=256) {
ret = IPC_EINVAL;
goto free_and_error;
}
pdata = iosAlloc(hId,(len+1));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
memcpy(pdata,ps,(len+1));
argp->data = pdata;
argp->len = (len+1);
bufp->ipc_buf = pdata;
cbdata->num_bufs++;
(*cnt_in)++;
argp++;
bufp++;
break;
case ':':
format++;
goto parse_io_params;
default:
ret = IPC_EINVAL;
goto free_and_error;
}
format++;
}
parse_io_params:
while(*format) {
type = tolower(*format);
switch(type) {
case 'b':
pdata = iosAlloc(hId,sizeof(u8));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
iodata = va_arg(args,u8*);
*(u8*)pdata = *(u8*)iodata;
argp->data = pdata;
argp->len = sizeof(u8);
bufp->ipc_buf = pdata;
bufp->io_buf = iodata;
bufp->copy_len = sizeof(u8);
cbdata->num_bufs++;
(*cnt_io)++;
argp++;
bufp++;
break;
case 'h':
pdata = iosAlloc(hId,sizeof(u16));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
iodata = va_arg(args,u16*);
*(u16*)pdata = *(u16*)iodata;
argp->data = pdata;
argp->len = sizeof(u16);
bufp->ipc_buf = pdata;
bufp->io_buf = iodata;
bufp->copy_len = sizeof(u16);
cbdata->num_bufs++;
(*cnt_io)++;
argp++;
bufp++;
break;
case 'i':
pdata = iosAlloc(hId,sizeof(u32));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
iodata = va_arg(args,u32*);
*(u32*)pdata = *(u32*)iodata;
argp->data = pdata;
argp->len = sizeof(u32);
bufp->ipc_buf = pdata;
bufp->io_buf = iodata;
bufp->copy_len = sizeof(u32);
cbdata->num_bufs++;
(*cnt_io)++;
argp++;
bufp++;
break;
case 'q':
pdata = iosAlloc(hId,sizeof(u64));
if(pdata==NULL) {
ret = IPC_ENOMEM;
goto free_and_error;
}
iodata = va_arg(args,u64*);
*(u64*)pdata = *(u64*)iodata;
argp->data = pdata;
argp->len = sizeof(u64);
bufp->ipc_buf = pdata;
bufp->io_buf = iodata;
bufp->copy_len = sizeof(u64);
cbdata->num_bufs++;
(*cnt_io)++;
argp++;
bufp++;
break;
case 'd':
argp->data = va_arg(args, void*);
argp->len = va_arg(args, u32);
(*cnt_io)++;
argp++;
break;
default:
ret = IPC_EINVAL;
goto free_and_error;
}
format++;
}
return IPC_OK;
free_and_error:
for(i=0;i<cbdata->num_bufs;i++) {
if(cbdata->bufs[i].ipc_buf!=NULL) iosFree(hId,cbdata->bufs[i].ipc_buf);
}
__lwp_wkspace_free(cbdata->bufs);
return ret;
}
static s32 __ipc_asyncrequest(struct _ipcreq *req)
{
s32 ret;
u32 level;
ret = __ipc_queuerequest(req);
if(ret) __ipc_freereq(req);
else {
_CPU_ISR_Disable(level);
if(_ipc_mailboxack>0) __ipc_sendrequest();
_CPU_ISR_Restore(level);
}
return ret;
}
static s32 __ipc_syncrequest(struct _ipcreq *req)
{
s32 ret;
u32 level;
LWP_InitQueue(&req->syncqueue);
_CPU_ISR_Disable(level);
ret = __ipc_syncqueuerequest(req);
if(ret==0) {
if(_ipc_mailboxack>0) __ipc_sendrequest();
LWP_ThreadSleep(req->syncqueue);
ret = req->result;
}
_CPU_ISR_Restore(level);
LWP_CloseQueue(req->syncqueue);
return ret;
}
s32 iosCreateHeap(s32 size)
{
s32 i,ret;
s32 free;
u32 level;
u32 ipclo,ipchi;
#ifdef DEBUG_IPC
printf("iosCreateHeap(%d)\n",size);
#endif
_CPU_ISR_Disable(level);
i=0;
while(i<IPC_NUMHEAPS) {
if(_ipc_heaps[i].membase==NULL) break;
i++;
}
if(i>=IPC_NUMHEAPS) {
_CPU_ISR_Restore(level);
return IPC_ENOHEAP;
}
ipclo = (((u32)IPC_GetBufferLo()+0x1f)&~0x1f);
ipchi = (u32)IPC_GetBufferHi();
free = (ipchi - (ipclo + size));
if(free<0) return IPC_ENOMEM;
_ipc_heaps[i].membase = (void*)ipclo;
_ipc_heaps[i].size = size;
ret = __lwp_heap_init(&_ipc_heaps[i].heap,(void*)ipclo,size,PPC_CACHE_ALIGNMENT);
if(ret<=0) return IPC_ENOMEM;
IPC_SetBufferLo((void*)(ipclo+size));
_CPU_ISR_Restore(level);
return i;
}
s32 iosDestroyHeap(s32 hid)
{
s32 ret = 0;
u32 level;
#ifdef DEBUG_IPC
printf("iosDestroyHeap(%d)\n",hid);
#endif
_CPU_ISR_Disable(level);
if(hid>=0 && hid<IPC_NUMHEAPS) {
if(_ipc_heaps[hid].membase!=NULL) {
_ipc_heaps[hid].membase = NULL;
_ipc_heaps[hid].size = 0;
}
} else
ret = IPC_EINVAL;
_CPU_ISR_Restore(level);
return ret;
}
void* iosAlloc(s32 hid,s32 size)
{
#ifdef DEBUG_IPC
printf("iosAlloc(%d,%d)\n",hid,size);
#endif
if(hid<0 || hid>=IPC_NUMHEAPS || size<=0) return NULL;
return __lwp_heap_allocate(&_ipc_heaps[hid].heap,size);
}
void iosFree(s32 hid,void *ptr)
{
#ifdef DEBUG_IPC
printf("iosFree(%d,0x%p)\n",hid,ptr);
#endif
if(hid<0 || hid>=IPC_NUMHEAPS || ptr==NULL) return;
__lwp_heap_free(&_ipc_heaps[hid].heap,ptr);
}
void* IPC_GetBufferLo()
{
return _ipc_currbufferlo;
}
void* IPC_GetBufferHi()
{
return _ipc_currbufferhi;
}
void IPC_SetBufferLo(void *bufferlo)
{
if(_ipc_bufferlo<=bufferlo) _ipc_currbufferlo = bufferlo;
}
void IPC_SetBufferHi(void *bufferhi)
{
if(bufferhi<=_ipc_bufferhi) _ipc_currbufferhi = bufferhi;
}
void __IPC_Init(void)
{
if(!_ipc_initialized) {
_ipc_bufferlo = _ipc_currbufferlo = __SYS_GetIPCBufferLo();
_ipc_bufferhi = _ipc_currbufferhi = __SYS_GetIPCBufferHi();
_ipc_initialized = 1;
}
}
u32 __IPC_ClntInit(void)
{
if(!_ipc_clntinitialized) {
_ipc_clntinitialized = 1;
__IPC_Init();
_ipc_hid = iosCreateHeap(IPC_HEAP_SIZE);
IRQ_Request(IRQ_PI_ACR,__ipc_interrupthandler,NULL);
__UnmaskIrq(IM_PI_ACR);
IPC_WriteReg(1,56);
}
return IPC_OK;
}
void __IPC_Reinitialize(void)
{
u32 level;
_CPU_ISR_Disable(level);
IPC_WriteReg(1,56);
_ipc_mailboxack = 1;
_ipc_relnchFl = 0;
_ipc_relnchRpc = NULL;
_ipc_responses.req_queue_no = 0;
_ipc_responses.cnt_queue = 0;
_ipc_responses.req_send_no = 0;
_ipc_responses.cnt_sent = 0;
_CPU_ISR_Restore(level);
}
s32 IOS_Open(const char *filepath,u32 mode)
{
s32 ret;
struct _ipcreq *req;
if(filepath==NULL) return IPC_EINVAL;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_OPEN;
req->cb = NULL;
req->relnch = 0;
DCFlushRange((void*)filepath,strnlen(filepath,IPC_MAXPATH_LEN));
req->open.filepath = (char*)MEM_VIRTUAL_TO_PHYSICAL(filepath);
req->open.mode = mode;
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_OpenAsync(const char *filepath,u32 mode,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_OPEN;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
DCFlushRange((void*)filepath,strnlen(filepath,IPC_MAXPATH_LEN));
req->open.filepath = (char*)MEM_VIRTUAL_TO_PHYSICAL(filepath);
req->open.mode = mode;
return __ipc_asyncrequest(req);
}
s32 IOS_Close(s32 fd)
{
s32 ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_CLOSE;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_CloseAsync(s32 fd,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_CLOSE;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
return __ipc_asyncrequest(req);
}
s32 IOS_Read(s32 fd,void *buf,s32 len)
{
s32 ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_READ;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
DCInvalidateRange(buf,len);
req->read.data = (void*)MEM_VIRTUAL_TO_PHYSICAL(buf);
req->read.len = len;
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_ReadAsync(s32 fd,void *buf,s32 len,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_READ;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
DCInvalidateRange(buf,len);
req->read.data = (void*)MEM_VIRTUAL_TO_PHYSICAL(buf);
req->read.len = len;
return __ipc_asyncrequest(req);
}
s32 IOS_Write(s32 fd,const void *buf,s32 len)
{
s32 ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_WRITE;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
DCFlushRange((void*)buf,len);
req->write.data = (void*)MEM_VIRTUAL_TO_PHYSICAL(buf);
req->write.len = len;
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_WriteAsync(s32 fd,const void *buf,s32 len,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_WRITE;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
DCFlushRange((void*)buf,len);
req->write.data = (void*)MEM_VIRTUAL_TO_PHYSICAL(buf);
req->write.len = len;
return __ipc_asyncrequest(req);
}
s32 IOS_Seek(s32 fd,s32 where,s32 whence)
{
s32 ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_SEEK;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
req->seek.where = where;
req->seek.whence = whence;
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_SeekAsync(s32 fd,s32 where,s32 whence,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_SEEK;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
req->seek.where = where;
req->seek.whence = whence;
return __ipc_asyncrequest(req);
}
s32 IOS_Ioctl(s32 fd,s32 ioctl,void *buffer_in,s32 len_in,void *buffer_io,s32 len_io)
{
s32 ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTL;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
req->ioctl.ioctl = ioctl;
req->ioctl.buffer_in = (void*)MEM_VIRTUAL_TO_PHYSICAL(buffer_in);
req->ioctl.len_in = len_in;
req->ioctl.buffer_io = (void*)MEM_VIRTUAL_TO_PHYSICAL(buffer_io);
req->ioctl.len_io = len_io;
DCFlushRange(buffer_in,len_in);
DCFlushRange(buffer_io,len_io);
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_IoctlAsync(s32 fd,s32 ioctl,void *buffer_in,s32 len_in,void *buffer_io,s32 len_io,ipccallback ipc_cb,void *usrdata)
{
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTL;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
req->ioctl.ioctl = ioctl;
req->ioctl.buffer_in = (void*)MEM_VIRTUAL_TO_PHYSICAL(buffer_in);
req->ioctl.len_in = len_in;
req->ioctl.buffer_io = (void*)MEM_VIRTUAL_TO_PHYSICAL(buffer_io);
req->ioctl.len_io = len_io;
DCFlushRange(buffer_in,len_in);
DCFlushRange(buffer_io,len_io);
return __ipc_asyncrequest(req);
}
s32 IOS_Ioctlv(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv)
{
s32 i,ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTLV;
req->fd = fd;
req->cb = NULL;
req->relnch = 0;
req->ioctlv.ioctl = ioctl;
req->ioctlv.argcin = cnt_in;
req->ioctlv.argcio = cnt_io;
req->ioctlv.argv = (struct _ioctlv*)MEM_VIRTUAL_TO_PHYSICAL(argv);
i = 0;
while(i<cnt_in) {
if(argv[i].data!=NULL && argv[i].len>0) {
DCFlushRange(argv[i].data,argv[i].len);
argv[i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[i].data);
}
i++;
}
i = 0;
while(i<cnt_io) {
if(argv[cnt_in+i].data!=NULL && argv[cnt_in+i].len>0) {
DCFlushRange(argv[cnt_in+i].data,argv[cnt_in+i].len);
argv[cnt_in+i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[cnt_in+i].data);
}
i++;
}
DCFlushRange(argv,((cnt_in+cnt_io)<<3));
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_IoctlvAsync(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv,ipccallback ipc_cb,void *usrdata)
{
s32 i;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTLV;
req->fd = fd;
req->cb = ipc_cb;
req->usrdata = usrdata;
req->relnch = 0;
req->ioctlv.ioctl = ioctl;
req->ioctlv.argcin = cnt_in;
req->ioctlv.argcio = cnt_io;
req->ioctlv.argv = (struct _ioctlv*)MEM_VIRTUAL_TO_PHYSICAL(argv);
i = 0;
while(i<cnt_in) {
if(argv[i].data!=NULL && argv[i].len>0) {
DCFlushRange(argv[i].data,argv[i].len);
argv[i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[i].data);
}
i++;
}
i = 0;
while(i<cnt_io) {
if(argv[cnt_in+i].data!=NULL && argv[cnt_in+i].len>0) {
DCFlushRange(argv[cnt_in+i].data,argv[cnt_in+i].len);
argv[cnt_in+i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[cnt_in+i].data);
}
i++;
}
DCFlushRange(argv,((cnt_in+cnt_io)<<3));
return __ipc_asyncrequest(req);
}
s32 IOS_IoctlvFormat(s32 hId,s32 fd,s32 ioctl,const char *format,...)
{
s32 ret;
va_list args;
s32 cnt_in,cnt_io;
struct _ioctlv *argv;
struct _ioctlvfmt_cbdata *cbdata;
cbdata = __lwp_wkspace_allocate(sizeof(struct _ioctlvfmt_cbdata));
if(cbdata==NULL) return IPC_ENOMEM;
memset(cbdata,0,sizeof(struct _ioctlvfmt_cbdata));
va_start(args,format);
ret = __ios_ioctlvformat_parse(format,args,cbdata,&cnt_in,&cnt_io,&argv,hId);
va_end(args);
if(ret<0) {
__lwp_wkspace_free(cbdata);
return ret;
}
ret = IOS_Ioctlv(fd,ioctl,cnt_in,cnt_io,argv);
__ioctlvfmtCB(ret,cbdata);
return ret;
}
s32 IOS_IoctlvFormatAsync(s32 hId,s32 fd,s32 ioctl,ipccallback usr_cb,void *usr_data,const char *format,...)
{
s32 ret;
va_list args;
s32 cnt_in,cnt_io;
struct _ioctlv *argv;
struct _ioctlvfmt_cbdata *cbdata;
cbdata = __lwp_wkspace_allocate(sizeof(struct _ioctlvfmt_cbdata));
if(cbdata==NULL) return IPC_ENOMEM;
memset(cbdata,0,sizeof(struct _ioctlvfmt_cbdata));
va_start(args,format);
ret = __ios_ioctlvformat_parse(format,args,cbdata,&cnt_in,&cnt_io,&argv,hId);
va_end(args);
if(ret<0) {
__lwp_wkspace_free(cbdata);
return ret;
}
cbdata->user_cb = usr_cb;
cbdata->user_data = usr_data;
return IOS_IoctlvAsync(fd,ioctl,cnt_in,cnt_io,argv,__ioctlvfmtCB,cbdata);
}
s32 IOS_IoctlvReboot(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv)
{
s32 i,ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTLV;
req->fd = fd;
req->cb = NULL;
req->relnch = RELNCH_RELAUNCH;
req->ioctlv.ioctl = ioctl;
req->ioctlv.argcin = cnt_in;
req->ioctlv.argcio = cnt_io;
req->ioctlv.argv = (struct _ioctlv*)MEM_VIRTUAL_TO_PHYSICAL(argv);
i = 0;
while(i<cnt_in) {
if(argv[i].data!=NULL && argv[i].len>0) {
DCFlushRange(argv[i].data,argv[i].len);
argv[i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[i].data);
}
i++;
}
i = 0;
while(i<cnt_io) {
if(argv[cnt_in+i].data!=NULL && argv[cnt_in+i].len>0) {
DCFlushRange(argv[cnt_in+i].data,argv[cnt_in+i].len);
argv[cnt_in+i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[cnt_in+i].data);
}
i++;
}
DCFlushRange(argv,((cnt_in+cnt_io)<<3));
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
s32 IOS_IoctlvRebootBackground(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv)
{
s32 i,ret;
struct _ipcreq *req;
req = __ipc_allocreq();
if(req==NULL) return IPC_ENOMEM;
req->cmd = IOS_IOCTLV;
req->result = 0;
req->fd = fd;
req->cb = NULL;
req->relnch = RELNCH_BACKGROUND|RELNCH_RELAUNCH;
req->ioctlv.ioctl = ioctl;
req->ioctlv.argcin = cnt_in;
req->ioctlv.argcio = cnt_io;
req->ioctlv.argv = (struct _ioctlv*)MEM_VIRTUAL_TO_PHYSICAL(argv);
i = 0;
while(i<cnt_in) {
if(argv[i].data!=NULL && argv[i].len>0) {
DCFlushRange(argv[i].data,argv[i].len);
argv[i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[i].data);
}
i++;
}
i = 0;
while(i<cnt_io) {
if(argv[cnt_in+i].data!=NULL && argv[cnt_in+i].len>0) {
DCFlushRange(argv[cnt_in+i].data,argv[cnt_in+i].len);
argv[cnt_in+i].data = (void*)MEM_VIRTUAL_TO_PHYSICAL(argv[cnt_in+i].data);
}
i++;
}
DCFlushRange(argv,((cnt_in+cnt_io)<<3));
ret = __ipc_syncrequest(req);
if(req!=NULL) __ipc_freereq(req);
return ret;
}
#endif
|
the_stack_data/243894330.c
|
/* Redis uses the CRC64 variant with "Jones" coefficients and init value of 0.
*
* Specification of this CRC64 variant follows:
* Name: crc-64-jones
* Width: 64 bites
* Poly: 0xad93d23594c935a9
* Reflected In: True
* Xor_In: 0xffffffffffffffff
* Reflected_Out: True
* Xor_Out: 0x0
* Check("123456789"): 0xe9c6d914c4b8d9ca
*
* Copyright (c) 2012, Salvatore Sanfilippo <antirez at gmail dot com>
* 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 Redis 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 OWNER 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. */
#include <stdint.h>
static const uint64_t crc64_tab[256] = {
UINT64_C(0x0000000000000000), UINT64_C(0x7ad870c830358979),
UINT64_C(0xf5b0e190606b12f2), UINT64_C(0x8f689158505e9b8b),
UINT64_C(0xc038e5739841b68f), UINT64_C(0xbae095bba8743ff6),
UINT64_C(0x358804e3f82aa47d), UINT64_C(0x4f50742bc81f2d04),
UINT64_C(0xab28ecb46814fe75), UINT64_C(0xd1f09c7c5821770c),
UINT64_C(0x5e980d24087fec87), UINT64_C(0x24407dec384a65fe),
UINT64_C(0x6b1009c7f05548fa), UINT64_C(0x11c8790fc060c183),
UINT64_C(0x9ea0e857903e5a08), UINT64_C(0xe478989fa00bd371),
UINT64_C(0x7d08ff3b88be6f81), UINT64_C(0x07d08ff3b88be6f8),
UINT64_C(0x88b81eabe8d57d73), UINT64_C(0xf2606e63d8e0f40a),
UINT64_C(0xbd301a4810ffd90e), UINT64_C(0xc7e86a8020ca5077),
UINT64_C(0x4880fbd87094cbfc), UINT64_C(0x32588b1040a14285),
UINT64_C(0xd620138fe0aa91f4), UINT64_C(0xacf86347d09f188d),
UINT64_C(0x2390f21f80c18306), UINT64_C(0x594882d7b0f40a7f),
UINT64_C(0x1618f6fc78eb277b), UINT64_C(0x6cc0863448deae02),
UINT64_C(0xe3a8176c18803589), UINT64_C(0x997067a428b5bcf0),
UINT64_C(0xfa11fe77117cdf02), UINT64_C(0x80c98ebf2149567b),
UINT64_C(0x0fa11fe77117cdf0), UINT64_C(0x75796f2f41224489),
UINT64_C(0x3a291b04893d698d), UINT64_C(0x40f16bccb908e0f4),
UINT64_C(0xcf99fa94e9567b7f), UINT64_C(0xb5418a5cd963f206),
UINT64_C(0x513912c379682177), UINT64_C(0x2be1620b495da80e),
UINT64_C(0xa489f35319033385), UINT64_C(0xde51839b2936bafc),
UINT64_C(0x9101f7b0e12997f8), UINT64_C(0xebd98778d11c1e81),
UINT64_C(0x64b116208142850a), UINT64_C(0x1e6966e8b1770c73),
UINT64_C(0x8719014c99c2b083), UINT64_C(0xfdc17184a9f739fa),
UINT64_C(0x72a9e0dcf9a9a271), UINT64_C(0x08719014c99c2b08),
UINT64_C(0x4721e43f0183060c), UINT64_C(0x3df994f731b68f75),
UINT64_C(0xb29105af61e814fe), UINT64_C(0xc849756751dd9d87),
UINT64_C(0x2c31edf8f1d64ef6), UINT64_C(0x56e99d30c1e3c78f),
UINT64_C(0xd9810c6891bd5c04), UINT64_C(0xa3597ca0a188d57d),
UINT64_C(0xec09088b6997f879), UINT64_C(0x96d1784359a27100),
UINT64_C(0x19b9e91b09fcea8b), UINT64_C(0x636199d339c963f2),
UINT64_C(0xdf7adabd7a6e2d6f), UINT64_C(0xa5a2aa754a5ba416),
UINT64_C(0x2aca3b2d1a053f9d), UINT64_C(0x50124be52a30b6e4),
UINT64_C(0x1f423fcee22f9be0), UINT64_C(0x659a4f06d21a1299),
UINT64_C(0xeaf2de5e82448912), UINT64_C(0x902aae96b271006b),
UINT64_C(0x74523609127ad31a), UINT64_C(0x0e8a46c1224f5a63),
UINT64_C(0x81e2d7997211c1e8), UINT64_C(0xfb3aa75142244891),
UINT64_C(0xb46ad37a8a3b6595), UINT64_C(0xceb2a3b2ba0eecec),
UINT64_C(0x41da32eaea507767), UINT64_C(0x3b024222da65fe1e),
UINT64_C(0xa2722586f2d042ee), UINT64_C(0xd8aa554ec2e5cb97),
UINT64_C(0x57c2c41692bb501c), UINT64_C(0x2d1ab4dea28ed965),
UINT64_C(0x624ac0f56a91f461), UINT64_C(0x1892b03d5aa47d18),
UINT64_C(0x97fa21650afae693), UINT64_C(0xed2251ad3acf6fea),
UINT64_C(0x095ac9329ac4bc9b), UINT64_C(0x7382b9faaaf135e2),
UINT64_C(0xfcea28a2faafae69), UINT64_C(0x8632586aca9a2710),
UINT64_C(0xc9622c4102850a14), UINT64_C(0xb3ba5c8932b0836d),
UINT64_C(0x3cd2cdd162ee18e6), UINT64_C(0x460abd1952db919f),
UINT64_C(0x256b24ca6b12f26d), UINT64_C(0x5fb354025b277b14),
UINT64_C(0xd0dbc55a0b79e09f), UINT64_C(0xaa03b5923b4c69e6),
UINT64_C(0xe553c1b9f35344e2), UINT64_C(0x9f8bb171c366cd9b),
UINT64_C(0x10e3202993385610), UINT64_C(0x6a3b50e1a30ddf69),
UINT64_C(0x8e43c87e03060c18), UINT64_C(0xf49bb8b633338561),
UINT64_C(0x7bf329ee636d1eea), UINT64_C(0x012b592653589793),
UINT64_C(0x4e7b2d0d9b47ba97), UINT64_C(0x34a35dc5ab7233ee),
UINT64_C(0xbbcbcc9dfb2ca865), UINT64_C(0xc113bc55cb19211c),
UINT64_C(0x5863dbf1e3ac9dec), UINT64_C(0x22bbab39d3991495),
UINT64_C(0xadd33a6183c78f1e), UINT64_C(0xd70b4aa9b3f20667),
UINT64_C(0x985b3e827bed2b63), UINT64_C(0xe2834e4a4bd8a21a),
UINT64_C(0x6debdf121b863991), UINT64_C(0x1733afda2bb3b0e8),
UINT64_C(0xf34b37458bb86399), UINT64_C(0x8993478dbb8deae0),
UINT64_C(0x06fbd6d5ebd3716b), UINT64_C(0x7c23a61ddbe6f812),
UINT64_C(0x3373d23613f9d516), UINT64_C(0x49aba2fe23cc5c6f),
UINT64_C(0xc6c333a67392c7e4), UINT64_C(0xbc1b436e43a74e9d),
UINT64_C(0x95ac9329ac4bc9b5), UINT64_C(0xef74e3e19c7e40cc),
UINT64_C(0x601c72b9cc20db47), UINT64_C(0x1ac40271fc15523e),
UINT64_C(0x5594765a340a7f3a), UINT64_C(0x2f4c0692043ff643),
UINT64_C(0xa02497ca54616dc8), UINT64_C(0xdafce7026454e4b1),
UINT64_C(0x3e847f9dc45f37c0), UINT64_C(0x445c0f55f46abeb9),
UINT64_C(0xcb349e0da4342532), UINT64_C(0xb1eceec59401ac4b),
UINT64_C(0xfebc9aee5c1e814f), UINT64_C(0x8464ea266c2b0836),
UINT64_C(0x0b0c7b7e3c7593bd), UINT64_C(0x71d40bb60c401ac4),
UINT64_C(0xe8a46c1224f5a634), UINT64_C(0x927c1cda14c02f4d),
UINT64_C(0x1d148d82449eb4c6), UINT64_C(0x67ccfd4a74ab3dbf),
UINT64_C(0x289c8961bcb410bb), UINT64_C(0x5244f9a98c8199c2),
UINT64_C(0xdd2c68f1dcdf0249), UINT64_C(0xa7f41839ecea8b30),
UINT64_C(0x438c80a64ce15841), UINT64_C(0x3954f06e7cd4d138),
UINT64_C(0xb63c61362c8a4ab3), UINT64_C(0xcce411fe1cbfc3ca),
UINT64_C(0x83b465d5d4a0eece), UINT64_C(0xf96c151de49567b7),
UINT64_C(0x76048445b4cbfc3c), UINT64_C(0x0cdcf48d84fe7545),
UINT64_C(0x6fbd6d5ebd3716b7), UINT64_C(0x15651d968d029fce),
UINT64_C(0x9a0d8ccedd5c0445), UINT64_C(0xe0d5fc06ed698d3c),
UINT64_C(0xaf85882d2576a038), UINT64_C(0xd55df8e515432941),
UINT64_C(0x5a3569bd451db2ca), UINT64_C(0x20ed197575283bb3),
UINT64_C(0xc49581ead523e8c2), UINT64_C(0xbe4df122e51661bb),
UINT64_C(0x3125607ab548fa30), UINT64_C(0x4bfd10b2857d7349),
UINT64_C(0x04ad64994d625e4d), UINT64_C(0x7e7514517d57d734),
UINT64_C(0xf11d85092d094cbf), UINT64_C(0x8bc5f5c11d3cc5c6),
UINT64_C(0x12b5926535897936), UINT64_C(0x686de2ad05bcf04f),
UINT64_C(0xe70573f555e26bc4), UINT64_C(0x9ddd033d65d7e2bd),
UINT64_C(0xd28d7716adc8cfb9), UINT64_C(0xa85507de9dfd46c0),
UINT64_C(0x273d9686cda3dd4b), UINT64_C(0x5de5e64efd965432),
UINT64_C(0xb99d7ed15d9d8743), UINT64_C(0xc3450e196da80e3a),
UINT64_C(0x4c2d9f413df695b1), UINT64_C(0x36f5ef890dc31cc8),
UINT64_C(0x79a59ba2c5dc31cc), UINT64_C(0x037deb6af5e9b8b5),
UINT64_C(0x8c157a32a5b7233e), UINT64_C(0xf6cd0afa9582aa47),
UINT64_C(0x4ad64994d625e4da), UINT64_C(0x300e395ce6106da3),
UINT64_C(0xbf66a804b64ef628), UINT64_C(0xc5bed8cc867b7f51),
UINT64_C(0x8aeeace74e645255), UINT64_C(0xf036dc2f7e51db2c),
UINT64_C(0x7f5e4d772e0f40a7), UINT64_C(0x05863dbf1e3ac9de),
UINT64_C(0xe1fea520be311aaf), UINT64_C(0x9b26d5e88e0493d6),
UINT64_C(0x144e44b0de5a085d), UINT64_C(0x6e963478ee6f8124),
UINT64_C(0x21c640532670ac20), UINT64_C(0x5b1e309b16452559),
UINT64_C(0xd476a1c3461bbed2), UINT64_C(0xaeaed10b762e37ab),
UINT64_C(0x37deb6af5e9b8b5b), UINT64_C(0x4d06c6676eae0222),
UINT64_C(0xc26e573f3ef099a9), UINT64_C(0xb8b627f70ec510d0),
UINT64_C(0xf7e653dcc6da3dd4), UINT64_C(0x8d3e2314f6efb4ad),
UINT64_C(0x0256b24ca6b12f26), UINT64_C(0x788ec2849684a65f),
UINT64_C(0x9cf65a1b368f752e), UINT64_C(0xe62e2ad306bafc57),
UINT64_C(0x6946bb8b56e467dc), UINT64_C(0x139ecb4366d1eea5),
UINT64_C(0x5ccebf68aecec3a1), UINT64_C(0x2616cfa09efb4ad8),
UINT64_C(0xa97e5ef8cea5d153), UINT64_C(0xd3a62e30fe90582a),
UINT64_C(0xb0c7b7e3c7593bd8), UINT64_C(0xca1fc72bf76cb2a1),
UINT64_C(0x45775673a732292a), UINT64_C(0x3faf26bb9707a053),
UINT64_C(0x70ff52905f188d57), UINT64_C(0x0a2722586f2d042e),
UINT64_C(0x854fb3003f739fa5), UINT64_C(0xff97c3c80f4616dc),
UINT64_C(0x1bef5b57af4dc5ad), UINT64_C(0x61372b9f9f784cd4),
UINT64_C(0xee5fbac7cf26d75f), UINT64_C(0x9487ca0fff135e26),
UINT64_C(0xdbd7be24370c7322), UINT64_C(0xa10fceec0739fa5b),
UINT64_C(0x2e675fb4576761d0), UINT64_C(0x54bf2f7c6752e8a9),
UINT64_C(0xcdcf48d84fe75459), UINT64_C(0xb71738107fd2dd20),
UINT64_C(0x387fa9482f8c46ab), UINT64_C(0x42a7d9801fb9cfd2),
UINT64_C(0x0df7adabd7a6e2d6), UINT64_C(0x772fdd63e7936baf),
UINT64_C(0xf8474c3bb7cdf024), UINT64_C(0x829f3cf387f8795d),
UINT64_C(0x66e7a46c27f3aa2c), UINT64_C(0x1c3fd4a417c62355),
UINT64_C(0x935745fc4798b8de), UINT64_C(0xe98f353477ad31a7),
UINT64_C(0xa6df411fbfb21ca3), UINT64_C(0xdc0731d78f8795da),
UINT64_C(0x536fa08fdfd90e51), UINT64_C(0x29b7d047efec8728),
};
uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l) {
uint64_t j;
for (j = 0; j < l; j++) {
uint8_t byte = s[j];
crc = crc64_tab[(uint8_t)crc ^ byte] ^ (crc >> 8);
}
return crc;
}
/* Test main */
#ifdef REDIS_TEST
#include <stdio.h>
#define UNUSED(x) (void)(x)
int crc64Test(int argc, char *argv[]) {
UNUSED(argc);
UNUSED(argv);
printf("e9c6d914c4b8d9ca == %016llx\n",
(PORT_ULONGLONG) crc64(0,(unsigned char*)"123456789",9));
return 0;
}
#endif
|
the_stack_data/16888.c
|
#define BITSLICE(x, a, b) ((x) >> (b)) & ((1 << ((a)-(b)+1)) - 1)
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include<assert.h>
int symbol;
int assert_forward = 1;
int action_run;
void end_assertions();
int hdr_tcp_ack_453638;
int traverse_453638 = 0;
int meta_stats_metadata_dupack_le_3_454027;
int traverse_454027 = 0;
int hdr_ipv4_ttl_eq_0_455545;
uint64_t constant_hdr_tcp_dstPort_455552;
uint64_t constant_hdr_tcp_seqNo_455559;
uint64_t constant_hdr_tcp_ackNo_455566;
uint64_t constant_hdr_tcp_dataOffset_455573;
uint64_t constant_hdr_tcp_res_455580;
uint64_t constant_hdr_tcp_ecn_455587;
uint64_t constant_hdr_tcp_urg_455594;
uint64_t constant_hdr_tcp_ack_455601;
uint64_t constant_hdr_tcp_push_455608;
uint64_t constant_hdr_tcp_rst_455615;
uint64_t constant_hdr_tcp_syn_455622;
uint64_t constant_hdr_tcp_fin_455629;
uint64_t constant_hdr_tcp_window_455636;
uint64_t constant_hdr_tcp_checksum_455643;
uint64_t constant_hdr_tcp_urgentPtr_455650;
void lookup_reverse_455435();
void update_flow_dupack_0_453843();
void NoAction_30_453274();
void _drop_4_454454();
void set_nhop_0_454574();
void accept();
void _drop_1_454438();
void flow_retx_3dupack_455113();
void NoAction_28_453272();
void lookup_flow_map_0_454610();
void record_IP_0_454487();
void set_dmac_0_454420();
void NoAction_20_453264();
void NoAction_26_453270();
void sample_rtt_sent_455503();
void parse_ethernet();
void parse_sack();
void NoAction_29_453273();
void parse_tcp();
void lookup_455401();
void update_flow_rcvd_0_453896();
void debug_454943();
void increase_mincwnd_0_454461();
void start();
void send_frame_453170();
void lookup_flow_map_reverse_0_454672();
void _drop_0_453154();
void reject();
void direction_454977();
void NoAction_23_453267();
void sample_new_rtt_0_454900();
void update_flow_retx_timeout_0_454141();
void NoAction_0_453126();
void NoAction_31_453275();
void use_sample_rtt_0_459912();
void parse_mss();
void parse_ts();
void use_sample_rtt_first_0_458416();
void ipv4_lpm_455342();
void NoAction_22_453266();
void parse_end();
void NoAction_19_453263();
void init_455308();
void increase_cwnd_455274();
void forward_455215();
void parse_ipv4();
void flow_sent_455181();
void NoAction_21_453265();
void get_sender_IP_0_453622();
void flow_dupack_455045();
void rewrite_mac_0_453136();
void flow_retx_timeout_455147();
void NoAction_27_453271();
void NoAction_25_453269();
void flow_rcvd_455079();
void NoAction_24_453268();
void NoAction_32_453276();
void save_source_IP_0_453564();
void parse_tcp_options();
void NoAction_1_453262();
void parse_nop();
void parse_wscale();
void update_flow_retx_3dupack_0_454011();
void first_rtt_sample_455011();
void update_flow_sent_0_454233();
void sample_rtt_rcvd_455469();
void NoAction_33_453277();
typedef struct {
uint32_t ingress_port : 9;
uint32_t egress_spec : 9;
uint32_t egress_port : 9;
uint32_t clone_spec : 32;
uint32_t instance_type : 32;
uint8_t drop : 1;
uint32_t recirculate_port : 16;
uint32_t packet_length : 32;
uint32_t enq_timestamp : 32;
uint32_t enq_qdepth : 19;
uint32_t deq_timedelta : 32;
uint32_t deq_qdepth : 19;
uint64_t ingress_global_timestamp : 48;
uint32_t lf_field_list : 32;
uint32_t mcast_grp : 16;
uint8_t resubmit_flag : 1;
uint32_t egress_rid : 16;
uint8_t checksum_error : 1;
} standard_metadata_t;
void mark_to_drop() {
assert_forward = 0;
end_assertions();
exit(0);
}
typedef struct {
uint64_t ingress_global_timestamp : 48;
uint32_t lf_field_list : 32;
uint32_t mcast_grp : 16;
uint32_t egress_rid : 16;
} intrinsic_metadata_t;
typedef struct {
uint8_t parse_tcp_options_counter : 8;
} my_metadata_t;
typedef struct {
uint32_t nhop_ipv4 : 32;
} routing_metadata_t;
typedef struct {
uint32_t dummy : 32;
uint32_t dummy2 : 32;
uint8_t flow_map_index : 2;
uint32_t senderIP : 32;
uint32_t seqNo : 32;
uint32_t ackNo : 32;
uint32_t sample_rtt_seq : 32;
uint32_t rtt_samples : 32;
uint32_t mincwnd : 32;
uint32_t dupack : 32;
} stats_metadata_t;
typedef struct {
uint8_t isValid : 1;
uint64_t dstAddr : 48;
uint64_t srcAddr : 48;
uint32_t etherType : 16;
} ethernet_t;
typedef struct {
uint8_t isValid : 1;
uint8_t version : 4;
uint8_t ihl : 4;
uint8_t diffserv : 8;
uint32_t totalLen : 16;
uint32_t identification : 16;
uint8_t flags : 3;
uint32_t fragOffset : 13;
uint8_t ttl : 8;
uint8_t protocol : 8;
uint32_t hdrChecksum : 16;
uint32_t srcAddr : 32;
uint32_t dstAddr : 32;
} ipv4_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
} options_end_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
uint8_t len : 8;
uint32_t MSS : 16;
} options_mss_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
uint8_t len : 8;
} options_sack_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
uint8_t len : 8;
uint64_t ttee : 64;
} options_ts_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
uint8_t len : 8;
uint8_t wscale : 8;
} options_wscale_t;
typedef struct {
uint8_t isValid : 1;
uint32_t srcPort : 16;
uint32_t dstPort : 16;
uint32_t seqNo : 32;
uint32_t ackNo : 32;
uint8_t dataOffset : 4;
uint8_t res : 3;
uint8_t ecn : 3;
uint8_t urg : 1;
uint8_t ack : 1;
uint8_t push : 1;
uint8_t rst : 1;
uint8_t syn : 1;
uint8_t fin : 1;
uint32_t window : 16;
uint32_t checksum : 16;
uint32_t urgentPtr : 16;
} tcp_t;
typedef struct {
uint8_t isValid : 1;
uint8_t kind : 8;
} options_nop_t;
typedef struct {
intrinsic_metadata_t intrinsic_metadata;
my_metadata_t my_metadata;
routing_metadata_t routing_metadata;
stats_metadata_t stats_metadata;
} metadata;
typedef struct {
ethernet_t ethernet;
ipv4_t ipv4;
options_end_t options_end;
options_mss_t options_mss;
options_sack_t options_sack;
options_ts_t options_ts;
options_wscale_t options_wscale;
tcp_t tcp;
int options_nop_index;
options_nop_t options_nop[3];
} headers;
headers hdr;
metadata meta;
standard_metadata_t standard_metadata;
uint8_t tmp_0;
void parse_end() {
//Extract hdr.options_end
hdr.options_end.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 255;
parse_tcp_options();
}
void parse_ethernet() {
//Extract hdr.ethernet
hdr.ethernet.isValid = 1;
if((hdr.ethernet.etherType == 2048)){
parse_ipv4();
} else {
accept();
}
}
void parse_ipv4() {
//Extract hdr.ipv4
hdr.ipv4.isValid = 1;
if((hdr.ipv4.protocol == 6)){
parse_tcp();
} else {
accept();
}
}
void parse_mss() {
//Extract hdr.options_mss
hdr.options_mss.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 252;
parse_tcp_options();
}
void parse_nop() {
//Extract hdr.options_nop.next
hdr.options_nop[hdr.options_nop_index].isValid = 1;
hdr.options_nop_index++;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 255;
parse_tcp_options();
}
void parse_sack() {
//Extract hdr.options_sack
hdr.options_sack.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 254;
parse_tcp_options();
}
void parse_tcp() {
//Extract hdr.tcp
hdr.tcp.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = (uint8_t) hdr.tcp.dataOffset << 2 + 12;
if((hdr.tcp.syn == 1)){
parse_tcp_options();
} else {
accept();
}
}
void parse_tcp_options() {
klee_make_symbolic(&tmp_0, sizeof(tmp_0), "tmp_0");
if(((meta.my_metadata.parse_tcp_options_counter & 255) == (0 & 255)) && ((BITSLICE(tmp_0, 7, 0) & 0) == (0 & 0))){
accept();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (0 & 255))){
parse_end();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (1 & 255))){
parse_nop();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (2 & 255))){
parse_mss();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (3 & 255))){
parse_wscale();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (4 & 255))){
parse_sack();
} else if(((meta.my_metadata.parse_tcp_options_counter & 0) == (0 & 0)) && ((BITSLICE(tmp_0, 7, 0) & 255) == (8 & 255))){
parse_ts();
}
}
void parse_ts() {
//Extract hdr.options_ts
hdr.options_ts.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 246;
parse_tcp_options();
}
void parse_wscale() {
//Extract hdr.options_wscale
hdr.options_wscale.isValid = 1;
meta.my_metadata.parse_tcp_options_counter = meta.my_metadata.parse_tcp_options_counter + 253;
parse_tcp_options();
}
void start() {
parse_ethernet();
}
void accept() {
}
void reject() {
assert_forward = 0;
end_assertions();
exit(0);
}
void ParserImpl() {
klee_make_symbolic(&hdr, sizeof(hdr), "hdr");
klee_make_symbolic(&meta, sizeof(meta), "meta");
klee_make_symbolic(&standard_metadata, sizeof(standard_metadata), "standard_metadata");
start();
}
//Control
void egress() {
send_frame_453170();
}
// Action
void NoAction_0_453126() {
action_run = 453126;
}
// Action
void rewrite_mac_0_453136() {
action_run = 453136;
uint64_t smac;
klee_make_symbolic(&smac, sizeof(smac), "smac");
hdr.ethernet.srcAddr = smac;
}
// Action
void _drop_0_453154() {
action_run = 453154;
mark_to_drop();
}
//Table
void send_frame_453170() {
int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: rewrite_mac_0_453136(); break;
case 1: _drop_0_453154(); break;
default: NoAction_0_453126(); break;
}
// keys: standard_metadata.egress_port:exact
// size 256
// default_action NoAction_0();
}
typedef struct {
uint32_t field : 32;
uint32_t field_0 : 32;
uint8_t field_1 : 8;
uint32_t field_2 : 16;
uint32_t field_3 : 16;
} tuple_0;
//Control
void ingress() {
hdr_ipv4_ttl_eq_0_455545 = (hdr.ipv4.ttl == 0);
constant_hdr_tcp_dstPort_455552 = hdr.tcp.dstPort;
constant_hdr_tcp_seqNo_455559 = hdr.tcp.seqNo;
constant_hdr_tcp_ackNo_455566 = hdr.tcp.ackNo;
constant_hdr_tcp_dataOffset_455573 = hdr.tcp.dataOffset;
constant_hdr_tcp_res_455580 = hdr.tcp.res;
constant_hdr_tcp_ecn_455587 = hdr.tcp.ecn;
constant_hdr_tcp_urg_455594 = hdr.tcp.urg;
constant_hdr_tcp_ack_455601 = hdr.tcp.ack;
constant_hdr_tcp_push_455608 = hdr.tcp.push;
constant_hdr_tcp_rst_455615 = hdr.tcp.rst;
constant_hdr_tcp_syn_455622 = hdr.tcp.syn;
constant_hdr_tcp_fin_455629 = hdr.tcp.fin;
constant_hdr_tcp_window_455636 = hdr.tcp.window;
constant_hdr_tcp_checksum_455643 = hdr.tcp.checksum;
constant_hdr_tcp_urgentPtr_455650 = hdr.tcp.urgentPtr;
if((hdr.ipv4.protocol == 6)) {
if(hdr.ipv4.srcAddr > hdr.ipv4.dstAddr) {
lookup_455401();
} else {
lookup_reverse_455435();
}
if((hdr.tcp.syn == 1) && (hdr.tcp.ack == 0)) {
init_455308();
} else {
direction_454977();
}
if((hdr.ipv4.srcAddr == meta.stats_metadata.senderIP)) {
if(hdr.tcp.seqNo > meta.stats_metadata.seqNo) {
flow_sent_455181();
if((meta.stats_metadata.sample_rtt_seq == 0)) {
sample_rtt_sent_455503();
}
if(meta.stats_metadata.dummy > meta.stats_metadata.mincwnd) {
increase_cwnd_455274();
}
} else {
if((meta.stats_metadata.dupack == 3)) {
flow_retx_3dupack_455113();
} else {
flow_retx_timeout_455147();
}
}
} else {
if((hdr.ipv4.dstAddr == meta.stats_metadata.senderIP)) {
if(hdr.tcp.ackNo > meta.stats_metadata.ackNo) {
flow_rcvd_455079();
if(hdr.tcp.ackNo >= meta.stats_metadata.sample_rtt_seq && meta.stats_metadata.sample_rtt_seq > 0) {
if((meta.stats_metadata.rtt_samples == 0)) {
first_rtt_sample_455011();
} else {
sample_rtt_rcvd_455469();
}
}
} else {
flow_dupack_455045();
}
} else {
debug_454943();
}
}
}
ipv4_lpm_455342();
forward_455215();
}
// Action
void NoAction_1_453262() {
action_run = 453262;
}
// Action
void NoAction_19_453263() {
action_run = 453263;
}
// Action
void NoAction_20_453264() {
action_run = 453264;
}
// Action
void NoAction_21_453265() {
action_run = 453265;
}
// Action
void NoAction_22_453266() {
action_run = 453266;
}
// Action
void NoAction_23_453267() {
action_run = 453267;
}
// Action
void NoAction_24_453268() {
action_run = 453268;
}
// Action
void NoAction_25_453269() {
action_run = 453269;
}
// Action
void NoAction_26_453270() {
action_run = 453270;
}
// Action
void NoAction_27_453271() {
action_run = 453271;
}
// Action
void NoAction_28_453272() {
action_run = 453272;
}
// Action
void NoAction_29_453273() {
action_run = 453273;
}
// Action
void NoAction_30_453274() {
action_run = 453274;
}
// Action
void NoAction_31_453275() {
action_run = 453275;
}
// Action
void NoAction_32_453276() {
action_run = 453276;
}
// Action
void NoAction_33_453277() {
action_run = 453277;
}
// Action
void save_source_IP_0_453564() {
action_run = 453564;
}
// Action
void get_sender_IP_0_453622() {
action_run = 453622;
hdr_tcp_ack_453638 = (hdr.tcp.ack == 1);
traverse_453638 = 1;
uint64_t t84710467_540e_4c78_b9f4_a4a8cde883cd;
klee_make_symbolic(&t84710467_540e_4c78_b9f4_a4a8cde883cd, sizeof(t84710467_540e_4c78_b9f4_a4a8cde883cd), "t84710467_540e_4c78_b9f4_a4a8cde883cd");
meta.stats_metadata.senderIP = t84710467_540e_4c78_b9f4_a4a8cde883cd;
uint64_t tc2657781_89c5_4494_8e21_499aa8caec4b;
klee_make_symbolic(&tc2657781_89c5_4494_8e21_499aa8caec4b, sizeof(tc2657781_89c5_4494_8e21_499aa8caec4b), "tc2657781_89c5_4494_8e21_499aa8caec4b");
meta.stats_metadata.seqNo = tc2657781_89c5_4494_8e21_499aa8caec4b;
uint64_t t397c4235_0d25_461d_a146_a5548f85870c;
klee_make_symbolic(&t397c4235_0d25_461d_a146_a5548f85870c, sizeof(t397c4235_0d25_461d_a146_a5548f85870c), "t397c4235_0d25_461d_a146_a5548f85870c");
meta.stats_metadata.ackNo = t397c4235_0d25_461d_a146_a5548f85870c;
uint64_t t33d4b0dc_4a79_4d9a_8866_01d06bbeaa6d;
klee_make_symbolic(&t33d4b0dc_4a79_4d9a_8866_01d06bbeaa6d, sizeof(t33d4b0dc_4a79_4d9a_8866_01d06bbeaa6d), "t33d4b0dc_4a79_4d9a_8866_01d06bbeaa6d");
meta.stats_metadata.sample_rtt_seq = t33d4b0dc_4a79_4d9a_8866_01d06bbeaa6d;
uint64_t t0042b193_6254_498c_9290_8b199fb35363;
klee_make_symbolic(&t0042b193_6254_498c_9290_8b199fb35363, sizeof(t0042b193_6254_498c_9290_8b199fb35363), "t0042b193_6254_498c_9290_8b199fb35363");
meta.stats_metadata.rtt_samples = t0042b193_6254_498c_9290_8b199fb35363;
uint64_t tdd4becaa_adba_48c2_b312_88bc177dfe51;
klee_make_symbolic(&tdd4becaa_adba_48c2_b312_88bc177dfe51, sizeof(tdd4becaa_adba_48c2_b312_88bc177dfe51), "tdd4becaa_adba_48c2_b312_88bc177dfe51");
meta.stats_metadata.mincwnd = tdd4becaa_adba_48c2_b312_88bc177dfe51;
uint64_t t543c8d31_64cb_4a09_aedb_760122b697d0;
klee_make_symbolic(&t543c8d31_64cb_4a09_aedb_760122b697d0, sizeof(t543c8d31_64cb_4a09_aedb_760122b697d0), "t543c8d31_64cb_4a09_aedb_760122b697d0");
meta.stats_metadata.dupack = t543c8d31_64cb_4a09_aedb_760122b697d0;
}
// Action
void use_sample_rtt_first_0_458416() {
action_run = 458416;
uint64_t t8fd99da7_2390_4faa_b72e_1c8d2fe8ec76;
klee_make_symbolic(&t8fd99da7_2390_4faa_b72e_1c8d2fe8ec76, sizeof(t8fd99da7_2390_4faa_b72e_1c8d2fe8ec76), "t8fd99da7_2390_4faa_b72e_1c8d2fe8ec76");
meta.stats_metadata.dummy = t8fd99da7_2390_4faa_b72e_1c8d2fe8ec76;
meta.stats_metadata.dummy2 = (uint32_t) meta.intrinsic_metadata.ingress_global_timestamp;
meta.stats_metadata.dummy2 = meta.intrinsic_metadata.ingress_global_timestamp - meta.stats_metadata.dummy;
}
// Action
void update_flow_dupack_0_453843() {
action_run = 453843;
uint64_t td57b7426_1259_40f2_b38e_53c8db694035;
klee_make_symbolic(&td57b7426_1259_40f2_b38e_53c8db694035, sizeof(td57b7426_1259_40f2_b38e_53c8db694035), "td57b7426_1259_40f2_b38e_53c8db694035");
meta.stats_metadata.dummy = td57b7426_1259_40f2_b38e_53c8db694035;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
}
// Action
void update_flow_rcvd_0_453896() {
action_run = 453896;
uint64_t t027c3367_c295_4744_92d9_7f71fe8da4cf;
klee_make_symbolic(&t027c3367_c295_4744_92d9_7f71fe8da4cf, sizeof(t027c3367_c295_4744_92d9_7f71fe8da4cf), "t027c3367_c295_4744_92d9_7f71fe8da4cf");
meta.stats_metadata.dummy = t027c3367_c295_4744_92d9_7f71fe8da4cf;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
}
// Action
void update_flow_retx_3dupack_0_454011() {
action_run = 454011;
meta_stats_metadata_dupack_le_3_454027 = (meta.stats_metadata.dupack < 3);
traverse_454027 = 1;
uint64_t t6cdeb88d_183a_496b_bd1c_7545b4500045;
klee_make_symbolic(&t6cdeb88d_183a_496b_bd1c_7545b4500045, sizeof(t6cdeb88d_183a_496b_bd1c_7545b4500045), "t6cdeb88d_183a_496b_bd1c_7545b4500045");
meta.stats_metadata.dummy = t6cdeb88d_183a_496b_bd1c_7545b4500045;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
uint64_t t1eef1073_2268_4adb_9b9f_f0c4a478783b;
klee_make_symbolic(&t1eef1073_2268_4adb_9b9f_f0c4a478783b, sizeof(t1eef1073_2268_4adb_9b9f_f0c4a478783b), "t1eef1073_2268_4adb_9b9f_f0c4a478783b");
meta.stats_metadata.dummy = t1eef1073_2268_4adb_9b9f_f0c4a478783b;
meta.stats_metadata.dummy = meta.stats_metadata.dummy >> 1;
}
// Action
void update_flow_retx_timeout_0_454141() {
action_run = 454141;
uint64_t t7814ce3c_d0d1_42be_ac04_b1119828690e;
klee_make_symbolic(&t7814ce3c_d0d1_42be_ac04_b1119828690e, sizeof(t7814ce3c_d0d1_42be_ac04_b1119828690e), "t7814ce3c_d0d1_42be_ac04_b1119828690e");
meta.stats_metadata.dummy = t7814ce3c_d0d1_42be_ac04_b1119828690e;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
}
// Action
void update_flow_sent_0_454233() {
action_run = 454233;
uint64_t te1b91cfe_5d0f_4530_a884_0be722efb1a8;
klee_make_symbolic(&te1b91cfe_5d0f_4530_a884_0be722efb1a8, sizeof(te1b91cfe_5d0f_4530_a884_0be722efb1a8), "te1b91cfe_5d0f_4530_a884_0be722efb1a8");
meta.stats_metadata.dummy = te1b91cfe_5d0f_4530_a884_0be722efb1a8;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
meta.stats_metadata.dummy = (uint32_t) meta.intrinsic_metadata.ingress_global_timestamp;
uint64_t t3a4972fa_fbbd_4235_b9aa_fd47bb2f6e52;
klee_make_symbolic(&t3a4972fa_fbbd_4235_b9aa_fd47bb2f6e52, sizeof(t3a4972fa_fbbd_4235_b9aa_fd47bb2f6e52), "t3a4972fa_fbbd_4235_b9aa_fd47bb2f6e52");
meta.stats_metadata.dummy2 = t3a4972fa_fbbd_4235_b9aa_fd47bb2f6e52;
meta.stats_metadata.dummy = meta.stats_metadata.dummy - meta.stats_metadata.dummy2;
uint64_t t5ed0309f_6b03_4d51_8a63_e7eb5084dca2;
klee_make_symbolic(&t5ed0309f_6b03_4d51_8a63_e7eb5084dca2, sizeof(t5ed0309f_6b03_4d51_8a63_e7eb5084dca2), "t5ed0309f_6b03_4d51_8a63_e7eb5084dca2");
meta.stats_metadata.dummy = t5ed0309f_6b03_4d51_8a63_e7eb5084dca2;
uint64_t tc41b4e19_7e83_4d1c_b753_4eb7539bdea3;
klee_make_symbolic(&tc41b4e19_7e83_4d1c_b753_4eb7539bdea3, sizeof(tc41b4e19_7e83_4d1c_b753_4eb7539bdea3), "tc41b4e19_7e83_4d1c_b753_4eb7539bdea3");
meta.stats_metadata.dummy2 = tc41b4e19_7e83_4d1c_b753_4eb7539bdea3;
meta.stats_metadata.dummy = meta.stats_metadata.dummy - meta.stats_metadata.dummy2;
}
// Action
void set_dmac_0_454420() {
action_run = 454420;
uint64_t dmac;
klee_make_symbolic(&dmac, sizeof(dmac), "dmac");
hdr.ethernet.dstAddr = dmac;
}
// Action
void _drop_1_454438() {
action_run = 454438;
mark_to_drop();
}
// Action
void _drop_4_454454() {
action_run = 454454;
mark_to_drop();
}
// Action
void increase_mincwnd_0_454461() {
action_run = 454461;
}
// Action
void record_IP_0_454487() {
action_run = 454487;
uint64_t tc9585c7b_790e_494a_9f60_75e1b3890aab;
klee_make_symbolic(&tc9585c7b_790e_494a_9f60_75e1b3890aab, sizeof(tc9585c7b_790e_494a_9f60_75e1b3890aab), "tc9585c7b_790e_494a_9f60_75e1b3890aab");
meta.stats_metadata.senderIP = tc9585c7b_790e_494a_9f60_75e1b3890aab;
}
// Action
void set_nhop_0_454574() {
action_run = 454574;
uint32_t nhop_ipv4;
klee_make_symbolic(&nhop_ipv4, sizeof(nhop_ipv4), "nhop_ipv4");
uint32_t port;
klee_make_symbolic(&port, sizeof(port), "port");
meta.routing_metadata.nhop_ipv4 = nhop_ipv4;
standard_metadata.egress_spec = port;
hdr.ipv4.ttl = hdr.ipv4.ttl + 255;
}
// Action
void lookup_flow_map_0_454610() {
action_run = 454610;
uint64_t t12faf59b_7eed_401f_8b88_85a14fdc44c3;
klee_make_symbolic(&t12faf59b_7eed_401f_8b88_85a14fdc44c3, sizeof(t12faf59b_7eed_401f_8b88_85a14fdc44c3), "t12faf59b_7eed_401f_8b88_85a14fdc44c3");
meta.stats_metadata.flow_map_index = t12faf59b_7eed_401f_8b88_85a14fdc44c3;
}
// Action
void lookup_flow_map_reverse_0_454672() {
action_run = 454672;
uint64_t t4e5dad2d_c703_4505_91bd_095317cef223;
klee_make_symbolic(&t4e5dad2d_c703_4505_91bd_095317cef223, sizeof(t4e5dad2d_c703_4505_91bd_095317cef223), "t4e5dad2d_c703_4505_91bd_095317cef223");
meta.stats_metadata.flow_map_index = t4e5dad2d_c703_4505_91bd_095317cef223;
}
// Action
void use_sample_rtt_0_459912() {
action_run = 459912;
uint64_t t1bc1f8cd_431f_40a1_a56a_30b3fb7aee68;
klee_make_symbolic(&t1bc1f8cd_431f_40a1_a56a_30b3fb7aee68, sizeof(t1bc1f8cd_431f_40a1_a56a_30b3fb7aee68), "t1bc1f8cd_431f_40a1_a56a_30b3fb7aee68");
meta.stats_metadata.dummy = t1bc1f8cd_431f_40a1_a56a_30b3fb7aee68;
meta.stats_metadata.dummy2 = (uint32_t) meta.intrinsic_metadata.ingress_global_timestamp;
meta.stats_metadata.dummy2 = meta.intrinsic_metadata.ingress_global_timestamp - meta.stats_metadata.dummy;
uint64_t t5cf0c290_3447_4bec_982f_ad887f31367e;
klee_make_symbolic(&t5cf0c290_3447_4bec_982f_ad887f31367e, sizeof(t5cf0c290_3447_4bec_982f_ad887f31367e), "t5cf0c290_3447_4bec_982f_ad887f31367e");
meta.stats_metadata.dummy = t5cf0c290_3447_4bec_982f_ad887f31367e;
meta.stats_metadata.dummy = 7 * meta.stats_metadata.dummy + meta.stats_metadata.dummy2;
meta.stats_metadata.dummy = meta.stats_metadata.dummy >> 3;
uint64_t t41623da2_e52b_4cf5_9c2d_ef3958befb03;
klee_make_symbolic(&t41623da2_e52b_4cf5_9c2d_ef3958befb03, sizeof(t41623da2_e52b_4cf5_9c2d_ef3958befb03), "t41623da2_e52b_4cf5_9c2d_ef3958befb03");
meta.stats_metadata.dummy = t41623da2_e52b_4cf5_9c2d_ef3958befb03;
meta.stats_metadata.dummy = meta.stats_metadata.dummy + 1;
}
// Action
void sample_new_rtt_0_454900() {
action_run = 454900;
}
//Table
void debug_454943() {
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
case 0: save_source_IP_0_453564(); break;
default: NoAction_1_453262(); break;
}
}
//Table
void direction_454977() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: get_sender_IP_0_453622(); break;
default: NoAction_19_453263(); break;
}
// default_action NoAction_19();
}
//Table
void first_rtt_sample_455011() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: use_sample_rtt_first_0_458416(); break;
default: NoAction_20_453264(); break;
}
// default_action NoAction_20();
}
//Table
void flow_dupack_455045() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: update_flow_dupack_0_453843(); break;
default: NoAction_21_453265(); break;
}
// default_action NoAction_21();
}
//Table
void flow_rcvd_455079() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: update_flow_rcvd_0_453896(); break;
default: NoAction_22_453266(); break;
}
// default_action NoAction_22();
}
//Table
void flow_retx_3dupack_455113() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: update_flow_retx_3dupack_0_454011(); break;
default: NoAction_23_453267(); break;
}
// default_action NoAction_23();
}
//Table
void flow_retx_timeout_455147() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: update_flow_retx_timeout_0_454141(); break;
default: NoAction_24_453268(); break;
}
// default_action NoAction_24();
}
//Table
void flow_sent_455181() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: update_flow_sent_0_454233(); break;
default: NoAction_25_453269(); break;
}
// default_action NoAction_25();
}
//Table
void forward_455215() {
// int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: set_dmac_0_454420(); break;
case 1: _drop_1_454438(); break;
default: NoAction_26_453270(); break;
}
// keys: meta.routing_metadata.nhop_ipv4:exact
// size 512
// default_action NoAction_26();
}
//Table
void increase_cwnd_455274() {
// int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: increase_mincwnd_0_454461(); break;
default: NoAction_27_453271(); break;
}
// default_action NoAction_27();
}
//Table
void init_455308() {
//int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: record_IP_0_454487(); break;
default: NoAction_28_453272(); break;
}
// default_action NoAction_28();
}
//Table
void ipv4_lpm_455342() {
// int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: set_nhop_0_454574(); break;
case 1: _drop_4_454454(); break;
default: NoAction_29_453273(); break;
}
// keys: hdr.ipv4.dstAddr:lpm
// size 1024
// default_action NoAction_29();
}
//Table
void lookup_455401() {
// int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: lookup_flow_map_0_454610(); break;
default: NoAction_30_453274(); break;
}
// default_action NoAction_30();
}
//Table
void lookup_reverse_455435() {
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: lookup_flow_map_reverse_0_454672(); break;
default: NoAction_31_453275(); break;
}
// default_action NoAction_31();
}
//Table
void sample_rtt_rcvd_455469() {
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: use_sample_rtt_0_459912(); break;
default: NoAction_32_453276(); break;
}
// default_action NoAction_32();
}
//Table
void sample_rtt_sent_455503() {
// int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
//switch(klee_int("symbol")){
case 0: sample_new_rtt_0_454900(); break;
default: NoAction_33_453277(); break;
}
// default_action NoAction_33();
}
typedef struct {
uint8_t field_4 : 4;
uint8_t field_5 : 4;
uint8_t field_6 : 8;
uint32_t field_7 : 16;
uint32_t field_8 : 16;
uint8_t field_9 : 3;
uint32_t field_10 : 13;
uint8_t field_11 : 8;
uint8_t field_12 : 8;
uint32_t field_13 : 32;
uint32_t field_14 : 32;
} tuple_1;
//Control
void verifyChecksum() {
verify_checksum();
}
//Control
void computeChecksum() {
update_checksum();
}
int main() {
ParserImpl();
ingress();
egress();
end_assertions();
return 0;
}
void end_assertions(){
if(!(!(hdr_tcp_ack_453638) || (traverse_453638))) klee_print_once(0 , "!(hdr_tcp_ack_453638) || (traverse_453638)");
if(!(!(meta_stats_metadata_dupack_le_3_454027) || (!traverse_454027))) klee_print_once(1, "!(meta_stats_metadata_dupack_le_3_454027) || (!traverse_454027)");
if(!(!(hdr_ipv4_ttl_eq_0_455545) || (!assert_forward))) klee_print_once(2, "!(hdr_ipv4_ttl_eq_0_455545) || (!assert_forward)");
///if(!(constant_hdr_tcp_dstPort_455552 == hdr.tcp.dstPort)) assert_error("constant_hdr_tcp_dstPort_455552 == hdr.tcp.dstPort");
///if(!(constant_hdr_tcp_seqNo_455559 == hdr.tcp.seqNo)) assert_error("constant_hdr_tcp_seqNo_455559 == hdr.tcp.seqNo");
///if(!(constant_hdr_tcp_ackNo_455566 == hdr.tcp.ackNo)) assert_error("constant_hdr_tcp_ackNo_455566 == hdr.tcp.ackNo");
///if(!(constant_hdr_tcp_dataOffset_455573 == hdr.tcp.dataOffset)) assert_error("constant_hdr_tcp_dataOffset_455573 == hdr.tcp.dataOffset");
///if(!(constant_hdr_tcp_res_455580 == hdr.tcp.res)) assert_error("constant_hdr_tcp_res_455580 == hdr.tcp.res");
///if(!(constant_hdr_tcp_ecn_455587 == hdr.tcp.ecn)) assert_error("constant_hdr_tcp_ecn_455587 == hdr.tcp.ecn");
///if(!(constant_hdr_tcp_urg_455594 == hdr.tcp.urg)) assert_error("constant_hdr_tcp_urg_455594 == hdr.tcp.urg");
///if(!(constant_hdr_tcp_ack_455601 == hdr.tcp.ack)) assert_error("constant_hdr_tcp_ack_455601 == hdr.tcp.ack");
///if(!(constant_hdr_tcp_push_455608 == hdr.tcp.push)) assert_error("constant_hdr_tcp_push_455608 == hdr.tcp.push");
///if(!(constant_hdr_tcp_rst_455615 == hdr.tcp.rst)) assert_error("constant_hdr_tcp_rst_455615 == hdr.tcp.rst");
///if(!(constant_hdr_tcp_syn_455622 == hdr.tcp.syn)) assert_error("constant_hdr_tcp_syn_455622 == hdr.tcp.syn");
///if(!(constant_hdr_tcp_fin_455629 == hdr.tcp.fin)) assert_error("constant_hdr_tcp_fin_455629 == hdr.tcp.fin");
///if(!(constant_hdr_tcp_window_455636 == hdr.tcp.window)) assert_error("constant_hdr_tcp_window_455636 == hdr.tcp.window");
///if(!(constant_hdr_tcp_checksum_455643 == hdr.tcp.checksum)) assert_error("constant_hdr_tcp_checksum_455643 == hdr.tcp.checksum");
///if(!(constant_hdr_tcp_urgentPtr_455650 == hdr.tcp.urgentPtr)) assert_error("constant_hdr_tcp_urgentPtr_455650 == hdr.tcp.urgentPtr");
}
|
the_stack_data/125141454.c
|
/* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned int input[1] , unsigned int output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
int main(int argc , char *argv[] )
{
unsigned int input[1] ;
unsigned int output[1] ;
int randomFuns_i5 ;
unsigned int randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned int )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == 4242424242U) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
void megaInit(void)
{
{
}
}
void RandomFunc(unsigned int input[1] , unsigned int output[1] )
{
unsigned int state[1] ;
unsigned int local1 ;
char copy11 ;
unsigned short copy12 ;
{
state[0UL] = (input[0UL] + 914778474UL) ^ 3462201355U;
local1 = 0UL;
while (local1 < input[1UL]) {
if (state[0UL] > local1) {
copy11 = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = copy11;
} else {
copy12 = *((unsigned short *)(& state[0UL]) + 1);
*((unsigned short *)(& state[0UL]) + 1) = *((unsigned short *)(& state[0UL]) + 0);
*((unsigned short *)(& state[0UL]) + 0) = copy12;
}
local1 ++;
}
output[0UL] = state[0UL] * 238420169UL | 1855805517U;
}
}
|
the_stack_data/58604.c
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <stdlib.h>
struct Person {
int age;
int height;
int weight;
};
int simple_null_pointer() {
struct Person* max = 0;
return max->age;
}
struct Person* Person_create(int age, int height, int weight) {
struct Person* who = 0;
return who;
}
int get_age(struct Person* who) { return who->age; }
int null_pointer_interproc() {
struct Person* joe = Person_create(32, 64, 140);
return get_age(joe);
}
int negation_in_conditional() {
int* x = 0;
if (!x)
return 0;
else
return *x; // this never happens
}
static int* foo() { return 0; }
void null_pointer_with_function_pointer() {
int* (*fp)();
fp = foo;
int* x = fp();
*x = 3;
}
void use_exit(struct Person* htbl) {
if (!htbl)
exit(0);
int x = htbl->age;
}
void basic_null_dereference() {
int* p = NULL;
*p = 42; // NULL dereference
}
void no_check_for_null_after_malloc() {
int* p;
p = (int*)malloc(sizeof(int));
*p = 42; // NULL dereference
free(p);
}
void no_check_for_null_after_realloc() {
int* p;
p = (int*)malloc(sizeof(int) * 5);
if (p) {
p[3] = 42;
}
int* q = (int*)realloc(p, sizeof(int) * 10);
if (!q)
free(p);
q[7] = 0; // NULL dereference
free(q);
}
void assign(int* p, int n) { *p = n; }
void potentially_null_pointer_passed_as_argument() {
int* p = NULL;
p = (int*)malloc(sizeof(int));
assign(p, 42); // NULL dereference
free(p);
}
void null_passed_as_argument() {
assign(NULL, 42); // NULL dereference
}
void allocated_pointer_passed_as_argument() {
int* p = NULL;
p = (int*)malloc(sizeof(int));
if (p) {
assign(p, 42);
free(p);
}
}
int* unsafe_allocate() {
int* p = NULL;
p = (int*)malloc(sizeof(int));
return p;
}
int* safe_allocate() {
int* p = NULL;
while (!p) {
p = (int*)malloc(sizeof(int));
}
return p;
}
void function_call_can_return_null_pointer() {
int* p = NULL;
p = unsafe_allocate();
assign(p, 42); // NULL dereference
free(p);
}
void function_call_returns_allocated_pointer() {
int* p = NULL;
p = safe_allocate();
assign(p, 42);
free(p);
}
void sizeof_expr_ok(void) {
struct Person* p = malloc(sizeof *p);
if (p) {
p->age = 42;
}
free(p);
}
void __attribute__((noreturn)) will_not_return();
void unreachable_null_ok() {
int* p = NULL;
if (p == NULL) {
will_not_return();
}
*p = 42;
}
void no_ret() { will_not_return(); }
// pre-analysis is not inter-procedural for handling no_return calls
void unreachable_null_no_return_ok_FP() {
int* p = NULL;
if (p == NULL) {
no_ret(); // inter-procedural call to no_return
}
*p = 42;
}
|
the_stack_data/76700338.c
|
/* ACM 392 Polynomial Showdown
* mythnc
* 2011/12/21 09:15:20
* run time: 0.108
*/
#include <stdio.h>
#include <string.h>
#define MAXD 9
#define TRUE 1
#define FALSE 0
void output(int *);
int main(void)
{
int i;
int poly[MAXD] = { 0 };
while (scanf("%d", &poly[8]) == 1) {
for (i = 7; i > -1; i--)
scanf("%d", &poly[i]);
output(poly);
/* init */
memset(poly, 0, sizeof(int) * MAXD);
}
return 0;
}
void output(int *p)
{
int i, first;
for (i = 8, first = TRUE; i > -1; i--) {
if (p[i] == 0)
continue;
/* first element */
if (first) {
first = FALSE;
if (p[i] < 0)
putchar('-');
}
else if (p[i] > 0)
printf(" + ");
else
printf(" - ");
/* coefficient */
if (p[i] > 1 && i != 0)
printf("%d", p[i]);
else if (p[i] < -1 && i != 0)
printf("%d", -p[i]);
/* degree */
if (i > 1)
printf("x^%d", i);
else if (i == 1)
putchar('x');
else
printf("%d", p[i] >= 0 ? p[i] : -p[i]);
}
if (first)
putchar('0');
putchar('\n');
}
|
the_stack_data/1027011.c
|
/* stb_image - v1.35 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c
when you control the images you're loading
no warranty implied; use at your own risk
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
JPEG baseline (no JPEG progressive)
PNG 8-bit-per-channel only
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
- decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- decode from arbitrary I/O callbacks
- overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)
Latest revisions:
1.35 (2014-05-27) warnings, bugfixes, TGA optimization, etc
1.34 (unknown ) warning fix
1.33 (2011-07-14) minor fixes suggested by Dave Moore
1.32 (2011-07-13) info support for all filetypes (SpartanJ)
1.31 (2011-06-19) a few more leak fixes, bug in PNG handling (SpartanJ)
1.30 (2011-06-11) added ability to load files via io callbacks (Ben Wenger)
1.29 (2010-08-16) various warning fixes from Aurelien Pocheville
1.28 (2010-08-01) fix bug in GIF palette transparency (SpartanJ)
See end of file for full revision history.
TODO:
stbi_info support for BMP,PSD,HDR,PIC
============================ Contributors =========================
Image formats Bug fixes & warning fixes
Sean Barrett (jpeg, png, bmp) Marc LeBlanc
Nicolas Schulz (hdr, psd) Christpher Lloyd
Jonathan Dummer (tga) Dave Moore
Jean-Marc Lienher (gif) Won Chun
Tom Seddon (pic) the Horde3D community
Thatcher Ulrich (psd) Janez Zemva
Jonathan Blow
Laurent Gomila
Extensions, features Aruelien Pocheville
Jetro Lauha (stbi_info) Ryamond Barbiero
James "moose2000" Brown (iPhone PNG) David Woo
Ben "Disch" Wenger (io callbacks) Roy Eltham
Martin "SpartanJ" Golini Luke Graham
Thomas Ruf
John Bartholomew
Optimizations & bugfixes Ken Hamada
Fabian "ryg" Giesen Cort Stratton
Arseny Kapoulkine Blazej Dariusz Roszkowski
Thibault Reuille
If your name should be here but Paul Du Bois
isn't let Sean know. Guillaume George
*/
#ifndef STBI_INCLUDE_STB_IMAGE_H
#define STBI_INCLUDE_STB_IMAGE_H
// To get a header file for this, either cut and paste the header,
// or create stb_image.h, #define STBI_HEADER_FILE_ONLY, and
// then include stb_image.c from it.
//// begin header file ////////////////////////////////////////////////////
//
// Limitations:
// - no jpeg progressive support
// - non-HDR formats support 8-bit samples only (jpeg, png)
// - no delayed line count (jpeg) -- IJG doesn't support either
// - no 1-bit BMP
// - GIF always returns *comp=4
//
// Basic usage (see HDR discussion below):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
// // ... process data if not NULL ...
// // ... x = width, y = height, n = # 8-bit components per pixel ...
// // ... replace '0' with '1'..'4' to force that many components per pixel
// // ... but 'n' will always be the number that it would have been if you said 0
// stbi_image_free(data)
//
// Standard parameters:
// int *x -- outputs image width in pixels
// int *y -- outputs image height in pixels
// int *comp -- outputs # of image components in image file
// int req_comp -- if non-zero, # of image components requested in result
//
// The return value from an image loader is an 'unsigned char *' which points
// to the pixel data. The pixel data consists of *y scanlines of *x pixels,
// with each pixel consisting of N interleaved 8-bit components; the first
// pixel pointed to is top-left-most in the image. There is no padding between
// image scanlines or between pixels, regardless of format. The number of
// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.
// If req_comp is non-zero, *comp has the number of components that _would_
// have been output otherwise. E.g. if you set req_comp to 4, you will always
// get RGBA output, but you can check *comp to easily see if it's opaque.
//
// An output image with N components has the following components interleaved
// in this order in each pixel:
//
// N=#comp components
// 1 grey
// 2 grey, alpha
// 3 red, green, blue
// 4 red, green, blue, alpha
//
// If image loading fails for any reason, the return value will be NULL,
// and *x, *y, *comp will be unchanged. The function stbi_failure_reason()
// can be queried for an extremely brief, end-user unfriendly explanation
// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid
// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
// more user-friendly ones.
//
// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
//
// ===========================================================================
//
// iPhone PNG support:
//
// By default we convert iphone-formatted PNGs back to RGB; nominally they
// would silently load as BGR, except the existing code should have just
// failed on such iPhone PNGs. But you can disable this conversion by
// by calling stbi_convert_iphone_png_to_rgb(0), in which case
// you will always just get the native iphone "format" through.
//
// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
// pixel to remove any premultiplied alpha *only* if the image file explicitly
// says there's premultiplied data (currently only happens in iPhone images,
// and only if iPhone convert-to-rgb processing is on).
//
// ===========================================================================
//
// HDR image support (disable by defining STBI_NO_HDR)
//
// stb_image now supports loading HDR images in general, and currently
// the Radiance .HDR file format, although the support is provided
// generically. You can still load any file through the existing interface;
// if you attempt to load an HDR file, it will be automatically remapped to
// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
// both of these constants can be reconfigured through this interface:
//
// stbi_hdr_to_ldr_gamma(2.2f);
// stbi_hdr_to_ldr_scale(1.0f);
//
// (note, do not use _inverse_ constants; stbi_image will invert them
// appropriately).
//
// Additionally, there is a new, parallel interface for loading files as
// (linear) floats to preserve the full dynamic range:
//
// float *data = stbi_loadf(filename, &x, &y, &n, 0);
//
// If you load LDR images through this interface, those images will
// be promoted to floating point values, run through the inverse of
// constants corresponding to the above:
//
// stbi_ldr_to_hdr_scale(1.0f);
// stbi_ldr_to_hdr_gamma(2.2f);
//
// Finally, given a filename (or an open file or memory block--see header
// file for details) containing image data, you can query for the "most
// appropriate" interface to use (that is, whether the image is HDR or
// not), using:
//
// stbi_is_hdr(char *filename);
//
// ===========================================================================
//
// I/O callbacks
//
// I/O callbacks allow you to read from arbitrary sources, like packaged
// files or some other source. Data read from callbacks are processed
// through a small internal buffer (currently 128 bytes) to try to reduce
// overhead.
//
// The three functions you must define are "read" (reads some bytes of data),
// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
#ifndef STBI_NO_STDIO
#if defined(_MSC_VER) && _MSC_VER >= 1400
#define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
#pragma warning(push)
#pragma warning(disable:4996) // suppress even more warnings about fopen()
#endif
#include <stdio.h>
#endif // STBI_NO_STDIO
#define STBI_VERSION 1
enum
{
STBI_default = 0, // only used for req_comp
STBI_grey = 1,
STBI_grey_alpha = 2,
STBI_rgb = 3,
STBI_rgb_alpha = 4
};
typedef unsigned char stbi_uc;
#ifdef __cplusplus
extern "C" {
#endif
//////////////////////////////////////////////////////////////////////////////
//
// PRIMARY API - works on images of any type
//
//
// load image by filename, open file, or memory buffer
//
extern stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
#ifndef STBI_NO_STDIO
extern stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
extern stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
// for stbi_load_from_file, file pointer is left pointing immediately after image
#endif
typedef struct
{
int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
int (*eof) (void *user); // returns nonzero if we are at end of file/data
} stbi_io_callbacks;
extern stbi_uc *stbi_load_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
#ifndef STBI_NO_HDR
extern float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
#ifndef STBI_NO_STDIO
extern float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
extern float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
#endif
extern float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
extern void stbi_hdr_to_ldr_gamma(float gamma);
extern void stbi_hdr_to_ldr_scale(float scale);
extern void stbi_ldr_to_hdr_gamma(float gamma);
extern void stbi_ldr_to_hdr_scale(float scale);
#endif // STBI_NO_HDR
// stbi_is_hdr is always defined
extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
extern int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
#ifndef STBI_NO_STDIO
extern int stbi_is_hdr (char const *filename);
extern int stbi_is_hdr_from_file(FILE *f);
#endif // STBI_NO_STDIO
// get a VERY brief reason for failure
// NOT THREADSAFE
extern const char *stbi_failure_reason (void);
// free the loaded image -- this is just free()
extern void stbi_image_free (void *retval_from_stbi_load);
// get image dimensions & components without fully decoding
extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
extern int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
#ifndef STBI_NO_STDIO
extern int stbi_info (char const *filename, int *x, int *y, int *comp);
extern int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);
#endif
// for image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
extern void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
// indicate whether we should process iphone images back to canonical format,
// or just pass them through "as-is"
extern void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
// ZLIB client - used by PNG, available for other purposes
extern char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
extern char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);
extern char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
extern int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
extern char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
extern int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
// define faster low-level operations (typically SIMD support)
#ifdef STBI_SIMD
typedef void (*stbi_idct_8x8)(stbi_uc *out, int out_stride, short data[64], unsigned short *dequantize);
// compute an integer IDCT on "input"
// input[x] = data[x] * dequantize[x]
// write results to 'out': 64 samples, each run of 8 spaced by 'out_stride'
// CLAMP results to 0..255
typedef void (*stbi_YCbCr_to_RGB_run)(stbi_uc *output, stbi_uc const *y, stbi_uc const *cb, stbi_uc const *cr, int count, int step);
// compute a conversion from YCbCr to RGB
// 'count' pixels
// write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B
// y: Y input channel
// cb: Cb input channel; scale/biased to be 0..255
// cr: Cr input channel; scale/biased to be 0..255
extern void stbi_install_idct(stbi_idct_8x8 func);
extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
#endif // STBI_SIMD
#ifdef __cplusplus
}
#endif
//
//
//// end header file /////////////////////////////////////////////////////
#endif // STBI_INCLUDE_STB_IMAGE_H
#ifndef STBI_HEADER_FILE_ONLY
#ifndef STBI_NO_HDR
#include <math.h> // ldexp
#include <string.h> // strcmp, strtok
#endif
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif
#include <stdlib.h>
#include <memory.h>
#include <assert.h>
#include <stdarg.h>
#include <stddef.h> // ptrdiff_t on osx
#ifndef _MSC_VER
#ifdef __cplusplus
#define stbi_inline inline
#else
#define stbi_inline
#endif
#else
#define stbi_inline __forceinline
#endif
#ifdef _MSC_VER
typedef unsigned char stbi__uint8;
typedef unsigned short stbi__uint16;
typedef signed short stbi__int16;
typedef unsigned int stbi__uint32;
typedef signed int stbi__int32;
#else
#include <stdint.h>
typedef uint8_t stbi__uint8;
typedef uint16_t stbi__uint16;
typedef int16_t stbi__int16;
typedef uint32_t stbi__uint32;
typedef int32_t stbi__int32;
#endif
// should produce compiler error if size is wrong
typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
#ifdef _MSC_VER
#define STBI_NOTUSED(v) (void)(v)
#else
#define STBI_NOTUSED(v) (void)sizeof(v)
#endif
#ifdef _MSC_VER
#define STBI_HAS_LROTL
#endif
#ifdef STBI_HAS_LROTL
#define stbi_lrot(x,y) _lrotl(x,y)
#else
#define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
#endif
///////////////////////////////////////////////
//
// stbi struct and start_xxx functions
// stbi structure is our basic context used by all images, so it
// contains all the IO context, plus some basic image information
typedef struct
{
stbi__uint32 img_x, img_y;
int img_n, img_out_n;
stbi_io_callbacks io;
void *io_user_data;
int read_from_callbacks;
int buflen;
stbi__uint8 buffer_start[128];
stbi__uint8 *img_buffer, *img_buffer_end;
stbi__uint8 *img_buffer_original;
} stbi;
static void refill_buffer(stbi *s);
// initialize a memory-decode context
static void start_mem(stbi *s, stbi__uint8 const *buffer, int len)
{
s->io.read = NULL;
s->read_from_callbacks = 0;
s->img_buffer = s->img_buffer_original = (stbi__uint8 *) buffer;
s->img_buffer_end = (stbi__uint8 *) buffer+len;
}
// initialize a callback-based context
static void start_callbacks(stbi *s, stbi_io_callbacks *c, void *user)
{
s->io = *c;
s->io_user_data = user;
s->buflen = sizeof(s->buffer_start);
s->read_from_callbacks = 1;
s->img_buffer_original = s->buffer_start;
refill_buffer(s);
}
#ifndef STBI_NO_STDIO
static int stdio_read(void *user, char *data, int size)
{
return (int) fread(data,1,size,(FILE*) user);
}
static void stdio_skip(void *user, int n)
{
fseek((FILE*) user, n, SEEK_CUR);
}
static int stdio_eof(void *user)
{
return feof((FILE*) user);
}
static stbi_io_callbacks stbi_stdio_callbacks =
{
stdio_read,
stdio_skip,
stdio_eof,
};
static void start_file(stbi *s, FILE *f)
{
start_callbacks(s, &stbi_stdio_callbacks, (void *) f);
}
//static void stop_file(stbi *s) { }
#endif // !STBI_NO_STDIO
static void stbi_rewind(stbi *s)
{
// conceptually rewind SHOULD rewind to the beginning of the stream,
// but we just rewind to the beginning of the initial buffer, because
// we only use it after doing 'test', which only ever looks at at most 92 bytes
s->img_buffer = s->img_buffer_original;
}
static int stbi_jpeg_test(stbi *s);
static stbi_uc *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp);
static int stbi_png_test(stbi *s);
static stbi_uc *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_png_info(stbi *s, int *x, int *y, int *comp);
static int stbi_bmp_test(stbi *s);
static stbi_uc *stbi_bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_tga_test(stbi *s);
static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_tga_info(stbi *s, int *x, int *y, int *comp);
static int stbi_psd_test(stbi *s);
static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp);
#ifndef STBI_NO_HDR
static int stbi_hdr_test(stbi *s);
static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp);
#endif
static int stbi_pic_test(stbi *s);
static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_gif_test(stbi *s);
static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp);
static int stbi_gif_info(stbi *s, int *x, int *y, int *comp);
// this is not threadsafe
static const char *failure_reason;
const char *stbi_failure_reason(void)
{
return failure_reason;
}
static int e(const char *str)
{
failure_reason = str;
return 0;
}
// e - error
// epf - error returning pointer to float
// epuc - error returning pointer to unsigned char
#ifdef STBI_NO_FAILURE_STRINGS
#define e(x,y) 0
#elif defined(STBI_FAILURE_USERMSG)
#define e(x,y) e(y)
#else
#define e(x,y) e(x)
#endif
#define epf(x,y) ((float *) (e(x,y)?NULL:NULL))
#define epuc(x,y) ((unsigned char *) (e(x,y)?NULL:NULL))
void stbi_image_free(void *retval_from_stbi_load)
{
free(retval_from_stbi_load);
}
#ifndef STBI_NO_HDR
static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp);
#endif
static unsigned char *stbi_load_main(stbi *s, int *x, int *y, int *comp, int req_comp)
{
if (stbi_jpeg_test(s)) return stbi_jpeg_load(s,x,y,comp,req_comp);
if (stbi_png_test(s)) return stbi_png_load(s,x,y,comp,req_comp);
if (stbi_bmp_test(s)) return stbi_bmp_load(s,x,y,comp,req_comp);
if (stbi_gif_test(s)) return stbi_gif_load(s,x,y,comp,req_comp);
if (stbi_psd_test(s)) return stbi_psd_load(s,x,y,comp,req_comp);
if (stbi_pic_test(s)) return stbi_pic_load(s,x,y,comp,req_comp);
#ifndef STBI_NO_HDR
if (stbi_hdr_test(s)) {
float *hdr = stbi_hdr_load(s, x,y,comp,req_comp);
return hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
}
#endif
// test tga last because it's a crappy test!
if (stbi_tga_test(s))
return stbi_tga_load(s,x,y,comp,req_comp);
return epuc("unknown image type", "Image not of any known type, or corrupt");
}
#ifndef STBI_NO_STDIO
unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
{
FILE *f = fopen(filename, "rb");
unsigned char *result;
if (!f) return epuc("can't fopen", "Unable to open file");
result = stbi_load_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
}
unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
unsigned char *result;
stbi s;
start_file(&s,f);
result = stbi_load_main(&s,x,y,comp,req_comp);
if (result) {
// need to 'unget' all the characters in the IO buffer
fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
}
return result;
}
#endif //!STBI_NO_STDIO
unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
stbi s;
start_mem(&s,buffer,len);
return stbi_load_main(&s,x,y,comp,req_comp);
}
unsigned char *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi s;
start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
return stbi_load_main(&s,x,y,comp,req_comp);
}
#ifndef STBI_NO_HDR
float *stbi_loadf_main(stbi *s, int *x, int *y, int *comp, int req_comp)
{
unsigned char *data;
#ifndef STBI_NO_HDR
if (stbi_hdr_test(s))
return stbi_hdr_load(s,x,y,comp,req_comp);
#endif
data = stbi_load_main(s, x, y, comp, req_comp);
if (data)
return ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
return epf("unknown image type", "Image not of any known type, or corrupt");
}
float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
stbi s;
start_mem(&s,buffer,len);
return stbi_loadf_main(&s,x,y,comp,req_comp);
}
float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi s;
start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
return stbi_loadf_main(&s,x,y,comp,req_comp);
}
#ifndef STBI_NO_STDIO
float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
{
FILE *f = fopen(filename, "rb");
float *result;
if (!f) return epf("can't fopen", "Unable to open file");
result = stbi_loadf_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
}
float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
stbi s;
start_file(&s,f);
return stbi_loadf_main(&s,x,y,comp,req_comp);
}
#endif // !STBI_NO_STDIO
#endif // !STBI_NO_HDR
// these is-hdr-or-not is defined independent of whether STBI_NO_HDR is
// defined, for API simplicity; if STBI_NO_HDR is defined, it always
// reports false!
int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
{
#ifndef STBI_NO_HDR
stbi s;
start_mem(&s,buffer,len);
return stbi_hdr_test(&s);
#else
STBI_NOTUSED(buffer);
STBI_NOTUSED(len);
return 0;
#endif
}
#ifndef STBI_NO_STDIO
extern int stbi_is_hdr (char const *filename)
{
FILE *f = fopen(filename, "rb");
int result=0;
if (f) {
result = stbi_is_hdr_from_file(f);
fclose(f);
}
return result;
}
extern int stbi_is_hdr_from_file(FILE *f)
{
#ifndef STBI_NO_HDR
stbi s;
start_file(&s,f);
return stbi_hdr_test(&s);
#else
return 0;
#endif
}
#endif // !STBI_NO_STDIO
extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)
{
#ifndef STBI_NO_HDR
stbi s;
start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
return stbi_hdr_test(&s);
#else
return 0;
#endif
}
#ifndef STBI_NO_HDR
static float h2l_gamma_i=1.0f/2.2f, h2l_scale_i=1.0f;
static float l2h_gamma=2.2f, l2h_scale=1.0f;
void stbi_hdr_to_ldr_gamma(float gamma) { h2l_gamma_i = 1/gamma; }
void stbi_hdr_to_ldr_scale(float scale) { h2l_scale_i = 1/scale; }
void stbi_ldr_to_hdr_gamma(float gamma) { l2h_gamma = gamma; }
void stbi_ldr_to_hdr_scale(float scale) { l2h_scale = scale; }
#endif
//////////////////////////////////////////////////////////////////////////////
//
// Common code used by all image loaders
//
enum
{
SCAN_load=0,
SCAN_type,
SCAN_header
};
static void refill_buffer(stbi *s)
{
int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
if (n == 0) {
// at end of file, treat same as if from memory, but need to handle case
// where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
s->read_from_callbacks = 0;
s->img_buffer = s->buffer_start;
s->img_buffer_end = s->buffer_start+1;
*s->img_buffer = 0;
} else {
s->img_buffer = s->buffer_start;
s->img_buffer_end = s->buffer_start + n;
}
}
stbi_inline static int get8(stbi *s)
{
if (s->img_buffer < s->img_buffer_end)
return *s->img_buffer++;
if (s->read_from_callbacks) {
refill_buffer(s);
return *s->img_buffer++;
}
return 0;
}
stbi_inline static int at_eof(stbi *s)
{
if (s->io.read) {
if (!(s->io.eof)(s->io_user_data)) return 0;
// if feof() is true, check if buffer = end
// special case: we've only got the special 0 character at the end
if (s->read_from_callbacks == 0) return 1;
}
return s->img_buffer >= s->img_buffer_end;
}
stbi_inline static stbi__uint8 get8u(stbi *s)
{
return (stbi__uint8) get8(s);
}
static void skip(stbi *s, int n)
{
if (s->io.read) {
int blen = (int) (s->img_buffer_end - s->img_buffer);
if (blen < n) {
s->img_buffer = s->img_buffer_end;
(s->io.skip)(s->io_user_data, n - blen);
return;
}
}
s->img_buffer += n;
}
static int getn(stbi *s, stbi_uc *buffer, int n)
{
if (s->io.read) {
int blen = (int) (s->img_buffer_end - s->img_buffer);
if (blen < n) {
int res, count;
memcpy(buffer, s->img_buffer, blen);
count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
res = (count == (n-blen));
s->img_buffer = s->img_buffer_end;
return res;
}
}
if (s->img_buffer+n <= s->img_buffer_end) {
memcpy(buffer, s->img_buffer, n);
s->img_buffer += n;
return 1;
} else
return 0;
}
static int get16(stbi *s)
{
int z = get8(s);
return (z << 8) + get8(s);
}
static stbi__uint32 get32(stbi *s)
{
stbi__uint32 z = get16(s);
return (z << 16) + get16(s);
}
static int get16le(stbi *s)
{
int z = get8(s);
return z + (get8(s) << 8);
}
static stbi__uint32 get32le(stbi *s)
{
stbi__uint32 z = get16le(s);
return z + (get16le(s) << 16);
}
//////////////////////////////////////////////////////////////////////////////
//
// generic converter from built-in img_n to req_comp
// individual types do this automatically as much as possible (e.g. jpeg
// does all cases internally since it needs to colorspace convert anyway,
// and it never has alpha, so very few cases ). png can automatically
// interleave an alpha=255 channel, but falls back to this for other cases
//
// assume data buffer is malloced, so malloc a new one and free that one
// only failure mode is malloc failing
static stbi__uint8 compute_y(int r, int g, int b)
{
return (stbi__uint8) (((r*77) + (g*150) + (29*b)) >> 8);
}
static unsigned char *convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)
{
int i,j;
unsigned char *good;
if (req_comp == img_n) return data;
assert(req_comp >= 1 && req_comp <= 4);
good = (unsigned char *) malloc(req_comp * x * y);
if (good == NULL) {
free(data);
return epuc("outofmem", "Out of memory");
}
for (j=0; j < (int) y; ++j) {
unsigned char *src = data + j * x * img_n ;
unsigned char *dest = good + j * x * req_comp;
#define COMBO(a,b) ((a)*8+(b))
#define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
// convert source image with img_n components to one with req_comp components;
// avoid switch per pixel, so use switch per scanline and massive macros
switch (COMBO(img_n, req_comp)) {
CASE(1,2) (void)(dest[0]=src[0]), dest[1]=255; break;
CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;
CASE(1,4) (void)(dest[0]=dest[1]=dest[2]=src[0]), dest[3]=255; break;
CASE(2,1) dest[0]=src[0]; break;
CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;
CASE(2,4) (void)(dest[0]=dest[1]=dest[2]=src[0]), dest[3]=src[1]; break;
CASE(3,4) (void)(dest[0]=src[0]),(void)(dest[1]=src[1]),(void)(dest[2]=src[2]),dest[3]=255; break;
CASE(3,1) dest[0]=compute_y(src[0],src[1],src[2]); break;
CASE(3,2) (void)(dest[0]=compute_y(src[0],src[1],src[2])), dest[1] = 255; break;
CASE(4,1) dest[0]=compute_y(src[0],src[1],src[2]); break;
CASE(4,2) (void)(dest[0]=compute_y(src[0],src[1],src[2])), dest[1] = src[3]; break;
CASE(4,3) (void)(dest[0]=src[0]),(void)(dest[1]=src[1]),dest[2]=src[2]; break;
default: assert(0);
}
#undef CASE
}
free(data);
return good;
}
#ifndef STBI_NO_HDR
static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
{
int i,k,n;
float *output = (float *) malloc(x * y * comp * sizeof(float));
if (output == NULL) { free(data); return epf("outofmem", "Out of memory"); }
// compute number of non-alpha components
if (comp & 1) n = comp; else n = comp-1;
for (i=0; i < x*y; ++i) {
for (k=0; k < n; ++k) {
output[i*comp + k] = (float) pow(data[i*comp+k]/255.0f, l2h_gamma) * l2h_scale;
}
if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
}
free(data);
return output;
}
#define float2int(x) ((int) (x))
static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp)
{
int i,k,n;
stbi_uc *output = (stbi_uc *) malloc(x * y * comp);
if (output == NULL) { free(data); return epuc("outofmem", "Out of memory"); }
// compute number of non-alpha components
if (comp & 1) n = comp; else n = comp-1;
for (i=0; i < x*y; ++i) {
for (k=0; k < n; ++k) {
float z = (float) pow(data[i*comp+k]*h2l_scale_i, h2l_gamma_i) * 255 + 0.5f;
if (z < 0) z = 0;
if (z > 255) z = 255;
output[i*comp + k] = (stbi__uint8) float2int(z);
}
if (k < comp) {
float z = data[i*comp+k] * 255 + 0.5f;
if (z < 0) z = 0;
if (z > 255) z = 255;
output[i*comp + k] = (stbi__uint8) float2int(z);
}
}
free(data);
return output;
}
#endif
//////////////////////////////////////////////////////////////////////////////
//
// "baseline" JPEG/JFIF decoder (not actually fully baseline implementation)
//
// simple implementation
// - channel subsampling of at most 2 in each dimension
// - doesn't support delayed output of y-dimension
// - simple interface (only one output format: 8-bit interleaved RGB)
// - doesn't try to recover corrupt jpegs
// - doesn't allow partial loading, loading multiple at once
// - still fast on x86 (copying globals into locals doesn't help x86)
// - allocates lots of intermediate memory (full size of all components)
// - non-interleaved case requires this anyway
// - allows good upsampling (see next)
// high-quality
// - upsampled channels are bilinearly interpolated, even across blocks
// - quality integer IDCT derived from IJG's 'slow'
// performance
// - fast huffman; reasonable integer IDCT
// - uses a lot of intermediate memory, could cache poorly
// - load http://nothings.org/remote/anemones.jpg 3 times on 2.8Ghz P4
// stb_jpeg: 1.34 seconds (MSVC6, default release build)
// stb_jpeg: 1.06 seconds (MSVC6, processor = Pentium Pro)
// IJL11.dll: 1.08 seconds (compiled by intel)
// IJG 1998: 0.98 seconds (MSVC6, makefile provided by IJG)
// IJG 1998: 0.95 seconds (MSVC6, makefile + proc=PPro)
// huffman decoding acceleration
#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
typedef struct
{
stbi__uint8 fast[1 << FAST_BITS];
// weirdly, repacking this into AoS is a 10% speed loss, instead of a win
stbi__uint16 code[256];
stbi__uint8 values[256];
stbi__uint8 size[257];
unsigned int maxcode[18];
int delta[17]; // old 'firstsymbol' - old 'firstcode'
} huffman;
typedef struct
{
#ifdef STBI_SIMD
unsigned short dequant2[4][64];
#endif
stbi *s;
huffman huff_dc[4];
huffman huff_ac[4];
stbi__uint8 dequant[4][64];
// sizes for components, interleaved MCUs
int img_h_max, img_v_max;
int img_mcu_x, img_mcu_y;
int img_mcu_w, img_mcu_h;
// definition of jpeg image component
struct
{
int id;
int h,v;
int tq;
int hd,ha;
int dc_pred;
int x,y,w2,h2;
stbi__uint8 *data;
void *raw_data;
stbi__uint8 *linebuf;
} img_comp[4];
stbi__uint32 code_buffer; // jpeg entropy-coded buffer
int code_bits; // number of valid bits
unsigned char marker; // marker seen while filling entropy buffer
int nomore; // flag if we saw a marker so must stop
int scan_n, order[4];
int restart_interval, todo;
} jpeg;
static int build_huffman(huffman *h, int *count)
{
int i,j,k=0,code;
// build size list for each symbol (from JPEG spec)
for (i=0; i < 16; ++i)
for (j=0; j < count[i]; ++j)
h->size[k++] = (stbi__uint8) (i+1);
h->size[k] = 0;
// compute actual symbols (from jpeg spec)
code = 0;
k = 0;
for(j=1; j <= 16; ++j) {
// compute delta to add to code to compute symbol id
h->delta[j] = k - code;
if (h->size[k] == j) {
while (h->size[k] == j)
h->code[k++] = (stbi__uint16) (code++);
if (code-1 >= (1 << j)) return e("bad code lengths","Corrupt JPEG");
}
// compute largest code + 1 for this size, preshifted as needed later
h->maxcode[j] = code << (16-j);
code <<= 1;
}
h->maxcode[j] = 0xffffffff;
// build non-spec acceleration table; 255 is flag for not-accelerated
memset(h->fast, 255, 1 << FAST_BITS);
for (i=0; i < k; ++i) {
int s = h->size[i];
if (s <= FAST_BITS) {
int c = h->code[i] << (FAST_BITS-s);
int m = 1 << (FAST_BITS-s);
for (j=0; j < m; ++j) {
h->fast[c+j] = (stbi__uint8) i;
}
}
}
return 1;
}
static void grow_buffer_unsafe(jpeg *j)
{
do {
int b = j->nomore ? 0 : get8(j->s);
if (b == 0xff) {
int c = get8(j->s);
if (c != 0) {
j->marker = (unsigned char) c;
j->nomore = 1;
return;
}
}
j->code_buffer |= b << (24 - j->code_bits);
j->code_bits += 8;
} while (j->code_bits <= 24);
}
// (1 << n) - 1
static stbi__uint32 bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
// decode a jpeg huffman value from the bitstream
stbi_inline static int decode(jpeg *j, huffman *h)
{
unsigned int temp;
int c,k;
if (j->code_bits < 16) grow_buffer_unsafe(j);
// look at the top FAST_BITS and determine what symbol ID it is,
// if the code is <= FAST_BITS
c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
k = h->fast[c];
if (k < 255) {
int s = h->size[k];
if (s > j->code_bits)
return -1;
j->code_buffer <<= s;
j->code_bits -= s;
return h->values[k];
}
// naive test is to shift the code_buffer down so k bits are
// valid, then test against maxcode. To speed this up, we've
// preshifted maxcode left so that it has (16-k) 0s at the
// end; in other words, regardless of the number of bits, it
// wants to be compared against something shifted to have 16;
// that way we don't need to shift inside the loop.
temp = j->code_buffer >> 16;
for (k=FAST_BITS+1 ; ; ++k)
if (temp < h->maxcode[k])
break;
if (k == 17) {
// error! code not found
j->code_bits -= 16;
return -1;
}
if (k > j->code_bits)
return -1;
// convert the huffman code to the symbol id
c = ((j->code_buffer >> (32 - k)) & bmask[k]) + h->delta[k];
assert((((j->code_buffer) >> (32 - h->size[c])) & bmask[h->size[c]]) == h->code[c]);
// convert the id to a symbol
j->code_bits -= k;
j->code_buffer <<= k;
return h->values[c];
}
// combined JPEG 'receive' and JPEG 'extend', since baseline
// always extends everything it receives.
stbi_inline static int extend_receive(jpeg *j, int n)
{
unsigned int m = 1 << (n-1);
unsigned int k;
if (j->code_bits < n) grow_buffer_unsafe(j);
#if 1
k = stbi_lrot(j->code_buffer, n);
j->code_buffer = k & ~bmask[n];
k &= bmask[n];
j->code_bits -= n;
#else
k = (j->code_buffer >> (32 - n)) & bmask[n];
j->code_bits -= n;
j->code_buffer <<= n;
#endif
// the following test is probably a random branch that won't
// predict well. I tried to table accelerate it but failed.
// maybe it's compiling as a conditional move?
if (k < m)
return (-1 << n) + k + 1;
else
return k;
}
// given a value that's at position X in the zigzag stream,
// where does it appear in the 8x8 matrix coded as row-major?
static stbi__uint8 dezigzag[64+15] =
{
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34,
27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36,
29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46,
53, 60, 61, 54, 47, 55, 62, 63,
// let corrupt input sample past end
63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63
};
// decode one 64-entry block--
static int decode_block(jpeg *j, short data[64], huffman *hdc, huffman *hac, int b)
{
int diff,dc,k;
int t = decode(j, hdc);
if (t < 0) return e("bad huffman code","Corrupt JPEG");
// 0 all the ac values now so we can do it 32-bits at a time
memset(data,0,64*sizeof(data[0]));
diff = t ? extend_receive(j, t) : 0;
dc = j->img_comp[b].dc_pred + diff;
j->img_comp[b].dc_pred = dc;
data[0] = (short) dc;
// decode AC components, see JPEG spec
k = 1;
do {
int r,s;
int rs = decode(j, hac);
if (rs < 0) return e("bad huffman code","Corrupt JPEG");
s = rs & 15;
r = rs >> 4;
if (s == 0) {
if (rs != 0xf0) break; // end block
k += 16;
} else {
k += r;
// decode into unzigzag'd location
data[dezigzag[k++]] = (short) extend_receive(j,s);
}
} while (k < 64);
return 1;
}
// take a -128..127 value and clamp it and convert to 0..255
stbi_inline static stbi__uint8 clamp(int x)
{
// trick to use a single test to catch both cases
if ((unsigned int) x > 255) {
if (x < 0) return 0;
if (x > 255) return 255;
}
return (stbi__uint8) x;
}
#define f2f(x) (int) (((x) * 4096 + 0.5))
#define fsh(x) ((x) << 12)
// derived from jidctint -- DCT_ISLOW
#define IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
p2 = s2; \
p3 = s6; \
p1 = (p2+p3) * f2f(0.5411961f); \
t2 = p1 + p3*f2f(-1.847759065f); \
t3 = p1 + p2*f2f( 0.765366865f); \
p2 = s0; \
p3 = s4; \
t0 = fsh(p2+p3); \
t1 = fsh(p2-p3); \
x0 = t0+t3; \
x3 = t0-t3; \
x1 = t1+t2; \
x2 = t1-t2; \
t0 = s7; \
t1 = s5; \
t2 = s3; \
t3 = s1; \
p3 = t0+t2; \
p4 = t1+t3; \
p1 = t0+t3; \
p2 = t1+t2; \
p5 = (p3+p4)*f2f( 1.175875602f); \
t0 = t0*f2f( 0.298631336f); \
t1 = t1*f2f( 2.053119869f); \
t2 = t2*f2f( 3.072711026f); \
t3 = t3*f2f( 1.501321110f); \
p1 = p5 + p1*f2f(-0.899976223f); \
p2 = p5 + p2*f2f(-2.562915447f); \
p3 = p3*f2f(-1.961570560f); \
p4 = p4*f2f(-0.390180644f); \
t3 += p1+p4; \
t2 += p2+p3; \
t1 += p2+p4; \
t0 += p1+p3;
#ifdef STBI_SIMD
typedef unsigned short stbi_dequantize_t;
#else
typedef stbi__uint8 stbi_dequantize_t;
#endif
// .344 seconds on 3*anemones.jpg
static void idct_block(stbi__uint8 *out, int out_stride, short data[64], stbi_dequantize_t *dequantize)
{
int i,val[64],*v=val;
stbi_dequantize_t *dq = dequantize;
stbi__uint8 *o;
short *d = data;
// columns
for (i=0; i < 8; ++i,++d,++dq, ++v) {
// if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
&& d[40]==0 && d[48]==0 && d[56]==0) {
// no shortcut 0 seconds
// (1|2|3|4|5|6|7)==0 0 seconds
// all separate -0.047 seconds
// 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
int dcterm = d[0] * dq[0] << 2;
v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
} else {
IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24],
d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56])
// constants scaled things up by 1<<12; let's bring them back
// down, but keep 2 extra bits of precision
x0 += 512; x1 += 512; x2 += 512; x3 += 512;
v[ 0] = (x0+t3) >> 10;
v[56] = (x0-t3) >> 10;
v[ 8] = (x1+t2) >> 10;
v[48] = (x1-t2) >> 10;
v[16] = (x2+t1) >> 10;
v[40] = (x2-t1) >> 10;
v[24] = (x3+t0) >> 10;
v[32] = (x3-t0) >> 10;
}
}
for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
// no fast case since the first 1D IDCT spread components out
IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])
// constants scaled things up by 1<<12, plus we had 1<<2 from first
// loop, plus horizontal and vertical each scale by sqrt(8) so together
// we've got an extra 1<<3, so 1<<17 total we need to remove.
// so we want to round that, which means adding 0.5 * 1<<17,
// aka 65536. Also, we'll end up with -128 to 127 that we want
// to encode as 0..255 by adding 128, so we'll add that before the shift
x0 += 65536 + (128<<17);
x1 += 65536 + (128<<17);
x2 += 65536 + (128<<17);
x3 += 65536 + (128<<17);
// tried computing the shifts into temps, or'ing the temps to see
// if any were out of range, but that was slower
o[0] = clamp((x0+t3) >> 17);
o[7] = clamp((x0-t3) >> 17);
o[1] = clamp((x1+t2) >> 17);
o[6] = clamp((x1-t2) >> 17);
o[2] = clamp((x2+t1) >> 17);
o[5] = clamp((x2-t1) >> 17);
o[3] = clamp((x3+t0) >> 17);
o[4] = clamp((x3-t0) >> 17);
}
}
#ifdef STBI_SIMD
static stbi_idct_8x8 stbi_idct_installed = idct_block;
void stbi_install_idct(stbi_idct_8x8 func)
{
stbi_idct_installed = func;
}
#endif
#define MARKER_none 0xff
// if there's a pending marker from the entropy stream, return that
// otherwise, fetch from the stream and get a marker. if there's no
// marker, return 0xff, which is never a valid marker value
static stbi__uint8 get_marker(jpeg *j)
{
stbi__uint8 x;
if (j->marker != MARKER_none) { x = j->marker; j->marker = MARKER_none; return x; }
x = get8u(j->s);
if (x != 0xff) return MARKER_none;
while (x == 0xff)
x = get8u(j->s);
return x;
}
// in each scan, we'll have scan_n components, and the order
// of the components is specified by order[]
#define RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
// after a restart interval, reset the entropy decoder and
// the dc prediction
static void reset(jpeg *j)
{
j->code_bits = 0;
j->code_buffer = 0;
j->nomore = 0;
j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;
j->marker = MARKER_none;
j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
// no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
// since we don't even allow 1<<30 pixels
}
static int parse_entropy_coded_data(jpeg *z)
{
reset(z);
if (z->scan_n == 1) {
int i,j;
#ifdef STBI_SIMD
__declspec(align(16))
#endif
short data[64];
int n = z->order[0];
// non-interleaved data, we just need to process one block at a time,
// in trivial scanline order
// number of blocks to do just depends on how many actual "pixels" this
// component has, independent of interleaved MCU blocking and such
int w = (z->img_comp[n].x+7) >> 3;
int h = (z->img_comp[n].y+7) >> 3;
for (j=0; j < h; ++j) {
for (i=0; i < w; ++i) {
if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
#ifdef STBI_SIMD
stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
#else
idct_block(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
#endif
// every data block is an MCU, so countdown the restart interval
if (--z->todo <= 0) {
if (z->code_bits < 24) grow_buffer_unsafe(z);
// if it's NOT a restart, then just bail, so we get corrupt data
// rather than no data
if (!RESTART(z->marker)) return 1;
reset(z);
}
}
}
} else { // interleaved!
int i,j,k,x,y;
short data[64];
for (j=0; j < z->img_mcu_y; ++j) {
for (i=0; i < z->img_mcu_x; ++i) {
// scan an interleaved mcu... process scan_n components in order
for (k=0; k < z->scan_n; ++k) {
int n = z->order[k];
// scan out an mcu's worth of this component; that's just determined
// by the basic H and V specified for the component
for (y=0; y < z->img_comp[n].v; ++y) {
for (x=0; x < z->img_comp[n].h; ++x) {
int x2 = (i*z->img_comp[n].h + x)*8;
int y2 = (j*z->img_comp[n].v + y)*8;
if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
#ifdef STBI_SIMD
stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
#else
idct_block(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
#endif
}
}
}
// after all interleaved components, that's an interleaved MCU,
// so now count down the restart interval
if (--z->todo <= 0) {
if (z->code_bits < 24) grow_buffer_unsafe(z);
// if it's NOT a restart, then just bail, so we get corrupt data
// rather than no data
if (!RESTART(z->marker)) return 1;
reset(z);
}
}
}
}
return 1;
}
static int process_marker(jpeg *z, int m)
{
int L;
switch (m) {
case MARKER_none: // no marker found
return e("expected marker","Corrupt JPEG");
case 0xC2: // SOF - progressive
return e("progressive jpeg","JPEG format not supported (progressive)");
case 0xDD: // DRI - specify restart interval
if (get16(z->s) != 4) return e("bad DRI len","Corrupt JPEG");
z->restart_interval = get16(z->s);
return 1;
case 0xDB: // DQT - define quantization table
L = get16(z->s)-2;
while (L > 0) {
int q = get8(z->s);
int p = q >> 4;
int t = q & 15,i;
if (p != 0) return e("bad DQT type","Corrupt JPEG");
if (t > 3) return e("bad DQT table","Corrupt JPEG");
for (i=0; i < 64; ++i)
z->dequant[t][dezigzag[i]] = get8u(z->s);
#ifdef STBI_SIMD
for (i=0; i < 64; ++i)
z->dequant2[t][i] = z->dequant[t][i];
#endif
L -= 65;
}
return L==0;
case 0xC4: // DHT - define huffman table
L = get16(z->s)-2;
while (L > 0) {
stbi__uint8 *v;
int sizes[16],i,n=0;
int q = get8(z->s);
int tc = q >> 4;
int th = q & 15;
if (tc > 1 || th > 3) return e("bad DHT header","Corrupt JPEG");
for (i=0; i < 16; ++i) {
sizes[i] = get8(z->s);
n += sizes[i];
}
L -= 17;
if (tc == 0) {
if (!build_huffman(z->huff_dc+th, sizes)) return 0;
v = z->huff_dc[th].values;
} else {
if (!build_huffman(z->huff_ac+th, sizes)) return 0;
v = z->huff_ac[th].values;
}
for (i=0; i < n; ++i)
v[i] = get8u(z->s);
L -= n;
}
return L==0;
}
// check for comment block or APP blocks
if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
skip(z->s, get16(z->s)-2);
return 1;
}
return 0;
}
// after we see SOS
static int process_scan_header(jpeg *z)
{
int i;
int Ls = get16(z->s);
z->scan_n = get8(z->s);
if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return e("bad SOS component count","Corrupt JPEG");
if (Ls != 6+2*z->scan_n) return e("bad SOS len","Corrupt JPEG");
for (i=0; i < z->scan_n; ++i) {
int id = get8(z->s), which;
int q = get8(z->s);
for (which = 0; which < z->s->img_n; ++which)
if (z->img_comp[which].id == id)
break;
if (which == z->s->img_n) return 0;
z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return e("bad DC huff","Corrupt JPEG");
z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return e("bad AC huff","Corrupt JPEG");
z->order[i] = which;
}
if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG");
get8(z->s); // should be 63, but might be 0
if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG");
return 1;
}
static int process_frame_header(jpeg *z, int scan)
{
stbi *s = z->s;
int Lf,p,i,q, h_max=1,v_max=1,c;
Lf = get16(s); if (Lf < 11) return e("bad SOF len","Corrupt JPEG"); // JPEG
p = get8(s); if (p != 8) return e("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
s->img_y = get16(s); if (s->img_y == 0) return e("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
s->img_x = get16(s); if (s->img_x == 0) return e("0 width","Corrupt JPEG"); // JPEG requires
c = get8(s);
if (c != 3 && c != 1) return e("bad component count","Corrupt JPEG"); // JFIF requires
s->img_n = c;
for (i=0; i < c; ++i) {
z->img_comp[i].data = NULL;
z->img_comp[i].linebuf = NULL;
}
if (Lf != 8+3*s->img_n) return e("bad SOF len","Corrupt JPEG");
for (i=0; i < s->img_n; ++i) {
z->img_comp[i].id = get8(s);
if (z->img_comp[i].id != i+1) // JFIF requires
if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files!
return e("bad component ID","Corrupt JPEG");
q = get8(s);
z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return e("bad H","Corrupt JPEG");
z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return e("bad V","Corrupt JPEG");
z->img_comp[i].tq = get8(s); if (z->img_comp[i].tq > 3) return e("bad TQ","Corrupt JPEG");
}
if (scan != SCAN_load) return 1;
if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode");
for (i=0; i < s->img_n; ++i) {
if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
}
// compute interleaved mcu info
z->img_h_max = h_max;
z->img_v_max = v_max;
z->img_mcu_w = h_max * 8;
z->img_mcu_h = v_max * 8;
z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
for (i=0; i < s->img_n; ++i) {
// number of effective pixels (e.g. for non-interleaved MCU)
z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
// to simplify generation, we'll allocate enough memory to decode
// the bogus oversized data from using interleaved MCUs and their
// big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
// discard the extra data until colorspace conversion
z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
if (z->img_comp[i].raw_data == NULL) {
for(--i; i >= 0; --i) {
free(z->img_comp[i].raw_data);
z->img_comp[i].data = NULL;
}
return e("outofmem", "Out of memory");
}
// align blocks for installable-idct using mmx/sse
z->img_comp[i].data = (stbi__uint8*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
z->img_comp[i].linebuf = NULL;
}
return 1;
}
// use comparisons since in some cases we handle more than one case (e.g. SOF)
#define DNL(x) ((x) == 0xdc)
#define SOI(x) ((x) == 0xd8)
#define EOI(x) ((x) == 0xd9)
#define SOF(x) ((x) == 0xc0 || (x) == 0xc1)
#define SOS(x) ((x) == 0xda)
static int decode_jpeg_header(jpeg *z, int scan)
{
int m;
z->marker = MARKER_none; // initialize cached marker to empty
m = get_marker(z);
if (!SOI(m)) return e("no SOI","Corrupt JPEG");
if (scan == SCAN_type) return 1;
m = get_marker(z);
while (!SOF(m)) {
if (!process_marker(z,m)) return 0;
m = get_marker(z);
while (m == MARKER_none) {
// some files have extra padding after their blocks, so ok, we'll scan
if (at_eof(z->s)) return e("no SOF", "Corrupt JPEG");
m = get_marker(z);
}
}
if (!process_frame_header(z, scan)) return 0;
return 1;
}
static int decode_jpeg_image(jpeg *j)
{
int m;
j->restart_interval = 0;
if (!decode_jpeg_header(j, SCAN_load)) return 0;
m = get_marker(j);
while (!EOI(m)) {
if (SOS(m)) {
if (!process_scan_header(j)) return 0;
if (!parse_entropy_coded_data(j)) return 0;
if (j->marker == MARKER_none ) {
// handle 0s at the end of image data from IP Kamera 9060
while (!at_eof(j->s)) {
int x = get8(j->s);
if (x == 255) {
j->marker = get8u(j->s);
break;
} else if (x != 0) {
return 0;
}
}
// if we reach eof without hitting a marker, get_marker() below will fail and we'll eventually return 0
}
} else {
if (!process_marker(j, m)) return 0;
}
m = get_marker(j);
}
return 1;
}
// static jfif-centered resampling (across block boundaries)
typedef stbi__uint8 *(*resample_row_func)(stbi__uint8 *out, stbi__uint8 *in0, stbi__uint8 *in1,
int w, int hs);
#define div4(x) ((stbi__uint8) ((x) >> 2))
static stbi__uint8 *resample_row_1(stbi__uint8 *out, stbi__uint8 *in_near, stbi__uint8 *in_far, int w, int hs)
{
STBI_NOTUSED(out);
STBI_NOTUSED(in_far);
STBI_NOTUSED(w);
STBI_NOTUSED(hs);
return in_near;
}
static stbi__uint8* resample_row_v_2(stbi__uint8 *out, stbi__uint8 *in_near, stbi__uint8 *in_far, int w, int hs)
{
// need to generate two samples vertically for every one in input
int i;
STBI_NOTUSED(hs);
for (i=0; i < w; ++i)
out[i] = div4(3*in_near[i] + in_far[i] + 2);
return out;
}
static stbi__uint8* resample_row_h_2(stbi__uint8 *out, stbi__uint8 *in_near, stbi__uint8 *in_far, int w, int hs)
{
// need to generate two samples horizontally for every one in input
int i;
stbi__uint8 *input = in_near;
if (w == 1) {
// if only one sample, can't do any interpolation
out[0] = out[1] = input[0];
return out;
}
out[0] = input[0];
out[1] = div4(input[0]*3 + input[1] + 2);
for (i=1; i < w-1; ++i) {
int n = 3*input[i]+2;
out[i*2+0] = div4(n+input[i-1]);
out[i*2+1] = div4(n+input[i+1]);
}
out[i*2+0] = div4(input[w-2]*3 + input[w-1] + 2);
out[i*2+1] = input[w-1];
STBI_NOTUSED(in_far);
STBI_NOTUSED(hs);
return out;
}
#define div16(x) ((stbi__uint8) ((x) >> 4))
static stbi__uint8 *resample_row_hv_2(stbi__uint8 *out, stbi__uint8 *in_near, stbi__uint8 *in_far, int w, int hs)
{
// need to generate 2x2 samples for every one in input
int i,t0,t1;
if (w == 1) {
out[0] = out[1] = div4(3*in_near[0] + in_far[0] + 2);
return out;
}
t1 = 3*in_near[0] + in_far[0];
out[0] = div4(t1+2);
for (i=1; i < w; ++i) {
t0 = t1;
t1 = 3*in_near[i]+in_far[i];
out[i*2-1] = div16(3*t0 + t1 + 8);
out[i*2 ] = div16(3*t1 + t0 + 8);
}
out[w*2-1] = div4(t1+2);
STBI_NOTUSED(hs);
return out;
}
static stbi__uint8 *resample_row_generic(stbi__uint8 *out, stbi__uint8 *in_near, stbi__uint8 *in_far, int w, int hs)
{
// resample with nearest-neighbor
int i,j;
STBI_NOTUSED(in_far);
for (i=0; i < w; ++i)
for (j=0; j < hs; ++j)
out[i*hs+j] = in_near[i];
return out;
}
#define float2fixed(x) ((int) ((x) * 65536 + 0.5))
// 0.38 seconds on 3*anemones.jpg (0.25 with processor = Pro)
// VC6 without processor=Pro is generating multiple LEAs per multiply!
static void YCbCr_to_RGB_row(stbi__uint8 *out, const stbi__uint8 *y, const stbi__uint8 *pcb, const stbi__uint8 *pcr, int count, int step)
{
int i;
for (i=0; i < count; ++i) {
int y_fixed = (y[i] << 16) + 32768; // rounding
int r,g,b;
int cr = pcr[i] - 128;
int cb = pcb[i] - 128;
r = y_fixed + cr*float2fixed(1.40200f);
g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f);
b = y_fixed + cb*float2fixed(1.77200f);
r >>= 16;
g >>= 16;
b >>= 16;
if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
out[0] = (stbi__uint8)r;
out[1] = (stbi__uint8)g;
out[2] = (stbi__uint8)b;
out[3] = 255;
out += step;
}
}
#ifdef STBI_SIMD
static stbi_YCbCr_to_RGB_run stbi_YCbCr_installed = YCbCr_to_RGB_row;
void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func)
{
stbi_YCbCr_installed = func;
}
#endif
// clean up the temporary component buffers
static void cleanup_jpeg(jpeg *j)
{
int i;
for (i=0; i < j->s->img_n; ++i) {
if (j->img_comp[i].data) {
free(j->img_comp[i].raw_data);
j->img_comp[i].data = NULL;
}
if (j->img_comp[i].linebuf) {
free(j->img_comp[i].linebuf);
j->img_comp[i].linebuf = NULL;
}
}
}
typedef struct
{
resample_row_func resample;
stbi__uint8 *line0,*line1;
int hs,vs; // expansion factor in each axis
int w_lores; // horizontal pixels pre-expansion
int ystep; // how far through vertical expansion we are
int ypos; // which pre-expansion row we're on
} stbi_resample;
static stbi__uint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
{
int n, decode_n;
// validate req_comp
if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error");
z->s->img_n = 0;
// load a jpeg image from whichever source
if (!decode_jpeg_image(z)) { cleanup_jpeg(z); return NULL; }
// determine actual number of components to generate
n = req_comp ? req_comp : z->s->img_n;
if (z->s->img_n == 3 && n < 3)
decode_n = 1;
else
decode_n = z->s->img_n;
// resample and color-convert
{
int k;
unsigned int i,j;
stbi__uint8 *output;
stbi__uint8 *coutput[4];
stbi_resample res_comp[4];
for (k=0; k < decode_n; ++k) {
stbi_resample *r = &res_comp[k];
// allocate line buffer big enough for upsampling off the edges
// with upsample factor of 4
z->img_comp[k].linebuf = (stbi__uint8 *) malloc(z->s->img_x + 3);
if (!z->img_comp[k].linebuf) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
r->hs = z->img_h_max / z->img_comp[k].h;
r->vs = z->img_v_max / z->img_comp[k].v;
r->ystep = r->vs >> 1;
r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
r->ypos = 0;
r->line0 = r->line1 = z->img_comp[k].data;
if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
else if (r->hs == 1 && r->vs == 2) r->resample = resample_row_v_2;
else if (r->hs == 2 && r->vs == 1) r->resample = resample_row_h_2;
else if (r->hs == 2 && r->vs == 2) r->resample = resample_row_hv_2;
else r->resample = resample_row_generic;
}
// can't error after this so, this is safe
output = (stbi__uint8 *) malloc(n * z->s->img_x * z->s->img_y + 1);
if (!output) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
// now go ahead and resample
for (j=0; j < z->s->img_y; ++j) {
stbi__uint8 *out = output + n * z->s->img_x * j;
for (k=0; k < decode_n; ++k) {
stbi_resample *r = &res_comp[k];
int y_bot = r->ystep >= (r->vs >> 1);
coutput[k] = r->resample(z->img_comp[k].linebuf,
y_bot ? r->line1 : r->line0,
y_bot ? r->line0 : r->line1,
r->w_lores, r->hs);
if (++r->ystep >= r->vs) {
r->ystep = 0;
r->line0 = r->line1;
if (++r->ypos < z->img_comp[k].y)
r->line1 += z->img_comp[k].w2;
}
}
if (n >= 3) {
stbi__uint8 *y = coutput[0];
if (z->s->img_n == 3) {
#ifdef STBI_SIMD
stbi_YCbCr_installed(out, y, coutput[1], coutput[2], z->s->img_x, n);
#else
YCbCr_to_RGB_row(out, y, coutput[1], coutput[2], z->s->img_x, n);
#endif
} else
for (i=0; i < z->s->img_x; ++i) {
out[0] = out[1] = out[2] = y[i];
out[3] = 255; // not used if n==3
out += n;
}
} else {
stbi__uint8 *y = coutput[0];
if (n == 1)
for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
else
for (i=0; i < z->s->img_x; ++i) (void)(*out++ = y[i]), *out++ = 255;
}
}
cleanup_jpeg(z);
*out_x = z->s->img_x;
*out_y = z->s->img_y;
if (comp) *comp = z->s->img_n; // report original components, not output
return output;
}
}
static unsigned char *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
jpeg j;
j.s = s;
return load_jpeg_image(&j, x,y,comp,req_comp);
}
static int stbi_jpeg_test(stbi *s)
{
int r;
jpeg j;
j.s = s;
r = decode_jpeg_header(&j, SCAN_type);
stbi_rewind(s);
return r;
}
static int stbi_jpeg_info_raw(jpeg *j, int *x, int *y, int *comp)
{
if (!decode_jpeg_header(j, SCAN_header)) {
stbi_rewind( j->s );
return 0;
}
if (x) *x = j->s->img_x;
if (y) *y = j->s->img_y;
if (comp) *comp = j->s->img_n;
return 1;
}
static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp)
{
jpeg j;
j.s = s;
return stbi_jpeg_info_raw(&j, x, y, comp);
}
// public domain zlib decode v0.2 Sean Barrett 2006-11-18
// simple implementation
// - all input must be provided in an upfront buffer
// - all output is written to a single output buffer (can malloc/realloc)
// performance
// - fast huffman
// fast-way is faster to check than jpeg huffman, but slow way is slower
#define ZFAST_BITS 9 // accelerate all cases in default tables
#define ZFAST_MASK ((1 << ZFAST_BITS) - 1)
// zlib-style huffman encoding
// (jpegs packs from left, zlib from right, so can't share code)
typedef struct
{
stbi__uint16 fast[1 << ZFAST_BITS];
stbi__uint16 firstcode[16];
int maxcode[17];
stbi__uint16 firstsymbol[16];
stbi__uint8 size[288];
stbi__uint16 value[288];
} zhuffman;
stbi_inline static int bitreverse16(int n)
{
n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
return n;
}
stbi_inline static int bit_reverse(int v, int bits)
{
assert(bits <= 16);
// to bit reverse n bits, reverse 16 and shift
// e.g. 11 bits, bit reverse and shift away 5
return bitreverse16(v) >> (16-bits);
}
static int zbuild_huffman(zhuffman *z, stbi__uint8 *sizelist, int num)
{
int i,k=0;
int code, next_code[16], sizes[17];
// DEFLATE spec for generating codes
memset(sizes, 0, sizeof(sizes));
memset(z->fast, 255, sizeof(z->fast));
for (i=0; i < num; ++i)
++sizes[sizelist[i]];
sizes[0] = 0;
for (i=1; i < 16; ++i)
assert(sizes[i] <= (1 << i));
code = 0;
for (i=1; i < 16; ++i) {
next_code[i] = code;
z->firstcode[i] = (stbi__uint16) code;
z->firstsymbol[i] = (stbi__uint16) k;
code = (code + sizes[i]);
if (sizes[i])
if (code-1 >= (1 << i)) return e("bad codelengths","Corrupt JPEG");
z->maxcode[i] = code << (16-i); // preshift for inner loop
code <<= 1;
k += sizes[i];
}
z->maxcode[16] = 0x10000; // sentinel
for (i=0; i < num; ++i) {
int s = sizelist[i];
if (s) {
int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
z->size[c] = (stbi__uint8)s;
z->value[c] = (stbi__uint16)i;
if (s <= ZFAST_BITS) {
int k = bit_reverse(next_code[s],s);
while (k < (1 << ZFAST_BITS)) {
z->fast[k] = (stbi__uint16) c;
k += (1 << s);
}
}
++next_code[s];
}
}
return 1;
}
// zlib-from-memory implementation for PNG reading
// because PNG allows splitting the zlib stream arbitrarily,
// and it's annoying structurally to have PNG call ZLIB call PNG,
// we require PNG read all the IDATs and combine them into a single
// memory buffer
typedef struct
{
stbi__uint8 *zbuffer, *zbuffer_end;
int num_bits;
stbi__uint32 code_buffer;
char *zout;
char *zout_start;
char *zout_end;
int z_expandable;
zhuffman z_length, z_distance;
} zbuf;
stbi_inline static int zget8(zbuf *z)
{
if (z->zbuffer >= z->zbuffer_end) return 0;
return *z->zbuffer++;
}
static void fill_bits(zbuf *z)
{
do {
assert(z->code_buffer < (1U << z->num_bits));
z->code_buffer |= zget8(z) << z->num_bits;
z->num_bits += 8;
} while (z->num_bits <= 24);
}
stbi_inline static unsigned int zreceive(zbuf *z, int n)
{
unsigned int k;
if (z->num_bits < n) fill_bits(z);
k = z->code_buffer & ((1 << n) - 1);
z->code_buffer >>= n;
z->num_bits -= n;
return k;
}
stbi_inline static int zhuffman_decode(zbuf *a, zhuffman *z)
{
int b,s,k;
if (a->num_bits < 16) fill_bits(a);
b = z->fast[a->code_buffer & ZFAST_MASK];
if (b < 0xffff) {
s = z->size[b];
a->code_buffer >>= s;
a->num_bits -= s;
return z->value[b];
}
// not resolved by fast table, so compute it the slow way
// use jpeg approach, which requires MSbits at top
k = bit_reverse(a->code_buffer, 16);
for (s=ZFAST_BITS+1; ; ++s)
if (k < z->maxcode[s])
break;
if (s == 16) return -1; // invalid code!
// code size is s, so:
b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
assert(z->size[b] == s);
a->code_buffer >>= s;
a->num_bits -= s;
return z->value[b];
}
static int expand(zbuf *z, int n) // need to make room for n bytes
{
char *q;
int cur, limit;
if (!z->z_expandable) return e("output buffer limit","Corrupt PNG");
cur = (int) (z->zout - z->zout_start);
limit = (int) (z->zout_end - z->zout_start);
while (cur + n > limit)
limit *= 2;
q = (char *) realloc(z->zout_start, limit);
if (q == NULL) return e("outofmem", "Out of memory");
z->zout_start = q;
z->zout = q + cur;
z->zout_end = q + limit;
return 1;
}
static int length_base[31] = {
3,4,5,6,7,8,9,10,11,13,
15,17,19,23,27,31,35,43,51,59,
67,83,99,115,131,163,195,227,258,0,0 };
static int length_extra[31]=
{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
static int dist_extra[32] =
{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
static int parse_huffman_block(zbuf *a)
{
for(;;) {
int z = zhuffman_decode(a, &a->z_length);
if (z < 256) {
if (z < 0) return e("bad huffman code","Corrupt PNG"); // error in huffman codes
if (a->zout >= a->zout_end) if (!expand(a, 1)) return 0;
*a->zout++ = (char) z;
} else {
stbi__uint8 *p;
int len,dist;
if (z == 256) return 1;
z -= 257;
len = length_base[z];
if (length_extra[z]) len += zreceive(a, length_extra[z]);
z = zhuffman_decode(a, &a->z_distance);
if (z < 0) return e("bad huffman code","Corrupt PNG");
dist = dist_base[z];
if (dist_extra[z]) dist += zreceive(a, dist_extra[z]);
if (a->zout - a->zout_start < dist) return e("bad dist","Corrupt PNG");
if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0;
p = (stbi__uint8 *) (a->zout - dist);
while (len--)
*a->zout++ = *p++;
}
}
}
static int compute_huffman_codes(zbuf *a)
{
static stbi__uint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
zhuffman z_codelength;
stbi__uint8 lencodes[286+32+137];//padding for maximum single op
stbi__uint8 codelength_sizes[19];
int i,n;
int hlit = zreceive(a,5) + 257;
int hdist = zreceive(a,5) + 1;
int hclen = zreceive(a,4) + 4;
memset(codelength_sizes, 0, sizeof(codelength_sizes));
for (i=0; i < hclen; ++i) {
int s = zreceive(a,3);
codelength_sizes[length_dezigzag[i]] = (stbi__uint8) s;
}
if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
n = 0;
while (n < hlit + hdist) {
int c = zhuffman_decode(a, &z_codelength);
assert(c >= 0 && c < 19);
if (c < 16)
lencodes[n++] = (stbi__uint8) c;
else if (c == 16) {
c = zreceive(a,2)+3;
memset(lencodes+n, lencodes[n-1], c);
n += c;
} else if (c == 17) {
c = zreceive(a,3)+3;
memset(lencodes+n, 0, c);
n += c;
} else {
assert(c == 18);
c = zreceive(a,7)+11;
memset(lencodes+n, 0, c);
n += c;
}
}
if (n != hlit+hdist) return e("bad codelengths","Corrupt PNG");
if (!zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
if (!zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
return 1;
}
static int parse_uncompressed_block(zbuf *a)
{
stbi__uint8 header[4];
int len,nlen,k;
if (a->num_bits & 7)
zreceive(a, a->num_bits & 7); // discard
// drain the bit-packed data into header
k = 0;
while (a->num_bits > 0) {
header[k++] = (stbi__uint8) (a->code_buffer & 255); // wtf this warns?
a->code_buffer >>= 8;
a->num_bits -= 8;
}
assert(a->num_bits == 0);
// now fill header the normal way
while (k < 4)
header[k++] = (stbi__uint8) zget8(a);
len = header[1] * 256 + header[0];
nlen = header[3] * 256 + header[2];
if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG");
if (a->zbuffer + len > a->zbuffer_end) return e("read past buffer","Corrupt PNG");
if (a->zout + len > a->zout_end)
if (!expand(a, len)) return 0;
memcpy(a->zout, a->zbuffer, len);
a->zbuffer += len;
a->zout += len;
return 1;
}
static int parse_zlib_header(zbuf *a)
{
int cmf = zget8(a);
int cm = cmf & 15;
/* int cinfo = cmf >> 4; */
int flg = zget8(a);
if ((cmf*256+flg) % 31 != 0) return e("bad zlib header","Corrupt PNG"); // zlib spec
if (flg & 32) return e("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
if (cm != 8) return e("bad compression","Corrupt PNG"); // DEFLATE required for png
// window = 1 << (8 + cinfo)... but who cares, we fully buffer output
return 1;
}
// @TODO: should statically initialize these for optimal thread safety
static stbi__uint8 default_length[288], default_distance[32];
static void init_defaults(void)
{
int i; // use <= to match clearly with spec
for (i=0; i <= 143; ++i) default_length[i] = 8;
for ( ; i <= 255; ++i) default_length[i] = 9;
for ( ; i <= 279; ++i) default_length[i] = 7;
for ( ; i <= 287; ++i) default_length[i] = 8;
for (i=0; i <= 31; ++i) default_distance[i] = 5;
}
int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead
static int parse_zlib(zbuf *a, int parse_header)
{
int final, type;
if (parse_header)
if (!parse_zlib_header(a)) return 0;
a->num_bits = 0;
a->code_buffer = 0;
do {
final = zreceive(a,1);
type = zreceive(a,2);
if (type == 0) {
if (!parse_uncompressed_block(a)) return 0;
} else if (type == 3) {
return 0;
} else {
if (type == 1) {
// use fixed code lengths
if (!default_distance[31]) init_defaults();
if (!zbuild_huffman(&a->z_length , default_length , 288)) return 0;
if (!zbuild_huffman(&a->z_distance, default_distance, 32)) return 0;
} else {
if (!compute_huffman_codes(a)) return 0;
}
if (!parse_huffman_block(a)) return 0;
}
if (stbi_png_partial && a->zout - a->zout_start > 65536)
break;
} while (!final);
return 1;
}
static int do_zlib(zbuf *a, char *obuf, int olen, int exp, int parse_header)
{
a->zout_start = obuf;
a->zout = obuf;
a->zout_end = obuf + olen;
a->z_expandable = exp;
return parse_zlib(a, parse_header);
}
char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
{
zbuf a;
char *p = (char *) malloc(initial_size);
if (p == NULL) return NULL;
a.zbuffer = (stbi__uint8 *) buffer;
a.zbuffer_end = (stbi__uint8 *) buffer + len;
if (do_zlib(&a, p, initial_size, 1, 1)) {
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
free(a.zout_start);
return NULL;
}
}
char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
{
return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
}
char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
{
zbuf a;
char *p = (char *) malloc(initial_size);
if (p == NULL) return NULL;
a.zbuffer = (stbi__uint8 *) buffer;
a.zbuffer_end = (stbi__uint8 *) buffer + len;
if (do_zlib(&a, p, initial_size, 1, parse_header)) {
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
free(a.zout_start);
return NULL;
}
}
int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
{
zbuf a;
a.zbuffer = (stbi__uint8 *) ibuffer;
a.zbuffer_end = (stbi__uint8 *) ibuffer + ilen;
if (do_zlib(&a, obuffer, olen, 0, 1))
return (int) (a.zout - a.zout_start);
else
return -1;
}
char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
{
zbuf a;
char *p = (char *) malloc(16384);
if (p == NULL) return NULL;
a.zbuffer = (stbi__uint8 *) buffer;
a.zbuffer_end = (stbi__uint8 *) buffer+len;
if (do_zlib(&a, p, 16384, 1, 0)) {
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
free(a.zout_start);
return NULL;
}
}
int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
{
zbuf a;
a.zbuffer = (stbi__uint8 *) ibuffer;
a.zbuffer_end = (stbi__uint8 *) ibuffer + ilen;
if (do_zlib(&a, obuffer, olen, 0, 0))
return (int) (a.zout - a.zout_start);
else
return -1;
}
// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
// simple implementation
// - only 8-bit samples
// - no CRC checking
// - allocates lots of intermediate memory
// - avoids problem of streaming data between subsystems
// - avoids explicit window management
// performance
// - uses stb_zlib, a PD zlib implementation with fast huffman decoding
typedef struct
{
stbi__uint32 length;
stbi__uint32 type;
} chunk;
#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
static chunk get_chunk_header(stbi *s)
{
chunk c;
c.length = get32(s);
c.type = get32(s);
return c;
}
static int check_png_header(stbi *s)
{
static stbi__uint8 png_sig[8] = { 137,80,78,71,13,10,26,10 };
int i;
for (i=0; i < 8; ++i)
if (get8u(s) != png_sig[i]) return e("bad png sig","Not a PNG");
return 1;
}
typedef struct
{
stbi *s;
stbi__uint8 *idata, *expanded, *out;
} png;
enum {
F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4,
F_avg_first, F_paeth_first
};
static stbi__uint8 first_row_filter[5] =
{
F_none, F_sub, F_none, F_avg_first, F_paeth_first
};
static int paeth(int a, int b, int c)
{
int p = a + b - c;
int pa = abs(p-a);
int pb = abs(p-b);
int pc = abs(p-c);
if (pa <= pb && pa <= pc) return a;
if (pb <= pc) return b;
return c;
}
// create the png data from post-deflated data
static int create_png_image_raw(png *a, stbi__uint8 *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y)
{
stbi *s = a->s;
stbi__uint32 i,j,stride = x*out_n;
int k;
int img_n = s->img_n; // copy it into a local for later
assert(out_n == s->img_n || out_n == s->img_n+1);
if (stbi_png_partial) y = 1;
a->out = (stbi__uint8 *) malloc(x * y * out_n);
if (!a->out) return e("outofmem", "Out of memory");
if (!stbi_png_partial) {
if (s->img_x == x && s->img_y == y) {
if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
} else { // interlaced:
if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
}
}
for (j=0; j < y; ++j) {
stbi__uint8 *cur = a->out + stride*j;
stbi__uint8 *prior = cur - stride;
int filter = *raw++;
if (filter > 4) return e("invalid filter","Corrupt PNG");
// if first row, use special filter that doesn't sample previous row
if (j == 0) filter = first_row_filter[filter];
// handle first pixel explicitly
for (k=0; k < img_n; ++k) {
switch (filter) {
case F_none : cur[k] = raw[k]; break;
case F_sub : cur[k] = raw[k]; break;
case F_up : cur[k] = raw[k] + prior[k]; break;
case F_avg : cur[k] = raw[k] + (prior[k]>>1); break;
case F_paeth : cur[k] = (stbi__uint8) (raw[k] + paeth(0,prior[k],0)); break;
case F_avg_first : cur[k] = raw[k]; break;
case F_paeth_first: cur[k] = raw[k]; break;
}
}
if (img_n != out_n) cur[img_n] = 255;
raw += img_n;
cur += out_n;
prior += out_n;
// this is a little gross, so that we don't switch per-pixel or per-component
if (img_n == out_n) {
#define CASE(f) \
case f: \
for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \
for (k=0; k < img_n; ++k)
switch (filter) {
CASE(F_none) cur[k] = raw[k]; break;
CASE(F_sub) cur[k] = raw[k] + cur[k-img_n]; break;
CASE(F_up) cur[k] = raw[k] + prior[k]; break;
CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-img_n])>>1); break;
CASE(F_paeth) cur[k] = (stbi__uint8) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
CASE(F_avg_first) cur[k] = raw[k] + (cur[k-img_n] >> 1); break;
CASE(F_paeth_first) cur[k] = (stbi__uint8) (raw[k] + paeth(cur[k-img_n],0,0)); break;
}
#undef CASE
} else {
assert(img_n+1 == out_n);
#define CASE(f) \
case f: \
for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
for (k=0; k < img_n; ++k)
switch (filter) {
CASE(F_none) cur[k] = raw[k]; break;
CASE(F_sub) cur[k] = raw[k] + cur[k-out_n]; break;
CASE(F_up) cur[k] = raw[k] + prior[k]; break;
CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-out_n])>>1); break;
CASE(F_paeth) cur[k] = (stbi__uint8) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
CASE(F_avg_first) cur[k] = raw[k] + (cur[k-out_n] >> 1); break;
CASE(F_paeth_first) cur[k] = (stbi__uint8) (raw[k] + paeth(cur[k-out_n],0,0)); break;
}
#undef CASE
}
}
return 1;
}
static int create_png_image(png *a, stbi__uint8 *raw, stbi__uint32 raw_len, int out_n, int interlaced)
{
stbi__uint8 *final;
int p;
int save;
if (!interlaced)
return create_png_image_raw(a, raw, raw_len, out_n, a->s->img_x, a->s->img_y);
save = stbi_png_partial;
stbi_png_partial = 0;
// de-interlacing
final = (stbi__uint8 *) malloc(a->s->img_x * a->s->img_y * out_n);
for (p=0; p < 7; ++p) {
int xorig[] = { 0,4,0,2,0,1,0 };
int yorig[] = { 0,0,4,0,2,0,1 };
int xspc[] = { 8,8,4,4,2,2,1 };
int yspc[] = { 8,8,8,4,4,2,2 };
int i,j,x,y;
// pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
if (x && y) {
if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) {
free(final);
return 0;
}
for (j=0; j < y; ++j)
for (i=0; i < x; ++i)
memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
a->out + (j*x+i)*out_n, out_n);
free(a->out);
raw += (x*out_n+1)*y;
raw_len -= (x*out_n+1)*y;
}
}
a->out = final;
stbi_png_partial = save;
return 1;
}
static int compute_transparency(png *z, stbi__uint8 tc[3], int out_n)
{
stbi *s = z->s;
stbi__uint32 i, pixel_count = s->img_x * s->img_y;
stbi__uint8 *p = z->out;
// compute color-based transparency, assuming we've
// already got 255 as the alpha value in the output
assert(out_n == 2 || out_n == 4);
if (out_n == 2) {
for (i=0; i < pixel_count; ++i) {
p[1] = (p[0] == tc[0] ? 0 : 255);
p += 2;
}
} else {
for (i=0; i < pixel_count; ++i) {
if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
p[3] = 0;
p += 4;
}
}
return 1;
}
static int expand_palette(png *a, stbi__uint8 *palette, int len, int pal_img_n)
{
stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
stbi__uint8 *p, *temp_out, *orig = a->out;
p = (stbi__uint8 *) malloc(pixel_count * pal_img_n);
if (p == NULL) return e("outofmem", "Out of memory");
// between here and free(out) below, exitting would leak
temp_out = p;
if (pal_img_n == 3) {
for (i=0; i < pixel_count; ++i) {
int n = orig[i]*4;
p[0] = palette[n ];
p[1] = palette[n+1];
p[2] = palette[n+2];
p += 3;
}
} else {
for (i=0; i < pixel_count; ++i) {
int n = orig[i]*4;
p[0] = palette[n ];
p[1] = palette[n+1];
p[2] = palette[n+2];
p[3] = palette[n+3];
p += 4;
}
}
free(a->out);
a->out = temp_out;
STBI_NOTUSED(len);
return 1;
}
static int stbi_unpremultiply_on_load = 0;
static int stbi_de_iphone_flag = 0;
void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
{
stbi_unpremultiply_on_load = flag_true_if_should_unpremultiply;
}
void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
{
stbi_de_iphone_flag = flag_true_if_should_convert;
}
static void stbi_de_iphone(png *z)
{
stbi *s = z->s;
stbi__uint32 i, pixel_count = s->img_x * s->img_y;
stbi__uint8 *p = z->out;
if (s->img_out_n == 3) { // convert bgr to rgb
for (i=0; i < pixel_count; ++i) {
stbi__uint8 t = p[0];
p[0] = p[2];
p[2] = t;
p += 3;
}
} else {
assert(s->img_out_n == 4);
if (stbi_unpremultiply_on_load) {
// convert bgr to rgb and unpremultiply
for (i=0; i < pixel_count; ++i) {
stbi__uint8 a = p[3];
stbi__uint8 t = p[0];
if (a) {
p[0] = p[2] * 255 / a;
p[1] = p[1] * 255 / a;
p[2] = t * 255 / a;
} else {
p[0] = p[2];
p[2] = t;
}
p += 4;
}
} else {
// convert bgr to rgb
for (i=0; i < pixel_count; ++i) {
stbi__uint8 t = p[0];
p[0] = p[2];
p[2] = t;
p += 4;
}
}
}
}
static int parse_png_file(png *z, int scan, int req_comp)
{
stbi__uint8 palette[1024], pal_img_n=0;
stbi__uint8 has_trans=0, tc[3];
stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
int first=1,k,interlace=0, iphone=0;
stbi *s = z->s;
z->expanded = NULL;
z->idata = NULL;
z->out = NULL;
if (!check_png_header(s)) return 0;
if (scan == SCAN_type) return 1;
for (;;) {
chunk c = get_chunk_header(s);
switch (c.type) {
case PNG_TYPE('C','g','B','I'):
iphone = stbi_de_iphone_flag;
skip(s, c.length);
break;
case PNG_TYPE('I','H','D','R'): {
int depth,color,comp,filter;
if (!first) return e("multiple IHDR","Corrupt PNG");
first = 0;
if (c.length != 13) return e("bad IHDR len","Corrupt PNG");
s->img_x = get32(s); if (s->img_x > (1 << 24)) return e("too large","Very large image (corrupt?)");
s->img_y = get32(s); if (s->img_y > (1 << 24)) return e("too large","Very large image (corrupt?)");
depth = get8(s); if (depth != 8) return e("8bit only","PNG not supported: 8-bit only");
color = get8(s); if (color > 6) return e("bad ctype","Corrupt PNG");
if (color == 3) pal_img_n = 3; else if (color & 1) return e("bad ctype","Corrupt PNG");
comp = get8(s); if (comp) return e("bad comp method","Corrupt PNG");
filter= get8(s); if (filter) return e("bad filter method","Corrupt PNG");
interlace = get8(s); if (interlace>1) return e("bad interlace method","Corrupt PNG");
if (!s->img_x || !s->img_y) return e("0-pixel image","Corrupt PNG");
if (!pal_img_n) {
s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode");
if (scan == SCAN_header) return 1;
} else {
// if paletted, then pal_n is our final components, and
// img_n is # components to decompress/filter.
s->img_n = 1;
if ((1 << 30) / s->img_x / 4 < s->img_y) return e("too large","Corrupt PNG");
// if SCAN_header, have to scan to see if we have a tRNS
}
break;
}
case PNG_TYPE('P','L','T','E'): {
if (first) return e("first not IHDR", "Corrupt PNG");
if (c.length > 256*3) return e("invalid PLTE","Corrupt PNG");
pal_len = c.length / 3;
if (pal_len * 3 != c.length) return e("invalid PLTE","Corrupt PNG");
for (i=0; i < pal_len; ++i) {
palette[i*4+0] = get8u(s);
palette[i*4+1] = get8u(s);
palette[i*4+2] = get8u(s);
palette[i*4+3] = 255;
}
break;
}
case PNG_TYPE('t','R','N','S'): {
if (first) return e("first not IHDR", "Corrupt PNG");
if (z->idata) return e("tRNS after IDAT","Corrupt PNG");
if (pal_img_n) {
if (scan == SCAN_header) { s->img_n = 4; return 1; }
if (pal_len == 0) return e("tRNS before PLTE","Corrupt PNG");
if (c.length > pal_len) return e("bad tRNS len","Corrupt PNG");
pal_img_n = 4;
for (i=0; i < c.length; ++i)
palette[i*4+3] = get8u(s);
} else {
if (!(s->img_n & 1)) return e("tRNS with alpha","Corrupt PNG");
if (c.length != (stbi__uint32) s->img_n*2) return e("bad tRNS len","Corrupt PNG");
has_trans = 1;
for (k=0; k < s->img_n; ++k)
tc[k] = (stbi__uint8) get16(s); // non 8-bit images will be larger
}
break;
}
case PNG_TYPE('I','D','A','T'): {
if (first) return e("first not IHDR", "Corrupt PNG");
if (pal_img_n && !pal_len) return e("no PLTE","Corrupt PNG");
if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; }
if (ioff + c.length > idata_limit) {
stbi__uint8 *p;
if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
while (ioff + c.length > idata_limit)
idata_limit *= 2;
p = (stbi__uint8 *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory");
z->idata = p;
}
if (!getn(s, z->idata+ioff,c.length)) return e("outofdata","Corrupt PNG");
ioff += c.length;
break;
}
case PNG_TYPE('I','E','N','D'): {
stbi__uint32 raw_len;
if (first) return e("first not IHDR", "Corrupt PNG");
if (scan != SCAN_load) return 1;
if (z->idata == NULL) return e("no IDAT","Corrupt PNG");
z->expanded = (stbi__uint8 *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, 16384, (int *) &raw_len, !iphone);
if (z->expanded == NULL) return 0; // zlib should set error
free(z->idata); z->idata = NULL;
if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
s->img_out_n = s->img_n+1;
else
s->img_out_n = s->img_n;
if (!create_png_image(z, z->expanded, raw_len, s->img_out_n, interlace)) return 0;
if (has_trans)
if (!compute_transparency(z, tc, s->img_out_n)) return 0;
if (iphone && s->img_out_n > 2)
stbi_de_iphone(z);
if (pal_img_n) {
// pal_img_n == 3 or 4
s->img_n = pal_img_n; // record the actual colors we had
s->img_out_n = pal_img_n;
if (req_comp >= 3) s->img_out_n = req_comp;
if (!expand_palette(z, palette, pal_len, s->img_out_n))
return 0;
}
free(z->expanded); z->expanded = NULL;
return 1;
}
default:
// if critical, fail
if (first) return e("first not IHDR", "Corrupt PNG");
if ((c.type & (1 << 29)) == 0) {
#ifndef STBI_NO_FAILURE_STRINGS
// not threadsafe
static char invalid_chunk[] = "XXXX chunk not known";
invalid_chunk[0] = (stbi__uint8) (c.type >> 24);
invalid_chunk[1] = (stbi__uint8) (c.type >> 16);
invalid_chunk[2] = (stbi__uint8) (c.type >> 8);
invalid_chunk[3] = (stbi__uint8) (c.type >> 0);
#endif
return e(invalid_chunk, "PNG not supported: unknown chunk type");
}
skip(s, c.length);
break;
}
// end of chunk, read and skip CRC
get32(s);
}
}
static unsigned char *do_png(png *p, int *x, int *y, int *n, int req_comp)
{
unsigned char *result=NULL;
if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error");
if (parse_png_file(p, SCAN_load, req_comp)) {
result = p->out;
p->out = NULL;
if (req_comp && req_comp != p->s->img_out_n) {
result = convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
p->s->img_out_n = req_comp;
if (result == NULL) return result;
}
*x = p->s->img_x;
*y = p->s->img_y;
if (n) *n = p->s->img_n;
}
free(p->out); p->out = NULL;
free(p->expanded); p->expanded = NULL;
free(p->idata); p->idata = NULL;
return result;
}
static unsigned char *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
png p;
p.s = s;
return do_png(&p, x,y,comp,req_comp);
}
static int stbi_png_test(stbi *s)
{
int r;
r = check_png_header(s);
stbi_rewind(s);
return r;
}
static int stbi_png_info_raw(png *p, int *x, int *y, int *comp)
{
if (!parse_png_file(p, SCAN_header, 0)) {
stbi_rewind( p->s );
return 0;
}
if (x) *x = p->s->img_x;
if (y) *y = p->s->img_y;
if (comp) *comp = p->s->img_n;
return 1;
}
static int stbi_png_info(stbi *s, int *x, int *y, int *comp)
{
png p;
p.s = s;
return stbi_png_info_raw(&p, x, y, comp);
}
// Microsoft/Windows BMP image
static int bmp_test(stbi *s)
{
int sz;
if (get8(s) != 'B') return 0;
if (get8(s) != 'M') return 0;
get32le(s); // discard filesize
get16le(s); // discard reserved
get16le(s); // discard reserved
get32le(s); // discard data offset
sz = get32le(s);
if (sz == 12 || sz == 40 || sz == 56 || sz == 108) return 1;
return 0;
}
static int stbi_bmp_test(stbi *s)
{
int r = bmp_test(s);
stbi_rewind(s);
return r;
}
// returns 0..31 for the highest set bit
static int high_bit(unsigned int z)
{
int n=0;
if (z == 0) return -1;
if (z >= 0x10000) (void)(n += 16), z >>= 16;
if (z >= 0x00100) (void)(n += 8), z >>= 8;
if (z >= 0x00010) (void)(n += 4), z >>= 4;
if (z >= 0x00004) (void)(n += 2), z >>= 2;
if (z >= 0x00002) (void)(n += 1), z >>= 1;
return n;
}
static int bitcount(unsigned int a)
{
a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
a = (a + (a >> 8)); // max 16 per 8 bits
a = (a + (a >> 16)); // max 32 per 8 bits
return a & 0xff;
}
static int shiftsigned(int v, int shift, int bits)
{
int result;
int z=0;
if (shift < 0) v <<= -shift;
else v >>= shift;
result = v;
z = bits;
while (z < 8) {
result += v >> z;
z += bits;
}
return result;
}
static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
stbi__uint8 *out;
unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
stbi_uc pal[256][4];
int psize=0,i,j,compress=0,width;
int bpp, flip_vertically, pad, target, offset, hsz;
if (get8(s) != 'B' || get8(s) != 'M') return epuc("not BMP", "Corrupt BMP");
get32le(s); // discard filesize
get16le(s); // discard reserved
get16le(s); // discard reserved
offset = get32le(s);
hsz = get32le(s);
if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) return epuc("unknown BMP", "BMP type not supported: unknown");
if (hsz == 12) {
s->img_x = get16le(s);
s->img_y = get16le(s);
} else {
s->img_x = get32le(s);
s->img_y = get32le(s);
}
if (get16le(s) != 1) return epuc("bad BMP", "bad BMP");
bpp = get16le(s);
if (bpp == 1) return epuc("monochrome", "BMP type not supported: 1-bit");
flip_vertically = ((int) s->img_y) > 0;
s->img_y = abs((int) s->img_y);
if (hsz == 12) {
if (bpp < 24)
psize = (offset - 14 - 24) / 3;
} else {
compress = get32le(s);
if (compress == 1 || compress == 2) return epuc("BMP RLE", "BMP type not supported: RLE");
get32le(s); // discard sizeof
get32le(s); // discard hres
get32le(s); // discard vres
get32le(s); // discard colorsused
get32le(s); // discard max important
if (hsz == 40 || hsz == 56) {
if (hsz == 56) {
get32le(s);
get32le(s);
get32le(s);
get32le(s);
}
if (bpp == 16 || bpp == 32) {
mr = mg = mb = 0;
if (compress == 0) {
if (bpp == 32) {
mr = 0xffu << 16;
mg = 0xffu << 8;
mb = 0xffu << 0;
ma = 0xffu << 24;
fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255
STBI_NOTUSED(fake_a);
} else {
mr = 31u << 10;
mg = 31u << 5;
mb = 31u << 0;
}
} else if (compress == 3) {
mr = get32le(s);
mg = get32le(s);
mb = get32le(s);
// not documented, but generated by photoshop and handled by mspaint
if (mr == mg && mg == mb) {
// ?!?!?
return epuc("bad BMP", "bad BMP");
}
} else
return epuc("bad BMP", "bad BMP");
}
} else {
assert(hsz == 108);
mr = get32le(s);
mg = get32le(s);
mb = get32le(s);
ma = get32le(s);
get32le(s); // discard color space
for (i=0; i < 12; ++i)
get32le(s); // discard color space parameters
}
if (bpp < 16)
psize = (offset - 14 - hsz) >> 2;
}
s->img_n = ma ? 4 : 3;
if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
target = req_comp;
else
target = s->img_n; // if they want monochrome, we'll post-convert
out = (stbi_uc *) malloc(target * s->img_x * s->img_y);
if (!out) return epuc("outofmem", "Out of memory");
if (bpp < 16) {
int z=0;
if (psize == 0 || psize > 256) { free(out); return epuc("invalid", "Corrupt BMP"); }
for (i=0; i < psize; ++i) {
pal[i][2] = get8u(s);
pal[i][1] = get8u(s);
pal[i][0] = get8u(s);
if (hsz != 12) get8(s);
pal[i][3] = 255;
}
skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4));
if (bpp == 4) width = (s->img_x + 1) >> 1;
else if (bpp == 8) width = s->img_x;
else { free(out); return epuc("bad bpp", "Corrupt BMP"); }
pad = (-width)&3;
for (j=0; j < (int) s->img_y; ++j) {
for (i=0; i < (int) s->img_x; i += 2) {
int v=get8(s),v2=0;
if (bpp == 4) {
v2 = v & 15;
v >>= 4;
}
out[z++] = pal[v][0];
out[z++] = pal[v][1];
out[z++] = pal[v][2];
if (target == 4) out[z++] = 255;
if (i+1 == (int) s->img_x) break;
v = (bpp == 8) ? get8(s) : v2;
out[z++] = pal[v][0];
out[z++] = pal[v][1];
out[z++] = pal[v][2];
if (target == 4) out[z++] = 255;
}
skip(s, pad);
}
} else {
int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
int z = 0;
int easy=0;
skip(s, offset - 14 - hsz);
if (bpp == 24) width = 3 * s->img_x;
else if (bpp == 16) width = 2*s->img_x;
else /* bpp = 32 and pad = 0 */ width=0;
pad = (-width) & 3;
if (bpp == 24) {
easy = 1;
} else if (bpp == 32) {
if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
easy = 2;
}
if (!easy) {
if (!mr || !mg || !mb) { free(out); return epuc("bad masks", "Corrupt BMP"); }
// right shift amt to put high bit in position #7
rshift = high_bit(mr)-7; rcount = bitcount(mr);
gshift = high_bit(mg)-7; gcount = bitcount(mg);
bshift = high_bit(mb)-7; bcount = bitcount(mb);
ashift = high_bit(ma)-7; acount = bitcount(ma);
}
for (j=0; j < (int) s->img_y; ++j) {
if (easy) {
for (i=0; i < (int) s->img_x; ++i) {
int a;
out[z+2] = get8u(s);
out[z+1] = get8u(s);
out[z+0] = get8u(s);
z += 3;
a = (easy == 2 ? get8(s) : 255);
if (target == 4) out[z++] = (stbi__uint8) a;
}
} else {
for (i=0; i < (int) s->img_x; ++i) {
stbi__uint32 v = (stbi__uint32) (bpp == 16 ? get16le(s) : get32le(s));
int a;
out[z++] = (stbi__uint8) shiftsigned(v & mr, rshift, rcount);
out[z++] = (stbi__uint8) shiftsigned(v & mg, gshift, gcount);
out[z++] = (stbi__uint8) shiftsigned(v & mb, bshift, bcount);
a = (ma ? shiftsigned(v & ma, ashift, acount) : 255);
if (target == 4) out[z++] = (stbi__uint8) a;
}
}
skip(s, pad);
}
}
if (flip_vertically) {
stbi_uc t;
for (j=0; j < (int) s->img_y>>1; ++j) {
stbi_uc *p1 = out + j *s->img_x*target;
stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
for (i=0; i < (int) s->img_x*target; ++i) {
(void)(t = p1[i]), (void)(p1[i] = p2[i]), p2[i] = t;
}
}
}
if (req_comp && req_comp != target) {
out = convert_format(out, target, req_comp, s->img_x, s->img_y);
if (out == NULL) return out; // convert_format frees input on failure
}
*x = s->img_x;
*y = s->img_y;
if (comp) *comp = s->img_n;
return out;
}
static stbi_uc *stbi_bmp_load(stbi *s,int *x, int *y, int *comp, int req_comp)
{
return bmp_load(s, x,y,comp,req_comp);
}
// Targa Truevision - TGA
// by Jonathan Dummer
static int tga_info(stbi *s, int *x, int *y, int *comp)
{
int tga_w, tga_h, tga_comp;
int sz;
get8u(s); // discard Offset
sz = get8u(s); // color type
if( sz > 1 ) {
stbi_rewind(s);
return 0; // only RGB or indexed allowed
}
sz = get8u(s); // image type
// only RGB or grey allowed, +/- RLE
if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0;
skip(s,9);
tga_w = get16le(s);
if( tga_w < 1 ) {
stbi_rewind(s);
return 0; // test width
}
tga_h = get16le(s);
if( tga_h < 1 ) {
stbi_rewind(s);
return 0; // test height
}
sz = get8(s); // bits per pixel
// only RGB or RGBA or grey allowed
if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) {
stbi_rewind(s);
return 0;
}
tga_comp = sz;
if (x) *x = tga_w;
if (y) *y = tga_h;
if (comp) *comp = tga_comp / 8;
return 1; // seems to have passed everything
}
int stbi_tga_info(stbi *s, int *x, int *y, int *comp)
{
return tga_info(s, x, y, comp);
}
static int tga_test(stbi *s)
{
int sz;
get8u(s); // discard Offset
sz = get8u(s); // color type
if ( sz > 1 ) return 0; // only RGB or indexed allowed
sz = get8u(s); // image type
if ( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0; // only RGB or grey allowed, +/- RLE
get16(s); // discard palette start
get16(s); // discard palette length
get8(s); // discard bits per palette color entry
get16(s); // discard x origin
get16(s); // discard y origin
if ( get16(s) < 1 ) return 0; // test width
if ( get16(s) < 1 ) return 0; // test height
sz = get8(s); // bits per pixel
if ( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) ) return 0; // only RGB or RGBA or grey allowed
return 1; // seems to have passed everything
}
static int stbi_tga_test(stbi *s)
{
int res = tga_test(s);
stbi_rewind(s);
return res;
}
static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
// read in the TGA header stuff
int tga_offset = get8u(s);
int tga_indexed = get8u(s);
int tga_image_type = get8u(s);
int tga_is_RLE = 0;
int tga_palette_start = get16le(s);
int tga_palette_len = get16le(s);
int tga_palette_bits = get8u(s);
int tga_x_origin = get16le(s);
int tga_y_origin = get16le(s);
int tga_width = get16le(s);
int tga_height = get16le(s);
int tga_bits_per_pixel = get8u(s);
int tga_comp = tga_bits_per_pixel / 8;
int tga_inverted = get8u(s);
// image data
unsigned char *tga_data;
unsigned char *tga_palette = NULL;
int i, j;
unsigned char raw_data[4];
int RLE_count = 0;
int RLE_repeating = 0;
int read_next_pixel = 1;
// do a tiny bit of precessing
if ( tga_image_type >= 8 )
{
tga_image_type -= 8;
tga_is_RLE = 1;
}
/* int tga_alpha_bits = tga_inverted & 15; */
tga_inverted = 1 - ((tga_inverted >> 5) & 1);
// error check
if ( //(tga_indexed) ||
(tga_width < 1) || (tga_height < 1) ||
(tga_image_type < 1) || (tga_image_type > 3) ||
((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) &&
(tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32))
)
{
return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA
}
// If I'm paletted, then I'll use the number of bits from the palette
if ( tga_indexed )
{
tga_comp = tga_palette_bits / 8;
}
// tga info
*x = tga_width;
*y = tga_height;
if (comp) *comp = tga_comp;
tga_data = (unsigned char*)malloc( tga_width * tga_height * req_comp );
if (!tga_data) return epuc("outofmem", "Out of memory");
// skip to the data's starting position (offset usually = 0)
skip(s, tga_offset );
if ( !tga_indexed && !tga_is_RLE) {
for (i=0; i < tga_height; ++i) {
int y = tga_inverted ? tga_height -i - 1 : i;
stbi__uint8 *tga_row = tga_data + y*tga_width*tga_comp;
getn(s, tga_row, tga_width * tga_comp);
}
} else {
// do I need to load a palette?
if ( tga_indexed)
{
// any data to skip? (offset usually = 0)
skip(s, tga_palette_start );
// load the palette
tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 );
if (!tga_palette) {
free(tga_data);
return epuc("outofmem", "Out of memory");
}
if (!getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
free(tga_data);
free(tga_palette);
return epuc("bad palette", "Corrupt TGA");
}
}
// load the data
for (i=0; i < tga_width * tga_height; ++i)
{
// if I'm in RLE mode, do I need to get a RLE chunk?
if ( tga_is_RLE )
{
if ( RLE_count == 0 )
{
// yep, get the next byte as a RLE command
int RLE_cmd = get8u(s);
RLE_count = 1 + (RLE_cmd & 127);
RLE_repeating = RLE_cmd >> 7;
read_next_pixel = 1;
} else if ( !RLE_repeating )
{
read_next_pixel = 1;
}
} else
{
read_next_pixel = 1;
}
// OK, if I need to read a pixel, do it now
if ( read_next_pixel )
{
// load however much data we did have
if ( tga_indexed )
{
// read in 1 byte, then perform the lookup
int pal_idx = get8u(s);
if ( pal_idx >= tga_palette_len )
{
// invalid index
pal_idx = 0;
}
pal_idx *= tga_bits_per_pixel / 8;
for (j = 0; j*8 < tga_bits_per_pixel; ++j)
{
raw_data[j] = tga_palette[pal_idx+j];
}
} else
{
// read in the data raw
for (j = 0; j*8 < tga_bits_per_pixel; ++j)
{
raw_data[j] = get8u(s);
}
}
// clear the reading flag for the next pixel
read_next_pixel = 0;
} // end of reading a pixel
// copy data
for (j = 0; j < tga_comp; ++j)
tga_data[i*tga_comp+j] = raw_data[j];
// in case we're in RLE mode, keep counting down
--RLE_count;
}
// do I need to invert the image?
if ( tga_inverted )
{
for (j = 0; j*2 < tga_height; ++j)
{
int index1 = j * tga_width * req_comp;
int index2 = (tga_height - 1 - j) * tga_width * req_comp;
for (i = tga_width * req_comp; i > 0; --i)
{
unsigned char temp = tga_data[index1];
tga_data[index1] = tga_data[index2];
tga_data[index2] = temp;
++index1;
++index2;
}
}
}
// clear my palette, if I had one
if ( tga_palette != NULL )
{
free( tga_palette );
}
}
// swap RGB
if (tga_comp >= 3)
{
unsigned char* tga_pixel = tga_data;
for (i=0; i < tga_width * tga_height; ++i)
{
unsigned char temp = tga_pixel[0];
tga_pixel[0] = tga_pixel[2];
tga_pixel[2] = temp;
tga_pixel += tga_comp;
}
}
// convert to target component count
if (req_comp && req_comp != tga_comp)
tga_data = convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);
// the things I do to get rid of an error message, and yet keep
// Microsoft's C compilers happy... [8^(
tga_palette_start = tga_palette_len = tga_palette_bits =
tga_x_origin = tga_y_origin = 0;
// OK, done
return tga_data;
}
static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
return tga_load(s,x,y,comp,req_comp);
}
// *************************************************************************************************
// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
static int psd_test(stbi *s)
{
if (get32(s) != 0x38425053) return 0; // "8BPS"
else return 1;
}
static int stbi_psd_test(stbi *s)
{
int r = psd_test(s);
stbi_rewind(s);
return r;
}
static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
int pixelCount;
int channelCount, compression;
int channel, i, count, len;
int w,h;
stbi__uint8 *out;
// Check identifier
if (get32(s) != 0x38425053) // "8BPS"
return epuc("not PSD", "Corrupt PSD image");
// Check file type version.
if (get16(s) != 1)
return epuc("wrong version", "Unsupported version of PSD image");
// Skip 6 reserved bytes.
skip(s, 6 );
// Read the number of channels (R, G, B, A, etc).
channelCount = get16(s);
if (channelCount < 0 || channelCount > 16)
return epuc("wrong channel count", "Unsupported number of channels in PSD image");
// Read the rows and columns of the image.
h = get32(s);
w = get32(s);
// Make sure the depth is 8 bits.
if (get16(s) != 8)
return epuc("unsupported bit depth", "PSD bit depth is not 8 bit");
// Make sure the color mode is RGB.
// Valid options are:
// 0: Bitmap
// 1: Grayscale
// 2: Indexed color
// 3: RGB color
// 4: CMYK color
// 7: Multichannel
// 8: Duotone
// 9: Lab color
if (get16(s) != 3)
return epuc("wrong color format", "PSD is not in RGB color format");
// Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)
skip(s,get32(s) );
// Skip the image resources. (resolution, pen tool paths, etc)
skip(s, get32(s) );
// Skip the reserved data.
skip(s, get32(s) );
// Find out if the data is compressed.
// Known values:
// 0: no compression
// 1: RLE compressed
compression = get16(s);
if (compression > 1)
return epuc("bad compression", "PSD has an unknown compression format");
// Create the destination image.
out = (stbi_uc *) malloc(4 * w*h);
if (!out) return epuc("outofmem", "Out of memory");
pixelCount = w*h;
// Initialize the data to zero.
//memset( out, 0, pixelCount * 4 );
// Finally, the image data.
if (compression) {
// RLE as used by .PSD and .TIFF
// Loop until you get the number of unpacked bytes you are expecting:
// Read the next source byte into n.
// If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
// Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
// Else if n is 128, noop.
// Endloop
// The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
// which we're going to just skip.
skip(s, h * channelCount * 2 );
// Read the RLE data by channel.
for (channel = 0; channel < 4; channel++) {
stbi__uint8 *p;
p = out+channel;
if (channel >= channelCount) {
// Fill this channel with default data.
for (i = 0; i < pixelCount; i++) (void)(*p = (channel == 3 ? 255 : 0)), p += 4;
} else {
// Read the RLE data.
count = 0;
while (count < pixelCount) {
len = get8(s);
if (len == 128) {
// No-op.
} else if (len < 128) {
// Copy next len+1 bytes literally.
len++;
count += len;
while (len) {
*p = get8u(s);
p += 4;
len--;
}
} else if (len > 128) {
stbi__uint8 val;
// Next -len+1 bytes in the dest are replicated from next source byte.
// (Interpret len as a negative 8-bit int.)
len ^= 0x0FF;
len += 2;
val = get8u(s);
count += len;
while (len) {
*p = val;
p += 4;
len--;
}
}
}
}
}
} else {
// We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
// where each channel consists of an 8-bit value for each pixel in the image.
// Read the data by channel.
for (channel = 0; channel < 4; channel++) {
stbi__uint8 *p;
p = out + channel;
if (channel > channelCount) {
// Fill this channel with default data.
for (i = 0; i < pixelCount; i++) (void)(*p = channel == 3 ? 255 : 0), p += 4;
} else {
// Read the data.
for (i = 0; i < pixelCount; i++)
(void)(*p = get8u(s)), p += 4;
}
}
}
if (req_comp && req_comp != 4) {
out = convert_format(out, 4, req_comp, w, h);
if (out == NULL) return out; // convert_format frees input on failure
}
if (comp) *comp = channelCount;
*y = h;
*x = w;
return out;
}
static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
return psd_load(s,x,y,comp,req_comp);
}
// *************************************************************************************************
// Softimage PIC loader
// by Tom Seddon
//
// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
static int pic_is4(stbi *s,const char *str)
{
int i;
for (i=0; i<4; ++i)
if (get8(s) != (stbi_uc)str[i])
return 0;
return 1;
}
static int pic_test(stbi *s)
{
int i;
if (!pic_is4(s,"\x53\x80\xF6\x34"))
return 0;
for(i=0;i<84;++i)
get8(s);
if (!pic_is4(s,"PICT"))
return 0;
return 1;
}
typedef struct
{
stbi_uc size,type,channel;
} pic_packet_t;
static stbi_uc *pic_readval(stbi *s, int channel, stbi_uc *dest)
{
int mask=0x80, i;
for (i=0; i<4; ++i, mask>>=1) {
if (channel & mask) {
if (at_eof(s)) return epuc("bad file","PIC file too short");
dest[i]=get8u(s);
}
}
return dest;
}
static void pic_copyval(int channel,stbi_uc *dest,const stbi_uc *src)
{
int mask=0x80,i;
for (i=0;i<4; ++i, mask>>=1)
if (channel&mask)
dest[i]=src[i];
}
static stbi_uc *pic_load2(stbi *s,int width,int height,int *comp, stbi_uc *result)
{
int act_comp=0,num_packets=0,y,chained;
pic_packet_t packets[10];
// this will (should...) cater for even some bizarre stuff like having data
// for the same channel in multiple packets.
do {
pic_packet_t *packet;
if (num_packets==sizeof(packets)/sizeof(packets[0]))
return epuc("bad format","too many packets");
packet = &packets[num_packets++];
chained = get8(s);
packet->size = get8u(s);
packet->type = get8u(s);
packet->channel = get8u(s);
act_comp |= packet->channel;
if (at_eof(s)) return epuc("bad file","file too short (reading packets)");
if (packet->size != 8) return epuc("bad format","packet isn't 8bpp");
} while (chained);
*comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
for(y=0; y<height; ++y) {
int packet_idx;
for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
pic_packet_t *packet = &packets[packet_idx];
stbi_uc *dest = result+y*width*4;
switch (packet->type) {
default:
return epuc("bad format","packet has bad compression type");
case 0: {//uncompressed
int x;
for(x=0;x<width;++x, dest+=4)
if (!pic_readval(s,packet->channel,dest))
return 0;
break;
}
case 1://Pure RLE
{
int left=width, i;
while (left>0) {
stbi_uc count,value[4];
count=get8u(s);
if (at_eof(s)) return epuc("bad file","file too short (pure read count)");
if (count > left)
count = (stbi__uint8) left;
if (!pic_readval(s,packet->channel,value)) return 0;
for(i=0; i<count; ++i,dest+=4)
pic_copyval(packet->channel,dest,value);
left -= count;
}
}
break;
case 2: {//Mixed RLE
int left=width;
while (left>0) {
int count = get8(s), i;
if (at_eof(s)) return epuc("bad file","file too short (mixed read count)");
if (count >= 128) { // Repeated
stbi_uc value[4];
int i;
if (count==128)
count = get16(s);
else
count -= 127;
if (count > left)
return epuc("bad file","scanline overrun");
if (!pic_readval(s,packet->channel,value))
return 0;
for(i=0;i<count;++i, dest += 4)
pic_copyval(packet->channel,dest,value);
} else { // Raw
++count;
if (count>left) return epuc("bad file","scanline overrun");
for(i=0;i<count;++i, dest+=4)
if (!pic_readval(s,packet->channel,dest))
return 0;
}
left-=count;
}
break;
}
}
}
}
return result;
}
static stbi_uc *pic_load(stbi *s,int *px,int *py,int *comp,int req_comp)
{
stbi_uc *result;
int i, x,y;
for (i=0; i<92; ++i)
get8(s);
x = get16(s);
y = get16(s);
if (at_eof(s)) return epuc("bad file","file too short (pic header)");
if ((1 << 28) / x < y) return epuc("too large", "Image too large to decode");
get32(s); //skip `ratio'
get16(s); //skip `fields'
get16(s); //skip `pad'
// intermediate buffer is RGBA
result = (stbi_uc *) malloc(x*y*4);
memset(result, 0xff, x*y*4);
if (!pic_load2(s,x,y,comp, result)) {
free(result);
result=0;
}
*px = x;
*py = y;
if (req_comp == 0) req_comp = *comp;
result=convert_format(result,4,req_comp,x,y);
return result;
}
static int stbi_pic_test(stbi *s)
{
int r = pic_test(s);
stbi_rewind(s);
return r;
}
static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
return pic_load(s,x,y,comp,req_comp);
}
// *************************************************************************************************
// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
typedef struct stbi_gif_lzw_struct {
stbi__int16 prefix;
stbi__uint8 first;
stbi__uint8 suffix;
} stbi_gif_lzw;
typedef struct stbi_gif_struct
{
int w,h;
stbi_uc *out; // output buffer (always 4 components)
int flags, bgindex, ratio, transparent, eflags;
stbi__uint8 pal[256][4];
stbi__uint8 lpal[256][4];
stbi_gif_lzw codes[4096];
stbi__uint8 *color_table;
int parse, step;
int lflags;
int start_x, start_y;
int max_x, max_y;
int cur_x, cur_y;
int line_size;
} stbi_gif;
static int gif_test(stbi *s)
{
int sz;
if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8') return 0;
sz = get8(s);
if (sz != '9' && sz != '7') return 0;
if (get8(s) != 'a') return 0;
return 1;
}
static int stbi_gif_test(stbi *s)
{
int r = gif_test(s);
stbi_rewind(s);
return r;
}
static void stbi_gif_parse_colortable(stbi *s, stbi__uint8 pal[256][4], int num_entries, int transp)
{
int i;
for (i=0; i < num_entries; ++i) {
pal[i][2] = get8u(s);
pal[i][1] = get8u(s);
pal[i][0] = get8u(s);
pal[i][3] = transp ? 0 : 255;
}
}
static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info)
{
stbi__uint8 version;
if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8')
return e("not GIF", "Corrupt GIF");
version = get8u(s);
if (version != '7' && version != '9') return e("not GIF", "Corrupt GIF");
if (get8(s) != 'a') return e("not GIF", "Corrupt GIF");
failure_reason = "";
g->w = get16le(s);
g->h = get16le(s);
g->flags = get8(s);
g->bgindex = get8(s);
g->ratio = get8(s);
g->transparent = -1;
if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments
if (is_info) return 1;
if (g->flags & 0x80)
stbi_gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
return 1;
}
static int stbi_gif_info_raw(stbi *s, int *x, int *y, int *comp)
{
stbi_gif g;
if (!stbi_gif_header(s, &g, comp, 1)) {
stbi_rewind( s );
return 0;
}
if (x) *x = g.w;
if (y) *y = g.h;
return 1;
}
static void stbi_out_gif_code(stbi_gif *g, stbi__uint16 code)
{
stbi__uint8 *p, *c;
// recurse to decode the prefixes, since the linked-list is backwards,
// and working backwards through an interleaved image would be nasty
if (g->codes[code].prefix >= 0)
stbi_out_gif_code(g, g->codes[code].prefix);
if (g->cur_y >= g->max_y) return;
p = &g->out[g->cur_x + g->cur_y];
c = &g->color_table[g->codes[code].suffix * 4];
if (c[3] >= 128) {
p[0] = c[2];
p[1] = c[1];
p[2] = c[0];
p[3] = c[3];
}
g->cur_x += 4;
if (g->cur_x >= g->max_x) {
g->cur_x = g->start_x;
g->cur_y += g->step;
while (g->cur_y >= g->max_y && g->parse > 0) {
g->step = (1 << g->parse) * g->line_size;
g->cur_y = g->start_y + (g->step >> 1);
--g->parse;
}
}
}
static stbi__uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g)
{
stbi__uint8 lzw_cs;
stbi__int32 len, code;
stbi__uint32 first;
stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
stbi_gif_lzw *p;
lzw_cs = get8u(s);
clear = 1 << lzw_cs;
first = 1;
codesize = lzw_cs + 1;
codemask = (1 << codesize) - 1;
bits = 0;
valid_bits = 0;
for (code = 0; code < clear; code++) {
g->codes[code].prefix = -1;
g->codes[code].first = (stbi__uint8) code;
g->codes[code].suffix = (stbi__uint8) code;
}
// support no starting clear code
avail = clear+2;
oldcode = -1;
len = 0;
for(;;) {
if (valid_bits < codesize) {
if (len == 0) {
len = get8(s); // start new block
if (len == 0)
return g->out;
}
--len;
bits |= (stbi__int32) get8(s) << valid_bits;
valid_bits += 8;
} else {
stbi__int32 code = bits & codemask;
bits >>= codesize;
valid_bits -= codesize;
// @OPTIMIZE: is there some way we can accelerate the non-clear path?
if (code == clear) { // clear code
codesize = lzw_cs + 1;
codemask = (1 << codesize) - 1;
avail = clear + 2;
oldcode = -1;
first = 0;
} else if (code == clear + 1) { // end of stream code
skip(s, len);
while ((len = get8(s)) > 0)
skip(s,len);
return g->out;
} else if (code <= avail) {
if (first) return epuc("no clear code", "Corrupt GIF");
if (oldcode >= 0) {
p = &g->codes[avail++];
if (avail > 4096) return epuc("too many codes", "Corrupt GIF");
p->prefix = (stbi__int16) oldcode;
p->first = g->codes[oldcode].first;
p->suffix = (code == avail) ? p->first : g->codes[code].first;
} else if (code == avail)
return epuc("illegal code in raster", "Corrupt GIF");
stbi_out_gif_code(g, (stbi__uint16) code);
if ((avail & codemask) == 0 && avail <= 0x0FFF) {
codesize++;
codemask = (1 << codesize) - 1;
}
oldcode = code;
} else {
return epuc("illegal code in raster", "Corrupt GIF");
}
}
}
}
static void stbi_fill_gif_background(stbi_gif *g)
{
int i;
stbi__uint8 *c = g->pal[g->bgindex];
// @OPTIMIZE: write a dword at a time
for (i = 0; i < g->w * g->h * 4; i += 4) {
stbi__uint8 *p = &g->out[i];
p[0] = c[2];
p[1] = c[1];
p[2] = c[0];
p[3] = c[3];
}
}
// this function is designed to support animated gifs, although stb_image doesn't support it
static stbi__uint8 *stbi_gif_load_next(stbi *s, stbi_gif *g, int *comp, int req_comp)
{
int i;
stbi__uint8 *old_out = 0;
if (g->out == 0) {
if (!stbi_gif_header(s, g, comp,0)) return 0; // failure_reason set by stbi_gif_header
g->out = (stbi__uint8 *) malloc(4 * g->w * g->h);
if (g->out == 0) return epuc("outofmem", "Out of memory");
stbi_fill_gif_background(g);
} else {
// animated-gif-only path
if (((g->eflags & 0x1C) >> 2) == 3) {
old_out = g->out;
g->out = (stbi__uint8 *) malloc(4 * g->w * g->h);
if (g->out == 0) return epuc("outofmem", "Out of memory");
memcpy(g->out, old_out, g->w*g->h*4);
}
}
for (;;) {
switch (get8(s)) {
case 0x2C: /* Image Descriptor */
{
stbi__int32 x, y, w, h;
stbi__uint8 *o;
x = get16le(s);
y = get16le(s);
w = get16le(s);
h = get16le(s);
if (((x + w) > (g->w)) || ((y + h) > (g->h)))
return epuc("bad Image Descriptor", "Corrupt GIF");
g->line_size = g->w * 4;
g->start_x = x * 4;
g->start_y = y * g->line_size;
g->max_x = g->start_x + w * 4;
g->max_y = g->start_y + h * g->line_size;
g->cur_x = g->start_x;
g->cur_y = g->start_y;
g->lflags = get8(s);
if (g->lflags & 0x40) {
g->step = 8 * g->line_size; // first interlaced spacing
g->parse = 3;
} else {
g->step = g->line_size;
g->parse = 0;
}
if (g->lflags & 0x80) {
stbi_gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
g->color_table = (stbi__uint8 *) g->lpal;
} else if (g->flags & 0x80) {
for (i=0; i < 256; ++i) // @OPTIMIZE: reset only the previous transparent
g->pal[i][3] = 255;
if (g->transparent >= 0 && (g->eflags & 0x01))
g->pal[g->transparent][3] = 0;
g->color_table = (stbi__uint8 *) g->pal;
} else
return epuc("missing color table", "Corrupt GIF");
o = stbi_process_gif_raster(s, g);
if (o == NULL) return NULL;
if (req_comp && req_comp != 4)
o = convert_format(o, 4, req_comp, g->w, g->h);
return o;
}
case 0x21: // Comment Extension.
{
int len;
if (get8(s) == 0xF9) { // Graphic Control Extension.
len = get8(s);
if (len == 4) {
g->eflags = get8(s);
get16le(s); // delay
g->transparent = get8(s);
} else {
skip(s, len);
break;
}
}
while ((len = get8(s)) != 0)
skip(s, len);
break;
}
case 0x3B: // gif stream termination code
return (stbi__uint8 *) 1;
default:
return epuc("unknown code", "Corrupt GIF");
}
}
}
static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
stbi__uint8 *u = 0;
stbi_gif g={0};
u = stbi_gif_load_next(s, &g, comp, req_comp);
if (u == (void *) 1) u = 0; // end of animated gif marker
if (u) {
*x = g.w;
*y = g.h;
}
return u;
}
static int stbi_gif_info(stbi *s, int *x, int *y, int *comp)
{
return stbi_gif_info_raw(s,x,y,comp);
}
// *************************************************************************************************
// Radiance RGBE HDR loader
// originally by Nicolas Schulz
#ifndef STBI_NO_HDR
static int hdr_test(stbi *s)
{
const char *signature = "#?RADIANCE\n";
int i;
for (i=0; signature[i]; ++i)
if (get8(s) != signature[i])
return 0;
return 1;
}
static int stbi_hdr_test(stbi* s)
{
int r = hdr_test(s);
stbi_rewind(s);
return r;
}
#define HDR_BUFLEN 1024
static char *hdr_gettoken(stbi *z, char *buffer)
{
int len=0;
char c = '\0';
c = (char) get8(z);
while (!at_eof(z) && c != '\n') {
buffer[len++] = c;
if (len == HDR_BUFLEN-1) {
// flush to end of line
while (!at_eof(z) && get8(z) != '\n')
;
break;
}
c = (char) get8(z);
}
buffer[len] = 0;
return buffer;
}
static void hdr_convert(float *output, stbi_uc *input, int req_comp)
{
if ( input[3] != 0 ) {
float f1;
// Exponent
f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
if (req_comp <= 2)
output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
else {
output[0] = input[0] * f1;
output[1] = input[1] * f1;
output[2] = input[2] * f1;
}
if (req_comp == 2) output[1] = 1;
if (req_comp == 4) output[3] = 1;
} else {
switch (req_comp) {
case 4: output[3] = 1; /* fallthrough */
case 3: output[0] = output[1] = output[2] = 0;
break;
case 2: output[1] = 1; /* fallthrough */
case 1: output[0] = 0;
break;
}
}
}
static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
char buffer[HDR_BUFLEN];
char *token;
int valid = 0;
int width, height;
stbi_uc *scanline;
float *hdr_data;
int len;
unsigned char count, value;
int i, j, k, c1,c2, z;
// Check identifier
if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0)
return epf("not HDR", "Corrupt HDR image");
// Parse header
for(;;) {
token = hdr_gettoken(s,buffer);
if (token[0] == 0) break;
if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
}
if (!valid) return epf("unsupported format", "Unsupported HDR format");
// Parse width and height
// can't use sscanf() if we're not using stdio!
token = hdr_gettoken(s,buffer);
if (strncmp(token, "-Y ", 3)) return epf("unsupported data layout", "Unsupported HDR format");
token += 3;
height = (int) strtol(token, &token, 10);
while (*token == ' ') ++token;
if (strncmp(token, "+X ", 3)) return epf("unsupported data layout", "Unsupported HDR format");
token += 3;
width = (int) strtol(token, NULL, 10);
*x = width;
*y = height;
*comp = 3;
if (req_comp == 0) req_comp = 3;
// Read data
hdr_data = (float *) malloc(height * width * req_comp * sizeof(float));
// Load image data
// image data is stored as some number of sca
if ( width < 8 || width >= 32768) {
// Read flat data
for (j=0; j < height; ++j) {
for (i=0; i < width; ++i) {
stbi_uc rgbe[4];
main_decode_loop:
getn(s, rgbe, 4);
hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
}
}
} else {
// Read RLE-encoded data
scanline = NULL;
for (j = 0; j < height; ++j) {
c1 = get8(s);
c2 = get8(s);
len = get8(s);
if (c1 != 2 || c2 != 2 || (len & 0x80)) {
// not run-length encoded, so we have to actually use THIS data as a decoded
// pixel (note this can't be a valid pixel--one of RGB must be >= 128)
stbi__uint8 rgbe[4];
rgbe[0] = (stbi__uint8) c1;
rgbe[1] = (stbi__uint8) c2;
rgbe[2] = (stbi__uint8) len;
rgbe[3] = (stbi__uint8) get8u(s);
hdr_convert(hdr_data, rgbe, req_comp);
i = 1;
j = 0;
free(scanline);
goto main_decode_loop; // yes, this makes no sense
}
len <<= 8;
len |= get8(s);
if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); }
if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4);
for (k = 0; k < 4; ++k) {
i = 0;
while (i < width) {
count = get8u(s);
if (count > 128) {
// Run
value = get8u(s);
count -= 128;
for (z = 0; z < count; ++z)
scanline[i++ * 4 + k] = value;
} else {
// Dump
for (z = 0; z < count; ++z)
scanline[i++ * 4 + k] = get8u(s);
}
}
}
for (i=0; i < width; ++i)
hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
}
free(scanline);
}
return hdr_data;
}
static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
return hdr_load(s,x,y,comp,req_comp);
}
static int stbi_hdr_info(stbi *s, int *x, int *y, int *comp)
{
char buffer[HDR_BUFLEN];
char *token;
int valid = 0;
if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0) {
stbi_rewind( s );
return 0;
}
for(;;) {
token = hdr_gettoken(s,buffer);
if (token[0] == 0) break;
if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
}
if (!valid) {
stbi_rewind( s );
return 0;
}
token = hdr_gettoken(s,buffer);
if (strncmp(token, "-Y ", 3)) {
stbi_rewind( s );
return 0;
}
token += 3;
*y = (int) strtol(token, &token, 10);
while (*token == ' ') ++token;
if (strncmp(token, "+X ", 3)) {
stbi_rewind( s );
return 0;
}
token += 3;
*x = (int) strtol(token, NULL, 10);
*comp = 3;
return 1;
}
#endif // STBI_NO_HDR
static int stbi_bmp_info(stbi *s, int *x, int *y, int *comp)
{
int hsz;
if (get8(s) != 'B' || get8(s) != 'M') {
stbi_rewind( s );
return 0;
}
skip(s,12);
hsz = get32le(s);
if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) {
stbi_rewind( s );
return 0;
}
if (hsz == 12) {
*x = get16le(s);
*y = get16le(s);
} else {
*x = get32le(s);
*y = get32le(s);
}
if (get16le(s) != 1) {
stbi_rewind( s );
return 0;
}
*comp = get16le(s) / 8;
return 1;
}
static int stbi_psd_info(stbi *s, int *x, int *y, int *comp)
{
int channelCount;
if (get32(s) != 0x38425053) {
stbi_rewind( s );
return 0;
}
if (get16(s) != 1) {
stbi_rewind( s );
return 0;
}
skip(s, 6);
channelCount = get16(s);
if (channelCount < 0 || channelCount > 16) {
stbi_rewind( s );
return 0;
}
*y = get32(s);
*x = get32(s);
if (get16(s) != 8) {
stbi_rewind( s );
return 0;
}
if (get16(s) != 3) {
stbi_rewind( s );
return 0;
}
*comp = 4;
return 1;
}
static int stbi_pic_info(stbi *s, int *x, int *y, int *comp)
{
int act_comp=0,num_packets=0,chained;
pic_packet_t packets[10];
skip(s, 92);
*x = get16(s);
*y = get16(s);
if (at_eof(s)) return 0;
if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
stbi_rewind( s );
return 0;
}
skip(s, 8);
do {
pic_packet_t *packet;
if (num_packets==sizeof(packets)/sizeof(packets[0]))
return 0;
packet = &packets[num_packets++];
chained = get8(s);
packet->size = get8u(s);
packet->type = get8u(s);
packet->channel = get8u(s);
act_comp |= packet->channel;
if (at_eof(s)) {
stbi_rewind( s );
return 0;
}
if (packet->size != 8) {
stbi_rewind( s );
return 0;
}
} while (chained);
*comp = (act_comp & 0x10 ? 4 : 3);
return 1;
}
static int stbi_info_main(stbi *s, int *x, int *y, int *comp)
{
if (stbi_jpeg_info(s, x, y, comp))
return 1;
if (stbi_png_info(s, x, y, comp))
return 1;
if (stbi_gif_info(s, x, y, comp))
return 1;
if (stbi_bmp_info(s, x, y, comp))
return 1;
if (stbi_psd_info(s, x, y, comp))
return 1;
if (stbi_pic_info(s, x, y, comp))
return 1;
#ifndef STBI_NO_HDR
if (stbi_hdr_info(s, x, y, comp))
return 1;
#endif
// test tga last because it's a crappy test!
if (stbi_tga_info(s, x, y, comp))
return 1;
return e("unknown image type", "Image not of any known type, or corrupt");
}
#ifndef STBI_NO_STDIO
int stbi_info(char const *filename, int *x, int *y, int *comp)
{
FILE *f = fopen(filename, "rb");
int result;
if (!f) return e("can't fopen", "Unable to open file");
result = stbi_info_from_file(f, x, y, comp);
fclose(f);
return result;
}
int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
{
int r;
stbi s;
long pos = ftell(f);
start_file(&s, f);
r = stbi_info_main(&s,x,y,comp);
fseek(f,pos,SEEK_SET);
return r;
}
#endif // !STBI_NO_STDIO
int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
{
stbi s;
start_mem(&s,buffer,len);
return stbi_info_main(&s,x,y,comp);
}
int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
{
stbi s;
start_callbacks(&s, (stbi_io_callbacks *) c, user);
return stbi_info_main(&s,x,y,comp);
}
#endif // STBI_HEADER_FILE_ONLY
#if !defined(STBI_NO_STDIO) && defined(_MSC_VER) && _MSC_VER >= 1400
#pragma warning(pop)
#endif
/*
revision history:
1.35 (2014-05-27)
various warnings
fix broken STBI_SIMD path
fix bug where stbi_load_from_file no longer left file pointer in correct place
fix broken non-easy path for 32-bit BMP (possibly never used)
TGA optimization by Arseny Kapoulkine
1.34 (unknown)
use STBI_NOTUSED in resample_row_generic(), fix one more leak in tga failure case
1.33 (2011-07-14)
make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
1.32 (2011-07-13)
support for "info" function for all supported filetypes (SpartanJ)
1.31 (2011-06-20)
a few more leak fixes, bug in PNG handling (SpartanJ)
1.30 (2011-06-11)
added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
removed deprecated format-specific test/load functions
removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
fix inefficiency in decoding 32-bit BMP (David Woo)
1.29 (2010-08-16)
various warning fixes from Aurelien Pocheville
1.28 (2010-08-01)
fix bug in GIF palette transparency (SpartanJ)
1.27 (2010-08-01)
cast-to-stbi__uint8 to fix warnings
1.26 (2010-07-24)
fix bug in file buffering for PNG reported by SpartanJ
1.25 (2010-07-17)
refix trans_data warning (Won Chun)
1.24 (2010-07-12)
perf improvements reading from files on platforms with lock-heavy fgetc()
minor perf improvements for jpeg
deprecated type-specific functions so we'll get feedback if they're needed
attempt to fix trans_data warning (Won Chun)
1.23 fixed bug in iPhone support
1.22 (2010-07-10)
removed image *writing* support
stbi_info support from Jetro Lauha
GIF support from Jean-Marc Lienher
iPhone PNG-extensions from James Brown
warning-fixes from Nicolas Schulz and Janez Zemva (i.e. Janez (U+017D)emva)
1.21 fix use of 'stbi__uint8' in header (reported by jon blow)
1.20 added support for Softimage PIC, by Tom Seddon
1.19 bug in interlaced PNG corruption check (found by ryg)
1.18 2008-08-02
fix a threading bug (local mutable static)
1.17 support interlaced PNG
1.16 major bugfix - convert_format converted one too many pixels
1.15 initialize some fields for thread safety
1.14 fix threadsafe conversion bug
header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
1.13 threadsafe
1.12 const qualifiers in the API
1.11 Support installable IDCT, colorspace conversion routines
1.10 Fixes for 64-bit (don't use "unsigned long")
optimized upsampling by Fabian "ryg" Giesen
1.09 Fix format-conversion for PSD code (bad global variables!)
1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
1.07 attempt to fix C++ warning/errors again
1.06 attempt to fix C++ warning/errors again
1.05 fix TGA loading to return correct *comp and use good luminance calc
1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
1.02 support for (subset of) HDR files, float interface for preferred access to them
1.01 fix bug: possible bug in handling right-side up bmps... not sure
fix bug: the stbi_bmp_load() and stbi_tga_load() functions didn't work at all
1.00 interface to zlib that skips zlib header
0.99 correct handling of alpha in palette
0.98 TGA loader by lonesock; dynamically add loaders (untested)
0.97 jpeg errors on too large a file; also catch another malloc failure
0.96 fix detection of invalid v value - particleman@mollyrocket forum
0.95 during header scan, seek to markers in case of padding
0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
0.93 handle jpegtran output; verbose errors
0.92 read 4,8,16,24,32-bit BMP files of several formats
0.91 output 24-bit Windows 3.0 BMP files
0.90 fix a few more warnings; bump version number to approach 1.0
0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
0.60 fix compiling as c++
0.59 fix warnings: merge Dave Moore's -Wall fixes
0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
0.56 fix bug: zlib uncompressed mode len vs. nlen
0.55 fix bug: restart_interval not initialized to 0
0.54 allow NULL for 'int *comp'
0.53 fix bug in png 3->4; speedup png decoding
0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
0.51 obey req_comp requests, 1-component jpegs return as 1-component,
on 'test' only check type, not whether we support this variant
0.50 first released version
*/
|
the_stack_data/530257.c
|
#include <stdio.h>
#include <stdlib.h>
struct node{
unsigned num;
struct node *next;
};
int main()
{
int i,n,j;
unsigned x=4294967295;
char s[4][3]={"th","st","nd","rd"};
struct node *list,*head,*rear,*p,*q,*r,*l;
head=(struct node *)malloc(sizeof(struct node));
head->num=1;
head->next=NULL;
rear=head;
list=head;
for (i=1;i<4817;i++)
{
l=head;
if (head->num%3!=0 && head->num%5!=0 && head->num%7!=0 && head->num<=x/2)
{
p=(struct node *)malloc(sizeof(struct node));
p->num=head->num*2;
q=l->next;
while (q!=NULL && q->num<p->num)
{
r=q;
q=q->next;
}
if (q==NULL)
{
rear->next=p;
rear=p;
p->next=NULL;
}
else {
r->next=p;
p->next=q;
}
l=p;
}
if (head->num%5!=0 && head->num%7!=0 && head->num<=x/3)
{
p=(struct node *)malloc(sizeof(struct node));
p->num=head->num*3;
q=l->next;
while (q!=NULL && q->num<p->num)
{
r=q;
q=q->next;
}
if (q==NULL)
{
rear->next=p;
rear=p;
p->next=NULL;
}
else {
r->next=p;
p->next=q;
}
l=p;
}
if (head->num%7!=0 && head->num<=x/5)
{
p=(struct node *)malloc(sizeof(struct node));
p->num=head->num*5;
q=l->next;
while (q!=NULL && q->num<p->num)
{
r=q;
q=q->next;
}
if (q==NULL)
{
rear->next=p;
rear=p;
p->next=NULL;
}
else {
r->next=p;
p->next=q;
}
}
if (head->num<=x/7)
{
p=(struct node *)malloc(sizeof(struct node));
p->num=head->num*7;
q=l->next;
while (q!=NULL && q->num<p->num)
{
r=q;
q=q->next;
}
if (q==NULL)
{
rear->next=p;
rear=p;
p->next=NULL;
}
else {
r->next=p;
p->next=q;
}
}
head=head->next;
}
scanf("%d",&n);
while (n!=0)
{
if (n%10==1 && n%100!=11)
j=1;
else if (n%10==2 && n%100!=12)
j=2;
else if (n%10==3 && n%100!=13)
j=3;
else j=0;
p=list;
for (i=1;i<n;i++)
p=p->next;
printf("The %d%s humble number is %d.\n",n,s[j],p->num);
scanf("%d",&n);
}
return 0;
}
|
the_stack_data/1240505.c
|
/// Test program to do matrix multiplication on large arrays.
///
/// Intended to stress virtual memory system.
///
/// Ideally, we could read the matrices off of the file system, and store the
/// result back to the file system!
#include "syscall.h"
/// Sum total of the arrays does not fit in physical memory.
#define DIM 20
static int A[DIM][DIM];
static int B[DIM][DIM];
static int C[DIM][DIM];
int
main(void)
{
int i, j, k;
// First initialize the matrices.
for (i = 0; i < DIM; i++) {
for (j = 0; j < DIM; j++) {
A[i][j] = i;
B[i][j] = j;
C[i][j] = 0;
}
}
// Then multiply them together.
for (i = 0; i < DIM; i++) {
for (j = 0; j < DIM; j++) {
for (k = 0; k < DIM; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
// And then we are done.
return C[DIM - 1][DIM - 1];
}
|
the_stack_data/89200418.c
|
#ifndef IN_GENERATED_CCODE
#define IN_GENERATED_CCODE
#define U_DISABLE_RENAMING 1
#include "unicode/umachine.h"
#endif
U_CDECL_BEGIN
const struct {
double bogus;
uint8_t bytes[83664];
} icudt57l_icu_internal_compound_d3_cnv={ 0.0, {
128,0,218,39,20,0,0,0,0,0,2,0,99,110,118,116,
6,2,0,0,57,1,0,0,32,67,111,112,121,114,105,103,
104,116,32,40,67,41,32,50,48,49,54,44,32,73,110,116,
101,114,110,97,116,105,111,110,97,108,32,66,117,115,105,110,
101,115,115,32,77,97,99,104,105,110,101,115,32,67,111,114,
112,111,114,97,116,105,111,110,32,97,110,100,32,111,116,104,
101,114,115,46,32,65,108,108,32,82,105,103,104,116,115,32,
82,101,115,101,114,118,101,100,46,32,0,0,0,0,0,0,
100,0,0,0,105,99,117,45,105,110,116,101,114,110,97,108,
45,99,111,109,112,111,117,110,100,45,100,51,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,255,2,1,2,63,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,4,4,215,0,3,0,0,0,0,0,0,0,
32,12,0,0,116,97,0,0,136,135,0,0,1,168,67,1,
96,181,0,0,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
254,255,96,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,0,0,0,1,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,127,0,0,1,254,0,0,1,
125,1,0,1,252,1,0,1,123,2,0,1,250,2,0,2,
250,2,0,1,121,3,0,1,248,3,0,1,119,4,0,2,
119,4,0,2,119,4,0,2,119,4,0,2,119,4,0,2,
119,4,0,2,119,4,0,1,246,4,0,1,117,5,0,1,
244,5,0,1,115,6,0,1,242,6,0,1,113,7,0,1,
240,7,0,1,111,8,0,1,238,8,0,1,109,9,0,1,
236,9,0,1,107,10,0,1,234,10,0,1,105,11,0,1,
232,11,0,1,103,12,0,1,230,12,0,1,101,13,0,1,
228,13,0,1,99,14,0,1,226,14,0,1,97,15,0,1,
224,15,0,1,95,16,0,1,222,16,0,2,222,16,0,1,
93,17,0,1,220,17,0,1,91,18,0,1,218,18,0,1,
89,19,0,1,216,19,0,1,87,20,0,1,214,20,0,1,
85,21,0,1,212,21,0,1,83,22,0,1,210,22,0,1,
81,23,0,1,208,23,0,1,79,24,0,1,206,24,0,1,
77,25,0,1,204,25,0,1,75,26,0,1,202,26,0,1,
73,27,0,1,200,27,0,1,71,28,0,1,198,28,0,1,
69,29,0,1,196,29,0,1,67,30,0,1,194,30,0,1,
65,31,0,1,192,31,0,1,63,32,0,1,190,32,0,1,
61,33,0,1,188,33,0,1,59,34,0,1,186,34,0,1,
57,35,0,1,184,35,0,1,55,36,0,1,182,36,0,1,
53,37,0,1,180,37,0,1,51,38,0,1,178,38,0,1,
49,39,0,1,176,39,0,1,47,40,0,1,174,40,0,1,
45,41,0,1,172,41,0,1,43,42,0,1,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,0,0,64,128,1,0,64,128,2,0,64,128,
3,0,64,128,4,0,64,128,5,0,64,128,6,0,64,128,
7,0,64,128,8,0,64,128,9,0,64,128,10,0,64,128,
11,0,64,128,12,0,64,128,13,0,64,128,14,0,64,128,
15,0,64,128,16,0,64,128,17,0,64,128,18,0,64,128,
19,0,64,128,20,0,64,128,21,0,64,128,22,0,64,128,
23,0,64,128,24,0,64,128,25,0,64,128,26,0,64,128,
27,0,64,128,28,0,64,128,29,0,64,128,30,0,64,128,
31,0,64,128,32,0,64,128,33,0,64,128,34,0,64,128,
35,0,64,128,36,0,64,128,37,0,64,128,38,0,64,128,
39,0,64,128,40,0,64,128,41,0,64,128,42,0,64,128,
43,0,64,128,44,0,64,128,45,0,64,128,46,0,64,128,
47,0,64,128,48,0,64,128,49,0,64,128,50,0,64,128,
51,0,64,128,52,0,64,128,53,0,64,128,54,0,64,128,
55,0,64,128,56,0,64,128,57,0,64,128,58,0,64,128,
59,0,64,128,60,0,64,128,61,0,64,128,62,0,64,128,
63,0,64,128,64,0,64,128,65,0,64,128,66,0,64,128,
67,0,64,128,68,0,64,128,69,0,64,128,70,0,64,128,
71,0,64,128,72,0,64,128,73,0,64,128,74,0,64,128,
75,0,64,128,76,0,64,128,77,0,64,128,78,0,64,128,
79,0,64,128,80,0,64,128,81,0,64,128,82,0,64,128,
83,0,64,128,84,0,64,128,85,0,64,128,86,0,64,128,
87,0,64,128,88,0,64,128,89,0,64,128,90,0,64,128,
91,0,64,128,92,0,64,128,93,0,64,128,94,0,64,128,
95,0,64,128,96,0,64,128,97,0,64,128,98,0,64,128,
99,0,64,128,100,0,64,128,101,0,64,128,102,0,64,128,
103,0,64,128,104,0,64,128,105,0,64,128,106,0,64,128,
107,0,64,128,108,0,64,128,109,0,64,128,110,0,64,128,
111,0,64,128,112,0,64,128,113,0,64,128,114,0,64,128,
115,0,64,128,116,0,64,128,117,0,64,128,118,0,64,128,
119,0,64,128,120,0,64,128,121,0,64,128,122,0,64,128,
123,0,64,128,124,0,64,128,125,0,64,128,126,0,64,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,255,255,112,128,255,255,112,128,255,255,112,128,
255,255,112,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
254,255,96,128,254,255,96,128,254,255,96,128,254,255,96,128,
255,255,112,128,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,169,32,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,60,34,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,148,33,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,226,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,9,33,254,255,193,37,
192,37,183,37,182,37,100,38,96,38,97,38,101,38,103,38,
99,38,254,255,200,37,163,37,208,37,209,37,146,37,164,37,
165,37,168,37,167,37,166,37,169,37,104,38,15,38,14,38,
28,38,30,38,254,255,254,255,254,255,149,33,151,33,153,33,
150,33,152,33,254,255,105,38,254,255,108,38,127,50,28,50,
254,255,199,51,34,33,194,51,216,51,33,33,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,230,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,49,49,
50,49,51,49,52,49,53,49,54,49,55,49,56,49,57,49,
58,49,59,49,60,49,61,49,62,49,63,49,64,49,65,49,
66,49,67,49,68,49,69,49,70,49,71,49,72,49,73,49,
74,49,75,49,76,49,77,49,78,49,79,49,80,49,81,49,
82,49,83,49,84,49,85,49,86,49,87,49,88,49,89,49,
90,49,91,49,92,49,93,49,94,49,95,49,96,49,97,49,
98,49,99,49,100,49,101,49,102,49,103,49,104,49,105,49,
106,49,107,49,108,49,109,49,110,49,111,49,112,49,113,49,
114,49,115,49,116,49,117,49,118,49,119,49,120,49,121,49,
122,49,123,49,124,49,125,49,126,49,127,49,128,49,129,49,
130,49,131,49,132,49,133,49,134,49,135,49,136,49,137,49,
138,49,139,49,140,49,141,49,142,49,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,112,33,113,33,
114,33,115,33,116,33,117,33,118,33,119,33,120,33,121,33,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,149,51,150,51,151,51,
19,33,152,51,196,51,163,51,164,51,165,51,166,51,153,51,
154,51,155,51,156,51,157,51,158,51,159,51,160,51,161,51,
162,51,202,51,141,51,142,51,143,51,207,51,136,51,137,51,
200,51,167,51,168,51,176,51,177,51,178,51,179,51,180,51,
181,51,182,51,183,51,184,51,185,51,128,51,129,51,130,51,
131,51,132,51,186,51,187,51,188,51,189,51,190,51,191,51,
144,51,145,51,146,51,147,51,148,51,38,33,192,51,193,51,
138,51,139,51,140,51,214,51,197,51,173,51,174,51,175,51,
219,51,169,51,170,51,171,51,172,51,221,51,208,51,211,51,
195,51,201,51,220,51,198,51,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,96,50,97,50,98,50,99,50,
100,50,101,50,102,50,103,50,104,50,105,50,106,50,107,50,
108,50,109,50,110,50,111,50,112,50,113,50,114,50,115,50,
116,50,117,50,118,50,119,50,120,50,121,50,122,50,123,50,
208,36,209,36,210,36,211,36,212,36,213,36,214,36,215,36,
216,36,217,36,218,36,219,36,220,36,221,36,222,36,223,36,
224,36,225,36,226,36,227,36,228,36,229,36,230,36,231,36,
232,36,233,36,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,106,36,107,36,108,36,109,36,
110,36,254,255,83,33,84,33,254,255,254,255,91,33,92,33,
93,33,94,33,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,0,50,1,50,2,50,3,50,4,50,
5,50,6,50,7,50,8,50,9,50,10,50,11,50,12,50,
13,50,14,50,15,50,16,50,17,50,18,50,19,50,20,50,
21,50,22,50,23,50,24,50,25,50,26,50,27,50,156,36,
157,36,158,36,159,36,160,36,161,36,162,36,163,36,164,36,
165,36,166,36,167,36,168,36,169,36,170,36,171,36,172,36,
173,36,174,36,175,36,176,36,177,36,178,36,179,36,180,36,
181,36,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,116,32,127,32,129,32,130,32,131,32,
132,32,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,0,172,1,172,4,172,7,172,8,172,9,172,
10,172,16,172,17,172,18,172,19,172,20,172,21,172,22,172,
23,172,25,172,26,172,27,172,28,172,29,172,32,172,36,172,
44,172,45,172,47,172,48,172,49,172,56,172,57,172,60,172,
64,172,75,172,77,172,84,172,88,172,92,172,112,172,113,172,
116,172,119,172,120,172,122,172,128,172,129,172,131,172,132,172,
133,172,134,172,137,172,138,172,139,172,140,172,144,172,148,172,
156,172,157,172,159,172,160,172,161,172,168,172,169,172,170,172,
172,172,175,172,176,172,184,172,185,172,187,172,188,172,189,172,
193,172,196,172,200,172,204,172,213,172,215,172,224,172,225,172,
228,172,231,172,232,172,234,172,236,172,239,172,240,172,241,172,
243,172,245,172,246,172,252,172,253,172,0,173,4,173,6,173,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,12,173,13,173,15,173,17,173,24,173,28,173,32,173,
41,173,44,173,45,173,52,173,53,173,56,173,60,173,68,173,
69,173,71,173,73,173,80,173,84,173,88,173,97,173,99,173,
108,173,109,173,112,173,115,173,116,173,117,173,118,173,123,173,
124,173,125,173,127,173,129,173,130,173,136,173,137,173,140,173,
144,173,156,173,157,173,164,173,183,173,192,173,193,173,196,173,
200,173,208,173,209,173,211,173,220,173,224,173,228,173,248,173,
249,173,252,173,255,173,0,174,1,174,8,174,9,174,11,174,
13,174,20,174,48,174,49,174,52,174,55,174,56,174,58,174,
64,174,65,174,67,174,69,174,70,174,74,174,76,174,77,174,
78,174,80,174,84,174,86,174,92,174,93,174,95,174,96,174,
97,174,101,174,104,174,105,174,108,174,112,174,120,174,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
121,174,123,174,124,174,125,174,132,174,133,174,140,174,188,174,
189,174,190,174,192,174,196,174,204,174,205,174,207,174,208,174,
209,174,216,174,217,174,220,174,232,174,235,174,237,174,244,174,
248,174,252,174,7,175,8,175,13,175,16,175,44,175,45,175,
48,175,50,175,52,175,60,175,61,175,63,175,65,175,66,175,
67,175,72,175,73,175,80,175,92,175,93,175,100,175,101,175,
121,175,128,175,132,175,136,175,144,175,145,175,149,175,156,175,
184,175,185,175,188,175,192,175,199,175,200,175,201,175,203,175,
205,175,206,175,212,175,220,175,232,175,233,175,240,175,241,175,
244,175,248,175,0,176,1,176,4,176,12,176,16,176,20,176,
28,176,29,176,40,176,68,176,69,176,72,176,74,176,76,176,
78,176,83,176,84,176,85,176,87,176,89,176,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,93,176,
124,176,125,176,128,176,132,176,140,176,141,176,143,176,145,176,
152,176,153,176,154,176,156,176,159,176,160,176,161,176,162,176,
168,176,169,176,171,176,172,176,173,176,174,176,175,176,177,176,
179,176,180,176,181,176,184,176,188,176,196,176,197,176,199,176,
200,176,201,176,208,176,209,176,212,176,216,176,224,176,229,176,
8,177,9,177,11,177,12,177,16,177,18,177,19,177,24,177,
25,177,27,177,28,177,29,177,35,177,36,177,37,177,40,177,
44,177,52,177,53,177,55,177,56,177,57,177,64,177,65,177,
68,177,72,177,80,177,81,177,84,177,85,177,88,177,92,177,
96,177,120,177,121,177,124,177,128,177,130,177,136,177,137,177,
139,177,141,177,146,177,147,177,148,177,152,177,156,177,168,177,
204,177,208,177,212,177,220,177,221,177,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,223,177,232,177,
233,177,236,177,240,177,249,177,251,177,253,177,4,178,5,178,
8,178,11,178,12,178,20,178,21,178,23,178,25,178,32,178,
52,178,60,178,88,178,92,178,96,178,104,178,105,178,116,178,
117,178,124,178,132,178,133,178,137,178,144,178,145,178,148,178,
152,178,153,178,154,178,160,178,161,178,163,178,165,178,166,178,
170,178,172,178,176,178,180,178,200,178,201,178,204,178,208,178,
210,178,216,178,217,178,219,178,221,178,226,178,228,178,229,178,
230,178,232,178,235,178,236,178,237,178,238,178,239,178,243,178,
244,178,245,178,247,178,248,178,249,178,250,178,251,178,255,178,
0,179,1,179,4,179,8,179,16,179,17,179,19,179,20,179,
21,179,28,179,84,179,85,179,86,179,88,179,91,179,92,179,
94,179,95,179,100,179,101,179,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,103,179,105,179,107,179,
110,179,112,179,113,179,116,179,120,179,128,179,129,179,131,179,
132,179,133,179,140,179,144,179,148,179,160,179,161,179,168,179,
172,179,196,179,197,179,200,179,203,179,204,179,206,179,208,179,
212,179,213,179,215,179,217,179,219,179,221,179,224,179,228,179,
232,179,252,179,16,180,24,180,28,180,32,180,40,180,41,180,
43,180,52,180,80,180,81,180,84,180,88,180,96,180,97,180,
99,180,101,180,108,180,128,180,136,180,157,180,164,180,168,180,
172,180,181,180,183,180,185,180,192,180,196,180,200,180,208,180,
213,180,220,180,221,180,224,180,227,180,228,180,230,180,236,180,
237,180,239,180,241,180,248,180,20,181,21,181,24,181,27,181,
28,181,36,181,37,181,39,181,40,181,41,181,42,181,48,181,
49,181,52,181,56,181,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,64,181,65,181,67,181,68,181,
69,181,75,181,76,181,77,181,80,181,84,181,92,181,93,181,
95,181,96,181,97,181,160,181,161,181,164,181,168,181,170,181,
171,181,176,181,177,181,179,181,180,181,181,181,187,181,188,181,
189,181,192,181,196,181,204,181,205,181,207,181,208,181,209,181,
216,181,236,181,16,182,17,182,20,182,24,182,37,182,44,182,
52,182,72,182,100,182,104,182,156,182,157,182,160,182,164,182,
171,182,172,182,177,182,212,182,240,182,244,182,248,182,0,183,
1,183,5,183,40,183,41,183,44,183,47,183,48,183,56,183,
57,183,59,183,68,183,72,183,76,183,84,183,85,183,96,183,
100,183,104,183,112,183,113,183,115,183,117,183,124,183,125,183,
128,183,132,183,140,183,141,183,143,183,144,183,145,183,146,183,
150,183,151,183,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,152,183,153,183,156,183,160,183,168,183,
169,183,171,183,172,183,173,183,180,183,181,183,184,183,199,183,
201,183,236,183,237,183,240,183,244,183,252,183,253,183,255,183,
0,184,1,184,7,184,8,184,9,184,12,184,16,184,24,184,
25,184,27,184,29,184,36,184,37,184,40,184,44,184,52,184,
53,184,55,184,56,184,57,184,64,184,68,184,81,184,83,184,
92,184,93,184,96,184,100,184,108,184,109,184,111,184,113,184,
120,184,124,184,141,184,168,184,176,184,180,184,184,184,192,184,
193,184,195,184,197,184,204,184,208,184,212,184,221,184,223,184,
225,184,232,184,233,184,236,184,240,184,248,184,249,184,251,184,
253,184,4,185,24,185,32,185,60,185,61,185,64,185,68,185,
76,185,79,185,81,185,88,185,89,185,92,185,96,185,104,185,
105,185,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,107,185,109,185,116,185,117,185,120,185,124,185,
132,185,133,185,135,185,137,185,138,185,141,185,142,185,172,185,
173,185,176,185,180,185,188,185,189,185,191,185,193,185,200,185,
201,185,204,185,206,185,207,185,208,185,209,185,210,185,216,185,
217,185,219,185,221,185,222,185,225,185,227,185,228,185,229,185,
232,185,236,185,244,185,245,185,247,185,248,185,249,185,250,185,
0,186,1,186,8,186,21,186,56,186,57,186,60,186,64,186,
66,186,72,186,73,186,75,186,77,186,78,186,83,186,84,186,
85,186,88,186,92,186,100,186,101,186,103,186,104,186,105,186,
112,186,113,186,116,186,120,186,131,186,132,186,133,186,135,186,
140,186,168,186,169,186,171,186,172,186,176,186,178,186,184,186,
185,186,187,186,189,186,196,186,200,186,216,186,217,186,252,186,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,0,187,4,187,13,187,15,187,17,187,24,187,28,187,
32,187,41,187,43,187,52,187,53,187,54,187,56,187,59,187,
60,187,61,187,62,187,68,187,69,187,71,187,73,187,77,187,
79,187,80,187,84,187,88,187,97,187,99,187,108,187,136,187,
140,187,144,187,164,187,168,187,172,187,180,187,183,187,192,187,
196,187,200,187,208,187,211,187,248,187,249,187,252,187,255,187,
0,188,2,188,8,188,9,188,11,188,12,188,13,188,15,188,
17,188,20,188,21,188,22,188,23,188,24,188,27,188,28,188,
29,188,30,188,31,188,36,188,37,188,39,188,41,188,45,188,
48,188,49,188,52,188,56,188,64,188,65,188,67,188,68,188,
69,188,73,188,76,188,77,188,80,188,93,188,132,188,133,188,
136,188,139,188,140,188,142,188,148,188,149,188,151,188,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
153,188,154,188,160,188,161,188,164,188,167,188,168,188,176,188,
177,188,179,188,180,188,181,188,188,188,189,188,192,188,196,188,
205,188,207,188,208,188,209,188,213,188,216,188,220,188,244,188,
245,188,246,188,248,188,252,188,4,189,5,189,7,189,9,189,
16,189,20,189,36,189,44,189,64,189,72,189,73,189,76,189,
80,189,88,189,89,189,100,189,104,189,128,189,129,189,132,189,
135,189,136,189,137,189,138,189,144,189,145,189,147,189,149,189,
153,189,154,189,156,189,164,189,176,189,184,189,212,189,213,189,
216,189,220,189,233,189,240,189,244,189,248,189,0,190,3,190,
5,190,12,190,13,190,16,190,20,190,28,190,29,190,31,190,
68,190,69,190,72,190,76,190,78,190,84,190,85,190,87,190,
89,190,90,190,91,190,96,190,97,190,100,190,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,104,190,
106,190,112,190,113,190,115,190,116,190,117,190,123,190,124,190,
125,190,128,190,132,190,140,190,141,190,143,190,144,190,145,190,
152,190,153,190,168,190,208,190,209,190,212,190,215,190,216,190,
224,190,227,190,228,190,229,190,236,190,1,191,8,191,9,191,
24,191,25,191,27,191,28,191,29,191,64,191,65,191,68,191,
72,191,80,191,81,191,85,191,148,191,176,191,197,191,204,191,
205,191,208,191,212,191,220,191,223,191,225,191,60,192,81,192,
88,192,92,192,96,192,104,192,105,192,144,192,145,192,148,192,
152,192,160,192,161,192,163,192,165,192,172,192,173,192,175,192,
176,192,179,192,180,192,181,192,182,192,188,192,189,192,191,192,
192,192,193,192,197,192,200,192,201,192,204,192,208,192,216,192,
217,192,219,192,220,192,221,192,228,192,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,229,192,232,192,
236,192,244,192,245,192,247,192,249,192,0,193,4,193,8,193,
16,193,21,193,28,193,29,193,30,193,31,193,32,193,35,193,
36,193,38,193,39,193,44,193,45,193,47,193,48,193,49,193,
54,193,56,193,57,193,60,193,64,193,72,193,73,193,75,193,
76,193,77,193,84,193,85,193,88,193,92,193,100,193,101,193,
103,193,104,193,105,193,112,193,116,193,120,193,133,193,140,193,
141,193,142,193,144,193,148,193,150,193,156,193,157,193,159,193,
161,193,165,193,168,193,169,193,172,193,176,193,189,193,196,193,
200,193,204,193,212,193,215,193,216,193,224,193,228,193,232,193,
240,193,241,193,243,193,252,193,253,193,0,194,4,194,12,194,
13,194,15,194,17,194,24,194,25,194,28,194,31,194,32,194,
40,194,41,194,43,194,45,194,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,47,194,49,194,50,194,
52,194,72,194,80,194,81,194,84,194,88,194,96,194,101,194,
108,194,109,194,112,194,116,194,124,194,125,194,127,194,129,194,
136,194,137,194,144,194,152,194,155,194,157,194,164,194,165,194,
168,194,172,194,173,194,180,194,181,194,183,194,185,194,220,194,
221,194,224,194,227,194,228,194,235,194,236,194,237,194,239,194,
241,194,246,194,248,194,249,194,251,194,252,194,0,195,8,195,
9,195,12,195,13,195,19,195,20,195,21,195,24,195,28,195,
36,195,37,195,40,195,41,195,69,195,104,195,105,195,108,195,
112,195,114,195,120,195,121,195,124,195,125,195,132,195,136,195,
140,195,192,195,216,195,217,195,220,195,223,195,224,195,226,195,
232,195,233,195,237,195,244,195,245,195,248,195,8,196,16,196,
36,196,44,196,48,196,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,52,196,60,196,61,196,72,196,
100,196,101,196,104,196,108,196,116,196,117,196,121,196,128,196,
148,196,156,196,184,196,188,196,233,196,240,196,241,196,244,196,
248,196,250,196,255,196,0,197,1,197,12,197,16,197,20,197,
28,197,40,197,41,197,44,197,48,197,56,197,57,197,59,197,
61,197,68,197,69,197,72,197,73,197,74,197,76,197,77,197,
78,197,83,197,84,197,85,197,87,197,88,197,89,197,93,197,
94,197,96,197,97,197,100,197,104,197,112,197,113,197,115,197,
116,197,117,197,124,197,125,197,128,197,132,197,135,197,140,197,
141,197,143,197,145,197,149,197,151,197,152,197,156,197,160,197,
169,197,180,197,181,197,184,197,185,197,187,197,188,197,189,197,
190,197,196,197,197,197,198,197,199,197,200,197,201,197,202,197,
204,197,206,197,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,208,197,209,197,212,197,216,197,224,197,
225,197,227,197,229,197,236,197,237,197,238,197,240,197,244,197,
246,197,247,197,252,197,253,197,254,197,255,197,0,198,1,198,
5,198,6,198,7,198,8,198,12,198,16,198,24,198,25,198,
27,198,28,198,36,198,37,198,40,198,44,198,45,198,46,198,
48,198,51,198,52,198,53,198,55,198,57,198,59,198,64,198,
65,198,68,198,72,198,80,198,81,198,83,198,84,198,85,198,
92,198,93,198,96,198,108,198,111,198,113,198,120,198,121,198,
124,198,128,198,136,198,137,198,139,198,141,198,148,198,149,198,
152,198,156,198,164,198,165,198,167,198,169,198,176,198,177,198,
180,198,184,198,185,198,186,198,192,198,193,198,195,198,197,198,
204,198,205,198,208,198,212,198,220,198,221,198,224,198,225,198,
232,198,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,233,198,236,198,240,198,248,198,249,198,253,198,
4,199,5,199,8,199,12,199,20,199,21,199,23,199,25,199,
32,199,33,199,36,199,40,199,48,199,49,199,51,199,53,199,
55,199,60,199,61,199,64,199,68,199,74,199,76,199,77,199,
79,199,81,199,82,199,83,199,84,199,85,199,86,199,87,199,
88,199,92,199,96,199,104,199,107,199,116,199,117,199,120,199,
124,199,125,199,126,199,131,199,132,199,133,199,135,199,136,199,
137,199,138,199,142,199,144,199,145,199,148,199,150,199,151,199,
152,199,154,199,160,199,161,199,163,199,164,199,165,199,166,199,
172,199,173,199,176,199,180,199,188,199,189,199,191,199,192,199,
193,199,200,199,201,199,204,199,206,199,208,199,216,199,221,199,
228,199,232,199,236,199,0,200,1,200,4,200,8,200,10,200,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,16,200,17,200,19,200,21,200,22,200,28,200,29,200,
32,200,36,200,44,200,45,200,47,200,49,200,56,200,60,200,
64,200,72,200,73,200,76,200,77,200,84,200,112,200,113,200,
116,200,120,200,122,200,128,200,129,200,131,200,133,200,134,200,
135,200,139,200,140,200,141,200,148,200,157,200,159,200,161,200,
168,200,188,200,189,200,196,200,200,200,204,200,212,200,213,200,
215,200,217,200,224,200,225,200,228,200,245,200,252,200,253,200,
0,201,4,201,5,201,6,201,12,201,13,201,15,201,17,201,
24,201,44,201,52,201,80,201,81,201,84,201,88,201,96,201,
97,201,99,201,108,201,112,201,116,201,124,201,136,201,137,201,
140,201,144,201,152,201,153,201,155,201,157,201,192,201,193,201,
196,201,199,201,200,201,202,201,208,201,209,201,211,201,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
213,201,214,201,217,201,218,201,220,201,221,201,224,201,226,201,
228,201,231,201,236,201,237,201,239,201,240,201,241,201,248,201,
249,201,252,201,0,202,8,202,9,202,11,202,12,202,13,202,
20,202,24,202,41,202,76,202,77,202,80,202,84,202,92,202,
93,202,95,202,96,202,97,202,104,202,125,202,132,202,152,202,
188,202,189,202,192,202,196,202,204,202,205,202,207,202,209,202,
211,202,216,202,217,202,224,202,236,202,244,202,8,203,16,203,
20,203,24,203,32,203,33,203,65,203,72,203,73,203,76,203,
80,203,88,203,89,203,93,203,100,203,120,203,121,203,156,203,
184,203,212,203,228,203,231,203,233,203,12,204,13,204,16,204,
20,204,28,204,29,204,33,204,34,204,39,204,40,204,41,204,
44,204,46,204,48,204,56,204,57,204,59,204,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,60,204,
61,204,62,204,68,204,69,204,72,204,76,204,84,204,85,204,
87,204,88,204,89,204,96,204,100,204,102,204,104,204,112,204,
117,204,152,204,153,204,156,204,160,204,168,204,169,204,171,204,
172,204,173,204,180,204,181,204,184,204,188,204,196,204,197,204,
199,204,201,204,208,204,212,204,228,204,236,204,240,204,1,205,
8,205,9,205,12,205,16,205,24,205,25,205,27,205,29,205,
36,205,40,205,44,205,57,205,92,205,96,205,100,205,108,205,
109,205,111,205,113,205,120,205,136,205,148,205,149,205,152,205,
156,205,164,205,165,205,167,205,169,205,176,205,196,205,204,205,
208,205,232,205,236,205,240,205,248,205,249,205,251,205,253,205,
4,206,8,206,12,206,20,206,25,206,32,206,33,206,36,206,
40,206,48,206,49,206,51,206,53,206,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,88,206,89,206,
92,206,95,206,96,206,97,206,104,206,105,206,107,206,109,206,
116,206,117,206,120,206,124,206,132,206,133,206,135,206,137,206,
144,206,145,206,148,206,152,206,160,206,161,206,163,206,164,206,
165,206,172,206,173,206,193,206,228,206,229,206,232,206,235,206,
236,206,244,206,245,206,247,206,248,206,249,206,0,207,1,207,
4,207,8,207,16,207,17,207,19,207,21,207,28,207,32,207,
36,207,44,207,45,207,47,207,48,207,49,207,56,207,84,207,
85,207,88,207,92,207,100,207,101,207,103,207,105,207,112,207,
113,207,116,207,120,207,128,207,133,207,140,207,161,207,168,207,
176,207,196,207,224,207,225,207,228,207,232,207,240,207,241,207,
243,207,245,207,252,207,0,208,4,208,17,208,24,208,45,208,
52,208,53,208,56,208,60,208,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,68,208,69,208,71,208,
73,208,80,208,84,208,88,208,96,208,108,208,109,208,112,208,
116,208,124,208,125,208,129,208,164,208,165,208,168,208,172,208,
180,208,181,208,183,208,185,208,192,208,193,208,196,208,200,208,
201,208,208,208,209,208,211,208,212,208,213,208,220,208,221,208,
224,208,228,208,236,208,237,208,239,208,240,208,241,208,248,208,
13,209,48,209,49,209,52,209,56,209,58,209,64,209,65,209,
67,209,68,209,69,209,76,209,77,209,80,209,84,209,92,209,
93,209,95,209,97,209,104,209,108,209,124,209,132,209,136,209,
160,209,161,209,164,209,168,209,176,209,177,209,179,209,181,209,
186,209,188,209,192,209,216,209,244,209,248,209,7,210,9,210,
16,210,44,210,45,210,48,210,52,210,60,210,61,210,63,210,
65,210,72,210,92,210,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,100,210,128,210,129,210,132,210,
136,210,144,210,145,210,149,210,156,210,160,210,164,210,172,210,
177,210,184,210,185,210,188,210,191,210,192,210,194,210,200,210,
201,210,203,210,212,210,216,210,220,210,228,210,229,210,240,210,
241,210,244,210,248,210,0,211,1,211,3,211,5,211,12,211,
13,211,14,211,16,211,20,211,22,211,28,211,29,211,31,211,
32,211,33,211,37,211,40,211,41,211,44,211,48,211,56,211,
57,211,59,211,60,211,61,211,68,211,69,211,124,211,125,211,
128,211,132,211,140,211,141,211,143,211,144,211,145,211,152,211,
153,211,156,211,160,211,168,211,169,211,171,211,173,211,180,211,
184,211,188,211,196,211,197,211,200,211,201,211,208,211,216,211,
225,211,227,211,236,211,237,211,240,211,244,211,252,211,253,211,
255,211,1,212,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,8,212,29,212,64,212,68,212,92,212,
96,212,100,212,109,212,111,212,120,212,121,212,124,212,127,212,
128,212,130,212,136,212,137,212,139,212,141,212,148,212,169,212,
204,212,208,212,212,212,220,212,223,212,232,212,236,212,240,212,
248,212,251,212,253,212,4,213,8,213,12,213,20,213,21,213,
23,213,60,213,61,213,64,213,68,213,76,213,77,213,79,213,
81,213,88,213,89,213,92,213,96,213,101,213,104,213,105,213,
107,213,109,213,116,213,117,213,120,213,124,213,132,213,133,213,
135,213,136,213,137,213,144,213,165,213,200,213,201,213,204,213,
208,213,210,213,216,213,217,213,219,213,221,213,228,213,229,213,
232,213,236,213,244,213,245,213,247,213,249,213,0,214,1,214,
4,214,8,214,16,214,17,214,19,214,20,214,21,214,28,214,
32,214,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,36,214,45,214,56,214,57,214,60,214,64,214,
69,214,72,214,73,214,75,214,77,214,81,214,84,214,85,214,
88,214,92,214,103,214,105,214,112,214,113,214,116,214,131,214,
133,214,140,214,141,214,144,214,148,214,157,214,159,214,161,214,
168,214,172,214,176,214,185,214,187,214,196,214,197,214,200,214,
204,214,209,214,212,214,215,214,217,214,224,214,228,214,232,214,
240,214,245,214,252,214,253,214,0,215,4,215,17,215,24,215,
25,215,28,215,32,215,40,215,41,215,43,215,45,215,52,215,
53,215,56,215,60,215,68,215,71,215,73,215,80,215,81,215,
84,215,86,215,87,215,88,215,89,215,96,215,97,215,99,215,
101,215,105,215,108,215,112,215,116,215,124,215,125,215,129,215,
136,215,137,215,140,215,144,215,152,215,153,215,155,215,157,215,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,100,97,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,78,118,254,255,
245,120,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,107,78,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,64,146,254,255,254,255,8,88,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
122,117,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,79,88,55,97,254,255,254,255,254,255,234,105,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,0,249,
254,255,254,255,254,255,254,255,254,255,1,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,2,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
16,146,254,255,254,255,254,255,242,143,254,255,254,255,254,255,
202,100,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,211,79,
30,80,254,255,254,255,254,255,254,255,254,255,112,87,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,187,102,
254,255,254,255,135,109,254,255,254,255,159,116,165,116,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,232,104,254,255,
254,255,254,255,206,120,254,255,254,255,107,126,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,160,102,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,253,130,254,255,
254,255,254,255,254,255,254,255,3,249,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,4,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,5,249,254,255,254,255,236,91,254,255,254,255,254,255,
254,255,47,116,216,116,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,138,79,254,255,
254,255,254,255,254,255,254,255,254,255,154,112,254,255,214,115,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
160,93,254,255,254,255,78,101,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,117,87,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
127,125,9,128,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,192,142,254,255,254,255,254,255,182,146,254,255,254,255,
254,255,215,157,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,195,109,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,6,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,7,249,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,251,82,254,255,71,117,254,255,
254,255,254,255,8,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,164,82,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,9,249,254,255,254,255,254,255,17,102,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,10,249,
254,255,11,79,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
227,101,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,152,115,254,255,254,255,
130,116,163,116,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,45,128,
254,255,254,255,254,255,254,255,254,255,33,147,36,147,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,11,249,12,249,254,255,
254,255,13,249,254,255,254,255,14,249,15,249,16,249,17,249,
18,249,19,249,254,255,20,249,21,249,22,249,23,249,24,249,
254,255,25,249,26,249,27,249,28,249,254,255,29,249,254,255,
30,249,31,249,254,255,32,249,254,255,254,255,254,255,33,249,
143,103,254,255,115,110,34,249,254,255,35,249,36,249,37,249,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,38,249,39,249,254,255,254,255,254,255,40,249,
41,249,42,249,43,249,44,249,254,255,45,249,103,81,254,255,
254,255,254,255,46,249,254,255,254,255,254,255,202,121,254,255,
254,255,254,255,254,255,254,255,215,91,254,255,47,249,254,255,
254,255,254,255,48,249,49,249,50,249,254,255,51,249,52,249,
53,249,54,249,55,249,56,249,254,255,57,249,58,249,59,249,
60,249,61,249,62,249,63,249,64,249,65,249,66,249,67,249,
254,255,68,249,69,249,254,255,254,255,254,255,70,249,71,249,
254,255,72,249,73,249,254,255,74,249,75,249,76,249,77,249,
78,249,79,249,80,249,81,249,254,255,254,255,123,103,254,255,
82,249,83,249,84,249,85,249,86,249,87,249,254,255,88,249,
89,249,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,30,124,254,255,
254,255,254,255,254,255,254,255,254,255,190,111,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,31,147,254,255,83,117,254,255,254,255,93,144,254,255,
254,255,254,255,254,255,7,98,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,110,87,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,113,254,255,254,255,
177,121,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,6,112,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,253,101,254,255,254,255,30,113,254,255,
254,255,254,255,109,78,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
147,103,254,255,254,255,254,255,90,249,254,255,254,255,254,255,
254,255,254,255,154,130,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,39,145,254,255,
254,255,254,255,91,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,92,249,254,255,254,255,254,255,254,255,254,255,
93,249,254,255,254,255,94,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,229,100,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,31,136,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,222,144,254,255,13,93,254,255,10,132,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,17,106,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,198,102,119,107,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,137,116,254,255,
254,255,254,255,254,255,254,255,74,147,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,174,107,254,255,254,255,
254,255,254,255,254,255,254,255,95,249,186,92,254,255,254,255,
254,255,45,123,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,96,249,254,255,196,100,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,160,125,201,131,4,147,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,40,112,254,255,254,255,254,255,254,255,244,140,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,98,92,254,255,218,109,254,255,254,255,254,255,254,255,
30,133,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,97,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,14,85,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,98,249,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,126,111,254,255,152,116,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,28,85,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
30,143,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,181,158,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
39,105,254,255,254,255,254,255,254,255,194,132,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,188,130,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
215,122,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,247,115,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,149,108,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,60,110,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,252,101,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,93,82,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,251,120,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,81,111,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,177,145,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,9,102,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,144,159,254,255,254,255,99,249,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
245,136,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,100,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,101,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,73,156,254,255,254,255,2,80,
254,255,91,92,119,94,30,102,58,102,254,255,197,104,254,255,
1,117,254,255,254,255,254,255,39,143,254,255,8,154,254,255,
254,255,254,255,254,255,254,255,254,255,17,109,122,110,125,111,
228,115,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,118,78,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,162,113,43,116,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,102,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,217,153,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
16,102,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,103,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,104,249,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,172,86,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,173,115,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,255,80,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,246,103,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
105,249,254,255,106,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
119,78,254,255,254,255,254,255,254,255,254,255,107,249,254,255,
254,255,254,255,254,255,254,255,254,255,247,99,254,255,18,146,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,25,92,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,192,114,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,108,249,254,255,254,255,254,255,
254,255,254,255,254,255,109,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,127,99,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
214,125,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,109,89,254,255,254,255,
254,255,115,102,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,126,101,254,255,254,255,254,255,1,116,68,116,
254,255,191,116,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,236,135,117,138,254,255,254,255,254,255,
37,148,77,153,254,255,104,83,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,170,138,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,110,249,254,255,254,255,172,91,254,255,
254,255,254,255,254,255,254,255,254,255,249,115,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,114,107,254,255,5,122,254,255,254,255,111,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
164,112,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,192,132,254,255,225,152,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,112,249,254,255,
254,255,254,255,254,255,215,145,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,192,92,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,7,116,
178,116,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,97,126,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
90,111,254,255,33,116,185,116,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,18,104,254,255,83,106,254,255,254,255,
254,255,227,115,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,30,147,254,255,
254,255,254,255,254,255,254,255,101,146,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,164,90,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,190,103,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,92,110,254,255,
210,123,254,255,254,255,254,255,254,255,254,255,254,255,129,79,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,206,133,
254,255,254,255,254,255,254,255,113,249,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,114,249,
254,255,254,255,254,255,254,255,246,138,254,255,254,255,115,249,
254,255,254,255,254,255,254,255,254,255,94,85,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
53,85,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,59,102,
254,255,254,255,254,255,147,83,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,59,80,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,116,249,254,255,254,255,117,249,118,249,
254,255,254,255,254,255,254,255,254,255,254,255,119,249,254,255,
120,249,121,249,254,255,254,255,254,255,254,255,254,255,109,101,
254,255,122,249,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,123,249,254,255,124,249,254,255,125,249,
254,255,254,255,254,255,126,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,124,91,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,170,93,254,255,254,255,254,255,254,255,127,249,
128,249,129,249,254,255,130,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,131,249,254,255,254,255,
132,249,181,116,22,121,133,249,254,255,69,130,254,255,254,255,
93,143,134,249,254,255,135,249,136,249,137,249,254,255,138,249,
254,255,254,255,254,255,139,249,140,249,254,255,254,255,254,255,
141,249,254,255,254,255,254,255,39,88,248,89,254,255,254,255,
142,249,254,255,143,249,144,249,254,255,59,99,145,249,254,255,
135,108,254,255,254,255,254,255,254,255,254,255,146,249,254,255,
254,255,254,255,147,249,254,255,254,255,148,249,79,120,254,255,
149,249,254,255,227,125,150,249,47,126,151,249,254,255,254,255,
152,249,153,249,154,249,254,255,155,249,254,255,156,249,157,249,
158,249,133,96,254,255,159,249,254,255,160,249,161,249,177,149,
254,255,162,249,163,249,164,249,254,255,165,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,166,249,254,255,229,154,254,255,
254,255,167,249,193,113,254,255,168,249,169,249,254,255,170,249,
171,249,184,93,254,255,172,249,254,255,254,255,254,255,254,255,
254,255,254,255,54,110,254,255,218,111,254,255,47,112,80,113,
254,255,254,255,173,249,254,255,174,249,254,255,254,255,254,255,
254,255,175,249,176,249,254,255,254,255,254,255,177,249,72,147,
178,249,254,255,179,249,180,249,254,255,254,255,181,249,254,255,
254,255,254,255,109,108,202,111,254,255,254,255,254,255,254,255,
254,255,254,255,182,249,254,255,254,255,254,255,254,255,183,249,
179,146,184,249,254,255,254,255,254,255,254,255,201,79,254,255,
254,255,254,255,51,84,254,255,254,255,254,255,254,255,27,90,
254,255,254,255,185,249,254,255,254,255,255,101,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,125,123,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,58,146,
171,110,101,116,254,255,254,255,21,126,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,161,104,254,255,254,255,254,255,19,116,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,186,249,187,249,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,188,249,189,249,254,255,254,255,254,255,254,255,
254,255,190,249,254,255,191,249,254,255,192,249,254,255,254,255,
193,249,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
194,249,254,255,254,255,254,255,254,255,195,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,199,87,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,98,116,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,222,147,196,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,244,101,254,255,151,115,64,116,254,255,254,255,
145,121,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,234,145,254,255,254,255,254,255,254,255,103,95,
254,255,254,255,47,104,254,255,54,122,254,255,10,152,254,255,
197,249,82,106,254,255,144,111,137,113,254,255,254,255,83,133,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,144,78,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,196,90,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,198,249,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,144,102,254,255,254,255,75,116,254,255,254,255,254,255,
254,255,63,133,254,255,254,255,24,137,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,199,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,200,249,254,255,254,255,201,249,
254,255,254,255,254,255,254,255,202,249,254,255,203,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,204,249,254,255,254,255,205,249,254,255,
206,249,207,249,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,208,249,209,249,9,88,210,249,254,255,254,255,254,255,
211,249,212,249,254,255,107,89,254,255,213,249,214,249,254,255,
167,115,254,255,254,255,215,249,23,146,254,255,216,249,217,249,
218,249,219,249,254,255,254,255,28,112,254,255,254,255,220,249,
254,255,254,255,254,255,254,255,190,138,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,221,249,222,249,254,255,254,255,
223,249,254,255,254,255,91,95,254,255,224,249,225,249,226,249,
227,249,254,255,254,255,228,249,254,255,254,255,229,249,254,255,
230,249,254,255,254,255,254,255,254,255,254,255,231,249,232,249,
254,255,254,255,254,255,233,249,234,249,254,255,254,255,235,249,
236,249,55,112,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,237,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,238,249,239,249,106,125,254,255,240,249,
254,255,254,255,241,249,254,255,119,151,242,249,243,249,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,185,153,
254,255,254,255,254,255,254,255,254,255,244,249,245,249,254,255,
246,249,254,255,254,255,254,255,68,83,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,247,249,248,249,
249,249,254,255,254,255,254,255,191,130,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,134,115,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,178,102,254,255,254,255,254,255,
12,107,254,255,254,255,250,249,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,35,133,254,255,254,255,
254,255,254,255,172,145,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,61,110,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,251,249,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,122,79,254,255,254,255,254,255,254,255,254,255,97,88,
124,88,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,32,116,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,90,152,
254,255,254,255,254,255,254,255,254,255,254,255,100,118,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,195,89,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
120,102,254,255,104,105,137,106,254,255,254,255,254,255,254,255,
254,255,94,110,254,255,161,112,254,255,253,115,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,142,125,254,255,254,255,
234,138,254,255,254,255,254,255,254,255,254,255,204,146,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
250,102,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,170,116,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,39,80,254,255,254,255,176,96,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,200,87,239,91,254,255,89,102,254,255,254,255,254,255,
254,255,12,113,111,117,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,125,83,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,82,126,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,252,249,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,34,100,254,255,254,255,109,104,254,255,254,255,
254,255,254,255,254,255,104,116,161,116,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,29,126,254,255,47,133,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,198,116,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,253,249,254,255,87,111,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
246,147,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,249,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,175,111,254,255,254,255,218,116,
254,255,254,255,254,255,254,255,152,126,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
240,87,192,91,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,255,249,254,255,254,255,
125,97,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,148,115,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
134,85,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,27,117,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,248,109,254,255,
254,255,254,255,81,151,254,255,0,250,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,164,96,
129,97,96,100,254,255,254,255,37,133,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,54,154,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,67,116,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,177,153,254,255,254,255,254,255,254,255,254,255,
1,250,254,255,2,250,254,255,107,102,254,255,254,255,254,255,
254,255,56,116,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
43,129,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,3,250,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,4,250,254,255,254,255,254,255,4,101,
254,255,254,255,254,255,254,255,254,255,254,255,5,250,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
57,152,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
166,143,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,127,109,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,72,79,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,6,250,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,7,250,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,199,152,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,204,115,254,255,254,255,254,255,
254,130,157,153,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,48,102,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,146,149,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,238,89,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,8,250,9,250,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
230,115,21,145,254,255,254,255,254,255,254,255,83,86,254,255,
91,134,254,255,254,255,246,106,254,255,254,255,254,255,254,255,
254,255,254,255,0,114,254,255,254,255,254,255,244,92,254,255,
254,255,91,102,254,255,254,255,254,255,185,115,254,255,254,255,
77,119,254,255,254,255,254,255,254,255,254,255,10,250,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,224,79,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,48,152,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,194,108,206,110,5,112,80,112,254,255,146,113,254,255,
254,255,254,255,254,255,254,255,8,144,254,255,163,147,254,255,
254,255,254,255,254,255,254,255,179,102,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,54,98,254,255,254,255,254,255,254,255,254,255,207,109,
254,255,254,255,148,111,254,255,233,111,93,112,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
0,152,101,152,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,5,91,254,255,254,255,117,117,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,11,250,
254,255,254,255,254,255,187,120,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,101,102,254,255,254,255,
254,255,254,255,8,125,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
48,97,254,255,254,255,254,255,165,105,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,195,158,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,174,111,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,150,91,107,106,4,148,254,255,254,255,254,255,254,255,
133,101,254,255,254,255,141,109,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,63,94,254,255,254,255,254,255,221,115,254,255,219,82,
254,255,100,88,206,88,4,113,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,71,113,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
254,255,152,112,254,255,254,255,254,255,7,125,254,255,254,255,
254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,
222,81,254,255,254,255,205,86,254,255,254,255,254,255,254,255,
152,97,49,98,254,255,254,255,254,255,254,255,186,113,254,255,
254,255,254,255,254,255,254,255,96,0,32,0,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0,0,80,
50,0,0,0,51,0,0,0,50,0,0,0,51,0,0,0,
52,0,187,19,53,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,53,0,0,0,54,0,0,0,
55,0,0,0,56,0,254,255,57,0,255,255,58,0,255,255,
59,0,255,255,60,0,255,255,61,0,255,127,62,0,0,0,
63,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,65,0,255,255,66,0,255,31,
67,0,0,0,68,0,0,0,67,0,0,0,68,0,0,0,
69,0,255,255,70,0,255,143,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,71,0,31,255,72,0,255,255,
73,0,255,255,74,0,255,255,75,0,255,135,76,0,73,57,
77,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,77,0,0,0,78,0,0,0,
79,0,0,40,80,0,192,0,81,0,0,0,82,0,1,0,
83,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,85,0,0,8,86,0,0,0,
87,0,0,0,88,0,0,0,89,0,0,1,90,0,0,0,
91,0,0,0,92,0,0,4,93,0,2,4,94,0,0,0,
95,0,0,0,96,0,0,0,97,0,0,2,98,0,8,0,
99,0,1,0,100,0,0,0,101,0,4,0,102,0,0,64,
103,0,128,0,104,0,0,8,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,105,0,0,0,106,0,0,0,
107,0,0,0,108,0,0,128,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,109,0,0,0,110,0,0,0,
111,0,128,0,112,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,112,0,0,0,113,0,0,64,
114,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,115,0,0,0,116,0,0,32,
117,0,0,0,118,0,0,0,117,0,0,0,118,0,0,0,
119,0,16,0,120,0,0,0,120,0,0,0,121,0,0,8,
122,0,0,0,123,0,0,8,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,124,0,16,0,125,0,0,0,
126,0,0,1,127,0,0,32,128,0,0,0,129,0,8,0,
130,0,0,0,131,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,130,0,0,0,131,0,0,0,
132,0,0,0,133,0,8,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,134,0,0,64,135,0,0,16,
136,0,0,0,137,0,32,0,138,0,0,0,139,0,0,64,
140,0,0,0,141,0,0,0,142,0,64,0,143,0,0,0,
144,0,0,0,145,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,145,0,0,0,146,0,8,0,
147,0,0,0,148,0,0,0,147,0,0,0,148,0,0,0,
149,0,0,16,150,0,0,0,151,0,0,32,152,0,0,0,
153,0,0,0,154,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,153,0,0,0,154,0,0,0,
155,0,0,64,156,0,33,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,157,0,128,1,158,0,0,0,
159,0,0,0,160,0,1,0,161,0,0,3,162,0,0,0,
163,0,128,0,164,0,0,0,165,0,0,128,166,0,0,0,
167,0,18,0,168,0,0,16,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,169,0,0,64,170,0,0,0,
171,0,0,0,172,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,171,0,0,0,172,0,0,0,
173,0,0,40,174,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,175,0,8,0,176,0,0,0,
177,0,0,64,178,0,0,1,179,0,0,0,180,0,0,8,
181,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,181,0,0,0,182,0,0,0,
183,0,16,0,184,0,0,0,185,0,16,0,186,0,0,0,
187,0,0,0,188,0,0,0,189,0,32,0,190,0,0,0,
191,0,0,0,192,0,0,0,190,0,0,0,191,0,0,0,
192,0,0,0,193,0,0,16,194,0,0,0,195,0,64,0,
196,0,0,16,197,0,0,0,198,0,1,0,199,0,128,0,
200,0,0,144,201,0,0,0,201,0,0,0,202,0,0,2,
203,0,0,0,204,0,0,0,204,0,0,0,205,0,0,8,
206,0,4,0,207,0,0,0,207,0,0,0,208,0,0,0,
209,0,0,0,210,0,0,4,211,0,1,0,212,0,0,0,
213,0,0,0,214,0,16,0,215,0,0,32,216,0,0,0,
217,0,0,0,218,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,217,0,0,0,218,0,0,0,
219,0,1,4,220,0,0,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,221,0,0,0,222,0,0,0,
223,0,0,0,224,0,0,128,225,0,0,0,226,0,0,0,
227,0,0,0,228,0,128,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,229,0,0,0,230,0,0,8,
231,0,128,0,232,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,233,0,32,0,234,0,0,0,
235,0,16,0,236,0,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,237,0,0,0,238,0,0,0,
239,0,0,0,240,0,129,0,241,0,0,0,242,0,0,0,
243,0,16,0,244,0,0,32,245,0,2,0,246,0,0,1,
247,0,0,0,248,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,249,0,128,0,250,0,0,0,
251,0,0,0,252,0,66,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,253,0,0,0,254,0,0,0,
255,0,0,0,0,1,0,8,1,1,0,0,2,1,0,0,
3,1,0,0,4,1,0,128,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,5,1,0,0,6,1,0,0,
7,1,0,0,8,1,128,0,9,1,0,0,10,1,0,0,
11,1,4,0,12,1,0,0,12,1,0,0,13,1,0,0,
14,1,1,0,15,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,16,1,16,4,17,1,0,0,
18,1,32,0,19,1,0,0,20,1,16,0,21,1,0,0,
22,1,0,0,23,1,0,0,24,1,0,64,25,1,0,0,
26,1,0,32,27,1,0,64,28,1,32,0,29,1,0,0,
30,1,0,0,31,1,0,0,30,1,0,0,31,1,0,0,
32,1,8,0,33,1,16,176,34,1,0,2,35,1,3,64,
36,1,0,0,37,1,1,12,38,1,0,0,39,1,0,10,
40,1,32,8,41,1,8,1,42,1,0,0,43,1,1,0,
44,1,1,0,45,1,12,8,46,1,64,0,47,1,0,0,
48,1,0,0,49,1,0,4,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,50,1,0,0,51,1,0,0,
52,1,0,0,53,1,0,8,54,1,0,128,55,1,8,0,
56,1,0,0,57,1,0,64,58,1,0,0,59,1,0,0,
60,1,0,0,61,1,64,0,62,1,0,0,63,1,4,0,
64,1,0,128,65,1,0,0,65,1,0,0,66,1,0,0,
67,1,0,32,68,1,0,0,68,1,0,0,69,1,0,0,
70,1,2,0,71,1,0,0,72,1,32,0,73,1,0,0,
74,1,0,1,75,1,0,0,75,1,0,0,76,1,0,0,
77,1,128,0,78,1,0,0,78,1,0,0,79,1,0,0,
80,1,0,1,81,1,0,0,81,1,0,0,82,1,0,0,
83,1,32,0,84,1,0,0,84,1,0,0,85,1,0,0,
86,1,0,4,87,1,0,0,87,1,0,0,88,1,2,0,
89,1,0,0,90,1,0,0,90,1,0,0,91,1,12,0,
92,1,0,8,93,1,0,0,94,1,0,2,95,1,0,0,
96,1,0,0,97,1,0,0,95,1,0,0,96,1,0,0,
97,1,0,0,98,1,64,0,99,1,0,16,100,1,0,0,
101,1,0,0,102,1,0,0,100,1,0,0,101,1,0,0,
102,1,0,0,103,1,132,0,104,1,0,0,105,1,0,0,
106,1,0,64,107,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,107,1,0,0,108,1,0,0,
109,1,0,32,110,1,0,0,111,1,128,0,112,1,32,0,
113,1,0,0,114,1,0,0,115,1,4,0,116,1,0,0,
117,1,0,0,118,1,0,0,118,1,0,0,119,1,2,0,
120,1,0,0,121,1,0,0,120,1,0,0,121,1,0,0,
122,1,0,0,123,1,0,128,124,1,128,32,125,1,0,0,
126,1,0,0,127,1,0,0,128,1,8,128,129,1,0,4,
130,1,0,0,131,1,0,1,132,1,0,0,133,1,0,0,
134,1,0,0,135,1,64,48,136,1,0,0,137,1,0,80,
138,1,0,0,139,1,8,4,140,1,0,0,141,1,0,0,
142,1,0,8,143,1,0,0,144,1,0,64,145,1,0,0,
146,1,0,0,147,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,147,1,0,0,148,1,130,4,
149,1,0,0,150,1,0,96,151,1,0,0,152,1,17,0,
153,1,0,192,154,1,0,64,155,1,0,4,156,1,0,4,
157,1,0,2,158,1,0,0,159,1,96,0,160,1,0,16,
161,1,0,129,162,1,128,0,163,1,0,0,164,1,1,32,
165,1,0,0,166,1,0,0,166,1,0,0,167,1,0,5,
168,1,18,0,169,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,170,1,16,16,171,1,0,64,
172,1,0,0,173,1,0,0,174,1,128,0,175,1,1,0,
176,1,0,0,177,1,0,0,178,1,0,2,179,1,4,0,
180,1,4,0,181,1,0,4,182,1,2,0,183,1,0,0,
184,1,0,0,185,1,0,64,186,1,1,0,187,1,0,0,
188,1,0,0,189,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,190,1,1,0,191,1,0,0,
192,1,0,0,193,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,194,1,64,0,195,1,144,1,
196,1,128,32,197,1,0,2,198,1,0,16,199,1,64,32,
200,1,88,0,201,1,128,34,202,1,130,0,203,1,8,0,
204,1,3,136,205,1,0,1,206,1,25,8,207,1,0,0,
208,1,36,1,209,1,0,0,210,1,4,2,211,1,0,129,
212,1,42,4,213,1,36,130,214,1,64,0,215,1,0,5,
216,1,0,0,217,1,0,0,218,1,2,0,219,1,0,8,
220,1,0,0,221,1,0,0,222,1,128,0,223,1,8,0,
224,1,0,128,225,1,32,4,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,226,1,0,64,227,1,0,0,
228,1,16,0,229,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,230,1,0,32,231,1,0,0,
232,1,0,0,233,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,234,1,0,128,235,1,0,0,
236,1,0,0,237,1,0,0,235,1,0,0,236,1,0,0,
237,1,0,0,238,1,0,8,239,1,0,64,240,1,0,0,
241,1,0,0,242,1,32,8,243,1,0,0,244,1,64,0,
245,1,0,0,246,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,246,1,0,0,247,1,2,0,
248,1,0,0,249,1,2,0,250,1,0,4,251,1,0,0,
252,1,0,0,253,1,0,0,254,1,32,0,255,1,0,0,
0,2,0,0,1,2,64,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2,2,0,0,3,2,128,0,
4,2,0,0,5,2,0,0,4,2,0,0,5,2,0,0,
6,2,0,32,7,2,0,0,7,2,0,0,8,2,0,0,
9,2,0,0,10,2,0,32,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,11,2,0,0,12,2,4,0,
13,2,0,0,14,2,0,0,14,2,0,0,15,2,0,64,
16,2,0,0,17,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,18,2,128,1,19,2,0,0,
20,2,0,0,21,2,0,0,20,2,0,0,21,2,0,0,
22,2,0,4,23,2,0,128,24,2,0,64,25,2,0,0,
26,2,1,0,27,2,0,0,27,2,0,0,28,2,64,0,
29,2,8,0,30,2,0,0,30,2,0,0,31,2,32,32,
32,2,0,128,33,2,0,0,33,2,0,0,34,2,4,0,
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0,0,0,0,0,0,0,109,2,1,0,110,2,0,0,
111,2,0,0,112,2,0,0,112,2,0,0,113,2,0,64,
114,2,128,0,115,2,0,0,115,2,0,0,116,2,0,32,
117,2,0,0,118,2,0,0,117,2,0,0,118,2,0,0,
119,2,64,0,120,2,0,0,120,2,0,0,121,2,0,0,
122,2,0,0,123,2,4,0,124,2,0,1,125,2,0,0,
126,2,0,0,127,2,0,0,127,2,0,0,128,2,0,32,
129,2,0,0,130,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,130,2,0,0,131,2,0,64,
132,2,0,0,133,2,0,0,133,2,0,0,134,2,32,0,
135,2,128,0,136,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,136,2,0,0,137,2,0,0,
138,2,0,16,139,2,2,0,140,2,0,0,141,2,128,0,
142,2,0,4,143,2,0,0,143,2,0,0,144,2,133,0,
145,2,0,0,146,2,0,4,147,2,1,0,148,2,0,0,
149,2,32,0,150,2,0,0,150,2,0,0,151,2,0,0,
152,2,0,0,153,2,72,0,154,2,0,16,155,2,0,0,
156,2,0,0,157,2,0,0,158,2,16,0,159,2,0,192,
160,2,18,0,161,2,0,0,162,2,0,5,163,2,0,0,
164,2,0,0,165,2,0,0,164,2,0,0,165,2,0,0,
166,2,8,0,167,2,0,0,167,2,0,0,168,2,0,64,
169,2,0,0,170,2,64,0,171,2,16,0,172,2,0,0,
173,2,32,0,174,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,174,2,0,0,175,2,4,0,
176,2,0,0,177,2,2,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0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0,0,0,0,0,0,218,2,0,0,219,2,0,0,
220,2,0,0,221,2,32,0,222,2,8,0,223,2,0,0,
224,2,0,0,225,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,225,2,0,0,226,2,1,0,
227,2,0,0,228,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,229,2,147,7,230,2,255,62,
231,2,17,176,232,2,3,19,233,2,1,40,234,2,16,17,
235,2,0,0,236,2,147,5,237,2,123,30,238,2,17,176,
239,2,3,151,240,2,1,59,241,2,18,17,242,2,160,0,
243,2,147,149,244,2,107,48,245,2,81,176,246,2,2,17,
247,2,1,50,248,2,48,17,249,2,176,2,250,2,17,1,
251,2,10,48,252,2,121,184,253,2,6,19,254,2,1,48,
255,2,16,0,0,3,128,0,1,3,19,1,2,3,11,16,
3,3,17,0,4,3,0,147,5,3,3,43,6,3,16,0,
7,3,0,0,8,3,147,5,9,3,107,116,10,3,81,176,
11,3,35,19,12,3,1,59,13,3,48,16,14,3,0,0,
15,3,0,0,16,3,0,112,17,3,17,176,18,3,3,19,
19,3,0,41,20,3,16,17,21,3,128,33,22,3,1,0,
23,3,0,48,24,3,21,176,25,3,14,3,26,3,1,48,
27,3,48,0,28,3,0,2,29,3,17,1,30,3,35,16,
31,3,0,0,32,3,0,19,33,3,129,107,34,3,16,16,
35,3,0,3,36,3,19,1,37,3,19,16,38,3,17,48,
39,3,0,1,40,3,0,0,41,3,48,85,42,3,184,34,
43,3,0,0,44,3,0,48,45,3,17,176,46,3,2,151,
47,3,7,251,48,3,58,17,49,3,176,3,50,3,19,1,
51,3,33,0,52,3,0,0,53,3,0,27,54,3,13,59,
55,3,56,17,56,3,176,3,57,3,19,1,58,3,51,17,
59,3,1,0,60,3,0,19,61,3,5,43,62,3,28,17,
63,3,0,1,64,3,0,0,65,3,0,16,66,3,17,176,
67,3,0,19,68,3,1,42,69,3,48,25,70,3,176,2,
71,3,1,0,72,3,16,16,73,3,0,0,74,3,0,17,
75,3,1,3,76,3,48,16,77,3,48,2,78,3,19,7,
79,3,107,20,80,3,17,0,81,3,0,19,82,3,5,43,
83,3,116,249,84,3,184,143,85,3,19,1,86,3,59,16,
87,3,0,0,88,3,0,0,88,3,0,0,89,3,112,217,
90,3,176,74,91,3,19,1,92,3,59,16,93,3,17,0,
94,3,3,17,95,3,0,0,96,3,48,89,97,3,177,42,
98,3,17,1,99,3,0,16,100,3,0,0,101,3,1,17,
102,3,1,11,103,3,16,0,104,3,0,0,105,3,19,1,
106,3,43,16,107,3,0,0,108,3,1,1,109,3,0,32,
110,3,16,17,111,3,160,2,112,3,17,1,113,3,33,48,
114,3,89,176,115,3,2,1,116,3,0,0,117,3,48,25,
118,3,176,7,119,3,19,1,120,3,59,56,121,3,17,176,
122,3,3,0,123,3,0,0,123,3,0,0,124,3,0,0,
125,3,19,13,126,3,59,56,127,3,17,176,128,3,3,1,
129,3,0,16,130,3,0,0,130,3,0,0,131,3,19,1,
132,3,32,16,133,3,16,0,134,3,0,1,135,3,0,0,
136,3,16,1,137,3,0,0,137,3,0,0,138,3,0,48,
139,3,17,24,140,3,2,0,141,3,0,0,142,3,16,0,
143,3,0,0,144,3,17,1,145,3,35,0,146,3,0,0,
147,3,0,147,148,3,1,11,149,3,16,17,150,3,48,0,
151,3,17,1,152,3,43,48,153,3,17,176,154,3,199,19,
155,3,1,59,156,3,48,1,157,3,128,2,158,3,0,0,
159,3,0,48,160,3,17,176,161,3,131,19,162,3,1,43,
163,3,48,17,164,3,176,3,165,3,17,0,166,3,10,48,
167,3,17,176,168,3,2,17,169,3,0,32,170,3,0,0,
171,3,0,1,172,3,17,1,173,3,43,16,174,3,17,160,
175,3,2,19,176,3,1,43,177,3,16,0,178,3,0,1,
179,3,1,0,180,3,0,48,181,3,17,144,182,3,2,19,
183,3,1,43,184,3,48,17,185,3,176,102,186,3,0,0,
187,3,0,48,188,3,17,176,189,3,2,211,190,3,7,107,
191,3,58,17,192,3,176,7,193,3,3,1,194,3,32,0,
195,3,0,0,196,3,0,19,197,3,5,107,198,3,56,17,
199,3,176,3,200,3,19,1,201,3,184,16,202,3,0,0,
203,3,0,27,204,3,5,43,205,3,16,1,206,3,0,3,
207,3,0,0,208,3,0,16,209,3,17,160,210,3,2,17,
211,3,1,10,212,3,112,121,213,3,176,162,214,3,17,1,
215,3,10,16,216,3,0,0,217,3,0,17,218,3,1,0,
219,3,16,17,220,3,144,0,221,3,17,1,222,3,9,0,
223,3,0,0,224,3,0,147,225,3,5,187,226,3,242,249,
227,3,176,34,228,3,19,1,229,3,59,50,230,3,1,32,
231,3,0,0,232,3,0,0,233,3,48,89,234,3,176,6,
235,3,147,1,236,3,59,48,237,3,17,160,238,3,35,17,
239,3,0,0,240,3,112,17,241,3,176,2,242,3,17,0,
243,3,16,16,244,3,0,0,245,3,1,19,246,3,1,3,
247,3,16,1,248,3,0,0,249,3,147,7,250,3,43,22,
251,3,16,0,252,3,1,1,253,3,0,0,254,3,48,17,
255,3,0,2,0,4,17,1,1,4,41,48,2,4,17,176,
3,4,0,0,4,4,0,0,5,4,48,81,6,4,176,14,
7,4,19,5,8,4,59,56,9,4,17,176,10,4,3,3,
11,4,0,1,12,4,0,0,12,4,0,0,13,4,147,1,
14,4,57,16,15,4,0,0,16,4,2,3,17,4,0,59,
18,4,0,0,19,4,0,0,20,4,19,1,21,4,35,0,
22,4,0,0,23,4,0,0,23,4,0,0,24,4,16,0,
25,4,0,0,26,4,1,0,27,4,32,48,28,4,17,144,
29,4,2,0,30,4,0,0,30,4,0,0,31,4,0,0,
32,4,0,0,33,4,0,16,34,4,0,0,35,4,2,17,
36,4,1,3,37,4,0,0,37,4,0,0,38,4,19,1,
39,4,43,176,40,4,121,176,41,4,35,19,42,4,1,59,
43,4,48,17,44,4,176,2,45,4,17,1,46,4,33,240,
47,4,217,176,48,4,67,19,49,4,1,59,50,4,48,17,
51,4,176,3,52,4,17,1,53,4,32,112,54,4,81,176,
55,4,34,19,56,4,1,32,57,4,16,17,58,4,144,1,
59,4,17,1,60,4,11,48,61,4,17,176,62,4,2,147,
63,4,1,171,64,4,22,0,65,4,0,1,66,4,19,1,
67,4,33,48,68,4,17,176,69,4,2,3,70,4,1,41,
71,4,48,49,72,4,176,2,73,4,0,0,74,4,0,48,
75,4,25,184,76,4,66,27,77,4,1,51,78,4,56,17,
79,4,48,3,80,4,0,0,81,4,32,0,82,4,0,0,
83,4,0,19,84,4,5,51,85,4,16,17,86,4,0,0,
87,4,0,0,88,4,0,0,89,4,1,0,90,4,0,147,
91,4,5,35,92,4,48,1,93,4,0,1,94,4,1,0,
95,4,16,16,96,4,17,48,97,4,0,1,98,4,0,0,
99,4,48,17,100,4,48,2,101,4,1,0,102,4,16,16,
103,4,0,0,104,4,0,17,105,4,0,0,106,4,0,0,
107,4,0,2,108,4,19,133,109,4,3,16,110,4,17,16,
111,4,0,19,112,4,1,43,113,4,48,119,114,4,184,99,
115,4,19,1,116,4,59,48,117,4,145,176,118,4,162,17,
119,4,1,2,120,4,48,123,121,4,240,87,122,4,19,1,
123,4,43,112,124,4,209,240,125,4,227,17,126,4,1,27,
127,4,48,113,128,4,185,10,129,4,19,1,130,4,59,48,
131,4,1,144,132,4,2,19,133,4,1,43,134,4,48,17,
135,4,176,2,136,4,19,7,137,4,43,48,138,4,17,48,
139,4,3,19,140,4,1,35,141,4,48,17,142,4,176,2,
143,4,19,1,144,4,171,48,145,4,17,180,146,4,254,17,
147,4,1,9,148,4,48,113,149,4,184,71,150,4,211,5,
151,4,123,48,152,4,17,176,153,4,3,83,154,4,1,33,
155,4,16,17,156,4,0,0,157,4,19,5,158,4,107,48,
159,4,17,176,160,4,2,17,161,4,1,51,162,4,16,0,
163,4,0,0,164,4,19,5,165,4,235,56,166,4,16,160,
167,4,2,1,168,4,0,48,169,4,16,17,170,4,176,2,
171,4,19,0,172,4,32,48,173,4,113,176,174,4,2,1,
175,4,0,16,176,4,16,0,177,4,0,0,178,4,19,1,
179,4,11,16,180,4,17,16,181,4,0,19,182,4,1,43,
183,4,0,0,184,4,0,0,185,4,147,5,186,4,107,54,
187,4,149,176,188,4,3,19,189,4,1,59,190,4,16,1,
191,4,0,2,192,4,0,0,193,4,0,48,194,4,17,176,
195,4,3,1,196,4,0,32,197,4,16,0,198,4,0,1,
199,4,0,0,200,4,0,48,201,4,17,176,202,4,10,3,
203,4,1,16,204,4,16,0,205,4,0,1,206,4,17,1,
207,4,3,0,208,4,0,0,209,4,2,19,210,4,1,35,
211,4,16,0,212,4,0,3,213,4,0,0,214,4,0,16,
215,4,0,0,216,4,0,1,217,4,0,0,218,4,16,0,
219,4,144,2,220,4,0,0,221,4,0,48,222,4,17,48,
223,4,134,83,224,4,1,123,225,4,48,17,226,4,176,3,
227,4,81,1,228,4,33,0,229,4,0,0,230,4,0,19,
231,4,1,59,232,4,48,17,233,4,176,2,234,4,17,0,
235,4,16,16,236,4,1,0,237,4,2,19,238,4,1,43,
239,4,16,17,240,4,0,2,241,4,0,0,242,4,0,16,
243,4,17,176,244,4,2,1,245,4,0,1,246,4,48,17,
247,4,176,2,248,4,1,0,249,4,16,16,250,4,1,0,
251,4,0,17,252,4,1,43,253,4,16,17,254,4,16,2,
255,4,19,1,0,5,43,0,1,5,0,0,2,5,0,147,
3,5,3,43,4,5,48,17,5,5,176,2,6,5,19,1,
7,5,59,48,8,5,0,0,9,5,2,0,10,5,0,0,
11,5,48,25,12,5,176,3,13,5,19,1,14,5,43,16,
15,5,17,176,16,5,3,1,17,5,0,0,18,5,48,17,
19,5,176,2,20,5,19,1,21,5,33,16,22,5,0,0,
23,5,2,1,24,5,1,0,25,5,16,0,26,5,0,0,
27,5,19,1,28,5,43,16,29,5,17,0,30,5,2,1,
31,5,0,32,32,5,48,17,33,5,176,2,34,5,17,1,
35,5,1,48,36,5,17,48,37,5,2,0,38,5,0,0,
39,5,48,17,40,5,176,2,41,5,19,3,42,5,59,48,
43,5,17,176,44,5,3,1,45,5,0,32,46,5,0,0,
47,5,0,0,48,5,19,5,49,5,59,48,50,5,17,176,
51,5,2,17,52,5,0,16,53,5,16,1,54,5,0,0,
55,5,19,1,56,5,43,20,57,5,1,0,58,5,0,1,
59,5,0,0,60,5,16,1,61,5,128,2,62,5,1,0,
63,5,0,48,64,5,17,176,65,5,2,1,66,5,0,16,
67,5,16,0,68,5,0,0,69,5,19,1,70,5,35,16,
71,5,17,16,72,5,2,147,73,5,5,11,74,5,16,17,
75,5,48,0,76,5,19,1,77,5,43,112,78,5,81,176,
79,5,35,19,80,5,1,59,81,5,48,0,82,5,0,0,
83,5,0,0,84,5,0,48,85,5,17,176,86,5,3,19,
87,5,1,43,88,5,16,17,89,5,48,3,90,5,1,1,
91,5,10,48,92,5,17,176,93,5,2,1,94,5,0,32,
95,5,0,0,96,5,0,0,97,5,17,0,98,5,0,16,
99,5,17,160,100,5,0,147,101,5,5,43,102,5,16,0,
103,5,0,2,104,5,0,0,105,5,0,16,106,5,17,144,
107,5,0,17,108,5,1,41,109,5,16,17,110,5,176,0,
111,5,0,0,112,5,0,48,113,5,17,176,114,5,2,19,
115,5,33,43,116,5,48,17,117,5,176,3,118,5,1,0,
119,5,32,0,120,5,0,0,121,5,0,19,122,5,5,43,
123,5,48,17,124,5,176,2,125,5,19,1,126,5,59,16,
127,5,17,32,128,5,0,19,129,5,33,43,130,5,50,17,
131,5,128,2,132,5,19,0,133,5,40,48,134,5,17,160,
135,5,2,17,136,5,1,10,137,5,48,17,138,5,146,2,
139,5,17,1,140,5,33,48,141,5,17,0,142,5,2,19,
143,5,1,43,144,5,48,17,145,5,144,2,146,5,211,3,
147,5,43,18,148,5,17,48,149,5,2,19,150,5,1,43,
151,5,0,0,152,5,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,153,5,255,255,154,5,255,255,
155,5,255,255,156,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0,0,0,0,0,0,0,0,0,0,
0,0,251,168,252,168,253,168,254,168,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,161,165,162,165,
163,165,164,165,165,165,166,165,167,165,168,165,169,165,170,165,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,234,161,213,162,216,162,214,162,217,162,215,162,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,173,161,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
241,168,242,168,243,168,244,168,245,168,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,205,169,206,169,207,169,208,169,209,169,210,169,
211,169,212,169,213,169,214,169,215,169,216,169,217,169,218,169,
219,169,220,169,221,169,222,169,223,169,224,169,225,169,226,169,
227,169,228,169,229,169,230,169,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,205,168,206,168,
207,168,208,168,209,168,210,168,211,168,212,168,213,168,214,168,
215,168,216,168,217,168,218,168,219,168,220,168,221,168,222,168,
223,168,224,168,225,168,226,168,227,168,228,168,229,168,230,168,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
198,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,195,162,199,162,200,162,203,162,202,162,201,162,204,162,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,186,162,185,162,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,184,162,183,162,
0,0,0,0,0,0,0,0,0,0,0,0,194,162,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,196,162,197,162,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,207,162,206,162,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,208,162,0,0,209,162,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,188,162,189,162,
0,0,192,162,187,162,190,162,0,0,191,162,205,162,219,162,
0,0,0,0,221,162,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,161,164,
162,164,163,164,164,164,165,164,166,164,167,164,168,164,169,164,
170,164,171,164,172,164,173,164,174,164,175,164,176,164,177,164,
178,164,179,164,180,164,181,164,182,164,183,164,184,164,185,164,
186,164,187,164,188,164,189,164,190,164,191,164,192,164,193,164,
194,164,195,164,196,164,197,164,198,164,199,164,200,164,201,164,
202,164,203,164,204,164,205,164,206,164,207,164,208,164,209,164,
210,164,211,164,212,164,213,164,214,164,215,164,216,164,217,164,
218,164,219,164,220,164,221,164,222,164,223,164,224,164,225,164,
226,164,227,164,228,164,229,164,230,164,231,164,232,164,233,164,
234,164,235,164,236,164,237,164,238,164,239,164,240,164,241,164,
242,164,243,164,244,164,245,164,246,164,247,164,248,164,249,164,
250,164,251,164,252,164,253,164,254,164,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,177,169,178,169,
179,169,180,169,181,169,182,169,183,169,184,169,185,169,186,169,
187,169,188,169,189,169,190,169,191,169,192,169,193,169,194,169,
195,169,196,169,197,169,198,169,199,169,200,169,201,169,202,169,
203,169,204,169,223,162,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,177,168,178,168,
179,168,180,168,181,168,182,168,183,168,184,168,185,168,186,168,
187,168,188,168,189,168,190,168,191,168,192,168,193,168,194,168,
195,168,196,168,197,168,198,168,199,168,200,168,201,168,202,168,
203,168,204,168,0,0,0,0,0,0,222,162,201,167,202,167,
203,167,204,167,205,167,0,0,0,0,0,0,186,167,187,167,
220,167,221,167,222,167,182,167,183,167,184,167,212,167,213,167,
214,167,215,167,216,167,161,167,162,167,163,167,165,167,171,167,
172,167,173,167,174,167,175,167,176,167,177,167,178,167,179,167,
180,167,167,167,168,167,169,167,170,167,189,167,190,167,229,167,
230,167,231,167,232,167,225,167,226,167,227,167,191,167,192,167,
193,167,194,167,195,167,196,167,197,167,198,167,199,167,200,167,
206,167,207,167,208,167,209,167,210,167,211,167,218,167,219,167,
227,162,236,167,166,167,224,167,239,167,225,162,188,167,237,167,
181,167,0,0,0,0,0,0,0,0,185,167,234,167,0,0,
0,0,235,167,0,0,0,0,223,167,0,0,228,162,0,0,
0,0,228,167,238,167,233,167,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,225,202,0,0,204,212,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,227,220,173,223,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,167,234,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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,0,0,176,253,0,0,0,0,0,0,0,0,
0,0,233,226,202,220,0,0,192,250,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,238,217,0,0,251,224,
0,0,0,0,0,0,234,239,0,0,0,0,0,0,196,224,
0,0,0,0,0,0,0,0,0,0,175,226,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,205,232,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,162,239,218,226,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,237,220,0,0,0,0,0,0,181,206,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,253,246,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,220,233,0,0,
0,0,242,245,197,224,0,0,0,0,0,0,0,0,0,0,
0,0,212,234,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
195,233,0,0,0,0,175,232,0,0,0,0,211,242,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
175,209,0,0,0,0,0,0,0,0,0,0,0,0,162,214,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,243,215,0,0,
0,0,0,0,0,0,0,0,0,0,223,204,0,0,212,242,
0,0,176,209,0,0,224,204,0,0,0,0,0,0,0,0,
209,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176,226,0,0,0,0,165,230,0,0,0,0,0,0,219,226,
0,0,0,0,0,0,0,0,0,0,199,224,0,0,0,0,
0,0,0,0,0,0,0,0,239,242,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,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,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,194,219,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,161,176,162,176,
0,0,0,0,163,176,0,0,0,0,164,176,165,176,166,176,
167,176,0,0,0,0,0,0,0,0,0,0,168,176,169,176,
170,176,171,176,172,176,173,176,174,176,175,176,0,0,176,176,
177,176,178,176,179,176,180,176,0,0,0,0,181,176,0,0,
0,0,0,0,182,176,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,183,176,184,176,0,0,185,176,186,176,187,176,
0,0,0,0,0,0,0,0,0,0,0,0,188,176,189,176,
0,0,0,0,190,176,0,0,0,0,0,0,191,176,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,192,176,0,0,193,176,0,0,0,0,0,0,0,0,
0,0,0,0,194,176,0,0,0,0,0,0,195,176,0,0,
0,0,0,0,196,176,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,197,176,198,176,
0,0,0,0,199,176,0,0,0,0,200,176,201,176,0,0,
202,176,0,0,0,0,0,0,0,0,0,0,203,176,204,176,
0,0,205,176,206,176,207,176,208,176,0,0,0,0,209,176,
210,176,211,176,212,176,0,0,0,0,0,0,213,176,0,0,
0,0,0,0,214,176,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,215,176,216,176,0,0,217,176,218,176,219,176,
0,0,0,0,0,0,0,0,0,0,0,0,220,176,221,176,
222,176,0,0,223,176,0,0,0,0,224,176,225,176,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,226,176,227,176,
0,0,228,176,229,176,230,176,0,0,0,0,0,0,231,176,
0,0,0,0,232,176,0,0,0,0,0,0,233,176,0,0,
0,0,0,0,234,176,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,235,176,0,0,236,176,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,237,176,238,176,
0,0,0,0,239,176,0,0,0,0,240,176,241,176,0,0,
242,176,0,0,243,176,0,0,0,0,244,176,245,176,246,176,
0,0,247,176,0,0,248,176,249,176,0,0,0,0,0,0,
0,0,0,0,250,176,251,176,0,0,0,0,252,176,0,0,
0,0,0,0,253,176,0,0,254,176,0,0,0,0,0,0,
0,0,0,0,161,177,162,177,0,0,163,177,0,0,164,177,
0,0,0,0,0,0,0,0,0,0,0,0,165,177,0,0,
0,0,0,0,166,177,0,0,0,0,0,0,167,177,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,177,
0,0,0,0,169,177,170,177,0,0,0,0,0,0,0,0,
0,0,0,0,171,177,172,177,0,0,0,0,173,177,0,0,
0,0,0,0,174,177,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,175,177,176,177,0,0,177,177,0,0,178,177,
0,0,0,0,0,0,0,0,0,0,0,0,179,177,0,0,
0,0,0,0,180,177,0,0,0,0,0,0,181,177,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,177,
0,0,183,177,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,184,177,185,177,0,0,0,0,186,177,0,0,
0,0,187,177,188,177,189,177,190,177,0,0,0,0,0,0,
0,0,191,177,192,177,193,177,0,0,194,177,0,0,195,177,
196,177,0,0,0,0,0,0,0,0,0,0,197,177,198,177,
0,0,0,0,199,177,0,0,0,0,0,0,200,177,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,201,177,202,177,0,0,0,0,0,0,0,0,
0,0,0,0,203,177,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,204,177,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,205,177,206,177,
0,0,0,0,207,177,0,0,0,0,0,0,208,177,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,209,177,210,177,
0,0,211,177,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,212,177,0,0,0,0,0,0,213,177,0,0,
0,0,0,0,214,177,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,215,177,216,177,
0,0,0,0,217,177,0,0,0,0,218,177,219,177,220,177,
0,0,0,0,0,0,0,0,0,0,0,0,221,177,222,177,
0,0,223,177,0,0,224,177,0,0,0,0,0,0,0,0,
0,0,0,0,225,177,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,226,177,227,177,
0,0,0,0,228,177,0,0,0,0,229,177,230,177,0,0,
231,177,0,0,0,0,0,0,0,0,0,0,232,177,233,177,
0,0,234,177,0,0,235,177,236,177,0,0,0,0,0,0,
237,177,0,0,238,177,239,177,240,177,0,0,241,177,0,0,
0,0,0,0,242,177,0,0,243,177,0,0,0,0,0,0,
0,0,0,0,244,177,245,177,0,0,246,177,247,177,248,177,
0,0,0,0,0,0,249,177,0,0,0,0,250,177,251,177,
0,0,0,0,252,177,0,0,0,0,0,0,253,177,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,254,177,161,178,
0,0,162,178,163,178,164,178,0,0,0,0,0,0,0,0,
0,0,0,0,165,178,166,178,0,0,0,0,0,0,0,0,
0,0,0,0,167,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,168,178,169,178,170,178,0,0,171,178,0,0,
0,0,0,0,172,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,173,178,174,178,0,0,175,178,176,178,177,178,
0,0,0,0,0,0,0,0,0,0,0,0,178,178,179,178,
0,0,0,0,180,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,181,178,0,0,
0,0,182,178,0,0,183,178,0,0,0,0,0,0,0,0,
0,0,0,0,184,178,0,0,0,0,0,0,185,178,0,0,
0,0,0,0,186,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,187,178,188,178,0,0,
0,0,0,0,0,0,189,178,0,0,0,0,190,178,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,191,178,192,178,0,0,0,0,193,178,0,0,
194,178,0,0,195,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,196,178,197,178,0,0,198,178,0,0,199,178,
200,178,201,178,0,0,0,0,0,0,0,0,202,178,203,178,
0,0,0,0,0,0,0,0,0,0,0,0,204,178,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,205,178,206,178,0,0,0,0,0,0,0,0,
0,0,0,0,207,178,208,178,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,178,
0,0,0,0,0,0,0,0,0,0,0,0,210,178,0,0,
0,0,0,0,211,178,0,0,0,0,0,0,212,178,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,213,178,214,178,
0,0,0,0,0,0,215,178,0,0,0,0,0,0,0,0,
0,0,0,0,216,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,217,178,218,178,
0,0,0,0,219,178,0,0,0,0,0,0,220,178,0,0,
0,0,0,0,0,0,0,0,0,0,221,178,222,178,223,178,
0,0,224,178,0,0,225,178,226,178,0,0,0,0,0,0,
0,0,0,0,227,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,228,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,229,178,230,178,
0,0,0,0,0,0,0,0,0,0,0,0,231,178,232,178,
0,0,0,0,233,178,0,0,0,0,0,0,234,178,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,178,236,178,
0,0,0,0,237,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,238,178,0,0,0,0,0,0,239,178,0,0,
0,0,0,0,240,178,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,241,178,242,178,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,243,178,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,244,178,245,178,0,0,0,0,246,178,0,0,
247,178,0,0,248,178,0,0,249,178,0,0,0,0,0,0,
0,0,250,178,251,178,252,178,0,0,253,178,0,0,254,178,
0,0,0,0,0,0,161,179,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,162,179,163,179,0,0,0,0,164,179,0,0,
0,0,0,0,165,179,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,166,179,167,179,0,0,168,179,0,0,169,179,
0,0,0,0,0,0,0,0,0,0,0,0,170,179,171,179,
172,179,0,0,173,179,0,0,0,0,174,179,175,179,176,179,
177,179,0,0,0,0,0,0,0,0,0,0,178,179,179,179,
0,0,180,179,181,179,182,179,183,179,184,179,0,0,185,179,
0,0,186,179,187,179,188,179,0,0,0,0,189,179,0,0,
0,0,0,0,190,179,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,191,179,192,179,0,0,193,179,194,179,195,179,
0,0,0,0,0,0,0,0,0,0,0,0,196,179,197,179,
0,0,0,0,198,179,0,0,0,0,0,0,199,179,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,200,179,0,0,
0,0,0,0,0,0,201,179,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,202,179,203,179,
0,0,204,179,205,179,0,0,0,0,0,0,206,179,0,0,
207,179,208,179,0,0,0,0,0,0,0,0,209,179,210,179,
0,0,211,179,212,179,213,179,0,0,0,0,0,0,0,0,
0,0,214,179,215,179,216,179,0,0,0,0,217,179,0,0,
0,0,0,0,218,179,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,219,179,220,179,0,0,221,179,222,179,223,179,
0,0,0,0,0,0,0,0,0,0,0,0,224,179,225,179,
0,0,0,0,226,179,0,0,0,0,0,0,227,179,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,228,179,229,179,
0,0,0,0,230,179,231,179,0,0,0,0,232,179,0,0,
0,0,0,0,233,179,0,0,0,0,0,0,234,179,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,179,236,179,
0,0,0,0,237,179,0,0,0,0,0,0,238,179,0,0,
239,179,0,0,0,0,0,0,0,0,0,0,240,179,241,179,
0,0,242,179,0,0,243,179,0,0,0,0,0,0,0,0,
244,179,245,179,246,179,0,0,0,0,0,0,247,179,0,0,
0,0,0,0,248,179,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,249,179,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,250,179,0,0,0,0,0,0,251,179,0,0,
0,0,0,0,252,179,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,253,179,254,179,0,0,161,180,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,162,180,163,180,
0,0,0,0,164,180,0,0,0,0,0,0,165,180,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,180,
0,0,167,180,0,0,168,180,0,0,0,0,0,0,0,0,
0,0,0,0,169,180,170,180,0,0,0,0,171,180,0,0,
0,0,172,180,173,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,174,180,175,180,0,0,176,180,0,0,177,180,
0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,179,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,180,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,181,180,0,0,
0,0,0,0,182,180,0,0,0,0,0,0,183,180,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,184,180,185,180,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,186,180,187,180,0,0,0,0,0,0,0,0,
0,0,0,0,188,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,189,180,190,180,0,0,0,0,0,0,191,180,
0,0,0,0,0,0,0,0,0,0,0,0,192,180,193,180,
0,0,0,0,194,180,0,0,0,0,0,0,195,180,196,180,
197,180,0,0,0,0,0,0,0,0,0,0,198,180,199,180,
0,0,200,180,0,0,201,180,202,180,0,0,0,0,0,0,
203,180,0,0,204,180,0,0,0,0,0,0,205,180,0,0,
0,0,0,0,206,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,207,180,208,180,
0,0,0,0,209,180,0,0,0,0,0,0,210,180,0,0,
211,180,0,0,0,0,0,0,0,0,0,0,212,180,213,180,
0,0,214,180,0,0,215,180,0,0,0,0,0,0,0,0,
216,180,0,0,217,180,218,180,219,180,0,0,220,180,0,0,
0,0,221,180,222,180,223,180,224,180,225,180,0,0,0,0,
0,0,226,180,227,180,228,180,0,0,229,180,230,180,231,180,
232,180,233,180,0,0,0,0,0,0,234,180,235,180,236,180,
0,0,0,0,237,180,0,0,0,0,0,0,238,180,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,239,180,240,180,
0,0,241,180,242,180,243,180,0,0,0,0,0,0,0,0,
0,0,0,0,244,180,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,245,180,246,180,247,180,0,0,248,180,0,0,
0,0,249,180,250,180,0,0,251,180,252,180,0,0,0,0,
0,0,0,0,253,180,254,180,0,0,161,181,0,0,162,181,
0,0,163,181,0,0,0,0,164,181,0,0,165,181,166,181,
0,0,0,0,167,181,0,0,0,0,0,0,168,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,169,181,170,181,
0,0,171,181,172,181,173,181,0,0,0,0,0,0,0,0,
0,0,0,0,174,181,0,0,0,0,0,0,175,181,0,0,
0,0,0,0,176,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,177,181,178,181,
0,0,0,0,0,0,0,0,0,0,0,0,179,181,0,0,
0,0,0,0,180,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,181,181,182,181,0,0,0,0,183,181,0,0,
0,0,184,181,185,181,0,0,186,181,0,0,187,181,0,0,
0,0,0,0,188,181,189,181,0,0,190,181,0,0,191,181,
0,0,192,181,0,0,193,181,0,0,0,0,194,181,0,0,
0,0,0,0,195,181,0,0,0,0,0,0,196,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,197,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,198,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,199,181,0,0,
0,0,0,0,200,181,0,0,0,0,0,0,201,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,202,181,203,181,
0,0,204,181,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,205,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,206,181,207,181,
0,0,0,0,208,181,0,0,0,0,0,0,209,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,210,181,211,181,
0,0,212,181,0,0,213,181,0,0,0,0,0,0,0,0,
0,0,0,0,214,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,215,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,216,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,217,181,0,0,0,0,0,0,0,0,
0,0,0,0,218,181,0,0,0,0,0,0,219,181,0,0,
0,0,0,0,220,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,221,181,0,0,222,181,0,0,223,181,
0,0,0,0,0,0,0,0,0,0,0,0,224,181,0,0,
0,0,0,0,225,181,0,0,0,0,0,0,226,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,227,181,0,0,
0,0,0,0,0,0,228,181,0,0,0,0,0,0,0,0,
0,0,0,0,229,181,230,181,0,0,0,0,231,181,0,0,
0,0,232,181,233,181,0,0,234,181,0,0,0,0,0,0,
0,0,0,0,235,181,236,181,0,0,237,181,0,0,238,181,
0,0,0,0,0,0,0,0,0,0,0,0,239,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,240,181,241,181,0,0,0,0,242,181,0,0,
0,0,243,181,244,181,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,245,181,246,181,0,0,247,181,248,181,249,181,
250,181,0,0,0,0,0,0,0,0,0,0,251,181,252,181,
0,0,0,0,253,181,0,0,0,0,0,0,254,181,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,161,182,162,182,
0,0,163,182,164,182,165,182,0,0,0,0,0,0,0,0,
0,0,166,182,167,182,168,182,0,0,0,0,169,182,0,0,
0,0,0,0,170,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,171,182,172,182,0,0,173,182,174,182,175,182,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,176,182,177,182,
0,0,0,0,178,182,0,0,0,0,0,0,179,182,0,0,
180,182,181,182,0,0,0,0,0,0,0,0,182,182,183,182,
0,0,184,182,185,182,186,182,0,0,0,0,0,0,0,0,
0,0,187,182,188,182,189,182,0,0,0,0,190,182,0,0,
0,0,0,0,191,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,192,182,193,182,0,0,194,182,195,182,196,182,
0,0,0,0,0,0,0,0,0,0,0,0,197,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,198,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,199,182,200,182,
0,0,0,0,201,182,0,0,0,0,0,0,202,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,203,182,0,0,0,0,0,0,0,0,
0,0,0,0,204,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,205,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,206,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,207,182,0,0,0,0,0,0,208,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,209,182,210,182,0,0,0,0,211,182,0,0,
0,0,0,0,212,182,0,0,0,0,0,0,0,0,0,0,
0,0,213,182,214,182,0,0,0,0,0,0,0,0,215,182,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,216,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,217,182,0,0,
0,0,0,0,218,182,0,0,0,0,0,0,219,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,220,182,221,182,
0,0,0,0,0,0,222,182,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,223,182,224,182,
0,0,0,0,225,182,0,0,0,0,226,182,227,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,228,182,229,182,
0,0,230,182,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,231,182,0,0,0,0,0,0,232,182,0,0,
0,0,0,0,233,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,234,182,235,182,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,236,182,0,0,
0,0,0,0,237,182,0,0,0,0,0,0,238,182,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,239,182,240,182,
0,0,241,182,0,0,242,182,0,0,0,0,0,0,0,0,
0,0,0,0,243,182,244,182,0,0,0,0,245,182,0,0,
0,0,0,0,246,182,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,247,182,248,182,0,0,249,182,250,182,251,182,
252,182,0,0,0,0,0,0,253,182,254,182,161,183,162,183,
0,0,0,0,163,183,0,0,0,0,0,0,164,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,165,183,166,183,
0,0,167,183,168,183,169,183,0,0,0,0,0,0,0,0,
0,0,0,0,170,183,171,183,0,0,0,0,172,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,173,183,0,0,174,183,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,175,183,176,183,0,0,0,0,177,183,0,0,
0,0,0,0,178,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,179,183,180,183,0,0,181,183,182,183,183,183,
0,0,0,0,0,0,0,0,0,0,184,183,185,183,186,183,
0,0,0,0,187,183,0,0,0,0,0,0,188,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,189,183,190,183,
0,0,191,183,0,0,192,183,0,0,0,0,0,0,0,0,
0,0,0,0,193,183,194,183,0,0,0,0,195,183,0,0,
0,0,0,0,196,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,197,183,198,183,0,0,199,183,200,183,201,183,
0,0,0,0,0,0,0,0,0,0,0,0,202,183,0,0,
0,0,0,0,203,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,183,
0,0,205,183,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,206,183,207,183,0,0,0,0,208,183,0,0,
0,0,0,0,209,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,210,183,211,183,0,0,212,183,0,0,213,183,
0,0,0,0,0,0,0,0,0,0,0,0,214,183,0,0,
0,0,0,0,215,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,216,183,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,217,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,183,0,0,
0,0,0,0,219,183,0,0,0,0,0,0,220,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,221,183,222,183,
0,0,223,183,0,0,224,183,0,0,0,0,0,0,0,0,
0,0,0,0,225,183,0,0,0,0,0,0,226,183,0,0,
0,0,0,0,227,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,228,183,0,0,229,183,0,0,230,183,
0,0,0,0,0,0,0,0,0,0,0,0,231,183,232,183,
0,0,0,0,233,183,0,0,0,0,0,0,234,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,183,236,183,
0,0,237,183,0,0,238,183,0,0,0,0,0,0,0,0,
0,0,0,0,239,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,240,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,241,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,242,183,243,183,0,0,0,0,244,183,0,0,
0,0,0,0,245,183,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,246,183,0,0,0,0,247,183,0,0,248,183,
0,0,0,0,0,0,0,0,0,0,0,0,249,183,250,183,
0,0,0,0,251,183,0,0,0,0,0,0,252,183,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,253,183,254,183,
0,0,161,184,0,0,162,184,0,0,0,0,0,0,0,0,
0,0,0,0,163,184,164,184,0,0,0,0,165,184,0,0,
0,0,0,0,166,184,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,167,184,168,184,0,0,169,184,0,0,170,184,
171,184,0,0,0,0,172,184,173,184,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,174,184,175,184,0,0,0,0,176,184,0,0,
0,0,0,0,177,184,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,178,184,179,184,0,0,180,184,0,0,181,184,
0,0,0,0,0,0,0,0,0,0,0,0,182,184,183,184,
0,0,0,0,184,184,0,0,185,184,186,184,187,184,188,184,
189,184,0,0,0,0,0,0,0,0,0,0,190,184,191,184,
0,0,192,184,0,0,193,184,194,184,0,0,0,0,195,184,
0,0,196,184,197,184,198,184,0,0,0,0,199,184,0,0,
0,0,0,0,200,184,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,201,184,202,184,0,0,203,184,204,184,205,184,
206,184,0,0,0,0,0,0,0,0,0,0,207,184,208,184,
0,0,0,0,0,0,0,0,0,0,0,0,209,184,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,210,184,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,211,184,212,184,
0,0,0,0,213,184,0,0,0,0,0,0,214,184,0,0,
215,184,0,0,0,0,0,0,0,0,0,0,216,184,217,184,
0,0,218,184,0,0,219,184,220,184,0,0,0,0,0,0,
0,0,221,184,222,184,223,184,0,0,0,0,224,184,0,0,
0,0,0,0,225,184,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,226,184,227,184,0,0,228,184,229,184,230,184,
0,0,0,0,0,0,0,0,0,0,0,0,231,184,232,184,
0,0,0,0,233,184,0,0,0,0,0,0,234,184,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,235,184,236,184,237,184,0,0,238,184,0,0,0,0,
0,0,0,0,239,184,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,240,184,241,184,
0,0,242,184,243,184,0,0,0,0,0,0,244,184,0,0,
245,184,0,0,0,0,0,0,0,0,0,0,246,184,247,184,
0,0,248,184,0,0,249,184,0,0,0,0,0,0,0,0,
0,0,0,0,250,184,0,0,0,0,0,0,251,184,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,252,184,253,184,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,254,184,0,0,0,0,0,0,161,185,0,0,
0,0,0,0,162,185,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,163,185,0,0,164,185,0,0,165,185,
0,0,0,0,0,0,0,0,0,0,0,0,166,185,0,0,
0,0,0,0,167,185,0,0,0,0,0,0,168,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,185,
0,0,170,185,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,171,185,172,185,173,185,0,0,174,185,0,0,
0,0,175,185,176,185,177,185,178,185,0,0,0,0,0,0,
0,0,0,0,179,185,180,185,0,0,181,185,0,0,182,185,
0,0,0,0,0,0,183,185,0,0,184,185,185,185,0,0,
0,0,0,0,186,185,0,0,0,0,0,0,187,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,185,
0,0,189,185,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,190,185,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,191,185,0,0,
0,0,0,0,192,185,0,0,0,0,0,0,193,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,194,185,0,0,0,0,0,0,195,185,0,0,
0,0,0,0,196,185,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,197,185,0,0,0,0,198,185,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,199,185,0,0,
0,0,0,0,200,185,0,0,0,0,0,0,201,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,202,185,0,0,
0,0,203,185,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,204,185,205,185,
0,0,0,0,206,185,0,0,0,0,207,185,208,185,0,0,
209,185,0,0,0,0,0,0,0,0,0,0,210,185,211,185,
0,0,212,185,213,185,214,185,0,0,215,185,0,0,216,185,
0,0,0,0,217,185,218,185,219,185,220,185,221,185,0,0,
0,0,222,185,223,185,224,185,225,185,226,185,0,0,0,0,
0,0,0,0,227,185,228,185,0,0,229,185,0,0,230,185,
0,0,0,0,0,0,231,185,0,0,0,0,232,185,233,185,
0,0,0,0,234,185,0,0,0,0,0,0,235,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,236,185,237,185,
0,0,238,185,239,185,240,185,0,0,0,0,0,0,241,185,
0,0,0,0,242,185,243,185,0,0,0,0,244,185,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,245,185,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,246,185,247,185,0,0,0,0,248,185,0,0,
0,0,249,185,250,185,0,0,251,185,0,0,0,0,0,0,
0,0,0,0,252,185,253,185,0,0,254,185,0,0,161,186,
162,186,0,0,0,0,0,0,0,0,0,0,163,186,164,186,
0,0,0,0,165,186,0,0,0,0,166,186,167,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,168,186,169,186,
0,0,170,186,171,186,172,186,0,0,0,0,0,0,0,0,
0,0,0,0,173,186,174,186,0,0,0,0,175,186,0,0,
0,0,0,0,176,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,177,186,0,0,178,186,179,186,180,186,
0,0,0,0,0,0,181,186,0,0,0,0,182,186,0,0,
0,0,0,0,183,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,184,186,185,186,186,186,0,0,187,186,0,0,
0,0,0,0,188,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,189,186,190,186,0,0,191,186,0,0,192,186,
0,0,0,0,0,0,0,0,0,0,0,0,193,186,0,0,
0,0,0,0,194,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,195,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,196,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,197,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,198,186,199,186,
0,0,0,0,200,186,0,0,0,0,0,0,201,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,202,186,203,186,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,204,186,0,0,0,0,0,0,205,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,206,186,207,186,
0,0,0,0,208,186,0,0,0,0,209,186,210,186,211,186,
212,186,0,0,0,0,0,0,0,0,0,0,213,186,214,186,
0,0,215,186,0,0,216,186,0,0,0,0,0,0,217,186,
218,186,0,0,219,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,220,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,221,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,222,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,223,186,224,186,0,0,0,0,225,186,0,0,
0,0,0,0,226,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,186,
0,0,0,0,0,0,0,0,0,0,0,0,228,186,0,0,
0,0,0,0,229,186,0,0,0,0,0,0,230,186,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,231,186,0,0,
0,0,232,186,0,0,233,186,0,0,0,0,0,0,0,0,
0,0,0,0,234,186,235,186,0,0,0,0,236,186,0,0,
0,0,0,0,237,186,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,238,186,239,186,0,0,240,186,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,241,186,242,186,0,0,0,0,243,186,0,0,
0,0,0,0,244,186,0,0,245,186,0,0,0,0,0,0,
0,0,0,0,246,186,247,186,0,0,248,186,0,0,249,186,
250,186,251,186,0,0,0,0,0,0,0,0,252,186,253,186,
0,0,0,0,254,186,0,0,0,0,0,0,161,187,0,0,
162,187,0,0,0,0,0,0,0,0,0,0,163,187,164,187,
0,0,165,187,166,187,167,187,0,0,0,0,0,0,0,0,
0,0,168,187,169,187,170,187,0,0,0,0,171,187,0,0,
0,0,0,0,172,187,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,173,187,174,187,0,0,175,187,176,187,177,187,
0,0,0,0,0,0,0,0,0,0,0,0,178,187,179,187,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,180,187,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,181,187,182,187,
0,0,0,0,183,187,0,0,0,0,184,187,185,187,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,186,187,0,0,
0,0,187,187,188,187,189,187,0,0,0,0,0,0,0,0,
0,0,0,0,190,187,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,187,
0,0,0,0,0,0,0,0,0,0,0,0,192,187,193,187,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,194,187,195,187,
0,0,196,187,197,187,198,187,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,199,187,200,187,
0,0,0,0,201,187,0,0,0,0,0,0,202,187,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,203,187,204,187,
0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,223,187,224,187,
0,0,0,0,225,187,0,0,0,0,0,0,226,187,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,227,187,228,187,
0,0,229,187,0,0,230,187,0,0,0,0,0,0,0,0,
0,0,0,0,231,187,232,187,0,0,233,187,234,187,0,0,
0,0,235,187,236,187,237,187,238,187,0,0,0,0,0,0,
0,0,0,0,239,187,240,187,0,0,241,187,242,187,243,187,
0,0,0,0,0,0,244,187,0,0,0,0,245,187,246,187,
0,0,0,0,247,187,0,0,0,0,0,0,248,187,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,249,187,250,187,
0,0,251,187,252,187,253,187,0,0,0,0,0,0,0,0,
0,0,0,0,254,187,161,188,0,0,0,0,162,188,0,0,
0,0,0,0,163,188,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,164,188,165,188,0,0,166,188,0,0,167,188,
0,0,0,0,0,0,0,0,0,0,0,0,168,188,0,0,
0,0,0,0,169,188,0,0,0,0,0,0,170,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,171,188,0,0,
0,0,0,0,0,0,172,188,0,0,0,0,0,0,0,0,
0,0,0,0,173,188,174,188,175,188,176,188,177,188,0,0,
0,0,178,188,179,188,0,0,180,188,181,188,0,0,0,0,
0,0,0,0,182,188,183,188,0,0,184,188,185,188,186,188,
0,0,0,0,0,0,0,0,187,188,0,0,188,188,189,188,
0,0,0,0,190,188,0,0,0,0,0,0,191,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,192,188,193,188,
0,0,194,188,195,188,196,188,0,0,0,0,0,0,0,0,
0,0,0,0,197,188,198,188,0,0,0,0,199,188,0,0,
0,0,0,0,200,188,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,201,188,202,188,0,0,203,188,204,188,205,188,
0,0,0,0,0,0,0,0,0,0,0,0,206,188,0,0,
0,0,0,0,207,188,0,0,0,0,0,0,208,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,209,188,0,0,0,0,0,0,0,0,
0,0,0,0,210,188,211,188,212,188,0,0,213,188,0,0,
0,0,0,0,214,188,0,0,215,188,0,0,0,0,0,0,
0,0,0,0,216,188,217,188,0,0,218,188,0,0,219,188,
0,0,0,0,0,0,220,188,0,0,0,0,221,188,222,188,
0,0,0,0,223,188,0,0,0,0,0,0,224,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,225,188,0,0,0,0,0,0,0,0,
0,0,0,0,226,188,0,0,0,0,0,0,227,188,0,0,
0,0,0,0,228,188,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,229,188,0,0,0,0,230,188,231,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,232,188,0,0,
0,0,0,0,233,188,0,0,0,0,0,0,234,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,188,236,188,
0,0,237,188,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,238,188,239,188,0,0,0,0,240,188,0,0,
0,0,0,0,241,188,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,242,188,243,188,0,0,244,188,0,0,245,188,
0,0,0,0,0,0,0,0,0,0,0,0,246,188,247,188,
0,0,0,0,248,188,0,0,0,0,249,188,250,188,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,251,188,252,188,
0,0,253,188,0,0,254,188,0,0,161,189,0,0,162,189,
163,189,0,0,164,189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,165,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,166,189,167,189,
0,0,0,0,168,189,0,0,0,0,0,0,169,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,170,189,0,0,
0,0,0,0,0,0,171,189,0,0,0,0,0,0,0,0,
0,0,0,0,172,189,173,189,0,0,0,0,174,189,0,0,
0,0,0,0,175,189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,176,189,177,189,0,0,178,189,0,0,179,189,
0,0,0,0,0,0,0,0,0,0,0,0,180,189,181,189,
0,0,0,0,0,0,0,0,0,0,0,0,182,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,183,189,0,0,
0,0,184,189,0,0,185,189,0,0,0,0,0,0,0,0,
0,0,0,0,186,189,187,189,0,0,0,0,188,189,0,0,
0,0,0,0,189,189,190,189,0,0,0,0,0,0,0,0,
0,0,0,0,191,189,192,189,0,0,193,189,0,0,194,189,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,195,189,196,189,0,0,0,0,197,189,0,0,
0,0,198,189,199,189,0,0,0,0,0,0,0,0,0,0,
0,0,200,189,201,189,202,189,0,0,203,189,0,0,204,189,
0,0,0,0,0,0,0,0,205,189,0,0,206,189,207,189,
0,0,208,189,209,189,0,0,0,0,0,0,210,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,211,189,212,189,
0,0,0,0,213,189,214,189,0,0,0,0,0,0,0,0,
0,0,215,189,216,189,217,189,0,0,0,0,218,189,0,0,
0,0,0,0,219,189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,220,189,221,189,0,0,0,0,222,189,223,189,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,224,189,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,225,189,226,189,
0,0,0,0,227,189,0,0,0,0,0,0,228,189,0,0,
229,189,0,0,0,0,0,0,0,0,0,0,230,189,231,189,
0,0,0,0,232,189,233,189,0,0,0,0,0,0,0,0,
0,0,0,0,234,189,0,0,0,0,0,0,235,189,0,0,
0,0,0,0,236,189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,237,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,238,189,239,189,
0,0,0,0,240,189,0,0,0,0,241,189,242,189,0,0,
243,189,0,0,0,0,0,0,0,0,0,0,244,189,245,189,
0,0,0,0,0,0,246,189,0,0,0,0,0,0,0,0,
0,0,0,0,247,189,248,189,0,0,0,0,249,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,250,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,251,189,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,252,189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,253,189,0,0,0,0,0,0,254,189,0,0,
0,0,0,0,161,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,162,190,163,190,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,164,190,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,165,190,166,190,0,0,0,0,167,190,0,0,
0,0,0,0,168,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,169,190,170,190,0,0,0,0,0,0,171,190,
0,0,0,0,0,0,0,0,0,0,0,0,172,190,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,173,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,174,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,175,190,0,0,
0,0,0,0,176,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,177,190,
0,0,0,0,0,0,0,0,0,0,0,0,178,190,179,190,
0,0,0,0,180,190,0,0,0,0,0,0,181,190,0,0,
182,190,0,0,0,0,0,0,0,0,183,190,184,190,185,190,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,186,190,0,0,0,0,0,0,187,190,0,0,
0,0,0,0,188,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,189,190,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,190,190,191,190,
0,0,0,0,192,190,0,0,0,0,0,0,193,190,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,194,190,195,190,
0,0,196,190,0,0,197,190,0,0,0,0,0,0,0,0,
0,0,0,0,198,190,199,190,0,0,0,0,200,190,201,190,
202,190,0,0,203,190,204,190,205,190,0,0,0,0,0,0,
0,0,206,190,207,190,208,190,0,0,209,190,210,190,211,190,
0,0,0,0,0,0,212,190,213,190,0,0,214,190,215,190,
0,0,0,0,216,190,0,0,0,0,0,0,217,190,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,190,219,190,
0,0,220,190,221,190,222,190,0,0,0,0,0,0,0,0,
0,0,0,0,223,190,224,190,0,0,0,0,225,190,0,0,
0,0,0,0,226,190,0,0,0,0,227,190,0,0,0,0,
0,0,0,0,228,190,229,190,0,0,230,190,0,0,231,190,
0,0,0,0,0,0,232,190,0,0,233,190,234,190,0,0,
0,0,0,0,235,190,0,0,0,0,0,0,236,190,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,190,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,238,190,239,190,0,0,0,0,240,190,241,190,
0,0,242,190,243,190,244,190,245,190,0,0,0,0,0,0,
0,0,0,0,246,190,247,190,248,190,249,190,250,190,251,190,
252,190,0,0,253,190,0,0,254,190,0,0,161,191,162,191,
0,0,0,0,163,191,0,0,0,0,0,0,164,191,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,165,191,166,191,
0,0,167,191,0,0,168,191,0,0,0,0,0,0,0,0,
0,0,0,0,169,191,170,191,171,191,0,0,172,191,0,0,
0,0,0,0,173,191,0,0,174,191,175,191,0,0,0,0,
0,0,0,0,176,191,177,191,178,191,179,191,180,191,181,191,
0,0,0,0,0,0,182,191,183,191,184,191,185,191,0,0,
0,0,0,0,186,191,0,0,0,0,0,0,187,191,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,188,191,189,191,
0,0,190,191,191,191,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,192,191,193,191,0,0,0,0,194,191,0,0,
0,0,0,0,195,191,196,191,197,191,0,0,198,191,0,0,
0,0,199,191,200,191,201,191,0,0,202,191,0,0,203,191,
0,0,204,191,0,0,0,0,0,0,0,0,205,191,206,191,
0,0,0,0,207,191,0,0,0,0,0,0,208,191,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,209,191,210,191,
0,0,211,191,212,191,213,191,0,0,0,0,0,0,0,0,
0,0,0,0,214,191,215,191,0,0,0,0,216,191,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,217,191,0,0,0,0,218,191,0,0,219,191,
0,0,0,0,0,0,0,0,0,0,0,0,220,191,221,191,
0,0,0,0,222,191,0,0,0,0,0,0,223,191,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,224,191,225,191,
0,0,226,191,0,0,227,191,0,0,0,0,0,0,0,0,
0,0,0,0,228,191,229,191,0,0,0,0,230,191,0,0,
0,0,0,0,231,191,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,232,191,233,191,0,0,234,191,0,0,235,191,
0,0,0,0,0,0,0,0,0,0,0,0,236,191,237,191,
0,0,0,0,238,191,0,0,0,0,0,0,239,191,240,191,
241,191,0,0,0,0,0,0,0,0,0,0,242,191,243,191,
0,0,244,191,0,0,245,191,0,0,0,0,0,0,0,0,
0,0,0,0,246,191,247,191,0,0,0,0,248,191,0,0,
0,0,0,0,249,191,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,250,191,251,191,0,0,0,0,252,191,253,191,
0,0,0,0,0,0,0,0,0,0,0,0,254,191,161,192,
0,0,0,0,162,192,0,0,0,0,0,0,163,192,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,164,192,165,192,
0,0,0,0,0,0,166,192,0,0,0,0,0,0,0,0,
0,0,0,0,167,192,168,192,0,0,0,0,169,192,0,0,
0,0,0,0,170,192,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,171,192,172,192,0,0,173,192,0,0,174,192,
0,0,0,0,0,0,0,0,0,0,0,0,175,192,176,192,
0,0,0,0,177,192,0,0,0,0,0,0,178,192,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,179,192,180,192,
0,0,181,192,0,0,182,192,0,0,183,192,0,0,0,0,
0,0,0,0,184,192,185,192,0,0,0,0,186,192,0,0,
0,0,0,0,187,192,0,0,0,0,0,0,0,0,0,0,
188,192,0,0,189,192,190,192,0,0,191,192,0,0,192,192,
193,192,194,192,195,192,196,192,197,192,198,192,199,192,0,0,
0,0,0,0,200,192,0,0,0,0,0,0,201,192,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,202,192,0,0,
0,0,203,192,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,204,192,205,192,0,0,0,0,206,192,0,0,
0,0,0,0,207,192,208,192,209,192,0,0,0,0,0,0,
0,0,210,192,211,192,212,192,0,0,213,192,214,192,215,192,
216,192,0,0,0,0,0,0,217,192,0,0,218,192,219,192,
0,0,0,0,220,192,0,0,221,192,222,192,223,192,0,0,
224,192,0,0,0,0,0,0,0,0,0,0,225,192,226,192,
0,0,227,192,228,192,229,192,230,192,0,0,0,0,0,0,
0,0,0,0,231,192,232,192,0,0,0,0,233,192,0,0,
0,0,0,0,234,192,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,235,192,236,192,0,0,237,192,238,192,239,192,
0,0,0,0,0,0,0,0,0,0,0,0,240,192,241,192,
0,0,0,0,242,192,0,0,243,192,0,0,244,192,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,245,192,0,0,
0,0,0,0,0,0,246,192,0,0,0,0,0,0,0,0,
0,0,0,0,247,192,0,0,0,0,0,0,248,192,0,0,
0,0,0,0,249,192,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,250,192,251,192,
0,0,0,0,252,192,0,0,0,0,0,0,253,192,0,0,
254,192,0,0,0,0,0,0,0,0,0,0,161,193,162,193,
0,0,163,193,0,0,164,193,165,193,0,0,0,0,0,0,
0,0,0,0,166,193,167,193,0,0,0,0,168,193,0,0,
0,0,0,0,169,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,170,193,171,193,0,0,172,193,0,0,173,193,
0,0,0,0,0,0,0,0,0,0,0,0,174,193,0,0,
0,0,0,0,175,193,0,0,0,0,0,0,176,193,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,177,193,178,193,
0,0,0,0,179,193,180,193,0,0,0,0,0,0,0,0,
0,0,0,0,181,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,182,193,183,193,
0,0,0,0,184,193,0,0,0,0,0,0,185,193,0,0,
186,193,0,0,0,0,0,0,0,0,0,0,187,193,188,193,
0,0,189,193,0,0,190,193,191,193,192,193,0,0,0,0,
0,0,193,193,194,193,195,193,0,0,0,0,0,0,0,0,
0,0,0,0,196,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,197,193,0,0,198,193,0,0,199,193,
0,0,0,0,0,0,0,0,0,0,0,0,200,193,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,201,193,202,193,0,0,0,0,0,0,0,0,
0,0,0,0,203,193,0,0,0,0,0,0,204,193,0,0,
0,0,0,0,205,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,206,193,207,193,0,0,208,193,0,0,209,193,
0,0,0,0,0,0,0,0,0,0,0,0,210,193,211,193,
0,0,0,0,212,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,213,193,0,0,0,0,0,0,0,0,
0,0,0,0,214,193,215,193,0,0,0,0,216,193,0,0,
0,0,0,0,217,193,218,193,219,193,0,0,0,0,0,0,
0,0,0,0,220,193,221,193,0,0,222,193,0,0,223,193,
0,0,0,0,0,0,0,0,0,0,0,0,224,193,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,225,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,226,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,227,193,228,193,
0,0,0,0,229,193,0,0,0,0,0,0,230,193,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,231,193,232,193,
0,0,233,193,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,234,193,0,0,0,0,0,0,235,193,0,0,
0,0,0,0,236,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,237,193,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,238,193,239,193,
0,0,0,0,240,193,0,0,0,0,0,0,241,193,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,242,193,243,193,
0,0,244,193,0,0,245,193,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,246,193,247,193,
0,0,0,0,248,193,0,0,0,0,249,193,250,193,0,0,
251,193,0,0,0,0,0,0,0,0,0,0,252,193,253,193,
0,0,254,193,0,0,161,194,162,194,0,0,0,0,163,194,
164,194,0,0,165,194,166,194,0,0,0,0,167,194,0,0,
168,194,0,0,169,194,0,0,0,0,170,194,0,0,0,0,
0,0,0,0,171,194,172,194,0,0,173,194,174,194,175,194,
0,0,0,0,0,0,0,0,0,0,0,0,176,194,177,194,
0,0,0,0,178,194,0,0,0,0,0,0,179,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,180,194,181,194,
0,0,182,194,183,194,184,194,0,0,0,0,0,0,0,0,
0,0,0,0,185,194,0,0,0,0,0,0,186,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,187,194,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,188,194,189,194,0,0,0,0,190,194,0,0,
0,0,0,0,191,194,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,192,194,193,194,0,0,194,194,195,194,196,194,
0,0,0,0,0,0,0,0,0,0,0,0,197,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,198,194,0,0,0,0,0,0,0,0,
0,0,0,0,199,194,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,200,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,201,194,202,194,0,0,0,0,203,194,0,0,
0,0,0,0,204,194,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,205,194,206,194,0,0,207,194,0,0,208,194,
0,0,209,194,0,0,0,0,0,0,0,0,210,194,211,194,
0,0,0,0,0,0,0,0,0,0,0,0,212,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,213,194,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,214,194,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,215,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,216,194,0,0,
0,0,0,0,217,194,0,0,0,0,0,0,218,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,219,194,220,194,
0,0,0,0,0,0,0,0,0,0,0,0,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,0,244,194,
245,194,0,0,0,0,0,0,0,0,246,194,247,194,248,194,
0,0,0,0,249,194,0,0,250,194,0,0,251,194,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,252,194,253,194,
0,0,254,194,161,195,162,195,163,195,0,0,0,0,0,0,
0,0,0,0,164,195,165,195,0,0,0,0,166,195,0,0,
0,0,0,0,167,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,168,195,169,195,0,0,170,195,171,195,172,195,
0,0,0,0,0,0,0,0,0,0,0,0,173,195,0,0,
0,0,0,0,174,195,0,0,175,195,0,0,176,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,177,195,0,0,
0,0,0,0,0,0,178,195,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,179,195,180,195,
0,0,0,0,181,195,0,0,0,0,0,0,182,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,183,195,184,195,
0,0,185,195,186,195,187,195,0,0,0,0,0,0,0,0,
0,0,0,0,188,195,189,195,0,0,0,0,190,195,0,0,
0,0,0,0,191,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,192,195,193,195,0,0,194,195,0,0,195,195,
0,0,0,0,0,0,0,0,0,0,0,0,196,195,0,0,
0,0,0,0,197,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,198,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,199,195,0,0,0,0,0,0,200,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,195,
0,0,0,0,0,0,0,0,0,0,0,0,202,195,203,195,
0,0,0,0,204,195,0,0,0,0,0,0,205,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,206,195,207,195,
0,0,208,195,0,0,209,195,0,0,0,0,0,0,0,0,
0,0,0,0,210,195,0,0,0,0,0,0,211,195,0,0,
0,0,0,0,212,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,213,195,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,214,195,0,0,0,0,0,0,215,195,0,0,
0,0,0,0,216,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,217,195,218,195,0,0,219,195,0,0,220,195,
0,0,0,0,0,0,0,0,0,0,0,0,221,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,222,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,223,195,224,195,0,0,0,0,225,195,0,0,
0,0,0,0,226,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,227,195,228,195,0,0,229,195,0,0,230,195,
0,0,0,0,0,0,0,0,0,0,0,0,231,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,232,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,233,195,0,0,0,0,0,0,234,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,195,0,0,
0,0,0,0,236,195,0,0,0,0,0,0,237,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,238,195,239,195,
0,0,240,195,0,0,241,195,0,0,0,0,0,0,0,0,
0,0,0,0,242,195,0,0,0,0,0,0,243,195,0,0,
0,0,0,0,244,195,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,245,195,0,0,0,0,0,0,0,0,246,195,
0,0,0,0,0,0,0,0,0,0,0,0,247,195,248,195,
0,0,0,0,249,195,0,0,0,0,0,0,250,195,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,251,195,252,195,
0,0,253,195,0,0,254,195,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,161,196,162,196,
0,0,0,0,163,196,0,0,0,0,164,196,165,196,166,196,
0,0,0,0,0,0,0,0,0,0,0,0,167,196,168,196,
0,0,169,196,0,0,170,196,0,0,0,0,0,0,0,0,
0,0,0,0,171,196,172,196,0,0,0,0,173,196,0,0,
0,0,0,0,174,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,175,196,176,196,0,0,177,196,0,0,178,196,
0,0,0,0,0,0,0,0,0,0,0,0,179,196,180,196,
0,0,0,0,181,196,0,0,0,0,0,0,182,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,183,196,184,196,
0,0,185,196,186,196,187,196,0,0,0,0,0,0,0,0,
0,0,0,0,188,196,189,196,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,196,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,191,196,192,196,0,0,0,0,193,196,0,0,
0,0,194,196,195,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,196,196,197,196,0,0,198,196,199,196,200,196,
0,0,0,0,0,0,0,0,0,0,0,0,201,196,202,196,
0,0,0,0,203,196,0,0,0,0,0,0,204,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,205,196,206,196,
0,0,207,196,0,0,208,196,0,0,0,0,0,0,0,0,
0,0,0,0,209,196,0,0,0,0,0,0,210,196,0,0,
0,0,0,0,211,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,212,196,213,196,0,0,214,196,215,196,216,196,
0,0,0,0,0,0,0,0,0,0,0,0,217,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,218,196,219,196,0,0,0,0,220,196,0,0,
0,0,0,0,221,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,222,196,223,196,0,0,224,196,0,0,225,196,
0,0,0,0,0,0,0,0,0,0,0,0,226,196,227,196,
0,0,0,0,228,196,0,0,0,0,0,0,229,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,230,196,0,0,
0,0,0,0,0,0,231,196,0,0,0,0,0,0,0,0,
0,0,0,0,232,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,196,
0,0,0,0,0,0,0,0,0,0,0,0,234,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,235,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,236,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,237,196,238,196,
0,0,0,0,239,196,0,0,0,0,0,0,240,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,241,196,242,196,
0,0,243,196,0,0,244,196,0,0,0,0,0,0,0,0,
0,0,0,0,245,196,0,0,0,0,0,0,246,196,0,0,
0,0,0,0,247,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,196,
0,0,0,0,0,0,0,0,0,0,0,0,249,196,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,250,196,0,0,0,0,0,0,0,0,
0,0,0,0,251,196,252,196,0,0,0,0,253,196,0,0,
0,0,0,0,254,196,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,161,197,162,197,0,0,163,197,0,0,164,197,
0,0,0,0,0,0,0,0,0,0,0,0,165,197,0,0,
0,0,0,0,166,197,0,0,0,0,0,0,167,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,168,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,169,197,170,197,0,0,0,0,171,197,0,0,
0,0,0,0,172,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,173,197,174,197,0,0,0,0,0,0,175,197,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,176,197,177,197,0,0,0,0,178,197,0,0,
0,0,0,0,179,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,180,197,181,197,0,0,182,197,0,0,183,197,
0,0,0,0,0,0,0,0,0,0,0,0,184,197,185,197,
0,0,0,0,186,197,0,0,0,0,0,0,187,197,188,197,
0,0,0,0,0,0,0,0,0,0,0,0,189,197,190,197,
0,0,191,197,192,197,193,197,0,0,0,0,0,0,0,0,
0,0,0,0,194,197,195,197,0,0,0,0,196,197,0,0,
0,0,0,0,197,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,198,197,199,197,0,0,200,197,201,197,202,197,
0,0,0,0,0,0,0,0,0,0,0,0,203,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,204,197,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,205,197,206,197,
0,0,0,0,207,197,0,0,0,0,0,0,208,197,0,0,
209,197,0,0,0,0,0,0,0,0,0,0,210,197,211,197,
0,0,212,197,213,197,214,197,0,0,0,0,0,0,0,0,
0,0,0,0,215,197,216,197,0,0,0,0,217,197,0,0,
0,0,0,0,218,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,219,197,220,197,0,0,221,197,0,0,222,197,
0,0,0,0,0,0,0,0,0,0,0,0,223,197,0,0,
0,0,0,0,224,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,225,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,226,197,0,0,0,0,0,0,227,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,228,197,229,197,
0,0,0,0,230,197,0,0,0,0,0,0,231,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,232,197,233,197,
0,0,234,197,0,0,235,197,0,0,0,0,0,0,0,0,
236,197,0,0,237,197,0,0,0,0,0,0,238,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,239,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,240,197,0,0,0,0,0,0,241,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,242,197,0,0,243,197,
0,0,0,0,0,0,0,0,0,0,0,0,244,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,245,197,246,197,0,0,0,0,247,197,0,0,
0,0,0,0,248,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,249,197,250,197,0,0,251,197,0,0,252,197,
0,0,0,0,0,0,0,0,0,0,0,0,253,197,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,254,197,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,161,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,162,198,163,198,
0,0,0,0,164,198,0,0,0,0,0,0,165,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,166,198,167,198,
0,0,0,0,0,0,168,198,0,0,0,0,0,0,0,0,
0,0,0,0,169,198,0,0,0,0,0,0,170,198,0,0,
0,0,0,0,171,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,172,198,0,0,0,0,0,0,0,0,173,198,
0,0,0,0,0,0,0,0,0,0,0,0,174,198,175,198,
0,0,0,0,176,198,0,0,0,0,177,198,178,198,0,0,
179,198,0,0,0,0,0,0,0,0,0,0,180,198,181,198,
0,0,182,198,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,183,198,0,0,0,0,0,0,184,198,0,0,
0,0,0,0,185,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,186,198,187,198,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,188,198,189,198,
0,0,0,0,190,198,0,0,0,0,0,0,191,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,192,198,193,198,
0,0,194,198,0,0,195,198,0,0,0,0,0,0,0,0,
0,0,0,0,196,198,197,198,198,198,0,0,199,198,0,0,
0,0,0,0,200,198,0,0,201,198,0,0,0,0,0,0,
0,0,0,0,202,198,203,198,0,0,204,198,205,198,206,198,
0,0,0,0,0,0,207,198,0,0,0,0,208,198,209,198,
0,0,0,0,210,198,0,0,0,0,0,0,211,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,212,198,213,198,
0,0,214,198,215,198,216,198,0,0,0,0,0,0,0,0,
0,0,0,0,217,198,218,198,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,219,198,220,198,0,0,0,0,221,198,0,0,
0,0,0,0,222,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,223,198,224,198,0,0,225,198,226,198,227,198,
0,0,0,0,0,0,0,0,0,0,0,0,228,198,229,198,
0,0,0,0,230,198,0,0,0,0,0,0,231,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,232,198,233,198,
0,0,234,198,0,0,235,198,0,0,0,0,0,0,0,0,
0,0,0,0,236,198,0,0,0,0,0,0,237,198,0,0,
0,0,0,0,238,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,239,198,240,198,0,0,0,0,241,198,242,198,
0,0,0,0,0,0,0,0,0,0,0,0,243,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,244,198,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,245,198,
0,0,246,198,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,247,198,248,198,0,0,0,0,249,198,0,0,
0,0,0,0,250,198,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,251,198,252,198,0,0,253,198,0,0,254,198,
0,0,0,0,0,0,0,0,0,0,0,0,161,199,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,162,199,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,163,199,0,0,
0,0,0,0,164,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,165,199,0,0,0,0,0,0,166,199,0,0,
0,0,0,0,167,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,168,199,0,0,169,199,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,170,199,171,199,
0,0,0,0,172,199,0,0,0,0,173,199,174,199,0,0,
175,199,0,0,0,0,0,0,0,0,0,0,176,199,177,199,
0,0,178,199,0,0,179,199,0,0,0,0,0,0,0,0,
0,0,0,0,180,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,199,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,182,199,0,0,0,0,0,0,183,199,0,0,
0,0,0,0,184,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,185,199,0,0,0,0,186,199,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,187,199,0,0,
0,0,0,0,188,199,0,0,0,0,0,0,189,199,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,190,199,0,0,
0,0,191,199,0,0,192,199,0,0,0,0,0,0,0,0,
0,0,0,0,193,199,0,0,0,0,0,0,194,199,0,0,
0,0,0,0,195,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,196,199,197,199,0,0,198,199,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,199,199,200,199,0,0,0,0,201,199,0,0,
0,0,0,0,202,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,203,199,204,199,0,0,205,199,0,0,206,199,
0,0,0,0,0,0,0,0,0,0,0,0,207,199,208,199,
0,0,0,0,209,199,0,0,0,0,0,0,210,199,0,0,
0,0,0,0,0,0,211,199,0,0,0,0,212,199,213,199,
0,0,214,199,0,0,215,199,0,0,0,0,0,0,0,0,
0,0,0,0,216,199,217,199,0,0,0,0,218,199,0,0,
0,0,0,0,219,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,220,199,221,199,0,0,222,199,223,199,224,199,
0,0,0,0,0,0,0,0,0,0,0,0,225,199,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,226,199,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,227,199,228,199,
0,0,0,0,229,199,0,0,0,0,0,0,230,199,0,0,
231,199,0,0,0,0,0,0,0,0,0,0,232,199,233,199,
0,0,234,199,0,0,235,199,0,0,0,0,0,0,0,0,
0,0,0,0,236,199,237,199,0,0,0,0,238,199,0,0,
0,0,0,0,239,199,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,240,199,241,199,0,0,242,199,0,0,243,199,
0,0,0,0,0,0,0,0,0,0,0,0,244,199,245,199,
0,0,0,0,246,199,0,0,0,0,0,0,247,199,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,248,199,249,199,
0,0,250,199,251,199,252,199,0,0,0,0,0,0,0,0,
0,0,0,0,253,199,0,0,0,0,0,0,254,199,0,0,
0,0,0,0,161,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,162,200,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,163,200,164,200,
0,0,0,0,165,200,0,0,0,0,0,0,166,200,0,0,
0,0,0,0,0,0,167,200,0,0,0,0,168,200,169,200,
0,0,170,200,0,0,171,200,0,0,0,0,0,0,172,200,
0,0,0,0,173,200,174,200,0,0,0,0,175,200,0,0,
0,0,0,0,176,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,177,200,0,0,178,200,
0,0,0,0,0,0,0,0,0,0,0,0,179,200,180,200,
0,0,0,0,181,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,182,200,0,0,183,200,0,0,0,0,0,0,0,0,
0,0,0,0,184,200,185,200,0,0,0,0,186,200,0,0,
0,0,0,0,187,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,188,200,0,0,189,200,0,0,190,200,
0,0,0,0,0,0,0,0,0,0,0,0,191,200,0,0,
0,0,0,0,192,200,0,0,0,0,0,0,193,200,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,194,200,
0,0,195,200,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,196,200,197,200,0,0,0,0,198,200,0,0,
0,0,0,0,199,200,0,0,0,0,0,0,0,0,200,200,
0,0,0,0,201,200,0,0,0,0,202,200,0,0,203,200,
0,0,0,0,0,0,0,0,0,0,0,0,204,200,0,0,
0,0,0,0,205,200,0,0,0,0,0,0,206,200,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,207,200,0,0,
0,0,0,0,0,0,208,200,0,0,0,0,0,0,0,0,
0,0,0,0,209,200,210,200,0,0,0,0,211,200,0,0,
0,0,0,0,212,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,213,200,
0,0,0,0,0,0,0,0,0,0,0,0,214,200,215,200,
0,0,0,0,216,200,0,0,0,0,0,0,217,200,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,200,219,200,
0,0,220,200,0,0,221,200,0,0,0,0,0,0,0,0,
0,0,0,0,222,200,223,200,0,0,0,0,224,200,0,0,
0,0,0,0,225,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,226,200,0,0,0,0,227,200,0,0,228,200,
0,0,0,0,0,0,0,0,0,0,0,0,229,200,230,200,
0,0,0,0,231,200,0,0,232,200,233,200,234,200,235,200,
0,0,0,0,0,0,0,0,0,0,0,0,236,200,237,200,
0,0,238,200,0,0,239,200,0,0,0,0,0,0,240,200,
0,0,0,0,241,200,0,0,0,0,0,0,242,200,0,0,
0,0,0,0,243,200,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,244,200,245,200,0,0,0,0,0,0,246,200,
0,0,0,0,0,0,0,0,0,0,0,0,247,200,248,200,
0,0,0,0,249,200,0,0,0,0,0,0,250,200,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,251,200,252,200,
0,0,253,200,0,0,254,200,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,208,203,214,203,
231,203,207,205,232,205,173,206,251,207,162,208,184,208,208,208,
221,208,212,209,213,209,216,209,219,209,220,209,221,209,222,209,
223,209,224,209,226,209,227,209,228,209,229,209,230,209,232,209,
233,209,234,209,235,209,237,209,239,209,240,209,242,209,246,209,
250,209,252,209,253,209,254,209,162,210,163,210,167,210,168,210,
169,210,170,210,171,210,173,210,178,210,190,210,194,210,195,210,
196,210,198,210,199,210,200,210,201,210,202,210,203,210,205,210,
206,210,207,210,208,210,209,210,210,210,211,210,212,210,213,210,
214,210,215,210,217,210,218,210,222,210,223,210,225,210,226,210,
228,210,229,210,230,210,231,210,232,210,233,210,234,210,235,210,
240,210,241,210,242,210,243,210,244,210,245,210,247,210,248,210,
230,212,252,212,165,213,171,213,174,213,184,214,205,214,203,215,
228,215,197,219,228,219,165,220,165,221,213,221,244,221,252,222,
254,222,179,223,225,223,232,223,241,224,173,225,237,225,245,227,
161,228,169,228,174,229,177,229,178,229,185,229,187,229,188,229,
196,229,206,229,208,229,210,229,214,229,250,229,251,229,252,229,
254,229,161,230,164,230,167,230,173,230,175,230,176,230,177,230,
179,230,183,230,184,230,188,230,196,230,198,230,199,230,202,230,
210,230,214,230,217,230,220,230,223,230,225,230,228,230,229,230,
230,230,232,230,234,230,235,230,236,230,239,230,241,230,242,230,
245,230,246,230,247,230,249,230,161,231,166,231,169,231,170,231,
172,231,173,231,176,231,191,231,193,231,198,231,199,231,203,231,
205,231,207,231,208,231,211,231,223,231,228,231,230,231,247,231,
231,232,232,232,240,232,241,232,247,232,249,232,251,232,254,232,
167,233,172,233,204,233,247,233,193,234,229,234,244,234,247,234,
252,234,254,234,164,235,167,235,169,235,170,235,186,235,187,235,
189,235,193,235,194,235,198,235,199,235,204,235,207,235,208,235,
209,235,210,235,216,235,166,236,167,236,170,236,175,236,176,236,
177,236,178,236,181,236,184,236,186,236,192,236,193,236,197,236,
198,236,201,236,202,236,213,236,221,236,222,236,225,236,228,236,
231,236,232,236,247,236,248,236,250,236,161,237,162,237,163,237,
238,237,219,238,189,242,250,242,177,243,167,244,238,244,244,246,
246,246,184,247,200,247,211,247,219,248,240,248,161,250,162,250,
230,250,169,252,0,0,0,0,0,0,0,0,0,0,0,0,
254,161,0,0,0,0,0,0,220,163,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,64,0,128,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,0,
208,0,0,0,16,1,64,1,128,1,0,0,160,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,
16,2,80,2,0,0,0,0,128,2,192,2,0,3,32,3,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,80,3,144,3,208,3,0,0,16,4,48,4,
0,0,0,0,0,0,0,0,112,4,176,4,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,4,
16,5,0,0,80,5,144,5,208,5,16,6,80,6,0,0,
0,0,144,6,0,0,208,6,0,0,0,7,0,0,48,7,
80,7,128,7,0,0,192,7,0,8,0,0,32,8,0,0,
0,0,0,0,96,8,160,8,224,8,0,0,0,0,16,9,
48,9,112,9,0,0,144,9,0,0,208,9,16,10,80,10,
0,0,144,10,0,0,176,10,0,0,240,10,48,11,0,0,
80,11,144,11,208,11,224,11,32,12,96,12,144,12,192,12,
240,12,48,13,112,13,0,0,144,13,0,0,208,13,16,14,
0,0,0,0,0,0,80,14,0,0,0,0,0,0,0,0,
144,14,0,0,208,14,16,15,80,15,0,0,144,15,0,0,
0,0,0,0,208,15,16,16,0,0,80,16,144,16,192,16,
0,0,0,17,64,17,128,17,192,17,224,17,32,18,96,18,
160,18,224,18,0,0,32,19,96,19,160,19,224,19,16,20,
64,20,128,20,176,20,224,20,16,21,64,21,112,21,160,21,
224,21,240,21,48,22,64,22,128,22,0,0,0,0,176,22,
240,22,48,23,96,23,128,23,192,23,0,24,64,24,128,24,
192,24,0,25,0,0,48,25,112,25,176,25,240,25,48,26,
96,26,0,0,160,26,224,26,32,27,96,27,160,27,0,0,
0,0,224,27,0,0,0,0,32,28,96,28,160,28,224,28,
32,29,96,29,160,29,224,29,0,0,0,0,0,0,32,30,
0,0,0,0,0,0,96,30,0,0,0,0,0,0,160,30,
176,30,240,30,48,31,0,0,96,31,160,31,224,31,0,0,
0,0,32,32,64,32,112,32,0,0,176,32,224,32,0,0,
0,0,0,0,32,33,64,33,128,33,176,33,224,33,16,34,
64,34,0,0,0,0,0,0,0,0,0,0,128,34,0,0,
0,0,0,0,176,34,0,0,0,0,0,0,0,0,240,34,
32,35,96,35,0,0,0,0,0,0,160,35,224,35,0,0,
0,0,32,36,80,36,144,36,0,0,208,36,0,0,0,37,
0,0,0,0,0,0,0,0,0,0,32,37,80,37,0,0,
0,0,112,37,176,37,0,0,0,0,0,0,0,0,208,37,
16,38,80,38,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,144,38,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,208,38,0,39,48,39,80,39,128,39,192,39,240,39,
0,0,32,40,80,40,0,0,128,40,192,40,240,40,48,41,
96,41,160,41,224,41,32,42,64,42,112,42,176,42,0,0,
0,0,0,0,0,0,0,0,224,42,0,0,0,0,0,0,
0,0,0,0,0,0,32,43,0,0,0,0,96,43,160,43,
0,0,224,43,0,0,32,44,80,44,144,44,208,44,0,0,
0,0,16,45,0,0,0,0,0,0,0,0,0,0,80,45,
0,0,0,0,0,0,0,0,0,0,128,45,0,0,0,0,
160,45,224,45,0,0,0,0,16,46,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,80,46,144,46,
208,46,16,47,80,47,144,47,208,47,16,48,80,48,144,48,
208,48,16,49,80,49,144,49,208,49,16,50,80,50,144,50,
208,50,16,51,80,51,144,51,208,51,16,52,80,52,144,52,
208,52,16,53,80,53,128,53,192,53,0,54,64,54,128,54,
192,54,0,55,64,55,128,55,176,55,240,55,32,56,96,56,
144,56,208,56,16,57,80,57,144,57,208,57,16,58,80,58,
144,58,208,58,16,59,80,59,144,59,208,59,16,60,80,60,
144,60,208,60,16,61,80,61,144,61,208,61,16,62,80,62,
144,62,208,62,16,63,80,63,144,63,208,63,16,64,80,64,
144,64,192,64,0,65,64,65,112,65,176,65,224,65,32,66,
80,66,144,66,208,66,16,67,80,67,144,67,208,67,16,68,
80,68,144,68,208,68,16,69,80,69,144,69,208,69,16,70,
80,70,144,70,208,70,16,71,80,71,144,71,208,71,16,72,
80,72,144,72,208,72,16,73,80,73,144,73,208,73,16,74,
80,74,144,74,208,74,16,75,80,75,144,75,208,75,16,76,
80,76,144,76,208,76,16,77,80,77,144,77,208,77,16,78,
80,78,144,78,208,78,16,79,80,79,144,79,208,79,16,80,
80,80,144,80,208,80,16,81,80,81,144,81,208,81,16,82,
80,82,144,82,208,82,16,83,80,83,144,83,208,83,16,84,
80,84,144,84,208,84,16,85,80,85,144,85,208,85,16,86,
80,86,144,86,208,86,16,87,80,87,144,87,208,87,16,88,
80,88,144,88,208,88,16,89,80,89,0,0,32,0,0,0,
128,0,0,0,2,0,0,0,136,0,0,0,0,0,0,0,
136,0,0,0,140,0,0,0,2,0,0,0,148,0,0,0,
0,0,0,0,148,0,0,0,10,0,0,0,171,0,0,0,
234,1,0,0,37,0,0,0,52,2,0,0,3,0,0,0,
2,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,64,2,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
71,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,
10,0,107,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,128,193,162,0,2,170,170,170,170
}
};
U_CDECL_END
|
the_stack_data/32115.c
|
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Test");
system("LVS_Webtools.exe");
return 0;
}
|
the_stack_data/192330584.c
|
#include <stdio.h>
int main() {
int x = 0;
int y = 0;
int z = 0;
if (y == x) {
x = -5;
}
else {
x = 6;
}
y = 7;
z = x;
y = 8;
return 0; /*x and z out of scope*/
}
|
the_stack_data/494733.c
|
// Test to ensure -fdebug-pass-manager works when invoking the
// ThinLTO backend path with the new PM.
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -o %t.o -flto=thin -fexperimental-new-pass-manager -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s
// RUN: llvm-lto -thinlto -o %t %t.o
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s
// CHECK: Running pass:
void foo() {
}
|
the_stack_data/1183575.c
|
// This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
// unused inside expression list, tests scoping
int main() {
int a = 5;
(
4,
({int a = 42;})
);
if(a != 5) {
ERROR: // unreachable
return 1;
}
return 0;
}
|
the_stack_data/15653.c
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
static int recursive(int** triangle, int row_size, int *col_sizes,
int row, int col, int **sums, bool **passes)
{
if (row == row_size - 1) {
return triangle[row][col];
} else if (passes[row][col]) {
return sums[row][col];
} else {
int s1 = recursive(triangle, row_size, col_sizes, row + 1, col, sums, passes);
int s2 = recursive(triangle, row_size, col_sizes, row + 1, col + 1, sums, passes);
sums[row][col] = triangle[row][col] + (s1 < s2 ? s1 : s2);
passes[row][col] = true;
return sums[row][col];
}
}
static int minimumTotal(int** triangle, int triangleRowSize, int *triangleColSizes)
{
int i;
bool **passes = malloc(triangleRowSize * sizeof(bool *));
for (i = 0; i < triangleRowSize; i++) {
passes[i] = malloc(triangleColSizes[i]);
memset(passes[i], false, triangleColSizes[i]);
}
int **sums = malloc(triangleRowSize * sizeof(int *));
for (i = 0; i < triangleRowSize; i++) {
sums[i] = malloc(triangleColSizes[i] * sizeof(int));
}
return recursive(triangle, triangleRowSize, triangleColSizes, 0, 0, sums, passes);
}
int main(void)
{
int i, row = 4;
int **nums = malloc(row * sizeof(int *));
int *sizes = malloc(row * sizeof(int));
for (i = 0; i < row; i++) {
sizes[i] = i + 1;
nums[i] = malloc(sizes[i] * sizeof(int));
}
#if 0
nums[0][0] = -1;
nums[1][0] = 3;
nums[1][1] = 2;
nums[2][0] = -3;
nums[2][1] = 1;
nums[2][2] = -1;
#else
nums[0][0] = 2;
nums[1][0] = 3;
nums[1][1] = 4;
nums[2][0] = 6;
nums[2][1] = 5;
nums[2][2] = 7;
nums[3][0] = 4;
nums[3][1] = 1;
nums[3][2] = 8;
nums[3][3] = 3;
#endif
printf("%d\n", minimumTotal(nums, row, sizes));
return 0;
}
|
the_stack_data/75137114.c
|
static void
foo ()
{
long maplength;
int type;
{
const long nibbles = 8;
char buf1[nibbles + 1];
char buf2[nibbles + 1];
char buf3[nibbles + 1];
buf1[nibbles] = '\0';
buf2[nibbles] = '\0';
buf3[nibbles] = '\0';
((nibbles) <= 16
? (({
void *__s = (buf1);
union
{
unsigned int __ui;
unsigned short int __usi;
unsigned char __uc;
}
*__u = __s;
unsigned char __c = (unsigned char)('0');
switch ((unsigned int) (nibbles))
{
case 16:
__u->__ui = __c * 0x01010101;
__u = __extension__ ((void *) __u + 4);
case 12:
__u->__ui = __c * 0x01010101;
__u = __extension__ ((void *) __u + 4);
case 0:
break;
}
__s;
}))
: 0);
((nibbles) <= 16
? (({
void *__s = (buf2);
union
{
unsigned int __ui;
unsigned short int __usi;
unsigned char __uc;
}
*__u = __s;
unsigned char __c = (unsigned char)('0');
switch ((unsigned int) (nibbles))
{
case 16:
__u->__ui = __c * 0x01010101;
__u = __extension__ ((void *) __u + 4);
case 12:
__u->__ui = __c * 0x01010101;
__u = __extension__ ((void *) __u + 4);
case 8:
__u->__ui = __c * 0x01010101;
__u = __extension__ ((void *) __u + 4);
case 4:
__u->__ui = __c * 0x01010101;
case 0:
break;
}
__s;
}))
: 0);
}
}
|
the_stack_data/73575740.c
|
/*
* Copyright (c) 2008, The Android Open Source Project
* 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 Google, Inc. 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 OWNER 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.
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#define PROC_NET_DEV "/proc/net/dev"
#define MAX_IF 8 /* max interfaces we can handle */
#ifndef PAGE_SIZE
# define PAGE_SIZE 4096
#endif
#define _STR(s) #s
#define STR(s) _STR(s)
struct if_stats {
char name[IFNAMSIZ];
unsigned int mtu;
unsigned int rx_bytes;
unsigned int rx_packets;
unsigned int rx_errors;
unsigned int rx_dropped;
unsigned int tx_bytes;
unsigned int tx_packets;
unsigned int tx_errors;
unsigned int tx_dropped;
};
static int get_mtu(const char *if_name)
{
struct ifreq ifr;
int s, ret;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
perror("socket");
exit(EXIT_FAILURE);
}
memset(&ifr, 0, sizeof(struct ifreq));
ifr.ifr_addr.sa_family = AF_INET;
strcpy(ifr.ifr_name, if_name);
ret = ioctl(s, SIOCGIFMTU, &ifr);
if (ret < 0) {
perror("ioctl");
exit(EXIT_FAILURE);
}
ret = close(s);
if (ret < 0) {
perror("close");
exit(EXIT_FAILURE);
}
return ifr.ifr_mtu;
}
static int get_interfaces(struct if_stats *ifs)
{
char buf[PAGE_SIZE];
char *p;
int ret, nr, fd;
fd = open(PROC_NET_DEV, O_RDONLY);
if (fd < 0) {
perror("open");
exit(EXIT_FAILURE);
}
ret = read(fd, buf, sizeof(buf) - 1);
if (ret < 0) {
perror("read");
exit(EXIT_FAILURE);
} else if (!ret) {
fprintf(stderr, "reading " PROC_NET_DEV " returned premature EOF\n");
exit(EXIT_FAILURE);
}
buf[ret] = '\0';
/* skip down to the third line */
p = strchr(buf, '\n');
if (!p) {
fprintf(stderr, "parsing " PROC_NET_DEV " failed unexpectedly\n");
exit(EXIT_FAILURE);
}
p = strchr(p + 1, '\n');
if (!p) {
fprintf(stderr, "parsing " PROC_NET_DEV " failed unexpectedly\n");
exit(EXIT_FAILURE);
}
p += 1;
/*
* Key:
* if: (Rx) bytes packets errs drop fifo frame compressed multicast \
* (Tx) bytes packets errs drop fifo colls carrier compressed
*/
for (nr = 0; nr < MAX_IF; nr++) {
char *c;
ret = sscanf(p, "%" STR(IFNAMSIZ) "s", ifs->name);
if (ret != 1) {
fprintf(stderr, "parsing " PROC_NET_DEV " failed unexpectedly\n");
exit(EXIT_FAILURE);
}
/*
* This works around a bug in the proc file where large interface names
* or Rx byte counts eat the delimiter, breaking sscanf.
*/
c = strchr(ifs->name, ':');
if (c)
*c = '\0';
p = strchr(p, ':') + 1;
ret = sscanf(p, "%u %u %u %u %*u %*u %*u %*u %u %u %u %u %*u %*u "
"%*u %*u\n", &ifs->rx_bytes, &ifs->rx_packets,
&ifs->rx_errors, &ifs->rx_dropped, &ifs->tx_bytes,
&ifs->tx_packets, &ifs->tx_errors, &ifs->tx_dropped);
if (ret != 8) {
fprintf(stderr, "parsing " PROC_NET_DEV " failed unexpectedly\n");
exit(EXIT_FAILURE);
}
ifs->mtu = get_mtu(ifs->name);
p = strchr(p, '\n') + 1;
if (*p == '\0') {
nr++;
break;
}
ifs++;
}
ret = close(fd);
if (ret) {
perror("close");
exit(EXIT_FAILURE);
}
return nr;
}
static void print_header(void)
{
printf(" Rx Tx\n");
printf("%-8s %-5s %-10s %-8s %-5s %-5s %-10s %-8s %-5s %-5s\n",
"name", "MTU", "bytes", "packets", "errs", "drpd", "bytes",
"packets", "errs", "drpd");
}
static int print_interfaces(struct if_stats *old, struct if_stats *new, int nr)
{
int i = 0;
while (nr--) {
if (old->rx_packets || old->tx_packets) {
printf("%-8s %-5u %-10u %-8u %-5u %-5u %-10u %-8u %-5u %-5u\n",
new->name, new->mtu,
new->rx_bytes - old->rx_bytes,
new->rx_packets - old->rx_packets,
new->rx_errors - old->rx_errors,
new->rx_dropped - old->rx_dropped,
new->tx_bytes - old->tx_bytes,
new->tx_packets - old->tx_packets,
new->tx_errors - old->tx_errors,
new->tx_dropped - old->tx_dropped);
i++;
}
old++;
new++;
}
return i;
}
static void usage(const char *cmd)
{
fprintf(stderr, "usage: %s [ -r repeats] [ -d delay ]\n", cmd);
}
int iftop_main(int argc, char *argv[])
{
struct if_stats ifs[2][MAX_IF];
int count = 0, header_interval = 22, delay = 1, i;
unsigned int toggle = 0;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-d")) {
if (i >= argc - 1) {
fprintf(stderr, "Option -d requires an argument.\n");
exit(EXIT_FAILURE);
}
delay = atoi(argv[i++]);
if (!delay)
delay = 1;
continue;
}
if (!strcmp(argv[i], "-r")) {
if (i >= argc - 1) {
fprintf(stderr, "Option -r requires an argument.\n");
exit(EXIT_FAILURE);
}
header_interval = atoi(argv[i++]);
if (header_interval < MAX_IF)
header_interval = MAX_IF;
continue;
}
if (!strcmp(argv[i], "-h")) {
usage(argv[0]);
exit(EXIT_SUCCESS);
}
usage(argv[0]);
exit(EXIT_FAILURE);
}
get_interfaces(ifs[!toggle]);
if (header_interval)
print_header();
while (1) {
int nr;
sleep(delay);
nr = get_interfaces(ifs[toggle]);
if (header_interval && count + nr > header_interval) {
print_header();
count = 0;
}
count += print_interfaces(ifs[!toggle], ifs[toggle], nr);
toggle = !toggle;
}
return 0;
}
|
the_stack_data/124660.c
|
#include <sys/resource.h>
#include <stdio.h>
#include <stdlib.h>
#include <spawn.h>
#include <sys/wait.h>
#include <string.h>
#include <errno.h>
#ifdef __linux__
#define REPORT \
"User time : %ld s, %ld us\n" \
"System time : %ld s, %ld us\n" \
"Time : %lld ms (%.3f ms/per)\n" \
"Max RSS : %ld kB\n" \
"Page reclaims : %ld\n" \
"Page faults : %ld\n" \
"Block inputs : %ld\n" \
"Block outputs : %ld\n" \
"vol ctx switches : %ld\n" \
"invol ctx switches : %ld\n"
#define VALS \
usage.ru_maxrss, \
usage.ru_minflt, \
usage.ru_majflt, \
usage.ru_inblock, \
usage.ru_oublock, \
usage.ru_nvcsw, \
usage.ru_nivcsw
#else
#define REPORT \
"User time : %ld s, %ld us\n" \
"System time : %ld s, %ld us\n" \
"Time : %lld ms (%.3f ms/per)\n" \
"Max RSS : %ld kB\n" \
"Shared RSS : %ld kB\n" \
"Unshared Data : %ld\n" \
"Unshared Stack : %ld\n" \
"Page reclaims : %ld\n" \
"Page faults : %ld\n" \
"Swaps : %ld\n" \
"Block inputs : %ld\n" \
"Block outputs : %ld\n" \
"Sigs received : %ld\n" \
"vol ctx switches : %ld\n" \
"invol ctx switches : %ld\n"
#define VALS \
usage.ru_maxrss, \
usage.ru_ixrss, \
usage.ru_idrss, \
usage.ru_isrss, \
usage.ru_minflt, \
usage.ru_majflt, \
usage.ru_nswap, \
usage.ru_inblock, \
usage.ru_oublock, \
usage.ru_nsignals, \
usage.ru_nvcsw, \
usage.ru_nivcsw
#endif
int main (int argc, char **argv, char **environ) {
struct rusage usage;
int i, count;
pid_t child;
if (argc > 2) {
count = atoi(argv[1]);
for (i = 0; i < count; i++) {
if (0 != posix_spawn(&child, argv[2], NULL, NULL, &argv[2], environ)) {
fprintf(stderr, "posix_spawn failed: %s", strerror(errno));
return 1;
}
waitpid(child, NULL, 0);
}
getrusage(RUSAGE_CHILDREN, &usage);
fprintf(stderr, REPORT,
(long int)usage.ru_utime.tv_sec,
(long int)usage.ru_utime.tv_usec,
(long int)usage.ru_stime.tv_sec,
(long int)usage.ru_stime.tv_usec,
(((usage.ru_utime.tv_usec + usage.ru_stime.tv_usec)/1000) + ((usage.ru_utime.tv_sec + usage.ru_stime.tv_sec)*1000)),
(((usage.ru_utime.tv_usec + usage.ru_stime.tv_usec)/1000.0) + ((usage.ru_utime.tv_sec + usage.ru_stime.tv_sec)*1000.0))/count,
VALS
);
} else {
fprintf(stderr, "usage: %s <n> <command> [<args> ...]\n", argv[0]);
return 1;
}
return 0;
}
|
the_stack_data/107953862.c
|
/* Используя возможности OpenMP, написать программу умножения матрицы на вектор.
Сравнить время выполнения последовательной и параллельных программ. */
#include <stdio.h>
#include <omp.h>
#include <time.h>
#define N 100
#define M 112
int main(int argc, char *argv[])
{
// Инициализация
static long matrix[N][M];
static long vector[M];
// Вектору присваиваиваем значения vector[i] = i*2, i=(1,M)
for (int i = 0; i < M; i++)
{
vector[i] = i;
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
matrix[i][j] = i + 1;
}
}
long result_vector[N];
// Последовательная секция
double start_time = omp_get_wtime();
for (int i = 0; i < N; i++)
{
result_vector[i] = 0;
for (int j = 0; j < M; j++)
{
result_vector[i] += matrix[i][j] * vector[j];
}
}
double end_time = omp_get_wtime();
double result_time = (end_time - start_time);
printf("Время последовательного блока: %f\n", result_time);
// print_result(result_vector, N);
double result_time_parallel;
double start_time_parallel;
double end_time_parallel;
// Параллельная секция
#pragma omp parallel num_threads(4)
{
start_time_parallel = omp_get_wtime();
#pragma omp for
for (int i = 0; i < N; i++)
{
result_vector[i] = 0;
for (int j = 0; j < M; j++)
{
result_vector[i] += matrix[i][j] * vector[j];
}
}
end_time_parallel = omp_get_wtime();
}
result_time_parallel = (end_time_parallel - start_time_parallel);
printf("Время параллельного блока: %f\n", result_time_parallel);
// print_result(result_vector, N);
}
void print_result(long array[], long n)
{
for (int i = 0; i < n; i++)
{
printf("%ld\n", array[i]);
}
}
|
the_stack_data/162642660.c
|
/*
* Copyright (c) 1998 Todd C. Miller <[email protected]>
* 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.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#ifndef lint
static const char rcsid[] =
"$FreeBSD: src/lib/libc/string/strlcat.c,v 1.2.4.2 2001/07/09 23:30:06 obrien Exp $";
#endif
#define _MINIX_SOURCE
#include <sys/types.h>
#include <string.h>
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(initial dst) + strlen(src); if retval >= siz,
* truncation occurred.
*/
size_t strlcat(dst, src, siz)
char *dst;
const char *src;
size_t siz;
{
register char *d = dst;
register const char *s = src;
register size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0') {
if (n != 1) {
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}
/*
* $PchId: strlcat.c,v 1.1 2004/11/02 12:29:23 philip Exp philip $
*/
|
the_stack_data/103126.c
|
/*
1374. Generate a String With Characters That Have Odd Counts
1374_generate_string_with_odd_counts.c
Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times.
The returned string must contain only lowercase English letters. If there are multiples valid strings, return any of them.
Example 1:
Input: n = 4
Output: "pppz"
Explanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".
Example 2:
Input: n = 2
Output: "xy"
Explanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".
Example 3:
Input: n = 7
Output: "holasss"
Constraints:
1 <= n <= 500
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
Version 1
*/
#define MAX_STR_LEN 501
char * generateTheString(int n){
char *out;
out = calloc(MAX_STR_LEN, sizeof(char));
if (!out) {
printf("out is null. calloc() failed!\n");
exit(1);
}
char *o = out;
for (int i = 0; i < n; i++)
*o++ = 'p';
if (n % 2 == 0)
*out = 'z';
return out;
}
/*
Example 1:
Input: n = 4
Output: "pppz"
Explanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".
Example 2:
Input: n = 2
Output: "xy"
Explanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".
Example 3:
Input: n = 7
Output: "holasss"
*/
int main() {
char *out;
int n1 = 4;
int n2 = 2;
int n3 = 7;
out = generateTheString(n1);
printf("ans = %s\n", out);
free(out);
out = generateTheString(n2);
printf("ans = %s\n", out);
free(out);
out = generateTheString(n3);
printf("ans = %s\n", out);
free(out);
return 0;
}
|
the_stack_data/231394336.c
|
/*5) Escriba y ejecute un programa que mantenga información de números complejos (usando el tipo de datos
definido en el trabajo práctico 0). Se desea tener 2 matrices de complejos (de 10 filas por 10 columnas) y realizar
la suma y resta de dichas matrices. Implemente con funciones.*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 10
typedef struct {
int real, imag;
} tsComplex[N][N];
//Podria mejorarse para que imprima 0 cuando la parte real e imaginaria son 0, o solo la parte real si la imaginaria es 0,
//Pero no es el objetivo del trabajo.
void PrintNum(tsComplex number) {
int i, j, aux;
for(i = 0; i < N; i++) {
for(j = 0; j < N; j++) {
if(number[i][j].imag < 0 ) {
aux = number[i][j].imag*(-1);
printf("%2d-%di ", number[i][j].real, aux);
}
else {
printf("%2d+%di ", number[i][j].real, number[i][j].imag);
}
}
printf("\n");
}
printf("\n");
}
//Asigna valores desde -4 a 4 (para que haya diversidad de signos cuando se opere).
void InitNum(tsComplex num) {
int i, j;
for(i = 0; i < N; i++) {
for(j = 0; j < N; j++) {
num[i][j].real = rand()%8-4;
num[i][j].imag = rand()%8-4;
}
}
}
void Add(tsComplex result, tsComplex number1, tsComplex number2) {
int i, j;
for(i = 0; i < N; i++) {
for(j = 0; j < N; j++) {
result[i][j].real = number1[i][j].real + number2[i][j].real;
result[i][j].imag = number1[i][j].imag + number2[i][j].imag;
}
}
}
void Sub(tsComplex result, tsComplex number1, tsComplex number2) {
int i, j;
for(i = 0; i < N; i++) {
for(j = 0; j < N; j++) {
result[i][j].real = number1[i][j].real - number2[i][j].real;
result[i][j].imag = number1[i][j].imag - number2[i][j].imag;
}
}
}
int main(int argc, char** argv) {
srand(time(NULL));
tsComplex num1, num2, result;
char operator;
InitNum(num1); InitNum(num2);
PrintNum(num1); PrintNum(num2);
puts("Que operacion desea realizar? (+, -)");
scanf(" %c", &operator);
if (operator != '+' && operator != '-' ) { //Por alguna razon el compilador se queja al usar OR.
printf("Error: Operacion Invalida.");
return -1;
}
switch(operator) {
case '+': Add(result, num1, num2); break;
case '-': Sub(result, num1, num2); break;
}
PrintNum(result);
return 0;
}
|
the_stack_data/232955206.c
|
int test() {
return 11;
}
#pragma weak __test = test
int __test (); // __attribute__((weak, alias("test")));
|
the_stack_data/92326602.c
|
/* { dg-do compile } */
/* { dg-options "-march=octeon2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(N, R, T) \
T fll##N (T j, signed R *b, long long i) { return j + b[i]; } \
T gll##N (T j, unsigned R *b, long long i) { return j + b[i]; } \
T fi##N (T j, signed R *b, int i) { return j + b[i]; } \
T gi##N (T j, unsigned R *b, int i) { return j + b[i]; } \
TEST (1, char, int)
TEST (2, char, long long)
/* { dg-final { scan-assembler-times "\tlbx\t" 4 } } */
/* { dg-final { scan-assembler-times "\tlbux\t" 4 } } */
TEST (3, short, int)
TEST (4, short, long long)
/* { dg-final { scan-assembler-times "\tlhx\t" 4 } } */
/* { dg-final { scan-assembler-times "\tlhux\t" 4 } } */
TEST (5, int, long long)
/* { dg-final { scan-assembler-times "\tlwx\t" 2 } } */
/* { dg-final { scan-assembler-times "\tlwux\t" 2 } } */
|
the_stack_data/37638088.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jwinthei <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/23 12:04:02 by jwinthei #+# #+# */
/* Updated: 2018/11/21 17:19:23 by jwinthei ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
char *ft_strcat(char *dst, const char *src)
{
size_t i;
size_t j;
i = 0;
j = 0;
while (dst[j])
j++;
while (src[i])
dst[j++] = src[i++];
dst[j] = '\0';
return (dst);
}
|
the_stack_data/44993.c
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define CALLS 10
int main(void) {
int a = __VERIFIER_nondet_uint() % 100000000,
b = __VERIFIER_nondet_uint() % 100000000;
float prob = __VERIFIER_nondet_float();
int c = 0;
while (a <= b) {
for (int i = 0; i < CALLS; i++) {
unsigned char flip =
((float)(nondet_double() / (RAND_MAX))) >= prob ? 1 : 0;
c += (flip == 1) ? 1 : 0;
a = a + c;
b = b - c;
}
}
assert(a < b);
}
|
the_stack_data/544782.c
|
#include <stdio.h>
int main(void) {
for (int i = 0; i < 10000; i++) {
printf("%d ", i);
}
}
|
the_stack_data/122016819.c
|
/* ====================================================================
* Copyright (c) 2011 The OpenSSL Project. 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.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT 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.
* ====================================================================
*/
#include <openssl/opensslconf.h>
#include <stdio.h>
#include <string.h>
#if !defined(OPENSSL_NO_AES) && !defined(OPENSSL_NO_SHA1)
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/aes.h>
#include <openssl/sha.h>
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
#define EVP_CTRL_AEAD_TLS1_AAD 0x16
#define EVP_CTRL_AEAD_SET_MAC_KEY 0x17
#endif
#if !defined(EVP_CIPH_FLAG_DEFAULT_ASN1)
#define EVP_CIPH_FLAG_DEFAULT_ASN1 0
#endif
#define TLS1_1_VERSION 0x0302
typedef struct
{
AES_KEY ks;
SHA_CTX head,tail,md;
size_t payload_length; /* AAD length in decrypt case */
union {
unsigned int tls_ver;
unsigned char tls_aad[16]; /* 13 used */
} aux;
} EVP_AES_HMAC_SHA1;
#define NO_PAYLOAD_LENGTH ((size_t)-1)
#if defined(AES_ASM) && ( \
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_AMD64) || defined(_M_X64) || \
defined(__INTEL__) )
extern unsigned int OPENSSL_ia32cap_P[2];
#define AESNI_CAPABLE (1<<(57-32))
int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
AES_KEY *key);
int aesni_set_decrypt_key(const unsigned char *userKey, int bits,
AES_KEY *key);
void aesni_cbc_encrypt(const unsigned char *in,
unsigned char *out,
size_t length,
const AES_KEY *key,
unsigned char *ivec, int enc);
void aesni_cbc_sha1_enc (const void *inp, void *out, size_t blocks,
const AES_KEY *key, unsigned char iv[16],
SHA_CTX *ctx,const void *in0);
#define data(ctx) ((EVP_AES_HMAC_SHA1 *)(ctx)->cipher_data)
static int aesni_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
const unsigned char *inkey,
const unsigned char *iv, int enc)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
int ret;
if (enc)
ret=aesni_set_encrypt_key(inkey,ctx->key_len*8,&key->ks);
else
ret=aesni_set_decrypt_key(inkey,ctx->key_len*8,&key->ks);
SHA1_Init(&key->head); /* handy when benchmarking */
key->tail = key->head;
key->md = key->head;
key->payload_length = NO_PAYLOAD_LENGTH;
return ret<0?0:1;
}
#define STITCHED_CALL
#if !defined(STITCHED_CALL)
#define aes_off 0
#endif
void sha1_block_data_order (void *c,const void *p,size_t len);
static void sha1_update(SHA_CTX *c,const void *data,size_t len)
{ const unsigned char *ptr = data;
size_t res;
if ((res = c->num)) {
res = SHA_CBLOCK-res;
if (len<res) res=len;
SHA1_Update (c,ptr,res);
ptr += res;
len -= res;
}
res = len % SHA_CBLOCK;
len -= res;
if (len) {
sha1_block_data_order(c,ptr,len/SHA_CBLOCK);
ptr += len;
c->Nh += len>>29;
c->Nl += len<<=3;
if (c->Nl<(unsigned int)len) c->Nh++;
}
if (res)
SHA1_Update(c,ptr,res);
}
#define SHA1_Update sha1_update
static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t len)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
unsigned int l;
size_t plen = key->payload_length,
iv = 0, /* explicit IV in TLS 1.1 and later */
sha_off = 0;
#if defined(STITCHED_CALL)
size_t aes_off = 0,
blocks;
sha_off = SHA_CBLOCK-key->md.num;
#endif
if (len%AES_BLOCK_SIZE) return 0;
if (ctx->encrypt) {
if (plen==NO_PAYLOAD_LENGTH)
plen = len;
else if (len!=((plen+SHA_DIGEST_LENGTH+AES_BLOCK_SIZE)&-AES_BLOCK_SIZE))
return 0;
else if (key->aux.tls_ver >= TLS1_1_VERSION)
iv = AES_BLOCK_SIZE;
#if defined(STITCHED_CALL)
if (plen>(sha_off+iv) && (blocks=(plen-(sha_off+iv))/SHA_CBLOCK)) {
SHA1_Update(&key->md,in+iv,sha_off);
aesni_cbc_sha1_enc(in,out,blocks,&key->ks,
ctx->iv,&key->md,in+iv+sha_off);
blocks *= SHA_CBLOCK;
aes_off += blocks;
sha_off += blocks;
key->md.Nh += blocks>>29;
key->md.Nl += blocks<<=3;
if (key->md.Nl<(unsigned int)blocks) key->md.Nh++;
} else {
sha_off = 0;
}
#endif
sha_off += iv;
SHA1_Update(&key->md,in+sha_off,plen-sha_off);
if (plen!=len) { /* "TLS" mode of operation */
if (in!=out)
memcpy(out+aes_off,in+aes_off,plen-aes_off);
/* calculate HMAC and append it to payload */
SHA1_Final(out+plen,&key->md);
key->md = key->tail;
SHA1_Update(&key->md,out+plen,SHA_DIGEST_LENGTH);
SHA1_Final(out+plen,&key->md);
/* pad the payload|hmac */
plen += SHA_DIGEST_LENGTH;
for (l=len-plen-1;plen<len;plen++) out[plen]=l;
/* encrypt HMAC|padding at once */
aesni_cbc_encrypt(out+aes_off,out+aes_off,len-aes_off,
&key->ks,ctx->iv,1);
} else {
aesni_cbc_encrypt(in+aes_off,out+aes_off,len-aes_off,
&key->ks,ctx->iv,1);
}
} else {
unsigned char mac[SHA_DIGEST_LENGTH];
/* decrypt HMAC|padding at once */
aesni_cbc_encrypt(in,out,len,
&key->ks,ctx->iv,0);
if (plen) { /* "TLS" mode of operation */
/* figure out payload length */
if (len<(size_t)(out[len-1]+1+SHA_DIGEST_LENGTH))
return 0;
len -= (out[len-1]+1+SHA_DIGEST_LENGTH);
if ((key->aux.tls_aad[plen-4]<<8|key->aux.tls_aad[plen-3])
>= TLS1_1_VERSION) {
len -= AES_BLOCK_SIZE;
iv = AES_BLOCK_SIZE;
}
key->aux.tls_aad[plen-2] = len>>8;
key->aux.tls_aad[plen-1] = len;
/* calculate HMAC and verify it */
key->md = key->head;
SHA1_Update(&key->md,key->aux.tls_aad,plen);
SHA1_Update(&key->md,out+iv,len);
SHA1_Final(mac,&key->md);
key->md = key->tail;
SHA1_Update(&key->md,mac,SHA_DIGEST_LENGTH);
SHA1_Final(mac,&key->md);
if (memcmp(out+iv+len,mac,SHA_DIGEST_LENGTH))
return 0;
} else {
SHA1_Update(&key->md,out,len);
}
}
key->payload_length = NO_PAYLOAD_LENGTH;
return 1;
}
static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
switch (type)
{
case EVP_CTRL_AEAD_SET_MAC_KEY:
{
unsigned int i;
unsigned char hmac_key[64];
memset (hmac_key,0,sizeof(hmac_key));
if (arg > (int)sizeof(hmac_key)) {
SHA1_Init(&key->head);
SHA1_Update(&key->head,ptr,arg);
SHA1_Final(hmac_key,&key->head);
} else {
memcpy(hmac_key,ptr,arg);
}
for (i=0;i<sizeof(hmac_key);i++)
hmac_key[i] ^= 0x36; /* ipad */
SHA1_Init(&key->head);
SHA1_Update(&key->head,hmac_key,sizeof(hmac_key));
for (i=0;i<sizeof(hmac_key);i++)
hmac_key[i] ^= 0x36^0x5c; /* opad */
SHA1_Init(&key->tail);
SHA1_Update(&key->tail,hmac_key,sizeof(hmac_key));
return 1;
}
case EVP_CTRL_AEAD_TLS1_AAD:
{
unsigned char *p=ptr;
unsigned int len=p[arg-2]<<8|p[arg-1];
if (ctx->encrypt)
{
key->payload_length = len;
if ((key->aux.tls_ver=p[arg-4]<<8|p[arg-3]) >= TLS1_1_VERSION) {
len -= AES_BLOCK_SIZE;
p[arg-2] = len>>8;
p[arg-1] = len;
}
key->md = key->head;
SHA1_Update(&key->md,p,arg);
return (int)(((len+SHA_DIGEST_LENGTH+AES_BLOCK_SIZE)&-AES_BLOCK_SIZE)
- len);
}
else
{
if (arg>13) arg = 13;
memcpy(key->aux.tls_aad,ptr,arg);
key->payload_length = arg;
return SHA_DIGEST_LENGTH;
}
}
default:
return -1;
}
}
static EVP_CIPHER aesni_128_cbc_hmac_sha1_cipher =
{
#ifdef NID_aes_128_cbc_hmac_sha1
NID_aes_128_cbc_hmac_sha1,
#else
NID_undef,
#endif
16,16,16,
EVP_CIPH_CBC_MODE|EVP_CIPH_FLAG_DEFAULT_ASN1|EVP_CIPH_FLAG_AEAD_CIPHER,
aesni_cbc_hmac_sha1_init_key,
aesni_cbc_hmac_sha1_cipher,
NULL,
sizeof(EVP_AES_HMAC_SHA1),
EVP_CIPH_FLAG_DEFAULT_ASN1?NULL:EVP_CIPHER_set_asn1_iv,
EVP_CIPH_FLAG_DEFAULT_ASN1?NULL:EVP_CIPHER_get_asn1_iv,
aesni_cbc_hmac_sha1_ctrl,
NULL
};
static EVP_CIPHER aesni_256_cbc_hmac_sha1_cipher =
{
#ifdef NID_aes_256_cbc_hmac_sha1
NID_aes_256_cbc_hmac_sha1,
#else
NID_undef,
#endif
16,32,16,
EVP_CIPH_CBC_MODE|EVP_CIPH_FLAG_DEFAULT_ASN1|EVP_CIPH_FLAG_AEAD_CIPHER,
aesni_cbc_hmac_sha1_init_key,
aesni_cbc_hmac_sha1_cipher,
NULL,
sizeof(EVP_AES_HMAC_SHA1),
EVP_CIPH_FLAG_DEFAULT_ASN1?NULL:EVP_CIPHER_set_asn1_iv,
EVP_CIPH_FLAG_DEFAULT_ASN1?NULL:EVP_CIPHER_get_asn1_iv,
aesni_cbc_hmac_sha1_ctrl,
NULL
};
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void)
{
return(OPENSSL_ia32cap_P[1]&AESNI_CAPABLE?
&aesni_128_cbc_hmac_sha1_cipher:NULL);
}
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void)
{
return(OPENSSL_ia32cap_P[1]&AESNI_CAPABLE?
&aesni_256_cbc_hmac_sha1_cipher:NULL);
}
#else
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void)
{
return NULL;
}
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void)
{
return NULL;
}
#endif
#endif
|
the_stack_data/222943.c
|
#import <stdio.h>
void main () {
printf("Digite uma letra: ");
char l;
scanf("%c", &l);
char a;
a = l-1;
char s;
s = l+1;
printf("Antes da letra %c temos a letra %c. Depois temos a letra %c.",l,a,s);
}
|
the_stack_data/80403.c
|
/* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file ntmain.c
*
* \brief Entry points for running/configuring Tor as a Windows Service.
*
* Windows Services expect to be registered with the operating system, and to
* have entry points for starting, stopping, and monitoring them. This module
* implements those entry points so that a tor relay or client or hidden
* service can run as a Windows service. Therefore, this module
* is only compiled when building for Windows.
*
* Warning: this module is not very well tested or very well maintained.
*/
#ifdef _WIN32
#include "core/or/or.h"
#include "app/config/config.h"
#include "core/mainloop/main.h"
#include "app/main/ntmain.h"
#include "lib/log/win32err.h"
#include "lib/fs/winlib.h"
#include "lib/evloop/compat_libevent.h"
#include <windows.h>
#define GENSRV_SERVICENAME "tor"
#define GENSRV_DISPLAYNAME "Tor Win32 Service"
#define GENSRV_DESCRIPTION \
"Provides an anonymous Internet communication system"
#define GENSRV_USERACCT "NT AUTHORITY\\LocalService"
// Cheating: using the pre-defined error codes, tricks Windows into displaying
// a semi-related human-readable error message if startup fails as
// opposed to simply scaring people with Error: 0xffffffff
#define NT_SERVICE_ERROR_TORINIT_FAILED ERROR_EXCEPTION_IN_SERVICE
static SERVICE_STATUS service_status;
static SERVICE_STATUS_HANDLE hStatus;
/* XXXX This 'backup argv' and 'backup argc' business is an ugly hack. This
* is a job for arguments, not globals. Alas, some of the functions that
* use them use them need to have fixed signatures, so they can be passed
* to the NT service functions. */
static char **backup_argv;
static int backup_argc;
static void nt_service_control(DWORD request);
static void nt_service_body(int argc, char **argv);
static void nt_service_main(void);
static SC_HANDLE nt_service_open_scm(void);
static SC_HANDLE nt_service_open(SC_HANDLE hSCManager);
static int nt_service_start(SC_HANDLE hService);
static int nt_service_stop(SC_HANDLE hService);
static int nt_service_install(int argc, char **argv);
static int nt_service_remove(void);
static int nt_service_cmd_start(void);
static int nt_service_cmd_stop(void);
/** Struct to hold dynamically loaded NT-service related function pointers.
*/
struct service_fns {
int loaded;
/** @{ */
/** Function pointers for Windows API functions related to service
* management. These are NULL, or they point to the . They're set by
* calling the LOAD macro below. */
BOOL (WINAPI *ChangeServiceConfig2A_fn)(
SC_HANDLE hService,
DWORD dwInfoLevel,
LPVOID lpInfo);
BOOL (WINAPI *CloseServiceHandle_fn)(
SC_HANDLE hSCObject);
BOOL (WINAPI *ControlService_fn)(
SC_HANDLE hService,
DWORD dwControl,
LPSERVICE_STATUS lpServiceStatus);
SC_HANDLE (WINAPI *CreateServiceA_fn)(
SC_HANDLE hSCManager,
LPCSTR lpServiceName,
LPCSTR lpDisplayName,
DWORD dwDesiredAccess,
DWORD dwServiceType,
DWORD dwStartType,
DWORD dwErrorControl,
LPCSTR lpBinaryPathName,
LPCSTR lpLoadOrderGroup,
LPDWORD lpdwTagId,
LPCSTR lpDependencies,
LPCSTR lpServiceStartName,
LPCSTR lpPassword);
BOOL (WINAPI *DeleteService_fn)(
SC_HANDLE hService);
SC_HANDLE (WINAPI *OpenSCManagerA_fn)(
LPCSTR lpMachineName,
LPCSTR lpDatabaseName,
DWORD dwDesiredAccess);
SC_HANDLE (WINAPI *OpenServiceA_fn)(
SC_HANDLE hSCManager,
LPCSTR lpServiceName,
DWORD dwDesiredAccess);
BOOL (WINAPI *QueryServiceStatus_fn)(
SC_HANDLE hService,
LPSERVICE_STATUS lpServiceStatus);
SERVICE_STATUS_HANDLE (WINAPI *RegisterServiceCtrlHandlerA_fn)(
LPCSTR lpServiceName,
LPHANDLER_FUNCTION lpHandlerProc);
BOOL (WINAPI *SetServiceStatus_fn)(SERVICE_STATUS_HANDLE,
LPSERVICE_STATUS);
BOOL (WINAPI *StartServiceCtrlDispatcherA_fn)(
const SERVICE_TABLE_ENTRYA* lpServiceTable);
BOOL (WINAPI *StartServiceA_fn)(
SC_HANDLE hService,
DWORD dwNumServiceArgs,
LPCSTR* lpServiceArgVectors);
BOOL (WINAPI *LookupAccountNameA_fn)(
LPCSTR lpSystemName,
LPCSTR lpAccountName,
PSID Sid,
LPDWORD cbSid,
LPTSTR ReferencedDomainName,
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse);
/** @} */
} service_fns = { 0,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL};
/** Loads functions used by NT services. Returns on success, or prints a
* complaint to stdout and exits on error. */
static void
nt_service_loadlibrary(void)
{
HMODULE library = 0;
void *fn;
if (service_fns.loaded)
return;
if (!(library = load_windows_system_library(TEXT("advapi32.dll")))) {
log_err(LD_GENERAL, "Couldn't open advapi32.dll. Are you trying to use "
"NT services on Windows 98? That doesn't work.");
goto err;
}
/* Helper macro: try to load a function named <b>f</b> from "library" into
* service_functions.<b>f</b>_fn. On failure, log an error message, and goto
* err.
*/
#define LOAD(f) STMT_BEGIN \
if (!(fn = GetProcAddress(library, #f))) { \
log_err(LD_BUG, \
"Couldn't find %s in advapi32.dll! We probably got the " \
"name wrong.", #f); \
goto err; \
} else { \
service_fns.f ## _fn = fn; \
} \
STMT_END
LOAD(ChangeServiceConfig2A);
LOAD(CloseServiceHandle);
LOAD(ControlService);
LOAD(CreateServiceA);
LOAD(DeleteService);
LOAD(OpenSCManagerA);
LOAD(OpenServiceA);
LOAD(QueryServiceStatus);
LOAD(RegisterServiceCtrlHandlerA);
LOAD(SetServiceStatus);
LOAD(StartServiceCtrlDispatcherA);
LOAD(StartServiceA);
LOAD(LookupAccountNameA);
service_fns.loaded = 1;
return;
err:
printf("Unable to load library support for NT services: exiting.\n");
exit(1); // exit ok: ntmain can't read libraries
}
/** If we're compiled to run as an NT service, and the service wants to
* shut down, then change our current status and return 1. Else
* return 0.
*/
int
nt_service_is_stopping(void)
{
/* If we haven't loaded the function pointers, we can't possibly be an NT
* service trying to shut down. */
if (!service_fns.loaded)
return 0;
if (service_status.dwCurrentState == SERVICE_STOP_PENDING) {
service_status.dwWin32ExitCode = 0;
service_status.dwCurrentState = SERVICE_STOPPED;
service_fns.SetServiceStatus_fn(hStatus, &service_status);
return 1;
} else if (service_status.dwCurrentState == SERVICE_STOPPED) {
return 1;
}
return 0;
}
/** Set the dwCurrentState field for our service to <b>state</b>. */
void
nt_service_set_state(DWORD state)
{
service_status.dwCurrentState = state;
}
/** Handles service control requests, such as stopping or starting the
* Tor service. */
static void
nt_service_control(DWORD request)
{
static struct timeval exit_now;
exit_now.tv_sec = 0;
exit_now.tv_usec = 0;
nt_service_loadlibrary();
switch (request) {
case SERVICE_CONTROL_STOP:
case SERVICE_CONTROL_SHUTDOWN:
log_notice(LD_GENERAL,
"Got stop/shutdown request; shutting down cleanly.");
service_status.dwCurrentState = SERVICE_STOP_PENDING;
tor_libevent_exit_loop_after_delay(tor_libevent_get_base(),
&exit_now);
return;
}
service_fns.SetServiceStatus_fn(hStatus, &service_status);
}
/** Called when the service is started via the system's service control
* manager. This calls tor_init() and starts the main event loop. If
* tor_init() fails, the service will be stopped and exit code set to
* NT_SERVICE_ERROR_TORINIT_FAILED. */
static void
nt_service_body(int argc, char **argv)
{
int r;
(void) argc; /* unused */
(void) argv; /* unused */
nt_service_loadlibrary();
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
service_status.dwCurrentState = SERVICE_START_PENDING;
service_status.dwControlsAccepted =
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
service_status.dwWin32ExitCode = 0;
service_status.dwServiceSpecificExitCode = 0;
service_status.dwCheckPoint = 0;
service_status.dwWaitHint = 1000;
hStatus = service_fns.RegisterServiceCtrlHandlerA_fn(GENSRV_SERVICENAME,
(LPHANDLER_FUNCTION) nt_service_control);
if (hStatus == 0) {
/* Failed to register the service control handler function */
return;
}
r = tor_init(backup_argc, backup_argv);
if (r) {
/* Failed to start the Tor service */
r = NT_SERVICE_ERROR_TORINIT_FAILED;
service_status.dwCurrentState = SERVICE_STOPPED;
service_status.dwWin32ExitCode = r;
service_status.dwServiceSpecificExitCode = r;
service_fns.SetServiceStatus_fn(hStatus, &service_status);
return;
}
/* Set the service's status to SERVICE_RUNNING and start the main
* event loop */
service_status.dwCurrentState = SERVICE_RUNNING;
service_fns.SetServiceStatus_fn(hStatus, &service_status);
set_main_thread();
do_main_loop();
tor_cleanup();
}
/** Main service entry point. Starts the service control dispatcher and waits
* until the service status is set to SERVICE_STOPPED. */
static void
nt_service_main(void)
{
SERVICE_TABLE_ENTRYA table[2];
DWORD result = 0;
char *errmsg;
nt_service_loadlibrary();
table[0].lpServiceName = (char*)GENSRV_SERVICENAME;
table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTIONA)nt_service_body;
table[1].lpServiceName = NULL;
table[1].lpServiceProc = NULL;
if (!service_fns.StartServiceCtrlDispatcherA_fn(table)) {
result = GetLastError();
errmsg = format_win32_error(result);
printf("Service error %d : %s\n", (int) result, errmsg);
tor_free(errmsg);
if (result == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
if (tor_init(backup_argc, backup_argv))
return;
switch (get_options()->command) {
case CMD_RUN_TOR:
do_main_loop();
break;
case CMD_LIST_FINGERPRINT:
case CMD_HASH_PASSWORD:
case CMD_VERIFY_CONFIG:
case CMD_DUMP_CONFIG:
case CMD_KEYGEN:
case CMD_KEY_EXPIRATION:
log_err(LD_CONFIG, "Unsupported command (--list-fingerprint, "
"--hash-password, --keygen, --dump-config, --verify-config, "
"or --key-expiration) in NT service.");
break;
case CMD_RUN_UNITTESTS:
default:
log_err(LD_CONFIG, "Illegal command number %d: internal error.",
get_options()->command);
}
tor_cleanup();
}
}
}
/** Return a handle to the service control manager on success, or NULL on
* failure. */
static SC_HANDLE
nt_service_open_scm(void)
{
SC_HANDLE hSCManager;
char *errmsg = NULL;
nt_service_loadlibrary();
if ((hSCManager = service_fns.OpenSCManagerA_fn(
NULL, NULL, SC_MANAGER_CREATE_SERVICE)) == NULL) {
errmsg = format_win32_error(GetLastError());
printf("OpenSCManager() failed : %s\n", errmsg);
tor_free(errmsg);
}
return hSCManager;
}
/** Open a handle to the Tor service using <b>hSCManager</b>. Return NULL
* on failure. */
static SC_HANDLE
nt_service_open(SC_HANDLE hSCManager)
{
SC_HANDLE hService;
char *errmsg = NULL;
nt_service_loadlibrary();
if ((hService = service_fns.OpenServiceA_fn(hSCManager, GENSRV_SERVICENAME,
SERVICE_ALL_ACCESS)) == NULL) {
errmsg = format_win32_error(GetLastError());
printf("OpenService() failed : %s\n", errmsg);
tor_free(errmsg);
}
return hService;
}
/** Start the Tor service. Return 0 if the service is started or was
* previously running. Return -1 on error. */
static int
nt_service_start(SC_HANDLE hService)
{
char *errmsg = NULL;
nt_service_loadlibrary();
service_fns.QueryServiceStatus_fn(hService, &service_status);
if (service_status.dwCurrentState == SERVICE_RUNNING) {
printf("Service is already running\n");
return 0;
}
if (service_fns.StartServiceA_fn(hService, 0, NULL)) {
/* Loop until the service has finished attempting to start */
while (service_fns.QueryServiceStatus_fn(hService, &service_status) &&
(service_status.dwCurrentState == SERVICE_START_PENDING)) {
Sleep(500);
}
/* Check if it started successfully or not */
if (service_status.dwCurrentState == SERVICE_RUNNING) {
printf("Service started successfully\n");
return 0;
} else {
errmsg = format_win32_error(service_status.dwWin32ExitCode);
printf("Service failed to start : %s\n", errmsg);
tor_free(errmsg);
}
} else {
errmsg = format_win32_error(GetLastError());
printf("StartService() failed : %s\n", errmsg);
tor_free(errmsg);
}
return -1;
}
/** Stop the Tor service. Return 0 if the service is stopped or was not
* previously running. Return -1 on error. */
static int
nt_service_stop(SC_HANDLE hService)
{
/** Wait at most 10 seconds for the service to stop. */
#define MAX_SERVICE_WAIT_TIME 10
int wait_time;
char *errmsg = NULL;
nt_service_loadlibrary();
service_fns.QueryServiceStatus_fn(hService, &service_status);
if (service_status.dwCurrentState == SERVICE_STOPPED) {
printf("Service is already stopped\n");
return 0;
}
if (service_fns.ControlService_fn(hService, SERVICE_CONTROL_STOP,
&service_status)) {
wait_time = 0;
while (service_fns.QueryServiceStatus_fn(hService, &service_status) &&
(service_status.dwCurrentState != SERVICE_STOPPED) &&
(wait_time < MAX_SERVICE_WAIT_TIME)) {
Sleep(1000);
wait_time++;
}
if (service_status.dwCurrentState == SERVICE_STOPPED) {
printf("Service stopped successfully\n");
return 0;
} else if (wait_time == MAX_SERVICE_WAIT_TIME) {
printf("Service did not stop within %d seconds.\n", wait_time);
} else {
errmsg = format_win32_error(GetLastError());
printf("QueryServiceStatus() failed : %s\n",errmsg);
tor_free(errmsg);
}
} else {
errmsg = format_win32_error(GetLastError());
printf("ControlService() failed : %s\n", errmsg);
tor_free(errmsg);
}
return -1;
}
/** Build a formatted command line used for the NT service. Return a
* pointer to the formatted string on success, or NULL on failure. Set
* *<b>using_default_torrc</b> to true if we're going to use the default
* location to torrc, or 1 if an option was specified on the command line.
*/
static char *
nt_service_command_line(int *using_default_torrc)
{
TCHAR tor_exe[MAX_PATH+1];
char tor_exe_ascii[MAX_PATH*2+1];
char *command=NULL, *options=NULL;
smartlist_t *sl;
int i;
*using_default_torrc = 1;
/* Get the location of tor.exe */
if (0 == GetModuleFileName(NULL, tor_exe, MAX_PATH))
return NULL;
/* Get the service arguments */
sl = smartlist_new();
for (i = 1; i < backup_argc; ++i) {
if (!strcmp(backup_argv[i], "--options") ||
!strcmp(backup_argv[i], "-options")) {
while (++i < backup_argc) {
if (!strcmp(backup_argv[i], "-f"))
*using_default_torrc = 0;
smartlist_add(sl, backup_argv[i]);
}
}
}
if (smartlist_len(sl))
options = smartlist_join_strings(sl,"\" \"",0,NULL);
smartlist_free(sl);
#ifdef UNICODE
wcstombs(tor_exe_ascii, tor_exe, sizeof(tor_exe_ascii));
tor_exe_ascii[sizeof(tor_exe_ascii)-1] = '\0';
#else
strlcpy(tor_exe_ascii, tor_exe, sizeof(tor_exe_ascii));
#endif /* defined(UNICODE) */
/* Allocate a string for the NT service command line and */
/* Format the service command */
if (options) {
tor_asprintf(&command, "\"%s\" --nt-service \"%s\"",
tor_exe_ascii, options);
} else { /* ! options */
tor_asprintf(&command, "\"%s\" --nt-service", tor_exe_ascii);
}
tor_free(options);
return command;
}
/** Creates a Tor NT service, set to start on boot. The service will be
* started if installation succeeds. Returns 0 on success, or -1 on
* failure. */
static int
nt_service_install(int argc, char **argv)
{
/* Notes about developing NT services:
*
* 1. Don't count on your CWD. If an absolute path is not given, the
* fopen() function goes wrong.
* 2. The parameters given to the nt_service_body() function differ
* from those given to main() function.
*/
SC_HANDLE hSCManager = NULL;
SC_HANDLE hService = NULL;
SERVICE_DESCRIPTIONA sdBuff;
char *command;
char *errmsg;
const char *user_acct = NULL;
const char *password = "";
int i;
OSVERSIONINFOEX info;
SID_NAME_USE sidUse;
DWORD sidLen = 0, domainLen = 0;
int is_win2k_or_worse = 0;
int using_default_torrc = 0;
nt_service_loadlibrary();
/* Open the service control manager so we can create a new service */
if ((hSCManager = nt_service_open_scm()) == NULL)
return -1;
/* Build the command line used for the service */
if ((command = nt_service_command_line(&using_default_torrc)) == NULL) {
printf("Unable to build service command line.\n");
service_fns.CloseServiceHandle_fn(hSCManager);
return -1;
}
for (i=1; i < argc; ++i) {
if (!strcmp(argv[i], "--user") && i+1<argc) {
user_acct = argv[i+1];
++i;
}
if (!strcmp(argv[i], "--password") && i+1<argc) {
password = argv[i+1];
++i;
}
}
/* Compute our version and see whether we're running win2k or earlier. */
memset(&info, 0, sizeof(info));
info.dwOSVersionInfoSize = sizeof(info);
if (! GetVersionEx((LPOSVERSIONINFO)&info)) {
printf("Call to GetVersionEx failed.\n");
is_win2k_or_worse = 1;
} else {
if (info.dwMajorVersion < 5 ||
(info.dwMajorVersion == 5 && info.dwMinorVersion == 0))
is_win2k_or_worse = 1;
}
if (!user_acct) {
if (is_win2k_or_worse) {
/* On Win2k, there is no LocalService account, so we actually need to
* fall back on NULL (the system account). */
printf("Running on Win2K or earlier, so the LocalService account "
"doesn't exist. Falling back to SYSTEM account.\n");
} else {
/* Genericity is apparently _so_ last year in Redmond, where some
* accounts are accounts that you can look up, and some accounts
* are magic and undetectable via the security subsystem. See
* http://msdn2.microsoft.com/en-us/library/ms684188.aspx
*/
printf("Running on a Post-Win2K OS, so we'll assume that the "
"LocalService account exists.\n");
user_acct = GENSRV_USERACCT;
}
} else if (0 && service_fns.LookupAccountNameA_fn(NULL, // On this system
user_acct,
NULL, &sidLen, // Don't care about the SID
NULL, &domainLen, // Don't care about the domain
&sidUse) == 0) {
/* XXXX For some reason, the above test segfaults. Fix that. */
printf("User \"%s\" doesn't seem to exist.\n", user_acct);
return -1;
} else {
printf("Will try to install service as user \"%s\".\n", user_acct);
}
/* XXXX This warning could be better about explaining how to resolve the
* situation. */
if (using_default_torrc)
printf("IMPORTANT NOTE:\n"
" The Tor service will run under the account \"%s\". This means\n"
" that Tor will look for its configuration file under that\n"
" account's Application Data directory, which is probably not\n"
" the same as yours.\n", user_acct?user_acct:"<local system>");
/* Create the Tor service, set to auto-start on boot */
if ((hService = service_fns.CreateServiceA_fn(hSCManager, GENSRV_SERVICENAME,
GENSRV_DISPLAYNAME,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START, SERVICE_ERROR_IGNORE,
command, NULL, NULL, NULL,
user_acct, password)) == NULL) {
errmsg = format_win32_error(GetLastError());
printf("CreateService() failed : %s\n", errmsg);
service_fns.CloseServiceHandle_fn(hSCManager);
tor_free(errmsg);
tor_free(command);
return -1;
}
printf("Done with CreateService.\n");
/* Set the service's description */
sdBuff.lpDescription = (char*)GENSRV_DESCRIPTION;
service_fns.ChangeServiceConfig2A_fn(hService, SERVICE_CONFIG_DESCRIPTION,
&sdBuff);
printf("Service installed successfully\n");
/* Start the service initially */
nt_service_start(hService);
service_fns.CloseServiceHandle_fn(hService);
service_fns.CloseServiceHandle_fn(hSCManager);
tor_free(command);
return 0;
}
/** Removes the Tor NT service. Returns 0 if the service was successfully
* removed, or -1 on error. */
static int
nt_service_remove(void)
{
SC_HANDLE hSCManager = NULL;
SC_HANDLE hService = NULL;
char *errmsg;
nt_service_loadlibrary();
if ((hSCManager = nt_service_open_scm()) == NULL)
return -1;
if ((hService = nt_service_open(hSCManager)) == NULL) {
service_fns.CloseServiceHandle_fn(hSCManager);
return -1;
}
nt_service_stop(hService);
if (service_fns.DeleteService_fn(hService) == FALSE) {
errmsg = format_win32_error(GetLastError());
printf("DeleteService() failed : %s\n", errmsg);
tor_free(errmsg);
service_fns.CloseServiceHandle_fn(hService);
service_fns.CloseServiceHandle_fn(hSCManager);
return -1;
}
service_fns.CloseServiceHandle_fn(hService);
service_fns.CloseServiceHandle_fn(hSCManager);
printf("Service removed successfully\n");
return 0;
}
/** Starts the Tor service. Returns 0 on success, or -1 on error. */
static int
nt_service_cmd_start(void)
{
SC_HANDLE hSCManager;
SC_HANDLE hService;
int start;
if ((hSCManager = nt_service_open_scm()) == NULL)
return -1;
if ((hService = nt_service_open(hSCManager)) == NULL) {
service_fns.CloseServiceHandle_fn(hSCManager);
return -1;
}
start = nt_service_start(hService);
service_fns.CloseServiceHandle_fn(hService);
service_fns.CloseServiceHandle_fn(hSCManager);
return start;
}
/** Stops the Tor service. Returns 0 on success, or -1 on error. */
static int
nt_service_cmd_stop(void)
{
SC_HANDLE hSCManager;
SC_HANDLE hService;
int stop;
if ((hSCManager = nt_service_open_scm()) == NULL)
return -1;
if ((hService = nt_service_open(hSCManager)) == NULL) {
service_fns.CloseServiceHandle_fn(hSCManager);
return -1;
}
stop = nt_service_stop(hService);
service_fns.CloseServiceHandle_fn(hService);
service_fns.CloseServiceHandle_fn(hSCManager);
return stop;
}
int
nt_service_parse_options(int argc, char **argv, int *should_exit)
{
backup_argv = argv;
backup_argc = argc;
*should_exit = 0;
if ((argc >= 3) &&
(!strcmp(argv[1], "-service") || !strcmp(argv[1], "--service"))) {
nt_service_loadlibrary();
*should_exit = 1;
if (!strcmp(argv[2], "install"))
return nt_service_install(argc, argv);
if (!strcmp(argv[2], "remove"))
return nt_service_remove();
if (!strcmp(argv[2], "start"))
return nt_service_cmd_start();
if (!strcmp(argv[2], "stop"))
return nt_service_cmd_stop();
printf("Unrecognized service command '%s'\n", argv[2]);
return 1;
}
if (argc >= 2) {
if (!strcmp(argv[1], "-nt-service") || !strcmp(argv[1], "--nt-service")) {
nt_service_loadlibrary();
nt_service_main();
*should_exit = 1;
return 0;
}
// These values have been deprecated since 0.1.1.2-alpha; we've warned
// about them since 0.1.2.7-alpha.
if (!strcmp(argv[1], "-install") || !strcmp(argv[1], "--install")) {
nt_service_loadlibrary();
fprintf(stderr,
"The %s option is deprecated; use \"--service install\" instead.",
argv[1]);
*should_exit = 1;
return nt_service_install(argc, argv);
}
if (!strcmp(argv[1], "-remove") || !strcmp(argv[1], "--remove")) {
nt_service_loadlibrary();
fprintf(stderr,
"The %s option is deprecated; use \"--service remove\" instead.",
argv[1]);
*should_exit = 1;
return nt_service_remove();
}
}
*should_exit = 0;
return 0;
}
#endif /* defined(_WIN32) */
|
the_stack_data/211081355.c
|
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
extern void abort(void);
void reach_error(){}
int __VERIFIER_nondet_int(void);
void ldv_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; }
pthread_t t1;
pthread_mutex_t mutex;
int pdev;
void *thread1(void *arg) {
pthread_mutex_lock(&mutex);
pdev = 6;
pthread_mutex_unlock(&mutex);
return 0;
}
int module_init() {
pthread_mutex_init(&mutex, NULL);
//not a race
pdev = 1;
ldv_assert(pdev==1);
if(__VERIFIER_nondet_int()) {
//enable thread 1
pthread_create(&t1, NULL, thread1, NULL);
//race
pdev = 2;
ldv_assert(pdev==2);
return 0;
}
//not a race
pdev = 3;
ldv_assert(pdev==3);
pthread_mutex_destroy(&mutex);
return -1;
}
void module_exit() {
void *status;
//race
//pdev = 4;
//ldv_assert(pdev==4);
pthread_join(t1, &status);
pthread_mutex_destroy(&mutex);
//not a race
pdev = 5;
ldv_assert(pdev==5);
}
int main(void) {
if(module_init()!=0) goto module_exit;
module_exit();
module_exit:
return 0;
}
|
the_stack_data/154831191.c
|
int main(){
return (1 == 1) + -(2 == 1);}
|
the_stack_data/122014401.c
|
#include <stdio.h>
#include <stdlib.h>
struct Array{
int A[10];
int size;
int length;
};
void Append(struct Array *arr, int x){
if (arr->length < arr->size){
arr->A[arr->length++] = x;
}
}
void Insert(struct Array *arr, int index, int x){
int i;
if(index >= 0 && index <= arr->length){
for(i = arr->length; i > index; i--){
arr->A[i] = arr->A[i-1];
}
arr->A[index] = x;
arr->length++;
}
}
int Delete (struct Array *arr, int index){
int x = 0;
int i;
if(index >= 0 && index <= arr->length-1){
x = arr->A[index];
for(i = index; i < arr->length-1; i++){
arr->A[i] = arr->A[i+1];
}
arr->length--;
return x;
}
return 0;
}
void Display(struct Array arr){
int i;
printf("\nElements are\n");
for (i = 0; i < arr.length; i++){
printf("%d ", arr.A[i]);
}
}
void Swap(int *x, int *y){
int tempo;
tempo = *x;
*x = *y;
*y = tempo;
}
int LinearSearch(struct Array *arr, int key){
int i;
for(i = 0; i < arr->length; i++){
if(key == arr->A[i]){
//swap - transposition
Swap(&arr->A[i], &arr->A[i-1]);
//swap - to head
//Swap(&arr->A[i], &arr->A[0]);
return i;
}
}
return -1;
}
int main(){
struct Array arr = {{2,3,4,5,6}, 10, 5};
printf("%d\n", LinearSearch(&arr, 6));
Display(arr);
return 0;
}
|
the_stack_data/92325992.c
|
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */
#ifdef CAPSTONE_HAS_ARM64
#include <stdio.h> // debug
#include <string.h>
#include "../../utils.h"
#include "AArch64Mapping.h"
#define GET_INSTRINFO_ENUM
#include "AArch64GenInstrInfo.inc"
#ifndef CAPSTONE_DIET
// NOTE: this reg_name_maps[] reflects the order of registers in arm64_reg
static const char * const reg_name_maps[] = {
NULL, /* ARM64_REG_INVALID */
"ffr",
"fp",
"lr",
"nzcv",
"sp",
"wsp",
"wzr",
"xzr",
"b0",
"b1",
"b2",
"b3",
"b4",
"b5",
"b6",
"b7",
"b8",
"b9",
"b10",
"b11",
"b12",
"b13",
"b14",
"b15",
"b16",
"b17",
"b18",
"b19",
"b20",
"b21",
"b22",
"b23",
"b24",
"b25",
"b26",
"b27",
"b28",
"b29",
"b30",
"b31",
"d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
"d8",
"d9",
"d10",
"d11",
"d12",
"d13",
"d14",
"d15",
"d16",
"d17",
"d18",
"d19",
"d20",
"d21",
"d22",
"d23",
"d24",
"d25",
"d26",
"d27",
"d28",
"d29",
"d30",
"d31",
"h0",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"h7",
"h8",
"h9",
"h10",
"h11",
"h12",
"h13",
"h14",
"h15",
"h16",
"h17",
"h18",
"h19",
"h20",
"h21",
"h22",
"h23",
"h24",
"h25",
"h26",
"h27",
"h28",
"h29",
"h30",
"h31",
"p0",
"p1",
"p2",
"p3",
"p4",
"p5",
"p6",
"p7",
"p8",
"p9",
"p10",
"p11",
"p12",
"p13",
"p14",
"p15",
"q0",
"q1",
"q2",
"q3",
"q4",
"q5",
"q6",
"q7",
"q8",
"q9",
"q10",
"q11",
"q12",
"q13",
"q14",
"q15",
"q16",
"q17",
"q18",
"q19",
"q20",
"q21",
"q22",
"q23",
"q24",
"q25",
"q26",
"q27",
"q28",
"q29",
"q30",
"q31",
"s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
"s8",
"s9",
"s10",
"s11",
"s12",
"s13",
"s14",
"s15",
"s16",
"s17",
"s18",
"s19",
"s20",
"s21",
"s22",
"s23",
"s24",
"s25",
"s26",
"s27",
"s28",
"s29",
"s30",
"s31",
"w0",
"w1",
"w2",
"w3",
"w4",
"w5",
"w6",
"w7",
"w8",
"w9",
"w10",
"w11",
"w12",
"w13",
"w14",
"w15",
"w16",
"w17",
"w18",
"w19",
"w20",
"w21",
"w22",
"w23",
"w24",
"w25",
"w26",
"w27",
"w28",
"w29",
"w30",
"x0",
"x1",
"x2",
"x3",
"x4",
"x5",
"x6",
"x7",
"x8",
"x9",
"x10",
"x11",
"x12",
"x13",
"x14",
"x15",
"x16",
"x17",
"x18",
"x19",
"x20",
"x21",
"x22",
"x23",
"x24",
"x25",
"x26",
"x27",
"x28",
"z0",
"z1",
"z2",
"z3",
"z4",
"z5",
"z6",
"z7",
"z8",
"z9",
"z10",
"z11",
"z12",
"z13",
"z14",
"z15",
"z16",
"z17",
"z18",
"z19",
"z20",
"z21",
"z22",
"z23",
"z24",
"z25",
"z26",
"z27",
"z28",
"z29",
"z30",
"z31",
"v0",
"v1",
"v2",
"v3",
"v4",
"v5",
"v6",
"v7",
"v8",
"v9",
"v10",
"v11",
"v12",
"v13",
"v14",
"v15",
"v16",
"v17",
"v18",
"v19",
"v20",
"v21",
"v22",
"v23",
"v24",
"v25",
"v26",
"v27",
"v28",
"v29",
"v30",
"v31",
};
#endif
const char *AArch64_reg_name(csh handle, unsigned int reg)
{
#ifndef CAPSTONE_DIET
if (reg >= ARR_SIZE(reg_name_maps))
return NULL;
return reg_name_maps[reg];
#else
return NULL;
#endif
}
static const insn_map insns[] = {
// dummy item
{
0, 0,
#ifndef CAPSTONE_DIET
{ 0 }, { 0 }, { 0 }, 0, 0
#endif
},
#include "AArch64MappingInsn.inc"
};
// given internal insn id, return public instruction info
void AArch64_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
{
int i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache);
if (i != 0) {
insn->id = insns[i].mapid;
if (h->detail) {
#ifndef CAPSTONE_DIET
cs_struct handle;
handle.detail = h->detail;
memcpy(insn->detail->regs_read, insns[i].regs_use, sizeof(insns[i].regs_use));
insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use);
memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod));
insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod);
memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups));
insn->detail->groups_count = (uint8_t)count_positive8(insns[i].groups);
insn->detail->arm64.update_flags = cs_reg_write((csh)&handle, insn, ARM64_REG_NZCV);
#endif
}
}
}
static const char * const insn_name_maps[] = {
NULL, // ARM64_INS_INVALID
#include "AArch64MappingInsnName.inc"
"sbfiz",
"ubfiz",
"sbfx",
"ubfx",
"bfi",
"bfxil",
"ic",
"dc",
"at",
"tlbi",
};
const char *AArch64_insn_name(csh handle, unsigned int id)
{
#ifndef CAPSTONE_DIET
if (id >= ARM64_INS_ENDING)
return NULL;
if (id < ARR_SIZE(insn_name_maps))
return insn_name_maps[id];
// not found
return NULL;
#else
return NULL;
#endif
}
#ifndef CAPSTONE_DIET
static const name_map group_name_maps[] = {
// generic groups
{ ARM64_GRP_INVALID, NULL },
{ ARM64_GRP_JUMP, "jump" },
{ ARM64_GRP_CALL, "call" },
{ ARM64_GRP_RET, "return" },
{ ARM64_GRP_PRIVILEGE, "privilege" },
{ ARM64_GRP_INT, "int" },
{ ARM64_GRP_BRANCH_RELATIVE, "branch_relative" },
{ ARM64_GRP_PAC, "pointer authentication" },
// architecture-specific groups
{ ARM64_GRP_CRYPTO, "crypto" },
{ ARM64_GRP_FPARMV8, "fparmv8" },
{ ARM64_GRP_NEON, "neon" },
{ ARM64_GRP_CRC, "crc" },
{ ARM64_GRP_AES, "aes" },
{ ARM64_GRP_DOTPROD, "dotprod" },
{ ARM64_GRP_FULLFP16, "fullfp16" },
{ ARM64_GRP_LSE, "lse" },
{ ARM64_GRP_RCPC, "rcpc" },
{ ARM64_GRP_RDM, "rdm" },
{ ARM64_GRP_SHA2, "sha2" },
{ ARM64_GRP_SHA3, "sha3" },
{ ARM64_GRP_SM4, "sm4" },
{ ARM64_GRP_SVE, "sve" },
{ ARM64_GRP_V8_1A, "v8_1a" },
{ ARM64_GRP_V8_3A, "v8_3a" },
{ ARM64_GRP_V8_4A, "v8_4a" },
};
#endif
const char *AArch64_group_name(csh handle, unsigned int id)
{
#ifndef CAPSTONE_DIET
return id2name(group_name_maps, ARR_SIZE(group_name_maps), id);
#else
return NULL;
#endif
}
// map instruction name to public instruction ID
arm64_insn AArch64_map_insn(const char *name)
{
unsigned int i;
for(i = 1; i < ARR_SIZE(insn_name_maps); i++) {
if (!strcmp(name, insn_name_maps[i]))
return i;
}
// not found
return ARM64_INS_INVALID;
}
// map internal raw vregister to 'public' register
arm64_reg AArch64_map_vregister(unsigned int r)
{
static const unsigned short RegAsmOffsetvreg[] = {
#include "AArch64GenRegisterV.inc"
};
if (r < ARR_SIZE(RegAsmOffsetvreg))
return RegAsmOffsetvreg[r - 1];
// cannot find this register
return 0;
}
void arm64_op_addVectorArrSpecifier(MCInst * MI, int sp)
{
if (MI->csh->detail) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count - 1].vas = sp;
}
}
void arm64_op_addFP(MCInst *MI, float fp)
{
if (MI->csh->detail) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_FP;
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].fp = fp;
MI->flat_insn->detail->arm64.op_count++;
}
}
void arm64_op_addImm(MCInst *MI, int64_t imm)
{
if (MI->csh->detail) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_IMM;
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].imm = (int)imm;
MI->flat_insn->detail->arm64.op_count++;
}
}
#ifndef CAPSTONE_DIET
// map instruction to its characteristics
typedef struct insn_op {
unsigned int eflags_update; // how this instruction update status flags
uint8_t access[5];
} insn_op;
static const insn_op insn_ops[] = {
{
/* NULL item */
0, { 0 }
},
#include "AArch64MappingInsnOp.inc"
};
// given internal insn id, return operand access info
const uint8_t *AArch64_get_op_access(cs_struct *h, unsigned int id)
{
int i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache);
if (i != 0) {
return insn_ops[i].access;
}
return NULL;
}
void AArch64_reg_access(const cs_insn *insn,
cs_regs regs_read, uint8_t *regs_read_count,
cs_regs regs_write, uint8_t *regs_write_count)
{
uint8_t i;
uint8_t read_count, write_count;
cs_arm64 *arm64 = &(insn->detail->arm64);
read_count = insn->detail->regs_read_count;
write_count = insn->detail->regs_write_count;
// implicit registers
memcpy(regs_read, insn->detail->regs_read, read_count * sizeof(insn->detail->regs_read[0]));
memcpy(regs_write, insn->detail->regs_write, write_count * sizeof(insn->detail->regs_write[0]));
// explicit registers
for (i = 0; i < arm64->op_count; i++) {
cs_arm64_op *op = &(arm64->operands[i]);
switch((int)op->type) {
case ARM64_OP_REG:
if ((op->access & CS_AC_READ) && !arr_exist(regs_read, read_count, op->reg)) {
regs_read[read_count] = (uint16_t)op->reg;
read_count++;
}
if ((op->access & CS_AC_WRITE) && !arr_exist(regs_write, write_count, op->reg)) {
regs_write[write_count] = (uint16_t)op->reg;
write_count++;
}
break;
case ARM_OP_MEM:
// registers appeared in memory references always being read
if ((op->mem.base != ARM64_REG_INVALID) && !arr_exist(regs_read, read_count, op->mem.base)) {
regs_read[read_count] = (uint16_t)op->mem.base;
read_count++;
}
if ((op->mem.index != ARM64_REG_INVALID) && !arr_exist(regs_read, read_count, op->mem.index)) {
regs_read[read_count] = (uint16_t)op->mem.index;
read_count++;
}
if ((arm64->writeback) && (op->mem.base != ARM64_REG_INVALID) && !arr_exist(regs_write, write_count, op->mem.base)) {
regs_write[write_count] = (uint16_t)op->mem.base;
write_count++;
}
default:
break;
}
}
*regs_read_count = read_count;
*regs_write_count = write_count;
}
#endif
#endif
|
the_stack_data/187642324.c
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/time.h>
#define NMAX 2000
static double a[NMAX][NMAX], b[NMAX][NMAX];
#ifdef TIME
#define IF_TIME(foo) foo;
#else
#define IF_TIME(foo)
#endif
void init_array()
{
int i, j;
for (i = 0; i < NMAX; i++) {
for (j = 0; j < NMAX; j++) {
b[i][j] = i*j*0.3+1;
a[i][j] = i+j+1;
}
}
}
double rtclock()
{
struct timezone Tzp;
struct timeval Tp;
int stat;
stat = gettimeofday (&Tp, &Tzp);
if (stat != 0) printf("Error return from gettimeofday: %d",stat);
return(Tp.tv_sec + Tp.tv_usec*1.0e-6);
}
#define TIME 1
#ifdef TIME
#define IF_TIME(foo) foo;
#else
#define IF_TIME(foo)
#endif
void strsm(long N) {
int i,j,k;
#pragma scop
for (i=0; i<N; i++) {
for (j=0; j<N; j++) {
for (k=i+1; k<N; k++) {
if (k == i+1) b[j][i] /= a[i][i];
b[j][k] -= a[i][k] * b[j][i];
}
}
}
#pragma endscop
}
int main()
{
double t_start, t_end;
long N=NMAX;
int i,j;
IF_TIME(t_start = rtclock());
strsm(N);
IF_TIME(t_end = rtclock());
IF_TIME(fprintf(stdout, "%0.6lfs\n", t_end - t_start));
if (fopen(".test", "r")) {
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
fprintf(stderr, "%lf ", b[i][j]);
}
fprintf(stderr, "\n");
}
}
return 0;
}
|
the_stack_data/47603.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#define thisprog "xe-ldas5-sliceEPSP"
#define TITLE_STRING thisprog" v 1: 6.September.2018 [JRH]"
#define MAXLINELEN 1000
#define MAXLABELS 1000
/* <TAGS> SLICE file signal_processing filter </TAGS> */
/*
TO DO
- change estimation of artefact - time irrelevant, take RMS in unfiltered data between zero and max1?
v 1: 2.October.2018 [JRH]
- bugfix: fEPSP minimum is now actually the minimum, as stated, not the first negative inflection
- allow user to specify whether fibre-volley is based on the first or the last inflection between max1 and max2
- include estimate of fEPSP quality (testing at present - RMS/mean might be best)
v 1: 6.September.2018 [JRH]
- bugfix - corrected use of wrong range (nn vs nnodes2) for checking fibre-volley nodes
v 1: 2.September.2018 [JRH] - rethink of fibre-volley detection strategy
1. do not require artefact detection to proceed with FV detection and fEPSP
- note that stim artefact is quite variable on the electrode in stratum radiatum - detection occassionally fails
- also note that up to this point A2 (artefact positivity) has been defined as the last positivity before max1
- consequently, F2 must by definition fall after max1
2. detect last positivity, OR LAST NEGATIVITY before max2
- because sometimes there is only a negativity, and the peak of the fibre-volley comes late
- using the mid-point of max2-max1 as the slope reference can result in the mid-point being near the actual peak
- revising the algorithm this way ensures that the fibre volley will always include an actual negativity and positivity, one of which must fall between max1 and max2
3. Impose 1.5*(max2-max1) limit on allowable fibre-volley duration
v 1: 30.August.2018 [JRH]
- do not omit slope calculation based on issues with artefact amplitude relative to the POP spike
- do not exit on slope-detection error/warning
- switch to using half-time of fEPSP for calculating slope, rather than the less reliable half-amplitude (which used to fail for shallow slopes)
- update instructions in xf_readwinltp1_f
- update xf_geom_slope2_f to allow slopes to be ignored or to break the loop if they are negative or positive
- update instructions
v 1: 8.May.2018 [JRH]
- estimate "fibre-volley" size and time for slope calculation, even if there is no fibre-volley preset
v 1: 14.December.2017 [JRH]
- three separate filter regimens for artefact, fibre-volley and fEPSP
- slope is calculated using data filtered for fEPSP (data3)
- this obliterates the fibre volley and other artefacts
- however, the scope of the slope-search is defined according to the detection of artefact & fibre-volley using the other filter settings
- requirements for stim-artefact reduced to a positivity before setmax1 (typically 1.5ms)
v 1: 13.December.2017 [JRH]
- make data0 the original unfiltered data
- create separate arrays for strict (data1) and gently (data2) filtered arrays
- bugfix: EPSP slope parameters now derived from more strictly-filtered data
- enable filtered trace output (-fout)
v 1: 2.November.2017 [JRH]
- enable filtered trace output (-fout)
v 1: 2.November.2017 [JRH]
*/
/* external functions start */
long xf_readwinltp1_f(char *setinfile, char *setchan, float **data0, double *result_d, char *message);
char *xf_lineread1(char *line, long *maxlinelen, FILE *fpin);
long *xf_lineparse1(char *line,long *nwords);
long xf_interp3_f(float *data, long ndata);
int xf_stats2_f(float *data1, long nn, int setlarge, float *result_f);
double xf_mae1_f(float *data1, float *data2, long nn, char *message);
double xf_rms1_f(float *input, long nn, char *message);
double xf_samplefreq1_d(double *time1, long n1, char *message);
int xf_compare1_d(const void *a, const void *b);
int xf_filter_bworth1_f(float *X, size_t nn, float sample_freq, float low_freq, float high_freq, float res, char *message);
long xf_detectinflect1_f(float *data,long n1,long **itime1,int **isign1,char *message);
long xf_geom_slope2_f(float *data,long n1,long winsize,double interval,int test,double *min,double *max,char *message);
/* external functions end */
int main (int argc, char *argv[]) {
/* general variables */
char message[MAXLINELEN];
long int ii,jj,kk,ll,mm,nn;
int v,w,x,y,z;
float result_f[16];
double aa,bb,cc,dd,ee,result_d[64];
FILE *fpin,*fpout;
/* program-specific variables */
char outfile1[64],outfile2[64];
int *isign1=NULL,*isign2=NULL,*isign3=NULL;
long zero1,nnodes1,nnodes2,nnodes3,*isamp1=NULL,*isamp2=NULL,*isamp3=NULL;
long sampA1,sampA2,sampF1,sampF2,sampE1,sampE2,slopewin,fvmaxdur,ifirst,ilast;
float *data0=NULL,*data1=NULL,*data2=NULL,*data3=NULL,*dataslope;
double *itime1=NULL,*itime2=NULL,*itime3=NULL;
double timeA1,timeA2,timeF1,timeF2,timeE1,timeE2;
double valueA1,valueA2,valueF1,valueF2,valueE1,valueE2,errE1;
double sampint,samprate,baseline,mae,mean,sd,rms,slopemin,slopemax;
/* arguments */
char *infile,*setchan;
int setfiltout=2,setverb=0,setpos=2;
double setfilthigh1=1500.0,setfilthigh2=1800.0,setfilthigh3=250.0,setmax1=1.25,setmax2=2.5,setmax3=15.0;
/* define output file names */
snprintf(outfile1,64,"temp_%s_trace.txt",thisprog);
snprintf(outfile2,64,"temp_%s_nodes.txt",thisprog);
/********************************************************************************
PRINT INSTRUCTIONS IF THERE IS NO FILENAME SPECIFIED
********************************************************************************/
if(argc<3) {
fprintf(stderr,"\n");
fprintf(stderr,"----------------------------------------------------------------------\n");
fprintf(stderr,"%s\n",TITLE_STRING);
fprintf(stderr,"----------------------------------------------------------------------\n");
fprintf(stderr,"Slice-ephys analysis: fibre-volley (FV) and fEPSP\n");
fprintf(stderr,"- detect stim artefact (ART), FV & fEPSP with separate filters\n");
fprintf(stderr,"- FV: \n");
fprintf(stderr," - find neg or pos inflection between max1 and max2\n");
fprintf(stderr," - find next pos or previous neg inflection, respectively\n");
fprintf(stderr," - check that duration <= 1.5*(max2-max1)\n");
fprintf(stderr," - otherwise use (max1+max2)/2 as FV start and stop time\n");
fprintf(stderr,"- fEPSP slope: top half of line connecting FV and fEPSP minimum\n");
fprintf(stderr," - looks for most negative slope in 0.5ms sliding windows\n");
fprintf(stderr," - seeks from FV +ivity to fEPSP trough\n");
fprintf(stderr," - if no FV, use middle of max1-to-max2 (see below)\n");
fprintf(stderr,"\n");
fprintf(stderr,"USAGE: %s [input] [channel] [options]\n",thisprog);
fprintf(stderr," [input]: WinLTP output filename or \"stdin\"\n");
fprintf(stderr," [channel]: channel to analyze- typically AD0 or AD1\n");
fprintf(stderr,"\n");
fprintf(stderr,"VALID OPTIONS: defaults in []\n");
fprintf(stderr," high-cut filter options (Hz)\n");
fprintf(stderr," -high1 artefact filter [%g]\n",setfilthigh1);
fprintf(stderr," -high2 fibre-volley & slope-detection filter [%g]\n",setfilthigh2);
fprintf(stderr," -high3 fEPSP filter [%g]\n",setfilthigh3);
fprintf(stderr," maximum-times (ms) for phenomena\n");
fprintf(stderr," -max1 ART +ivity, also minimum for FV -ivity [%g]\n",setmax1);
fprintf(stderr," -max2 FV -ivity [%g]\n",setmax2);
fprintf(stderr," -max3 fEPSP trough [%g]\n",setmax3);
fprintf(stderr," other options\n");
fprintf(stderr," -pos: FV detected as first(1) or last(2) inflection [%d]\n",setpos);
fprintf(stderr," -fout output trace is filtered? (0=NO 1=high1, 2=high2, 3-high3) [%d]\n",setfiltout);
fprintf(stderr," -verb sets verbosity (0=simple, 1=verbose) [%d]\n",setverb);
fprintf(stderr,"\n");
fprintf(stderr,"EXAMPLES:\n");
fprintf(stderr," %s 63290358.P0 AD1 -verb 1\n",thisprog);
fprintf(stderr," cat 63290358.P0 | %s stdin AD1\n",thisprog);
fprintf(stderr,"\n");
fprintf(stderr,"SCREEN OUTPUT:\n");
fprintf(stderr," artmv fvms fvmv epspms epspmv epspslope\n");
fprintf(stderr,"\n");
fprintf(stderr,"FILE OUTPUT:\n");
fprintf(stderr," %s\n",outfile1);
fprintf(stderr," - trace in format <time> <voltage>\n");
fprintf(stderr," %s\n",outfile2);
fprintf(stderr," - fEPSP & fibre-volley nodes (used for plotting)\n");
fprintf(stderr,"----------------------------------------------------------------------\n");
fprintf(stderr,"\n");
exit(0);
}
/********************************************************************************
READ THE FILENAME AND OPTIONAL ARGUMENTS - including comma-separated list item
********************************************************************************/
infile= argv[1];
setchan= argv[2];
for(ii=3;ii<argc;ii++) {
if( *(argv[ii]+0) == '-') {
if((ii+1)>=argc) {fprintf(stderr,"\n--- Error [%s]: missing value for argument \"%s\"\n\n",thisprog,argv[ii]); exit(1);}
else if(strcmp(argv[ii],"-high1")==0) setfilthigh1= atof(argv[++ii]);
else if(strcmp(argv[ii],"-high2")==0) setfilthigh2= atof(argv[++ii]);
else if(strcmp(argv[ii],"-high3")==0) setfilthigh3= atof(argv[++ii]);
else if(strcmp(argv[ii],"-max1")==0) setmax1= atof(argv[++ii]);
else if(strcmp(argv[ii],"-max2")==0) setmax2= atof(argv[++ii]);
else if(strcmp(argv[ii],"-max3")==0) setmax3= atof(argv[++ii]);
else if(strcmp(argv[ii],"-pos")==0) setpos= atoi(argv[++ii]);
else if(strcmp(argv[ii],"-verb")==0) setverb= atoi(argv[++ii]);
else if(strcmp(argv[ii],"-fout")==0) setfiltout= atoi(argv[++ii]);
else {fprintf(stderr,"\n*** %s [ERROR: invalid command line argument \"%s\"]\n\n",thisprog,argv[ii]); exit(1);}
}}
if(setpos!=1 && setpos!=2) { fprintf(stderr,"\n--- Error [%s]: invalid -pos [%d] must be 1 or 2\n\n",thisprog,setpos);exit(1);}
if(setverb!=0 && setverb!=1) { fprintf(stderr,"\n--- Error [%s]: invalid -verb [%d] must be 0 or 1\n\n",thisprog,setverb);exit(1);}
if(setmax1>=setmax2) { fprintf(stderr,"\n--- Error [%s]: -max1 [%g] must be < max2 [%g]\n\n",thisprog,setmax1,setmax2);exit(1);}
if(setmax2>=setmax3) { fprintf(stderr,"\n--- Error [%s]: -max2 [%g] must be < max3 [%g]\n\n",thisprog,setmax2,setmax3);exit(1);}
if(setfiltout<0 || setfiltout>3) { fprintf(stderr,"\n--- Error [%s]: invalid -fout [%d] must be 0,1 or 2\n\n",thisprog,setfiltout);exit(1);}
/********************************************************************************/
/* READ THE WINLTP FILE - STORE IN data0 */
/********************************************************************************/
nn= xf_readwinltp1_f(infile,setchan,&data0,result_d,message);
if(nn<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
sampint= result_d[0];
samprate= result_d[1];
baseline= result_d[2];
zero1= (long)(samprate * (baseline/1000.0));
fvmaxdur= (long)(1.5*samprate*(setmax2-setmax1)/1000.0);
if(setverb==1) {
fprintf(stderr," infile= %s\n",infile);
fprintf(stderr," total_samples= %ld\n",nn);
fprintf(stderr," sample_interval= %g ms\n",sampint);
fprintf(stderr," sample_rate= %g Hz\n",samprate);
fprintf(stderr," baseline_period= %g ms\n",baseline);
fprintf(stderr," setmax1= %g ms\n",setmax1);
fprintf(stderr," setmax2= %g ms\n",setmax2);
fprintf(stderr," setmax3= %g ms\n",setmax3);
fprintf(stderr," highcut_filter1= %g Hz\n",setfilthigh1);
fprintf(stderr," highcut_filter2= %g Hz\n",setfilthigh2);
fprintf(stderr," highcut_filter3= %g Hz\n",setfilthigh3);
fprintf(stderr," stimart_maxtime= %g ms\n",setmax1);
fprintf(stderr," fibrevolley_maxtime= %g ms\n",setmax2);
if(setpos==1) fprintf(stderr," fibrevolley_inflection= first\n");
if(setpos==2) fprintf(stderr," fibrevolley_inflection= last\n");
fprintf(stderr," fEPSP_maxtime= %g ms\n",setmax3);
}
/* INTERPOLATE */
jj= xf_interp3_f(data0,nn);
if(jj<0) { fprintf(stderr,"\b\n\t--- Error [%s]: no valid data in %s\n\n",thisprog,infile); exit(1); }
/********************************************************************************/
/* NORMALIZE TO THE MEAN OF THE BASELINE */
/********************************************************************************/
aa= 0.0;
for(ii=0;ii<zero1;ii++) aa+= data0[ii];
mean= aa/(double)zero1;
for(ii=0;ii<nn;ii++) data0[ii]-= mean;
/********************************************************************************/
/* MAKE COPIES OF THE DATA */
/********************************************************************************/
data1= malloc(nn*sizeof(*data1));
data2= malloc(nn*sizeof(*data2));
data3= malloc(nn*sizeof(*data3));
if(data1==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
if(data2==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
if(data3==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
for(ii=0;ii<nn;ii++) data1[ii]= data2[ii]= data3[ii]= data0[ii];
/********************************************************************************/
/* APPLY FILTERING TO THE COPIES */
/********************************************************************************/
z= xf_filter_bworth1_f(data1,nn,samprate,0,setfilthigh1,1.412,message);
if(z<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
z= xf_filter_bworth1_f(data2,nn,samprate,0,setfilthigh2,1.412,message);
if(z<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
z= xf_filter_bworth1_f(data3,nn,samprate,0,setfilthigh3,1.412,message);
if(z<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
/********************************************************************************
DETECT INFLECTIONS (NODES)
- only detect for times > zero (after stimulation)
********************************************************************************/
nnodes1= xf_detectinflect1_f((data1+zero1),(nn-zero1),&isamp1,&isign1,message);
if(nnodes1<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
if(nnodes1<5) { fprintf(stderr,"--- Warning [%s]: fewer than 5 nodes in %s\n",thisprog,infile); }
/* build an inflection-times array: milliseconds, relative to zero */
itime1= malloc(nnodes1*sizeof(*itime1));
if(itime1==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
for(ii=0;ii<nnodes1;ii++) itime1[ii]= (double)isamp1[ii]*sampint;
/* correct the timestamps so they refer to the entire dataset, since detection started at "zero" */
for(ii=0;ii<nnodes1;ii++) isamp1[ii]+=zero1;
//TEST: for(ii=0;ii<nnodes1;ii++) fprintf(stderr,"node:%ld\tsamp:%ld\ttime:%.3f\n",ii,isamp1[ii],itime1[ii]);
nnodes2= xf_detectinflect1_f((data2+zero1),(nn-zero1),&isamp2,&isign2,message);
if(nnodes2<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
/* build an inflection-times array: milliseconds, relative to zero */
itime2= malloc(nnodes2*sizeof(*itime2));
if(itime2==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
for(ii=0;ii<nnodes2;ii++) itime2[ii]= (double)isamp2[ii]*sampint;
/* correct the timestamps so they refer to the entire dataset, since detection started at "zero" */
for(ii=0;ii<nnodes2;ii++) isamp2[ii]+= zero1;
//TEST:for(ii=0;ii<nnodes1;ii++) fprintf(stderr,"node:%ld\tsamp:%ld\ttime:%.3f\n",ii,isamp2[ii],itime2[ii]);
nnodes3= xf_detectinflect1_f((data3+zero1),(nn-zero1),&isamp3,&isign3,message);
if(nnodes3<0) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
/* build an inflection-times array: milliseconds, relative to zero */
itime3= malloc(nnodes3*sizeof(*itime3));
if(itime3==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: insufficient memory\n\n",thisprog); exit(1); }
for(ii=0;ii<nnodes3;ii++) itime3[ii]= (double)isamp3[ii]*sampint;
/* correct the timestamps so they refer to the entire dataset, since detection started at "zero" */
for(ii=0;ii<nnodes3;ii++) isamp3[ii]+= zero1;
//TEST: for(ii=0;ii<nnodes3;ii++) fprintf(stderr,"node:%ld\tsamp:%ld\ttime:%.3f\n",ii,isamp3[ii],itime3[ii]);
/********************************************************************************
DETECT STIMULATION-ARTEFACT (A1,A2, <setmax1)
- based on data1
- look for last positivity before setmax1, then look back for preceding negativity
- if the positivity is the first node, take the negativity as time zero
********************************************************************************/
/* INITIALIZE VARIABLES TO "INVALID" */
sampA1=sampA2=sampF1=sampF2=-1;
timeA1=NAN; timeA2=NAN;
valueA1=NAN; valueA2=NAN;
/* DEFINE THE ARTEFACT START (A1, negative) AND STOP (A2, positive) */
jj=0;
for(ii=0;ii<nnodes1;ii++) {
if(itime1[ii]<setmax1 && isign1[ii]>0) {
/* set sample-numbers and times for (A)rtefact */
if(ii>0) {
timeA1= itime1[ii-1];
sampA1= isamp1[ii-1];
}
/* if the positivity is the first inflection, take the negativity as time zero */
else {
timeA1= 0.0;
sampA1= 0;
}
valueA1= data1[sampA1];
timeA2= itime1[ii];
sampA2= isamp1[ii];
valueA2= data1[sampA2];
jj++;
}}
if(jj==0) {
fprintf(stderr,"--- Warning [%s]: no artefact positivity before %gms in %s\n",thisprog,setmax1,infile);
}
//TEST: fprintf(stderr,"timeA1:%g sampA1:%ld valueA1:%g\n",timeA1,sampA1,valueA1);
//TEST: fprintf(stderr,"timeA2:%g sampA2:%ld valueA2:%g\n",timeA2,sampA2,valueA2);
/********************************************************************************
DETECT FIBRE-VOLLEY (F1,F2) BETWEEN MAX1 AND MAX2
- based on data2
- allow detection of multiple events as a precaution against really noisy data
- detect last positivity in acceptable region, take preceding negativity as actual FV
- define time and value for slope-reference (sampF2 valueF2)
- if there is no fibre volley...
- slope-reference value = mean of data2 values between setmax1 and setmax2
- slope-reference time = mid-point between setmax1 and setmax2
********************************************************************************/
/* INITIALIZE VARIABLES TO "INVALID" */
timeF1= timeF2= NAN;
valueF1= valueF2= NAN;
/* SCAN NODES FOR LAST POSITIVITY - FV POSITIVITY IS THE NEXT SAMPLE */
// jj= inflection count, kk= sample-number
//TEST:for(ii=1;ii<nnodes2;ii++) fprintf(stderr,"%g\n",itime2[ii]);
jj= kk= 0;
for(ii=1;ii<nnodes2;ii++) {
if(isign2[ii]>0 && itime2[ii]>setmax1 && itime2[ii]<setmax2) {
if(jj==0) ifirst= ii;
kk= ii;
jj++;
}}
/* if at least one positive inflection was detected... */
if(jj>0) {
if(setpos==1) kk= ifirst; /* move pointer to first or last inflection depending on options */
if(jj>1) {
if(setpos==1) fprintf(stderr,"--- Warning [%s]: %ld potential FVs in %s - taking the first %.2f-%.2f ms)\n",thisprog,jj,infile,itime2[kk-1],itime2[kk]);
if(setpos==2) fprintf(stderr,"--- Warning [%s]: %ld potential FVs in %s - taking the last %.2f-%.2f ms)\n",thisprog,jj,infile,itime2[kk-1],itime2[kk]);
}
timeF1= itime2[kk-1];
sampF1= isamp2[kk-1];
valueF1= data2[sampF1];
timeF2= itime2[kk];
sampF2= isamp2[kk];
valueF2= data2[sampF2];
}
/* ALTERNATIVELY, DETECT LAST NEGATIVE INFLECTION - FV POSITIVITY IS THE NEXT SAMPLE */
else {
mm= nnodes2-1;
jj= kk= 0;
for(ii=0;ii<mm;ii++) {
if(isign2[ii]<0 && itime2[ii]>setmax1 && itime2[ii]<setmax2) {
if(jj==0) ifirst= ii;
kk= ii;
jj++;
}}
if(jj>0) {
if(setpos==1) kk= ifirst; /* move pointer to first or last inflection depending on options */
if(jj>1) {
if(setpos==1) fprintf(stderr,"--- Warning [%s]: %ld potential FVs in %s - taking the first %.2f-%.2f ms)\n",thisprog,jj,infile,itime2[kk-1],itime2[kk]);
if(setpos==2) fprintf(stderr,"--- Warning [%s]: %ld potential FVs in %s - taking the last %.2f-%.2f ms)\n",thisprog,jj,infile,itime2[kk-1],itime2[kk]);
}
timeF1= itime2[kk];
sampF1= isamp2[kk];
valueF1= data2[sampF1];
timeF2= itime2[kk+1];
sampF2= isamp2[kk+1];
valueF2= data2[sampF2];
}
}
//TEST: fprintf(stderr,"actual %ld, max %ld\n",(sampF2-sampF1),(fvmaxdur));
/* IF NEITHER A NEGATIVE NOR POSITIVE INFLECTION WAS DETECTED, IMPROVISE! */
if(jj==0 || (sampF2-sampF1) > fvmaxdur) {
fprintf(stderr,"--- Warning [%s]: no fibre-volley found between %gms and %gms in %s\n",thisprog,setmax1,setmax2,infile);
aa= (setmax1+setmax2)/ 2000.0; // midpoint between max1 and max2, converted to seconds
sampF1= sampF2= zero1 + (long)(aa * samprate); // convert midpoint to samples, add zero offset
valueF1= NAN; // invalidate fibre-volley amplitude
valueF2= data2[sampF2]; // store value for slope
timeF1= timeF2= NAN;
}
//TEST: fprintf(stderr,"timeF1:%g sampF1:%ld valueF1:%g\n",timeF1,sampF1,valueF1);
//TEST: fprintf(stderr,"timeF2:%g sampF2:%ld valueF2:%g\n",timeF2,sampF2,valueF2);
/********************************************************************************
DETECT FIELD-EPSP MINIMUM (E1), BETWEEN STETMAX2 AND SETMAX3
- based on data3 (except for quality, which is based on data2)
********************************************************************************/
/* INITIALIZE VARIABLES TO "INVALID" */
sampE1=sampE2= -1;
timeE1=valueE1=errE1= NAN;
/* CALCULATE THE QUALITY, AS MEAN-ABSOLUTE-ERROR (data2-data3) BETWEEN setmax2 AND setmax3 */
ii= (long)(samprate * ((baseline+setmax2)/1000.0));
jj= (long)(samprate * ((baseline+setmax3)/1000.0));
kk= jj-ii;
mae= xf_mae1_f((data2+ii),(data3+ii),kk,message);
if(!isfinite(mae)) { fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message); exit(1); }
/* SCAN FOR fEPSP MINIMUM (E1) BETWEEN SETMAX2 AND SETMAX3 - OUTSIDE RANGE OF FIBRE-VOLLEY */
jj= kk= 0; // jj= counter, kk= node-number of minimum
aa= DBL_MAX; // value of minimum
for(ii=0;ii<nnodes3;ii++) {
if(isign3[ii]==-1 && itime3[ii]>=setmax2 && itime3[ii]<=setmax3) {
bb= data3[isamp3[ii]];
if(bb<aa) { aa= bb; kk= ii; jj++; }
break;
}
}
if(jj>0) {
timeE1= itime3[kk];
sampE1= isamp3[kk];
valueE1= data3[sampE1];
errE1= mae;
}
else { fprintf(stderr,"--- Warning [%s]: no fEPSP minimum found between %gms and %gms in %s\n",thisprog,setmax2,setmax3,infile); }
//TEST: fprintf(stderr,"timeE1:%g sampE1:%ld valueE1:%g\n",timeE1,sampE1,valueE1);
/********************************************************************************
CALCULATE THE fEPSP SLOPE
- use the highly filtered data (data3)
- but feature times from more gently filtered data
********************************************************************************/
/* - note that scanning starts from sampF2 */
timeE2=valueE2= NAN;
slopemin= slopemax= NAN;
if(sampE1>0) {
if(valueE1>valueA2) fprintf(stderr,"--- Warning [%s]: fEPSP minimum is higher than artefact positivity in %s\n",thisprog,infile);
/* set pointer to appropriately filtered data */
dataslope= data2;
/* define 0.5 ms sliding window to use for slope calculation */
slopewin= (long)(0.5/sampint);
/* determine the temporal mid-point between the FV positivity and the EPSP minimum */
sampE2= (sampF2+sampE1)/2;
timeE2= (sampE2-zero1)*sampint;
valueE2= dataslope[sampE2];
/* set the size of the slope-scan region */
mm= (sampE1-sampF2)+1;
/* analyze the slope */
/* note: do not exit on error - for this function it just means the data is too short or contains invalid values */
jj= xf_geom_slope2_f((dataslope+sampF2),mm,slopewin,sampint,0,&slopemin,&slopemax,message);
if(jj<0) {
fprintf(stderr,"\n\t--- %s/%s\n\n",thisprog,message);
}
}
/* TEST
fprintf(stderr,"sampA1=%ld = %gms\n",sampA1,timeA1);
fprintf(stderr,"sampA2=%ld = %gms\n",sampA2,timeA2);
fprintf(stderr,"sampF1=%ld = %gms\n",sampF1,timeF1);
fprintf(stderr,"sampF2=%ld = %gms\n",sampF2,timeF2);
fprintf(stderr,"sampE1=%ld = %gms\n",sampE1,timeE1);
*/
/********************************************************************************/
/* OUTPUT THE DATA */
/********************************************************************************/
/* WRITE THE TRACE */
if((fpout=fopen(outfile1,"w"))==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: could not open file %s for writing\n\n",thisprog,outfile1); exit(1); }
jj= -zero1;
fprintf(fpout,"ms mV\n");
if(setfiltout==0) for(ii=0;ii<nn;ii++) { aa= jj*sampint; fprintf(fpout,"%.3f\t%g\n",aa,data0[ii]); jj++; }
if(setfiltout==1) for(ii=0;ii<nn;ii++) { aa= jj*sampint; fprintf(fpout,"%.3f\t%g\n",aa,data1[ii]); jj++; }
if(setfiltout==2) for(ii=0;ii<nn;ii++) { aa= jj*sampint; fprintf(fpout,"%.3f\t%g\n",aa,data2[ii]); jj++; }
if(setfiltout==3) for(ii=0;ii<nn;ii++) { aa= jj*sampint; fprintf(fpout,"%.3f\t%g\n",aa,data3[ii]); jj++; }
fclose(fpout);
/* WRITE THE NODES */
if((fpout=fopen(outfile2,"w"))==NULL) { fprintf(stderr,"\b\n\t--- Error [%s]: could not open file %s for writing\n\n",thisprog,outfile2); exit(1); }
fprintf(fpout,"node colour ms mV\n");
fprintf(fpout,"A1 1 %g %g\n",timeA1,valueA1);
fprintf(fpout,"A2 1 %g %g\n",timeA2,valueA2);
fprintf(fpout,"F1 2 %g %g\n",timeF1,valueF1);
fprintf(fpout,"F2 2 %g %g\n",timeF2,valueF2);
fprintf(fpout,"E1 3 %g %g\n",timeE1,valueE1);
fprintf(fpout,"E2 3 %g %g\n",timeE2,valueE2);
if(! isfinite(timeF2)) {
fprintf(fpout,"Fest 10 %gzero1= %g\n",((double)(sampF2-zero1)*sampint),valueF2);
}
fclose(fpout);
/* WRITE THE SUMMARY */
printf("artmv fvms fvmv epspms epspmv epspslope epsperr\n");
printf("%.3f %.3f %.3f %.3f %.3f %.3f %.3f\n",valueA1,timeF1,valueF1,timeE1,valueE1,slopemin,errE1);
/********************************************************************************/
/* FREE MEMORY AND EXIT */
/********************************************************************************/
if(data0!=NULL) free(data0);
if(data1!=NULL) free(data1);
if(data2!=NULL) free(data2);
if(data3!=NULL) free(data3);
if(isamp1!=NULL) free(isamp1);
if(isamp2!=NULL) free(isamp2);
if(isamp3!=NULL) free(isamp3);
if(isign1!=NULL) free(isign1);
if(isign2!=NULL) free(isign2);
if(isign3!=NULL) free(isign3);
if(itime1!=NULL) free(itime1);
if(itime2!=NULL) free(itime2);
if(itime3!=NULL) free(itime3);
exit(0);
}
|
the_stack_data/60145.c
|
//Classification: #intrinsic/n/IVO/STR/dA/strcpy/lc/rp
//Written by: Igor Eremeev
//Reviewed by: Sergey Pomelov
//Comment: using not terminated string
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
char *str1, str2[50];
int i;
str1 = (char*)malloc(sizeof(char[50]));
if (str1 == 0) {
return 1;
}
for (i=0; i<=10; i++) {
str1[i]='a'+i;
}
strcpy(str2, str1);
printf("%s", str2);
free(str1);
return 0;
}
|
the_stack_data/122015789.c
|
/* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern void signal(int sig , void *func ) ;
extern float strtof(char const *str , char const *endptr ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned short input[1] , unsigned short output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
void RandomFunc(unsigned short input[1] , unsigned short output[1] )
{
unsigned short state[1] ;
unsigned short local1 ;
char copy11 ;
char copy12 ;
{
state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
local1 = 0UL;
while (local1 < (unsigned short)0) {
if (state[0UL] < local1) {
copy11 = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = copy11;
state[0UL] = state[local1] * state[local1];
} else {
state[0UL] *= state[0UL];
copy12 = *((char *)(& state[0UL]) + 1);
*((char *)(& state[0UL]) + 1) = *((char *)(& state[0UL]) + 0);
*((char *)(& state[0UL]) + 0) = copy12;
}
local1 += 2UL;
}
output[0UL] = state[0UL] * 943156777UL + (unsigned short)50010;
}
}
void megaInit(void)
{
{
}
}
int main(int argc , char *argv[] )
{
unsigned short input[1] ;
unsigned short output[1] ;
int randomFuns_i5 ;
unsigned short randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned short )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == (unsigned short)31026) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
|
the_stack_data/154830219.c
|
/*
// Copyright (c) 2016-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#ifdef OC_SECURITY
#include "oc_svr.h"
#include "oc_acl_internal.h"
#include "oc_api.h"
#include "oc_core_res.h"
#include "oc_cred_internal.h"
#include "oc_csr.h"
#include "oc_doxm.h"
#include "oc_pstat.h"
#include "oc_ri.h"
#include "oc_sp.h"
#include "port/oc_log.h"
void
oc_sec_create_svr(void)
{
oc_sec_doxm_init();
oc_sec_pstat_init();
oc_sec_cred_init();
oc_sec_acl_init();
oc_sec_sp_init();
size_t i;
for (i = 0; i < oc_core_get_num_devices(); i++) {
oc_core_populate_resource(OCF_SEC_DOXM, i, "/oic/sec/doxm", OC_IF_BASELINE,
OC_IF_BASELINE, OC_DISCOVERABLE, get_doxm, 0,
post_doxm, 0, 1, "oic.r.doxm");
oc_core_populate_resource(OCF_SEC_PSTAT, i, "/oic/sec/pstat",
OC_IF_BASELINE, OC_IF_BASELINE,
OC_DISCOVERABLE | OC_OBSERVABLE, get_pstat, 0,
post_pstat, 0, 1, "oic.r.pstat");
oc_core_populate_resource(OCF_SEC_ACL, i, "/oic/sec/acl2", OC_IF_BASELINE,
OC_IF_BASELINE, OC_DISCOVERABLE | OC_SECURE,
get_acl, 0, post_acl, delete_acl, 1,
"oic.r.acl2");
oc_core_populate_resource(OCF_SEC_CRED, i, "/oic/sec/cred", OC_IF_BASELINE,
OC_IF_BASELINE, OC_DISCOVERABLE | OC_SECURE,
get_cred, 0, post_cred, delete_cred, 1,
"oic.r.cred");
oc_core_populate_resource(OCF_SEC_SP, i, "/oic/sec/sp", OC_IF_BASELINE,
OC_IF_BASELINE, OC_DISCOVERABLE | OC_SECURE,
get_sp, 0, post_sp, 0, 1, "oic.r.sp");
#ifdef OC_PKI
oc_core_populate_resource(OCF_SEC_CSR, i, "/oic/sec/csr", OC_IF_BASELINE,
OC_IF_BASELINE, OC_DISCOVERABLE | OC_SECURE,
get_csr, 0, 0, 0, 1, "oic.r.csr");
oc_core_populate_resource(OCF_SEC_ROLES, i, "/oic/sec/roles",
OC_IF_BASELINE, OC_IF_BASELINE,
OC_DISCOVERABLE | OC_SECURE, get_cred, 0,
post_cred, delete_cred, 1, "oic.r.roles");
#endif /* OC_PKI */
}
}
#endif /* OC_SECURITY */
|
the_stack_data/151176.c
|
// 6 kyu
// Triangle type
// 0 : err
// 1 : acute
// 2 : right
// 3 : obtuse
int
triangleType(int a, int b, int c)
{
int temp;
if (c < a) {
temp = c;
c = a;
a = temp;
};
if (c < b) {
temp = c;
c = b;
b = temp;
};
temp = a * a + b * b;
if ((a + b) <= c)
return 0;
else if (c * c > temp)
return 3;
else if (c * c < temp)
return 1;
else
return 2;
}
|
the_stack_data/125140697.c
|
#include <stdio.h>
#include <stdlib.h>
//OK
void hanoi(int n, char x, char y, char z) {
/* mova n discos do pino a para o pino b usando
o pino c como intermediario */
if ( n == 1 )
printf("mova disco %d de %c para %c\n", n, x, y);
else {
hanoi ( n - 1, x, z, y ); // H1
printf ("mova disco %d de %c para %c\n", n, x, y);
hanoi ( n - 1, z, y, x ); // H2
}
}
int main( void ) {
int numDiscos = 0;
printf("Digite a quantidade de blocos a mover do pino A para o C: ");
scanf ("%d", &numDiscos);
hanoi (numDiscos, 'A', 'B', 'C');
return ( EXIT_SUCCESS );
}
|
the_stack_data/1109669.c
|
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
* Description: Definition of source file for generating bytecode.
* Create: 2020/09/07
*/
#ifdef JERRY_FOR_IAR_CONFIG
#include "generate-bytecode.h"
#include <string.h>
#include "config-gt.h"
#include "config-jupiter.h"
#define VERSION_LEN 30
#define ONETIME_MAX_OPTBYTES 4096 // max size for reading and writing at onetime
// jerry version code
char version_str[VERSION_LEN];
// secure functions
extern int memset_s(void *dest, size_t destMax, int c, size_t count);
extern int strcpy_s(char *strDest, size_t destMax, const char *strSrc);
extern int strcat_s(char *strDest, size_t destMax, const char *strSrc);
extern int strncat_s(char *strDest, size_t destMax, const char *strSrc, size_t count);
extern int sprintf_s(char *strDest, size_t destMax, const char *format, ...);
extern int strncpy_s(char *strDest, size_t destMax, const char *strSrc, size_t count);
#ifdef JERRY_IAR_JUPITER
extern uint8_t* input_buffer;
extern uint8_t* snapshot_buffer;
#endif // JERRY_IAR_JUPITER
/**
* jerry snapshot format version
*/
char* get_jerry_version_no() {
if (sprintf_s(version_str, sizeof(version_str),
"JERRY_SNAPSHOT_VERSION_%u", JERRY_SNAPSHOT_VERSION) < 0) {
return NULL;
}
return version_str;
} /* get_jerry_version_no */
/**
* splice path and filename
*/
char* splice_path(char* str1, char* str2) {
int len1 = strlen(str1);
int len2 = strlen(str2);
int res_len = len1 + len2 + 1; // str1 + "/" + str2
char* res = (char*)OhosMalloc(MEM_TYPE_JERRY, (res_len + 1) * sizeof(char));
if (res == NULL) {
return NULL;
}
if (memset_s(res, res_len + 1, 0, res_len + 1) != 0) {
OhosFree(res);
res = NULL;
return NULL;
}
if (strcpy_s(res, len1 + 1, str1) != 0) {
OhosFree(res);
res = NULL;
return NULL;
}
if ((strcat_s(res, len1 + strlen("/") + 1, "/") != 0)
|| (strcat_s(res, res_len + 1, str2) != 0)) {
OhosFree(res);
res = NULL;
return NULL;
}
return res;
} /* splice_path */
/**
* judge if is template(js/bc) file
*/
bool is_template_file(char* filename, char* template) {
const char* pFile;
pFile = strrchr(filename, '.');
if ((pFile != NULL) && (strcmp(pFile, template) == 0)) {
return true;
}
return false;
} /* is_template_file */
/**
* get output snapshot file absolutely path
*/
char* get_output_file_path(char* input_file_path) {
int len = strlen(input_file_path);
char* output_file_path = (char*)OhosMalloc(MEM_TYPE_JERRY, (len + 1) * sizeof(char));
if (output_file_path == NULL) {
return NULL;
}
if (memset_s(output_file_path, len + 1, 0, len + 1) != 0) {
OhosFree(output_file_path);
output_file_path = NULL;
return NULL;
}
if (strncpy_s(output_file_path, len, input_file_path, len - strlen(".js")) != 0) {
OhosFree(output_file_path);
output_file_path = NULL;
return NULL;
}
output_file_path[len-3] = '.';
output_file_path[len-2] = 'b';
output_file_path[len-1] = 'c';
output_file_path[len] = '\0';
return output_file_path;
} /* get_output_file_path */
/**
* read js bundle file by Fragement
*/
EXECRES read_js_file(char* filename, uint8_t* target_Js, int* file_bytesize) {
int fd = 0;
struct stat file_stat = { 0 };
int remain_to_read = 0;
int here_to_read = 0;
int tmp_read = 0;
int read_offset = 0;
fd = open(filename, O_RDONLY, S_IREAD);
if (fd < 0) {
// Error: failed to open file
return EXCE_ACE_JERRY_OPEN_FILE_FAILED;
}
if (fstat(fd, &file_stat) < 0) {
close(fd);
return EXCE_ACE_JERRY_GET_FILE_STAT_ERROR;
}
*file_bytesize = file_stat.st_size;
if (*file_bytesize > INPUTJS_BUFFER_SIZE) {
close(fd);
return EXCE_ACE_JERRY_JSFILE_TOO_LARGE;
}
remain_to_read = *file_bytesize;
while (remain_to_read > 0) {
here_to_read = (remain_to_read > ONETIME_MAX_OPTBYTES) ?
ONETIME_MAX_OPTBYTES : remain_to_read;
tmp_read = read(fd, target_Js + read_offset, here_to_read);
if (tmp_read < 0 || tmp_read != here_to_read) {
close(fd);
// Error: failed to read file
return EXCE_ACE_JERRY_READ_JSFILE_FAILED;
}
read_offset = read_offset + here_to_read;
remain_to_read = remain_to_read - here_to_read;
}
if (read_offset != *file_bytesize) {
close(fd);
// Error: failed to successfully read file
return EXCE_ACE_JERRY_READ_JSFILE_FAILED;
}
close(fd);
return EXCE_ACE_JERRY_EXEC_OK;
} /* read_js_file */
/**
* write snapshot file by Fragment
*/
EXECRES write_snapshot(char* output_file_name_path, size_t snapshot_size) {
int fd = 0;
int res = 0;
int remain_to_write = 0;
int here_to_write = 0;
int write_offset = 0;
fd = open(output_file_name_path, O_RDWR | O_CREAT, S_IREAD | S_IWRITE);
if (fd < 0) {
// Error: Unable to open snapshot file
return EXCE_ACE_JERRY_OPEN_FILE_FAILED;
}
remain_to_write = snapshot_size;
while (remain_to_write > 0) {
here_to_write = (remain_to_write > ONETIME_MAX_OPTBYTES) ?
ONETIME_MAX_OPTBYTES : remain_to_write;
res = write(fd, snapshot_buffer + write_offset, here_to_write);
if (res <= 0 || res != here_to_write) {
close(fd);
// Error: Unable to write snapshot file
return EXCE_ACE_JERRY_WRITE_SNAPSHOT_FILE_FAILED;
}
write_offset = write_offset + here_to_write;
remain_to_write = remain_to_write - here_to_write;
}
if (write_offset != snapshot_size) {
close(fd);
// Error: Unable to successfully write snapshot file
return EXCE_ACE_JERRY_WRITE_SNAPSHOT_FILE_FAILED;
}
close(fd);
return EXCE_ACE_JERRY_EXEC_OK;
} /* write_snapshot */
/**
* struct for Directory Node
*/
typedef struct Node {
char* dir_name;
struct Node* next;
} dir_node;
/**
* free the memory for linkedlist
*/
void free_link(dir_node* head) {
dir_node* tmp = NULL;
while (head != NULL) {
tmp = head;
head = head->next;
if (tmp->dir_name != NULL) {
OhosFree(tmp->dir_name);
tmp->dir_name = NULL;
}
OhosFree(tmp);
tmp = NULL;
}
} /* free_link */
/**
* generate snapshot file
*/
EXECRES generate_snapshot_file(char* input_file, char* output_file) {
uint8_t* target_Js = input_buffer;
jerry_value_t generate_result;
size_t snapshot_size = 0;
EXECRES write_res = EXCE_ACE_JERRY_EXEC_OK;
bool convert_state = false;
int file_bytesize = 0;
EXECRES read_res = EXCE_ACE_JERRY_EXEC_OK;
if (input_file == NULL || output_file == NULL) {
return EXCE_ACE_JERRY_NULL_PATH;
}
read_res = read_js_file(input_file, target_Js, &file_bytesize);
if (read_res != EXCE_ACE_JERRY_EXEC_OK) {
return read_res;
}
generate_result = jerry_generate_snapshot (
NULL,
0,
target_Js,
file_bytesize,
0,
(uint32_t* )snapshot_buffer,
SNAPSHOT_BUFFER_SIZE);
convert_state = jerry_value_is_error(generate_result)
|| !jerry_value_is_number(generate_result);
if (convert_state) {
// Error: Generating snapshot failed
jerry_release_value(generate_result);
return EXCE_ACE_JERRY_GENERATE_SNAPSHOT_FAILED;
}
snapshot_size = (size_t)jerry_get_number_value(generate_result);
jerry_release_value(generate_result);
write_res = write_snapshot(output_file, snapshot_size);
if (write_res != EXCE_ACE_JERRY_EXEC_OK) {
// Error: Writing snapshot file failed
return write_res;
}
return EXCE_ACE_JERRY_EXEC_OK;
}/* generate_snapshot_file */
/**
* traverse directory and do js to bytecode conversion ON IAR
*/
EXECRES walk_directory(char* filefolder) {
EXECRES generate_val = EXCE_ACE_JERRY_EXEC_OK;
DIR* dir;
struct dirent* direntp;
struct stat file_stat = { 0 };
char* filename = NULL;
char* current_path = NULL;
char* input_file_path = NULL;
char* output_file_path = NULL;
char* start_folder = NULL;
dir_node *head, *curr, *end, *new_node;
int filefolder_len = strlen(filefolder) + 1;
if ((filefolder == NULL) || (stat(filefolder, &file_stat) < 0)) {
return EXCE_ACE_JERRY_INPUT_PATH_ERROR;
}
if ((start_folder = (char*)OhosMalloc(MEM_TYPE_JERRY, filefolder_len)) == NULL) {
return EXEC_ACE_JERRY_MALLOC_ERROR;
}
if (strcpy_s(start_folder, filefolder_len, filefolder) != 0) {
OhosFree(start_folder);
start_folder = NULL;
return EXCE_ACE_JERRY_INPUT_PATH_ERROR;
}
if ((head = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
OhosFree(start_folder);
start_folder = NULL;
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
if ((end = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
OhosFree(start_folder);
start_folder = NULL;
OhosFree(head);
head = NULL;
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
head->dir_name = NULL;
head->next = end;
end->dir_name = start_folder;
end->next = NULL;
jerry_init_flag_t flags = JERRY_INIT_EMPTY;
jerry_init (flags);
while (head->next != NULL) {
curr = head->next;
current_path = curr->dir_name;
if ((dir = (DIR*)opendir(current_path)) == NULL) {
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_OPEN_DIR_FAILED;
}
while ((direntp = (struct dirent*)readdir(dir)) != NULL) {
filename = direntp->d_name;
if (strncmp(filename, ".", 1) == 0) {
continue;
}
if ((input_file_path = splice_path(current_path, filename)) == NULL) {
closedir(dir);
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_SPLICE_PATH_ERROR;
}
if (stat(input_file_path, &file_stat) < 0) {
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_GET_FILE_STAT_ERROR;
}
if (file_stat.st_mode & S_IFDIR) {
// file now is file folder
if ((new_node = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
// input_file_path for dir will be freed when that node is freed
new_node->dir_name = input_file_path;
new_node->next = NULL;
end->next = new_node;
end = new_node;
new_node = NULL;
} else if (is_template_file(filename, ".js")) {
//filename now is .js file
if ((output_file_path = get_output_file_path(input_file_path)) == NULL) {
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_SPLICE_OUTPUT_PATH_ERROR;
}
generate_val = generate_snapshot_file(input_file_path, output_file_path);
OhosFree(output_file_path);
output_file_path = NULL;
OhosFree(input_file_path);
input_file_path = NULL;
if (generate_val != EXCE_ACE_JERRY_EXEC_OK) {
closedir(dir);
free_link(head);
curr = NULL;
end = NULL;
jerry_cleanup();
return generate_val; // return error_code
}
} else {
OhosFree(input_file_path);
input_file_path = NULL;
}
}
closedir(dir);
head->next = curr->next;
OhosFree(curr->dir_name);
curr->dir_name = NULL;
OhosFree(curr);
curr = NULL;
}
OhosFree(head);
head = NULL;
end = NULL;
jerry_cleanup();
return EXCE_ACE_JERRY_EXEC_OK;
} /* walk_directory */
/**
* when convertion failed, traverse directory and delete all created bytecode files
*/
EXECRES walk_del_bytecode(char* filefolder) {
DIR* dir;
struct dirent* direntp;
struct stat file_stat = { 0 };
char* filename = NULL;
char* current_path = NULL;
char* input_file_path = NULL;
char* start_folder = NULL;
dir_node *head, *curr, *end, *new_node;
int filefolder_len = strlen(filefolder) + 1;
if ((filefolder == NULL) || (stat(filefolder, &file_stat) < 0)) {
return EXCE_ACE_JERRY_INPUT_PATH_ERROR;
}
if ((start_folder = (char*)OhosMalloc(MEM_TYPE_JERRY, filefolder_len)) == NULL) {
return EXEC_ACE_JERRY_MALLOC_ERROR;
}
if (strcpy_s(start_folder, filefolder_len, filefolder) != 0) {
OhosFree(start_folder);
start_folder = NULL;
return EXCE_ACE_JERRY_INPUT_PATH_ERROR;
}
if ((head = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
OhosFree(start_folder);
start_folder = NULL;
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
if ((end = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
OhosFree(start_folder);
start_folder = NULL;
OhosFree(head);
head = NULL;
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
head->dir_name = NULL;
head->next = end;
end->dir_name = start_folder;
end->next = NULL;
while (head->next != NULL) {
curr = head->next;
current_path = curr->dir_name;
if ((dir = (DIR*)opendir(current_path)) == NULL) {
free_link(head);
curr = NULL;
end = NULL;
return EXCE_ACE_JERRY_OPEN_DIR_FAILED;
}
while ((direntp = (struct dirent*)readdir(dir)) != NULL) {
filename = direntp->d_name;
if (strncmp(filename, ".", 1) == 0) {
continue;
}
if ((input_file_path = splice_path(current_path, filename)) == NULL) {
closedir(dir);
free_link(head);
curr = NULL;
end = NULL;
return EXCE_ACE_JERRY_SPLICE_PATH_ERROR;
}
if (stat(input_file_path, &file_stat) < 0) {
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
return EXCE_ACE_JERRY_GET_FILE_STAT_ERROR;
}
if (file_stat.st_mode & S_IFDIR) {
// file now is file folder
if ((new_node = (dir_node*)OhosMalloc(MEM_TYPE_JERRY, sizeof(dir_node))) == NULL) {
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
return EXCE_ACE_JERRY_LINKLIST_ERROR;
}
// input_file_path for dir will be freed when that node is freed
new_node->dir_name = input_file_path;
new_node->next = NULL;
end->next = new_node;
end = new_node;
new_node = NULL;
} else if ((is_template_file(filename, ".bc")) && (unlink(input_file_path) != F_OK)) {
//file now is .bc file and unlink file failed
closedir(dir);
OhosFree(input_file_path);
input_file_path = NULL;
free_link(head);
curr = NULL;
end = NULL;
return EXEC_ACE_JERRY_UNLINKFILE_ERROR;
} else {
OhosFree(input_file_path);
input_file_path = NULL;
}
}
closedir(dir);
head->next = curr->next;
OhosFree(curr->dir_name);
curr->dir_name = NULL;
OhosFree(curr);
curr = NULL;
}
OhosFree(head);
head = NULL;
end = NULL;
return EXCE_ACE_JERRY_EXEC_OK;
} /* walk_del_bytecode */
#endif // end JERRY_FOR_IAR_CONFIG
|
the_stack_data/34511976.c
|
/*
* Copyright (C) 2014, Galois, Inc.
* This sotware is distributed under a standard, three-clause BSD license.
* Please see the file LICENSE, distributed with this software, for specific
* terms and conditions.
*/
#include <langinfo.h>
char *nl_langinfo(nl_item item __attribute__((unused)))
{
return "UTF8";
}
|
the_stack_data/29826095.c
|
int addOne(int x)
{
return x+1;
}
|
the_stack_data/76700273.c
|
//Simple static test case for decompilation
int main (void)
{
int a = 1;
int b;
switch (a)
{
case 1:
b = 2;
case 2:
b = 1;
case 3:
b = -6;
case 4:
b = -7;
default:
b = 1024;
}
}
|
the_stack_data/215769230.c
|
#include<stdio.h>
#include<ctype.h>
#include<string.h>
/*
About:
This program takes a contigous string without spaces and tells if it
is a palindrome or not. Uppercase or lowercase doesn't matter.
*/
/*
TEST CASES:
Input: Hello
Output: The entered string is NOT PALINDROME!
Input: NaMan
Output: The entered string is a PALINDROME!
Input: lOL
Output: The entered string is a PALINDROME!
*/
int main() {
char str[100], reversed_str[100], ch;
int str_length, i;
printf("Enter the string: ");
scanf(" %[^\n]%*c", str);
/*
- The [^\n] takes characters until a new line character is entered
- The *c tells scanf to remove the newline character in the end of the entered string
*/
str_length = strlen(str); // The strleng() function returns the length of the string given as parameter
/*This loop converts all the uppercase charaters to lowercase characters*/
while(i < str_length) {
ch = str[i];
str[i] = tolower(ch); // tolower() converts the uppercase character to a lowercase
i++;
}
/*
- The strcpy(str1, str2) function copies the str2 into str1
*/
strcpy(reversed_str, str);
/*
- The strcmp(str1, str2) function compares both the string and return:
- 0 : If both the string match
- >0 : If the first non-matching character in str1 is greater (in ASCII) than that of str2
- <0 : If the first non-matching character in str1 is lower (in ASCII) than that of str2
- The strrev(str) function is defined in string.h and is used to reverse the string
*/
if(strcmp(str, strrev(reversed_str)) == 0) {
printf("\nThe entered string is a PALINDROME!");
} else {
printf("The entered string is NOT PALINDROME!");
}
return 0;
}
|
the_stack_data/379966.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)
*/
/* > \brief \b CPOEQU */
/* =========== DOCUMENTATION =========== */
/* Online html documentation available at */
/* http://www.netlib.org/lapack/explore-html/ */
/* > \htmlonly */
/* > Download CPOEQU + dependencies */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpoequ.
f"> */
/* > [TGZ]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpoequ.
f"> */
/* > [ZIP]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpoequ.
f"> */
/* > [TXT]</a> */
/* > \endhtmlonly */
/* Definition: */
/* =========== */
/* SUBROUTINE CPOEQU( N, A, LDA, S, SCOND, AMAX, INFO ) */
/* INTEGER INFO, LDA, N */
/* REAL AMAX, SCOND */
/* REAL S( * ) */
/* COMPLEX A( LDA, * ) */
/* > \par Purpose: */
/* ============= */
/* > */
/* > \verbatim */
/* > */
/* > CPOEQU computes row and column scalings intended to equilibrate a */
/* > Hermitian positive definite matrix A and reduce its condition number */
/* > (with respect to the two-norm). S contains the scale factors, */
/* > S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with */
/* > elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal. This */
/* > choice of S puts the condition number of B within a factor N of the */
/* > smallest possible condition number over all possible diagonal */
/* > scalings. */
/* > \endverbatim */
/* Arguments: */
/* ========== */
/* > \param[in] N */
/* > \verbatim */
/* > N is INTEGER */
/* > The order of the matrix A. N >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in] A */
/* > \verbatim */
/* > A is COMPLEX array, dimension (LDA,N) */
/* > The N-by-N Hermitian positive definite matrix whose scaling */
/* > factors are to be computed. Only the diagonal elements of A */
/* > are referenced. */
/* > \endverbatim */
/* > */
/* > \param[in] LDA */
/* > \verbatim */
/* > LDA is INTEGER */
/* > The leading dimension of the array A. LDA >= f2cmax(1,N). */
/* > \endverbatim */
/* > */
/* > \param[out] S */
/* > \verbatim */
/* > S is REAL array, dimension (N) */
/* > If INFO = 0, S contains the scale factors for A. */
/* > \endverbatim */
/* > */
/* > \param[out] SCOND */
/* > \verbatim */
/* > SCOND is REAL */
/* > If INFO = 0, S contains the ratio of the smallest S(i) to */
/* > the largest S(i). If SCOND >= 0.1 and AMAX is neither too */
/* > large nor too small, it is not worth scaling by S. */
/* > \endverbatim */
/* > */
/* > \param[out] AMAX */
/* > \verbatim */
/* > AMAX is REAL */
/* > Absolute value of largest matrix element. If AMAX is very */
/* > close to overflow or very close to underflow, the matrix */
/* > should be scaled. */
/* > \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, the i-th diagonal element is nonpositive. */
/* > \endverbatim */
/* Authors: */
/* ======== */
/* > \author Univ. of Tennessee */
/* > \author Univ. of California Berkeley */
/* > \author Univ. of Colorado Denver */
/* > \author NAG Ltd. */
/* > \date December 2016 */
/* > \ingroup complexPOcomputational */
/* ===================================================================== */
/* Subroutine */ int cpoequ_(integer *n, complex *a, integer *lda, real *s,
real *scond, real *amax, integer *info)
{
/* System generated locals */
integer a_dim1, a_offset, i__1, i__2;
real r__1, r__2;
/* Local variables */
real smin;
integer i__;
extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
/* -- LAPACK computational 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..-- */
/* December 2016 */
/* ===================================================================== */
/* Test the input parameters. */
/* Parameter adjustments */
a_dim1 = *lda;
a_offset = 1 + a_dim1 * 1;
a -= a_offset;
--s;
/* Function Body */
*info = 0;
if (*n < 0) {
*info = -1;
} else if (*lda < f2cmax(1,*n)) {
*info = -3;
}
if (*info != 0) {
i__1 = -(*info);
xerbla_("CPOEQU", &i__1, (ftnlen)6);
return 0;
}
/* Quick return if possible */
if (*n == 0) {
*scond = 1.f;
*amax = 0.f;
return 0;
}
/* Find the minimum and maximum diagonal elements. */
i__1 = a_dim1 + 1;
s[1] = a[i__1].r;
smin = s[1];
*amax = s[1];
i__1 = *n;
for (i__ = 2; i__ <= i__1; ++i__) {
i__2 = i__ + i__ * a_dim1;
s[i__] = a[i__2].r;
/* Computing MIN */
r__1 = smin, r__2 = s[i__];
smin = f2cmin(r__1,r__2);
/* Computing MAX */
r__1 = *amax, r__2 = s[i__];
*amax = f2cmax(r__1,r__2);
/* L10: */
}
if (smin <= 0.f) {
/* Find the first non-positive diagonal element and return. */
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
if (s[i__] <= 0.f) {
*info = i__;
return 0;
}
/* L20: */
}
} else {
/* Set the scale factors to the reciprocals */
/* of the diagonal elements. */
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
s[i__] = 1.f / sqrt(s[i__]);
/* L30: */
}
/* Compute SCOND = f2cmin(S(I)) / f2cmax(S(I)) */
*scond = sqrt(smin) / sqrt(*amax);
}
return 0;
/* End of CPOEQU */
} /* cpoequ_ */
|
the_stack_data/18887000.c
|
/* Ngaro VM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 2008 - 2011, Charles Childers
Copyright (c) 2009 - 2010, Luke Parrish
Copyright (c) 2010, Marc Simpson
Copyright (c) 2010, Jay Skeer
Copyright (c) 2011, Kenneth Keating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#include <stdio.h>
//#include <stdlib.h>
#include <time.h>
//#include <unistd.h>
//#include <string.h>
/* Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------+---------+---------+
| 16 bit | 32 bit | 64 bit |
+------------+---------+---------+---------+
| IMAGE_SIZE | 32000 | 1000000 | 1000000 |
+------------+---------+---------+---------+
| CELL | int16_t | int32_t | int64_t |
+------------+---------+---------+---------+
If memory is tight, cut the MAX_FILE_NAME and MAX_REQUEST_LENGTH.
You can also cut the ADDRESSES stack size down, but if you have
heavy nesting or recursion this may cause problems. If you do modify
it and experience odd problems, try raising it a bit higher.
Use -DRX16 to select defaults for 16-bit, or -DRX64 to select the
defaults for 64-bit. Without these, the compiler will generate a
standard 32-bit VM.
Use -DRXBE to enable the BE suffix for big endian images. This is
only useful on big endian systems.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#define CELL int//int32_t
#define IMAGE_SIZE 1000000
#define ADDRESSES 1024
#define STACK_DEPTH 128
#define PORTS 12
#define MAX_FILE_NAME 1024
#define MAX_REQUEST_LENGTH 1024
#define MAX_OPEN_FILES 8
#define LOCAL "retroImage"
#define CELLSIZE 32
#ifdef RX64
#undef CELL
#undef CELLSIZE
#undef LOCAL
#define CELL int64_t
#define CELLSIZE 64
#define LOCAL "retroImage64"
#endif
#ifdef RX16
#undef CELL
#undef CELLSIZE
#undef LOCAL
#undef IMAGE_SIZE
#define CELL int16_t
#define CELLSIZE 16
#define IMAGE_SIZE 32000
#define LOCAL "retroImage16"
#endif
#ifdef RXBE
#define LOCAL_FNAME (LOCAL "BE")
#define VM_ENDIAN 1
#else
#define LOCAL_FNAME (LOCAL)
#define VM_ENDIAN 0
#endif
enum vm_opcode {VM_NOP, VM_LIT, VM_DUP, VM_DROP, VM_SWAP, VM_PUSH, VM_POP,
VM_LOOP, VM_JUMP, VM_RETURN, VM_GT_JUMP, VM_LT_JUMP,
VM_NE_JUMP,VM_EQ_JUMP, VM_FETCH, VM_STORE, VM_ADD,
VM_SUB, VM_MUL, VM_DIVMOD, VM_AND, VM_OR, VM_XOR, VM_SHL,
VM_SHR, VM_ZERO_EXIT, VM_INC, VM_DEC, VM_IN, VM_OUT,
VM_WAIT };
#define NUM_OPS VM_WAIT + 1
typedef struct {
CELL sp, rsp, ip;
CELL data[STACK_DEPTH];
CELL address[ADDRESSES];
CELL ports[PORTS];
FILE *files[MAX_OPEN_FILES];
FILE *input[MAX_OPEN_FILES];
CELL isp;
CELL image[IMAGE_SIZE];
CELL shrink, padding;
int stats[NUM_OPS + 1];
int max_sp, max_rsp;
char filename[MAX_FILE_NAME];
char request[MAX_REQUEST_LENGTH];
} VM;
/* Macros ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#define IP vm->ip
#define SP vm->sp
#define RSP vm->rsp
#define DROP { vm->data[SP] = 0; if (--SP < 0) IP = IMAGE_SIZE; }
#define TOS vm->data[SP]
#define NOS vm->data[SP-1]
#define TORS vm->address[RSP]
/* Helper Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxGetString(VM *vm, int starting)
{
CELL i = 0;
while(vm->image[starting] && i < MAX_REQUEST_LENGTH)
vm->request[i++] = (char)vm->image[starting++];
vm->request[i] = 0;
}
/* Console I/O Support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxWriteConsole(VM *vm, CELL c) {
(c > 0) ? putchar((char)c) : printf("\033[2J\033[1;1H");
/* Erase the previous character if c = backspace */
if (c == 8) {
putchar(32);
putchar(8);
}
}
CELL rxReadConsole(VM *vm) {
CELL c;
if ((c = getc(vm->input[vm->isp])) == EOF && vm->input[vm->isp] != stdin) {
fclose(vm->input[vm->isp--]);
c = 0;
}
if (c == EOF && vm->input[vm->isp] == stdin)
exit(0);
return c;
}
void rxIncludeFile(VM *vm, char *s) {
FILE *file;
if ((file = fopen(s, "r")))
vm->input[++vm->isp] = file;
}
void rxPrepareInput(VM *vm) {
vm->isp = 0;
vm->input[vm->isp] = stdin;
}
void rxPrepareOutput(VM *vm) {
}
void rxRestoreIO(VM *vm) {
}
/* File I/O Support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
CELL rxGetFileHandle(VM *vm)
{
CELL i;
for(i = 1; i < MAX_OPEN_FILES; i++)
if (vm->files[i] == 0)
return i;
return 0;
}
void rxAddInputSource(VM *vm) {
CELL name = TOS; DROP;
rxGetString(vm, name);
rxIncludeFile(vm, vm->request);
}
CELL rxOpenFile(VM *vm) {
CELL slot, mode, name;
slot = rxGetFileHandle(vm);
mode = TOS; DROP;
name = TOS; DROP;
rxGetString(vm, name);
if (slot > 0)
{
if (mode == 0) vm->files[slot] = fopen(vm->request, "rb");
if (mode == 1) vm->files[slot] = fopen(vm->request, "wb");
if (mode == 2) vm->files[slot] = fopen(vm->request, "ab");
if (mode == 3) vm->files[slot] = fopen(vm->request, "rb+");
}
if (vm->files[slot] == NULL)
{
vm->files[slot] = 0;
slot = 0;
}
return slot;
}
CELL rxReadFile(VM *vm) {
CELL c = fgetc(vm->files[TOS]); DROP;
return (c == EOF) ? 0 : c;
}
CELL rxWriteFile(VM *vm) {
CELL slot, c, r;
slot = TOS; DROP;
c = TOS; DROP;
r = fputc(c, vm->files[slot]);
return (r == EOF) ? 0 : 1;
}
CELL rxCloseFile(VM *vm) {
fclose(vm->files[TOS]);
vm->files[TOS] = 0;
DROP;
return 0;
}
CELL rxGetFilePosition(VM *vm) {
CELL slot = TOS; DROP;
return (CELL) ftell(vm->files[slot]);
}
CELL rxSetFilePosition(VM *vm) {
CELL slot, pos, r;
slot = TOS; DROP;
pos = TOS; DROP;
r = fseek(vm->files[slot], pos, SEEK_SET);
return r;
}
CELL rxGetFileSize(VM *vm) {
CELL slot, current, r, size;
slot = TOS; DROP;
current = ftell(vm->files[slot]);
r = fseek(vm->files[slot], 0, SEEK_END);
size = ftell(vm->files[slot]);
fseek(vm->files[slot], current, SEEK_SET);
return (r == 0) ? size : 0;
}
CELL rxDeleteFile(VM *vm) {
CELL name = TOS; DROP;
rxGetString(vm, name);
return (unlink(vm->request) == 0) ? -1 : 0;
}
CELL rxLoadImage(VM *vm, char *image) {
FILE *fp;
CELL x = 0;
if ((fp = fopen(image, "rb")) != NULL) {
x = fread(&vm->image, sizeof(CELL), IMAGE_SIZE, fp);
fclose(fp);
}
else {
printf("Unable to find the retroImage!\n");
exit(1);
}
return x;
}
CELL rxSaveImage(VM *vm, char *image) {
FILE *fp;
CELL x = 0;
if ((fp = fopen(image, "wb")) == NULL)
{
printf("Unable to save the retroImage!\n");
rxRestoreIO(vm);
exit(2);
}
if (vm->shrink == 0)
x = fwrite(&vm->image, sizeof(CELL), IMAGE_SIZE, fp);
else
x = fwrite(&vm->image, sizeof(CELL), vm->image[3], fp);
fclose(fp);
return x;
}
/* Environment Query ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxQueryEnvironment(VM *vm) {
CELL req, dest;
char *r;
req = TOS; DROP;
dest = TOS; DROP;
rxGetString(vm, req);
r = getenv(vm->request);
if (r != 0)
while (*r != '\0')
{
vm->image[dest] = *r;
dest++;
r++;
}
else
vm->image[dest] = 0;
}
/* Device I/O Handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxDeviceHandler(VM *vm) {
if (vm->ports[0] != 1) {
/* Input */
if (vm->ports[0] == 0 && vm->ports[1] == 1) {
vm->ports[1] = rxReadConsole(vm);
vm->ports[0] = 1;
}
/* Output (character generator) */
if (vm->ports[2] == 1) {
rxWriteConsole(vm, TOS); DROP
vm->ports[2] = 0;
vm->ports[0] = 1;
}
/* File IO and Image Saving */
if (vm->ports[4] != 0) {
vm->ports[0] = 1;
switch (vm->ports[4]) {
case 1: rxSaveImage(vm, vm->filename);
vm->ports[4] = 0;
break;
case 2: rxAddInputSource(vm);
vm->ports[4] = 0;
break;
case -1: vm->ports[4] = rxOpenFile(vm);
break;
case -2: vm->ports[4] = rxReadFile(vm);
break;
case -3: vm->ports[4] = rxWriteFile(vm);
break;
case -4: vm->ports[4] = rxCloseFile(vm);
break;
case -5: vm->ports[4] = rxGetFilePosition(vm);
break;
case -6: vm->ports[4] = rxSetFilePosition(vm);
break;
case -7: vm->ports[4] = rxGetFileSize(vm);
break;
case -8: vm->ports[4] = rxDeleteFile(vm);
break;
default: vm->ports[4] = 0;
}
}
/* Capabilities */
if (vm->ports[5] != 0) {
vm->ports[0] = 1;
switch(vm->ports[5]) {
case -1: vm->ports[5] = IMAGE_SIZE;
break;
case -2: vm->ports[5] = 0;
break;
case -3: vm->ports[5] = 0;
break;
case -4: vm->ports[5] = 0;
break;
case -5: vm->ports[5] = SP;
break;
case -6: vm->ports[5] = RSP;
break;
case -7: vm->ports[5] = 0;
break;
case -8: vm->ports[5] = time(NULL);
break;
case -9: vm->ports[5] = 0;
IP = IMAGE_SIZE;
break;
case -10: vm->ports[5] = 0;
rxQueryEnvironment(vm);
break;
case -11: vm->ports[5] = 0;
break;
case -12: vm->ports[5] = 0;
break;
case -13: vm->ports[5] = CELLSIZE;
break;
case -14: vm->ports[5] = VM_ENDIAN;
break;
default: vm->ports[5] = 0;
}
}
}
}
/* The VM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxProcessOpcode(VM *vm) {
CELL a, b, opcode;
opcode = vm->image[IP];
if (opcode > NUM_OPS)
vm->stats[NUM_OPS]++;
else
vm->stats[opcode]++;
switch(opcode) {
case VM_NOP:
break;
case VM_LIT:
SP++;
IP++;
TOS = vm->image[IP];
if (vm->max_sp < SP)
vm->max_sp = SP;
break;
case VM_DUP:
SP++;
vm->data[SP] = NOS;
if (vm->max_sp < SP)
vm->max_sp = SP;
break;
case VM_DROP:
DROP
break;
case VM_SWAP:
a = TOS;
TOS = NOS;
NOS = a;
break;
case VM_PUSH:
RSP++;
TORS = TOS;
DROP
if (vm->max_rsp < RSP)
vm->max_rsp = RSP;
break;
case VM_POP:
SP++;
TOS = TORS;
RSP--;
break;
case VM_LOOP:
TOS--;
IP++;
if (TOS != 0 && TOS > -1)
IP = vm->image[IP] - 1;
else
DROP;
break;
case VM_JUMP:
IP++;
IP = vm->image[IP] - 1;
if (IP < 0)
IP = IMAGE_SIZE;
else {
if (vm->image[IP+1] == 0)
IP++;
if (vm->image[IP+1] == 0)
IP++;
}
break;
case VM_RETURN:
IP = TORS;
RSP--;
if (IP < 0)
IP = IMAGE_SIZE;
else {
if (vm->image[IP+1] == 0)
IP++;
if (vm->image[IP+1] == 0)
IP++;
}
break;
case VM_GT_JUMP:
IP++;
if(NOS > TOS)
IP = vm->image[IP] - 1;
DROP DROP
break;
case VM_LT_JUMP:
IP++;
if(NOS < TOS)
IP = vm->image[IP] - 1;
DROP DROP
break;
case VM_NE_JUMP:
IP++;
if(TOS != NOS)
IP = vm->image[IP] - 1;
DROP DROP
break;
case VM_EQ_JUMP:
IP++;
if(TOS == NOS)
IP = vm->image[IP] - 1;
DROP DROP
break;
case VM_FETCH:
TOS = vm->image[TOS];
break;
case VM_STORE:
vm->image[TOS] = NOS;
DROP DROP
break;
case VM_ADD:
NOS += TOS;
DROP
break;
case VM_SUB:
NOS -= TOS;
DROP
break;
case VM_MUL:
NOS *= TOS;
DROP
break;
case VM_DIVMOD:
a = TOS;
b = NOS;
TOS = b / a;
NOS = b % a;
break;
case VM_AND:
a = TOS;
b = NOS;
DROP
TOS = a & b;
break;
case VM_OR:
a = TOS;
b = NOS;
DROP
TOS = a | b;
break;
case VM_XOR:
a = TOS;
b = NOS;
DROP
TOS = a ^ b;
break;
case VM_SHL:
a = TOS;
b = NOS;
DROP
TOS = b << a;
break;
case VM_SHR:
a = TOS;
DROP
TOS >>= a;
break;
case VM_ZERO_EXIT:
if (TOS == 0) {
DROP
IP = TORS;
RSP--;
}
break;
case VM_INC:
TOS += 1;
break;
case VM_DEC:
TOS -= 1;
break;
case VM_IN:
a = TOS;
TOS = vm->ports[a];
vm->ports[a] = 0;
break;
case VM_OUT:
vm->ports[0] = 0;
vm->ports[TOS] = NOS;
DROP DROP
break;
case VM_WAIT:
rxDeviceHandler(vm);
break;
default:
RSP++;
TORS = IP;
IP = vm->image[IP] - 1;
if (IP < 0)
IP = IMAGE_SIZE;
else {
if (vm->image[IP+1] == 0)
IP++;
if (vm->image[IP+1] == 0)
IP++;
}
if (vm->max_rsp < RSP)
vm->max_rsp = RSP;
break;
}
vm->ports[3] = 1;
}
/* Stats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
void rxDisplayStats(VM *vm)
{
int s, i;
printf("Runtime Statistics\n");
printf("NOP: %d\n", vm->stats[VM_NOP]);
printf("LIT: %d\n", vm->stats[VM_LIT]);
printf("DUP: %d\n", vm->stats[VM_DUP]);
printf("DROP: %d\n", vm->stats[VM_DROP]);
printf("SWAP: %d\n", vm->stats[VM_SWAP]);
printf("PUSH: %d\n", vm->stats[VM_PUSH]);
printf("POP: %d\n", vm->stats[VM_POP]);
printf("LOOP: %d\n", vm->stats[VM_LOOP]);
printf("JUMP: %d\n", vm->stats[VM_JUMP]);
printf("RETURN: %d\n", vm->stats[VM_RETURN]);
printf(">JUMP: %d\n", vm->stats[VM_GT_JUMP]);
printf("<JUMP: %d\n", vm->stats[VM_LT_JUMP]);
printf("!JUMP: %d\n", vm->stats[VM_NE_JUMP]);
printf("=JUMP: %d\n", vm->stats[VM_EQ_JUMP]);
printf("FETCH: %d\n", vm->stats[VM_FETCH]);
printf("STORE: %d\n", vm->stats[VM_STORE]);
printf("ADD: %d\n", vm->stats[VM_ADD]);
printf("SUB: %d\n", vm->stats[VM_SUB]);
printf("MUL: %d\n", vm->stats[VM_MUL]);
printf("DIVMOD: %d\n", vm->stats[VM_DIVMOD]);
printf("AND: %d\n", vm->stats[VM_AND]);
printf("OR: %d\n", vm->stats[VM_OR]);
printf("XOR: %d\n", vm->stats[VM_XOR]);
printf("SHL: %d\n", vm->stats[VM_SHL]);
printf("SHR: %d\n", vm->stats[VM_SHR]);
printf("0;: %d\n", vm->stats[VM_ZERO_EXIT]);
printf("INC: %d\n", vm->stats[VM_INC]);
printf("DEC: %d\n", vm->stats[VM_DEC]);
printf("IN: %d\n", vm->stats[VM_IN]);
printf("OUT: %d\n", vm->stats[VM_OUT]);
printf("WAIT: %d\n", vm->stats[VM_WAIT]);
printf("CALL: %d\n", vm->stats[NUM_OPS]);
printf("Max SP: %d\n", vm->max_sp);
printf("Max RSP: %d\n", vm->max_rsp);
for (s = i = 0; s < NUM_OPS; s++)
i += vm->stats[s];
printf("Total opcodes processed: %d\n", i);
}
/* Main ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
int main(int argc, char **argv) {
VM *vm;
int i, wantsStats;
wantsStats = 0;
vm = calloc(sizeof(VM), sizeof(char));
strcpy(vm->filename, LOCAL_FNAME);
rxPrepareInput(vm);
/* Parse the command line arguments */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "--with") == 0)
rxIncludeFile(vm, argv[++i]);
if (strcmp(argv[i], "--image") == 0)
strcpy(vm->filename, argv[++i]);
if (strcmp(argv[i], "--shrink") == 0)
vm->shrink = 1;
if (strcmp(argv[i], "--stats") == 0)
wantsStats = 1;
if (strcmp(argv[i], "--help") == 0)
{
printf("--with filename Add filename to the input stack\n");
printf("--image filename Use filename as the image to load\n");
printf("--shrink When saving, don't save unused cells\n");
printf("--stats Display opcode usage and stack summaries upon exit\n");
printf("--help Display this text\n");
exit(1);
}
}
if (rxLoadImage(vm, vm->filename) == 0) {
printf("Sorry, unable to find %s\n", vm->filename);
free(vm);
exit(1);
}
rxPrepareOutput(vm);
for (IP = 0; IP < IMAGE_SIZE; IP++)
rxProcessOpcode(vm);
rxRestoreIO(vm);
if (wantsStats == 1)
rxDisplayStats(vm);
free(vm);
return 0;
}
|
the_stack_data/15718.c
|
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#include <unistd.h>
#define size 5
int sharedCounter = 0;
sem_t counter_sem,buffer_sem,empty_sem,full_sem;
int buffer[size];
void* counterFunc(void* args){
int threadCount = *((int*) args);
while(1){
printf("Counter thread %d: recieved a message \n",threadCount);
printf("Counter thread %d is waiting to write\n",threadCount);
sem_wait(&counter_sem);
sharedCounter++;
printf("Counter thread %d: now adding to counter, counter value = %d\n",threadCount,sharedCounter);
sem_post(&counter_sem);
int randnum = (random()% (15-1+1))+1;
sleep(randnum);
}
}
void* monitorFunc(void* args){
int i=0;
while (1){
printf("Monitor thread: waiting to read counter\n");
sem_wait(&counter_sem);
printf("Monitor thread: reading a count value of %d\n",sharedCounter);
int tempCount= sharedCounter;
sharedCounter=0;
sem_post(&counter_sem);
// check if buffer is full
int empty;
sem_getvalue(&empty_sem,&empty);
if(empty<=0){
printf("Monitor thread: buffer is full\n");
}
sem_wait(&empty_sem);
sem_wait(&buffer_sem);
buffer[i] = tempCount;
printf("Monitor thread: writing to buffer at position %d\n",i);
sem_post(&buffer_sem);
sem_post(&full_sem);
i++;
if(i>= size)
{
i=0;
}
int randnum = (random()% (15-1+1))+1;
sleep(randnum);
}
}
void* collectorFunc(void* args){
int i =0 ;
while(1){
// check if buffer is empty
int full;
sem_getvalue(&full_sem,&full);
if(full<=0){
printf("Collector thread: buffer is EMPTY\n");
}
sem_wait(&full_sem);
sem_wait(&buffer_sem);
printf("Collector thread: reading from buffer at position %d\n",i);
buffer[i]=0;
sem_post(&buffer_sem);
sem_post(&empty_sem);
i++;
if(i>= size)
{
i=0;
}
int randnum = (random()% (15-1+1))+1;
sleep(randnum);
}
}
void initializeSemaphores(){
sem_init(&counter_sem,0,1);
sem_init(&buffer_sem,0,1);
sem_init(&empty_sem,0,size);
sem_init(&full_sem,0,0);
}
int main(){
int n;
printf("Enter number of counters: ");
scanf("%d",&n);
initializeSemaphores();
pthread_t monitor_thread;
pthread_t counterthreads[n];
pthread_t collector_thread;
srandom(time(0));
int args[n];
int i;
for (i=0; i<n ; i++){
args[i]=i;
pthread_create(&counterthreads[i],NULL, &counterFunc, &args[i]);
}
pthread_create(&monitor_thread,NULL, &monitorFunc, NULL);
pthread_create(&collector_thread,NULL, &collectorFunc, NULL);
pthread_join(collector_thread,NULL);
return 0;
}
|
the_stack_data/34513425.c
|
const unsigned char logo_gb[] = {
};
|
the_stack_data/3893.c
|
#include <string.h>
#include <stdlib.h>
#include <assert.h>
int main(int argc, char *argv[]) {
int res;
res = strverscmp("jan1", "jan10");
assert(res < 0);
res = strverscmp("jan11", "jan10");
assert(res > 0);
res = strverscmp("jan1", "jan1");
assert(res == 0);
}
|
the_stack_data/89200553.c
|
#include <unistd.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
if (argc != 2) {
fprintf(stderr,"Use: hunlink <dir>\n");
return 1;
}
int ret = unlink(argv[1]);
if (ret != 0)
perror("unlink");
return ret;
}
|
the_stack_data/192331747.c
|
// REQUIRES: arm-registered-target,aarch64-registered-target
// RUN: %clang -target armv7-unknown-none-eabi -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target armv7-unknown-none-eabi -pg -meabi gnu -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target aarch64-unknown-none-eabi -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target aarch64-unknown-none-eabi -pg -meabi gnu -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER
// RUN: %clang -target armv7-unknown-linux-gnueabi -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI
// RUN: %clang -target armv7-unknown-linux-gnueabi -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU
// RUN: %clang -target aarch64-unknown-linux-gnueabi -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER
// RUN: %clang -target aarch64-unknown-linux-gnueabi -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER
// RUN: %clang -target armv7-unknown-linux-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI
// RUN: %clang -target armv7-unknown-linux-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU
// RUN: %clang -target aarch64-unknown-linux-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER
// RUN: %clang -target aarch64-unknown-linux-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER
// RUN: %clang -target armv7-unknown-freebsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target armv7-unknown-freebsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target aarch64-unknown-freebsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-EABI-FREEBSD
// RUN: %clang -target aarch64-unknown-freebsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-EABI-FREEBSD
// RUN: %clang -target armv7-unknown-openbsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix UNDER_UNDER
// RUN: %clang -target armv7-unknown-openbsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix UNDER_UNDER
// RUN: %clang -target aarch64-unknown-openbsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix UNDER_UNDER
// RUN: %clang -target aarch64-unknown-openbsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target armv7-unknown-netbsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target armv7-unknown-netbsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target aarch64-unknown-netbsd-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target aarch64-unknown-netbsd-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNDER_UNDER
// RUN: %clang -target armv7-apple-ios -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target armv7-apple-ios -pg -meabi gnu -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target arm64-apple-ios -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target arm64-apple-ios -pg -meabi gnu -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,UNSUPPORTED
// RUN: %clang -target armv7-unknown-rtems-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target armv7-unknown-rtems-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target aarch64-unknown-rtems-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,MCOUNT
// RUN: %clang -target aarch64-unknown-rtems-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,MCOUNT
// RUN: %clang -target armv7-unknown-cloudabi-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target armv7-unknown-cloudabi-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target aarch64-unknown-cloudabi-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
// RUN: %clang -target aarch64-unknown-cloudabi-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,MCOUNT
int f() {
return 0;
}
// CHECK-LABEL: f
// TODO: add profiling support for arm-baremetal
// UNSUPPORTED-NOT: "instrument-function-entry-inlined"=
// CHECK-ARM-EABI: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="\01mcount"{{.*}} }
// MCOUNT: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="mcount"
// UNDER: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="\01_mcount"
// UNDER_UNDER: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="__mcount"
// CHECK-ARM64-EABI-FREEBSD: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"=".mcount"{{.*}} }
// CHECK-ARM-EABI-MEABI-GNU: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="llvm.arm.gnu.eabi.mcount"{{.*}} }
|
the_stack_data/14490.c
|
#include <stdio.h>
#include <stdlib.h>
/*
9. Napište funkci, která vezme dva řetězce a zkopíruje první řetězec do druhého.
9. Write a function that takes two strings and copies the first string to the second.
*/
void copy(char *source, char *target);
int main()
{
char str[40], str2[40];
printf("Enter something to the str: ");
scanf("%39s", str);
copy(str, str2);
puts(str2);
return 0;
}
void copy(char *source, char *target)
{
int i;
for(i=0;source[i]!='\0';i++)
{
target[i] = source[i];
}
target[i]='\0';
}
|
the_stack_data/1095507.c
|
//Definition for singly-linked list.
struct ListNode
{
int val;
struct ListNode* next;
};
struct ListNode* deleteDuplicates(struct ListNode* head)
{
if (!head)
return head;
struct ListNode** res = &head;
while (*res && (*res)->next)
{
if ((*res)->val == (*res)->next->val)
{
while ((*res)->next && (*res)->val == (*res)->next->val)
(*res)->next = (*res)->next->next;
(*res) = (*res)->next;
}
else
res = &(*res)->next;
}
return head;
}
|
the_stack_data/51700017.c
|
/*-------------------------------------------------------------------------
_modulonglong.c - routine for modulus of 64 bit unsigned long long
Copyright (C) 1999, Sandeep Dutta . [email protected]
Bug fixes by Martijn van Balen, [email protected]
Copyright (C) 2014, Philipp Klaus Krause . [email protected]
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
#include <stdint.h>
#ifdef __SDCC_LONGLONG
#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1)
unsigned long long
_modulonglong (unsigned long long a, unsigned long long b)
{
unsigned char count = 0;
while (!MSB_SET(b))
{
b <<= 1;
if (b > a)
{
b >>=1;
break;
}
count++;
}
do
{
if (a >= b)
a -= b;
b >>= 1;
}
while (count--);
return a;
}
#endif
|
the_stack_data/92326749.c
|
#include <stdbool.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
enum jtok_type {
JOBJ_BEGIN,
JOBJ_END,
JARR_BEGIN,
JARR_END,
JCOMMA,
JCOLON,
JSTR,
JINT,
JFLOAT,
JBOOL,
JCHAR,
JNULL,
};
struct jtok {
enum jtok_type type;
const char *str;
int len;
size_t line;
size_t col;
union {
int i;
float f;
bool b;
char c;
char *s;
} val;
};
enum jlex_res {
JLEX_OK,
JLEX_ERR,
JLEX_PREMCHAR,
JLEX_PREMSTR,
JLEX_END,
};
inline int
suntilc(const char **const p,
size_t *const line,
size_t *const col,
const char c)
{
int len = 0;
while (**p != '\0' && **p == c) {
if (**p == '\n')
(*line)++, *col = 0;
else
(*col)++;
(*p)++, len++;
}
return (**p == '\0' ? -1 : len);
}
inline int
suntilp(const char **const p,
size_t *const line,
size_t *const col,
int (*pred)(int))
{
int len = 0;
while (**p != '\0' && pred(**p)) {
if (**p == '\n')
(*line)++, *col = 0;
else
(*col)++;
(*p)++, len++;
}
return (**p == '\0' ? -1 : len);
}
inline enum jlex_res
jlex_upd(const enum jtok_type type,
const char **const p,
const int len,
size_t *const line,
size_t *const col,
struct jtok *const res)
{
*res = (struct jtok) { type, *p, len, *line, *col, {0} };
(*col) += len;
(*p) += len;
return JLEX_OK;
}
enum jlex_res
jlex(const char **const p,
size_t *const line,
size_t *const col,
struct jtok *const res)
{
if (suntilp(p, line, col, isspace) == -1)
return JLEX_END;
switch (**p) {
case '{': return jlex_upd(JOBJ_BEGIN, p, 1, line, col, res);
case '}': return jlex_upd(JOBJ_END, p, 1, line, col, res);
case '[': return jlex_upd(JARR_BEGIN, p, 1, line, col, res);
case ']': return jlex_upd(JARR_END, p, 1, line, col, res);
case ',': return jlex_upd(JCOMMA, p, 1, line, col, res);
case ':': return jlex_upd(JCOLON, p, 1, line, col, res);
case '\'': {
(void) jlex_upd(JCHAR, p, 1, line, col, res);
res->len += suntilc(p, line, col, '\'');
if (res->len != 3)
return JLEX_PREMCHAR;
(*p)++;
return JLEX_OK;
}
case '"': {
(void) jlex_upd(JSTR, p, 1, line, col, res);
res->len += suntilc(p, line, col, '"');
if (res->len < 2)
return JLEX_PREMSTR;
(*p)++;
return JLEX_OK;
}
}
return JLEX_ERR;
}
#if defined(LIBJSON_TEST)
int
main()
{
const char *buf = " true {} false \n [] : \" \n : , null ";
size_t line = 1;
size_t col = 0;
struct jtok res;
json_lex_loop:
switch (jlex(&buf, &line, &col, &res)) {
case JLEX_OK:
printf("%zu:%zu %.*s\n", res.line, res.col, res.len, res.str);
goto json_lex_loop;
case JLEX_PREMCHAR:
printf("%zu:%zu: PREMCHAR\n", line, col);
return 1;
case JLEX_PREMSTR:
printf("%zu:%zu: PREMSTR\n", line, col);
return 1;
case JLEX_ERR:
printf("%zu:%zu: ERR\n", line, col);
return 1;
case JLEX_END:
printf("%zu:%zu: END\n", line, col);
return 0;
}
return 0;
}
#endif
|
the_stack_data/82950.c
|
#include <stdio.h>
int main() {
float sum = 0;
for (int i = 0; i < 10; ++i)
{
sum += 0.1f;
}
printf("%f", sum);
return 0;
}
|
the_stack_data/403830.c
|
#include <stdio.h>
// Victor Emanuel Sousa Lima - 16/01/2021
//ig: vic_lima.f.q
int main(){
float n1, n2;
printf("Digite primeiro numero: "); scanf("%f", &n1);
printf("Digite segundo numero: "); scanf("%f", &n2);
if (n1 >= n2)
printf("A diferenca e %f\n", (n1-n2));
else
printf("A diferenca e %f\n", (n2-n1));
system("pause");
return 0;
}
|
the_stack_data/73574583.c
|
#include <stdio.h>
#define message_for(a, b) \
printf(#a " and " #b ": We love you!\n")
int main(void)
{
message_for(Carole, Debra);
return 0;
}
|
the_stack_data/64199156.c
|
/*
* Copyright (C) 2017 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* TODO: Actually provide implementations for these function! */
void _ZNK7android11MediaBuffer8refcountEv() {}
|
the_stack_data/90763235.c
|
#include <stdio.h>
//user input buffer
static char input[2048];
int main(int argc, char **argv) {
puts("Lispy Version 0.0.0.1");
puts("Press ctrl-c to exit");
while (1) {
fputs("lispy> ", stdout);
fgets(input, 2048, stdin);
printf("You, you're a %s", input);
}
return 0;
}
|
the_stack_data/107953929.c
|
void dtrmm_ru(const int M,const int N,const int K,const double alpha,const double *A,const int lda,double *B,const int ldb,const double beta,double *C,const int ldc)
{
int i, j, k;
/*@; BEGIN(nest1=MM_pat[type="double";tri_array=("A")]) @*/
for(j=0; j < N; j++) {
for(i = 0; i < M; i++) {
for(k = 0; k<=j; k++) {
B[j*ldb+i] += B[k*ldb+i] * A[j*lda+k];
}
}
}
}
|
the_stack_data/198581543.c
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int vetor[5];
int i,j;
int numeros[5];
int y=0;
int x=0;
srand(time(NULL));
printf("_______________________________\n");
printf("\n JOGO DA MEMORIA:");
printf("\n_______________________________");
printf("\nBEM VINDO AO JOGO DA MEMORIA!!!");
printf("\n Agora prepare e tente guardar os numeros que virao a seguir:\n\n\n");
for(i=0;i<5;i++){
printf("[%d]",rand()%11);
vetor[i] = rand()%11;
}
printf("\n\n\n\n\n Dados os numeros, agora e a sua vez de acertar! ;)");
printf("\n\nDigite pelo menos 3 numeros vistos anteriormente:\n");
for(j=0;j<5;j++){
scanf("%d",&numeros[j]);
for(i=0;i<5;i++){
if(vetor[i]== numeros[j]){
y = y+1;
}
}
}
if(y >2){
printf("\n\nPARABENSS! Voce acertou!");
}else{
printf("\n\n GAME OVER :(");
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.