file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/211081009.c
#include <stdio.h> #include <stdlib.h> int main() { int a[99], b[99]; int i, n, sum[99], sub[99], mul[99], div[99], rem[99]; printf("enter array size\n"); scanf("%d", &n); printf("Enter elements of array 1 of size %d\n", n); for(i=0; i<n; i++) { scanf("%d", &a[i]); } printf("Enter elements of array 2 of size %d\n", n); for(i=0; i<n; i++) { scanf("%d", &b[i]); } for(i=0; i<n; i++) { sum[i]=a[i]+b[i]; sub[i]=a[i]-b[i]; mul[i]=a[i]*b[i]; div[i]=a[i]/b[i]; rem[i]=a[i]%b[i]; } printf("Sum\tSubtraction\tMultiplication\tDivision\tRemainder\n"); for(i=0; i<n; i++) { printf("%d\t%d\t\t%d\t\t%d\t\t%d\n", sum[i],sub[i],mul[i],div[i],rem[i]); } return 0; }
the_stack_data/145452809.c
#include<stdio.h> #define maxn 200010 int main(){ int n1,n2,mid; int a[maxn],b; int i,j,INF=0x7fffffff; scanf("%d",&n1); for(i=0;i<n1;i++){ scanf("%d",&a[i]); } a[i]=INF; scanf("%d",&n2); mid=(n1+n2+1)/2; n2--; i=0,j=0; scanf("%d",&b); while(--mid){ if(a[i]<b){ i++; }else{ if(j<n2){ scanf("%d",&b); j++; }else{ b=INF; } } } printf("%d\n",a[i]<b?a[i]:b); return 0; }
the_stack_data/189166.c
// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc // RUN: %klee --run-in=/tmp --init-env --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 2 2 // RUN: %klee --run-in=/tmp --init-env --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 1 2 // RUN: %klee --run-in=/tmp --init-env --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 0 2 // For this test really to work as intended it needs to be run in a // directory large enough to cause uclibc to do multiple getdents // calls (otherwise uclibc will handle the seeks itself). We should // create a bunch of files or something. #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <sys/stat.h> #include <errno.h> #include <string.h> int main(int argc, char **argv) { struct stat s; char first[256], second[256]; DIR *d = opendir("."); struct dirent *de = readdir(d); assert(de); strcpy(first, de->d_name); off_t pos = telldir(d); printf("pos: %d\n", telldir(d)); de = readdir(d); assert(de); strcpy(second, de->d_name); // Go back to second and check seekdir(d, pos); de = readdir(d); assert(de); assert(strcmp(de->d_name, second) == 0); // Go to end, then back to 2nd while (de) de = readdir(d); assert(!errno); seekdir(d, pos); assert(telldir(d) == pos); de = readdir(d); assert(de); assert(strcmp(de->d_name, second) == 0); // Go to beginning and check rewinddir(d); de = readdir(d); assert(de); assert(strcmp(de->d_name, first) == 0); closedir(d); return 0; }
the_stack_data/126924.c
// Linux compile and run : gcc -std=c99 flags_all_in_binary.c -o flags_all_in_binary.out && ./flags_all_in_binary.out // Mac compile and run : gcc flags_all_in_binary.c -o flags_all_in_binary.out && ./flags_all_in_binary.out // Print binary from `1<<0` to `1<<18` #include <stdio.h> void printBitsRightToLeft(unsigned int num) { int t = num; for (int bit = 0; bit < (sizeof(unsigned int) * 8); bit++) { t = num >> (31 - bit); printf("%i ", t & 0x01); } printf("\n"); } int main() { printf("All flags of `ifconfig` in binary:\n"); for (int i = 0; i <= 18; i++) { printBitsRightToLeft(1 << i); } printf("`sizeof(int)`: %i Bytes = %i bits\n", (int)sizeof(int), (int)sizeof(int) * 8); return 0; }
the_stack_data/107951726.c
#include <stdio.h> int main () { float n1,n2; printf ("Escreva dois valores: \n\n "); scanf ("%f", &n1); scanf ("%f", &n2); if (n1>n2){ printf ("O valor maior e: %.2f",n1); }else{ printf ("Valor maior e: %.2f",n2); } return 0; }
the_stack_data/60219.c
char* temperature_sensor() { return "Temperature sensor not confgured/linked"; }
the_stack_data/187642078.c
#include<stdio.h> void starpattern (int rows); void reversestarpattern (int rows); int main(){ int rows, type; printf("Enter 0 for star pattern and 1 for reversed star pattern\n"); scanf("%d", &type); printf("How many rows do you want?\n"); scanf("%d", &rows); switch (type) { case 0: starpattern(rows); break; case 1: reversestarpattern(rows); break; default: printf("You have entered an invalid choice"); break; } return 0; } void starpattern(int rows) { for (int i = 0; i < rows; i++) { for (int j = 0; j <= i; j++) { printf("*"); } printf("\n"); } } void reversestarpattern(int rows) { for (int i = 0; i < rows; i++) { for (int j = 0; j <= rows - i - 1; j++) { printf("*"); } printf("\n"); } }
the_stack_data/749790.c
#include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; // NOWARN! pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; int i; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex1); i++; // NOWARN! pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); return 0; }
the_stack_data/93887211.c
#include <stdio.h> #include <string.h> int y=2, x=1; int main() { int *p = &x + 1; int *q = &y; printf("Addresses: p=%p q=%p\n",(void*)p,(void*)q); _Bool b = (p==q); // can this be false even with identical addresses? printf("(p==q) = %s\n", b?"true":"false"); return 0; }
the_stack_data/211080381.c
// Copyright (C) 2016 Gernot Riegler // Institute for Computer Graphics and Vision (ICG) // Graz University of Technology (TU GRAZ) // 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 acknowledgement: // This product includes software developed by the ICG, TU GRAZ. // 4. Neither the name of the ICG, TU GRAZ nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED ''AS IS'' AND 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 PROVIDER 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. #ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/IcgThreshold2.c" #else static int icgnn_(IcgThreshold2_updateOutput)(lua_State *L) { THTensor* input1 = luaT_checkudata(L, 2, torch_Tensor); THTensor* input2 = luaT_checkudata(L, 3, torch_Tensor); real threshold = luaT_getfieldchecknumber(L, 1, "threshold"); real val = luaT_getfieldchecknumber(L, 1, "val"); THTensor* output = luaT_getfieldcheckudata(L, 1, "output", torch_Tensor); input1 = THTensor_(newContiguous)(input1); input2 = THTensor_(newContiguous)(input2); real* in1 = THTensor_(data)(input1); real* in2 = THTensor_(data)(input2); THTensor_(resizeAs)(output, input1); real* out = THTensor_(data)(output); long nelem = THTensor_(nElement)(input1); luaL_argcheck(L, nelem == THTensor_(nElement)(input2), 2, "input1 should have same number of elements as input2"); long idx; #pragma omp parallel for private(idx) for(idx = 0; idx < nelem; ++idx) { out[idx] = in2[idx] <= threshold ? val : in1[idx]; } THTensor_(free)(input1); THTensor_(free)(input2); return 1; } static int icgnn_(IcgThreshold2_updateGradInput)(lua_State *L) { THTensor* input1 = luaT_checkudata(L, 2, torch_Tensor); THTensor* input2 = luaT_checkudata(L, 3, torch_Tensor); THTensor* grad_input1 = luaT_checkudata(L, 4, torch_Tensor); THTensor* grad_output = luaT_checkudata(L, 5, torch_Tensor); real threshold = luaT_getfieldchecknumber(L, 1, "threshold"); real val = luaT_getfieldchecknumber(L, 1, "val"); THTensor_(resizeAs)(grad_input1, input1); real* in1 = THTensor_(data)(input1); real* in2 = THTensor_(data)(input2); real* grad_in1 = THTensor_(data)(grad_input1); real* grad_out = THTensor_(data)(grad_output); long nelem = THTensor_(nElement)(input1); luaL_argcheck(L, nelem == THTensor_(nElement)(input2), 2, "input1 should have same number of elements as input2"); long idx; #pragma omp parallel for private(idx) for(idx = 0; idx < nelem; ++idx) { grad_in1[idx] = in2[idx] <= threshold ? 0 : grad_out[idx]; } return 1; } static const struct luaL_Reg icgnn_(IcgThreshold2__) [] = { {"IcgThreshold2_updateOutput", icgnn_(IcgThreshold2_updateOutput)}, {"IcgThreshold2_updateGradInput", icgnn_(IcgThreshold2_updateGradInput)}, {NULL, NULL} }; static void icgnn_(IcgThreshold2_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, icgnn_(IcgThreshold2__), "icgnn"); lua_pop(L,1); } #endif
the_stack_data/154830145.c
#include <signal.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> volatile int ctrl_c=0; volatile int tempo=0; void comandC() { printf("Tempo:%d/s\n",tempo); ctrl_c++; } void quit() { printf("%d\n",ctrl_c); exit(0); } void my_alarm() { char buf[16] ="working...\n"; write(1,buf,12); alarm(1); tempo++; } int main() { signal(SIGINT,comandC); signal(SIGQUIT,quit); signal(SIGALRM,my_alarm); alarm(1); // chamar alarm que responderá 1 segundo depois /* pause(); Caso existisse este pause e não o while então o program iria esperar que um sinal fosse enviado (por exemplo o alarm(1 segundo depois) e depois o programa sairia*/ while(1){pause();} //loop infinito para poder 'ativar' todos os sinais sem o programa sair return 0; }
the_stack_data/48549.c
#include <stdio.h> #define MAX (64) double R[MAX + 1]; int main(void) { int TC, tc; long long N, n, i; double p, answer, r; freopen("sample_input.txt", "r", stdin); setbuf(stdout, NULL); scanf("%d", &TC); for (tc = 1; tc <= TC; ++tc) { scanf("%lf %lld\n", &p, &N); for (R[0] = 1.f - 2.f * p, i = 2; i <= MAX; ++i) R[i] = R[i - 1] * R[i - 1]; for (n = N - 1, r = 1.f, i = 0; n > 0; ++i, n >>= 1) { if (n & (long long)(0x1)) { r *= R[i]; } } answer = r * p + (p * (1.f - r)) / ( 1.f - R[0]); printf("#%d %lf\n", tc, answer); } return 0; }
the_stack_data/129932.c
// REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s #include <stdarg.h> struct x { long a; double b; }; void testva (int n, ...) { va_list ap; struct x t = va_arg (ap, struct x); // CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x* // CHECK: bitcast %struct.x* %t to i8* // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* // CHECK: call void @llvm.memcpy int v = va_arg (ap, int); // CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 // CHECK: add i64 %{{[0-9]+}}, 4 // CHECK: inttoptr i64 %{{[0-9]+}} to i8* // CHECK: bitcast i8* %{{[0-9]+}} to i32* __int128_t u = va_arg (ap, __int128_t); // CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128* // CHECK-NEXT: load i128* %{{[0-9]+}} }
the_stack_data/22013609.c
void reverse(int iorder[], int ncity, int n[]) { int nn,j,k,l,itmp; nn=(1+((n[2]-n[1]+ncity) % ncity))/2; for (j=1;j<=nn;j++) { k=1 + ((n[1]+j-2) % ncity); l=1 + ((n[2]-j+ncity) % ncity); itmp=iorder[k]; iorder[k]=iorder[l]; iorder[l]=itmp; } }
the_stack_data/1011792.c
//********************************************************** // Pseudo random number generator: // double drandom // void seed (lower_limit, higher_limit) //********************************************************** // // A simple linear congruential random number generator // (Numerical Recipies chapter 7, 1st ed.) with parameters // from the table on page 198j. // // Uses a linear congruential generator to return a value between // 0 and 1, then scales and shifts it to fill the desired range. This // range is set when the random number generator seed is called. // // USAGE: // // pseudo random sequence is seeded with a range // // void seed(lower_limit, higher_limit) // // and then subsequent calls to the random number generator generates values // in the sequence: // // double random() // // History: // Written by Tim Mattson, 9/2007. static long MULTIPLIER = 1366; static long ADDEND = 150889; static long PMOD = 714025; long random_last = 0.0; double random_low, random_hi; double drandom() { long random_next; double ret_val; // // compute an integer random number from zero to mod // random_next = (MULTIPLIER * random_last + ADDEND)% PMOD; random_last = random_next; // // shift into preset range // ret_val = ((double)random_next/(double)PMOD)*(random_hi-random_low)+random_low; return ret_val; } // // set the seed and the range // void seed(double low_in, double hi_in) { if(low_in < hi_in) { random_low = low_in; random_hi = hi_in; } else { random_low = hi_in; random_hi = low_in; } random_last = PMOD/ADDEND; // just pick something } //********************************************************** // end of pseudo random generator code. //**********************************************************
the_stack_data/521292.c
// https://www.hackerrank.com/challenges/the-love-letter-mystery/problem #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char arr[10000]; int t; int l, r, c; // get number of test cases scanf("%d", &t); while (t--) { scanf("%s", arr); r = strlen(arr) - 1; l = 0; c = 0; while (l < r) { c += abs(arr[l++] - arr[r--]); } printf("%d\n", c); } return 0; }
the_stack_data/855024.c
/** * Lambda calculus in C * ==================== * * I mean the abstract syntax. */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> typedef struct lambda { struct lambda *(*fp)(struct lambda *, ...); } *lambda_t; lambda_t ftrue(lambda_t x, ...) { return x; } lambda_t vtrue = &(struct lambda){.fp = ftrue}; lambda_t ffalse(lambda_t x, ...) { va_list args; va_start(args, x); lambda_t y = va_arg(args, lambda_t); va_end(args); return y; } lambda_t vfalse = &(struct lambda){.fp = ffalse}; lambda_t fnot(lambda_t b, ...) { return b->fp(vfalse, vtrue); } lambda_t vnot = &(struct lambda){.fp = fnot}; typedef struct { lambda_t lp; char* name; } symtbl_t; symtbl_t *symtbl; void init_symtbl() { symtbl = (symtbl_t *)malloc(sizeof(symtbl_t) *3); symtbl[0].lp = vtrue; symtbl[0].name = "true"; symtbl[1].lp = vfalse; symtbl[1].name = "false"; symtbl[2].lp = vnot; symtbl[2].name = "not"; } char* lookup(lambda_t lp) { size_t i; for (i = 0; i < sizeof(symtbl_t) * 3; ++i) { if (lp == symtbl[i].lp) { return symtbl[i].name; } } return "<nil>"; } int main() { init_symtbl(); lambda_t p1 = vnot->fp(vtrue); lambda_t p2 = vnot->fp(vfalse); printf("p1=%s,p2=%s\n", lookup(p1), lookup(p2)); return 0; }
the_stack_data/93888207.c
#include <stdio.h> /*Primer hello*/ int main(){ printf("Hola Mundo"); return 0; }
the_stack_data/746786.c
#include <stdio.h> typedef struct { char nome[30]; int matricula; } Aluno; int main() { Aluno *x; Aluno y; x = &y; x->matricula = 2031; printf("%d\n", y.matricula); return 0; }
the_stack_data/141370.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: pmasson <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/11/06 10:05:09 by pmasson #+# #+# */ /* Updated: 2019/02/22 11:48:01 by pmasson ### ########.fr */ /* */ /* ************************************************************************** */ int ft_strcmp(const char *s1, const char *s2) { int i; i = 0; if (s1[0] == '\0' && s2[0] == '\0') return (0); while (s1[i] == s2[i] && s1[i] != '\0' && s2[i] != '\0') i++; return ((unsigned char)s1[i] - (unsigned char)s2[i]); }
the_stack_data/22012581.c
#include <math.h> float beta(float z, float w) { float gammln(float xx); return exp(gammln(z)+gammln(w)-gammln(z+w)); } /* (C) Copr. 1986-92 Numerical Recipes Software 7&X*. */
the_stack_data/57405.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> /* front: 16 - 1 back: 2 - 15 front: 14 - 3 back: 4 - 13 front:12 - 5 back:6 - 11 front:10 - 7 back:8 - 9 */ static int buf[1024] = {0}; int main(void) { int paper, i, sum, big_paper; while(scanf("%d", &paper) != EOF) { for (i = 0; i < paper; i++) { buf[i] = i + 1; } if ((paper % 4) != 0) { sum = paper + (4 - (paper % 4)); } else { sum = paper; } big_paper = sum / 4; for (i = 0; i < big_paper; i++) { printf("front:"); if (buf[sum - 1 - i * 2]) printf("%d - ", buf[sum - 1 - i * 2]); else printf("None - "); if (buf[i * 2]) printf("%d", buf[i * 2]); else printf("None"); printf("\n"); printf("back:"); if (buf[i * 2 + 1]) printf("%d - ", buf[i * 2 + 1]); else printf("None - "); if (buf[sum - 1 - i * 2 - 1]) printf("%d", buf[sum - 1 - i * 2 - 1]); else printf("None"); printf("\n"); } memset(buf, 0, sizeof(int) * 1024); } return 0; }
the_stack_data/70343.c
/* Copyright (C) 2000-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. 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 <spawn.h> #include <string.h> /* Get process group ID from the attribute structure. */ int posix_spawnattr_getpgroup(const posix_spawnattr_t* attr, pid_t* pgroup) { /* Copy the process group ID. */ *pgroup = attr->__pgrp; return 0; }
the_stack_data/235.c
// Test that different values of -mhwmult pick correct // MSP430 hwmult target-feature(s). // RUN: %clang -### -target msp430 %s 2>&1 | FileCheck %s // RUN: %clang -### -target msp430 %s -mhwmult=auto 2>&1 | FileCheck %s // CHECK-NOT: "-target-feature" "+hwmult16" // CHECK-NOT: "-target-feature" "+hwmult32" // CHECK-NOT: "-target-feature" "+hwmultf5" // RUN: %clang -### -target msp430 %s -mhwmult=none 2>&1 | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=CHECK-NONE %s // CHECK-NONE: "-target-feature" "-hwmult16" // CHECK-NONE: "-target-feature" "-hwmult32" // CHECK-NONE: "-target-feature" "-hwmultf5" // RUN: %clang -### -target msp430 %s -mhwmult=16bit 2>&1 | FileCheck --check-prefix=CHECK-16 %s // CHECK-16: "-target-feature" "+hwmult16" // RUN: %clang -### -target msp430 %s -mhwmult=32bit 2>&1 | FileCheck --check-prefix=CHECK-32 %s // CHECK-32: "-target-feature" "+hwmult32" // RUN: %clang -### -target msp430 %s -mhwmult=f5series 2>&1 | FileCheck --check-prefix=CHECK-F5 %s // CHECK-F5: "-target-feature" "+hwmultf5" // RUN: %clang -### -target msp430 %s -mhwmult=rrr 2>&1 | FileCheck --check-prefix=INVL-ARG %s // INVL-ARG: error: unsupported argument 'rrr' to option '-mhwmult=rrr' // RUN: %clang -### -target msp430 %s -mhwmult=auto 2>&1 | FileCheck --check-prefix=WRN-NODEV %s // WRN-NODEV: warning: no MCU device specified, but '-mhwmult' is set to 'auto', // assuming no hardware multiply. Use -mmcu to specify a MSP430 device, // or -mhwmult to set hardware multiply type explicitly. // RUN: %clang -### -target msp430 %s -mhwmult=16bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s // RUN: %clang -### -target msp430 %s -mhwmult=32bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s // RUN: %clang -### -target msp430 %s -mhwmult=f5series -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s // WRN-UNSUP: warning: the given MCU does not support hardware multiply, but -mhwmult is set to // RUN: %clang -### -target msp430 %s -mhwmult=16bit -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s // RUN: %clang -### -target msp430 %s -mhwmult=32bit -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s // RUN: %clang -### -target msp430 %s -mhwmult=f5series -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s // WRN-MISMCH: warning: the given MCU supports {{.*}} hardware multiply, but -mhwmult is set to {{.*}}
the_stack_data/985095.c
/***************************************************** * NAME: assignment_8.c * * * * AUTHOR: Devarsh Ruparelia * * * * EMAIL: [email protected] * * * * PURPOSE: Program to to show swap of two Numbers * * without using third variable. * * * * DATE: 02/05/2016 * * * *****************************************************/ /***************************************************** * Chart: * * SR NO. | a | b * * 0 | 10 | 20 * * 1 | 30 | 20 * * 2 | 30 | 10 * * 3 | 20 | 10 * * * *****************************************************/ #include <stdio.h> int main() { // Declaration of variables: int a = 10, b= 20; // Processing of variables: a = a + b; b = a - b; a = a - b; /***************************************** * WOW! What a way to solve the problem. * *****************************************/ // Display of output: printf("a = %d, b = %d\n", a, b); }
the_stack_data/696737.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); void __VERIFIER_assert(int expression) { if (!expression) { ERROR: /* assert not proved */ /* assert not proved */ __VERIFIER_error(); }; return; } int __global_lock; void __VERIFIER_atomic_begin() { /* reachable */ /* reachable */ /* reachable */ /* reachable */ /* reachable */ /* reachable */ /* reachable */ __VERIFIER_assume(__global_lock==0); __global_lock=1; return; } void __VERIFIER_atomic_end() { __VERIFIER_assume(__global_lock==1); __global_lock=0; return; } #include <assert.h> #include <pthread.h> #ifndef TRUE #define TRUE (_Bool)1 #endif #ifndef FALSE #define FALSE (_Bool)0 #endif #ifndef NULL #define NULL ((void*)0) #endif #ifndef FENCE #define FENCE(x) ((void)0) #endif #ifndef IEEE_FLOAT_EQUAL #define IEEE_FLOAT_EQUAL(x,y) (x==y) #endif #ifndef IEEE_FLOAT_NOTEQUAL #define IEEE_FLOAT_NOTEQUAL(x,y) (x!=y) #endif void * P0(void *arg); void * P1(void *arg); void * P2(void *arg); void fence(); void isync(); void lwfence(); int __unbuffered_cnt; int __unbuffered_cnt = 0; int __unbuffered_p2_EAX; int __unbuffered_p2_EAX = 0; int __unbuffered_p2_EBX; int __unbuffered_p2_EBX = 0; _Bool main$tmp_guard0; _Bool main$tmp_guard1; int x; int x = 0; int y; int y = 0; _Bool y$flush_delayed; int y$mem_tmp; _Bool y$r_buff0_thd0; _Bool y$r_buff0_thd1; _Bool y$r_buff0_thd2; _Bool y$r_buff0_thd3; _Bool y$r_buff1_thd0; _Bool y$r_buff1_thd1; _Bool y$r_buff1_thd2; _Bool y$r_buff1_thd3; _Bool y$read_delayed; int *y$read_delayed_var; int y$w_buff0; _Bool y$w_buff0_used; int y$w_buff1; _Bool y$w_buff1_used; _Bool weak$$choice0; _Bool weak$$choice2; void * P0(void *arg) { __VERIFIER_atomic_begin(); y$w_buff1 = y$w_buff0; y$w_buff0 = 2; y$w_buff1_used = y$w_buff0_used; y$w_buff0_used = TRUE; __VERIFIER_assert(!(y$w_buff1_used && y$w_buff0_used)); y$r_buff1_thd0 = y$r_buff0_thd0; y$r_buff1_thd1 = y$r_buff0_thd1; y$r_buff1_thd2 = y$r_buff0_thd2; y$r_buff1_thd3 = y$r_buff0_thd3; y$r_buff0_thd1 = TRUE; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); x = 1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); y = y$w_buff0_used && y$r_buff0_thd1 ? y$w_buff0 : (y$w_buff1_used && y$r_buff1_thd1 ? y$w_buff1 : y); y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd1 ? FALSE : y$w_buff0_used; y$w_buff1_used = y$w_buff0_used && y$r_buff0_thd1 || y$w_buff1_used && y$r_buff1_thd1 ? FALSE : y$w_buff1_used; y$r_buff0_thd1 = y$w_buff0_used && y$r_buff0_thd1 ? FALSE : y$r_buff0_thd1; y$r_buff1_thd1 = y$w_buff0_used && y$r_buff0_thd1 || y$w_buff1_used && y$r_buff1_thd1 ? FALSE : y$r_buff1_thd1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return nondet_0(); } void * P1(void *arg) { __VERIFIER_atomic_begin(); x = 2; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); y = 1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); y = y$w_buff0_used && y$r_buff0_thd2 ? y$w_buff0 : (y$w_buff1_used && y$r_buff1_thd2 ? y$w_buff1 : y); y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd2 ? FALSE : y$w_buff0_used; y$w_buff1_used = y$w_buff0_used && y$r_buff0_thd2 || y$w_buff1_used && y$r_buff1_thd2 ? FALSE : y$w_buff1_used; y$r_buff0_thd2 = y$w_buff0_used && y$r_buff0_thd2 ? FALSE : y$r_buff0_thd2; y$r_buff1_thd2 = y$w_buff0_used && y$r_buff0_thd2 || y$w_buff1_used && y$r_buff1_thd2 ? FALSE : y$r_buff1_thd2; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return nondet_0(); } void * P2(void *arg) { __VERIFIER_atomic_begin(); weak$$choice0 = nondet_1(); weak$$choice2 = nondet_1(); y$flush_delayed = weak$$choice2; y$mem_tmp = y; y = !y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff1); y$w_buff0 = weak$$choice2 ? y$w_buff0 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff0 : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff0)); y$w_buff1 = weak$$choice2 ? y$w_buff1 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff1 : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff1 : y$w_buff1)); y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff0_used : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$w_buff0_used)); y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff1_used : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : FALSE)); y$r_buff0_thd3 = weak$$choice2 ? y$r_buff0_thd3 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$r_buff0_thd3 : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$r_buff0_thd3)); y$r_buff1_thd3 = weak$$choice2 ? y$r_buff1_thd3 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$r_buff1_thd3 : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : FALSE)); __unbuffered_p2_EAX = y; y = y$flush_delayed ? y$mem_tmp : y; y$flush_delayed = FALSE; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); weak$$choice0 = nondet_1(); weak$$choice2 = nondet_1(); y$flush_delayed = weak$$choice2; y$mem_tmp = y; y = !y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff1); y$w_buff0 = weak$$choice2 ? y$w_buff0 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff0 : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff0)); y$w_buff1 = weak$$choice2 ? y$w_buff1 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff1 : (y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff1 : y$w_buff1)); y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff0_used : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$w_buff0_used)); y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$w_buff1_used : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : FALSE)); y$r_buff0_thd3 = weak$$choice2 ? y$r_buff0_thd3 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$r_buff0_thd3 : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$r_buff0_thd3)); y$r_buff1_thd3 = weak$$choice2 ? y$r_buff1_thd3 : (!y$w_buff0_used || !y$r_buff0_thd3 && !y$w_buff1_used || !y$r_buff0_thd3 && !y$r_buff1_thd3 ? y$r_buff1_thd3 : (y$w_buff0_used && y$r_buff0_thd3 ? FALSE : FALSE)); __unbuffered_p2_EBX = y; y = y$flush_delayed ? y$mem_tmp : y; y$flush_delayed = FALSE; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); y = y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : (y$w_buff1_used && y$r_buff1_thd3 ? y$w_buff1 : y); y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$w_buff0_used; y$w_buff1_used = y$w_buff0_used && y$r_buff0_thd3 || y$w_buff1_used && y$r_buff1_thd3 ? FALSE : y$w_buff1_used; y$r_buff0_thd3 = y$w_buff0_used && y$r_buff0_thd3 ? FALSE : y$r_buff0_thd3; y$r_buff1_thd3 = y$w_buff0_used && y$r_buff0_thd3 || y$w_buff1_used && y$r_buff1_thd3 ? FALSE : y$r_buff1_thd3; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return nondet_0(); } void fence() { } void isync() { } void lwfence() { } int main() { pthread_create(NULL, NULL, P0, NULL); pthread_create(NULL, NULL, P1, NULL); pthread_create(NULL, NULL, P2, NULL); __VERIFIER_atomic_begin(); main$tmp_guard0 = __unbuffered_cnt == 3; __VERIFIER_atomic_end(); __VERIFIER_assume(main$tmp_guard0); __VERIFIER_atomic_begin(); y = y$w_buff0_used && y$r_buff0_thd0 ? y$w_buff0 : (y$w_buff1_used && y$r_buff1_thd0 ? y$w_buff1 : y); y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd0 ? FALSE : y$w_buff0_used; y$w_buff1_used = y$w_buff0_used && y$r_buff0_thd0 || y$w_buff1_used && y$r_buff1_thd0 ? FALSE : y$w_buff1_used; y$r_buff0_thd0 = y$w_buff0_used && y$r_buff0_thd0 ? FALSE : y$r_buff0_thd0; y$r_buff1_thd0 = y$w_buff0_used && y$r_buff0_thd0 || y$w_buff1_used && y$r_buff1_thd0 ? FALSE : y$r_buff1_thd0; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ weak$$choice0 = nondet_1(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ weak$$choice2 = nondet_1(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$flush_delayed = weak$$choice2; /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$mem_tmp = y; /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y = !y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y : (y$w_buff0_used && y$r_buff0_thd0 ? y$w_buff0 : y$w_buff1); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$w_buff0 = weak$$choice2 ? y$w_buff0 : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$w_buff0 : (y$w_buff0_used && y$r_buff0_thd0 ? y$w_buff0 : y$w_buff0)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$w_buff1 = weak$$choice2 ? y$w_buff1 : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$w_buff1 : (y$w_buff0_used && y$r_buff0_thd0 ? y$w_buff1 : y$w_buff1)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$w_buff0_used : (y$w_buff0_used && y$r_buff0_thd0 ? FALSE : y$w_buff0_used)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$w_buff1_used : (y$w_buff0_used && y$r_buff0_thd0 ? FALSE : FALSE)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$r_buff0_thd0 = weak$$choice2 ? y$r_buff0_thd0 : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$r_buff0_thd0 : (y$w_buff0_used && y$r_buff0_thd0 ? FALSE : y$r_buff0_thd0)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$r_buff1_thd0 = weak$$choice2 ? y$r_buff1_thd0 : (!y$w_buff0_used || !y$r_buff0_thd0 && !y$w_buff1_used || !y$r_buff0_thd0 && !y$r_buff1_thd0 ? y$r_buff1_thd0 : (y$w_buff0_used && y$r_buff0_thd0 ? FALSE : FALSE)); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ main$tmp_guard1 = !(x == 2 && y == 2 && __unbuffered_p2_EAX == 1 && __unbuffered_p2_EBX == 1); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y = y$flush_delayed ? y$mem_tmp : y; /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ y$flush_delayed = FALSE; __VERIFIER_atomic_end(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ __VERIFIER_assert(main$tmp_guard1); /* reachable */ return 0; }
the_stack_data/36075873.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putnbr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: erli <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/11/08 10:17:23 by erli #+# #+# */ /* Updated: 2018/11/08 14:43:14 by erli ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> void ft_putnbr(int nb) { char c; int pow; if (nb == -2147483648) write(1, "-2147483648", 11); else { pow = 1; if (nb < 0) { pow = -1; write(1, "-", 1); } while (nb / pow >= 10) pow *= 10; while (pow != 0) { c = nb / pow + 48; write(1, &c, 1); nb = nb % pow; pow /= 10; } } }
the_stack_data/717846.c
/* PR debug/29609 */ /* Verify that breakpoint on the break is hit. */ /* { dg-do compile } */ /* { dg-options "-O0 -gdwarf -dA" } */ void abort (void); int foo (void) { int a, i; for (i = 1; i <= 10; i++) { if (i < 3) a = 1; else break; a = 5; } return a; } int main (void) { if (foo () != 5) abort (); return 0; } /* { dg-final { scan-assembler "pr29609-1.c:18" } } */
the_stack_data/18901.c
#include <stdio.h> int main() { int p = 5; int *ptr1 = &p; int **ptr2 = &ptr1; int ***ptr3 = &ptr2; printf("value of *ptr1 %d\n", *ptr1); printf("value of **ptr2 %d\n", **ptr2); printf("value of ***ptr3 %d\n", ***ptr3); printf("address of ptr1 %p\n", (void*) &ptr1); printf("address of ptr2 %p\n", (void*) &ptr2); printf("address of ptr3 %p\n", (void*) &ptr3); printf("address of *ptr2 %p\n", (void*) ptr2); printf("address of *ptr3 %p\n", (void*) ptr3); return 0; }
the_stack_data/90605.c
#include <stdio.h> #include <omp.h> /* * Autor = Rafael Amauri Diniz Augusto * Matricula = 651047 */ double calcular_sequencial(double precisao); double calcular_paralelo(double precisao); int main(){ double precisao = 0.000000001; double inicio, fim, tempo_sequencial, tempo_paralelo; int resposta, quant_iteracoes = 15; // Trocar aqui para quantidade de iteracoes que deseja // Tirar o bloco abaixo dos comentarios caso queira trocar a precisao /* * printf("A precisao atual esta em '0.000000001'. Deseja mudar?\n[1] = Sim\n[2] = Nao\n"); scanf("%d", &resposta); resposta == 1 ? printf("Digite a precisao (valores menores = mais preciso)\n"), scanf("%lf", &precisao) : 0; * */ printf("Precisao escolhida: %.9lf\n\n", precisao); printf("Comecando a rodar o calculo de pi %d vezes...\n", quant_iteracoes); double speedup_medio = 0; double pi; // Calculando tempo de execucao medio entre iteracoes for(int i = 0; i < quant_iteracoes; i++) { printf("-------------------\n|Execucao numero %d|\n-------------------\n\n", i+1); printf("Calculando sequencial...\n------\n"); inicio = omp_get_wtime(); pi = calcular_sequencial(precisao); fim = omp_get_wtime(); tempo_sequencial = fim-inicio; printf("Tempo sequencial = %lf\n\n------\n", tempo_sequencial); printf("Calculando paralelo...\n------\n"); inicio = omp_get_wtime(); pi = calcular_paralelo(precisao); fim = omp_get_wtime(); tempo_paralelo = fim-inicio; printf("Tempo paralelo = %lf\n\n", tempo_paralelo); printf("O speedup da %d execucao foi %lf\n", i+1, tempo_sequencial/tempo_paralelo); speedup_medio += tempo_sequencial/tempo_paralelo; } printf("\n\nO speedup medio entre %d iteracoes foi de %lf\n", quant_iteracoes, speedup_medio/quant_iteracoes); return 0; } // Funcao da questao 1 double calcular_sequencial(double precisao) { double pi = 4; long int quantPassos = 1.0/precisao; for(int i = 3; i < quantPassos; i += 4) { pi -= 4.0 / (i); pi += 4.0 / (i+2); } return pi; } // Funcao da questao 2 double calcular_paralelo(double precisao) { double pi = 4; long int quantPassos = 1.0/precisao; #pragma omp parallel for reduction(+:pi) for(int i = 3; i < quantPassos; i += 4) { pi -= 4.0 / (i); pi += 4.0 / (i+2); } return pi; }
the_stack_data/651537.c
/* This testcase is part of GDB, the GNU debugger. Copyright 2014-2020 Free Software Foundation, Inc. This program 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 3 of the License, or (at your option) any later version. This program 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 program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> #include <signal.h> pthread_barrier_t barrier; sig_atomic_t got_sigusr1; sig_atomic_t got_sigusr2; void handler_sigusr1 (int sig) { got_sigusr1 = 1; } void handler_sigusr2 (int sig) { got_sigusr2 = 1; } void * thread_function (void *arg) { volatile unsigned int count = 1; pthread_barrier_wait (&barrier); while (count++ != 0) { if (got_sigusr1 && got_sigusr2) break; usleep (1); } } void all_threads_started (void) { } void all_threads_signalled (void) { } void end (void) { } int main (void) { pthread_t child_thread[2]; int i; signal (SIGUSR1, handler_sigusr1); signal (SIGUSR2, handler_sigusr2); for (i = 0; i < 2; i++) { pthread_barrier_init (&barrier, NULL, 2); pthread_create (&child_thread[i], NULL, thread_function, NULL); pthread_barrier_wait (&barrier); pthread_barrier_destroy (&barrier); } all_threads_started (); pthread_kill (child_thread[0], SIGUSR1); pthread_kill (child_thread[1], SIGUSR2); all_threads_signalled (); for (i = 0; i < 2; i++) pthread_join (child_thread[i], NULL); end (); return 0; }
the_stack_data/942295.c
#include <stdio.h> int main(){ printf("hello world\n"); return 0; }
the_stack_data/206392443.c
#include <stdio.h> #define NIZ 40 int main(void) { int fib[NIZ] = {1, 1}; for (int i = 2; i < NIZ; i++) { fib[i] = fib[i - 1] + fib[i - 2]; } for (int i = 0; i < NIZ; i++) { printf("%d. clan: %d\n", i + 1, fib[i]); } return 0; }
the_stack_data/1028210.c
#include <stdio.h> #include <unistd.h> int main(){ char buf[20]; puts("ROP is easy is'nt it ?"); printf("Your input :"); fflush(stdout); read(0,buf,160); }
the_stack_data/20449239.c
#include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include <sys/resource.h> #include <stdlib.h> #include <fcntl.h> void atributos(char *type){ pid_t pid; struct rlimit rlim; pid = getpid(); printf("(%s) ID del proceso actual: %i\n", type, pid); printf("(%s) ID del proceso padre: %i\n", type, getppid()); printf("(%s) ID del grupo del proceso: %i\n", type, getpgid(pid)); printf("(%s) ID de sesion: %i\n", type, getsid(pid)); if(getrlimit(RLIMIT_NOFILE, &rlim) == -1) perror("Error en getrlimit"); else printf("(%s) Número máximo de ficheros que puede abrir el proceso: %li\n", type, rlim.rlim_max); char *path = malloc(sizeof(char) * (4096+1)); char *rpath = getcwd(path, 4096+1); printf("(%s) Directorio de trabajo actual: %s\n", type, path); free(path); } int main(int argc, char **argv){ if(argc < 2){ printf("Error: debe introducir el programa a ejecutar.\n"); return -1; } pid_t pid = fork(); switch(pid){ case -1: perror("fork"); exit(1); break; case 0: if(setsid() == -1) perror("Error creando nueva sesión."); if(chdir("/tmp") == -1) perror("Error al cambiar el dir de trabajo"); atributos("Hijo"); int fd = open("/tmp/daemon.out", O_RDWR | O_CREAT, 0644); int fd2 = open("/tmp/daemon.err", O_RDWR | O_CREAT, 0644); int fd3 = open("/dev/null", O_RDWR | O_CREAT, 0644); if(fd == -1 | fd2 == -1 || fd3 == -1) perror("Error en open()"); else{ dup2(fd,1); dup2(fd2,2); dup2(fd3, 0); execvp(argv[1], argv+1); } close(fd); close(fd2); close(fd3); break; default: atributos("Padre"); break; } return 0; }
the_stack_data/132954214.c
#include <stdio.h> #include <math.h> void update(int *a,int *b) { int sum,diff; sum=*a+*b; diff=fabs(*a-*b); *a=sum; *b=diff; } int main() { int a, b; int *pa = &a, *pb = &b; scanf("%d %d",&a,&b); update(pa,pb); printf("%d\n%d",a,b); return 0; }
the_stack_data/200143672.c
#include <stdio.h> #include <ctype.h> int main(void) { int c, f[10] = {0}; c = getchar(); while (c != '.') { if (isdigit(c)) f[c - '0']++; c = getchar(); } for (int i=0; i<10; i++) { if (f[i] > 1) printf("%d\n", i); } return 0; }
the_stack_data/1084489.c
#include <stdio.h> int *recebe_notas(double *NOTAS, int input_size, int *APR); void conta_notas(int *APR, int input_size, int *q_apr_rep); int percent_aprov(int *q_apr_rep, float *per_apr_rep); int main(int argc, char const *argv[]) { double NOTAS[10]; int i; for(i = 0; i < 10; i++) { printf("Olá, digite o valor da nota %d: \n", i+1); scanf("%lf", &NOTAS[i]); } int *APR, vet[10]; APR = recebe_notas(NOTAS, 10, vet); int q_apr_rep[2];//pos[0] = quantidade aprovados e pos[1] = quantidade reprovados conta_notas(APR, 10, q_apr_rep); printf("Quantidade aprovados : %d\nQuantidade reprovados: %d\n", q_apr_rep[0], q_apr_rep[1]); float per_apr_rep[2];//pos[0] = percentual aprovados e pos[1] = percentual reprovados int mais_da_metade_rep = percent_aprov(q_apr_rep, per_apr_rep); printf("Percentual de aprovados: %.2f%%\tPercentual de reprovados: %.2f%%\n", per_apr_rep[0], per_apr_rep[1]); if(mais_da_metade_rep == 1) printf("Mais da metade da turma aprovada!!\n"); return 0; } int *recebe_notas(double *NOTAS, int input_size, int *APR) { for(int index = 0; index < input_size; index++){ if(NOTAS[index] >= 6.0){ *(APR + index) = 1; } else{ *(APR + index) = 0; } } return APR; } void conta_notas(int *APR, int input_size, int *q_apr_rep) { int quant_aprovados = 0, quant_reprovados = 0; for(int i = 0; i < 10; i++) { if(*(APR + i) == 1) { quant_aprovados++; } else{ quant_reprovados++; } } *q_apr_rep = quant_aprovados; *(q_apr_rep + 1) = quant_reprovados; } int percent_aprov(int *q_apr_rep, float *per_apr_rep) { float p_aprovado = 0, p_reprovado = 0; p_aprovado = *q_apr_rep * 100 / 10; p_reprovado = *(q_apr_rep + 1) * 100 / 10; *per_apr_rep = p_aprovado; *(per_apr_rep + 1) = p_reprovado; if(per_apr_rep[0] > 50) return 1; else return 0; }
the_stack_data/98576357.c
#include <stdio.h> #include <string.h> int main() { char my_string[] = "my string"; printf("The length of this string is: %d\n", strlen(my_string)); return 0; }
the_stack_data/55956.c
/* * Copyright 2020 The Emscripten Authors. All rights reserved. * Emscripten is available under two separate licenses, the MIT license and the * University of Illinois/NCSA Open Source License. Both these licenses can be * found in the LICENSE file. */ #include <sys/socket.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <netdb.h> #include <assert.h> int main() { struct sockaddr_in addr; int s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(12345); inet_pton(AF_INET, "127.0.0.1", &addr.sin_addr); connect(s, (struct sockaddr *)&addr, sizeof(addr)); struct sockaddr_storage adr_inet; socklen_t len_inet = sizeof adr_inet; memset(&adr_inet, 1, sizeof(adr_inet)); getsockname(s, (struct sockaddr *)&adr_inet, &len_inet); struct sockaddr_in *adr_inet4 = (struct sockaddr_in *)&adr_inet; for (int i = 0; i < 8; i++) { assert(adr_inet4->sin_zero[i] == 0); } shutdown(s, SHUT_RDWR); puts("success"); return EXIT_SUCCESS; }
the_stack_data/1085701.c
#include <stdlib.h> #include <stdio.h> int main() { int n, i, fatorial; printf("Digite o numero a ser fatorado: "); scanf("%d", &n); /* Outra forma: for (fatorial = 1; n > 1; n--){ fatorial = fatorial * n; } */ if (n == 0){ fatorial = 1; }else{ fatorial = n; for (i=n-1; i>0; i--){ fatorial = fatorial * i; } } printf("Fatorial de %d = %d\n", n, fatorial); return 0; }
the_stack_data/75138315.c
#include <stdio.h> #include <stdlib.h> int main() { const int N = 10; int p = 0; char CH = '$'; while (p++ < N) { int k = p; while (k--) { printf("%c", CH); } printf("\n"); } return 0; }
the_stack_data/26699380.c
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { return 0; }
the_stack_data/103266187.c
#include <stdio.h> // INSERTION SORT: // A ordenação é feita analisando cada um dos elementos e comparando com os antecedentes: um elemento por vez // O elemento a ser testado analisa com o elemento anterior, caso seja preciso trocar de posição // O elemento a ser testado é guardado em uma variável temporária e testada com cada um dos elementos antes dele // Se for maior, empurra todos o números para frente, até chegar na posição onde ele vai se encaixar // O melhor caso: vetor já ordenado, ele não entra no while -> O(n): Linear // O pior caso: vetor na ordem inversa, entrará todas as vezes no while -> O(n²): Quadrático // É instável: depende de como os dados estão previamente organizados // Mais eficiente/rápido do que selection e bubble sort // Menos eficiente que quick, head e merge sort // Fácil de implementar para pequenas quantidades de dados // É eficiente em dados que já estão pacialmente ordenados // Requere pouco espaço na memória // Consegue ordernar uma lista mesmo recebendo novos elementos em tempo de execução void insertion_sort(int arr[], int n) { int i, j, temp; for(i=1; i<n; i++) { // Laço 'pula' o index inicial (i = 1) j = i-1; // j recebe o index anterior (j = 0) temp = arr[i]; // temp recebe o elemento a ser analisado (i = 1) // Laço compara o temp com os anteriores: // Se o temp for menor que seu anterior && o anterior for >= 0 while((temp < arr[j]) && (j>=0)) { arr[j+1] = arr[j]; // O elemento anterior passa para frente j--; // Decrementa o j } arr[j+1] = temp; // Passa para o próximo elemento a ser analisado } } int main(int argc, char *argv[]) { int arr[5] = {500, 1, 50, 23, 76}; insertion_sort(arr, 5); // Array e número de elementos printf("The sorted array is: \n"); for(int i=0;i<5;i++) { printf("%d, ", arr[i]); } }
the_stack_data/182952464.c
// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -x c -std=c99 -ast-print %s -o - | FileCheck %s // RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -x c -std=c99 -ast-print %s -o - | FileCheck %s // expected-no-diagnostics #ifndef HEADER #define HEADER void bar(void); #define N 10 void foo(void) { #pragma omp metadirective when(device = {kind(cpu)} \ : parallel) default() bar(); #pragma omp metadirective when(implementation = {vendor(score(0) \ : llvm)}, \ device = {kind(cpu)} \ : parallel) default(target teams) bar(); #pragma omp metadirective when(device = {kind(gpu)} \ : target teams) when(implementation = {vendor(llvm)} \ : parallel) default() bar(); #pragma omp metadirective default(target) when(implementation = {vendor(score(5) \ : llvm)}, \ device = {kind(cpu, host)} \ : parallel) bar(); #pragma omp metadirective when(user = {condition(N > 10)} \ : target) when(user = {condition(N == 10)} \ : parallel) bar(); #pragma omp metadirective when(device = {kind(host)} \ : parallel for) for (int i = 0; i < 100; i++) ; #pragma omp metadirective when(implementation = {extension(match_all)} \ : parallel) default(parallel for) for (int i = 0; i < 100; i++) ; #pragma omp metadirective when(implementation = {extension(match_any)} \ : parallel) default(parallel for) for (int i = 0; i < 100; i++) ; #pragma omp metadirective when(implementation = {extension(match_none)} \ : parallel) default(parallel for) for (int i = 0; i < 100; i++) ; // Test metadirective with nested OpenMP directive. int array[16]; #pragma omp metadirective when(user = {condition(1)} \ : parallel for) for (int i = 0; i < 16; i++) { #pragma omp simd for (int j = 0; j < 16; j++) array[i] = i; } } // CHECK: void bar(void); // CHECK: void foo(void) // CHECK-NEXT: #pragma omp parallel // CHECK-NEXT: bar() // CHECK-NEXT: #pragma omp parallel // CHECK-NEXT: bar() // CHECK-NEXT: #pragma omp parallel // CHECK-NEXT: bar() // CHECK-NEXT: #pragma omp parallel // CHECK-NEXT: bar() // CHECK-NEXT: #pragma omp parallel // CHECK-NEXT: bar() // CHECK-NEXT: #pragma omp parallel for // CHECK-NEXT: for (int i = 0; i < 100; i++) // CHECK: #pragma omp parallel // CHECK-NEXT: for (int i = 0; i < 100; i++) // CHECK: #pragma omp parallel for // CHECK-NEXT: for (int i = 0; i < 100; i++) // CHECK: #pragma omp parallel // CHECK-NEXT: for (int i = 0; i < 100; i++) // CHECK: #pragma omp parallel for // CHECK-NEXT: for (int i = 0; i < 16; i++) { // CHECK-NEXT: #pragma omp simd // CHECK-NEXT: for (int j = 0; j < 16; j++) #endif
the_stack_data/818073.c
#include <stdio.h> #include <stdlib.h> int main() { FILE *arquivo; arquivo = fopen("resumo_TCC.txt", "r"); if (arquivo == NULL) { printf("Error"); exit(1); } char texto; texto = fgetc(arquivo); while (texto != EOF) { printf("%c", texto); texto = fgetc(arquivo); } fclose(arquivo); return 0; }
the_stack_data/225142915.c
// write a program that read number and display its armstrong or not #include<stdio.h> int main() { while(1) { int num, temp, rem, sum=0; printf("\nEnter any number: "); scanf("%d", &num); temp=num; while(temp!=0) { rem= temp%10; sum = sum+rem*rem*rem; temp = temp/10; } if (num==sum) printf("Armstrong Number.\n"); else printf("Not Armstrong Number.\n"); } return 0; }
the_stack_data/198580597.c
// RUN: %clang_analyze_cc1 \ // RUN: -analyzer-checker=debug.ExprInspection %s 2>&1 | FileCheck %s void clang_analyzer_printState(void); void test_disequality_info(int e0, int b0, int b1, int c0) { int e1 = e0 - b0; if (b0 == 2) { int e2 = e1 - b1; if (e2 > 0) { if (b1 != c0) clang_analyzer_printState(); } } } // CHECK: "disequality_info": [ // CHECK-NEXT: { // CHECK-NEXT: "class": [ "(reg_$0<int e0>) - 2" ], // CHECK-NEXT: "disequal_to": [ // CHECK-NEXT: [ "reg_$2<int b1>" ]] // CHECK-NEXT: }, // CHECK-NEXT: { // CHECK-NEXT: "class": [ "reg_$2<int b1>" ], // CHECK-NEXT: "disequal_to": [ // CHECK-NEXT: [ "(reg_$0<int e0>) - 2" ], // CHECK-NEXT: [ "reg_$3<int c0>" ]] // CHECK-NEXT: }, // CHECK-NEXT: { // CHECK-NEXT: "class": [ "reg_$3<int c0>" ], // CHECK-NEXT: "disequal_to": [ // CHECK-NEXT: [ "reg_$2<int b1>" ]] // CHECK-NEXT: } // CHECK-NEXT: ],
the_stack_data/37637289.c
//***************************************************************************** // // startup_ccs.c - Startup code for use with TI's Code Composer Studio. // // Copyright (c) 2007-2011 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this software for use solely and // exclusively on TI's microcontroller products. The software is owned by // TI and/or its suppliers, and is protected under applicable copyright // laws. You may not combine this software with "viral" open-source // software in order to form a larger program. // // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL // DAMAGES, FOR ANY REASON WHATSOEVER. // // This is part of revision 6852 of the EK-LM3S1968 Firmware Package. // //***************************************************************************** //***************************************************************************** // // Forward declaration of the default fault handlers. // //***************************************************************************** void ResetISR(void); static void NmiSR(void); static void FaultISR(void); static void IntDefaultHandler(void); //***************************************************************************** // // External declaration for the reset handler that is to be called when the // processor is started // //***************************************************************************** extern void _c_int00(void); //***************************************************************************** // // Linker variable that marks the top of the stack. // //***************************************************************************** extern unsigned long __STACK_TOP; //***************************************************************************** // // External declaration for the interrupt handler used by the application. // //***************************************************************************** extern void MPUFaultHandler(void); //***************************************************************************** // // The vector table. Note that the proper constructs must be placed on this to // ensure that it ends up at physical address 0x0000.0000 or at the start of // the program if located at a start address other than 0. // //***************************************************************************** #pragma DATA_SECTION(g_pfnVectors, ".intvecs") void (* const g_pfnVectors[])(void) = { (void (*)(void))((unsigned long)&__STACK_TOP), // The initial stack pointer ResetISR, // The reset handler NmiSR, // The NMI handler FaultISR, // The hard fault handler MPUFaultHandler, // The MPU fault handler IntDefaultHandler, // The bus fault handler IntDefaultHandler, // The usage fault handler 0, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved IntDefaultHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved IntDefaultHandler, // The PendSV handler IntDefaultHandler, // The SysTick handler IntDefaultHandler, // GPIO Port A IntDefaultHandler, // GPIO Port B IntDefaultHandler, // GPIO Port C IntDefaultHandler, // GPIO Port D IntDefaultHandler, // GPIO Port E IntDefaultHandler, // UART0 Rx and Tx IntDefaultHandler, // UART1 Rx and Tx IntDefaultHandler, // SSI0 Rx and Tx IntDefaultHandler, // I2C0 Master and Slave IntDefaultHandler, // PWM Fault IntDefaultHandler, // PWM Generator 0 IntDefaultHandler, // PWM Generator 1 IntDefaultHandler, // PWM Generator 2 IntDefaultHandler, // Quadrature Encoder 0 IntDefaultHandler, // ADC Sequence 0 IntDefaultHandler, // ADC Sequence 1 IntDefaultHandler, // ADC Sequence 2 IntDefaultHandler, // ADC Sequence 3 IntDefaultHandler, // Watchdog timer IntDefaultHandler, // Timer 0 subtimer A IntDefaultHandler, // Timer 0 subtimer B IntDefaultHandler, // Timer 1 subtimer A IntDefaultHandler, // Timer 1 subtimer B IntDefaultHandler, // Timer 2 subtimer A IntDefaultHandler, // Timer 2 subtimer B IntDefaultHandler, // Analog Comparator 0 IntDefaultHandler, // Analog Comparator 1 IntDefaultHandler, // Analog Comparator 2 IntDefaultHandler, // System Control (PLL, OSC, BO) IntDefaultHandler, // FLASH Control IntDefaultHandler, // GPIO Port F IntDefaultHandler, // GPIO Port G IntDefaultHandler, // GPIO Port H IntDefaultHandler, // UART2 Rx and Tx IntDefaultHandler, // SSI1 Rx and Tx IntDefaultHandler, // Timer 3 subtimer A IntDefaultHandler, // Timer 3 subtimer B IntDefaultHandler, // I2C1 Master and Slave IntDefaultHandler, // Quadrature Encoder 1 IntDefaultHandler, // CAN0 IntDefaultHandler, // CAN1 IntDefaultHandler, // CAN2 IntDefaultHandler, // Ethernet IntDefaultHandler // Hibernate }; //***************************************************************************** // // This is the code that gets called when the processor first starts execution // following a reset event. Only the absolutely necessary set is performed, // after which the application supplied entry() routine is called. Any fancy // actions (such as making decisions based on the reset cause register, and // resetting the bits in that register) are left solely in the hands of the // application. // //***************************************************************************** void ResetISR(void) { // // Jump to the CCS C Initialization Routine. // __asm(" .global _c_int00\n" " b.w _c_int00"); } //***************************************************************************** // // This is the code that gets called when the processor receives a NMI. This // simply enters an infinite loop, preserving the system state for examination // by a debugger. // //***************************************************************************** static void NmiSR(void) { // // Enter an infinite loop. // while(1) { } } //***************************************************************************** // // This is the code that gets called when the processor receives a fault // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void FaultISR(void) { // // Enter an infinite loop. // while(1) { } } //***************************************************************************** // // This is the code that gets called when the processor receives an unexpected // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void IntDefaultHandler(void) { // // Go into an infinite loop. // while(1) { } }
the_stack_data/161079896.c
/* Copyright (c) 2020 Dennis Wölfing * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* libc/src/wchar/wcwisth.c * Get the width of a character. */ #include <wchar.h> int wcwidth(wchar_t wc) { if (wc == L'\0') return 0; if (wc <= L'\x1F' || wc == L'\x7F') return -1; return 1; }
the_stack_data/181393554.c
#include <stdio.h> #include <string.h> int main() { char string[100]; int i; scanf("%s", string); for (i = 0; string[i] != '\0'; ++i); printf("Length of the string: %d", i); return 0; }
the_stack_data/151706197.c
/* * Copyright (c) 2019 Bose Corporation * Copyright (c) 2020-2021 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #ifdef CONFIG_BT_CSIS #include <bluetooth/audio/csis.h> #include "common.h" static struct bt_csis *csis; static struct bt_conn_cb conn_callbacks; extern enum bst_result_t bst_result; static volatile bool g_locked; static uint8_t sirk_read_req_rsp = BT_CSIS_READ_SIRK_REQ_RSP_ACCEPT; struct bt_csis_register_param param = { .set_size = 3, .rank = 1, .lockable = true, /* Using the CSIS test sample SIRK */ .set_sirk = { 0xcd, 0xcc, 0x72, 0xdd, 0x86, 0x8c, 0xcd, 0xce, 0x22, 0xfd, 0xa1, 0x21, 0x09, 0x7d, 0x7d, 0x45 }, }; static void connected(struct bt_conn *conn, uint8_t err) { char addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); if (err != 0) { FAIL("Failed to connect to %s (%u)\n", addr, err); return; } printk("Connected\n"); } static void csis_disconnected(struct bt_conn *conn, uint8_t reason) { printk("Disconnected (reason %u)\n", reason); if (reason == BT_HCI_ERR_REMOTE_USER_TERM_CONN) { PASS("Client successfully disconnected\n"); } else { FAIL("Client disconnected unexpectedly (0x%02x)\n", reason); } } static void csis_lock_changed_cb(struct bt_conn *conn, struct bt_csis *csis, bool locked) { printk("Client %p %s the lock\n", conn, locked ? "locked" : "released"); g_locked = locked; } static uint8_t sirk_read_req_cb(struct bt_conn *conn, struct bt_csis *csis) { return sirk_read_req_rsp; } static struct bt_csis_cb csis_cbs = { .lock_changed = csis_lock_changed_cb, .sirk_read_req = sirk_read_req_cb, }; static void bt_ready(int err) { if (err != 0) { FAIL("Bluetooth init failed (err %d)\n", err); return; } printk("Audio Server: Bluetooth initialized\n"); err = bt_csis_advertise(csis, true); if (err != 0) { FAIL("Advertising failed to start (err %d)\n", err); } } static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = csis_disconnected, }; static void test_main(void) { int err; err = bt_enable(bt_ready); if (err != 0) { FAIL("Bluetooth init failed (err %d)\n", err); return; } param.cb = &csis_cbs; err = bt_csis_register(&param, &csis); if (err != 0) { FAIL("Could not register CSIS: %d", err); return; } bt_conn_cb_register(&conn_callbacks); } static void test_force_release(void) { int err; err = bt_enable(bt_ready); if (err != 0) { FAIL("Bluetooth init failed (err %d)\n", err); return; } param.cb = &csis_cbs; err = bt_csis_register(&param, &csis); if (err != 0) { FAIL("Could not register CSIS: %d", err); return; } bt_conn_cb_register(&conn_callbacks); WAIT_FOR_COND(g_locked); printk("Force releasing set\n"); bt_csis_lock(csis, false, true); } static void test_csis_enc(void) { printk("Running %s\n", __func__); sirk_read_req_rsp = BT_CSIS_READ_SIRK_REQ_RSP_ACCEPT_ENC; test_main(); } static void test_args(int argc, char *argv[]) { for (size_t argn = 0; argn < argc; argn++) { const char *arg = argv[argn]; if (strcmp(arg, "size") == 0) { param.set_size = strtol(argv[++argn], NULL, 10); } else if (strcmp(arg, "rank") == 0) { param.rank = strtol(argv[++argn], NULL, 10); } else if (strcmp(arg, "not-lockable") == 0) { param.lockable = false; } else if (strcmp(arg, "sirk") == 0) { size_t len; argn++; len = hex2bin(argv[argn], strlen(argv[argn]), param.set_sirk, sizeof(param.set_sirk)); if (len == 0) { FAIL("Could not parse SIRK"); return; } } else { FAIL("Invalid arg: %s", arg); } } } static const struct bst_test_instance test_connect[] = { { .test_id = "csis", .test_post_init_f = test_init, .test_tick_f = test_tick, .test_main_f = test_main, .test_args_f = test_args, }, { .test_id = "csis_release", .test_post_init_f = test_init, .test_tick_f = test_tick, .test_main_f = test_force_release, .test_args_f = test_args, }, { .test_id = "csis_enc", .test_post_init_f = test_init, .test_tick_f = test_tick, .test_main_f = test_csis_enc, .test_args_f = test_args, }, BSTEST_END_MARKER }; struct bst_test_list *test_csis_install(struct bst_test_list *tests) { return bst_add_tests(tests, test_connect); } #else struct bst_test_list *test_csis_install(struct bst_test_list *tests) { return tests; } #endif /* CONFIG_BT_CSIS */
the_stack_data/22258.c
/* * Copyright 2009 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ /* It can't get much simpler than this (uh, except for noop.c). */ #include <stdlib.h> int main(void) { exit(69); return 0; }
the_stack_data/234518826.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> SGESV computes the solution to system of linear equations A * X = B for GE matrices</b> (simpl e driver) */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download SGESV + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sgesv.f "> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sgesv.f "> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgesv.f "> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE SGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO ) */ /* INTEGER INFO, LDA, LDB, N, NRHS */ /* INTEGER IPIV( * ) */ /* REAL A( LDA, * ), B( LDB, * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > SGESV computes the solution to a real system of linear equations */ /* > A * X = B, */ /* > where A is an N-by-N matrix and X and B are N-by-NRHS matrices. */ /* > */ /* > The LU decomposition with partial pivoting and row interchanges is */ /* > used to factor A as */ /* > A = P * L * U, */ /* > where P is a permutation matrix, L is unit lower triangular, and U is */ /* > upper triangular. The factored form of A is then used to solve the */ /* > system of equations A * X = B. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] N */ /* > \verbatim */ /* > N is INTEGER */ /* > The number of linear equations, i.e., the order of the */ /* > matrix A. N >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] NRHS */ /* > \verbatim */ /* > NRHS is INTEGER */ /* > The number of right hand sides, i.e., the number of columns */ /* > of the matrix B. NRHS >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in,out] A */ /* > \verbatim */ /* > A is REAL array, dimension (LDA,N) */ /* > On entry, the N-by-N coefficient matrix A. */ /* > On exit, the factors L and U from the factorization */ /* > A = P*L*U; the unit diagonal elements of L are not stored. */ /* > \endverbatim */ /* > */ /* > \param[in] LDA */ /* > \verbatim */ /* > LDA is INTEGER */ /* > The leading dimension of the array A. LDA >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[out] IPIV */ /* > \verbatim */ /* > IPIV is INTEGER array, dimension (N) */ /* > The pivot indices that define the permutation matrix P; */ /* > row i of the matrix was interchanged with row IPIV(i). */ /* > \endverbatim */ /* > */ /* > \param[in,out] B */ /* > \verbatim */ /* > B is REAL array, dimension (LDB,NRHS) */ /* > On entry, the N-by-NRHS matrix of right hand side matrix B. */ /* > On exit, if INFO = 0, the N-by-NRHS solution matrix X. */ /* > \endverbatim */ /* > */ /* > \param[in] LDB */ /* > \verbatim */ /* > LDB is INTEGER */ /* > The leading dimension of the array B. LDB >= f2cmax(1,N). */ /* > \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, U(i,i) is exactly zero. The factorization */ /* > has been completed, but the factor U is exactly */ /* > singular, so the solution could not be computed. */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date December 2016 */ /* > \ingroup realGEsolve */ /* ===================================================================== */ /* Subroutine */ int sgesv_(integer *n, integer *nrhs, real *a, integer *lda, integer *ipiv, real *b, integer *ldb, integer *info) { /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1; /* Local variables */ extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen), sgetrf_( integer *, integer *, real *, integer *, integer *, integer *), sgetrs_(char *, integer *, integer *, real *, integer *, integer * , real *, integer *, integer *); /* -- LAPACK driver routine (version 3.7.0) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* December 2016 */ /* ===================================================================== */ /* Test the input parameters. */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1 * 1; a -= a_offset; --ipiv; b_dim1 = *ldb; b_offset = 1 + b_dim1 * 1; b -= b_offset; /* Function Body */ *info = 0; if (*n < 0) { *info = -1; } else if (*nrhs < 0) { *info = -2; } else if (*lda < f2cmax(1,*n)) { *info = -4; } else if (*ldb < f2cmax(1,*n)) { *info = -7; } if (*info != 0) { i__1 = -(*info); xerbla_("SGESV ", &i__1, (ftnlen)5); return 0; } /* Compute the LU factorization of A. */ sgetrf_(n, n, &a[a_offset], lda, &ipiv[1], info); if (*info == 0) { /* Solve the system A*X = B, overwriting B with X. */ sgetrs_("No transpose", n, nrhs, &a[a_offset], lda, &ipiv[1], &b[ b_offset], ldb, info); } return 0; /* End of SGESV */ } /* sgesv_ */
the_stack_data/1010551.c
/* CFISCRYPTED: Checks to see if stdin is a template encrypted with CFCRYPT Matt Chapman <[email protected]> Usage: cfdecrypt <encrypted.cfm >decrypted.cfm Requires a DES encryption library to compile. Compile: Put this file in ~/openssl_ver/crypto/des ~/openssl-1.0.0d/crypto/des> gcc -static ~/openssl-1.0.0d/crypto/des/des_old.c -lcrypto ~/openssl-1.0.0d/crypto/des/cfdecrypt.c -o cfdecrypt */ #include <stdio.h> //#include "des.h" int main(void) { char *header = "Allaire Cold Fusion Template\012Header Size: "; char buffer[54]; int debug = 0; int headsize, outlen, seek_pos; //int skip_header; //int len, i; /* Note: This IS the encryption key! It is meant to look like an error. */ //char *keystr = "Error: cannot open template file--\"%s\". Please, try again!\012\012"; /*des_cblock key; des_cblock input; des_cblock output; des_key_schedule schedule; */ if ((fread(buffer, 1, 54, stdin) < 54) || (memcmp(buffer, header, 42))) { if(debug) fprintf(stderr, "File is not an encrypted template\n"); return 1; } if (!memcmp(&buffer[42], "New Version", 11)) { if(debug) fprintf(stderr, "\nEncrypted with 'New Version'\n"); headsize = 69; //skip_header = 1; } else { if(debug) fprintf(stderr, "\nEncrypted with 'Old Version'\n"); headsize = atoi(&buffer[42]); //skip_header = 0; } seek_pos = fseek(stdin, headsize, SEEK_SET); if ((headsize < 54) || seek_pos < 0) { if(debug){ fprintf(stderr, "Error in file format.\n Head size: %i\n",headsize); if (headsize < 54){ fprintf(stderr, "Error: Head Size < 54");} if (seek_pos < 0){ fprintf(stderr, "Couldn't set seek position: %i",seek_pos);} fprintf(stderr, "\n"); } return 1; } return 0; }
the_stack_data/486866.c
/* ** 2007 August 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file implements a special kind of sqlite3_file object used ** by SQLite to create journal files if the atomic-write optimization ** is enabled. ** ** The distinctive characteristic of this sqlite3_file is that the ** actual on disk file is created lazily. When the file is created, ** the caller specifies a buffer size for an in-memory buffer to ** be used to service read() and write() requests. The actual file ** on disk is not created or populated until either: ** ** 1) The in-memory representation grows too large for the allocated ** buffer, or ** 2) The sqlite3JournalCreate() function is called. */ #ifdef SQLITE_ENABLE_ATOMIC_WRITE #include "sqliteInt.h" /* ** A JournalFile object is a subclass of sqlite3_file used by ** as an open file handle for journal files. */ struct JournalFile { sqlite3_io_methods *pMethod; /* I/O methods on journal files */ int nBuf; /* Size of zBuf[] in bytes */ char *zBuf; /* Space to buffer journal writes */ int iSize; /* Amount of zBuf[] currently used */ int flags; /* xOpen flags */ sqlite3_vfs *pVfs; /* The "real" underlying VFS */ sqlite3_file *pReal; /* The "real" underlying file descriptor */ const char *zJournal; /* Name of the journal file */ }; typedef struct JournalFile JournalFile; /* ** If it does not already exists, create and populate the on-disk file ** for JournalFile p. */ static int createFile(JournalFile *p){ int rc = SQLITE_OK; if( !p->pReal ){ sqlite3_file *pReal = (sqlite3_file *)&p[1]; rc = sqlite3OsOpen(p->pVfs, p->zJournal, pReal, p->flags, 0); if( rc==SQLITE_OK ){ p->pReal = pReal; if( p->iSize>0 ){ assert(p->iSize<=p->nBuf); rc = sqlite3OsWrite(p->pReal, p->zBuf, p->iSize, 0); } } } return rc; } /* ** Close the file. */ static int jrnlClose(sqlite3_file *pJfd){ JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ sqlite3OsClose(p->pReal); } sqlite3_free(p->zBuf); return SQLITE_OK; } /* ** Read data from the file. */ static int jrnlRead( sqlite3_file *pJfd, /* The journal file from which to read */ void *zBuf, /* Put the results here */ int iAmt, /* Number of bytes to read */ sqlite_int64 iOfst /* Begin reading at this offset */ ){ int rc = SQLITE_OK; JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ rc = sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst); }else if( (iAmt+iOfst)>p->iSize ){ rc = SQLITE_IOERR_SHORT_READ; }else{ memcpy(zBuf, &p->zBuf[iOfst], iAmt); } return rc; } /* ** Write data to the file. */ static int jrnlWrite( sqlite3_file *pJfd, /* The journal file into which to write */ const void *zBuf, /* Take data to be written from here */ int iAmt, /* Number of bytes to write */ sqlite_int64 iOfst /* Begin writing at this offset into the file */ ){ int rc = SQLITE_OK; JournalFile *p = (JournalFile *)pJfd; if( !p->pReal && (iOfst+iAmt)>p->nBuf ){ rc = createFile(p); } if( rc==SQLITE_OK ){ if( p->pReal ){ rc = sqlite3OsWrite(p->pReal, zBuf, iAmt, iOfst); }else{ memcpy(&p->zBuf[iOfst], zBuf, iAmt); if( p->iSize<(iOfst+iAmt) ){ p->iSize = (iOfst+iAmt); } } } return rc; } /* ** Truncate the file. */ static int jrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){ int rc = SQLITE_OK; JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ rc = sqlite3OsTruncate(p->pReal, size); }else if( size<p->iSize ){ p->iSize = size; } return rc; } /* ** Sync the file. */ static int jrnlSync(sqlite3_file *pJfd, int flags){ int rc; JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ rc = sqlite3OsSync(p->pReal, flags); }else{ rc = SQLITE_OK; } return rc; } /* ** Query the size of the file in bytes. */ static int jrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){ int rc = SQLITE_OK; JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ rc = sqlite3OsFileSize(p->pReal, pSize); }else{ *pSize = (sqlite_int64) p->iSize; } return rc; } /* ** Table of methods for JournalFile sqlite3_file object. */ static struct sqlite3_io_methods JournalFileMethods = { 1, /* iVersion */ jrnlClose, /* xClose */ jrnlRead, /* xRead */ jrnlWrite, /* xWrite */ jrnlTruncate, /* xTruncate */ jrnlSync, /* xSync */ jrnlFileSize, /* xFileSize */ 0, /* xLock */ 0, /* xUnlock */ 0, /* xCheckReservedLock */ 0, /* xFileControl */ 0, /* xSectorSize */ 0 /* xDeviceCharacteristics */ }; /* ** Open a journal file. */ int sqlite3JournalOpen( sqlite3_vfs *pVfs, /* The VFS to use for actual file I/O */ const char *zName, /* Name of the journal file */ sqlite3_file *pJfd, /* Preallocated, blank file handle */ int flags, /* Opening flags */ int nBuf /* Bytes buffered before opening the file */ ){ JournalFile *p = (JournalFile *)pJfd; memset(p, 0, sqlite3JournalSize(pVfs)); if( nBuf>0 ){ p->zBuf = sqlite3MallocZero(nBuf); if( !p->zBuf ){ return SQLITE_NOMEM; } }else{ return sqlite3OsOpen(pVfs, zName, pJfd, flags, 0); } p->pMethod = &JournalFileMethods; p->nBuf = nBuf; p->flags = flags; p->zJournal = zName; p->pVfs = pVfs; return SQLITE_OK; } /* ** If the argument p points to a JournalFile structure, and the underlying ** file has not yet been created, create it now. */ int sqlite3JournalCreate(sqlite3_file *p){ if( p->pMethods!=&JournalFileMethods ){ return SQLITE_OK; } return createFile((JournalFile *)p); } /* ** Return the number of bytes required to store a JournalFile that uses vfs ** pVfs to create the underlying on-disk files. */ int sqlite3JournalSize(sqlite3_vfs *pVfs){ return (pVfs->szOsFile+sizeof(JournalFile)); } #endif
the_stack_data/11076587.c
// RUN: rm -rf %t* // RUN: 3c -base-dir=%S -addcr -alltypes -output-dir=%t.checkedALL %s %S/safefptrargcalleemulti2.c -- // RUN: 3c -base-dir=%S -addcr -output-dir=%t.checkedNOALL %s %S/safefptrargcalleemulti2.c -- // RUN: %clang -working-directory=%t.checkedNOALL -c safefptrargcalleemulti1.c safefptrargcalleemulti2.c // RUN: FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" --input-file %t.checkedNOALL/safefptrargcalleemulti1.c %s // RUN: FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" --input-file %t.checkedALL/safefptrargcalleemulti1.c %s // RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %S/safefptrargcalleemulti2.c %s -- // RUN: 3c -base-dir=%t.checked -alltypes -output-dir=%t.convert_again %t.checked/safefptrargcalleemulti1.c %t.checked/safefptrargcalleemulti2.c -- // RUN: test ! -f %t.convert_again/safefptrargcalleemulti1.c // RUN: test ! -f %t.convert_again/safefptrargcalleemulti2.c /******************************************************************************/ /*This file tests three functions: two callers bar and foo, and a callee sus*/ /*In particular, this file tests: passing a function pointer as an argument to a function safely (without unsafe casting)*/ /*For robustness, this test is identical to safefptrargprotocallee.c and safefptrargcallee.c except in that the callee and callers are split amongst two files to see how the tool performs conversions*/ /*In this test, foo and bar will treat their return values safely, but sus will not, through invalid pointer arithmetic, an unsafe cast, etc*/ /******************************************************************************/ #include <stddef.h> #include <stdlib.h> #include <stdio.h> #include <string.h> struct general { int data; struct general *next; //CHECK: _Ptr<struct general> next; }; struct warr { int data1[5]; //CHECK_NOALL: int data1[5]; //CHECK_ALL: int data1 _Checked[5]; char *name; //CHECK: _Ptr<char> name; }; struct fptrarr { int *values; //CHECK: _Ptr<int> values; char *name; //CHECK: _Ptr<char> name; int (*mapper)(int); //CHECK: _Ptr<int (int)> mapper; }; struct fptr { int *value; //CHECK: _Ptr<int> value; int (*func)(int); //CHECK: _Ptr<int (int)> func; }; struct arrfptr { int args[5]; //CHECK_NOALL: int args[5]; //CHECK_ALL: int args _Checked[5]; int (*funcs[5])(int); //CHECK_NOALL: int (*funcs[5])(int); //CHECK_ALL: _Ptr<int (int)> funcs _Checked[5]; }; static int add1(int x) { //CHECK: static int add1(int x) _Checked { return x + 1; } static int sub1(int x) { //CHECK: static int sub1(int x) _Checked { return x - 1; } static int fact(int n) { //CHECK: static int fact(int n) _Checked { if (n == 0) { return 1; } return n * fact(n - 1); } static int fib(int n) { //CHECK: static int fib(int n) _Checked { if (n == 0) { return 0; } if (n == 1) { return 1; } return fib(n - 1) + fib(n - 2); } static int zerohuh(int n) { //CHECK: static int zerohuh(int n) _Checked { return !n; } static int *mul2(int *x) { //CHECK: static _Ptr<int> mul2(_Ptr<int> x) _Checked { *x *= 2; return x; } int *sus(int (*)(int), int (*)(int)); //CHECK_NOALL: int *sus(int ((*x)(int)) : itype(_Ptr<int (int)>), _Ptr<int (int)> y) : itype(_Ptr<int>); //CHECK_ALL: _Array_ptr<int> sus(int ((*x)(int)) : itype(_Ptr<int (int)>), _Ptr<int (int)> y); int *foo() { //CHECK_NOALL: _Ptr<int> foo(void) _Checked { //CHECK_ALL: _Array_ptr<int> foo(void) _Checked { int (*x)(int) = add1; //CHECK: _Ptr<int (int)> x = add1; int (*y)(int) = sub1; //CHECK: _Ptr<int (int)> y = sub1; int *z = sus(x, y); //CHECK_NOALL: _Ptr<int> z = sus(x, y); //CHECK_ALL: _Array_ptr<int> z = sus(x, y); return z; } int *bar() { //CHECK_NOALL: _Ptr<int> bar(void) _Checked { //CHECK_ALL: _Array_ptr<int> bar(void) _Checked { int (*x)(int) = add1; //CHECK: _Ptr<int (int)> x = add1; int (*y)(int) = sub1; //CHECK: _Ptr<int (int)> y = sub1; int *z = sus(x, y); //CHECK_NOALL: _Ptr<int> z = sus(x, y); //CHECK_ALL: _Array_ptr<int> z = sus(x, y); return z; }
the_stack_data/22013742.c
/* * Copyright (C) 2007 Nokia Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program 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 program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Author: Adrian Hunter */ #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <stdio.h> #include <signal.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <errno.h> struct child_info { struct child_info *next; pid_t pid; int terminated; int killed; int gone; }; struct child_info *children = 0; void kill_children(void) { struct child_info *child; child = children; while (child) { if (!child->gone) { if (!child->terminated) { child->terminated = 1; kill(child->pid, SIGTERM); } /*else if (!child->killed) { child->killed = 1; kill(child->pid, SIGKILL); }*/ } child = child->next; } } void add_child(pid_t child_pid) { struct child_info *child; size_t sz; sz = sizeof(struct child_info); child = (struct child_info *) malloc(sz); memset(child, 0, sz); child->pid = child_pid; child->next = children; children = child; } void mark_child_gone(pid_t child_pid) { struct child_info *child; child = children; while (child) { if (child->pid == child_pid) { child->gone = 1; break; } child = child->next; } } int have_children(void) { struct child_info *child; child = children; while (child) { if (!child->gone) return 1; child = child->next; } return 0; } int parse_command_line(char *cmdline, int *pargc, char ***pargv) { char **tmp; char *p, *v, *q; size_t sz; int argc = 0; int state = 0; char *argv[1024]; if (!cmdline) return 1; q = v = (char *) malloc(strlen(cmdline) + 1024); if (!v) return 1; p = cmdline; for (;;) { char c = *p++; if (!c) { *v++ = 0; break; } switch (state) { case 0: /* Between args */ if (isspace(c)) break; argv[argc++] = v; if (c == '"') { state = 2; break; } else if (c == '\'') { state = 3; break; } state = 1; case 1: /* Not quoted */ if (c == '\\') { if (*p) *v++ = *p; } else if (isspace(c)) { *v++ = 0; state = 0; } else *v++ = c; break; case 2: /* Double quoted */ if (c == '\\' && *p == '"') { *v++ = '"'; ++p; } else if (c == '"') { *v++ = 0; state = 0; } else *v++ = c; break; case 3: /* Single quoted */ if (c == '\'') { *v++ = 0; state = 0; } else *v++ = c; break; } } argv[argc] = 0; sz = sizeof(char *) * (argc + 1); tmp = (char **) malloc(sz); if (!tmp) { free(q); return 1; } if (argc == 0) free(q); memcpy(tmp, argv, sz); *pargc = argc; *pargv = tmp; return 0; } void signal_handler(int signum) { kill_children(); } int result = 0; int alarm_gone_off = 0; void alarm_handler(int signum) { if (!result) alarm_gone_off = 1; kill_children(); } int main(int argc, char *argv[], char **env) { int p; pid_t child_pid; int status; int duration = 0; p = 1; if (argc > 1) { if (strncmp(argv[p], "--help", 6) == 0 || strncmp(argv[p], "-h", 2) == 0) { printf( "Usage is: " "fstest_monitor options programs...\n" " Options are:\n" " -h, --help " "This help message\n" " -d, --duration arg " "Stop after arg seconds\n" "\n" "Run programs and wait for them." " If duration is specified,\n" "kill all programs" " after that number of seconds have elapsed.\n" "Example: " "fstest_monitor \"/bin/ls -l\" /bin/date\n" ); return 1; } if (strncmp(argv[p], "--duration", 10) == 0 || strncmp(argv[p], "-d", 2) == 0) { char *s; if (p+1 < argc && !isdigit(argv[p][strlen(argv[p])-1])) ++p; s = argv[p]; while (*s && !isdigit(*s)) ++s; duration = atoi(s); ++p; } } signal(SIGTERM, signal_handler); signal(SIGINT, signal_handler); for (; p < argc; ++p) { child_pid = fork(); if (child_pid) { /* Parent */ if (child_pid == (pid_t) -1) { kill_children(); result = 1; break; } add_child(child_pid); } else { /* Child */ int cargc; char **cargv; if (parse_command_line(argv[p], &cargc, &cargv)) return 1; execve(cargv[0], cargv, env); return 1; } } if (!result && duration > 0) { signal(SIGALRM, alarm_handler); alarm(duration); } while (have_children()) { status = 0; child_pid = wait(&status); if (child_pid == (pid_t) -1) { if (errno == EINTR) continue; kill_children(); return 1; } mark_child_gone(child_pid); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { result = 1; kill_children(); } } if (alarm_gone_off) return 0; return result; }
the_stack_data/7950935.c
/* $OpenBSD: cmll_ctr.c,v 1.3 2014/06/12 15:49:28 deraadt Exp $ */ /* ==================================================================== * Copyright (c) 2006 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/camellia.h> #include <openssl/modes.h> void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, size_t length, const CAMELLIA_KEY *key, unsigned char ivec[CAMELLIA_BLOCK_SIZE], unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], unsigned int *num) { CRYPTO_ctr128_encrypt(in, out, length, key, ivec, ecount_buf, num, (block128_f)Camellia_encrypt); }
the_stack_data/48402.c
// // dishierzhang12.c // dishisizhang // // Created by mingyue on 15/11/25. // Copyright © 2015年 G. All rights reserved. // #include <stdio.h> #include <stdlib.h> #define MAXTITL 40 #define MAXAUTL 40 #define MAXBKS 10 struct book { char title[MAXTITL]; char author[MAXAUTL]; float value; }; int main(int argc, const char* argv[]){ struct book library[MAXBKS]; int count = 0; int index, filecount; FILE* pbooks; int size = sizeof(struct book); if ((pbooks = fopen("book.dat", "a+b")) == NULL) { fputs("Can't open book.dat file\n", stderr); exit(1); } rewind(pbooks); while (count < MAXBKS && fread(&library[count], size, 1, pbooks) == 1) { if (count == 0) { puts("Current contents of book.dat:"); } printf("%s by %s:%.2f\n",library[count].title, library[count].author, library[count].value); count++; } filecount = count; if (count == MAXBKS) { fputs("The book.dat file is full.", stderr); exit(2); } puts("Please add new book titles."); puts("Press [enter] at the start of a line to stop."); while (count < MAXBKS && gets(library[count].title) != NULL && library[count].title[0] != '\0') { puts("Now enter the author."); gets(library[count].author); puts("Now enter the value."); scanf("%f",&library[count++].value); while (getchar() != '\n') { continue; } if (count < MAXBKS) { puts("Enter the next title."); } } if (count > 0) { puts("Here is the list of your books:"); for (index = 0; index < count; index++) { printf("%s by %s: $%.2f\n",library[index].title, library[index].author, library[index].value); } fwrite(&library[filecount], size, count - filecount, pbooks); }else{ puts("Bye.\n"); } fclose(pbooks); return 0; }
the_stack_data/129879.c
#include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { size_t bytes; FILE *F = fopen("taint_1.ll", "r"); if (F) { fseek(F, 0, SEEK_END); bytes = ftell(F); fseek(F, 0, SEEK_SET); printf("The file is %zu bytes.\n", bytes); char *buffer = (char *)malloc(bytes + 1); fread(buffer, sizeof(char), bytes, F); buffer[bytes] = '\0'; printf("Read:\n%s", buffer); free(buffer); } if (fclose(F)) { printf("Could not close file properly.\n"); } return 0; }
the_stack_data/1268109.c
#include "unistd.h" int fooChildTwo() { int a = 0; int b = 4; int c = 2; return (a * b) / c; } int fooChildOne() { int a = 0; int b = 4; int c = 2; a++; a = 0; b = 4; c = 2; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; return (a * b) / c; } int foo() { sleep(10); fooChildTwo(); fooChildOne(); return 0; } int bar() { sleep(1); return 0; } int main(int argc, char **argv) { int a = foo(); int b = bar(); return 0; }
the_stack_data/206392508.c
#include <linux/module.h> void exported_function(void) {} EXPORT_SYMBOL(exported_function); void exported_function_gpl(void) {} EXPORT_SYMBOL_GPL(exported_function_gpl); int exported_variable = 1; EXPORT_SYMBOL(exported_variable); int exported_variable_gpl = 1; EXPORT_SYMBOL_GPL(exported_variable_gpl); void local_function(void) {} int local_variable = 2;
the_stack_data/18889189.c
#include <stdio.h> /* every C program must have a main function */ int main(){ /* this is a comment */ printf ("hello world !!!!\n"); return 0; }
the_stack_data/217150.c
/* This testcase is part of GDB, the GNU debugger. Copyright 2002-2015 Free Software Foundation, Inc. This program 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 3 of the License, or (at your option) any later version. This program 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 program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> void *thread_function(void *arg); /* Pointer to function executed by each thread */ #define NUM 5 unsigned int args[NUM+1]; int main() { int res; pthread_t threads[NUM]; void *thread_result; long i; for (i = 1; i <= NUM; i++) { args[i] = 1; res = pthread_create(&threads[i - 1], NULL, thread_function, (void *) i); } /* last thread start. */ args[0] = 1; thread_function ((void *) 0); exit(EXIT_SUCCESS); } void *thread_function(void *arg) { int my_number = (long) arg; int *myp = (int *) &args[my_number]; /* Don't run forever. Run just short of it :) */ while (*myp > 0) { /* main loop. */ (*myp) ++; usleep (1); } pthread_exit(NULL); }
the_stack_data/20449372.c
/* This test file is part of GDB, the GNU debugger. Copyright 2007, 2008 Free Software Foundation, Inc. This program 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 3 of the License, or (at your option) any later version. This program 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 program. If not, see <http://www.gnu.org/licenses/>. */ double a = 1.0/0.0; double b = 0.0/0.0; double c; int main() { c = a + b; return 0; }
the_stack_data/71180.c
#include <stdio.h> #include <math.h> #include <stdbool.h> int Non_Crossing_Biased_Climb(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int Own_Below_Threat(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int Non_Crossing_Biased_Descend(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int Own_Above_Threat(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int Inhibit_Biased_Climb (int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int ALIM (int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation); int snippet (int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; int enabled =0; int tcas_equipped =0; int intent_not_known =0; int alt_sep =0; if((Own_Tracked_Alt_Rate <= OLEV) && (Cur_Vertical_Sep > MAXALTDIFF))//change enabled = 1; else enabled = 0; if(Other_Capability == TCAS_TA) tcas_equipped = 1; else tcas_equipped = 0; if(Two_of_Three_Reports_Valid==1 && Other_RAC == NO_INTENT || true)//change intent_not_known += 1; else intent_not_known += 0; alt_sep += UNRESOLVED; if (enabled==1 && ((tcas_equipped==1 && intent_not_known==1) || tcas_equipped==0)){ if ((Non_Crossing_Biased_Climb(Climb_Inhibit, Alt_Layer_Value,Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)==1&& Own_Below_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation )==1)) need_upward_RA = 1; else need_upward_RA = 0; if((Non_Crossing_Biased_Descend(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability, Down_Separation, Up_Separation)==1&& Own_Above_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation )==1)) need_downward_RA = 1; else need_downward_RA = 0; if (need_upward_RA==1 && need_downward_RA==1) alt_sep = UNRESOLVED; else if (need_upward_RA==1) alt_sep = UPWARD_RA; else if (need_downward_RA!=1)//change alt_sep = DOWNWARD_RA; else alt_sep = UNRESOLVED; } return alt_sep; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int Non_Crossing_Biased_Climb(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; int upward_preferred; int upward_crossing_situation; int result; upward_preferred = (Inhibit_Biased_Climb(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation) > Down_Separation)?1:0; if (upward_preferred!=0){ result = (!(Own_Below_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation )==1) || ((Own_Below_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation )==1) && (!(Down_Separation >= ALIM(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)))))?1:0; }else{ result = (Own_Above_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)==1 && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= ALIM(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)))?1:0; } return result; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int Own_Below_Threat(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; return ((Own_Tracked_Alt < Other_Tracked_Alt)?1:0); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int Non_Crossing_Biased_Descend(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; int upward_preferred; int upward_crossing_situation; int result; upward_preferred = (Inhibit_Biased_Climb(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation) > Down_Separation)?1:0; if (upward_preferred!=0){ result = (Own_Below_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)==1 && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)))?1:0; }else{ result = (!(Own_Above_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)==1) || ((Own_Above_Threat(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation)==1) && (Up_Separation >= ALIM(Climb_Inhibit, Alt_Layer_Value, Other_Tracked_Alt, Own_Tracked_Alt, Two_of_Three_Reports_Valid, need_upward_RA, need_downward_RA, Other_RAC, High_Confidence, Own_Tracked_Alt_Rate, Cur_Vertical_Sep, Other_Capability , Down_Separation, Up_Separation))))?1:0; } return result; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int Own_Above_Threat(int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; return ((Other_Tracked_Alt < Own_Tracked_Alt)?1:0); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int Inhibit_Biased_Climb (int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; return ((Climb_Inhibit==1)? Up_Separation + MINSEP /* operand mutation NOZCROSS */ : Up_Separation); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// int ALIM (int Climb_Inhibit, int Alt_Layer_Value, int Other_Tracked_Alt, int Own_Tracked_Alt, int Two_of_Three_Reports_Valid, int need_upward_RA, int need_downward_RA, int Other_RAC,int High_Confidence, int Own_Tracked_Alt_Rate, int Cur_Vertical_Sep, int Other_Capability , int Down_Separation, int Up_Separation){ int Positive_RA_Alt_Thresh[4]; Positive_RA_Alt_Thresh[0] = 400; Positive_RA_Alt_Thresh[1] = 500; Positive_RA_Alt_Thresh[2] = 640; Positive_RA_Alt_Thresh[3] = 740; int OLEV = 600; /* in feets/minute */ int MAXALTDIFF = 600; /* max altitude difference in feet */ int MINSEP = 300; /* min separation in feet */ int NOZCROSS = 100; /* in feet */ int NO_INTENT = 0; int DO_NOT_CLIMB = 1; int DO_NOT_DESCEND = 2; int TCAS_TA = 1; int OTHER = 2; int UNRESOLVED = 0; int UPWARD_RA = 1; int DOWNWARD_RA = 2; return Positive_RA_Alt_Thresh[Alt_Layer_Value]; }
the_stack_data/18888201.c
#include <stdio.h> #include <string.h> #include <stdint.h> #include <inttypes.h> int y = 2, x=1; int main() { intptr_t ux = (intptr_t)&x; intptr_t uy = (intptr_t)&y; intptr_t offset = uy - ux; printf("Addresses: &x=%"PRIiPTR" &y=%"PRIiPTR\ " offset=%"PRIiPTR" \n",ux,uy,offset); int *p = (int *)(ux + offset); int *q = &y; if (memcmp(&p, &q, sizeof(p)) == 0) { *p = 11; // is this free of undefined behaviour? printf("x=%d y=%d *p=%d *q=%d\n",x,y,*p,*q); } }
the_stack_data/36075938.c
#include <dlfcn.h> #include <stdio.h> int main (int argc, char *argv[]) { /* jit_libname is updated by jit-so.exp */ const char *jit_libname = "jit-dlmain-so.so"; void *h; int (*p_main) (int, char **); h = NULL; /* break here before-dlopen */ h = dlopen (jit_libname, RTLD_LAZY); if (h == NULL) return 1; p_main = dlsym (h, "jit_dl_main"); if (p_main == NULL) return 2; h = h; /* break here after-dlopen */ return (*p_main) (argc, argv); }
the_stack_data/206393680.c
#include "stddef.h" #include "sys/wait.h" pid_t waitpid(pid_t pid, int *status, int options) { return wait4(pid, status, options, NULL); }
the_stack_data/70208.c
int g; int * h() { return &g; } int *f() { return h(); }
the_stack_data/136935.c
struct S { int a; int b; } s = { .b = 1, .a = 2 }; char hello[] = { 'a', 'b', [5] = 'c'}; void foo(void) { struct S s2 = (struct S) { .a = s.b, .b = s.a }; return; }
the_stack_data/45449781.c
#include<stdio.h> int main(){ printf("Swornim Shrestha \n Chautara, Sindhupalchok"); return 0; }
the_stack_data/134466.c
/* * $smu-mark$ * $name: memlock.c$ * $other_author: Alfonso De Gregorio <[email protected]> * $other_copyright: Copyright (C) 1999 by Alfonso De Gregorio * $license: This software is under GPL version 2 of license$ * $date: Fri Nov 5 11:55:48 MET 1999$ * $rev: 2$ */ #include <unistd.h> #include <sys/mman.h> int memlock(char *addr, size_t size) { #ifdef _POSIX_MEMLOCK_RANGE unsigned long page_offset, page_size; page_size = sysconf(_SC_PAGESIZE); /* also <limits.h> .. */ page_offset = (unsigned long) addr % page_size; addr -= page_offset; size += page_offset; return ( mlock(addr, size) ); #endif return (-1); }
the_stack_data/93995.c
#include <stdio.h> #include <string.h> #define DENSITY 62.4 int main(void){ float weight, volume; int size, letters; char name[40]; printf("Hi! Tell me what's your first name?\n"); scanf("%s", name); printf("%s, what's your weight in pounds?\n", name); scanf("%f", &weight); volume = weight/DENSITY; size = sizeof(name); letters = strlen(name); printf("Well, %s your volume is %2.2f cubic feet.\n", name, volume); printf("Also, your first name has %d letters.\n", letters); printf("and we have %d bytes to store your name.\n", size); return 0; }
the_stack_data/113320.c
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <dirent.h> #include <unistd.h> int main(int argc, char **argv){ struct dirent *pDirent; DIR *pDir; if(argc <2){ printf("Usage: ./opendir <dirname>\n"); return 1; } pDir = opendir(argv[1]); if(pDir==NULL){ printf("Cannot open directory '%s'\n",argv[1]); return 1; } while((pDirent=readdir(pDir))!=NULL){ printf("Name: %s inode: %d\n",pDirent->d_name,(int)pDirent->d_ino); } closedir(pDir); return 0; }
the_stack_data/593784.c
// // Created by ANDY on 2018/11/23. // #include <stdio.h> #define IN 1 #define OUT 0 int countWord() { int c, nl, nw, nc, state; state = OUT; nl = nw = nc = 0; while ((c = getchar()) != EOF) { nc++; if (c == '\n') nl++; if (c == ' ' || c == '\n' || c == '\t') state = OUT; else if (state == OUT) { state = IN; nw++; } } printf("%d %d %d\n", nl, nw, nc); }
the_stack_data/200143739.c
/* * KubOS HAL * Copyright (C) 2016 Kubos 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. */ #if (defined YOTTA_CFG_HARDWARE_I2C) && (YOTTA_CFG_HARDWARE_I2C_COUNT > 0) #include "kubos-hal/i2c.h" #include <string.h> #include <stdio.h> //Test line static KI2C k_i2cs[K_NUM_I2CS]; KI2CStatus k_i2c_init(KI2CNum i2c, KI2CConf *conf) { KI2C *k_i2c = kprv_i2c_get(i2c); if ((k_i2c != NULL) && (k_i2c->bus_num == K_I2C_NO_BUS)) { memcpy(&k_i2c->conf, conf, sizeof(KI2CConf)); k_i2c->bus_num = i2c; csp_mutex_create(&(k_i2c->i2c_lock)); return kprv_i2c_dev_init(i2c); } return I2C_OK; } void k_i2c_terminate(KI2CNum i2c) { KI2C *k_i2c = kprv_i2c_get(i2c); if ((k_i2c != NULL) && (k_i2c->bus_num != K_I2C_NO_BUS)) { kprv_i2c_dev_terminate(i2c); csp_mutex_remove(&(k_i2c->i2c_lock)); k_i2c->bus_num = K_I2C_NO_BUS; } } KI2CConf k_i2c_conf_defaults(void) { return (KI2CConf) { .addressing_mode = YOTTA_CFG_HARDWARE_I2C_DEFAULTS_ADDRESSINGMODE, .role = YOTTA_CFG_HARDWARE_I2C_DEFAULTS_ROLE, .clock_speed = YOTTA_CFG_HARDWARE_I2C_DEFAULTS_CLOCKSPEED }; } void k_i2c_default_init() { KI2CConf conf = k_i2c_conf_defaults(); k_i2c_init(DEFAULT_I2C, &conf); } void k_i2c_default_dev_init(KI2CNum i2c) { KI2CConf conf = k_i2c_conf_defaults(); k_i2c_init(i2c, &conf); } KI2CStatus k_i2c_write(KI2CNum i2c, uint16_t addr, uint8_t* ptr, int len) { KI2C * ki2c = kprv_i2c_get(i2c); KI2CStatus ret = I2C_ERROR; if ((ki2c != NULL) && (ki2c->bus_num != K_I2C_NO_BUS) && (ptr != NULL)) { // Today...block indefinitely if (csp_mutex_lock(&(ki2c->i2c_lock), CSP_MAX_DELAY) == CSP_SEMAPHORE_OK) { ret = kprv_i2c_master_write(i2c, addr, ptr, len); csp_mutex_unlock(&(ki2c->i2c_lock)); } } return ret; } KI2CStatus k_i2c_read(KI2CNum i2c, uint16_t addr, uint8_t* ptr, int len) { KI2C * ki2c = kprv_i2c_get(i2c); KI2CStatus ret = I2C_ERROR; if ((ki2c != NULL) && (ki2c->bus_num != K_I2C_NO_BUS) && (ptr != NULL)) { // Today...block indefinitely if (csp_mutex_lock(&(ki2c->i2c_lock), CSP_MAX_DELAY) == CSP_SEMAPHORE_OK) { ret = kprv_i2c_master_read(i2c, addr, ptr, len); csp_mutex_unlock(&(ki2c->i2c_lock)); } } return ret; } KI2C* kprv_i2c_get(KI2CNum i2c) { //Validate I2C number if(i2c > (K_NUM_I2CS) || i2c < 1) { return NULL; } return &k_i2cs[i2c - 1]; } #endif
the_stack_data/22313.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <math.h> #define forr(i, a, b) for(int i=a;i<b;i++) #define forp(i, a, b) for(int i=a;i<=b;i++) #define times(n) int _##n=n;while(_##n--) #define mset(d, v) memset(d,v,sizeof(d)) #define min(a, b) (((a)<=(b))?(a):(b)) #define swap(a, b) (a)^=(b)^=(a)^=(b) #define input(x) scanf("%d",&x) #define read(x) int x;input(x) #define prtl() putchar('\n') #define prti(x) printf("%d", x) #define prta(x, a, b) forr(i,a,b){if(i!=a)putchar(' ');prti(x[i]);} int cmp(const void* a,const void* b){return *((int*)a)-*((int*)b);} #define MAXN 100000 #define MAXSTR 1000 #define MOD 7 // Number Sequence static inline int f(int a, int b, int n) { if (n <= 2) return 1; int fm2 = 1, fm1 = 1, f; n -= 2; while (n--) { f = (a * fm1 + b * fm2) % 7; fm2 = fm1; fm1 = f; } return f; } int main() { int a, b, n; while(~scanf("%d%d%d", &a, &b, &n)) { if (!a & !b && !n) break; printf("%d\n", f(a % MOD, b % MOD, n)); } }
the_stack_data/484535.c
/** ***************************************************************************************** * Copyright(c) 2015, Realtek Semiconductor Corporation. All rights reserved. ***************************************************************************************** * @file generic_client_property_server.c * @brief Source file for generic on off client model. * @details Data types and external functions declaration. * @author bill * @date 2017-12-22 * @version v1.0 * ************************************************************************************* */ /* Add Includes here */
the_stack_data/263485.c
#include <stdio.h> double sumVector(double *n, int fst, int lst) {double soma = 0; for(int i = fst; i < lst; i++) { soma += n[i]; } return soma; } int main(void) {double m[12][12]; //int line = 0; char ch = 'o'; //scanf("%d", &line); scanf(" %c", &ch); for(int i = 0; i < 12; i++) { for(int j = 0; j < 12; j++) { scanf("%lf", &m[i][j]); } } double soma = 0; int j = 7; int k = 8; for(int i = 7; i < 12; i++) { soma += sumVector(m[i], (j-1), (k+1)); j--; k++; } /*int decrement = 11; for(int i = 0; i < 11; i++) { }*/ if(ch == 'S') { printf("%.1lf\n", soma); } double media = 0; if(ch == 'M') {media = ((soma) / (30)); printf("%.1lf\n", media); } return 0; }
the_stack_data/181392797.c
// 7 kyu // Shortest Word #include <sys/types.h> #include <string.h> ssize_t find_short(const char *s) { char i = -1, max = 100; for (; *s != '\0'; s++) { i++; if (*s == ' ') { if (i < max) max = i; i = -1; }; }; if (i++ < max) max = i; return (max); };
the_stack_data/937583.c
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <pthread.h> #include <unistd.h> void sigsev(){ printf("segment fault!!!\n"); } static void *thread_fun1(void *arg){ while(1){ printf("thread 1\n"); sleep(1); //return NULL; } return NULL; } static void *thread_fun2(void *arg){ while(1){ printf("thread 2\n"); sleep(2); } return NULL; } int main(){ int *a = NULL; pthread_t thread1,thread2; //signal(SIGSEGV,sigsev); pthread_create(&thread1, NULL, &thread_fun1, NULL); pthread_create(&thread2, NULL, &thread_fun2, NULL); sleep(1); printf("hello world\n"); //*a = 1; //raise(SIGSEGV); printf("2222\n"); pthread_join(thread1, NULL); pthread_join(thread2, NULL); return 0; }
the_stack_data/198581754.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_rev_params.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fsharif <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/11/20 19:56:53 by fsharif #+# #+# */ /* Updated: 2021/11/20 19:57:24 by fsharif ### ########.fr */ /* */ /* ************************************************************************** */ #include<unistd.h> int main(int argc, char *argv[]) { int i; i = argc - 1; while (i > 0) { while (*argv[i]) { write (1, argv[i]++, 1); } write (1, "\n", 1); i--; } return (0); }
the_stack_data/45947.c
/*****************************************************************************/ /* */ /* Logswan 2.0.3 */ /* Copyright (c) 2015-2018, Frederic Cambus */ /* https://www.logswan.org */ /* */ /* Created: 2015-05-31 */ /* Last Updated: 2018-10-15 */ /* */ /* Logswan is released under the BSD 2-Clause license. */ /* See LICENSE file for details. */ /* */ /*****************************************************************************/ char *countriesId[] = { "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW" }; char *countriesNames[] = { "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Aland", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Saint Barthelemy", "Bermuda", "Brunei", "Bolivia", "Bonaire", "Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Democratic Republic of the Congo", "Central African Republic", "Republic of the Congo", "Switzerland", "Ivory Coast", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde", "Curacao", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands", "Micronesia", "Faroe Islands", "France", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana", "Guernsey", "Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "Isle of Man", "India", "British Indian Ocean Territory", "Iraq", "Iran", "Iceland", "Italy", "Jersey", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "North Korea", "South Korea", "Kuwait", "Cayman Islands", "Kazakhstan", "Laos", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova", "Montenegro", "Saint Martin", "Madagascar", "Marshall Islands", "Macedonia", "Mali", "Myanmar", "Mongolia", "Macao", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestine", "Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", "Serbia", "Russia", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "South Sudan", "Sao Tome and Principe", "El Salvador", "Sint Maarten", "Syria", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "East Timor", "Turkmenistan", "Tunisia", "Tonga", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan", "Tanzania", "Ukraine", "Uganda", "U.S. Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", "Vatican City", "Saint Vincent and the Grenadines", "Venezuela", "British Virgin Islands", "U.S. Virgin Islands", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Kosovo", "Yemen", "Mayotte", "South Africa", "Zambia", "Zimbabwe" };
the_stack_data/90763022.c
/* This testcase is part of GDB, the GNU debugger. Copyright 2014-2020 Free Software Foundation, Inc. This program 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 3 of the License, or (at your option) any later version. This program 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 program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void some_function (void) { } int main (int argc, char **argv) { size_t len; char *bin; len = strlen (argv[0]); bin = malloc (len + 1); memcpy (bin, argv[0], len + 1); if (bin[len - 1] == '1') bin[len - 1] = '2'; execl (bin, bin, (char *) NULL); perror ("execl failed"); some_function (); exit (1); }
the_stack_data/51701188.c
/* Creating a variadic function that calculates the total of a bunch of drinks */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> enum drink { MUDSLIDE, FUZZY_NAVEL, MONKEY_GLAND, ZOMBIE }; double price(enum drink d) { switch (d) { case MUDSLIDE: return 6.79; case FUZZY_NAVEL: return 5.31; case MONKEY_GLAND: return 4.82; case ZOMBIE: return 5.89; } return 0; } double total(int args, ...) { double total = 0; va_list drink_list; va_start(drink_list, args); int i; for (i = 0; i < args; i++) { total += price(va_arg(drink_list, enum drink)); } va_end(drink_list); return total; } int main(int argc, char *argv[]) { printf("Price is %.2f\n", total(2, MONKEY_GLAND, MUDSLIDE)); printf("Price is %.2f\n", total(3, MONKEY_GLAND, MUDSLIDE, FUZZY_NAVEL)); printf("Price is %.2f\n", total(1, ZOMBIE)); return 0; }
the_stack_data/145451799.c
#include<stdio.h> void main() { int m,n,i; printf("Enter the first number:"); scanf("%d",&m); printf("\nEnter the last number:"); scanf("%d",&n); for(i=m;i<=n;i++) { if(i%3==0 && i%5==0) printf("FIZZBUZZ\n"); else if(i%3==0) printf("FIZZ\n"); else if(i%5==0) printf("BUZZ\n"); else printf("%d\n",i); } }
the_stack_data/51700200.c
/* * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 * The President and Fellows of Harvard College. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY 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 UNIVERSITY 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. */ /* * zhog.c * Like the xhog program from testbin, but z * */ #include <stdio.h> int main(void) { volatile int i; for (i=0; i<50000; i++) { if (i%10000 == 0) { putchar('z'); } } putchar('\n'); return 0; }
the_stack_data/384228.c
#include <stdint.h> const uint8_t loopPinsBMP[6256] = { 0x42,0x4D,0x70,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x68,0x02, 0x00,0x00,0x01,0x00,0x04,0x00,0x02,0x00,0x00,0x00,0x1E,0x18,0x00,0x00,0x27,0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x07,0x00, 0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x47,0x37,0x73,0x00,0x87,0x77,0xAB,0x00,0xDB,0xCB, 0xF7,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0xFF,0x00,0x02,0x23,0x0E,0x33,0x00,0x00,0x02,0x52,0x0C,0x33,0x02,0x32,0x00,0x00, 0x02,0x55,0x02,0x23,0x0A,0x33,0x02,0x25,0x00,0x00,0x02,0x55,0x02,0x52,0x08,0x33,0x02,0x32,0x02,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x23,0x33,0x33,0x33,0x25,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x52,0x33,0x33,0x32,0x55,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x55,0x23,0x33,0x25,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x55,0x52,0x32,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x25,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x10,0x22,0x00,0x00,0x02,0x54, 0x02,0x43,0x0A,0x33,0x02,0x32,0x00,0x00,0x02,0x55,0x02,0x44,0x0A,0x33,0x02,0x25,0x00,0x00,0x00,0x10,0x55,0x54,0x43,0x33, 0x33,0x33,0x32,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x44,0x33,0x33,0x33,0x25,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x54,0x43, 0x33,0x32,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x55,0x44,0x33,0x25,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x55,0x54, 0x32,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x25,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x35,0x55,0x55,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x55,0x53,0x33,0x55,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x55,0x33,0x33,0x35,0x55,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x53,0x33,0x33,0x33,0x55,0x55,0x00,0x00,0x02,0x55,0x02,0x55,0x08,0x33,0x02,0x35,0x02,0x55,0x00,0x00,0x02,0x55, 0x02,0x53,0x0A,0x33,0x02,0x55,0x00,0x00,0x02,0x55,0x0C,0x33,0x02,0x35,0x00,0x00,0x02,0x53,0x0E,0x33,0x00,0x00,0x10,0x22, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55, 0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55, 0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00, 0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08, 0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55, 0x00,0x00,0x08,0x55,0x00,0x08,0x65,0x55,0x55,0x55,0x00,0x00,0x08,0x55,0x00,0x08,0x25,0x55,0x55,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x55,0x52,0x22,0x55,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x55,0x23,0x32,0x25,0x55,0x55,0x00,0x00,0x00,0x10, 0x55,0x55,0x52,0x33,0x33,0x22,0x55,0x55,0x00,0x00,0x00,0x10,0x55,0x55,0x23,0x33,0x33,0x32,0x25,0x55,0x00,0x00,0x02,0x55, 0x02,0x52,0x08,0x33,0x02,0x22,0x02,0x55,0x00,0x00,0x02,0x55,0x02,0x23,0x08,0x33,0x02,0x32,0x02,0x25,0x00,0x00,0x02,0x52, 0x0C,0x33,0x02,0x22,0x00,0x00,0x02,0x24,0x0C,0x44,0x02,0x43,0x00,0x01,0x00,0x00 };
the_stack_data/73574794.c
/* About: Opens/creates a file and writes into it. Use: ./echo_file_sys_call <file> "text" [-a] Parameters: -a For appending at the end of the file By: Cesar Augusto Garcia Perez */ #include <unistd.h> //include POSIX functions and declarations as read(), write(), close() #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/syscall.h> #include <errno.h> #include <sys/stat.h> #include <string.h> int main(int argc, char const *argv[]){ int fd; char buffer[strlen(argv[2])]; //buffer is a memory-space to allow exchange of information if(argc >= 4 ){ if(strcmp ("-a",argv[3]) == 0){ fd = syscall(SYS_open, argv[1], O_WRONLY | O_CREAT | O_APPEND , 0755); } }else{ fd = syscall(SYS_open, argv[1], O_WRONLY | O_CREAT | O_TRUNC , 0755); } strcat(buffer, argv[2]); syscall(SYS_write, fd, buffer, strlen(buffer)); close(fd); exit(1); }
the_stack_data/64199341.c
/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include <stdio.h> /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include <stdlib.h> #include <unistd.h> /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include <io.h> #include <stdlib.h> #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 12 #define YY_END_OF_BUFFER 13 static yyconst short int yy_accept[43] = { 0, 0, 0, 13, 11, 1, 7, 10, 5, 11, 4, 9, 9, 9, 9, 7, 7, 6, 10, 10, 5, 5, 4, 0, 2, 3, 0, 4, 9, 9, 9, 9, 8, 9, 5, 2, 3, 2, 9, 9, 2, 9, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 6, 1, 6, 7, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 10, 1, 9, 9, 9, 9, 11, 12, 9, 13, 14, 9, 9, 15, 9, 9, 9, 9, 9, 9, 16, 9, 9, 9, 17, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[18] = { 0, 1, 2, 3, 1, 1, 1, 1, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4 } ; static yyconst short int yy_base[48] = { 0, 0, 0, 90, 91, 91, 17, 86, 12, 22, 18, 21, 26, 20, 24, 41, 0, 0, 85, 84, 0, 46, 36, 78, 0, 32, 0, 42, 0, 70, 69, 40, 68, 44, 69, 54, 55, 62, 53, 52, 58, 0, 91, 68, 71, 75, 77, 49 } ; static yyconst short int yy_def[48] = { 0, 42, 1, 42, 42, 42, 43, 44, 45, 42, 42, 46, 46, 12, 12, 43, 15, 15, 44, 44, 45, 45, 45, 42, 9, 42, 9, 42, 47, 12, 12, 12, 12, 12, 45, 45, 45, 42, 12, 12, 45, 38, 0, 42, 42, 42, 42, 42 } ; static yyconst short int yy_nxt[109] = { 0, 4, 5, 4, 6, 7, 8, 9, 10, 11, 11, 12, 11, 11, 13, 11, 11, 14, 15, 21, 22, 17, 15, 15, 15, 26, 27, 15, 23, 28, 24, 30, 32, 25, 28, 29, 30, 33, 23, 29, 37, 31, 15, 21, 22, 17, 15, 15, 15, 26, 27, 15, 34, 28, 35, 29, 38, 36, 39, 29, 34, 34, 35, 40, 32, 36, 40, 41, 29, 16, 37, 16, 16, 16, 19, 19, 20, 40, 20, 20, 20, 29, 29, 29, 29, 29, 37, 42, 18, 18, 42, 3, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 } ; static yyconst short int yy_chk[109] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 8, 8, 6, 6, 6, 6, 10, 10, 6, 9, 11, 9, 11, 13, 9, 12, 13, 12, 14, 25, 14, 25, 12, 15, 22, 22, 15, 15, 15, 15, 27, 27, 15, 21, 47, 21, 31, 31, 21, 33, 33, 35, 36, 35, 36, 38, 35, 40, 39, 38, 43, 37, 43, 43, 43, 44, 44, 45, 34, 45, 45, 45, 46, 46, 32, 30, 29, 23, 19, 18, 7, 3, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "tp01.l" #define INITIAL 0 /*****************************************************************/ /********************* TP01 Compilation 2021 *********************/ /*****************************************************************/ /****************** Made with ❤ by Imed Jaberi ******************/ /**************** <https://www.3imed-jaberi.com> *****************/ /************************* MIT Licensed **************************/ /*****************************************************************/ /* variable declaration */ #line 14 "tp01.l" int linesCounter; FILE *errorsLogger; /* regexp declaration aka rules */ /* regexp handlers aka rules handlers */ #line 411 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include <stdlib.h> #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 39 "tp01.l" #line 564 "lex.yy.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 43 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 91 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 40 "tp01.l" { ++linesCounter; } YY_BREAK case 2: YY_RULE_SETUP #line 42 "tp01.l" { printf("REEL : %s \n", yytext); } YY_BREAK case 3: YY_RULE_SETUP #line 43 "tp01.l" { fprintf(errorsLogger, "%s *** ligne %d *** exposant attendu\n", yytext, linesCounter); } YY_BREAK case 4: YY_RULE_SETUP #line 45 "tp01.l" { printf("ENTIER : %s \n", yytext); } YY_BREAK case 5: YY_RULE_SETUP #line 46 "tp01.l" { fprintf(errorsLogger, "%s *** ligne %d *** nombre attendue\n", yytext, linesCounter); } YY_BREAK case 6: YY_RULE_SETUP #line 48 "tp01.l" { printf("CHAINE : %s \n", yytext); } YY_BREAK case 7: YY_RULE_SETUP #line 49 "tp01.l" { fprintf(errorsLogger, "%s *** ligne %d *** fin de chaine attendue\n", yytext, linesCounter); } YY_BREAK case 8: YY_RULE_SETUP #line 51 "tp01.l" { printf("MCLEF : %s \n", yytext); } YY_BREAK case 9: YY_RULE_SETUP #line 53 "tp01.l" { printf("IDENT : %s \n", yytext); } YY_BREAK case 10: YY_RULE_SETUP #line 55 "tp01.l" { printf("COMMENT : %s \n", yytext); } YY_BREAK case 11: YY_RULE_SETUP #line 57 "tp01.l" { printf("caractere incorrect\n"); } YY_BREAK case 12: YY_RULE_SETUP #line 58 "tp01.l" ECHO; YY_BREAK #line 707 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 43 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 43 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 42); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 58 "tp01.l" /* end of file handler. when yylex is finished */ int yywrap(){ return 1; } /* behaviour flow */ void main(int argc, char *argv[]){ /* initialize the line counter variable */ linesCounter = 1; /* initialize the errorsLogger variable by create a file then open it with write and update mode */ errorsLogger = fopen("analyzer_erros_output.log", "w+"); /* expect file passed as arg to the program ---> pass it to yyin */ yyin = fopen(argv[1], "r"); /* call the lexical analyzer (handler) */ yylex(); /* close the errors logger file */ fclose(errorsLogger); /* close the input file */ fclose(yyin); }
the_stack_data/192331550.c
#include <stdio.h> main() { int valor; while(1) { printf("digite um valor: "); scanf("%d",&valor); if(valor>10) { printf("E MAIOR QUE 10! \n"); } else { printf("NAO E MAIOR QUE 10! \n"); } } }
the_stack_data/14687.c
#include <unistd.h> pid_t getpgrp( void ) { return 0; }
the_stack_data/123576701.c
#include <stdio.h> #define DIGIT_NUM 10 int main() { int arr[DIGIT_NUM] = {0}; int n, found = 0; scanf("%i", &n); while(n > 0) { arr[n % 10] += 1; n /= 10; } for (int i = 0; i < DIGIT_NUM; ++i) { if (arr[i] > 1) { found = 1; break; } } if (found) { printf("YES"); } else { printf("NO"); } }
the_stack_data/57950823.c
#include <ctype.h> #include <stdio.h> main() { printf("%d\n", atoi("123")); printf("%d\n", atoi("+1")); printf("%d\n", atoi("-0")); printf("%d\n", atoi("-123")); printf("%d\n", atoi("asd345")); printf("%d\n", atoi("789asd345")); } int atoi(char s[]) { int i, n, sign; for (i = 0; isspace(s[i]); i++) ; sign = (s[i] == '-') ? -1 : 1; if (s[i] == '+' || s[i] == '-') i++; for (n = 0; isdigit(s[i]); i++) n = 10 * n + (s[i] - '0'); return sign * n; }
the_stack_data/34513632.c
#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <math.h> int main( void ) { double trouble = exp(1000.0); if ( errno ) { printf("trouble: %f (errno: %d)\n", trouble, errno); exit(EXIT_FAILURE); } return 0; }
the_stack_data/89200744.c
/* Name: p8-04.c Purpose: Modified version of reverse.c program. Author: NiceMan1337 Date: 17.05.2022 */ #include <stdio.h> #define N 10 #define length (int) (sizeof(a) / sizeof(a[0])) int main(void) { int a[N], i; printf("Enter %d numbers: ", length); for (i = 0; i < length; i++) { scanf("%d", &a[i]); } printf("In reverse order:"); for (i = length - 1; i >= 0; i--) printf(" %d", a[i]); printf("\n"); return 0; }
the_stack_data/32249.c
/* * --------------------------------------- * Copyright (c) Sebastian Günther 2021 | * | * [email protected] | * | * SPDX-License-Identifier: BSD-3-Clause | * --------------------------------------- */ #include <stdio.h> int main(int argc, char* argv[]) { printf("Please insert a msg: "); getchar(); printf("\nGoodbye!\n"); }
the_stack_data/75137248.c
#include <stdio.h> #include <stdlib.h> struct node { int n; struct node *left; struct node *right; }; struct node *add(struct node *root, int k); void print(struct node *root); struct node *newnode(int k); int main() { int i; struct node *tree = NULL; do { scanf("%d", &i); tree = add(tree, i); } while (i); print(tree); return 0; } void print(struct node *root) { if (root!=NULL) { print(root->left); printf("%d\n", root->n); print(root->right); } } struct node *add(struct node *root, int k) { if (root == NULL) { root = newnode(k); } else if (root->n > k) { root->left = add(root->left, k); } else /*if (root->n <= k)*/ { root->right = add(root->right, k); } return root; } struct node *newnode(int k) { struct node *p; p = (struct node *)malloc(sizeof(struct node)); p->n = k; p->left = NULL; p->right = NULL; return p; };