file
stringlengths 18
26
| data
stringlengths 3
1.04M
|
---|---|
the_stack_data/1182038.c | #include <stdio.h>
#include <string.h>
int main() {
int t, str_len, i, j, k, m, word_len;
char str[1002], word[500][100];
scanf("%d", &t);
while (t--) {
scanf(" %[^\n]", str);
str_len = strlen(str);
for (i = 0, j = 0, k = 0; i < str_len; i++) {
if (str[i] == ' ') {
j++;
k = 0;
}
else {
word[j][k] = str[i];
k++;
}
}
for (i = j; i >= 0; i--) {
if (i == j) {
printf("%s", word[i]);
}
else {
printf(" %s", word[i]);
}
}
printf("\n");
}
return 0;
}
// by Shihab Mahamud |
the_stack_data/988902.c | /* PR target/59794 */
/* { dg-do compile { target { ia32 } } } */
/* { dg-options "-O2 -mno-sse" } */
/* { dg-skip-if "no SSE vector" { *-*-mingw* } } */
typedef int __v4si __attribute__ ((__vector_size__ (16)));
extern __v4si x;
__v4si
foo (void)
{ /* { dg-warning "SSE vector return without SSE enabled changes the ABI" } */
return x;
}
|
the_stack_data/34512023.c | /**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Jay Sorg 2004-2012
*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
int main(int argc, char **argv)
{
int sck;
int dis;
struct sockaddr_un sa;
size_t len;
char *p;
char *display;
if (argc != 1)
{
printf("xrdp disconnect utility\n");
printf("run with no parameters to disconnect you xrdp session\n");
return 0;
}
display = getenv("DISPLAY");
if (display == 0)
{
printf("display not set\n");
return 1;
}
dis = strtol(display + 1, &p, 10);
memset(&sa, 0, sizeof(sa));
sa.sun_family = AF_UNIX;
sprintf(sa.sun_path, "/tmp/.xrdp/xrdp_disconnect_display_%d", dis);
if (access(sa.sun_path, F_OK) != 0)
{
printf("not in an xrdp session\n");
return 1;
}
sck = socket(PF_UNIX, SOCK_DGRAM, 0);
len = sizeof(sa);
if (sendto(sck, "sig", 4, 0, (struct sockaddr *)&sa, len) > 0)
{
printf("message sent ok\n");
}
return 0;
}
|
the_stack_data/89201155.c | /* ******************************************
On Linux, compile via something like...
clang -O3 collatzPartiallySieveless_npp_GPU_nonNvidia.c -lOpenCL
On Windows with Cygwin installed...
gcc -O3 collatzPartiallySieveless_npp_GPU_nonNvidia.c /cygdrive/c/Windows/System32/OpenCL.DLL
On macOS...
clang -O3 collatzPartiallySieveless_npp_GPU_nonNvidia.c -framework opencl
Sieves of size 2^k are used, where k can be very large!
Not a huge amount of RAM is used.
You will need two OpenCL kernel files to run this code.
You'll need a 64-bit computer with a not-ancient version of gcc
in order for __uint128_t to work.
Note that I use the "long long" function strtoull when reading in the arguments.
Currently loads in a sieve file, which must must match the k1 value set in this code.
k < 81 must be true.
Parts of this file are modified from...
https://github.com/xbarin02/collatz/blob/master/src/gpuworker/gpuworker.c
The parts modified from the above project use tabs to indent
whereas my original code has no tabs.
This applies to the kernel files too, which came from modifying...
https://github.com/xbarin02/collatz/blob/master/src/gpuworker/kernel32-precalc.cl
This code requires two arguments...
./a.out TASK_ID_KERNEL2 TASK_ID
Starting at 0, increase TASK_ID by 1 each run until its max
( 2^(k - TASK_SIZE) - 1 )
Then, reset TASK_ID and increase TASK_ID_KERNEL2 by 1 (starting at 0).
Don't skip!
Here is a neat way to run this code...
seq -f %1.0f 0 1048575 | xargs -L 1 -P 1 ./a.out 0 |tee -a log.txt &
To pick up where you left off, change the start (and stop) value of seq.
k, TASK_SIZE, and TASK_SIZE_KERNEL2 should not change between runs.
For each TASK_ID_KERNEL2, 9 * 2 ^ TASK_SIZE_KERNEL2 numbers will be tested,
but only after each TASK_ID is run from 0 to ( 2^(k - TASK_SIZE) - 1 )
Why the 9? I thought it might help my GPU code, but it only does EXTREMELY SLIGHTLY.
Feel free to get rid of the 9 when h_minimum and h_supremum are defined in kernel2.
You'll also want to get rid of the division by 9 when this host program
checks if TASK_ID_KERNEL2 will cause certain overflow.
If TASK_ID_KERNEL2 > 0, you'll also want to fix the line in kernel2...
aMod = 0
I have assumed that your GPU has...
CL_DEVICE_ADDRESS_BITS == 64
If not, this will limit various run parameters.
I recommend that you play around with your device to see if it has a GPU watchdog timer.
It has one if the kernel always stops after a certain amount of time (like 5 seconds).
I would expect that, if a bunch of OVERFLOW messages are printed by kernel2
within a short period of time, some might be lost due to buffer sizes ??
55247846101001863167 will overflow 128 bits.
This number is over 64-bits, so it cannot be made into an integer literal.
To test 128-bit overflow and using printf() in kernel2,
calculate the following using Python 3, then put it as your TASK_ID_KERNEL2...
TASK_ID_KERNEL2 = 55247846101001863167 // (9 << TASK_SIZE_KERNEL2)
Then set the following as your TASK_ID...
remainder = (55247846101001863167 % (9 << TASK_SIZE_KERNEL2))
TASK_ID = (remainder % (1 << k)) // (1 << TASK_SIZE)
(c) 2021 Bradley Knockel
****************************************** */
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#include <unistd.h> // for usleep()
#include <sys/time.h>
struct timeval tv1, tv2, tv3;
/*
k < 81
*/
const int k = 51;
/*
The following are in log2...
For kernel1, which starts making the sieve...
TASK_UNITS + 8 <= TASK_SIZE <= k
Will use more than 2^TASK_SIZE bytes of RAM
Due to the limits of strtoull(), k - TASK_SIZE < 64
2^TASK_UNITS should be much larger than the number of CUDA Cores you have
(fraction of 2^k sieve not excluded) * 2^TASK_SIZE should be much larger than the number of CUDA Cores you have
My CPU-only code prefers a smaller TASK_SIZE so that the task finishes in a reasonable time
*/
const int TASK_SIZE = 24;
const int TASK_UNITS = 16;
/*
The following is in log2...
TASK_SIZE_KERNEL2 - k should ideally be at least 10
For kernel2, which tests numbers given a sieve...
9 * 2^(TASK_SIZE_KERNEL2 + TASK_SIZE - k) numbers will be run by each process
9 * 2^TASK_SIZE_KERNEL2 numbers will be run total by all processes
*/
const int TASK_SIZE_KERNEL2 = 67;
// For the 2^k1 sieve that speeds up the calculation of the 2^k sieve...
// TASK_SIZE <= k1 <= k
// The only con of a larger k1 is that the sieve file is harder to create and store,
// but, once you have the sieve file, use it!
// Especially good values are 32, 35, 37, 40, ...
const int k1 = 27;
const char file[10] = "sieve27";
// set kernel files
static const char *kernel1 = "kern1_128byHand_nonNvidia.cl";
static const char *kernel2 = "kern2_npp_128byHand_nonNvidia.cl";
// set to 1 if you don't want to use OpenCL 2.0 (else 0)
const int g_ocl_ver1 = 0;
/*
If your GPU has a watchdog timer, make CHUNKS_KERNEL2 larger than 0,
and have a small secondsKernel2.
CHUNKS_KERNEL2 <= TASK_SIZE_KERNEL2 - k
2^CHUNKS_KERNEL2 chunks will be run.
Increase CHUNKS_KERNEL2 if secondsKernel2 time limit is being reached.
*/
const int CHUNKS_KERNEL2 = 9;
const double secondsKernel2 = 4.5; // 1.0E32 is a good value if not watchdog timer
// Prints __uint128_t numbers since printf("%llu\n", x) doesn't work
// since "long long" is only 64-bit in gcc.
// This function works for any non-negative integer less than 128 bits.
void print128(__uint128_t n) {
char a[40] = { '\0' };
char *p = a + 39;
if (n==0) { *--p = (char)('0'); }
else { for (; n != 0; n /= 10) *--p = (char)('0' + n % 10); }
printf("%s", p);
}
char *load_source(size_t *size, int num)
{
FILE *fp;
char *str;
if ( num == 1 )
fp = fopen(kernel1, "r");
else
fp = fopen(kernel2, "r");
if (fp == NULL)
return NULL;
str = malloc(1<<20);
if (str == NULL)
return NULL;
*size = fread(str, 1, 1<<20, fp);
fclose(fp);
return str;
}
int main(int argc, char *argv[]) {
if( argc < 3 ) {
printf("Too few arguments. Aborting.\n");
return 0;
}
uint64_t TASK_ID_KERNEL2 = (uint64_t)strtoull(argv[1], NULL, 10);
uint64_t TASK_ID = (uint64_t)strtoull(argv[2], NULL, 10);
uint64_t maxTaskID = ((uint64_t)1 << (k - TASK_SIZE));
if ( TASK_ID >= maxTaskID ) {
printf("Aborting. TASK_ID must be less than ");
print128( maxTaskID );
printf("\n");
return 0;
}
/* Check for 100%-certain overflow.
This check prevents having to check when doing any pre-calculation when interlacing
Note that after k steps, for A * 2^k + B...
B = 2^k - 1 will become 3^k - 1
and A*2^k will become A*3^k
*/
__uint128_t temp = 1; // will equal 3^k
__uint128_t UINT128_MAX = (~(__uint128_t)0);
for (int i=0; i < k; i++) { temp *= 3; }
if ( (__uint128_t)TASK_ID_KERNEL2 > ((UINT128_MAX - temp) >> (TASK_SIZE_KERNEL2 - k)) / 9 / temp - 1 ) {
printf(" Well, aren't you ambitious!\n");
return 0;
}
printf("TASK_ID_KERNEL2 = ");
print128(TASK_ID_KERNEL2);
printf("\nTASK_ID = ");
print128(TASK_ID);
printf("\nTASK_ID must be less than ");
print128(maxTaskID);
printf("\nTASK_SIZE = ");
print128(TASK_SIZE);
printf("\nTASK_SIZE_KERNEL2 = ");
print128(TASK_SIZE_KERNEL2);
printf("\n k = %i\n", k);
printf(" k1 = %i\n", k1);
printf("\n");
fflush(stdout);
// start timing
gettimeofday(&tv1, NULL);
/* setup OpenCL */
int g_device_index = 0;
cl_mem mem_obj_arraySmall;
cl_mem mem_obj_arrayLarge;
cl_mem mem_obj_arrayIncreases;
cl_mem mem_obj_indices;
size_t arraySmallCount = ((size_t)1 << (TASK_SIZE - 8)) + 1; // each element is 2^8 numbers; add 1 to prevent kern1 from reading too far
size_t arrayLargeCount = (size_t)1 << (TASK_SIZE - 3); // two of these are needed per uint128
size_t arrayIncreasesCount = (size_t)1 << (TASK_SIZE - 4); // one for each bit in portion of 2^k1 sieve
size_t indicesCount = (size_t)1 << (TASK_SIZE - 4); // not all of this will be used
uint16_t *arraySmall = malloc(sizeof(cl_ushort) * arraySmallCount);
uint64_t *arrayLarge = malloc(sizeof(cl_ulong) * arrayLargeCount);
uint8_t *arrayIncreases = malloc(sizeof(cl_uchar) * arrayIncreasesCount);
uint64_t *indices = malloc(sizeof(cl_ulong) *indicesCount);
if ( arraySmall == NULL || arrayLarge == NULL || arrayIncreases == NULL || indices == NULL ) {
return -1;
}
cl_int ret;
cl_platform_id platform_id[64];
cl_uint num_platforms;
cl_device_id *device_id = NULL;
cl_uint num_devices;
cl_context context;
cl_command_queue command_queue;
char *program_string1;
char *program_string2;
size_t program_length1;
size_t program_length2;
cl_program program1;
cl_program program2;
cl_kernel kernel1;
cl_kernel kernel2;
size_t global_work_size1;
size_t global_work_size2;
int platform_index = 0;
int device_index = g_device_index;
char options1[4096];
char options2[4096];
ret = clGetPlatformIDs(0, NULL, &num_platforms);
if (ret != CL_SUCCESS) {
printf("[ERROR] clGetPlarformIDs failed with = %" PRIi32 "\n", ret);
return -1;
}
printf("[DEBUG] num_platforms = %u\n", (unsigned)num_platforms);
if (num_platforms == 0) {
printf("[ERROR] no platform\n");
return -1;
}
ret = clGetPlatformIDs(num_platforms, &platform_id[0], NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clGetPlarformIDs failed\n");
return -1;
}
next_platform:
printf("[DEBUG] platform = %i\n", platform_index);
num_devices = 0;
ret = clGetDeviceIDs(platform_id[platform_index], CL_DEVICE_TYPE_GPU, 0, NULL, &num_devices);
if (ret == CL_DEVICE_NOT_FOUND) {
if ((cl_uint)platform_index + 1 < num_platforms) {
platform_index++;
goto next_platform;
}
}
if (ret != CL_SUCCESS) {
printf("[ERROR] clGetDeviceIDs failed with %" PRIi32 "\n", ret);
return -1;
}
printf("[DEBUG] num_devices = %u\n", num_devices);
device_id = malloc(sizeof(cl_device_id) * num_devices);
if (device_id == NULL) {
return -1;
}
ret = clGetDeviceIDs(platform_id[platform_index], CL_DEVICE_TYPE_GPU, num_devices, &device_id[0], NULL);
if (ret != CL_SUCCESS) {
return -1;
}
for (; (cl_uint)device_index < num_devices; ++device_index) {
printf("[DEBUG] device_index = %i...\n", device_index);
context = clCreateContext(NULL, 1, &device_id[device_index], NULL, NULL, &ret);
if (ret == CL_INVALID_DEVICE) {
continue;
}
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateContext failed with %" PRIi32 "\n", ret);
return -1;
}
printf("[DEBUG] context created @ device_index = %i\n", device_index);
command_queue = clCreateCommandQueue(context, device_id[device_index], 0, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateCommandQueue failed\n");
return -1;
}
mem_obj_arraySmall = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(cl_ushort) * arraySmallCount, NULL, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateBuffer failed\n");
return -1;
}
mem_obj_arrayLarge = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_ulong) * arrayLargeCount, NULL, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateBuffer failed\n");
return -1;
}
mem_obj_arrayIncreases = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_uchar) * arrayIncreasesCount, NULL, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateBuffer failed\n");
return -1;
}
mem_obj_indices = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(cl_ulong) * indicesCount, NULL, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateBuffer failed\n");
return -1;
}
program_string1 = load_source(&program_length1, 1);
if (program_string1 == NULL) {
printf("[ERROR] load_source failed\n");
return -1;
}
program1 = clCreateProgramWithSource(context, 1, (const char **)&program_string1, (const size_t *)&program_length1, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateProgramWithSource failed\n");
return -1;
}
sprintf(options1, "%s -D SIEVE_LOGSIZE=%i -D TASK_ID=%" PRIu64 " -D TASK_SIZE=%i -D TASK_UNITS=%i",
g_ocl_ver1 ? "" : "-cl-std=CL2.0",
k,
TASK_ID,
TASK_SIZE,
TASK_UNITS
);
printf("[DEBUG] clBuildProgram options1: %s\n", options1);
ret = clBuildProgram(program1, 1, &device_id[device_index], options1, NULL, NULL);
if (ret == CL_BUILD_PROGRAM_FAILURE) {
size_t log_size;
char *log;
clGetProgramBuildInfo(program1, device_id[device_index], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
log = malloc(log_size);
clGetProgramBuildInfo(program1, device_id[device_index], CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
printf("%s\n", log);
}
if (ret != CL_SUCCESS) {
printf("[ERROR] clBuildProgram failed with %" PRIi32 "\n", ret);
return -1;
}
kernel1 = clCreateKernel(program1, "worker", &ret);
if (ret != CL_SUCCESS) {
return -1;
}
global_work_size1 = (size_t)1 << TASK_UNITS;
printf("[DEBUG] global_work_size1 = %zu\n", global_work_size1);
ret = clSetKernelArg(kernel1, 0, sizeof(cl_mem), (void *)&mem_obj_arraySmall);
if (ret != CL_SUCCESS) {
return -1;
}
ret = clSetKernelArg(kernel1, 1, sizeof(cl_mem), (void *)& mem_obj_arrayLarge);
if (ret != CL_SUCCESS) {
return -1;
}
ret = clSetKernelArg(kernel1, 2, sizeof(cl_mem), (void *)&mem_obj_arrayIncreases);
if (ret != CL_SUCCESS) {
return -1;
}
program_string2 = load_source(&program_length2, 2);
if (program_string2 == NULL) {
printf("[ERROR] load_source failed\n");
return -1;
}
program2 = clCreateProgramWithSource(context, 1, (const char **)&program_string2, (const size_t *)&program_length2, &ret);
if (ret != CL_SUCCESS) {
printf("[ERROR] clCreateProgramWithSource failed\n");
return -1;
}
sprintf(options2, "%s -D SIEVE_LOGSIZE=%i -D TASK_SIZE=%i -D TASK_ID=%" PRIu64 " -D TASK_SIZE_KERNEL2=%i -D TASK_ID_KERNEL2=%" PRIu64 " -D CHUNKS_KERNEL2=%i",
g_ocl_ver1 ? "" : "-cl-std=CL2.0",
k,
TASK_SIZE,
TASK_ID,
TASK_SIZE_KERNEL2,
TASK_ID_KERNEL2,
CHUNKS_KERNEL2
);
printf("[DEBUG] clBuildProgram options2: %s\n", options2);
ret = clBuildProgram(program2, 1, &device_id[device_index], options2, NULL, NULL);
if (ret == CL_BUILD_PROGRAM_FAILURE) {
size_t log_size;
char *log;
clGetProgramBuildInfo(program2, device_id[device_index], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
log = malloc(log_size);
clGetProgramBuildInfo(program2, device_id[device_index], CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
printf("%s\n", log);
}
if (ret != CL_SUCCESS) {
printf("[ERROR] clBuildProgram failed with %" PRIi32 "\n", ret);
return -1;
}
kernel2 = clCreateKernel(program2, "worker", &ret);
if (ret != CL_SUCCESS) {
return -1;
}
ret = clSetKernelArg(kernel2, 0, sizeof(cl_mem), (void *)&mem_obj_indices);
if (ret != CL_SUCCESS) {
return -1;
}
ret = clSetKernelArg(kernel2, 1, sizeof(cl_mem), (void *)& mem_obj_arrayLarge);
if (ret != CL_SUCCESS) {
return -1;
}
ret = clSetKernelArg(kernel2, 2, sizeof(cl_mem), (void *)&mem_obj_arrayIncreases);
if (ret != CL_SUCCESS) {
return -1;
}
/* test for 64-bit arithmetic errors */
const uint64_t inputVal = 45210249143;
const char *kernelString =
"__kernel void kernelFunc(const ulong a, __global ulong *c) { c[0] = a+a+a;}";
// Compile the kernelString
cl_program programTest = clCreateProgramWithSource(context, 1, &kernelString, NULL, &ret);
if (ret != CL_SUCCESS) {printf("[ERROR] clCreateProgramWithSource failed\n"); return -1;}
char *optionsTest = g_ocl_ver1 ? "" : "-cl-std=CL2.0";
ret = clBuildProgram(programTest, 1, &device_id[device_index], optionsTest, NULL, NULL);
// Check for compilation errors
if (ret == CL_BUILD_PROGRAM_FAILURE) {
size_t logSize;
clGetProgramBuildInfo(programTest, device_id[device_index], CL_PROGRAM_BUILD_LOG, 0, NULL, &logSize);
char* messages = (char*)malloc((1+logSize)*sizeof(char));
clGetProgramBuildInfo(programTest, device_id[device_index], CL_PROGRAM_BUILD_LOG, logSize, messages, NULL);
messages[logSize] = '\0';
if (logSize > 10) { printf(">>> Compiler message: %s\n", messages); }
return -1;
}
if (ret != CL_SUCCESS) {
printf("[ERROR] clBuildProgram failed with %" PRIi32 "\n", ret);
return -1;
}
// Run the kernel
cl_kernel kernelTest = clCreateKernel(programTest, "kernelFunc", NULL);
clSetKernelArg(kernelTest, 0, sizeof(uint64_t), (void*)&inputVal);
cl_mem mem_obj_output = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(cl_ulong), NULL, NULL);
clSetKernelArg(kernelTest, 1, sizeof(cl_mem), (void *)&mem_obj_output);
const size_t one = 1;
clEnqueueNDRangeKernel(command_queue, kernelTest, 1, NULL, &one, &one, 0, NULL, NULL);
clFlush(command_queue);
clFinish(command_queue);
// get the output
uint64_t *c = malloc(sizeof(cl_ulong));
ret = clEnqueueReadBuffer(command_queue, mem_obj_output, CL_TRUE, 0, sizeof(cl_ulong), c, 0, NULL, NULL);
if (ret != CL_SUCCESS) { printf(" [ERROR]\n"); return -1; }
// Clean-up OpenCL
clReleaseKernel(kernelTest);
clReleaseProgram(programTest);
// is there an arithmetic error?
if (c[0] != 135630747429) {
printf( "UNFORGIVABLE ERROR: 64-bit arithmetic error! %" PRIu64 "\n", c[0]);
return -1;
}
free(c);
}
/* open the 2^k1 sieve file */
FILE* fp;
size_t file_size;
fp = fopen(file, "rb");
// Check file size
// Bytes in sieve file are 2^(k1 - 7)
fseek(fp, 0, SEEK_END);
file_size = ftell(fp);
if ( file_size != ((size_t)1 << (k1 - 7)) ) {
printf(" error: wrong sieve file!\n");
return 0;
}
/*
Seek to necessary part of the file
Note that ((((uint64_t)1 << k1) - 1) & bStart) equals bStart % ((uint64_t)1 << k1)
*/
__uint128_t bStart = ( (__uint128_t)TASK_ID << TASK_SIZE );
fseek(fp, ((((uint64_t)1 << k1) - 1) & bStart) >> 7, SEEK_SET);
/*
fill arraySmall[] with part of 2^k1 array, and initialize and arrayLarge[] and arrayIncreases[] to 0,
then send to GPU
*/
fread(arraySmall, sizeof(uint16_t), arraySmallCount - 1, fp);
arraySmall[arraySmallCount - 1] = 0xffff; // to stop kern1 from reading too far
for (size_t i = 0; i < arrayLargeCount; i++) arrayLarge[i] = 0;
for (size_t i = 0; i < arrayIncreasesCount; i++) arrayIncreases[i] = 0;
ret = clEnqueueWriteBuffer(command_queue, mem_obj_arraySmall, CL_TRUE, 0, sizeof(cl_ushort) * arraySmallCount, arraySmall, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueWriteBuffer() failed with %" PRIi32 "\n", ret);
return -1;
}
ret = clEnqueueWriteBuffer(command_queue, mem_obj_arrayLarge, CL_TRUE, 0, sizeof(cl_ulong) * arrayLargeCount, arrayLarge, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueWriteBuffer() failed with %" PRIi32 "\n", ret);
return -1;
}
ret = clEnqueueWriteBuffer(command_queue, mem_obj_arrayIncreases, CL_TRUE, 0, sizeof(cl_uchar) * arrayIncreasesCount, arrayIncreases, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueWriteBuffer() failed with %" PRIi32 "\n", ret);
return -1;
}
gettimeofday(&tv2, NULL);
printf(" kernel1 is starting: %e seconds elapsed\n",
(double)(tv2.tv_usec - tv1.tv_usec) / 1000000.0 + (double)(tv2.tv_sec - tv1.tv_sec));
fflush(stdout);
/* start kernel1 */
ret = clEnqueueNDRangeKernel(command_queue, kernel1, 1, NULL, &global_work_size1, NULL, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueNDRangeKernel() failed with %" PRIi32 "\n", ret);
return -1;
}
/* wait for kernel1 to finish */
clFlush(command_queue);
clFinish(command_queue);
gettimeofday(&tv2, NULL);
printf(" kernel1 is finished: %e seconds elapsed\n",
(double)(tv2.tv_usec - tv1.tv_usec) / 1000000.0 + (double)(tv2.tv_sec - tv1.tv_sec));
fflush(stdout);
ret = clEnqueueReadBuffer(command_queue, mem_obj_arrayIncreases, CL_TRUE, 0, sizeof(uint8_t) * arrayIncreasesCount, arrayIncreases, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueReadBuffer failed with = %" PRIi32 "\n", ret);
return -1;
}
/* fill indices[] */
global_work_size2 = 0; // for seeing how much work kernel2 has to do
for (size_t index = 0; index < arrayIncreasesCount; index++) {
if (arrayIncreases[index]) {
indices[global_work_size2] = index;
global_work_size2++;
/*
uint8_t sieve8[16] = {27, 31, 47, 71, 91, 103, 111, 127, 155, 159, 167, 191, 231, 239, 251, 255};
print128(((__uint128_t)TASK_ID << TASK_SIZE) + (index / 16) * 256 + sieve8[index % 16]); printf("\n");
*/
}
}
printf("Numbers in sieve segment that need testing = %zu\n", global_work_size2);
/* pad indices[] to make global_work_size2 a multiple of 32 */
for (int j = 0; j < (global_work_size2 % 32); j++) {
indices[global_work_size2] = (~(uint64_t)0); // I believe this requires TASK_SIZE < 64 + 4
global_work_size2++;
}
/* write indices[] to GPU */
ret = clEnqueueWriteBuffer(command_queue, mem_obj_indices, CL_TRUE, 0, sizeof(uint64_t) * global_work_size2, indices, 0, NULL, NULL);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueWriteBuffer() failed with %" PRIi32 "\n", ret);
return -1;
}
// checksum stuff
cl_mem mem_obj_checksum_alpha = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(cl_ulong) * global_work_size2, NULL, &ret);
uint64_t g_checksum_alpha = 0;
clSetKernelArg(kernel2, 3, sizeof(cl_mem), (void *)&mem_obj_checksum_alpha);
uint64_t *checksum_alpha = malloc(sizeof(uint64_t) * global_work_size2);
gettimeofday(&tv2, NULL);
printf(" kernel2 is starting: %e seconds elapsed\n",
(double)(tv2.tv_usec - tv1.tv_usec) / 1000000.0 + (double)(tv2.tv_sec - tv1.tv_sec));
fflush(stdout);
for (int i = 0; i < (1 << CHUNKS_KERNEL2); i++) {
/* run kernel 2 */
clSetKernelArg(kernel2, 4, sizeof(cl_int), (void *)&i);
cl_event kernelsDone;
ret = clEnqueueNDRangeKernel(command_queue, kernel2, 1, NULL, &global_work_size2, NULL, 0, NULL, &kernelsDone);
if (ret != CL_SUCCESS) {
printf("[ERROR] clEnqueueNDRangeKernel() failed with %" PRIi32 "\n", ret);
return -1;
}
clFlush(command_queue);
/*
Wait for kernel2 to finish and enforce a time limit.
Basically, just use usleep() in a loop that checks if the kernel is done or if time limit is reached.
I would like to thank the developers at primegrid.com for sharing this idea with me!
*/
cl_int info = CL_QUEUED; // arbitrary start
while(info != CL_COMPLETE){
usleep(1000); // sleep for 1/1000 of a second
ret = clGetEventInfo(kernelsDone, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &info, NULL);
if ( ret != CL_SUCCESS ) { printf( "ERROR: clGetEventInfo\n" ); return -1; }
gettimeofday(&tv3, NULL);
if ((double)(tv3.tv_usec - tv2.tv_usec) / 1000000.0 + (double)(tv3.tv_sec - tv2.tv_sec) > secondsKernel2) {
printf( "ERROR: time limit reached!\n" );
return -1;
}
}
clReleaseEvent(kernelsDone);
// checksum stuff
clEnqueueReadBuffer(command_queue, mem_obj_checksum_alpha, CL_TRUE, 0, sizeof(uint64_t) * global_work_size2, checksum_alpha, 0, NULL, NULL);
for (long i = 0; i < global_work_size2; ++i) g_checksum_alpha += checksum_alpha[i];
gettimeofday(&tv2, NULL);
}
// checksum stuff
printf("CHECKSUM %" PRIu64 "\n", g_checksum_alpha);
free(checksum_alpha);
ret = clReleaseKernel(kernel1);
ret = clReleaseProgram(program1);
ret = clReleaseKernel(kernel2);
ret = clReleaseProgram(program2);
ret = clReleaseCommandQueue(command_queue);
ret = clReleaseContext(context);
free(program_string1);
free(program_string2);
free(device_id);
printf(" Elapsed wall time is %e seconds\n\n",
(double)(tv2.tv_usec - tv1.tv_usec) / 1000000.0 + (double)(tv2.tv_sec - tv1.tv_sec));
free(arraySmall);
free(arrayLarge);
free(arrayIncreases);
free(indices);
return 0;
}
|
the_stack_data/33458.c | /*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
#include <string.h>
char *
strchr(register const char *s, register int c)
{
c = (char) c;
while (c != *s) {
if (*s++ == '\0') return NULL;
}
return (char *)s;
}
|
the_stack_data/75136459.c | /* Generated by CIL v. 1.3.7 */
/* print_CIL_Input is true */
typedef int (*(*g[5])(int (*wtf)[5] ))(int wtf );
// a: pointer to int!
int *a =
(int *)((void *)0);
// b: pointer to function accepting int*, returning int.
int (*b)(int * ) =
(int (*)(int * ))((void *)0);
// c: an array of pointers to functions accepting int*, returning int.
int (*c[5])(int * ) =
{(int (*)(int * ))((void *)0), (int (*)(int * ))((void *)0), (int (*)(int * ))((void *)0), (int (*)(int * ))((void *)0), (int (*)(int * ))((void *)0)};
// d: an array of pointers to functions accepting pointers (to functions
// accepting ?, returning int), returning int.
int (*d[5])(int (*)() ) =
{(int (*)(int (*)() ))((void *)0), (int (*)(int (*)() ))((void *)0), (int (*)(int (*)() ))((void *)0), (int (*)(int (*)() ))((void *)0), (int (*)(int (*)() ))((void *)0)};
// e: left as an exercise to the reader.
int (*(*e[5])(int (*wtf)[5] ))(int wtf ) =
{(int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0), (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0), (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0), (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0), (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0)};
// f: this must be a function.
char (*(*f(void))[])[5]
{
{ return ((char (*(*)[])[5])((void *)0)); }
}
int main(void)
{ g x ;
char (*(*tmp)[])[5];
int a;
int b;
{
x[0] = (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0);
x[1] = (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0);
x[2] = (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0);
x[3] = (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0);
x[4] = (int (*(*)(int (*wtf)[5] ))(int wtf ))((void *)0);
tmp = f();
a = (int)tmp;
b = (int)x[4];
return 0;
}
}
|
the_stack_data/193893816.c | #include <stdio.h>
#define SUFF 18
#define MINVOTO 0
#define MAXVOTO 30
/*
Si consideri un corso X in cui l'esame è composto da due compitini,
ciascuno valutato in trentesimi. Condizione necessaria per essere
promossi è che entrambi i compitini siano sufficienti e in tal caso
il voto finale è calcolato come media dei due valori. Si noti che il
voto finale è un intero e quindi l'eventuale parte decimale non va
considerata.
Scrivere un programma che acquisisce due valori interi che
rappresentano i punteggi ottenuti da uno studente nelle due prove in
itinere; si assuma in prima istanza che l'utente inserisca
correttamente dei valori compresi tra 0 e 30.
Il programma valuta se lo studente è stato promosso o bocciato
visualizzando un apposito messaggio; in caso positivo il programma
deve anche visualizzare il voto ottenuto.
Migliorare poi il programma aggiungendo un controllo di validità dei
dati inseriti, cioè che ciascun punteggio deve essere compreso tra 0
e 30; nel caso almeno uno dei dati sia non consistente, il programma
deve visualizzare un messaggio di errore.
*/
int main() {
int a, b, media;
scanf("%d %d", &a, &b);
if (a >= MINVOTO && a <= MAXVOTO && b >= MINVOTO && b <= MAXVOTO) {
if (a >= SUFF && b >= SUFF) {
media = (a + b) / 2;
printf("Promosso: %d\n", media);
} else
printf("Bocciato.\n");
} else {
printf("Errore.\n");
}
return 0;
}
|
the_stack_data/103266555.c | /* PR tree-optimization/84383 */
struct S { char *s; };
void bar (struct S *);
void
foo (int a, char *b)
{
struct S c[4];
bar (c);
__builtin_strncpy (c[a].s, b, 32);
c[a].s[31] = '\0';
bar (c);
}
|
the_stack_data/375025.c | void printem(int a, int b, int c, int d)
{
printf("%d\n", a);
printf("%d\n", b);
printf("%d\n", c);
printf("%d\n", d);
}
int main()
{
printem(42,17,192,8);
return 0;
} |
the_stack_data/135277.c | const unsigned char local_audio_net_cfg_start[5733] = {
0x49, 0x44, 0x33, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x54, 0x53, 0x53, 0x45, 0x00, 0x00,
0x00, 0x0F, 0x00, 0x00, 0x03, 0x4C, 0x61, 0x76, 0x66, 0x35, 0x37, 0x2E, 0x38, 0x33, 0x2E, 0x31,
0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF3, 0x58,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x6E, 0x66, 0x6F, 0x00, 0x00,
0x00, 0x0F, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x16, 0x38, 0x00, 0x0C, 0x11, 0x11, 0x16, 0x16,
0x1B, 0x1B, 0x20, 0x20, 0x25, 0x25, 0x2A, 0x2A, 0x2E, 0x2E, 0x33, 0x33, 0x38, 0x38, 0x3D, 0x3D,
0x42, 0x42, 0x47, 0x47, 0x4C, 0x4C, 0x51, 0x51, 0x55, 0x55, 0x5A, 0x5A, 0x5F, 0x5F, 0x64, 0x64,
0x69, 0x69, 0x6E, 0x6E, 0x73, 0x73, 0x77, 0x77, 0x7C, 0x7C, 0x81, 0x81, 0x86, 0x8B, 0x8B, 0x90,
0x90, 0x95, 0x95, 0x99, 0x99, 0x9E, 0x9E, 0xA3, 0xA3, 0xA8, 0xA8, 0xAD, 0xAD, 0xB2, 0xB2, 0xB7,
0xB7, 0xBB, 0xBB, 0xC0, 0xC0, 0xC5, 0xC5, 0xCA, 0xCA, 0xCF, 0xCF, 0xD4, 0xD4, 0xD9, 0xD9, 0xDD,
0xDD, 0xE2, 0xE2, 0xE7, 0xE7, 0xEC, 0xEC, 0xF1, 0xF1, 0xF6, 0xF6, 0xFB, 0xFB, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x4C, 0x61, 0x76, 0x63, 0x35, 0x37, 0x2E, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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xFF, 0x6A, 0x4D, 0x49, 0x82, 0x82, 0x04, 0x1E, 0xFF,
0x16, 0x79, 0x55, 0xE8, 0x02, 0x8A, 0x3E, 0xF0, 0xAF, 0xB5, 0xDA, 0xC9, 0x3F, 0xD2, 0xAA, 0x10,
0xE3, 0xBD, 0x2D, 0x49, 0x4A, 0xAB, 0x72, 0x49, 0x69, 0x45, 0x2B, 0xBF, 0xD9, 0xA5, 0x15, 0xFF,
0x18, 0x68, 0xAA, 0x7F, 0xD9, 0x15, 0x5B, 0xBB, 0x7B, 0x26, 0x8A, 0x22, 0x5B, 0x7E, 0x53, 0x25,
0xA1, 0xFF, 0xF3, 0x38, 0xC4, 0xBB, 0x14, 0x41, 0xD6, 0xB1, 0xBE, 0x60, 0xC4, 0xD0, 0x2F, 0xCC,
0x13, 0x11, 0x2D, 0xBF, 0x93, 0x25, 0x95, 0x14, 0xB7, 0x4B, 0x29, 0x39, 0x5D, 0xFF, 0xD9, 0x41,
0xA6, 0xF6, 0xE5, 0x06, 0xBF, 0xFD, 0x91, 0x56, 0x8A, 0x62, 0xA8, 0xA5, 0x25, 0x31, 0x5B, 0x7B,
0x13, 0x04, 0xCC, 0x57, 0xF4, 0x50, 0x71, 0x5D, 0xD5, 0x4C, 0x41, 0x4D, 0x45, 0x33, 0x2E, 0x31,
0x30, 0x30, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xF3, 0x38,
0xC4, 0xC9, 0x11, 0xE1, 0xFE, 0x24, 0x02, 0x48, 0x46, 0xD8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xF3, 0x38, 0xC4, 0xE0, 0x13, 0x08,
0x05, 0xB8, 0x00, 0x08, 0x46, 0x01, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55,
};
|
the_stack_data/112531.c | // 遍历一个链表
#include <stdio.h>
int main(void){
struct entry{
int value;
struct entry *next;
};
struct entry n1, n2, n3;
struct entry *list_pointer = &n1; // 显示链表的头指针
n1.value = 100;
n1.next = &n2;
n2.value = 200;
n2.next = &n3;
n3.value = 300;
n3.next = (struct entry *) 0; // 用空指针来标识链表的表尾
while(list_pointer != (struct entry *) 0){
printf("%i\n", list_pointer->value);
list_pointer = list_pointer->next;;
}
return 0;
}
|
the_stack_data/592195.c | //
// Kevin Nash (kjn33)
// PacketTrace.c
// 2017-02-26
// [description goes here]
//
#include <ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* The number of bits in a byte, a constant as true as they come */
#define BITS_IN_BYTE 8
/* The number of bytes (octets) in a MAC address */
#define BYTES_IN_MAC 6
/* The number of bytes (octets) in the EtherType field */
#define BYTES_IN_TYPE 2
/* The number of bytes (octets) in an IPv4 address */
#define BYTES_IN_IPV4 4
/* The size, in bytes, of the word specified in the IHL field */
#define IHL_WORD_SIZE 4
/* The maximum number of bytes in a single packet */
#define BYTES_CACHED 66
/* The number of bytes in metadata */
#define META_LENGTH 12
/* The number of bytes in the Ethernet header */
#define ETH_LENGTH 14
/* One greater than the maximum number representable in six decimal digits */
#define US_DIGIT_MAX 1000000
/* Index of the first and last byte in the seconds timestamp */
#define TIME_S_START 0
#define TIME_S_END 3
/* Index of the first and last byte in the microseconds timestamp */
#define TIME_US_START 4
#define TIME_US_END 7
/* Index of the first and last byte in caplen */
#define CAPLEN_START 8
#define CAPLEN_END 9
/* Index of the first and last byte in the ignored segment */
#define IGNORED_START 10
#define IGNORED_END 11
/* Index of the first and last byte in the Ethernet header */
#define ETH_HEAD_START 12
#define ETH_HEAD_END 25
/* Index of the first and last byte in the fixed IP header */
#define IP_HEAD_START 26
#define IP_HEAD_END 45
/* The first octal in an IP header that contains the total length */
#define IP_TOTLEN_OCT 2
/* The octal in an IP header that contains the TTL */
#define IP_TTL_OCT 8
/* The octal in an IP header that contains the transport protocol */
#define IP_PROT_OCT 9
/* The first octal in an IP header that contains the source address */
#define IP_SRC_OCT 12
/* The first octal in an IP header that contains the destination address */
#define IP_DST_OCT 16
/* The IP protocol number for TCP */
#define TCP_PROT_NUM 6
/* The IP protocol number for UDP */
#define UDP_PROT_NUM 17
/* Sentinel value for when a destination address is not found */
#define DST_NOT_FOUND -1
/* Extracts the low nibble from a byte */
#define LOW_NIBBLE(byte) ((byte) & 0x0F)
typedef struct {
struct {
/* number of seconds since Unix epoch */
uint32_t timestamp_s;
/* number of microseconds following timestamp_s */
uint32_t timestamp_us;
/* capture length, the number of bytes captured */
uint16_t caplen;
} metadata;
struct {
/* Signifies that the Ethernet header is truncated */
uint8_t is_truncated;
/* The destination MAC address stored as a byte array */
uint8_t dst_MAC[BYTES_IN_MAC];
/* The source MAC address stored as a byte array */
uint8_t src_MAC[BYTES_IN_MAC];
/* The EtherType field stored as a byte array */
uint8_t EtherType[BYTES_IN_TYPE];
} Ethernet;
struct {
/* Signifies that the packet is not an IP packet */
uint8_t is_non_IP;
/* Signifies that the IP header is truncated */
uint8_t is_truncated;
/* The length of the IP header in decimal */
uint8_t headlen;
/* The the entire packet size in bytes */
uint8_t totlen;
/* The protocol number, in decimal, of the transport protocol */
uint8_t protocol;
/* The time to live in decimal */
uint8_t ttl;
/* The destination IP address stored as a byte array */
uint8_t dst_IP[BYTES_IN_IPV4];
/* The source IP address stored as a byte array */
uint8_t src_IP[BYTES_IN_IPV4];
} IP;
} Packet;
static struct {
/* specifies printing a trace summary */
uint8_t s;
/* specifies printing Ethernet headers */
uint8_t e;
/* specifies printing IP headers */
uint8_t i;
/* specifies printing a count of packet types */
uint8_t t;
/* specifies printing a traffic matrix */
uint8_t m;
} options;
void trace_summary(FILE *trace_fileptr);
void Ethernet_dump(FILE *trace_fileptr);
void IP_dump(FILE *trace_fileptr);
void packet_counts(FILE *trace_fileptr);
void traffic_matrix(FILE *trace_fileptr);
uint16_t convert_2bytes_int(unsigned char *bytes, int index);
uint32_t convert_4bytes_int(unsigned char *bytes, int index);
int main(int argc, char **argv) {
/* reusable counting variable */
int i = 0;
/* iterator for command line args */
int option = 0;
/* count of the optional flags provided */
int option_cnt = 0;
/* filename for the binary packet trace file */
char *trace_filename = NULL;
/* pointer to the file opened by trace_filename */
FILE *trace_fileptr = NULL;
/* external variable set to zero to override getopt error handling */
opterr = 0;
// Parse arguments
while (-1 != (option = getopt(argc, argv, "r:seitm")))
switch (option) {
case 's':
options.s = 1;
option_cnt++;
break;
case 'e':
options.e = 1;
option_cnt++;
break;
case 'i':
options.i = 1;
option_cnt++;
break;
case 't':
options.t = 1;
option_cnt++;
break;
case 'm':
options.m = 1;
option_cnt++;
break;
case 'r':
trace_filename = optarg;
break;
case '?':
if (optopt == 'r') {
fprintf (stderr, "Option -%c requires an argument.\n", optopt);
}
else if (isprint (optopt)) {
fprintf(stderr, "Unknown option `-%c'.\n", optopt);
}
else {
fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
}
default:
exit(EXIT_FAILURE);
}
// Tell the user they typed something wrong
for (i = optind; i < argc; i++) {
fprintf(stderr, "Invalid argument: %s\n", argv[optind]);
exit(EXIT_FAILURE); // Can be removed if we want to ignore unknown args
}
// Enforce mutual exclusion of options
if (1 < option_cnt) {
fprintf(stderr, "Specified multiple mutually exclusive options.\n");
exit(EXIT_FAILURE);
}
// do nothing if the user asks for nothing
else if (0 == option_cnt) {
exit(EXIT_SUCCESS);
}
// Check whether an input filename was given
if (trace_filename == NULL) {
printf("Use of -r <filename> is required.\n");
exit(EXIT_FAILURE);
} else {
// Attempt to open the specified file
trace_fileptr = fopen(trace_filename, "rb");
if (trace_fileptr == NULL) {
perror("Error");
exit(EXIT_FAILURE);
}
}
// Begin specified task
if (options.s) {
trace_summary(trace_fileptr);
}
else if (options.e) {
Ethernet_dump(trace_fileptr);
}
else if (options.i) {
IP_dump(trace_fileptr);
}
else if (options.t) {
packet_counts(trace_fileptr);
}
else if (options.m) {
traffic_matrix(trace_fileptr);
}
exit(EXIT_SUCCESS);
}
/**
* Prints a four line summary of the trace file
*/
void trace_summary(FILE *trace_fileptr) {
/* reusable counting variable */
int i = 0;
/* total number of packets contained in the FILE */
unsigned long packet_cnt = 0;
/* the last packet in the file */
Packet pkt_first = {{0}};
/* the last packet in the file */
Packet pkt_last = {{0}};
pkt_last.metadata.caplen = BYTES_CACHED; // initialize to max caplen
/* stores some of the most recent bytes read */
unsigned char bytes[BYTES_CACHED] = {0};
// Store the timestamp for the first packet
for (i = 0; !feof(trace_fileptr) && i <= TIME_US_END; i++) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (TIME_S_END == i) {
pkt_first.metadata.timestamp_s = convert_4bytes_int(bytes, i);
}
else if (TIME_US_END == i) {
pkt_first.metadata.timestamp_us = convert_4bytes_int(bytes, i);
}
}
while (!feof(trace_fileptr)) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (CAPLEN_END == i) {
pkt_last.metadata.caplen = convert_2bytes_int(bytes, i);
}
// Reached the end of the packet
if (i >= pkt_last.metadata.caplen + META_LENGTH - 1) {
packet_cnt++;
i = 0;
} else {
i++;
}
}
pkt_last.metadata.timestamp_s = convert_4bytes_int(bytes, TIME_S_END);
pkt_last.metadata.timestamp_us = convert_4bytes_int(bytes, TIME_US_END);
printf("PACKETS: %lu\n", (unsigned long)packet_cnt);
printf("FIRST: %lu.%06lu\n", (unsigned long)pkt_first.metadata.timestamp_s,
(unsigned long)pkt_first.metadata.timestamp_us);
printf("LAST: %lu.%06lu\n", (unsigned long)pkt_last.metadata.timestamp_s,
(unsigned long)pkt_last.metadata.timestamp_us);
uint32_t duration_s = pkt_last.metadata.timestamp_s -
pkt_first.metadata.timestamp_s;
uint32_t duration_us;
if (pkt_first.metadata.timestamp_us > pkt_last.metadata.timestamp_us) {
duration_us = US_DIGIT_MAX - (pkt_first.metadata.timestamp_us -
pkt_last.metadata.timestamp_us);
duration_s--;
} else {
duration_us = pkt_last.metadata.timestamp_us -
pkt_first.metadata.timestamp_us;
}
printf("DURATION: %lu.%06lu\n", (unsigned long)duration_s,
(unsigned long)duration_us);
}
/**
* Prints information from the Ethernet frames found in the trace file
*/
void Ethernet_dump(FILE *trace_fileptr) {
/* reusable counting variable */
int i = 0;
/* reusable counting variable */
int j = 0;
/* the current packet */
Packet pkt = {{0}};
/* stores some of the most recent bytes read */
unsigned char bytes[BYTES_CACHED] = {0};
i = 0;
while (!feof(trace_fileptr)) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (TIME_S_END == i) {
pkt.metadata.timestamp_s = convert_4bytes_int(bytes, i);
}
else if (TIME_US_END == i) {
pkt.metadata.timestamp_us = convert_4bytes_int(bytes, i);
}
else if (CAPLEN_END == i) {
pkt.metadata.caplen = convert_2bytes_int(bytes, i);
pkt.Ethernet.is_truncated =
(pkt.metadata.caplen > ETH_HEAD_END - META_LENGTH) ? 0 : 1;
}
// Reached the end of the Ethernet header
else if (ETH_HEAD_END == i) {
// Read bytes into destination MAC address
for (j = 0; j < BYTES_IN_MAC; j++) {
pkt.Ethernet.dst_MAC[j] = bytes[ETH_HEAD_START + j];
}
// Read bytes into source MAC address
for (j = 0; j < BYTES_IN_MAC; j++) {
pkt.Ethernet.src_MAC[j] = bytes[ETH_HEAD_START + BYTES_IN_MAC + j];
}
// Read bytes into EtherType
for (j = 0; j < BYTES_IN_TYPE; j++) {
pkt.Ethernet.EtherType[j] =
bytes[ETH_HEAD_START + (2 * BYTES_IN_MAC) + j];
}
}
// Reached the end of the packet
if (i >= pkt.metadata.caplen + META_LENGTH - 1) {
printf("%lu.%06lu ", (unsigned long)pkt.metadata.timestamp_s,
(unsigned long)pkt.metadata.timestamp_us);
if (pkt.Ethernet.is_truncated) {
printf("Ethernet-truncated\n");
} else {
printf("%02x", pkt.Ethernet.src_MAC[0]);
for (j = 1; j < BYTES_IN_MAC; j++) {
printf(":%02x", pkt.Ethernet.src_MAC[j]);
}
printf(" %02x", pkt.Ethernet.dst_MAC[0]);
for (j = 1; j < BYTES_IN_MAC; j++) {
printf(":%02x", pkt.Ethernet.dst_MAC[j]);
}
printf(" 0x");
for (j = 0; j < BYTES_IN_TYPE; j++) {
printf("%02x", pkt.Ethernet.EtherType[j]);
}
printf("\n");
}
pkt.Ethernet.is_truncated = 0;
i = 0;
} else {
i++;
}
}
}
/**
* Prints information from the IP headers found in the trace file
*/
void IP_dump(FILE *trace_fileptr) {
/* reusable counting variable */
int i = 0;
/* reusable counting variable */
int j = 0;
/* the current packet */
Packet pkt = {{0}};
/* stores some of the most recent bytes read */
unsigned char bytes[BYTES_CACHED] = {0};
i = 0;
while (!feof(trace_fileptr)) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (TIME_S_END == i) {
pkt.metadata.timestamp_s = convert_4bytes_int(bytes, i);
}
else if (TIME_US_END == i) {
pkt.metadata.timestamp_us = convert_4bytes_int(bytes, i);
}
else if (CAPLEN_END == i) {
pkt.metadata.caplen = convert_2bytes_int(bytes, i);
pkt.Ethernet.is_truncated =
(pkt.metadata.caplen > ETH_HEAD_END - META_LENGTH) ? 0 : 1;
pkt.IP.is_truncated =
(pkt.metadata.caplen > IP_HEAD_END - META_LENGTH) ? 0 : 1;
}
// Reached the end of the Ethernet header
else if (ETH_HEAD_END == i) {
// Read bytes into EtherType
for (j = 0; j < BYTES_IN_TYPE; j++) {
pkt.Ethernet.EtherType[j] =
bytes[ETH_HEAD_START + (2 * BYTES_IN_MAC) + j];
}
if (pkt.Ethernet.EtherType[0] != 0x08 ||
pkt.Ethernet.EtherType[1] != 0x00) {
pkt.IP.is_non_IP = 1;
}
}
// Reached the end of the fixed IP header
else if (IP_HEAD_END == i) {
pkt.IP.headlen = LOW_NIBBLE(bytes[IP_HEAD_START]) * IHL_WORD_SIZE;
if (pkt.metadata.caplen != ETH_LENGTH + pkt.IP.headlen) {
pkt.IP.is_truncated = 1;
}
pkt.IP.ttl = bytes[IP_HEAD_START + IP_TTL_OCT];
pkt.IP.protocol = bytes[IP_HEAD_START + IP_PROT_OCT];
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.src_IP[j] = bytes[IP_HEAD_START + IP_SRC_OCT + j];
}
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.dst_IP[j] = bytes[IP_HEAD_START + IP_DST_OCT + j];
}
}
// Reached the end of the packet
if (i >= pkt.metadata.caplen + META_LENGTH - 1) {
printf("%lu.%06lu ", (unsigned long)pkt.metadata.timestamp_s,
(unsigned long)pkt.metadata.timestamp_us);
if (pkt.Ethernet.is_truncated) {
printf("unknown\n");
}
else if (pkt.IP.is_non_IP) {
printf("non-IP\n");
}
else if (pkt.IP.is_truncated) {
printf("IP-truncated\n");
}
else {
printf("%d", pkt.IP.src_IP[0]);
for (j = 1; j < BYTES_IN_IPV4; j++) {
printf(".%d", pkt.IP.src_IP[j]);
}
printf(" %d", pkt.IP.dst_IP[0]);
for (j = 1; j < BYTES_IN_IPV4; j++) {
printf(".%d", pkt.IP.dst_IP[j]);
}
printf(" %d", pkt.IP.headlen);
printf(" %d", pkt.IP.protocol);
printf(" %d\n", pkt.IP.ttl);
}
pkt.Ethernet.is_truncated = 0;
pkt.IP.is_truncated = 0;
pkt.IP.is_non_IP = 0;
i = 0;
} else {
i++;
}
}
}
/**
*
*/
void packet_counts(FILE *trace_fileptr) {
struct counts {
/* The number of packets that have a fully intact Ethernet header */
uint32_t Ethernet;
/* The number of packets that have an incomplete Ethernet header */
uint32_t Ethernet_part;
/* The number of non-IP packets */
uint32_t non_IP;
/* The number of packets that have a fully intact IP header */
uint32_t IP;
/* The number of packets that have an incomplete IP header */
uint32_t IP_part;
/* The number of unique source IP addresses */
uint32_t src_IP;
/* The number of unique destination IP addresses */
uint32_t dst_IP;
/* The number of TCP packets */
uint32_t TCP;
/* The number of UDP packets */
uint32_t UDP;
/* The number of packets that use other transport protocols */
uint32_t other;
};
/* reusable counting variable */
int i;
/* reusable counting variable */
int j;
/* will store numerical conversions of IP addresses */
uint32_t IP_number = 0;
/* the current packet */
Packet pkt = {{0}};
/* counts of specific packet types */
struct counts count = {0};
/* Forgive me. These are going to be large and sparse as hell.
* But right now the programmer's time is more valuable than
* the memory they eat. Also given the way I'm doing assignments,
* A.B.C.D collides with A.B-1.C.D+1
* I'm gambling that this case won't appear in your test files...
*/
uint8_t all_src_IPs[UINT16_MAX] = {0};
uint8_t all_dst_IPs[UINT16_MAX] = {0};
/* stores some of the most recent bytes read */
unsigned char bytes[BYTES_CACHED] = {0};
i = 0;
while (!feof(trace_fileptr)) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (CAPLEN_END == i) {
pkt.metadata.caplen = convert_2bytes_int(bytes, i);
pkt.Ethernet.is_truncated =
(pkt.metadata.caplen > ETH_HEAD_END - META_LENGTH) ? 0 : 1;
pkt.IP.is_truncated =
(pkt.metadata.caplen > IP_HEAD_END - META_LENGTH) ? 0 : 1;
}
// Reached the end of the Ethernet header
else if (ETH_HEAD_END == i) {
// Read bytes into EtherType
for (j = 0; j < BYTES_IN_TYPE; j++) {
pkt.Ethernet.EtherType[j] =
bytes[ETH_HEAD_START + (2 * BYTES_IN_MAC) + j];
}
if (pkt.Ethernet.EtherType[0] != 0x08 ||
pkt.Ethernet.EtherType[1] != 0x00) {
pkt.IP.is_non_IP = 1;
}
}
// Reached the end of the fixed IP header
else if (IP_HEAD_END == i) {
pkt.IP.headlen = LOW_NIBBLE(bytes[IP_HEAD_START]) * IHL_WORD_SIZE;
if (pkt.metadata.caplen != ETH_LENGTH + pkt.IP.headlen) {
pkt.IP.is_truncated = 1;
}
pkt.IP.protocol = bytes[IP_HEAD_START + IP_PROT_OCT];
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.src_IP[j] = bytes[IP_HEAD_START + IP_SRC_OCT + j];
}
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.dst_IP[j] = bytes[IP_HEAD_START + IP_DST_OCT + j];
}
}
// Reached the end of the packet
if (i >= pkt.metadata.caplen + META_LENGTH - 1) {
if (pkt.Ethernet.is_truncated) { // truncated Ethernet header
count.Ethernet_part++;
}
else { // intact Ethernet header
count.Ethernet++;
if (pkt.IP.is_non_IP) { // non-IP header
count.non_IP++;
}
else if (pkt.IP.is_truncated) { // truncated IP header
count.IP_part++;
}
else { // intact IP header
count.IP++;
IP_number = convert_4bytes_int(pkt.IP.src_IP, BYTES_IN_IPV4 - 1);
IP_number %= UINT16_MAX;
if (all_src_IPs[IP_number] == 0) {
all_src_IPs[IP_number] = 1;
count.src_IP++;
}
IP_number = convert_4bytes_int(pkt.IP.dst_IP, BYTES_IN_IPV4 - 1);
IP_number %= UINT16_MAX;
if (all_dst_IPs[IP_number] == 0) {
all_dst_IPs[IP_number] = 1;
count.dst_IP++;
}
if (pkt.IP.protocol == TCP_PROT_NUM) {
count.TCP++;
}
else if (pkt.IP.protocol == UDP_PROT_NUM) {
count.UDP++;
}
else {
count.other++;
}
}
}
pkt.Ethernet.is_truncated = 0;
pkt.IP.is_truncated = 0;
pkt.IP.is_non_IP = 0;
i = 0;
} else {
i++;
}
}
printf("ETH: %lu %lu\n", (long unsigned)count.Ethernet,
(long unsigned)count.Ethernet_part);
printf("NON-IP: %lu\n", (long unsigned)count.non_IP);
printf("IP: %lu %lu\n", (long unsigned)count.IP,
(long unsigned)count.IP_part);
printf("SRC: %lu\n", (long unsigned)count.src_IP);
printf("DST: %lu\n", (long unsigned)count.dst_IP);
printf("TRANSPORT: %lu %lu %lu\n", (long unsigned)count.TCP,
(long unsigned)count.UDP,
(long unsigned)count.other);
}
void traffic_matrix(FILE *trace_fileptr) {
typedef struct dst_IP {
/* number of times the destination appears for a given source */
uint16_t appearance_cnt;
/* count of all IP data sent between the destination and source */
uint16_t data_total;
/* The IP address stored as a byte array */
uint8_t address[BYTES_IN_IPV4];
} dst_IP;
typedef struct src_IP {
/* The IP address stored as a byte array */
uint8_t address[BYTES_IN_IPV4];
/* */
dst_IP destinations[INT8_MAX];
} src_IP;
/* reusable counting variable */
int i;
/* reusable counting variable */
int j;
/* reusable counting variable */
int k;
/* will store the numerical conversion of the source IP addresses */
uint32_t IP_number = 0;
int8_t dst_index = DST_NOT_FOUND;
int8_t dst_free_index = 0;
uint8_t updated_free = 0;
/* the current packet */
Packet pkt = {{0}};
/* List of all source IPs by appearance */
src_IP sources[UINT16_MAX / 10] = {{{0}}};
/* stores some of the most recent bytes read */
unsigned char bytes[BYTES_CACHED] = {0};
i = 0;
while (!feof(trace_fileptr)) {
unsigned char byte = fgetc(trace_fileptr);
if (feof(trace_fileptr)) {
break;
}
bytes[i] = byte;
if (CAPLEN_END == i) {
pkt.metadata.caplen = convert_2bytes_int(bytes, i);
}
// Reached the end of the fixed IP header
if (IP_HEAD_END == i) {
// pkt.IP.headlen = LOW_NIBBLE(bytes[IP_HEAD_START]) * IHL_WORD_SIZE;
pkt.IP.totlen = convert_2bytes_int(bytes, IP_HEAD_START + IP_TOTLEN_OCT + 1);
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.src_IP[j] = bytes[IP_HEAD_START + IP_SRC_OCT + j];
}
for (j = 0; j < BYTES_IN_IPV4; j++) {
pkt.IP.dst_IP[j] = bytes[IP_HEAD_START + IP_DST_OCT + j];
}
IP_number = convert_4bytes_int(pkt.IP.src_IP, BYTES_IN_IPV4 - 1);
IP_number %= UINT16_MAX / 10;
for (j = 0; j < BYTES_IN_IPV4; j++) {
sources[IP_number].address[j] = pkt.IP.src_IP[j];
}
dst_index = DST_NOT_FOUND;
dst_free_index = 0;
updated_free = 0;
for (j = 0; (j < INT8_MAX) && (DST_NOT_FOUND == dst_index); j++) {
if (!updated_free && (sources[IP_number].destinations[j].address[0] == 0)) {
dst_free_index = j;
updated_free = 1;
}
for (k = 0; k < BYTES_IN_IPV4; k++) {
if (sources[IP_number].destinations[j].address[k] !=
pkt.IP.dst_IP[k]) {
break;
}
else {
dst_index = j;
}
}
}
// destination does not already exist in source
if (DST_NOT_FOUND == dst_index) {
dst_index = dst_free_index;
for (j = 0; j < BYTES_IN_IPV4; j++) {
sources[IP_number].destinations[dst_index].address[j] =
pkt.IP.dst_IP[j];
}
sources[IP_number].destinations[dst_index].appearance_cnt = 1;
sources[IP_number].destinations[dst_index].data_total =
pkt.IP.totlen;
}
// destination already exists in source
else {
sources[IP_number].destinations[dst_index].appearance_cnt++;
sources[IP_number].destinations[dst_index].data_total +=
pkt.IP.totlen;
}
}
// Reached the end of the packet
if (i >= pkt.metadata.caplen + META_LENGTH - 1) {
i = 0;
} else {
i++;
}
}
#if 1
for (i = 0; i < (UINT16_MAX / 10); i++) {
if (sources[i].address[0] != 0) {
printf("%d", sources[i].address[0]);
for (j = 1; j < BYTES_IN_IPV4; j++) {
printf(".%d", sources[i].address[j]);
}
for (j = 0; j < 1; j++) {
if (sources[i].destinations[j].address[0] != 0) {
printf(" %d", sources[i].destinations[j].address[0]);
for (k = 1; k < BYTES_IN_IPV4; k++) {
printf(".%d", sources[i].destinations[j].address[k]);
}
printf(" %d", sources[i].destinations[j].appearance_cnt);
printf(" %d\n", sources[i].destinations[j].data_total);
}
}
}
}
#endif
}
/**
* Converts four bytes into a 32-bit integer
*/
uint32_t convert_4bytes_int(unsigned char *bytes, int index) {
return bytes[index] | bytes[index - 1] << BITS_IN_BYTE
| bytes[index - 2] << (BITS_IN_BYTE * 2)
| bytes[index - 3] << (BITS_IN_BYTE * 3);
}
/**
* Converts two bytes into a 16-bit integer
*/
uint16_t convert_2bytes_int(unsigned char *bytes, int index) {
return bytes[index] | bytes[index - 1] << BITS_IN_BYTE;
}
|
the_stack_data/733509.c | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Exercise 10
* Page: 118
* Write the program expr , which evaluates a reverse Polish expression,
* from the command line, where each operator or operand is a separate
* argument., For example, expr 2 3 4 + * evaluates 2 x (3+4)
* note : use '"' when inputing operators since some terminals see it
* as a wildcard character
* */
#define NUMBER '0'
#define MAXOP 100
static int getop(/*@out@*/ char s[]);
static void push(double num);
static double pop(void);
int main(int argc, char **argv) {
int type;
double op2;
char *s;
while (--argc > 0) {
s = *(++argv);
switch (type = getop(s)) {
case NUMBER:
push(atof(s));
break;
case '+':
push(pop() + pop());
break;
case '*':
push(pop() * pop());
break;
case '-':
op2 = pop();
push(pop() - op2);
break;
case '/':
op2 = pop();
if (op2 != 0) {
push(pop() / op2);
} else {
printf("error: Zero Divisor\n");
}
break;
default:
printf("error: Unknown Command\n");
break;
}
}
printf("\t%.7g\n", pop());
return 0;
}
#define MAXVAL 100
static int sp = 0;
static double val[MAXVAL];
void push(double f) {
if (sp < MAXVAL)
val[sp++] = f;
else
printf("error: stack full, can't push %f\n", f);
}
double pop(void) {
if (sp > 0)
return val[--sp];
else {
printf("error: stack empty\n");
return 0.0;
}
}
int getop(char s[]) {
int i, c;
i = 0;
while ((c = (int)s[i++]) == (int)' ' || c == (int)'\t') {
;
}
if (!isdigit(c) && c != (int)'.') {
return c;
}
if (isdigit(c)) {
while (isdigit(c = (int)s[i++])) {
;
}
}
if (c == (int)'.') {
while (isdigit(c = (int)s[i++])) {
;
}
}
return (int)NUMBER;
}
|
the_stack_data/45449218.c | #include <stdio.h>
void foo() {
int a = 20;
if(a == 20) {
printf("%d\n", 0);
} else {}
}
int main() {
int b = 52;
printf("%d\n", 11);
foo();
}
|
the_stack_data/1203009.c | /**
* @Author ZhangGJ
* @Date 2021/01/10 22:52
*/
#include <stdio.h>
#define NONBLANK 'a'
int main() {
int c, lastc;
lastc = NONBLANK;
while ((c = getchar()) != EOF) {
if (c != ' ') {
putchar(c);
}
if (c == ' ') {
if (lastc != ' ') {
putchar(c);
}
}
lastc = c;
}
}
|
the_stack_data/200142128.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2004, 2007, 2008, 2009, 2010, 2011 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>
int k = 0;
extern void pendfunc (int x);
int main()
{
pendfunc (3); /* break main here */
pendfunc (4);
k = 1;
pendfunc (3);
return 0;
}
|
the_stack_data/26699752.c | #ifdef OPTION_FETCH
#include "rhc/string.h"
#include "u/fetch.h"
#ifdef __EMSCRIPTEN__
#include <emscripten/fetch.h>
struct uFetch {
emscripten_fetch_t *fetch;
String data;
bool error;
bool fetch_completed;
Allocator_i a;
};
static void ems_fetch_success(emscripten_fetch_t *fetch) {
log_trace("succeded with http code: %i", fetch->status);
uFetch *self = fetch->userData;
assume(self->fetch == fetch, "wtf");
self->data.size = 0;
string_append(&self->data, (Str_s) {(char*) fetch->data, fetch->numBytes});
self->error = false;
emscripten_fetch_close(self->fetch);
self->fetch = NULL;
if(self->fetch_completed)
log_warn("was completed, but overridden");
self->fetch_completed = true;
}
static void ems_fetch_error(emscripten_fetch_t *fetch) {
log_warn("failed with http code: %i", fetch->status);
uFetch *self = fetch->userData;
assume(self->fetch == fetch, "wtf");
string_kill(&self->data);
self->error = true;
emscripten_fetch_close(self->fetch);
self->fetch = NULL;
if(self->fetch_completed)
log_warn("was completed, but overridden");
self->fetch_completed = true;
}
uFetch *u_fetch_new_get_a(const char *url, Allocator_i a) {
log_trace("get: %s", url);
uFetch *self = allocator_calloc(a, sizeof *self);
self->a = a;
self->data = string_new_a(128, a);
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
attr.userData = self;
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY;
attr.onsuccess = ems_fetch_success;
attr.onerror = ems_fetch_error;
strcpy(attr.requestMethod, "GET");
self->fetch = emscripten_fetch(&attr, url);
assume(self->fetch->userData == self, "should include user_data");
return self;
}
uFetch *u_fetch_new_post_a(const char *url, Str_s data, Allocator_i a) {
log_trace("post: %s", url);
uFetch *self = allocator_calloc(a, sizeof *self);
self->a = a;
self->data = string_new_clone_a(data, a);
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
attr.userData = self;
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY;
attr.onsuccess = ems_fetch_success;
attr.onerror = ems_fetch_error;
strcpy(attr.requestMethod, "POST");
attr.requestData = self->data.data;
attr.requestDataSize = self->data.size;
attr.requestHeaders = (const char *[]) {"Content-Type", "text/plain", NULL};
self->fetch = emscripten_fetch(&attr, url);
assume(self->fetch->userData == self, "should include user_data");
return self;
}
void u_fetch_kill(uFetch **self_ptr) {
uFetch *self = *self_ptr;
if(!self)
return;
if(self->fetch) {
log_warn("kill called before fetch was finished?");
emscripten_fetch_close(self->fetch);
}
string_kill(&self->data);
allocator_free(self->a, self);
*self_ptr = NULL;
}
String u_fetch_check_response(uFetch **self_ptr, bool *opt_error) {
uFetch *self = *self_ptr;
if(opt_error)
*opt_error = false;
if(!self)
return string_new_invalid();
if(!self->fetch_completed)
return string_new_invalid();
if(opt_error)
*opt_error = self->error;
// move and kill
String ret = self->data;
self->data = string_new_invalid();
u_fetch_kill(self_ptr);
return ret;
}
#else
#include <SDL2/SDL.h>
#include <curl/curl.h>
struct uFetch {
SDL_mutex *lock;
String url;
String data;
bool error;
bool fetch_completed;
Allocator_i a;
};
static size_t response_writer(void *ptr, size_t size, size_t nmemb, void *ud) {
uFetch *self = ud;
size_t full_size = size * nmemb;
string_append(&self->data, (Str_s) {ptr, full_size});
return full_size;
}
static int request_thread(void *ud) {
uFetch *self = ud;
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, self->url.data);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, response_writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, self);
String post_data = string_new_invalid();
if(!str_empty(self->data.str)) {
// POST
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: text/plain");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
// move data
post_data = self->data;
self->data = string_new_invalid();
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data.data);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, post_data.size);
}
self->data = string_new_a(128, self->a);
CURLcode perform_res = curl_easy_perform(curl);
long http_code = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
SDL_LockMutex(self->lock);
{
self->error = perform_res != CURLE_OK || http_code != 200;
self->fetch_completed = true;
if (self->data.size == 0 || self->error)
string_kill(&self->data);
}
SDL_UnlockMutex(self->lock);
log_trace("succeded, error: %i", self->error);
curl_easy_cleanup(curl);
string_kill(&post_data);
return 0;
}
uFetch *u_fetch_new_get_a(const char *url, Allocator_i a) {
log_trace("get: %s", url);
uFetch *self = allocator_calloc(a, sizeof *self);
self->a = a;
self->url = string_new_clone_a(strc(url), a);
self->data = string_new_invalid();
self->lock = SDL_CreateMutex();
SDL_CreateThread(request_thread, "u_fetch_request", self);
return self;
}
uFetch *u_fetch_new_post_a(const char *url, Str_s data, Allocator_i a) {
log_trace("post: %s", url);
uFetch *self = allocator_calloc(a, sizeof *self);
self->a = a;
self->url = string_new_clone_a(strc(url), a);
self->data = string_new_clone_a(data, a);
self->lock = SDL_CreateMutex();
SDL_CreateThread(request_thread, "u_fetch_request", self);
return self;
}
void u_fetch_kill(uFetch **self_ptr) {
uFetch *self = *self_ptr;
if(!self)
return;
string_kill(&self->url);
SDL_DestroyMutex(self->lock);
allocator_free(self->a,self);
*self_ptr = NULL;
}
String u_fetch_check_response(uFetch **self_ptr, bool *opt_error) {
String ret = string_new_invalid();
uFetch *self = *self_ptr;
if(opt_error)
*opt_error = false;
if(!self)
return ret;
SDL_LockMutex(self->lock);
{
if (self->fetch_completed) {
// move
ret = self->data;
self->data = string_new_invalid();
if (opt_error)
*opt_error = self->error;
}
}
SDL_UnlockMutex(self->lock);
// kill on success
if(self->fetch_completed)
u_fetch_kill(self_ptr);
return ret;
}
#endif
#else //OPTION_FETCH
typedef int avoid_iso_c_empty_translation_unit_warning_;
#endif
|
the_stack_data/23502.c | /* Unpack a byte from an int. */
#include <limits.h>
char unpack(int p, int k) /* k = 0, 1, 2, or 3 */
{
int n = k * CHAR_BIT; /* n = 0, 8, 16, or 24 */
unsigned mask = 255; /* low-order byte */
mask <<= n;
return ((p & mask) >> n);
}
|
the_stack_data/92328359.c | /* { dg-do compile } */
/* { dg-require-effective-target vect_float } */
typedef float vsf __attribute__((vector_size(2048)));
|
the_stack_data/104828849.c | #include <stdio.h>
int main(){
char nome;
double salarioFixo, vendasMes, salarioFinal;
scanf("%s%lf%lf", &nome, &salarioFixo, &vendasMes);
salarioFinal = salarioFixo + (0.15 * vendasMes);
printf("TOTAL = R$ %.2lf", salarioFinal);
return 0;
}
|
the_stack_data/142979.c | #include <stdio.h>
int main()
{
int n,i,j;
printf("Enter n value : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
{
printf("%d ", i);
}
printf("\n");
}
return 0;
}
|
the_stack_data/181393186.c | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
#include <pthread.h>
int i=1, j=1;
#define NUM 6
void *
t1(void* arg)
{
int k = 0;
for (k = 0; k < NUM; k++)
i+=j;
pthread_exit(NULL);
}
void *
t2(void* arg)
{
int k = 0;
for (k = 0; k < NUM; k++)
j+=i;
pthread_exit(NULL);
}
int
main(int argc, char **argv)
{
pthread_t id1, id2;
pthread_create(&id1, NULL, t1, NULL);
pthread_create(&id2, NULL, t2, NULL);
if (i > 377 || j > 377) {
ERROR: __VERIFIER_error();
}
return 0;
}
|
the_stack_data/151706545.c | /*
* Oracle Linux DTrace.
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
int limit = 4096;
int grow1(int);
int
shouldGrow(int frame)
{
return frame >= limit-- ? 0 : 1;
}
int
grow(int frame)
{
/*
* Create a ridiculously large stack - enough to push us over
* the default setting of 'dtrace_ustackdepth_max' (2048).
*
* This loop used to repeatedly call getpid(), but on Linux the result
* of that call gets cached, so that repeated calls actually do not
* trigger a system call anymore. We use ioctl() instead.
*/
if (shouldGrow(frame))
frame = grow1(frame++);
for (;;)
ioctl(-1, -1, NULL);
grow1(frame);
}
int
grow1(int frame)
{
if (shouldGrow(frame))
frame = grow(frame++);
for (;;)
ioctl(-2, -2, NULL);
grow(frame);
}
int
main(int argc, char *argv[])
{
grow(1);
return 0;
}
|
the_stack_data/198580145.c | /* { dg-options "-std=iso9899:1990 -pedantic" } */
/* In strict ISO C mode, we don't recognize the anonymous struct/union
extension or any Microsoft extensions. */
struct A { char a; };
/* MS extension. */
struct B {
struct A; /* { dg-warning "does not declare anything" } */
char b;
};
char testB[sizeof(struct B) == sizeof(struct A) ? 1 : -1];
/* MS extension. */
struct C {
struct D { char d; }; /* { dg-warning "does not declare anything" } */
char c;
};
char testC[sizeof(struct C) == sizeof(struct A) ? 1 : -1];
char testD[sizeof(struct D) == sizeof(struct A) ? 1 : -1];
/* GNU extension. */
struct E {
struct { char z; }; /* { dg-warning "unnamed structs" } */
char e;
};
/* MS extension. */
typedef struct A typedef_A;
struct F {
typedef_A; /* { dg-warning "does not declare anything" } */
char f;
};
char testF[sizeof(struct F) == sizeof(struct A) ? 1 : -1];
/* __extension__ enables GNU C mode for the duration of the declaration. */
__extension__ struct G {
struct { char z; };
char g;
};
char testG[sizeof(struct G) == 2 * sizeof(struct A) ? 1 : -1];
struct H {
__extension__ struct { char z; };
char h;
};
char testH[sizeof(struct H) == 2 * sizeof(struct A) ? 1 : -1];
/* Make sure __extension__ gets turned back off. */
struct I {
struct { char z; }; /* { dg-warning "unnamed structs" } */
char i;
};
char testI[sizeof(struct I) == sizeof(struct E) ? 1 : -1];
|
the_stack_data/15763822.c | // RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b23_explicitunsafecast.c -- | diff %t.checked/b23_explicitunsafecast.c -
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int *sus(int *x, int *y) {
//CHECK_NOALL: _Ptr<int> sus(int *x : itype(_Ptr<int>), _Ptr<int> y) {
//CHECK_ALL: _Ptr<int> sus(_Array_ptr<int> x, _Ptr<int> y) {
int *z = malloc(sizeof(int));
//CHECK: _Ptr<int> z = malloc<int>(sizeof(int));
*z = 1;
x++;
*x = 2;
return z;
}
int *foo() {
//CHECK: _Ptr<int> foo(void) {
int sx = 3, sy = 4;
int *x = &sx;
//CHECK_NOALL: _Ptr<int> x = &sx;
//CHECK_ALL: int *x = &sx;
int *y = &sy;
//CHECK: _Ptr<int> y = &sy;
int *z = (int *)sus(x, y);
//CHECK_NOALL: _Ptr<int> z = (_Ptr<int>)sus(x, y);
//CHECK_ALL: _Ptr<int> z = (_Ptr<int>)sus(_Assume_bounds_cast<_Array_ptr<int>>(x, byte_count(0)), y);
*z = *z + 1;
return z;
}
char *bar() {
//CHECK: char *bar(void) : itype(_Ptr<char>) {
int sx = 3, sy = 4;
int *x = &sx;
//CHECK_NOALL: _Ptr<int> x = &sx;
//CHECK_ALL: int *x = &sx;
int *y = &sy;
//CHECK: _Ptr<int> y = &sy;
char *z = (char *)(sus(x, y));
//CHECK_NOALL: char *z = (char *)(((int *)sus(x, y)));
//CHECK_ALL: char *z = (char *)(((int *)sus(_Assume_bounds_cast<_Array_ptr<int>>(x, byte_count(0)), y)));
return z;
}
|
the_stack_data/237644357.c | #include<stdlib.h>
#include<stdio.h>
#include<math.h>
typedef struct Ponto{
float x;
float y;
};
float calcula_distancia(struct Ponto centro, struct Ponto perif){
return sqrt(pow((perif.x-centro.x),2)+pow((perif.y-centro.y),2));
}
int main()
{
int i, n;
float raio;
struct Ponto centro;
struct Ponto perif;
printf("Digite a coordenada x do ponto central: ");
scanf("%f",¢ro.x);
printf("Digite a coordenada y do ponto central: ");
scanf("%f",¢ro.y);
printf("Ponto central eh (%.4f,%.4f) \n", centro.x, centro.y);
printf("\nDigite quantos pontos na periferia: ");
scanf("%d",&n);
printf("\n");
for(i=0;i<n;i++){
printf("Digite a coordenada x do ponto %i : ", i);
scanf("%f",&perif.x);
printf("Digite a coordenada y do ponto %i : ", i);
scanf("%f",&perif.y);
raio = calcula_distancia(centro, perif);
printf("a distancia entre o centro eh a periferia eh %.4f ", raio);
printf("\na equacao do circulo eh (x - %.4f)^2 + (x - %.4f)^2 = %.4f ", centro.x, centro.y, raio*raio);
printf("\n");
}
return 0;
}
|
the_stack_data/1036406.c | /*
$Id$
Simulate the cray 64 bit word addressable I/O routines and
allow for large buffering in core.
CALL WOPEN(UNIT, NAME, BLOCKS, STATS, IERR)
----
CALL WCLOSE(UNIT, IERR)
CALL GETWA(UNIT, RESULT, ADDR, COUNT, IERR)
CALL PUTWA(UNIT, SOURCE, ADDR, COUNT, IERR)
Currently the I/O is syncronous and unbuffered */
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
#ifndef L_XTND
#define L_XTND SEEK_END
#endif
#define max_file 99
extern char *malloc();
extern off_t lseek();
extern char *strncpy();
/*extern char *sprintf();*/
static int first_call = 1; /* need to do stuff on the first call */
static struct w_file {
int fds; /* file descriptor */
off_t length; /* file length in bytes */
off_t position; /* current file position in bytes a la lseek */
char *path; /* file name */
int stats; /* boolean flag to collect statistics */
double words_write; /* total no. of words written */
double words_read; /* total no. of words read */
double time_write; /* total wall time writing */
double time_read; /* total wall time reading */
int n_read; /* no. of read requests */
int n_write; /* no. of write reqeusts */
int seek_read; /* no. of seeks on read */
int seek_write; /* no. of seeks on write */
} file_array[max_file];
void walltm_(ai)
double *ai;
/* return ai with the wall clock time in seconds as a double.
it might be accurate to about 0.01s at best */
{
struct timeval tp;
struct timezone tzp;
(void) gettimeofday(&tp,&tzp);
*ai = (double) tp.tv_sec + ((double) tp.tv_usec) * 1.0e-6;
}
static int CheckUnit(unit)
long unit;
{
if ( (unit < 0) || (unit >= max_file) )
return -1;
if ( file_array[unit].fds == -1 )
return -1;
return 0;
}
static int CheckAddr(addr)
long addr;
{
if (addr <= 0)
return -4;
else
return 0;
}
static int CheckCount(count)
long count;
{
if (count < 0)
return -4;
else
return 0;
}
void InitFileStats(file)
struct w_file *file;
{
file->stats = 1;
file->words_write = 0.0e0;
file->words_read = 0.0e0;
file->time_read = 0.0e0;
file->time_write = 0.0e0;
file->n_read = 0;
file->n_write = 0;
file->seek_read = 0;
file->seek_write = 0;
}
void PrintFileStats(unit, file)
struct w_file *file;
long unit;
{
double ave_read=0.0e0, ave_write=0.0e0;
double rate_read=0.0e0, rate_write=0.0e0;
(void) fflush(stdout);
if (file->n_read) {
ave_read = file->words_read / (double) file->n_read;
if (file->time_read > 0.0e0)
rate_read = file->words_read / (1000000.0e0 * file->time_read);
}
if (file->n_write) {
ave_write = file->words_write / (double) file->n_write;
if (file->time_write > 0.0e0)
rate_write = file->words_write / (1000000.0e0 * file->time_write);
}
(void) fflush(stdout);
(void) fflush(stderr);
(void) fprintf(stdout,"CRAYIO: Statistics for unit %d, file '%s', length=%d bytes.\n",
unit, file->path, file->length);
(void) fprintf(stdout,"CRAYIO: oper : #req. : #seek : #words :");
(void) fprintf(stdout," #w/#req : time(s) : MW/s \n");
(void) fprintf(stdout,"CRAYIO: read : %7d : %7d : %9d : %7d : %7.1f : %6.3f\n",
file->n_read, file->seek_read, (long) file->words_read,
(long) ave_read, file->time_read, rate_read);
(void) fprintf(stdout,"CRAYIO:write : %7d : %7d : %9d : %7d : %7.1f : %6.3f\n",
file->n_write, file->seek_write, (long) file->words_write,
(long) ave_write, file->time_write, rate_write);
(void) fflush(stdout);
}
void InitFileData(file)
struct w_file *file;
{
file->fds = -1;
file->length = -1;
file->path = (char *) NULL;
file->position = (off_t) -1;
}
void FirstCall()
/* Initialization on first call to anything */
{
int i;
for (i=0; i<max_file; i++) {
InitFileData(&file_array[i]);
InitFileStats(&file_array[i]);
}
first_call = 0;
}
void wclose_(unit, ierr)
long *unit, *ierr;
{
struct w_file *file;
if (first_call)
FirstCall();
if (*ierr = CheckUnit(*unit))
return;
file = file_array + *unit;
*ierr = close(file->fds);
if (file->stats)
PrintFileStats(*unit, file);
InitFileData(file);
InitFileStats(file);
}
/* ARGSUSED */
void wopen_(unit, name, blocks, stats, ierr, lennam)
long *unit, *blocks, *stats, *ierr;
int lennam;
char *name;
{
struct w_file *file;
*ierr = (long) 0;
if (first_call)
FirstCall();
if ( (*unit < 0) || (*unit >= max_file) ) {
*ierr = -1;
return;
}
file = file_array + *unit;
file->stats = *stats;
if (lennam > 0) {
file->path = malloc((unsigned) (lennam + 1));
(void) strncpy(file->path,name,lennam);
file->path[lennam] = 0;
}
else {
file->path = malloc((unsigned) 8);
(void) sprintf(file->path,"fort.%.2d",*unit);
}
if (( file->fds = open(file->path, (int)(O_RDWR|O_CREAT), (int) 0660))
== -1) {
*ierr = -6;
return;
}
file->length = lseek(file->fds, (off_t) 0, (int) L_XTND);
file->position = lseek(file->fds, (off_t) 0, (int) L_SET);
}
void getwa_(unit, result, addr, count, ierr)
long *unit, *addr, *count, *ierr;
double *result;
{
long nbytes;
off_t where;
double start, end;
struct w_file *file;
if (first_call)
FirstCall();
if (*ierr = CheckUnit(*unit))
return;
if (*ierr = CheckAddr(*addr))
return;
if (*ierr = CheckCount(*count))
return;
file = file_array + *unit;
nbytes = *count * 8;
where = (*addr - 1) * 8;
if ( (where+nbytes) > file->length ) {
*ierr = -5;
return;
}
if (file->stats)
walltm_(&start);
if (where != file->position) {
file->seek_read++;
if ( (file->position = lseek(file->fds, where, L_SET)) == (off_t) -1) {
*ierr = -4;
return;
}
}
if ((long) read(file->fds, (char *) result, (int) nbytes) != nbytes) {
*ierr = -6;
return;
}
file->position += nbytes;
if (file->stats) {
walltm_(&end);
file->n_read++;
file->words_read += (double) *count;
file->time_read += end - start;
}
*ierr = 0;
}
void putwa_(unit, source, addr, count, ierr)
long *unit, *addr, *count, *ierr;
double *source;
{
long nbytes;
off_t where;
double start, end;
struct w_file *file;
if (first_call)
FirstCall();
if ( *ierr = CheckUnit(*unit))
return;
if (*ierr = CheckAddr(*addr))
return;
if (*ierr = CheckCount(*count))
return;
file = file_array + *unit;
nbytes = *count * 8;
where = (*addr - 1) * 8;
if (file->stats)
walltm_(&start);
if (where != file->position) {
file->seek_write++;
if ( (file->position = lseek(file->fds, where, L_SET)) == (off_t) -1) {
*ierr = -4;
return;
}
}
if ((long) write(file->fds, (char *) source, (int) nbytes) != nbytes) {
*ierr = -6;
return;
}
where += nbytes;
file->position += nbytes;
if (file->length < where)
file->length = where;
if (file->stats) {
walltm_(&end);
file->n_write++;
file->words_write += (double) *count;
file->time_write += end - start;
}
*ierr = 0;
}
|
the_stack_data/175144350.c | /*
* simple bubble sort
*/
#include <stdio.h>
void bubblesort(int arr[], int len)
{
int i, j;
for( i = 0; i < len - 1; i += 1 ) {
for( j = 0; j < len - 1 - i; j += 1 ) {
if( arr[j] > arr[j+1] ) {
int tmp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = tmp;
}
}
}
}
void bubblesort2(int arr[], int len)
{
int i, j, flag;
for( i = 0; i < len - 1; i += 1 ) {
flag = 0;
for( j = 0; j < len - 1 - i; j += 1 ) {
if( arr[j] > arr[j+1] ) {
int tmp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = tmp;
flag = 1;
}
}
if( !flag )
break;
}
}
int main(int argc, const char *argv[])
{
int arr[] = {64, 34, 25, 12, 22, 11, 90};
int len = sizeof(arr)/sizeof(arr[0]);
bubblesort2(arr, len);
int i;
for( i = 0; i < len; i += 1 ) {
printf( "%d ", arr[i] );
}
return 0;
}
|
the_stack_data/156389219.c | #include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc , char *argv []) {
pid_t pid;pid = fork ();
if(pid ==-1) {
printf ("Fallo en fork\n");
return -1;
} else if (! pid) {
printf ("Proceso hijo: PID %d\n", getpid ());
} else {
printf ("Proceso padre: PID %d\n", getpid ());
}return 0;} |
the_stack_data/21851.c | #ifndef TH_GENERIC_FILE
#define TH_GENERIC_FILE "generic/Sigmoid.c"
#else
void THNN_(Sigmoid_updateOutput)(
THNNState *state,
THTensor *input,
THTensor *output)
{
THTensor_(sigmoid)(output, input);
}
void THNN_(Sigmoid_updateGradInput)(
THNNState *state,
THTensor *input,
THTensor *gradOutput,
THTensor *gradInput,
THTensor *output)
{
THNN_CHECK_NELEMENT(output, gradOutput);
THTensor_(resizeAs)(gradInput, output);
TH_TENSOR_APPLY3(real, gradInput, real, gradOutput, real, output,
real z = *output_data;
*gradInput_data = *gradOutput_data * (1. - z) * z;
);
}
#endif
|
the_stack_data/148577937.c | int ft_str_is_uppercase(char *str)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] < 'A' || str[i] > 'Z')
{
return (0);
}
i++;
}
return (1);
}
|
the_stack_data/15761571.c | int test072(){int a; int b; a =0; b=0; do{a-=1;b+=a;}while(a+3); return a*b;}
|
the_stack_data/22012153.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
int t(){struct timeval t;gettimeofday(&t,0);return t.tv_usec/1000+t.tv_sec*1000;}
#define g(x,y,u,v,s)\
for(int j=0,X=x,Y=y;j<v&&Y+j<h-X/w&&Y>=0&&X>=0;++j)memcpy(&f[Y+j][X],&s[j*u],u)
#define l(x,y,w,h,a,b,c,d)\
!((x-a>c&&x>=a)||(a-x>w&&a>=x)||(y-b>d&&y>=b)||(b-y>h&&b>=y))
int main(){
struct termios z,o;tcgetattr(0,&z);o=z;z.c_lflag&=~ICANON&~ECHO;
z.c_cc[VMIN]=0;z.c_cc[VTIME]=0;tcsetattr(0,TCSANOW,&z);
srand(time(0));struct winsize v;ioctl(STDOUT_FILENO,TIOCGWINSZ,&v);
int h=v.ws_row,w=v.ws_col,A=w*h/100,l=t(),k,s=0,g=1,i,c=0,L;
struct V{float x,y;}p={w/2,h/2},b={-3*h},a[A],m[A];
char*r=" /\\ /__\\ ^^ ",*n="o0o0OO",u=0,q,f[h+1][w];
while(u^'q'){
float d=(t()-l)*.001;
q=u;do read(0,&u,1);while((u&'p')>=(u|'p'));
l=t();c+=15;i=h*w-1;
K:
L=c*d;L=abs(((i/w)-L)*(i%w)+h*w);
(*f)[i]=L%3+L%5+L%7+L%11+L%13+L%17+L%19>14?32:46;
if(i--)goto K;
u^' '?0:(b.x=p.x+2,b.y=p.y,u=q);
q^'a'?q^'d'?q^'w'?q^'s'?0:
(p.y+=d*15):
(p.y+=d*-15):
(p.x+=d*20):
(p.x+=d*-20);
p.x=p.x<0?0:p.x>=w-4?w-4:p.x;
p.y=p.y<0?0:p.y>=h-3?h-3:p.y;
b.y+=d*-20;
int Y=b.y,X=b.x;Y*w+X>=0?f[Y][X]=64:0;
i=A-1;
L:
k=0;struct V*e=&a[i],*z=&m[i];
e->x+=d*z->x;e->y+=d*z->y;
l(b.x,b.y,1,1,e->x,e->y,6,4)&&!g?k=1,s++,b.y=-3*h:0;
e->x<0-3||e->x>=w+3||e->y>=h+2||k||g?
e->y=-rand()%h*(1+g),
e->x=rand()%w,
z->x=-8+rand()%15,
z->y=10+rand()%5:0;
l(p.x,p.y,4,3,e->x,e->y,3,2)?u='q':0;
g(e->x,e->y,3,2,n);
if(i--)goto L;
g(p.x,p.y,4,3,r);
*(f[h])=0;
printf("\033[0;4H%s\033[0;0H \033[4D%i\n",&f[0][4],s);
while(t()-l<9);g=0;
}
tcsetattr(0,TCSADRAIN,&o);
}
|
the_stack_data/913987.c | void a() {
}
void b() {
}
void c() {
}
void d() {
}
void e() {
}
void f() {
}
int main( int argc, char** argv ) {
motion_append_after_call( c, a );
motion_alwayslast_around_call( d, a );
motion_append_after_call( e, a );
a();
b();
return 0;
}
|
the_stack_data/688121.c | /***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1996-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <[email protected]> *
* *
***********************************************************************/
#pragma prototyped
#if _typ_int64_t
/*
* Aaron D. Gifford's SHA {256,384,512} code transcribed into a -lsum method
*/
/*
* Copyright (c) 2000-2001, Aaron D. Gifford
* 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. Neither the name of the copyright holder nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) 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.
*/
/*
* ASSERT NOTE:
* Some sanity checking code is included using assert(). On my FreeBSD
* system, this additional code can be removed by compiling with NDEBUG
* defined. Check your own systems manpage on assert() to see how to
* compile WITHOUT the sanity checking code on your system.
*
* UNROLLED TRANSFORM LOOP NOTE:
* You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform
* loop version for the hash transform rounds (defined using macros
* later in this file). Either define on the command line, for example:
*
* cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c
*
* or define below:
*
* #define SHA2_UNROLL_TRANSFORM
*
*/
/*** SHA-256/384/512 Machine Architecture Definitions *****************/
#if _PACKAGE_ast
#ifndef __USE_BSD
#define __undef__USE_BSD
#define __USE_BSD
#endif
#include <endian.h>
#ifdef __undef__USE_BSD
#undef __undef__USE_BSD
#undef __USE_BSD
#endif
typedef uint8_t sha2_byte; /* Exactly 1 byte */
typedef uint32_t sha2_word32; /* Exactly 4 bytes */
typedef uint64_t sha2_word64; /* Exactly 8 bytes */
#define assert(x)
#undef R
#undef S32
#undef S64
#else /* _PACKAGE_ast */
/*
* BYTE_ORDER NOTE:
*
* Please make sure that your system defines BYTE_ORDER. If your
* architecture is little-endian, make sure it also defines
* LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
* equivilent.
*
* If your system does not define the above, then you can do so by
* hand like this:
*
* #define LITTLE_ENDIAN 1234
* #define BIG_ENDIAN 4321
*
* And for little-endian machines, add:
*
* #define BYTE_ORDER LITTLE_ENDIAN
*
* Or for big-endian machines:
*
* #define BYTE_ORDER BIG_ENDIAN
*
* The FreeBSD machine this was written on defines BYTE_ORDER
* appropriately by including <sys/types.h> (which in turn includes
* <machine/endian.h> where the appropriate definitions are actually
* made).
*/
#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN
#endif
/*
* Define the following sha2_* types to types of the correct length on
* the native archtecture. Most BSD systems and Linux define u_intXX_t
* types. Machines with very recent ANSI C headers, can use the
* uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H
* during compile or in the sha.h header file.
*
* Machines that support neither u_intXX_t nor inttypes.h's uintXX_t
* will need to define these three typedefs below (and the appropriate
* ones in sha.h too) by hand according to their system architecture.
*
* Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t
* types and pointing out recent ANSI C support for uintXX_t in inttypes.h.
*/
#ifdef SHA2_USE_INTTYPES_H
typedef uint8_t sha2_byte; /* Exactly 1 byte */
typedef uint32_t sha2_word32; /* Exactly 4 bytes */
typedef uint64_t sha2_word64; /* Exactly 8 bytes */
#else /* SHA2_USE_INTTYPES_H */
typedef u_int8_t sha2_byte; /* Exactly 1 byte */
typedef u_int32_t sha2_word32; /* Exactly 4 bytes */
typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
#endif /* SHA2_USE_INTTYPES_H */
#endif /* _PACKAGE_ast */
/*** SHA-256/384/512 Various Length Definitions ***********************/
#define SHA256_BLOCK_LENGTH 64
#define SHA256_DIGEST_LENGTH 32
#define SHA384_BLOCK_LENGTH 128
#define SHA384_DIGEST_LENGTH 48
#define SHA512_BLOCK_LENGTH 128
#define SHA512_DIGEST_LENGTH 64
#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8)
#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16)
#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16)
/*** ENDIAN REVERSAL MACROS *******************************************/
#if BYTE_ORDER == LITTLE_ENDIAN
#define REVERSE32(w,x) { \
sha2_word32 tmp = (w); \
tmp = (tmp >> 16) | (tmp << 16); \
(x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
}
#if _ast_LL
#define REVERSE64(w,x) { \
sha2_word64 tmp = (w); \
tmp = (tmp >> 32) | (tmp << 32); \
tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \
((tmp & 0x00ff00ff00ff00ffULL) << 8); \
(x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
((tmp & 0x0000ffff0000ffffULL) << 16); \
}
#else
#define REVERSE64(w,x) { \
sha2_word64 tmp = (w); \
tmp = (tmp >> 32) | (tmp << 32); \
tmp = ((tmp & ((sha2_word64)0xff00ff00ff00ff00)) >> 8) | \
((tmp & ((sha2_word64)0x00ff00ff00ff00ff)) << 8); \
(x) = ((tmp & ((sha2_word64)0xffff0000ffff0000)) >> 16) | \
((tmp & ((sha2_word64)0x0000ffff0000ffff)) << 16); \
}
#endif
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
/*
* Macro for incrementally adding the unsigned 64-bit integer n to the
* unsigned 128-bit integer (represented using a two-element array of
* 64-bit words):
*/
#define ADDINC128(w,n) { \
(w)[0] += (sha2_word64)(n); \
if ((w)[0] < (n)) { \
(w)[1]++; \
} \
}
/*
* Macros for copying blocks of memory and for zeroing out ranges
* of memory. Using these macros makes it easy to switch from
* using memset()/memcpy() and using bzero()/bcopy().
*
* Please define either SHA2_USE_MEMSET_MEMCPY or define
* SHA2_USE_BZERO_BCOPY depending on which function set you
* choose to use:
*/
#if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY)
/* Default to memset()/memcpy() if no option is specified */
#define SHA2_USE_MEMSET_MEMCPY 1
#endif
#if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY)
/* Abort with an error if BOTH options are defined */
#error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both!
#endif
#ifdef SHA2_USE_MEMSET_MEMCPY
#define MEMSET_BZERO(p,l) memset((p), 0, (l))
#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l))
#endif
#ifdef SHA2_USE_BZERO_BCOPY
#define MEMSET_BZERO(p,l) bzero((p), (l))
#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l))
#endif
/*** THE SIX LOGICAL FUNCTIONS ****************************************/
/*
* Bit shifting and rotation (used by the six SHA-XYZ logical functions:
*
* NOTE: The naming of R and S appears backwards here (R is a SHIFT and
* S is a ROTATION) because the SHA-256/384/512 description document
* (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this
* same "backwards" definition.
*/
/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */
#define R(b,x) ((x) >> (b))
/* 32-bit Rotate-right (used in SHA-256): */
#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b))))
/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */
#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b))))
/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */
#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
/* Four of six logical functions used in SHA-256: */
#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x)))
#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x)))
#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x)))
#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x)))
/* Four of six logical functions used in SHA-384 and SHA-512: */
#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x)))
#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x)))
#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x)))
#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x)))
/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
/* Hash constant words K for SHA-256: */
static const sha2_word32 K256[64] = {
0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
};
/* Initial hash value H for SHA-256: */
static const sha2_word32 sha256_initial_hash_value[8] = {
0x6a09e667UL,
0xbb67ae85UL,
0x3c6ef372UL,
0xa54ff53aUL,
0x510e527fUL,
0x9b05688cUL,
0x1f83d9abUL,
0x5be0cd19UL
};
/* Hash constant words K for SHA-384 and SHA-512: */
static const sha2_word64 K512[80] = {
#if _ast_LL
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,
0xd807aa98a3030242ULL, 0x12835b0145706fbeULL,
0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL,
0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,
0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,
0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL,
0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL,
0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,
0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,
0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL,
0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,
0xd192e819d6ef5218ULL, 0xd69906245565a910ULL,
0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL,
0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,
0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,
0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL,
0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL,
0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,
0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,
0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL,
0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
0x28db77f523047d84ULL, 0x32caab7b40c72493ULL,
0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,
0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
#else
((sha2_word64)0x428a2f98d728ae22), ((sha2_word64)0x7137449123ef65cd),
((sha2_word64)0xb5c0fbcfec4d3b2f), ((sha2_word64)0xe9b5dba58189dbbc),
((sha2_word64)0x3956c25bf348b538), ((sha2_word64)0x59f111f1b605d019),
((sha2_word64)0x923f82a4af194f9b), ((sha2_word64)0xab1c5ed5da6d8118),
((sha2_word64)0xd807aa98a3030242), ((sha2_word64)0x12835b0145706fbe),
((sha2_word64)0x243185be4ee4b28c), ((sha2_word64)0x550c7dc3d5ffb4e2),
((sha2_word64)0x72be5d74f27b896f), ((sha2_word64)0x80deb1fe3b1696b1),
((sha2_word64)0x9bdc06a725c71235), ((sha2_word64)0xc19bf174cf692694),
((sha2_word64)0xe49b69c19ef14ad2), ((sha2_word64)0xefbe4786384f25e3),
((sha2_word64)0x0fc19dc68b8cd5b5), ((sha2_word64)0x240ca1cc77ac9c65),
((sha2_word64)0x2de92c6f592b0275), ((sha2_word64)0x4a7484aa6ea6e483),
((sha2_word64)0x5cb0a9dcbd41fbd4), ((sha2_word64)0x76f988da831153b5),
((sha2_word64)0x983e5152ee66dfab), ((sha2_word64)0xa831c66d2db43210),
((sha2_word64)0xb00327c898fb213f), ((sha2_word64)0xbf597fc7beef0ee4),
((sha2_word64)0xc6e00bf33da88fc2), ((sha2_word64)0xd5a79147930aa725),
((sha2_word64)0x06ca6351e003826f), ((sha2_word64)0x142929670a0e6e70),
((sha2_word64)0x27b70a8546d22ffc), ((sha2_word64)0x2e1b21385c26c926),
((sha2_word64)0x4d2c6dfc5ac42aed), ((sha2_word64)0x53380d139d95b3df),
((sha2_word64)0x650a73548baf63de), ((sha2_word64)0x766a0abb3c77b2a8),
((sha2_word64)0x81c2c92e47edaee6), ((sha2_word64)0x92722c851482353b),
((sha2_word64)0xa2bfe8a14cf10364), ((sha2_word64)0xa81a664bbc423001),
((sha2_word64)0xc24b8b70d0f89791), ((sha2_word64)0xc76c51a30654be30),
((sha2_word64)0xd192e819d6ef5218), ((sha2_word64)0xd69906245565a910),
((sha2_word64)0xf40e35855771202a), ((sha2_word64)0x106aa07032bbd1b8),
((sha2_word64)0x19a4c116b8d2d0c8), ((sha2_word64)0x1e376c085141ab53),
((sha2_word64)0x2748774cdf8eeb99), ((sha2_word64)0x34b0bcb5e19b48a8),
((sha2_word64)0x391c0cb3c5c95a63), ((sha2_word64)0x4ed8aa4ae3418acb),
((sha2_word64)0x5b9cca4f7763e373), ((sha2_word64)0x682e6ff3d6b2b8a3),
((sha2_word64)0x748f82ee5defb2fc), ((sha2_word64)0x78a5636f43172f60),
((sha2_word64)0x84c87814a1f0ab72), ((sha2_word64)0x8cc702081a6439ec),
((sha2_word64)0x90befffa23631e28), ((sha2_word64)0xa4506cebde82bde9),
((sha2_word64)0xbef9a3f7b2c67915), ((sha2_word64)0xc67178f2e372532b),
((sha2_word64)0xca273eceea26619c), ((sha2_word64)0xd186b8c721c0c207),
((sha2_word64)0xeada7dd6cde0eb1e), ((sha2_word64)0xf57d4f7fee6ed178),
((sha2_word64)0x06f067aa72176fba), ((sha2_word64)0x0a637dc5a2c898a6),
((sha2_word64)0x113f9804bef90dae), ((sha2_word64)0x1b710b35131c471b),
((sha2_word64)0x28db77f523047d84), ((sha2_word64)0x32caab7b40c72493),
((sha2_word64)0x3c9ebe0a15c9bebc), ((sha2_word64)0x431d67c49c100d4c),
((sha2_word64)0x4cc5d4becb3e42b6), ((sha2_word64)0x597f299cfc657e2a),
((sha2_word64)0x5fcb6fab3ad6faec), ((sha2_word64)0x6c44198c4a475817)
#endif
};
/* Initial hash value H for SHA-384 */
static const sha2_word64 sha384_initial_hash_value[8] = {
#if _ast_LL
0xcbbb9d5dc1059ed8ULL,
0x629a292a367cd507ULL,
0x9159015a3070dd17ULL,
0x152fecd8f70e5939ULL,
0x67332667ffc00b31ULL,
0x8eb44a8768581511ULL,
0xdb0c2e0d64f98fa7ULL,
0x47b5481dbefa4fa4ULL
#else
((sha2_word64)0xcbbb9d5dc1059ed8),
((sha2_word64)0x629a292a367cd507),
((sha2_word64)0x9159015a3070dd17),
((sha2_word64)0x152fecd8f70e5939),
((sha2_word64)0x67332667ffc00b31),
((sha2_word64)0x8eb44a8768581511),
((sha2_word64)0xdb0c2e0d64f98fa7),
((sha2_word64)0x47b5481dbefa4fa4)
#endif
};
/* Initial hash value H for SHA-512 */
static const sha2_word64 sha512_initial_hash_value[8] = {
#if _ast_LL
0x6a09e667f3bcc908ULL,
0xbb67ae8584caa73bULL,
0x3c6ef372fe94f82bULL,
0xa54ff53a5f1d36f1ULL,
0x510e527fade682d1ULL,
0x9b05688c2b3e6c1fULL,
0x1f83d9abfb41bd6bULL,
0x5be0cd19137e2179ULL
#else
((sha2_word64)0x6a09e667f3bcc908),
((sha2_word64)0xbb67ae8584caa73b),
((sha2_word64)0x3c6ef372fe94f82b),
((sha2_word64)0xa54ff53a5f1d36f1),
((sha2_word64)0x510e527fade682d1),
((sha2_word64)0x9b05688c2b3e6c1f),
((sha2_word64)0x1f83d9abfb41bd6b),
((sha2_word64)0x5be0cd19137e2179)
#endif
};
/*** SHA-256: *********************************************************/
#define sha256_description "FIPS SHA-256 secure hash algorithm."
#define sha256_options "\
[+(version)?sha-256 (FIPS) 2000-01-01]\
[+(author)?Aaron D. Gifford]\
"
#define sha256_match "sha256|sha-256|SHA256|SHA-256"
#define sha256_scale 0
#define sha256_padding md5_pad
#define SHA256_CTX Sha256_t
typedef struct Sha256_s
{
_SUM_PUBLIC_
_SUM_PRIVATE_
sha2_byte digest[SHA256_DIGEST_LENGTH];
sha2_byte digest_sum[SHA256_DIGEST_LENGTH];
sha2_word32 state[8];
sha2_word64 bitcount;
sha2_byte buffer[SHA256_BLOCK_LENGTH];
} Sha256_t;
#ifdef SHA2_UNROLL_TRANSFORM
/* Unrolled SHA-256 round macros: */
#if BYTE_ORDER == LITTLE_ENDIAN
#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
REVERSE32(*data++, W256[j]); \
T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
K256[j] + W256[j]; \
(d) += T1; \
(h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
j++
#else /* BYTE_ORDER == LITTLE_ENDIAN */
#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
K256[j] + (W256[j] = *data++); \
(d) += T1; \
(h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
j++
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
#define ROUND256(a,b,c,d,e,f,g,h) \
s0 = W256[(j+1)&0x0f]; \
s0 = sigma0_256(s0); \
s1 = W256[(j+14)&0x0f]; \
s1 = sigma1_256(s1); \
T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \
(W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \
(d) += T1; \
(h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
j++
static void SHA256_Transform(SHA256_CTX* sha, const sha2_word32* data) {
sha2_word32 a, b, c, d, e, f, g, h, s0, s1;
sha2_word32 T1, *W256;
int j;
W256 = (sha2_word32*)sha->buffer;
/* Initialize registers with the prev. intermediate value */
a = sha->state[0];
b = sha->state[1];
c = sha->state[2];
d = sha->state[3];
e = sha->state[4];
f = sha->state[5];
g = sha->state[6];
h = sha->state[7];
j = 0;
do {
/* Rounds 0 to 15 (unrolled): */
ROUND256_0_TO_15(a,b,c,d,e,f,g,h);
ROUND256_0_TO_15(h,a,b,c,d,e,f,g);
ROUND256_0_TO_15(g,h,a,b,c,d,e,f);
ROUND256_0_TO_15(f,g,h,a,b,c,d,e);
ROUND256_0_TO_15(e,f,g,h,a,b,c,d);
ROUND256_0_TO_15(d,e,f,g,h,a,b,c);
ROUND256_0_TO_15(c,d,e,f,g,h,a,b);
ROUND256_0_TO_15(b,c,d,e,f,g,h,a);
} while (j < 16);
/* Now for the remaining rounds to 64: */
do {
ROUND256(a,b,c,d,e,f,g,h);
ROUND256(h,a,b,c,d,e,f,g);
ROUND256(g,h,a,b,c,d,e,f);
ROUND256(f,g,h,a,b,c,d,e);
ROUND256(e,f,g,h,a,b,c,d);
ROUND256(d,e,f,g,h,a,b,c);
ROUND256(c,d,e,f,g,h,a,b);
ROUND256(b,c,d,e,f,g,h,a);
} while (j < 64);
/* Compute the current intermediate hash value */
sha->state[0] += a;
sha->state[1] += b;
sha->state[2] += c;
sha->state[3] += d;
sha->state[4] += e;
sha->state[5] += f;
sha->state[6] += g;
sha->state[7] += h;
/* Clean up */
a = b = c = d = e = f = g = h = T1 = 0;
}
#else /* SHA2_UNROLL_TRANSFORM */
static void SHA256_Transform(SHA256_CTX* sha, const sha2_word32* data) {
sha2_word32 a, b, c, d, e, f, g, h, s0, s1;
sha2_word32 T1, T2, *W256;
int j;
W256 = (sha2_word32*)sha->buffer;
/* Initialize registers with the prev. intermediate value */
a = sha->state[0];
b = sha->state[1];
c = sha->state[2];
d = sha->state[3];
e = sha->state[4];
f = sha->state[5];
g = sha->state[6];
h = sha->state[7];
j = 0;
do {
#if BYTE_ORDER == LITTLE_ENDIAN
/* Copy data while converting to host byte order */
REVERSE32(*data++,W256[j]);
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
/* Apply the SHA-256 compression function to update a..h with copy */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
g = f;
f = e;
e = d + T1;
d = c;
c = b;
b = a;
a = T1 + T2;
j++;
} while (j < 16);
do {
/* Part of the message block expansion: */
s0 = W256[(j+1)&0x0f];
s0 = sigma0_256(s0);
s1 = W256[(j+14)&0x0f];
s1 = sigma1_256(s1);
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
(W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
g = f;
f = e;
e = d + T1;
d = c;
c = b;
b = a;
a = T1 + T2;
j++;
} while (j < 64);
/* Compute the current intermediate hash value */
sha->state[0] += a;
sha->state[1] += b;
sha->state[2] += c;
sha->state[3] += d;
sha->state[4] += e;
sha->state[5] += f;
sha->state[6] += g;
sha->state[7] += h;
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
}
#endif /* SHA2_UNROLL_TRANSFORM */
static int
sha256_block(register Sum_t* p, const void* s, size_t len)
{
Sha256_t* sha = (Sha256_t*)p;
sha2_byte* data = (sha2_byte*)s;
unsigned int freespace, usedspace;
if (!len)
return 0;
usedspace = (sha->bitcount >> 3) % SHA256_BLOCK_LENGTH;
if (usedspace > 0) {
/* Calculate how much free space is available in the buffer */
freespace = SHA256_BLOCK_LENGTH - usedspace;
if (len >= freespace) {
/* Fill the buffer completely and process it */
MEMCPY_BCOPY(&sha->buffer[usedspace], data, freespace);
sha->bitcount += freespace << 3;
len -= freespace;
data += freespace;
SHA256_Transform(sha, (sha2_word32*)sha->buffer);
} else {
/* The buffer is not yet full */
MEMCPY_BCOPY(&sha->buffer[usedspace], data, len);
sha->bitcount += len << 3;
/* Clean up: */
usedspace = freespace = 0;
return 0;
}
}
while (len >= SHA256_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
SHA256_Transform(sha, (sha2_word32*)data);
sha->bitcount += SHA256_BLOCK_LENGTH << 3;
len -= SHA256_BLOCK_LENGTH;
data += SHA256_BLOCK_LENGTH;
}
if (len > 0) {
/* There's left-overs, so save 'em */
MEMCPY_BCOPY(sha->buffer, data, len);
sha->bitcount += len << 3;
}
/* Clean up: */
usedspace = freespace = 0;
return 0;
}
static int
sha256_init(Sum_t* p)
{
register Sha256_t* sha = (Sha256_t*)p;
MEMCPY_BCOPY(sha->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH);
MEMSET_BZERO(sha->buffer, SHA256_BLOCK_LENGTH);
sha->bitcount = 0;
return 0;
}
static Sum_t*
sha256_open(const Method_t* method, const char* name)
{
Sha256_t* sha;
if (sha = newof(0, Sha256_t, 1, 0))
{
sha->method = (Method_t*)method;
sha->name = name;
sha256_init((Sum_t*)sha);
}
return (Sum_t*)sha;
}
static int
sha256_done(Sum_t* p)
{
Sha256_t* sha = (Sha256_t*)p;
unsigned int usedspace;
register int i;
/* Sanity check: */
assert(sha != (SHA256_CTX*)0);
usedspace = (sha->bitcount >> 3) % SHA256_BLOCK_LENGTH;
#if BYTE_ORDER == LITTLE_ENDIAN
/* Convert FROM host byte order */
REVERSE64(sha->bitcount,sha->bitcount);
#endif
if (usedspace > 0) {
/* Begin padding with a 1 bit: */
sha->buffer[usedspace++] = 0x80;
if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) {
/* Set-up for the last transform: */
MEMSET_BZERO(&sha->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace);
} else {
if (usedspace < SHA256_BLOCK_LENGTH) {
MEMSET_BZERO(&sha->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace);
}
/* Do second-to-last transform: */
SHA256_Transform(sha, (sha2_word32*)sha->buffer);
/* And set-up for the last transform: */
MEMSET_BZERO(sha->buffer, SHA256_SHORT_BLOCK_LENGTH);
}
} else {
/* Set-up for the last transform: */
MEMSET_BZERO(sha->buffer, SHA256_SHORT_BLOCK_LENGTH);
/* Begin padding with a 1 bit: */
*sha->buffer = 0x80;
}
/* Set the bit count: */
*(sha2_word64*)&sha->buffer[SHA256_SHORT_BLOCK_LENGTH] = sha->bitcount;
/* Final transform: */
SHA256_Transform(sha, (sha2_word32*)sha->buffer);
#if BYTE_ORDER == LITTLE_ENDIAN
{
/* Convert TO host byte order */
int j;
sha2_word32* d = (sha2_word32*)sha->digest;
for (j = 0; j < 8; j++) {
REVERSE32(sha->state[j],sha->state[j]);
*d++ = sha->state[j];
}
}
#else
MEMCPY_BCOPY(sha->digest, sha->state, SHA256_DIGEST_LENGTH);
#endif
/* accumulate the digests */
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
sha->digest_sum[i] ^= sha->digest[i];
/* Clean up state data: */
MEMSET_BZERO(&sha->state, sizeof(*sha) - offsetof(Sha256_t, state));
usedspace = 0;
return 0;
}
static int
sha256_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
{
register Sha256_t* sha = (Sha256_t*)p;
register sha2_byte* d;
register sha2_byte* e;
d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
e = d + SHA256_DIGEST_LENGTH;
while (d < e)
sfprintf(sp, "%02x", *d++);
return 0;
}
static int
sha256_data(Sum_t* p, Sumdata_t* data)
{
register Sha256_t* sha = (Sha256_t*)p;
data->size = SHA256_DIGEST_LENGTH;
data->num = 0;
data->buf = sha->digest;
return 0;
}
/*** SHA-512: *********************************************************/
#define sha512_description "FIPS SHA-512 secure hash algorithm."
#define sha512_options "\
[+(version)?sha-512 (FIPS) 2000-01-01]\
[+(author)?Aaron D. Gifford]\
"
#define sha512_match "sha512|sha-512|SHA512|SHA-512"
#define sha512_scale 0
#define sha512_padding md5_pad
#define SHA512_CTX Sha512_t
typedef struct Sha512_s
{
_SUM_PUBLIC_
_SUM_PRIVATE_
sha2_byte digest[SHA512_DIGEST_LENGTH];
sha2_byte digest_sum[SHA512_DIGEST_LENGTH];
sha2_word64 state[8];
sha2_word64 bitcount[2];
sha2_byte buffer[SHA512_BLOCK_LENGTH];
} Sha512_t;
#ifdef SHA2_UNROLL_TRANSFORM
/* Unrolled SHA-512 round macros: */
#if BYTE_ORDER == LITTLE_ENDIAN
#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
REVERSE64(*data++, W512[j]); \
T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
K512[j] + W512[j]; \
(d) += T1, \
(h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \
j++
#else /* BYTE_ORDER == LITTLE_ENDIAN */
#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
K512[j] + (W512[j] = *data++); \
(d) += T1; \
(h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
j++
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
#define ROUND512(a,b,c,d,e,f,g,h) \
s0 = W512[(j+1)&0x0f]; \
s0 = sigma0_512(s0); \
s1 = W512[(j+14)&0x0f]; \
s1 = sigma1_512(s1); \
T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \
(W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \
(d) += T1; \
(h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
j++
static void SHA512_Transform(SHA512_CTX* sha, const sha2_word64* data) {
sha2_word64 a, b, c, d, e, f, g, h, s0, s1;
sha2_word64 T1, *W512 = (sha2_word64*)sha->buffer;
int j;
/* Initialize registers with the prev. intermediate value */
a = sha->state[0];
b = sha->state[1];
c = sha->state[2];
d = sha->state[3];
e = sha->state[4];
f = sha->state[5];
g = sha->state[6];
h = sha->state[7];
j = 0;
do {
ROUND512_0_TO_15(a,b,c,d,e,f,g,h);
ROUND512_0_TO_15(h,a,b,c,d,e,f,g);
ROUND512_0_TO_15(g,h,a,b,c,d,e,f);
ROUND512_0_TO_15(f,g,h,a,b,c,d,e);
ROUND512_0_TO_15(e,f,g,h,a,b,c,d);
ROUND512_0_TO_15(d,e,f,g,h,a,b,c);
ROUND512_0_TO_15(c,d,e,f,g,h,a,b);
ROUND512_0_TO_15(b,c,d,e,f,g,h,a);
} while (j < 16);
/* Now for the remaining rounds up to 79: */
do {
ROUND512(a,b,c,d,e,f,g,h);
ROUND512(h,a,b,c,d,e,f,g);
ROUND512(g,h,a,b,c,d,e,f);
ROUND512(f,g,h,a,b,c,d,e);
ROUND512(e,f,g,h,a,b,c,d);
ROUND512(d,e,f,g,h,a,b,c);
ROUND512(c,d,e,f,g,h,a,b);
ROUND512(b,c,d,e,f,g,h,a);
} while (j < 80);
/* Compute the current intermediate hash value */
sha->state[0] += a;
sha->state[1] += b;
sha->state[2] += c;
sha->state[3] += d;
sha->state[4] += e;
sha->state[5] += f;
sha->state[6] += g;
sha->state[7] += h;
/* Clean up */
a = b = c = d = e = f = g = h = T1 = 0;
}
#else /* SHA2_UNROLL_TRANSFORM */
static void SHA512_Transform(SHA512_CTX* sha, const sha2_word64* data) {
sha2_word64 a, b, c, d, e, f, g, h, s0, s1;
sha2_word64 T1, T2, *W512 = (sha2_word64*)sha->buffer;
int j;
/* Initialize registers with the prev. intermediate value */
a = sha->state[0];
b = sha->state[1];
c = sha->state[2];
d = sha->state[3];
e = sha->state[4];
f = sha->state[5];
g = sha->state[6];
h = sha->state[7];
j = 0;
do {
#if BYTE_ORDER == LITTLE_ENDIAN
/* Convert TO host byte order */
REVERSE64(*data++, W512[j]);
/* Apply the SHA-512 compression function to update a..h */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
/* Apply the SHA-512 compression function to update a..h with copy */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_512(a) + Maj(a, b, c);
h = g;
g = f;
f = e;
e = d + T1;
d = c;
c = b;
b = a;
a = T1 + T2;
j++;
} while (j < 16);
do {
/* Part of the message block expansion: */
s0 = W512[(j+1)&0x0f];
s0 = sigma0_512(s0);
s1 = W512[(j+14)&0x0f];
s1 = sigma1_512(s1);
/* Apply the SHA-512 compression function to update a..h */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] +
(W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0);
T2 = Sigma0_512(a) + Maj(a, b, c);
h = g;
g = f;
f = e;
e = d + T1;
d = c;
c = b;
b = a;
a = T1 + T2;
j++;
} while (j < 80);
/* Compute the current intermediate hash value */
sha->state[0] += a;
sha->state[1] += b;
sha->state[2] += c;
sha->state[3] += d;
sha->state[4] += e;
sha->state[5] += f;
sha->state[6] += g;
sha->state[7] += h;
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
}
#endif /* SHA2_UNROLL_TRANSFORM */
static int
sha512_block(register Sum_t* p, const void* s, size_t len)
{
Sha512_t* sha = (Sha512_t*)p;
sha2_byte* data = (sha2_byte*)s;
unsigned int freespace, usedspace;
if (!len)
return 0;
usedspace = (sha->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
if (usedspace > 0) {
/* Calculate how much free space is available in the buffer */
freespace = SHA512_BLOCK_LENGTH - usedspace;
if (len >= freespace) {
/* Fill the buffer completely and process it */
MEMCPY_BCOPY(&sha->buffer[usedspace], data, freespace);
ADDINC128(sha->bitcount, freespace << 3);
len -= freespace;
data += freespace;
SHA512_Transform(sha, (sha2_word64*)sha->buffer);
} else {
/* The buffer is not yet full */
MEMCPY_BCOPY(&sha->buffer[usedspace], data, len);
ADDINC128(sha->bitcount, len << 3);
/* Clean up: */
usedspace = freespace = 0;
return 0;
}
}
while (len >= SHA512_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
SHA512_Transform(sha, (sha2_word64*)data);
ADDINC128(sha->bitcount, SHA512_BLOCK_LENGTH << 3);
len -= SHA512_BLOCK_LENGTH;
data += SHA512_BLOCK_LENGTH;
}
if (len > 0) {
/* There's left-overs, so save 'em */
MEMCPY_BCOPY(sha->buffer, data, len);
ADDINC128(sha->bitcount, len << 3);
}
/* Clean up: */
usedspace = freespace = 0;
return 0;
}
static int
sha512_init(Sum_t* p)
{
register Sha512_t* sha = (Sha512_t*)p;
MEMCPY_BCOPY(sha->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH);
MEMSET_BZERO(sha->buffer, SHA512_BLOCK_LENGTH);
sha->bitcount[0] = sha->bitcount[1] = 0;
return 0;
}
static Sum_t*
sha512_open(const Method_t* method, const char* name)
{
Sha512_t* sha;
if (sha = newof(0, Sha512_t, 1, 0))
{
sha->method = (Method_t*)method;
sha->name = name;
sha512_init((Sum_t*)sha);
}
return (Sum_t*)sha;
}
static int
sha512_done(Sum_t* p)
{
Sha512_t* sha = (Sha512_t*)p;
unsigned int usedspace;
register int i;
usedspace = (sha->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
#if BYTE_ORDER == LITTLE_ENDIAN
/* Convert FROM host byte order */
REVERSE64(sha->bitcount[0],sha->bitcount[0]);
REVERSE64(sha->bitcount[1],sha->bitcount[1]);
#endif
if (usedspace > 0) {
/* Begin padding with a 1 bit: */
sha->buffer[usedspace++] = 0x80;
if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) {
/* Set-up for the last transform: */
MEMSET_BZERO(&sha->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace);
} else {
if (usedspace < SHA512_BLOCK_LENGTH) {
MEMSET_BZERO(&sha->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace);
}
/* Do second-to-last transform: */
SHA512_Transform(sha, (sha2_word64*)sha->buffer);
/* And set-up for the last transform: */
MEMSET_BZERO(sha->buffer, SHA512_BLOCK_LENGTH - 2);
}
} else {
/* Prepare for final transform: */
MEMSET_BZERO(sha->buffer, SHA512_SHORT_BLOCK_LENGTH);
/* Begin padding with a 1 bit: */
*sha->buffer = 0x80;
}
/* Store the length of input data (in bits): */
*(sha2_word64*)&sha->buffer[SHA512_SHORT_BLOCK_LENGTH] = sha->bitcount[1];
*(sha2_word64*)&sha->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = sha->bitcount[0];
/* Final transform: */
SHA512_Transform(sha, (sha2_word64*)sha->buffer);
#if BYTE_ORDER == LITTLE_ENDIAN
{
/* Convert TO host byte order */
sha2_word64* d = (sha2_word64*)sha->digest;
int j;
for (j = 0; j < 8; j++) {
REVERSE64(sha->state[j],sha->state[j]);
*d++ = sha->state[j];
}
}
#else
MEMCPY_BCOPY(sha->digest, sha->state, SHA512_DIGEST_LENGTH);
#endif
/* accumulate the digests */
for (i = 0; i < SHA512_DIGEST_LENGTH; i++)
sha->digest_sum[i] ^= sha->digest[i];
/* Clean up state data: */
MEMSET_BZERO(&sha->state, sizeof(*sha) - offsetof(Sha512_t, state));
usedspace = 0;
return 0;
}
static int
sha512_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
{
register Sha512_t* sha = (Sha512_t*)p;
register sha2_byte* d;
register sha2_byte* e;
d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
e = d + SHA512_DIGEST_LENGTH;
while (d < e)
sfprintf(sp, "%02x", *d++);
return 0;
}
static int
sha512_data(Sum_t* p, Sumdata_t* data)
{
register Sha512_t* sha = (Sha512_t*)p;
data->size = SHA512_DIGEST_LENGTH;
data->num = 0;
data->buf = sha->digest;
return 0;
}
/*** SHA-384: *********************************************************/
#define sha384_description "FIPS SHA-384 secure hash algorithm."
#define sha384_options "\
[+(version)?sha-384 (FIPS) 2000-01-01]\
[+(author)?Aaron D. Gifford]\
"
#define sha384_match "sha384|sha-384|SHA384|SHA-384"
#define sha384_scale 0
#define sha384_block sha512_block
#define sha384_done sha512_done
#define sha384_padding md5_pad
#define Sha384_t Sha512_t
#define SHA384_CTX Sha384_t
#define SHA384_DIGEST_LENGTH 48
static int
sha384_init(Sum_t* p)
{
register Sha384_t* sha = (Sha384_t*)p;
MEMCPY_BCOPY(sha->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH);
MEMSET_BZERO(sha->buffer, SHA384_BLOCK_LENGTH);
sha->bitcount[0] = sha->bitcount[1] = 0;
return 0;
}
static Sum_t*
sha384_open(const Method_t* method, const char* name)
{
Sha384_t* sha;
if (sha = newof(0, Sha384_t, 1, 0))
{
sha->method = (Method_t*)method;
sha->name = name;
sha384_init((Sum_t*)sha);
}
return (Sum_t*)sha;
}
static int
sha384_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
{
register Sha384_t* sha = (Sha384_t*)p;
register sha2_byte* d;
register sha2_byte* e;
d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
e = d + SHA384_DIGEST_LENGTH;
while (d < e)
sfprintf(sp, "%02x", *d++);
return 0;
}
static int
sha384_data(Sum_t* p, Sumdata_t* data)
{
register Sha384_t* sha = (Sha384_t*)p;
data->size = SHA384_DIGEST_LENGTH;
data->num = 0;
data->buf = sha->digest;
return 0;
}
#endif /* _typ_int64_t */
|
the_stack_data/151704816.c | #include <stdio.h>
#include <string.h>
/* Copyright 2021 Melwyn Francis Carlo */
int main()
{
char *thousand_digit_num =
"73167176531330624919225119674426574742355349194934"
"96983520312774506326239578318016984801869478851843"
"85861560789112949495459501737958331952853208805511"
"12540698747158523863050715693290963295227443043557"
"66896648950445244523161731856403098711121722383113"
"62229893423380308135336276614282806444486645238749"
"30358907296290491560440772390713810515859307960866"
"70172427121883998797908792274921901699720888093776"
"65727333001053367881220235421809751254540594752243"
"52584907711670556013604839586446706324415722155397"
"53697817977846174064955149290862569321978468622482"
"83972241375657056057490261407972968652414535100474"
"82166370484403199890008895243450658541227588666881"
"16427171479924442928230863465674813919123162824586"
"17866458359124566529476545682848912883142607690042"
"24219022671055626321111109370544217506941658960408"
"07198403850962455444362981230987879927244284909188"
"84580156166097919133875499200524063689912560717606"
"05886116467109405077541002256983155200055935729725"
"71636269561882670428252483600823257530420752963450";
long int product = 0;
for (unsigned int i = 0; i < strlen(thousand_digit_num)-13; i++)
{
if ((thousand_digit_num[i] - '0') >= 5)
{
long int temp_val = 1;
for (int j = 0; j < 13; j++)
temp_val *= thousand_digit_num[i+j] - '0';
if (temp_val > product)
product = temp_val;
}
}
printf("%ld\n", product);
return 0;
}
|
the_stack_data/125139989.c | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#define COLS 3000
#define ROWS 3000
#define MAX_TEMP_ERROR 0.01
double temperature[ROWS+2][COLS+2];
double temperature_last[ROWS+2][COLS+2];
void initialize();
void track_progress(int iter);
void main(int argc, char**argv){
int i , j;
int max_iterations = 4000;
int iteration=1;
double dt=100;
struct timeval start_time, stop_time, elapsed_time;
//printf("Maximum iterations ?\n");
//scanf("%d" , &max_iterations);
gettimeofday(&start_time, NULL);
initialize();
#pragma acc data copy(temperature, temperature_last)
while (dt > MAX_TEMP_ERROR && iteration <= max_iterations){
#pragma acc kernels
{
for (i = 1; i<= ROWS; i++){
for (j = 1; j<= COLS; j++){
temperature[i][j] = 0.25 * (temperature_last[i+1][j] + temperature_last[i-1][j] +
temperature_last[i][j+1] + temperature_last[i][j-1]);
}
}
dt =0.0;
//#pragma acc kernels
for (i = 1; i<= ROWS; i++){
for (j = 1; j<= COLS; j++){
dt = fmax( fabs(temperature[i][j]-temperature_last[i][j]), dt);
temperature_last[i][j] = temperature[i][j];
}
}
if ((iteration %100 ) == 0){
#pragma acc update host( temperature )
track_progress(iteration);
}
iteration++;
}
}
gettimeofday(&stop_time, NULL);
timersub(&stop_time, &start_time, &elapsed_time);
printf("\nMax error at iteration %d was %f\n" , iteration-1, dt);
printf("Total time was %d %f seconds.\n", elapsed_time.tv_sec, ((float)elapsed_time.tv_sec + ((float)elapsed_time.tv_usec/1000000.0f)));
exit(0);
}
void initialize(){
int i,j;
for (i = 0; i<= ROWS; i++){
for (j = 0; j<= COLS; j++){
temperature_last[i][j] = 0.0;
}
}
// boundary condition
for (i = 0; i<= ROWS; i++){
temperature_last[i][0] = 0.0;
temperature_last[i][COLS+1] = (100.0/ROWS)*i;
}
for (j = 0; j<= COLS; j++){
temperature_last[0][j] = 0.0;
temperature_last[ROWS+1][j] = (100.0/COLS)*j;
}
}
void track_progress(int iteration){
int i ;
printf("---------- Iteration number: %d -------------\n", iteration);
for (i = ROWS-5; i<= ROWS; i=i+2){
printf("[%d,%d]: %5.2f ", i,i, temperature[i][i]);
}
printf("\n");
}
|
the_stack_data/49213.c | // Tencent is pleased to support the open source community by making HaboMalHunter available.
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
//
// http://opensource.org/licenses/MIT
//
// 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.
/*
Author:
Date: August 18, 2016
Description: Linux Malware Analysis System Target Loader
1. print pid
2. pause and waiting for signal
3. execve to load the target
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
void print_pid(){
pid_t current_pid = getpid();
printf("%d\n",current_pid);
fflush(stdout);
return;
}
void sig_handler(int signum){
//printf("Received signal %d\n",signum);
}
void sig_manager(){
signal(SIGCONT,sig_handler);
}
void target_loader(char* target, char** envp){
char* para_list[2]={target,NULL};
int ret = execve(target,para_list,envp);
if (-1==ret){
printf("execve error:%s for loading the target:%s\n", strerror(errno),target);
exit(2);
}
}
void usage(){
printf("usage: target_loader target_path\n");
}
int main(int argc, char** argv, char** envp){
char* target=NULL;
//TODO LD_PRELOAD, LD_DEBUG
if (2!=argc){
usage();
exit(1);
}else{
target = argv[1];
}
print_pid();
sig_manager();
pause();
target_loader(target,envp);
return 0;
}
|
the_stack_data/18888798.c | #include <stdio.h>
#include <math.h>
int main(void) {
int a, b, c, d;
while (scanf("%d %d %d %d", &a, &b, &c, &d)) {
if (a == 0 && b == 0 && c == 0 && d == 0) break;
else if (a == c && b == d) printf("0\n");
else if (a == c || b == d || abs(a-c) == abs(b-d)) printf("1\n");
else printf("2\n");
}
return 0;
}
|
the_stack_data/216741.c | extern int __VERIFIER_nondet_int();
extern void __VERIFIER_assume(int);
int nondet_signed_int() {
int r = __VERIFIER_nondet_int();
__VERIFIER_assume ((-0x7fffffff - 1) <= r && r <= 0x7fffffff);
return r;
}
typedef long unsigned int size_t;
typedef int wchar_t;
typedef enum
{
P_ALL,
P_PID,
P_PGID
} idtype_t;
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
extern double atof (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern float strtof (const char *__restrict __nptr,
char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long double strtold (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int strtol (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern unsigned long int strtoul (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoll (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
extern long int a64l (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
typedef __clock_t clock_t;
typedef __clockid_t clockid_t;
typedef __time_t time_t;
typedef __timer_t timer_t;
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef int register_t __attribute__ ((__mode__ (__word__)));
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
return __builtin_bswap16 (__bsx);
}
static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{
return __builtin_bswap32 (__bsx);
}
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{
return __builtin_bswap64 (__bsx);
}
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
return __x;
}
static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
return __x;
}
static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
return __x;
}
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
typedef __sigset_t sigset_t;
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
struct timespec
{
__time_t tv_sec;
__syscall_slong_t tv_nsec;
};
typedef __suseconds_t suseconds_t;
typedef long int __fd_mask;
typedef struct
{
__fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
extern int pselect (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask);
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
struct __pthread_internal_list *__next;
} __pthread_list_t;
typedef struct __pthread_internal_slist
{
struct __pthread_internal_slist *__next;
} __pthread_slist_t;
struct __pthread_mutex_s
{
int __lock;
unsigned int __count;
int __owner;
unsigned int __nusers;
int __kind;
short __spins;
short __elision;
__pthread_list_t __list;
};
struct __pthread_rwlock_arch_t
{
unsigned int __readers;
unsigned int __writers;
unsigned int __wrphase_futex;
unsigned int __writers_futex;
unsigned int __pad3;
unsigned int __pad4;
int __cur_writer;
int __shared;
signed char __rwelision;
unsigned char __pad1[7];
unsigned long int __pad2;
unsigned int __flags;
};
struct __pthread_cond_s
{
__extension__ union
{
__extension__ unsigned long long int __wseq;
struct
{
unsigned int __low;
unsigned int __high;
} __wseq32;
};
__extension__ union
{
__extension__ unsigned long long int __g1_start;
struct
{
unsigned int __low;
unsigned int __high;
} __g1_start32;
};
unsigned int __g_refs[2] ;
unsigned int __g_size[2];
unsigned int __g1_orig_size;
unsigned int __wrefs;
unsigned int __g_signals[2];
};
typedef unsigned long int pthread_t;
typedef union
{
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union
{
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
union pthread_attr_t
{
char __size[56];
long int __align;
};
typedef union pthread_attr_t pthread_attr_t;
typedef union
{
struct __pthread_mutex_s __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union
{
struct __pthread_cond_s __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
struct __pthread_rwlock_arch_t __data;
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[4];
int __align;
} pthread_barrierattr_t;
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
__extension__ unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern void *calloc (size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;
extern void *realloc (void *__ptr, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));
extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
__attribute__ ((__alloc_size__ (2, 3)));
extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern void *aligned_alloc (size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int setenv (const char *__name, const char *__value, int __replace)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int system (const char *__command) ;
extern char *realpath (const char *__restrict __name,
char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
typedef int (*__compar_fn_t) (const void *, const void *);
extern void *bsearch (const void *__key, const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *gcvt (double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int mbtowc (wchar_t *__restrict __pwc,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern size_t wcstombs (char *__restrict __s,
const wchar_t *__restrict __pwcs, size_t __n)
__attribute__ ((__nothrow__ , __leaf__));
extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int getsubopt (char **__restrict __optionp,
char *const *__restrict __tokens,
char **__restrict __valuep)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
extern int getloadavg (double __loadavg[], int __nelem)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
typedef unsigned long int size_t;
signed int main()
{
signed int *p;
void *return_value_malloc=malloc(sizeof(signed int) );
p = (signed int *)return_value_malloc;
*p = nondet_signed_int();
for( ; *p >= 0; *p = *p - 1)
while(!(!(*p - 1 < (-0x7fffffff - 1) || 0x7fffffff < *p - 1)));
free((void *)p);
return 0;
}
|
the_stack_data/206393319.c | /**~common behavior~
* OpaqueBehavior [Class]
*
* Description
*
* An OpaqueBehavior is a Behavior whose specification is given in a textual language other than UML.
*
* Diagrams
*
* Behaviors
*
* Generalizations
*
* Behavior
*
* Specializations
*
* FunctionBehavior
*
* Attributes
*
* body : String [0..*]
*
* Specifies the behavior in one or more languages.
*
* language : String [0..*]
*
* Languages the body strings use in the same order as the body strings.
**/ |
the_stack_data/70791.c | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
struct Person
{
char *name;
int age;
int height;
int weight;
};
struct Person Person_create(char *name, int age, int height, int weight)
{
struct Person who;
who.name = name;
who.age = age;
who.height = height;
who.weight = weight;
return who;
}
void Person_print(struct Person who)
{
printf("Name: %s\n", who.name);
printf("\tAge: %d\n", who.age);
printf("\tHeight: %d\n", who.height);
printf("\tWeight: %d\n", who.weight);
}
int main(int argc, char *argv[])
{
// make two people structures
struct Person joe = Person_create(
"Joe Alex", 32, 64, 140);
struct Person frank = Person_create(
"Frank Blank", 20, 72, 180);
// print them out
Person_print(joe);
Person_print(frank);
// make everyone age 20 years and print them again
joe.age += 20;
joe.height -= 2;
joe.weight += 40;
Person_print(joe);
frank.age += 20;
frank.weight +=20;
Person_print(frank);
return 0;
} |
the_stack_data/985447.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi_base.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kkalnins <[email protected]. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/23 00:32:00 by kkalnins #+# #+# */
/* Updated: 2021/02/23 00:33:26 by kkalnins ### ########.fr */
/* */
/* ************************************************************************** */
int ft_atoi_base(char *str, char *base)
{
return (0);
}
|
the_stack_data/1107279.c | //70分
/*
Week 16 Question 1
Description
數迴是一個我非常喜歡的益智遊戲,數迴詳細的規則請參考以下的網站
https://zh.puzzle-loop.com/
這個學期的最後一個作業請各位同學寫一個程式來解數迴
如果能夠設計一個資料結構用來儲存這個遊戲,並解釋你打算如何用這樣的結構嘗試解決遊戲,那你可以拿到70分
如果能夠寫一個程式用你設計的資料結構,自行設計輸入輸出格式,嘗試解開5 X 5的普通難度但是沒有成功,那你可以拿到80分
如果能夠寫一個程式用你設計的資料結構,自行設計輸入輸出格式,解開5 X 5的普通難度,那你可以拿到95分
如果能夠寫一個程式用你設計的資料結構,自行設計輸入輸出格式,解開5 X 5的困難難度,那你可以拿到100分
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define wall 9
#define dot 8
void main()
{
char maps[13][13];
for (int i = 0; i < 13; i++)
for (int j = 0; j < 13; j++)
maps[i][j] = 32;
printf("\n===================32===================================\n");
for (int i = 0; i < 13; i++)
{
for (int j = 0; j < 13; j++)
printf("%c", maps[i][j]);
printf("\n");
}
printf("\n=======================================================\n");
for (int i = 0; i < 13; i++)
{
maps[0][i] = wall;
maps[i][0] = wall;
maps[i][12] = wall;
maps[12][i] = wall;
}
printf("\n======================wall=================================\n");
for (int i = 0; i < 13; i++)
{
for (int j = 0; j < 13; j++)
{
if (maps[i][j] == 32)
printf("+");
else if (maps[i][j] == wall)
printf("#");
else
printf("!");
}
printf("\n");
}
printf("\n========================================================\n");
for (int i = 1; i <= 11; i += 2)
{
for (int j = 1; j <= 11; j += 2)
maps[i][j] = dot;
}
printf("\n===========================dot=============================\n");
for (int i = 0; i < 13; i++)
{
for (int j = 0; j < 13; j++)
{
if (maps[i][j] == 32)
printf("+");
else if (maps[i][j] == wall)
printf("#");
else if (maps[i][j] == dot)
printf(".");
else
printf("!");
}
printf("\n");
}
printf("\n========================================================\n");
char tmp[5];
for (int i = 1; i <= 5; i++)
{
gets(tmp);
maps[2 * i][2] = tmp[0];
//printf("%c\n", tmp[0]);
//printf("maps:%c\n", maps[2 * i][2]);
maps[2 * i][4] = tmp[1];
maps[2 * i][6] = tmp[2];
maps[2 * i][8] = tmp[3];
maps[2 * i][10] = tmp[4];
printf("\n===========================i:%d=============================\n", i);
for (int l = 0; l < 13; l++)
{
for (int j = 0; j < 13; j++)
{
if (maps[l][j] == 32)
printf("+");
else if (maps[l][j] == wall)
printf("#");
else if (maps[l][j] == dot)
printf(".");
else if (maps[l][j] >= 48 && maps[l][j] <= 57)
printf("%c", maps[l][j]);
else
printf("!");
}
printf("\n");
}
printf("\n========================================================\n");
}
printf("\n=================tmp=======================================\n");
for (int i = 0; i < 13; i++)
{
for (int j = 0; j < 13; j++)
{
if (maps[i][j] == 32)
printf("+");
else if (maps[i][j] == wall)
printf("#");
else if (maps[i][j] == dot)
printf(".");
else if (maps[i][j] >= 48 && maps[i][j] <= 57)
printf("%c", maps[i][j]);
else
printf("!");
}
printf("\n");
}
printf("\n========================================================\n");
for (int i = 0; i < 13; i++)
{
for (int j = 0; j < 13; j++)
{
if (maps[i][j] == wall)
printf("#");
else if (maps[i][j] == dot)
printf(".");
else
printf("%c", maps[i][j]);
}
printf("\n");
}
}
|
the_stack_data/206392091.c | #include <stdio.h>
void swap(int *x, int *y)
{
int _x = *x ;
*x = *y ;
*y = _x ;
}
void heapify(int arr[], int n, int i)
{
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if (l < n && arr[l] > arr[largest])
largest = l;
if (r < n && arr[r] > arr[largest])
largest = r;
if (largest != i)
{
swap(&(arr[i]), &(arr[largest]));
heapify(arr, n, largest);
}
}
void heapSort(int arr[], int n)
{
for (int i = n / 2 - 1; i > 0; i--)
heapify(arr, n, i);
for (int i=n-1; i >= 0; i--)
{
swap(&(arr[0]), &(arr[i])) ;
heapify(arr, i, 0);
}
}
void printArray(int arr[], int n)
{
for (int i=0; i<n; ++i)
printf("%d ", arr[i]) ;
printf("\n") ;
}
int main()
{
int arr[] = {12, 11, 13, 5, 6, 7};
int n = 6 ;
heapSort(arr, n);
printArray(arr, n);
}
|
the_stack_data/28263969.c | /*-------------------------------------------------------------
usb.c -- USB lowlevel
Copyright (C) 2008
Michael Wiedenbauer (shagkur)
Dave Murphy (WinterMute)
tueidj
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
-------------------------------------------------------------*/
/* Note: There are 3 types of USB interfaces here, the early ones
* (V0: /dev/usb/oh0 and /dev/usb/oh1) and two later ones (V5: /dev/usb/ven
* and /dev/usb/hid) which are similar but have some small
* differences. There is also an earlier version of /dev/usb/hid (V4)
* found in IOSes 37,61,56,etc. and /dev/usb/msc found in IOS 57.
* These interfaces aren't implemented here and you may find some
* devices don't show up if you're running under those IOSes.
*/
#if defined(HW_RVL)
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <time.h>
#include <gcutil.h>
#include <ogcsys.h>
#include <ipc.h>
#include <asm.h>
#include <processor.h>
#include "usb.h"
#define USB_HEAPSIZE 16384
#define USBV0_IOCTL_CTRLMSG 0
#define USBV0_IOCTL_BLKMSG 1
#define USBV0_IOCTL_INTRMSG 2
#define USBV0_IOCTL_SUSPENDDEV 5
#define USBV0_IOCTL_RESUMEDEV 6
#define USBV0_IOCTL_ISOMSG 9
#define USBV0_IOCTL_GETDEVLIST 12
#define USBV0_IOCTL_DEVREMOVALHOOK 26
#define USBV0_IOCTL_DEVINSERTHOOK 27
#define USBV0_IOCTL_DEVICECLASSCHANGE 28
#define USBV0_IOCTL_RESETDEVICE 29
#define USBV4_IOCTL_GETVERSION 6 // returns 0x40001
#define USBV4_IOCTL_CANCELINTERRUPT 8
#define USBV5_IOCTL_GETVERSION 0 // should return 0x50001
#define USBV5_IOCTL_GETDEVICECHANGE 1
#define USBV5_IOCTL_SHUTDOWN 2
#define USBV5_IOCTL_GETDEVPARAMS 3
#define USBV5_IOCTL_ATTACHFINISH 6
#define USBV5_IOCTL_SETALTERNATE 7
#define USBV5_IOCTL_SUSPEND_RESUME 16
#define USBV5_IOCTL_CANCELENDPOINT 17
#define USBV5_IOCTL_CTRLMSG 18
#define USBV5_IOCTL_INTRMSG 19
#define USBV5_IOCTL_ISOMSG 20
#define USBV5_IOCTL_BULKMSG 21
#define USBV5_IOCTL_MSC_READWRITE_ASYNC 32 /* unimplemented */
#define USBV5_IOCTL_MSC_READ_ASYNC 33 /* unimplemented */
#define USBV5_IOCTL_MSC_WRITE_ASYNC 34 /* unimplemented */
#define USBV5_IOCTL_MSC_READWRITE 35 /* unimplemented */
#define USBV5_IOCTL_MSC_RESET 36 /* unimplemented */
#define USB_MAX_DEVICES 32
static s32 hId = -1;
static const char __oh0_path[] ATTRIBUTE_ALIGN(32) = "/dev/usb/oh0";
static const char __ven_path[] ATTRIBUTE_ALIGN(32) = "/dev/usb/ven";
static const char __hid_path[] ATTRIBUTE_ALIGN(32) = "/dev/usb/hid";
typedef struct _usb_cb_list {
usbcallback cb;
void *userdata;
union {
s32 device_id;
struct _usb_cb_list *next;
};
} _usb_cb_list;
struct _usbv5_host {
usb_device_entry attached_devices[USB_MAX_DEVICES];
_usb_cb_list remove_cb[USB_MAX_DEVICES];
s32 fd;
_usb_cb_list *device_change_notify;
};
static struct _usbv5_host* ven_host = NULL;
static struct _usbv5_host* hid_host = NULL;
struct _usb_msg {
s32 fd;
u32 heap_buffers;
union {
struct {
u8 bmRequestType;
u8 bmRequest;
u16 wValue;
u16 wIndex;
u16 wLength;
void *rpData;
} ctrl;
struct {
void *rpData;
u16 wLength;
u8 pad[4];
u8 bEndpoint;
} bulk;
struct {
void *rpData;
u16 wLength;
u8 bEndpoint;
} intr;
struct {
void *rpData;
void *rpPacketSizes;
u8 bPackets;
u8 bEndpoint;
} iso;
struct {
u16 pid;
u16 vid;
} notify;
u8 class;
u32 hid_intr_dir;
u32 align_pad[4]; // pad to 24 bytes
};
usbcallback cb;
void *userdata;
ioctlv vec[7];
};
static s32 __usbv5_devicechangeCB(s32 result, void *p);
static s32 __usbv5_attachfinishCB(s32 result, void *p)
{
_usb_cb_list *list;
struct _usbv5_host* host = (struct _usbv5_host*)p;
if(host==NULL) return IPC_EINVAL;
/* the callback functions may attempt to set a new notify func,
* device_change_notify is set to NULL *before* calling it to
* avoid wiping out the new functions
*/
list = host->device_change_notify;
host->device_change_notify = NULL;
while (list) {
_usb_cb_list *next = list->next;
list->cb(result, list->userdata);
iosFree(hId, list);
list = next;
}
if (result==0)
IOS_IoctlAsync(host->fd, USBV5_IOCTL_GETDEVICECHANGE, NULL, 0, host->attached_devices, 0x180, __usbv5_devicechangeCB, host);
return IPC_OK;
}
static s32 __usbv5_devicechangeCB(s32 result, void *p)
{
int i, j;
struct _usbv5_host* host = (struct _usbv5_host*)p;
if(host==NULL) return IPC_EINVAL;
if (result>=0) {
// can't check the remove callbacks only if the number of devices has decreased,
// because devices may have been inserted as well as removed
for (i=0; i<USB_MAX_DEVICES; i++) {
if (host->remove_cb[i].cb==NULL)
continue;
for (j=0; j<result; j++) {
if (host->remove_cb[i].device_id == host->attached_devices[j].device_id)
break;
}
if (j==result) { // execute callback and remove it
host->remove_cb[i].cb(0, host->remove_cb[i].userdata);
host->remove_cb[i].cb = NULL;
}
}
// wipe unused device entries
memset(host->attached_devices+result, 0, sizeof(usb_device_entry)*(32-result));
IOS_IoctlAsync(host->fd, USBV5_IOCTL_ATTACHFINISH, NULL, 0, NULL, 0, __usbv5_attachfinishCB, host);
}
return IPC_OK;
}
static s32 add_devicechange_cb(_usb_cb_list **list, usbcallback cb, void *userdata)
{
_usb_cb_list *new_cb = (_usb_cb_list*)iosAlloc(hId, sizeof(_usb_cb_list));
if (new_cb==NULL)
return IPC_ENOMEM;
new_cb->cb = cb;
new_cb->userdata = userdata;
new_cb->next = *list;
*list = new_cb;
return IPC_OK;
}
static s32 __usbv5_messageCB(s32 result,void *_msg)
{
struct _usb_msg *msg = (struct _usb_msg*)_msg;
if(msg==NULL) return IPC_EINVAL;
if(msg->cb!=NULL) msg->cb(result, msg->userdata);
iosFree(hId,msg);
return IPC_OK;
}
static s32 __usbv0_messageCB(s32 result,void *usrdata)
{
u32 i;
struct _usb_msg *msg = (struct _usb_msg*)usrdata;
if(msg==NULL) return IPC_EINVAL;
if(msg->cb!=NULL) msg->cb(result, msg->userdata);
for(i=0; i<msg->heap_buffers; i++) {
if(msg->vec[i].data!=NULL)
iosFree(hId,msg->vec[i].data);
}
iosFree(hId,msg);
return IPC_OK;
}
static s32 __find_device_on_host(struct _usbv5_host *host, s32 device_id)
{
int i;
if (host==NULL) return -1;
for (i=0; host->attached_devices[i].device_id; i++) {
if (host->attached_devices[i].device_id == device_id)
return i;
}
return -1;
}
static s32 __usb_isochronous_message(s32 device_id,u8 bEndpoint,u8 bPackets,u16* rpPacketSizes,void* rpData,usbcallback cb,void *userdata)
{
s32 ret = IPC_ENOMEM;
struct _usb_msg *msg;
u16 wLength=0;
u8 i;
for (i=0; i<bPackets; i++)
wLength += rpPacketSizes[i];
if(wLength==0) return IPC_EINVAL;
if(((u32)rpData%32)!=0) return IPC_EINVAL;
if(((u32)rpPacketSizes%32)!=0) return IPC_EINVAL;
if(bPackets==0) return IPC_EINVAL;
if(rpPacketSizes==NULL || rpData==NULL) return IPC_EINVAL;
msg = (struct _usb_msg*)iosAlloc(hId,sizeof(struct _usb_msg));
if(msg==NULL) return IPC_ENOMEM;
memset(msg, 0, sizeof(struct _usb_msg));
msg->fd = device_id;
msg->cb = cb;
msg->userdata = userdata;
if (device_id>=0 && device_id<0x20) {
u8 *pEndp=NULL;
u16 *pLength=NULL;
u8 *pPackets=NULL;
pEndp = (u8*)iosAlloc(hId,32);
if(pEndp==NULL) goto done;
*pEndp = bEndpoint;
pLength = (u16*)iosAlloc(hId,32);
if(pLength==NULL) goto done;
// NOT byteswapped!
*pLength = wLength;
pPackets = (u8*)iosAlloc(hId,32);
if(pPackets==NULL) goto done;
*pPackets = bPackets;
msg->heap_buffers = 3;
msg->vec[0].data = pEndp;
msg->vec[0].len = sizeof(u8);
msg->vec[1].data = pLength;
msg->vec[1].len = sizeof(u16);
msg->vec[2].data = pPackets;
msg->vec[2].len = sizeof(u8);
msg->vec[3].data = rpPacketSizes;
msg->vec[3].len = sizeof(u16)*bPackets;
msg->vec[4].data = rpData;
msg->vec[4].len = wLength;
if (cb==NULL)
ret = IOS_Ioctlv(device_id, USBV0_IOCTL_ISOMSG, 3, 2, msg->vec);
else
return IOS_IoctlvAsync(device_id, USBV0_IOCTL_ISOMSG, 3, 2, msg->vec, __usbv0_messageCB, msg);
done:
if(pEndp) iosFree(hId,pEndp);
if(pLength) iosFree(hId,pLength);
if(pPackets) iosFree(hId,pPackets);
} else {
u8 endpoint_dir = !!(bEndpoint&USB_ENDPOINT_IN);
s32 fd = (device_id<0) ? ven_host->fd : hid_host->fd;
msg->iso.rpData = rpData;
msg->iso.rpPacketSizes = rpPacketSizes;
msg->iso.bEndpoint = bEndpoint;
msg->iso.bPackets = bPackets;
msg->vec[0].data = msg;
msg->vec[0].len = 64;
// block counts are used for both input and output
msg->vec[1].data = msg->vec[3].data = rpPacketSizes;
msg->vec[1].len = msg->vec[3].len = sizeof(u16)*bPackets;
msg->vec[2].data = rpData;
msg->vec[2].len = wLength;
if (cb==NULL)
ret = IOS_Ioctlv(fd, USBV5_IOCTL_ISOMSG, 2-endpoint_dir, 2+endpoint_dir, msg->vec);
else
return IOS_IoctlvAsync(fd, USBV5_IOCTL_ISOMSG, 2-endpoint_dir, 2+endpoint_dir, msg->vec, __usbv5_messageCB, msg);
}
if (msg!=NULL) iosFree(hId,msg);
return ret;
}
static s32 __usb_control_message(s32 device_id,u8 bmRequestType,u8 bmRequest,u16 wValue,u16 wIndex,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
s32 ret = IPC_ENOMEM;
struct _usb_msg *msg;
if(((s32)rpData%32)!=0) return IPC_EINVAL;
if(wLength && !rpData) return IPC_EINVAL;
if(!wLength && rpData) return IPC_EINVAL;
msg = (struct _usb_msg*)iosAlloc(hId,sizeof(struct _usb_msg));
if(msg==NULL) return IPC_ENOMEM;
memset(msg, 0, sizeof(struct _usb_msg));
msg->fd = device_id;
msg->cb = cb;
msg->userdata = userdata;
if (device_id>=0 && device_id<0x20) {
u8 *pRqType = NULL,*pRq = NULL,*pNull = NULL;
u16 *pValue = NULL,*pIndex = NULL,*pLength = NULL;
pRqType = (u8*)iosAlloc(hId,32);
if(pRqType==NULL) goto done;
*pRqType = bmRequestType;
pRq = (u8*)iosAlloc(hId,32);
if(pRq==NULL) goto done;
*pRq = bmRequest;
pValue = (u16*)iosAlloc(hId,32);
if(pValue==NULL) goto done;
*pValue = bswap16(wValue);
pIndex = (u16*)iosAlloc(hId,32);
if(pIndex==NULL) goto done;
*pIndex = bswap16(wIndex);
pLength = (u16*)iosAlloc(hId,32);
if(pLength==NULL) goto done;
*pLength = bswap16(wLength);
pNull = (u8*)iosAlloc(hId,32);
if(pNull==NULL) goto done;
*pNull = 0;
msg->heap_buffers = 6;
msg->vec[0].data = pRqType;
msg->vec[0].len = sizeof(u8);
msg->vec[1].data = pRq;
msg->vec[1].len = sizeof(u8);
msg->vec[2].data = pValue;
msg->vec[2].len = sizeof(u16);
msg->vec[3].data = pIndex;
msg->vec[3].len = sizeof(u16);
msg->vec[4].data = pLength;
msg->vec[4].len = sizeof(u16);
msg->vec[5].data = pNull;
msg->vec[5].len = sizeof(u8);
msg->vec[6].data = rpData;
msg->vec[6].len = wLength;
if (cb==NULL)
ret = IOS_Ioctlv(device_id, USBV0_IOCTL_CTRLMSG, 6, 1, msg->vec);
else
return IOS_IoctlvAsync(device_id, USBV0_IOCTL_CTRLMSG, 6, 1, msg->vec, __usbv0_messageCB, msg);
done:
if(pRqType!=NULL) iosFree(hId,pRqType);
if(pRq!=NULL) iosFree(hId,pRq);
if(pValue!=NULL) iosFree(hId,pValue);
if(pIndex!=NULL) iosFree(hId,pIndex);
if(pLength!=NULL) iosFree(hId,pLength);
if(pNull!=NULL) iosFree(hId,pNull);
} else {
u8 request_dir = !!(bmRequestType&USB_CTRLTYPE_DIR_DEVICE2HOST);
s32 fd = (device_id<0) ? ven_host->fd : hid_host->fd;
msg->ctrl.bmRequestType = bmRequestType;
msg->ctrl.bmRequest = bmRequest;
msg->ctrl.wValue = wValue;
msg->ctrl.wIndex = wIndex;
msg->ctrl.wLength = wLength;
msg->ctrl.rpData = rpData;
msg->vec[0].data = msg;
msg->vec[0].len = 64;
msg->vec[1].data = rpData;
msg->vec[1].len = wLength;
if (cb==NULL)
ret = IOS_Ioctlv(fd, USBV5_IOCTL_CTRLMSG, 2-request_dir, request_dir, msg->vec);
else
return IOS_IoctlvAsync(fd, USBV5_IOCTL_CTRLMSG, 2-request_dir, request_dir, msg->vec, __usbv5_messageCB, msg);
}
if(msg!=NULL) iosFree(hId,msg);
return ret;
}
static inline s32 __usb_interrupt_bulk_message(s32 device_id,u8 ioctl,u8 bEndpoint,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
s32 ret = IPC_ENOMEM;
struct _usb_msg *msg;
if(((s32)rpData%32)!=0) return IPC_EINVAL;
if(wLength && !rpData) return IPC_EINVAL;
if(!wLength && rpData) return IPC_EINVAL;
msg = (struct _usb_msg*)iosAlloc(hId,sizeof(struct _usb_msg));
if(msg==NULL) return IPC_ENOMEM;
memset(msg, 0, sizeof(struct _usb_msg));
msg->fd = device_id;
msg->cb = cb;
msg->userdata = userdata;
if (device_id>=0 && device_id<0x20) {
u8 *pEndP = NULL;
u16 *pLength = NULL;
pEndP = (u8*)iosAlloc(hId,32);
if(pEndP==NULL) goto done;
*pEndP = bEndpoint;
pLength = (u16*)iosAlloc(hId,32);
if(pLength==NULL) goto done;
*pLength = wLength;
msg->vec[0].data = pEndP;
msg->vec[0].len = sizeof(u8);
msg->vec[1].data = pLength;
msg->vec[1].len = sizeof(u16);
msg->vec[2].data = rpData;
msg->vec[2].len = wLength;
msg->heap_buffers = 2;
if (cb==NULL)
ret = IOS_Ioctlv(device_id,ioctl,2,1,msg->vec);
else
return IOS_IoctlvAsync(device_id,ioctl,2,1,msg->vec,__usbv0_messageCB,msg);
done:
if(pEndP!=NULL) iosFree(hId,pEndP);
if(pLength!=NULL) iosFree(hId,pLength);
} else {
u8 endpoint_dir = !!(bEndpoint&USB_ENDPOINT_IN);
s32 fd = (device_id<0) ? ven_host->fd : hid_host->fd;
if (ioctl == USBV0_IOCTL_INTRMSG) {
// HID does this a little bit differently
if (device_id>=0)
msg->hid_intr_dir = !endpoint_dir;
else {
msg->intr.rpData = rpData;
msg->intr.wLength = wLength;
msg->intr.bEndpoint = bEndpoint;
}
ioctl = USBV5_IOCTL_INTRMSG;
} else {
msg->bulk.rpData = rpData;
msg->bulk.wLength = wLength;
msg->bulk.bEndpoint = bEndpoint;
ioctl = USBV5_IOCTL_BULKMSG;
}
msg->vec[0].data = msg;
msg->vec[0].len = 64;
msg->vec[1].data = rpData;
msg->vec[1].len = wLength;
if (cb==NULL)
ret = IOS_Ioctlv(fd, ioctl, 2-endpoint_dir, endpoint_dir, msg->vec);
else
return IOS_IoctlvAsync(fd, ioctl, 2-endpoint_dir, endpoint_dir, msg->vec, __usbv5_messageCB, msg);
}
if(msg!=NULL) iosFree(hId,msg);
return ret;
}
static inline s32 __usb_getdesc(s32 fd, u8 *buffer, u8 valuehi, u8 valuelo, u16 index, u16 size)
{
u8 requestType = USB_CTRLTYPE_DIR_DEVICE2HOST;
if (valuehi==USB_DT_HID || valuehi==USB_DT_REPORT || valuehi==USB_DT_PHYSICAL)
requestType |= USB_CTRLTYPE_REC_INTERFACE;
return __usb_control_message(fd, requestType, USB_REQ_GETDESCRIPTOR, (valuehi << 8) | valuelo, index, size, buffer, NULL, NULL);
}
static u32 __find_next_endpoint(u8 *buffer,s32 size,u8 align)
{
u8 *ptr = buffer;
while(size>2 && buffer[0]) { // abort if buffer[0]==0 to avoid getting stuck
if(buffer[1]==USB_DT_ENDPOINT || buffer[1]==USB_DT_INTERFACE)
break;
size -= (buffer[0]+align)&~align;
buffer += (buffer[0]+align)&~align;
}
return (buffer - ptr);
}
s32 USB_Initialize(void)
{
if(hId==-1) hId = iosCreateHeap(USB_HEAPSIZE);
if(hId<0) return IPC_ENOMEM;
if (ven_host==NULL) {
s32 ven_fd = IOS_Open(__ven_path, IPC_OPEN_NONE);
if (ven_fd>=0) {
ven_host = (struct _usbv5_host*)iosAlloc(hId, sizeof(*ven_host));
if (ven_host==NULL) {
IOS_Close(ven_fd);
return IPC_ENOMEM;
}
memset(ven_host, 0, sizeof(*ven_host));
ven_host->fd = ven_fd;
u32 *ven_ver = (u32*)iosAlloc(hId, 0x20);
if (ven_ver==NULL) goto mem_error;
if (IOS_Ioctl(ven_fd, USBV5_IOCTL_GETVERSION, NULL, 0, ven_ver, 0x20)==0 && ven_ver[0]==0x50001)
IOS_IoctlAsync(ven_fd, USBV5_IOCTL_GETDEVICECHANGE, NULL, 0, ven_host->attached_devices, 0x180, __usbv5_devicechangeCB, ven_host);
else {
// wrong ven version
IOS_Close(ven_fd);
iosFree(hId, ven_host);
ven_host = NULL;
}
iosFree(hId, ven_ver);
}
}
if (hid_host==NULL) {
s32 hid_fd = IOS_Open(__hid_path, IPC_OPEN_NONE);
if (hid_fd>=0) {
hid_host = (struct _usbv5_host*)iosAlloc(hId, sizeof(*hid_host));
if (hid_host==NULL) {
IOS_Close(hid_fd);
goto mem_error;
}
memset(hid_host, 0, sizeof(*hid_host));
hid_host->fd = hid_fd;
u32 *hid_ver = (u32*)iosAlloc(hId, 0x20);
if (hid_ver==NULL) goto mem_error;
// have to call the USB4 version first, to be safe
if (IOS_Ioctl(hid_fd, USBV4_IOCTL_GETVERSION, NULL, 0, NULL, 0)==0x40001 || \
IOS_Ioctl(hid_fd, USBV5_IOCTL_GETVERSION, NULL, 0, hid_ver, 0x20) || hid_ver[0]!=0x50001) {
// wrong hid version
IOS_Close(hid_fd);
iosFree(hId, hid_host);
hid_host = NULL;
} else
IOS_IoctlAsync(hid_fd, USBV5_IOCTL_GETDEVICECHANGE, NULL, 0, hid_host->attached_devices, 0x180, __usbv5_devicechangeCB, hid_host);
iosFree(hId, hid_ver);
}
}
return IPC_OK;
mem_error:
USB_Deinitialize();
return IPC_ENOMEM;
}
s32 USB_Deinitialize(void)
{
if (hid_host) {
if (hid_host->fd>=0) {
IOS_Ioctl(hid_host->fd, USBV5_IOCTL_SHUTDOWN, NULL, 0, NULL, 0);
IOS_Close(hid_host->fd);
}
iosFree(hId, hid_host);
hid_host = NULL;
}
if (ven_host) {
if (ven_host->fd>=0) {
IOS_Ioctl(ven_host->fd, USBV5_IOCTL_SHUTDOWN, NULL, 0, NULL, 0);
IOS_Close(ven_host->fd);
}
iosFree(hId, ven_host);
ven_host = NULL;
}
return IPC_OK;
}
s32 USB_OpenDevice(s32 device_id,u16 vid,u16 pid,s32 *fd)
{
s32 ret = USB_OK;
char *devicepath = NULL;
*fd = -1;
if (device_id && device_id!=USB_OH1_DEVICE_ID) {
int i;
i = __find_device_on_host(ven_host, device_id);
if (i>=0)
USB_ResumeDevice(device_id);
else {
// HID V5 devices need their descriptors read before being used
usb_devdesc desc;
i = __find_device_on_host(hid_host, device_id);
if (i>=0) {
USB_ResumeDevice(device_id);
i = USB_GetDescriptors(device_id, &desc);
if (i>=0)
USB_FreeDescriptors(&desc);
else {
USB_SuspendDevice(device_id);
return i;
}
}
}
if (i>=0) {
*fd = device_id;
return 0;
}
}
devicepath = iosAlloc(hId,USB_MAXPATH);
if(devicepath==NULL) return IPC_ENOMEM;
if (device_id==USB_OH1_DEVICE_ID)
snprintf(devicepath,USB_MAXPATH,"/dev/usb/oh1/%x/%x",vid,pid);
else
snprintf(devicepath,USB_MAXPATH,"/dev/usb/oh0/%x/%x",vid,pid);
*fd = IOS_Open(devicepath,0);
if(*fd<0) ret = *fd;
if (devicepath!=NULL) iosFree(hId,devicepath);
return ret;
}
s32 USBV5_CloseDevice(s32 device_id)
{
int i;
struct _usbv5_host* host;
if (__find_device_on_host(ven_host, device_id)>=0)
host = ven_host;
else if (__find_device_on_host(hid_host, device_id)>=0)
host = hid_host;
else
return IPC_EINVAL;
for (i=0; i < USB_MAX_DEVICES; i++) {
if (host->remove_cb[i].cb==NULL)
continue;
if (host->remove_cb[i].device_id==device_id) {
host->remove_cb[i].cb(0, host->remove_cb[i].userdata);
host->remove_cb[i].cb = NULL;
break;
}
}
//return USB_SuspendDevice(device_id);
return 0;
}
s32 USB_CloseDevice(s32 *fd)
{
s32 ret = IPC_EINVAL;
if (fd) {
ret = USBV5_CloseDevice(*fd);
if (ret==IPC_EINVAL && *fd>0)
ret = IOS_Close(*fd);
if (ret>=0) *fd = -1;
}
return ret;
}
s32 USB_CloseDeviceAsync(s32 *fd,usbcallback cb,void *userdata)
{
s32 ret = IPC_EINVAL;
if(fd) {
ret = USBV5_CloseDevice(*fd);
if (ret!=IPC_EINVAL) {
if (cb)
return cb(ret, userdata);
else
return ret;
}
if (*fd>0)
return IOS_CloseAsync(*fd,cb,userdata);
}
return ret;
}
s32 USB_GetDeviceDescription(s32 fd,usb_devdesc *devdesc)
{
s32 ret;
usb_devdesc *p;
p = iosAlloc(hId,USB_DT_DEVICE_SIZE);
if(p==NULL) return IPC_ENOMEM;
ret = __usb_control_message(fd,USB_CTRLTYPE_DIR_DEVICE2HOST,USB_REQ_GETDESCRIPTOR,(USB_DT_DEVICE<<8),0,USB_DT_DEVICE_SIZE,p,NULL,NULL);
if(ret>=0) memcpy(devdesc,p,USB_DT_DEVICE_SIZE);
devdesc->configurations = NULL;
if(p!=NULL) iosFree(hId,p);
return ret;
}
static s32 USBV5_GetDescriptors(s32 device_id, usb_devdesc *udd)
{
s32 retval = IPC_ENOMEM;
u32 *io_buffer = NULL;
u8 *buffer = NULL;
usb_configurationdesc *ucd = NULL;
usb_interfacedesc *uid = NULL;
usb_endpointdesc *ued = NULL;
u32 iConf, iEndpoint;
s32 fd;
u32 desc_out_size, desc_start_offset;
if (__find_device_on_host(ven_host, device_id)>=0) {
fd = ven_host->fd;
desc_out_size = 0xC0;
desc_start_offset = 20;
} else if (__find_device_on_host(hid_host, device_id)>=0) {
fd = hid_host->fd;
desc_out_size = 0x60;
desc_start_offset = 36;
} else
return IPC_EINVAL;
io_buffer = (u32*)iosAlloc(hId, 0x20);
buffer = (u8*)iosAlloc(hId, desc_out_size);
if (io_buffer==NULL || buffer==NULL) goto free_bufs;
io_buffer[0] = device_id;
io_buffer[2] = 0;
memset(buffer, 0, desc_out_size);
retval = IOS_Ioctl(fd, USBV5_IOCTL_GETDEVPARAMS, io_buffer, 0x20, buffer, desc_out_size);
if (retval==IPC_OK) {
u8 *next = buffer+desc_start_offset;
memcpy(udd, next, sizeof(*udd));
udd->configurations = calloc(udd->bNumConfigurations, sizeof(*udd->configurations));
if(udd->configurations == NULL) goto free_bufs;
next += (udd->bLength+3)&~3;
for (iConf = 0; iConf < udd->bNumConfigurations; iConf++)
{
ucd = &udd->configurations[iConf];
memcpy(ucd, next, USB_DT_CONFIG_SIZE);
next += (USB_DT_CONFIG_SIZE+3)&~3;
// ignore the actual value of bNumInterfaces; IOS presents each interface as a different device
// alternate settings will not show up here, if you want them you must explicitly request
// the interface descriptor
if (ucd->bNumInterfaces==0)
continue;
ucd->bNumInterfaces = 1;
ucd->interfaces = calloc(1, sizeof(*ucd->interfaces));
if (ucd->interfaces == NULL) goto free_bufs;
uid = ucd->interfaces;
memcpy(uid, next, USB_DT_INTERFACE_SIZE);
next += (uid->bLength+3)&~3;
/* This skips vendor and class specific descriptors */
uid->extra_size = __find_next_endpoint(next, buffer+desc_out_size-next, 3);
if(uid->extra_size>0)
{
uid->extra = malloc(uid->extra_size);
if(uid->extra == NULL)
goto free_bufs;
memcpy(uid->extra, next, uid->extra_size);
// already rounded
next += uid->extra_size;
}
if (uid->bNumEndpoints) {
uid->endpoints = calloc(uid->bNumEndpoints, sizeof(*uid->endpoints));
if (uid->endpoints == NULL) goto free_bufs;
for(iEndpoint = 0; iEndpoint < uid->bNumEndpoints; iEndpoint++)
{
ued = &uid->endpoints[iEndpoint];
memcpy(ued, next, USB_DT_ENDPOINT_SIZE);
next += (ued->bLength+3)&~3;
}
}
}
retval = IPC_OK;
}
free_bufs:
if (io_buffer!=NULL)
iosFree(hId, io_buffer);
if (buffer!=NULL)
iosFree(hId, buffer);
if (retval<0)
USB_FreeDescriptors(udd);
return retval;
}
s32 USB_GetDescriptors(s32 fd, usb_devdesc *udd)
{
u8 *buffer = NULL;
u8 *ptr = NULL;
usb_configurationdesc *ucd = NULL;
usb_interfacedesc *uid = NULL;
usb_endpointdesc *ued = NULL;
s32 retval = 0;
u32 size;
u32 iConf, iInterface, iEndpoint;
if (udd==NULL)
return IPC_EINVAL;
memset(udd, 0, sizeof(*udd));
if (fd>=0x20 || fd<-1)
return USBV5_GetDescriptors(fd, udd);
buffer = iosAlloc(hId, sizeof(*udd));
if(buffer == NULL)
{
retval = IPC_ENOHEAP;
goto free_and_error;
}
retval = __usb_getdesc(fd, buffer, USB_DT_DEVICE, 0, 0, USB_DT_DEVICE_SIZE);
if(retval < 0)
goto free_and_error;
memcpy(udd, buffer, USB_DT_DEVICE_SIZE);
iosFree(hId, buffer);
udd->bcdUSB = bswap16(udd->bcdUSB);
udd->idVendor = bswap16(udd->idVendor);
udd->idProduct = bswap16(udd->idProduct);
udd->bcdDevice = bswap16(udd->bcdDevice);
udd->configurations = calloc(udd->bNumConfigurations, sizeof(*udd->configurations));
if(udd->configurations == NULL)
{
retval = IPC_ENOMEM;
goto free_and_error;
}
for(iConf = 0; iConf < udd->bNumConfigurations; iConf++)
{
buffer = iosAlloc(hId, USB_DT_CONFIG_SIZE);
if(buffer == NULL)
{
retval = IPC_ENOHEAP;
goto free_and_error;
}
retval = __usb_getdesc(fd, buffer, USB_DT_CONFIG, iConf, 0, USB_DT_CONFIG_SIZE);
if (retval < 0)
goto free_and_error;
ucd = &udd->configurations[iConf];
memcpy(ucd, buffer, USB_DT_CONFIG_SIZE);
iosFree(hId, buffer);
ucd->wTotalLength = bswap16(ucd->wTotalLength);
size = ucd->wTotalLength;
buffer = iosAlloc(hId, size);
if(buffer == NULL)
{
retval = IPC_ENOHEAP;
goto free_and_error;
}
retval = __usb_getdesc(fd, buffer, USB_DT_CONFIG, iConf, 0, ucd->wTotalLength);
if(retval < 0)
goto free_and_error;
ptr = buffer;
ptr += ucd->bLength;
size -= ucd->bLength;
retval = IPC_ENOMEM;
ucd->interfaces = calloc(ucd->bNumInterfaces, sizeof(*ucd->interfaces));
if(ucd->interfaces == NULL)
goto free_and_error;
for(iInterface = 0; iInterface < ucd->bNumInterfaces; iInterface++)
{
retval = __find_next_endpoint(ptr, size, 0);
if (retval>0) {
// FIXME: do something with this data
}
ptr += retval;
size -= retval;
uid = ucd->interfaces+iInterface;
memcpy(uid, ptr, USB_DT_INTERFACE_SIZE);
ptr += uid->bLength;
size -= uid->bLength;
/* This skips vendor and class specific descriptors */
uid->extra_size = __find_next_endpoint(ptr, size, 0);
if(uid->extra_size>0)
{
uid->extra = malloc(uid->extra_size);
if(uid->extra == NULL)
goto free_and_error;
memcpy(uid->extra, ptr, uid->extra_size);
ptr += uid->extra_size;
size -= uid->extra_size;
}
if (uid->bNumEndpoints) {
uid->endpoints = calloc(uid->bNumEndpoints, sizeof(*uid->endpoints));
if(uid->endpoints == NULL)
goto free_and_error;
for(iEndpoint = 0; iEndpoint < uid->bNumEndpoints; iEndpoint++)
{
ued = &uid->endpoints[iEndpoint];
memcpy(ued, ptr, USB_DT_ENDPOINT_SIZE);
ptr += ued->bLength;
size -= ued->bLength;
ued->wMaxPacketSize = bswap16(ued->wMaxPacketSize);
}
}
if (iInterface==(ucd->bNumInterfaces-1) && size>2) {
// we've read all the interfaces but there's data left (probably alternate setting interfaces)
// see if we can find another interface descriptor
retval = __find_next_endpoint(ptr, size, 0);
if (size-retval >= USB_DT_INTERFACE_SIZE && ptr[retval+1] == USB_DT_INTERFACE) {
// found alternates, make room and loop
usb_interfacedesc *interfaces = realloc(ucd->interfaces, (iInterface+2)*sizeof(*interfaces));
if (interfaces == NULL)
goto free_and_error;
interfaces[iInterface+1].endpoints = NULL;
interfaces[iInterface+1].extra = NULL;
ucd->bNumInterfaces++;
ucd->interfaces = interfaces;
}
}
}
iosFree(hId, buffer);
buffer = NULL;
}
retval = IPC_OK;
free_and_error:
if(buffer != NULL)
iosFree(hId, buffer);
if(retval < 0)
USB_FreeDescriptors(udd);
return retval;
}
s32 USB_GetGenericDescriptor(s32 fd,u8 type,u8 index,u8 interface,void *data,u32 size) {
u8 *buffer;
s32 retval;
buffer = iosAlloc(hId,size);
if(buffer==NULL) {
retval = IPC_ENOMEM;
goto free_and_error;
}
retval = __usb_getdesc(fd,buffer,type,index,interface,size);
if(retval<0) goto free_and_error;
memcpy(data,buffer,size);
retval = IPC_OK;
free_and_error:
if(buffer!=NULL) iosFree(hId,buffer);
return retval;
}
s32 USB_GetHIDDescriptor(s32 fd,u8 interface,usb_hiddesc *uhd,u32 size)
{
int i;
s32 retval;
if (size < USB_DT_HID_SIZE)
return IPC_EINVAL;
retval = USB_GetGenericDescriptor(fd, USB_DT_HID, 0, interface, uhd, size);
if (retval != IPC_OK)
return retval;
uhd->bcdHID = bswap16(uhd->bcdHID);
uhd->descr[0].wDescriptorLength = bswap16(uhd->descr[0].wDescriptorLength);
size -= USB_DT_HID_SIZE;
for (i=1; i<uhd->bNumDescriptors && size>=3; size -=3, i++)
uhd->descr[i].wDescriptorLength = bswap16(uhd->descr[i].wDescriptorLength);
return retval;
}
void USB_FreeDescriptors(usb_devdesc *udd)
{
int iConf, iInterface;
usb_configurationdesc *ucd;
usb_interfacedesc *uid;
if(udd->configurations != NULL)
{
for(iConf = 0; iConf < udd->bNumConfigurations; iConf++)
{
ucd = &udd->configurations[iConf];
if(ucd->interfaces != NULL)
{
for(iInterface = 0; iInterface < ucd->bNumInterfaces; iInterface++)
{
uid = ucd->interfaces+iInterface;
free(uid->endpoints);
free(uid->extra);
}
free(ucd->interfaces);
}
}
free(udd->configurations);
}
}
s32 USB_GetAsciiString(s32 fd,u8 bIndex,u16 wLangID,u16 wLength,void *rpData)
{
s32 ret;
u8 bo, ro;
u8 *buf;
u8 *rp = (u8 *)rpData;
if(wLength > 255)
wLength = 255;
buf = iosAlloc(hId, 255); /* 255 is the highest possible length of a descriptor */
if(buf == NULL)
return IPC_ENOMEM;
ret = __usb_getdesc(fd, buf, USB_DT_STRING, bIndex, wLangID, 255);
/* index 0 gets a list of supported languages */
if(bIndex == 0)
{
if(ret > 0)
memcpy(rpData, buf, wLength);
iosFree(hId, buf);
return ret;
}
if(ret > 0)
{
bo = 2;
ro = 0;
while(ro < (wLength - 1) && bo < buf[0])
{
if(buf[bo + 1])
rp[ro++] = '?';
else
rp[ro++] = buf[bo];
bo += 2;
}
rp[ro] = 0;
ret = ro - 1;
}
iosFree(hId, buf);
return ret;
}
s32 USB_ReadIsoMsg(s32 fd,u8 bEndpoint,u8 bPackets,u16 *rpPacketSizes,void *rpData)
{
return __usb_isochronous_message(fd,bEndpoint,bPackets,rpPacketSizes,rpData,NULL,NULL);
}
s32 USB_ReadIsoMsgAsync(s32 fd,u8 bEndpoint,u8 bPackets,u16 *rpPacketSizes,void *rpData,usbcallback cb,void *userdata)
{
return __usb_isochronous_message(fd,bEndpoint,bPackets,rpPacketSizes,rpData,cb,userdata);
}
s32 USB_WriteIsoMsg(s32 fd,u8 bEndpoint,u8 bPackets,u16 *rpPacketSizes,void *rpData)
{
return __usb_isochronous_message(fd,bEndpoint,bPackets,rpPacketSizes,rpData,NULL,NULL);
}
s32 USB_WriteIsoMsgAsync(s32 fd,u8 bEndpoint,u8 bPackets,u16 *rpPacketSizes,void *rpData,usbcallback cb,void *userdata)
{
return __usb_isochronous_message(fd,bEndpoint,bPackets,rpPacketSizes,rpData,cb,userdata);
}
s32 USB_ReadIntrMsg(s32 fd,u8 bEndpoint,u16 wLength,void *rpData)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_INTRMSG,bEndpoint,wLength,rpData,NULL,NULL);
}
s32 USB_ReadIntrMsgAsync(s32 fd,u8 bEndpoint,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_INTRMSG,bEndpoint,wLength,rpData,cb,userdata);
}
s32 USB_WriteIntrMsg(s32 fd,u8 bEndpoint,u16 wLength,void *rpData)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_INTRMSG,bEndpoint,wLength,rpData,NULL,NULL);
}
s32 USB_WriteIntrMsgAsync(s32 fd,u8 bEndpoint,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_INTRMSG,bEndpoint,wLength,rpData,cb,userdata);
}
s32 USB_ReadBlkMsg(s32 fd,u8 bEndpoint,u16 wLength,void *rpData)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_BLKMSG,bEndpoint,wLength,rpData,NULL,NULL);
}
s32 USB_ReadBlkMsgAsync(s32 fd,u8 bEndpoint,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_BLKMSG,bEndpoint,wLength,rpData,cb,userdata);
}
s32 USB_WriteBlkMsg(s32 fd,u8 bEndpoint,u16 wLength,void *rpData)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_BLKMSG,bEndpoint,wLength,rpData,NULL,NULL);
}
s32 USB_WriteBlkMsgAsync(s32 fd,u8 bEndpoint,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_interrupt_bulk_message(fd,USBV0_IOCTL_BLKMSG,bEndpoint,wLength,rpData,cb,userdata);
}
s32 USB_ReadCtrlMsg(s32 fd,u8 bmRequestType,u8 bmRequest,u16 wValue,u16 wIndex,u16 wLength,void *rpData)
{
return __usb_control_message(fd,bmRequestType,bmRequest,wValue,wIndex,wLength,rpData,NULL,NULL);
}
s32 USB_ReadCtrlMsgAsync(s32 fd,u8 bmRequestType,u8 bmRequest,u16 wValue,u16 wIndex,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_control_message(fd,bmRequestType,bmRequest,wValue,wIndex,wLength,rpData,cb,userdata);
}
s32 USB_WriteCtrlMsg(s32 fd,u8 bmRequestType,u8 bmRequest,u16 wValue,u16 wIndex,u16 wLength,void *rpData)
{
return __usb_control_message(fd,bmRequestType,bmRequest,wValue,wIndex,wLength,rpData,NULL,NULL);
}
s32 USB_WriteCtrlMsgAsync(s32 fd,u8 bmRequestType,u8 bmRequest,u16 wValue,u16 wIndex,u16 wLength,void *rpData,usbcallback cb,void *userdata)
{
return __usb_control_message(fd,bmRequestType,bmRequest,wValue,wIndex,wLength,rpData,cb,userdata);
}
static s32 USB5_RegisterDeviceRemoval(struct _usbv5_host *host, s32 device_id, usbcallback cb, void *userdata)
{
int i;
// check to make sure the device is present
if (__find_device_on_host(host, device_id)<0)
return IPC_ENOENT;
// now make sure it's not hooked already
for (i=0; i<USB_MAX_DEVICES; i++) {
if (host->remove_cb[i].cb && host->remove_cb[i].device_id==device_id)
return IPC_EINVAL;
}
// find a free entry and add it
for (i=0; i<USB_MAX_DEVICES; i++) {
if (host->remove_cb[i].cb==NULL) {
host->remove_cb[i].cb = cb;
host->remove_cb[i].userdata = userdata;
host->remove_cb[i].device_id = device_id;
return IPC_OK;
}
}
return IPC_EINVAL;
}
s32 USB_DeviceRemovalNotifyAsync(s32 fd,usbcallback cb,void *userdata)
{
s32 ret;
if (fd>=0 && fd<0x20)
return IOS_IoctlAsync(fd,USBV0_IOCTL_DEVREMOVALHOOK,NULL,0,NULL,0,cb,userdata);
ret = USB5_RegisterDeviceRemoval(ven_host, fd, cb, userdata);
if (ret == IPC_ENOENT)
ret = USB5_RegisterDeviceRemoval(hid_host, fd, cb, userdata);
return ret;
}
static s32 USBV5_SuspendResume(s32 device_id, s32 resumed)
{
s32 ret;
s32 fd;
if (__find_device_on_host(ven_host, device_id)>=0)
fd = ven_host->fd;
else if (__find_device_on_host(hid_host, device_id)>=0)
fd = hid_host->fd;
else
return IPC_ENOENT;
s32 *buf = (s32*)iosAlloc(hId, 32);
if (buf==NULL) return IPC_ENOMEM;
buf[0] = device_id;
buf[2] = resumed;
ret = IOS_Ioctl(fd, USBV5_IOCTL_SUSPEND_RESUME, buf, 32, NULL, 0);
iosFree(hId, buf);
return ret;
}
s32 USB_SuspendDevice(s32 fd)
{
if (fd>=0x20 || fd<-1)
return USBV5_SuspendResume(fd, 0);
return IOS_Ioctl(fd,USBV0_IOCTL_SUSPENDDEV,NULL,0,NULL,0);
}
s32 USB_ResumeDevice(s32 fd)
{
if (fd>=0x20 || fd<-1)
return USBV5_SuspendResume(fd, 1);
return IOS_Ioctl(fd,USBV0_IOCTL_RESUMEDEV,NULL,0,NULL,0);
}
s32 USB_DeviceChangeNotifyAsync(u8 interface_class, usbcallback cb, void* userdata)
{
s32 ret=IPC_ENOENT;
if (ven_host==NULL) {
s32 fd;
struct _usb_msg *msg;
fd = IOS_Open(__oh0_path,IPC_OPEN_NONE);
if (fd<0) return fd;
msg = iosAlloc(hId,sizeof(*msg));
if (msg==NULL) {
IOS_Close(fd);
return IPC_ENOMEM;
}
msg->cb = cb;
msg->userdata = userdata;
msg->class = interface_class;
msg->vec[0].data = &msg->class;
msg->vec[0].len = 1;
ret = IOS_IoctlvAsync(fd,USBV0_IOCTL_DEVICECLASSCHANGE,1,0,msg->vec,__usbv5_messageCB,msg);
IOS_Close(fd);
if (ret<0) iosFree(hId, msg);
}
else if (interface_class != USB_CLASS_HID && ven_host)
ret = add_devicechange_cb(&ven_host->device_change_notify, cb, userdata);
else if (interface_class==USB_CLASS_HID && hid_host)
ret = add_devicechange_cb(&hid_host->device_change_notify, cb, userdata);
return ret;
}
s32 USB_GetDeviceList(usb_device_entry *descr_buffer,u8 num_descr,u8 interface_class,u8 *cnt_descr)
{
int i;
u8 cntdevs=0;
if (ven_host==NULL) {
s32 fd;
u32 *buf = (u32*)iosAlloc(hId, num_descr<<3);
if (buf==NULL) return IPC_ENOMEM;
fd = IOS_Open(__oh0_path,IPC_OPEN_NONE);
if (fd<0) {
iosFree(hId, buf);
return fd;
}
cntdevs = 0;
i = IOS_IoctlvFormat(hId,fd,USBV0_IOCTL_GETDEVLIST,"bb:dd",num_descr,interface_class,&cntdevs,sizeof(cntdevs),buf,(num_descr<<3));
if (cnt_descr) *cnt_descr = cntdevs;
while (cntdevs--) {
descr_buffer[cntdevs].device_id = 0;
descr_buffer[cntdevs].vid = (u16)(buf[cntdevs*2+1]>>16);
descr_buffer[cntdevs].pid = (u16)buf[cntdevs*2+1];
}
IOS_Close(fd);
iosFree(hId, buf);
return i;
}
// for ven_host, we can only exclude usb_hid class devices
if (interface_class != USB_CLASS_HID && ven_host) {
i=0;
while (cntdevs<num_descr && ven_host->attached_devices[i].device_id) {
descr_buffer[cntdevs++] = ven_host->attached_devices[i++];
if (i>=32) break;
}
}
if ((!interface_class || interface_class==USB_CLASS_HID) && hid_host) {
i=0;
while (cntdevs<num_descr && hid_host->attached_devices[i].device_id) {
descr_buffer[cntdevs++] = hid_host->attached_devices[i++];
if (i>32) break;
}
}
if (cnt_descr) *cnt_descr = cntdevs;
return IPC_OK;
}
s32 USB_SetConfiguration(s32 fd, u8 configuration)
{
return __usb_control_message(fd, (USB_CTRLTYPE_DIR_HOST2DEVICE | USB_CTRLTYPE_TYPE_STANDARD | USB_CTRLTYPE_REC_DEVICE), USB_REQ_SETCONFIG, configuration, 0, 0, NULL, NULL, NULL);
}
s32 USB_GetConfiguration(s32 fd, u8 *configuration)
{
u8 *_configuration;
s32 retval;
_configuration = iosAlloc(hId, 1);
if(_configuration == NULL)
return IPC_ENOMEM;
retval = __usb_control_message(fd, (USB_CTRLTYPE_DIR_DEVICE2HOST | USB_CTRLTYPE_TYPE_STANDARD | USB_CTRLTYPE_REC_DEVICE), USB_REQ_GETCONFIG, 0, 0, 1, _configuration, NULL, NULL);
if(retval >= 0)
*configuration = *_configuration;
iosFree(hId, _configuration);
return retval;
}
s32 USB_SetAlternativeInterface(s32 fd, u8 interface, u8 alternateSetting)
{
return __usb_control_message(fd, (USB_CTRLTYPE_DIR_HOST2DEVICE | USB_CTRLTYPE_TYPE_STANDARD | USB_CTRLTYPE_REC_INTERFACE), USB_REQ_SETINTERFACE, alternateSetting, interface, 0, NULL, NULL, NULL);
}
static s32 USBV5_CancelEndpoint(s32 device_id)
{
s32 ret;
s32 fd;
if (__find_device_on_host(ven_host, device_id)>=0)
fd = ven_host->fd;
else if (__find_device_on_host(hid_host, device_id)>=0)
fd = hid_host->fd;
else
return IPC_ENOENT;
s32 *buf = (s32*)iosAlloc(hId, 32);
if (buf==NULL) return IPC_ENOMEM;
buf[0] = device_id;
//Cancel all control messages
buf[2] = 0x00;
ret = IOS_Ioctl(fd, USBV5_IOCTL_CANCELENDPOINT, buf, 32, NULL, 0);
if(ret < 0)
goto ret;
//Cancel all incoming interrupts
buf[2] = 0x01 << 24;
ret = IOS_Ioctl(fd, USBV5_IOCTL_CANCELENDPOINT, buf, 32, NULL, 0);
if(ret < 0)
goto ret;
//Cancel all outgoing interrupts
buf[2] = 0x02 << 24;
ret = IOS_Ioctl(fd, USBV5_IOCTL_CANCELENDPOINT, buf, 32, NULL, 0);
if(ret < 0)
goto ret;
ret:
iosFree(hId, buf);
return ret;
}
s32 USB_ClearHalt(s32 fd, u8 endpoint)
{
if (fd>=0x20 || fd<-1)
return USBV5_CancelEndpoint(fd);
return __usb_control_message(fd, (USB_CTRLTYPE_DIR_HOST2DEVICE | USB_CTRLTYPE_TYPE_STANDARD | USB_CTRLTYPE_REC_ENDPOINT), USB_REQ_CLEARFEATURE, USB_FEATURE_ENDPOINT_HALT, endpoint, 0, NULL, NULL, NULL);
}
#endif /* defined(HW_RVL) */
|
the_stack_data/176706721.c | #include <stdio.h>
int main(){
int n,k,ts;
scanf("%d",&ts);
for(int i = 0;i<ts;i++){
scanf("%d %d", &n,&k);
if(k%3)
{
printf("%s\n",(n%3)?"Alice":"Bob");
}
else{
n = n%(k+1);
printf("%s\n",(n%3 || n==k)?"Alice":"Bob");
}
}
return 0;
}
|
the_stack_data/215767620.c | /* Exercise 1 - Calculations
Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */
#include <stdio.h>
int main()
{
int mark1, mark2;
float avg;
printf("Enter 1st subject marks= ");
scanf("%d", &mark1);
printf("Enter second subject marks= " );
scanf("%d", &mark2);
avg = (mark1 + mark2)/2.0;
printf("Average is = %.2f", avg);
return 0;
}
|
the_stack_data/198766.c |
//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1998.
//
// File: prxstub.c
//
// Contents: local marshalling code
//
// Classes:
//
// Notes: HICON marshals are not explosed through ole32.def
// so this file defines them locally and just turns
// around and call the HWND routines which are exposed
// and marshalled the same way HICON is internal in OLE.
//
// If Ole32 adds this to the .def on all platforms interested
// in remoting then this code is no longer necessary
//
//
// History: 11-Nov-98 rogerg Created.
//
//--------------------------------------------------------------------------
#ifdef _REMOTINTERFACES
#include "rpcproxy.h"
// local file to define unexported marshal interfaces
unsigned long __RPC_USER HICON_UserSize(
unsigned long * pFlags,
unsigned long Offset,
HICON * pH )
{
return HWND_UserSize(pFlags,Offset ,(HWND *) pH);
}
unsigned char __RPC_FAR * __RPC_USER HICON_UserMarshal(
unsigned long * pFlags,
unsigned char * pBuffer,
HICON * pH)
{
return HWND_UserMarshal( pFlags,pBuffer,(HWND *) pH);
}
unsigned char __RPC_FAR * __RPC_USER HICON_UserUnmarshal(
unsigned long * pFlags,
unsigned char * pBuffer,
HICON * pH)
{
return HWND_UserUnmarshal(pFlags
,pBuffer
, (HWND *) pH);
}
void __RPC_USER HICON_UserFree(
unsigned long * pFlags,
HICON * pH)
{
HWND_UserFree( pFlags,(HWND *) pH);
}
#endif // #ifdef _REMOTINTERFACES |
the_stack_data/110862.c | // 10001st prime
// website: https://projecteuler.net/problem=7
// By listing the first six prime numbers:
// 2, 3, 5, 7, 11, and 13,
// we can see that the 6th prime is 13.
// What is the Nth prime number?
// N = 10001 -> projecteuler.net
// ANSWER: 104743
// Constraints:
// 1 <= T <= 10^3
// 1 <= N <= 10^4
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int popCount(int n) {
n -= (n >> 1) & 0x55555555;
n = ((n >> 2) & 0x33333333) + (n & 0x33333333);
n = ((n >> 4) & 0x0F0F0F0F) + (n & 0x0F0F0F0F);
return (n * 0x01010101) >> 24;
}
int primeN(int n) {
if (n < 2) {
return 2;
}
if (n == 2) {
return 3;
}
if (n == 3) {
return 5;
}
int limit, root, count = 2;
limit = (int)(n * (log(n) + log(log(n)))) + 3;
root = (int)sqrt(limit);
switch(limit % 6) {
case 0:
limit = 2 * (limit / 6) - 1;
break;
case 5:
limit = 2 * (limit / 6) + 1;
break;
default:
limit = 2 * (limit / 6);
}
switch(root % 6) {
case 0:
root = 2 * (root / 6) - 1;
break;
case 5:
root = 2 * (root / 6) + 1;
break;
default:
root = 2 * (root / 6);
}
int dim = (limit + 31) >> 5;
int *sieve;
sieve = calloc(dim, sizeof(int));
for (int i = 0; i < root; i++) {
if ((sieve[i >> 5] & (1 << (i & 31))) == 0) {
int start, s1, s2;
if ((i & 1) == 1) {
start = i * (3 * i + 8) + 4;
s1 = 4 * i + 5;
s2 = 2 * i + 3;
}
else {
start = i * (3 * i + 10) + 7;
s1 = 2 * i + 3;
s2 = 4 * i + 7;
}
for (int j = start; j < limit; j += s2) {
sieve[j >> 5] |= 1 << (j & 31);
j += s1;
if (j >= limit) {
break;
}
sieve[j >> 5] |= 1 << (j & 31);
}
}
}
int i;
for (i = 0; count < n; i++) {
count += popCount(~sieve[i]);
}
--i;
int mask = ~sieve[i];
free(sieve);
int p;
for (p = 31; count >= n; --p) {
count -= (mask >> p) & 1;
}
return 3 * (p + (i << 5)) + 7 + (p & 1);
}
int main(int argc, char *argv[]) {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
int nPrime = primeN(n);
printf("%d\n", nPrime);
}
return 0;
} |
the_stack_data/100139566.c | #ifdef COMPILE_FOR_TEST
#include <assert.h>
#define assume(cond) assert(cond)
#endif
void main(int argc, char* argv[]) {
int x_0_0;//sh_buf.outcnt
int x_0_1;//sh_buf.outcnt
int x_0_2;//sh_buf.outcnt
int x_0_3;//sh_buf.outcnt
int x_0_4;//sh_buf.outcnt
int x_0_5;//sh_buf.outcnt
int x_1_0;//sh_buf.outbuf[0]
int x_1_1;//sh_buf.outbuf[0]
int x_2_0;//sh_buf.outbuf[1]
int x_2_1;//sh_buf.outbuf[1]
int x_3_0;//sh_buf.outbuf[2]
int x_3_1;//sh_buf.outbuf[2]
int x_4_0;//sh_buf.outbuf[3]
int x_4_1;//sh_buf.outbuf[3]
int x_5_0;//sh_buf.outbuf[4]
int x_5_1;//sh_buf.outbuf[4]
int x_6_0;//sh_buf.outbuf[5]
int x_7_0;//sh_buf.outbuf[6]
int x_8_0;//sh_buf.outbuf[7]
int x_9_0;//sh_buf.outbuf[8]
int x_10_0;//sh_buf.outbuf[9]
int x_11_0;//LOG_BUFSIZE
int x_11_1;//LOG_BUFSIZE
int x_12_0;//CREST_scheduler::lock_0
int x_12_1;//CREST_scheduler::lock_0
int x_12_2;//CREST_scheduler::lock_0
int x_12_3;//CREST_scheduler::lock_0
int x_12_4;//CREST_scheduler::lock_0
int x_13_0;//t3 T0
int x_14_0;//t2 T0
int x_15_0;//arg T0
int x_16_0;//functioncall::param T0
int x_16_1;//functioncall::param T0
int x_17_0;//buffered T0
int x_18_0;//functioncall::param T0
int x_18_1;//functioncall::param T0
int x_19_0;//functioncall::param T0
int x_19_1;//functioncall::param T0
int x_20_0;//functioncall::param T0
int x_20_1;//functioncall::param T0
int x_20_2;//functioncall::param T0
int x_20_3;//functioncall::param T0
int x_21_0;//functioncall::param T0
int x_21_1;//functioncall::param T0
int x_22_0;//direction T0
int x_23_0;//functioncall::param T0
int x_23_1;//functioncall::param T0
int x_24_0;//functioncall::param T0
int x_24_1;//functioncall::param T0
int x_25_0;//functioncall::param T0
int x_25_1;//functioncall::param T0
int x_26_0;//functioncall::param T0
int x_26_1;//functioncall::param T0
int x_27_0;//functioncall::param T0
int x_27_1;//functioncall::param T0
int x_28_0;//functioncall::param T0
int x_28_1;//functioncall::param T0
int x_29_0;//functioncall::param T0
int x_29_1;//functioncall::param T0
int x_30_0;//functioncall::param T0
int x_30_1;//functioncall::param T0
int x_31_0;//functioncall::param T0
int x_31_1;//functioncall::param T0
int x_32_0;//functioncall::param T0
int x_32_1;//functioncall::param T0
int x_33_0;//functioncall::param T0
int x_33_1;//functioncall::param T0
int x_34_0;//functioncall::param T0
int x_34_1;//functioncall::param T0
int x_35_0;//functioncall::param T1
int x_35_1;//functioncall::param T1
int x_36_0;//functioncall::param T1
int x_36_1;//functioncall::param T1
int x_37_0;//i T1
int x_37_1;//i T1
int x_37_2;//i T1
int x_38_0;//rv T1
int x_39_0;//rv T1
int x_40_0;//blocksize T1
int x_40_1;//blocksize T1
int x_41_0;//functioncall::param T1
int x_41_1;//functioncall::param T1
int x_41_2;//functioncall::param T1
int x_42_0;//apr_thread_mutex_lock::rv T1
int x_42_1;//apr_thread_mutex_lock::rv T1
int x_43_0;//functioncall::param T1
int x_43_1;//functioncall::param T1
int x_44_0;//status T1
int x_44_1;//status T1
int x_45_0;//functioncall::param T1
int x_45_1;//functioncall::param T1
int x_46_0;//functioncall::param T1
int x_46_1;//functioncall::param T1
int x_47_0;//functioncall::param T1
int x_47_1;//functioncall::param T1
int x_48_0;//functioncall::param T1
int x_48_1;//functioncall::param T1
int x_49_0;//functioncall::param T1
int x_49_1;//functioncall::param T1
int x_50_0;//functioncall::param T1
int x_50_1;//functioncall::param T1
int x_51_0;//functioncall::param T1
int x_51_1;//functioncall::param T1
int x_52_0;//functioncall::param T1
int x_52_1;//functioncall::param T1
int x_53_0;//functioncall::param T2
int x_53_1;//functioncall::param T2
int x_54_0;//functioncall::param T2
int x_54_1;//functioncall::param T2
int x_55_0;//i T2
int x_55_1;//i T2
int x_55_2;//i T2
int x_55_3;//i T2
int x_56_0;//rv T2
int x_57_0;//rv T2
int x_58_0;//blocksize T2
int x_58_1;//blocksize T2
int x_59_0;//functioncall::param T2
int x_59_1;//functioncall::param T2
int x_59_2;//functioncall::param T2
int x_60_0;//apr_thread_mutex_lock::rv T2
int x_60_1;//apr_thread_mutex_lock::rv T2
int x_61_0;//functioncall::param T2
int x_61_1;//functioncall::param T2
int x_62_0;//status T2
int x_62_1;//status T2
int x_63_0;//functioncall::param T2
int x_63_1;//functioncall::param T2
int x_64_0;//functioncall::param T2
int x_64_1;//functioncall::param T2
int x_65_0;//functioncall::param T2
int x_65_1;//functioncall::param T2
int x_66_0;//functioncall::param T2
int x_66_1;//functioncall::param T2
int x_67_0;//functioncall::param T2
int x_67_1;//functioncall::param T2
int x_67_2;//functioncall::param T2
int x_68_0;//functioncall::param T2
int x_68_1;//functioncall::param T2
T_0_0_0: x_0_0 = 0;
T_0_1_0: x_1_0 = 0;
T_0_2_0: x_2_0 = 0;
T_0_3_0: x_3_0 = 0;
T_0_4_0: x_4_0 = 0;
T_0_5_0: x_5_0 = 0;
T_0_6_0: x_6_0 = 0;
T_0_7_0: x_7_0 = 0;
T_0_8_0: x_8_0 = 0;
T_0_9_0: x_9_0 = 0;
T_0_10_0: x_10_0 = 0;
T_0_11_0: x_11_0 = 0;
T_0_12_0: x_13_0 = 1211782256;
T_0_13_0: x_14_0 = 3438309984;
T_0_14_0: x_15_0 = 0;
T_0_15_0: x_16_0 = 2089175586;
T_0_16_0: x_16_1 = -1;
T_0_17_0: x_17_0 = 0;
T_0_18_0: x_18_0 = 1972515004;
T_0_19_0: x_18_1 = x_17_0;
T_0_20_0: x_19_0 = 426991522;
T_0_21_0: x_19_1 = 97;
T_0_22_0: x_20_0 = 1885488095;
T_0_23_0: x_20_1 = 0;
T_0_24_0: x_21_0 = 2128937802;
T_0_25_0: x_21_1 = 0;
T_0_26_0: x_22_0 = -856661952;
T_0_27_0: x_23_0 = 1312013128;
T_0_28_0: x_23_1 = x_22_0;
T_0_29_0: x_24_0 = 411759577;
T_0_30_0: x_24_1 = 0;
T_0_31_0: x_12_0 = -1;
T_0_32_0: x_0_1 = 5;
T_0_33_0: x_1_1 = 72;
T_0_34_0: x_2_1 = 69;
T_0_35_0: x_3_1 = 76;
T_0_36_0: x_4_1 = 76;
T_0_37_0: x_5_1 = 79;
T_0_38_0: x_25_0 = 21375469;
T_0_39_0: x_25_1 = 83;
T_0_40_0: x_26_0 = 402405704;
T_0_41_0: x_26_1 = 1;
T_0_42_0: x_27_0 = 76535618;
T_0_43_0: x_27_1 = 1;
T_0_44_0: x_28_0 = 1853661595;
T_0_45_0: x_28_1 = 1;
T_0_46_0: x_29_0 = 1514230570;
T_0_47_0: x_29_1 = 82;
T_0_48_0: x_30_0 = 806482192;
T_0_49_0: x_30_1 = 90;
T_0_50_0: x_31_0 = 378723233;
T_0_51_0: x_31_1 = 1;
T_0_52_0: x_32_0 = 303102337;
T_0_53_0: x_32_1 = 1;
T_0_54_0: x_33_0 = 896180094;
T_0_55_0: x_33_1 = 2;
T_0_56_0: x_34_0 = 945695845;
T_0_57_0: x_34_1 = 2;
T_0_58_0: x_11_1 = 5;
T_2_59_2: x_53_0 = 889353453;
T_2_60_2: x_53_1 = x_33_1;
T_2_61_2: x_54_0 = 2028248112;
T_2_62_2: x_54_1 = x_34_1;
T_2_63_2: x_55_0 = 0;
T_2_64_2: x_56_0 = 805999105;
T_1_65_1: x_35_0 = 955475452;
T_1_66_1: x_35_1 = x_27_1;
T_1_67_1: x_36_0 = 376995144;
T_1_68_1: x_36_1 = x_28_1;
T_1_69_1: x_37_0 = 0;
T_1_70_1: x_38_0 = 808100353;
T_2_71_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_57_0 = -849594448;
T_2_72_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_58_0 = 11068;
T_2_73_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_59_0 = 249058483;
T_2_74_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_59_1 = x_0_1;
T_2_75_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_59_1) x_60_0 = 0;
T_1_76_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_39_0 = -849594448;
T_1_77_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_40_0 = 11068;
T_1_78_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_59_1 && 0 == x_12_0 + 1) x_12_1 = 2;
T_1_79_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_59_1 && 2 == x_12_1) x_60_1 = 0;
T_2_80_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 2 == x_12_1) x_61_0 = 2097080584;
T_2_81_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 2 == x_12_1) x_61_1 = 0;
T_2_82_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_61_1 && 2 == x_12_1) x_58_1 = x_59_1;
T_2_83_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_61_1 && 2 == x_12_1) x_20_2 = x_20_1 + x_58_1;
T_2_84_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_61_1 && 2 == x_12_1) x_59_2 = -1*x_58_1 + x_59_1;
T_2_85_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_59_2 <= 0 && 2 == x_12_1) x_62_0 = 0;
T_2_86_2: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_59_2 <= 0 && 2 == x_12_1) x_12_2 = -1;
T_2_87_2: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_41_0 = 284597821;
T_2_88_2: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0) x_41_1 = x_0_1;
T_2_89_2: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_41_1) x_42_0 = 0;
T_2_90_2: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_41_1 && 0 == x_12_2 + 1) x_12_3 = 1;
T_1_91_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_0_1 == x_41_1 && 1 == x_12_3) x_42_1 = 0;
T_1_92_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 1 == x_12_3) x_43_0 = 1209932369;
T_1_93_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 1 == x_12_3) x_43_1 = 0;
T_1_94_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_43_1 && 1 == x_12_3) x_40_1 = x_41_1;
T_1_95_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_43_1 && 1 == x_12_3) x_20_3 = x_20_2 + x_40_1;
T_1_96_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && 0 == x_43_1 && 1 == x_12_3) x_41_2 = -1*x_40_1 + x_41_1;
T_1_97_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_41_2 <= 0 && 1 == x_12_3) x_44_0 = 0;
T_1_98_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_41_2 <= 0 && 1 == x_12_3) x_12_4 = -1;
T_1_99_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_41_2 <= 0) x_44_1 = 0;
T_1_100_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_45_0 = 605830283;
T_1_101_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_45_1 = x_43_1;
T_1_102_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_46_0 = 1868022588;
T_1_103_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_46_1 = x_45_1;
T_1_104_1: if (x_0_1 + x_36_1 > x_11_1 && x_0_1 != 0) x_0_2 = 0;
T_1_105_1: if (x_36_1 < x_11_1) x_47_0 = 1923464945;
T_1_106_1: if (x_36_1 < x_11_1) x_47_1 = 47540184901376;
T_1_107_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0 && x_18_1 != 0 && x_59_2 <= 0) x_62_1 = 0;
T_1_108_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_63_0 = 1684642092;
T_1_109_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_63_1 = x_61_1;
T_1_110_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_64_0 = 367089181;
T_1_111_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_64_1 = x_63_1;
T_1_112_1: if (x_0_1 + x_54_1 > x_11_1 && x_0_1 != 0) x_0_3 = 0;
T_2_113_2: if (x_36_1 < x_11_1) x_48_0 = 223694704;
T_2_114_2: if (x_36_1 < x_11_1) x_48_1 = x_0_2 + x_36_1;
T_2_115_2: if (x_36_1 < x_11_1) x_37_1 = 0;
T_2_116_2: if (x_36_1 < x_11_1 && x_37_1 < x_35_1) x_49_0 = 1626334030;
T_2_117_2: if (x_36_1 < x_11_1 && x_37_1 < x_35_1) x_49_1 = 47540184901376;
T_1_118_1: if (x_36_1 < x_11_1) x_37_2 = 1 + x_37_1;
T_1_119_1: if (x_36_1 < x_11_1) x_50_0 = 192120537;
T_1_120_1: if (x_36_1 < x_11_1) x_50_1 = 47540184901376;
T_1_121_1: if (x_54_1 < x_11_1) x_65_0 = 650686226;
T_1_122_1: if (x_54_1 < x_11_1) x_65_1 = 47540187002624;
T_1_123_1: if (x_54_1 < x_11_1) x_66_0 = 1364338477;
T_1_124_1: if (x_54_1 < x_11_1) x_66_1 = x_0_3 + x_54_1;
T_1_125_1: if (x_54_1 < x_11_1) x_55_1 = 0;
T_2_126_2: if (x_54_1 < x_11_1 && x_55_1 < x_53_1) x_67_0 = 173574691;
T_2_127_2: if (x_54_1 < x_11_1 && x_55_1 < x_53_1) x_67_1 = 47540187002624;
T_2_128_2: if (x_54_1 < x_11_1) x_55_2 = 1 + x_55_1;
T_2_129_2: if (x_54_1 < x_11_1 && x_55_2 < x_53_1) x_67_2 = 47540187002624;
T_2_130_2: if (x_54_1 < x_11_1) x_55_3 = 1 + x_55_2;
T_2_131_2: if (x_54_1 < x_11_1) x_68_0 = 1962699354;
T_2_132_2: if (x_54_1 < x_11_1) x_68_1 = 47540187002624;
T_2_133_2: if (x_36_1 < x_11_1) x_0_4 = x_0_3 + x_36_1;
T_2_134_2: if (x_36_1 < x_11_1) x_51_0 = 1776098054;
T_2_135_2: if (x_36_1 < x_11_1) x_51_1 = 47540184901376;
T_2_136_2: if (x_54_1 < x_11_1) x_0_5 = x_0_3 + x_54_1;
T_2_137_2: if (x_36_1 < x_11_1) x_52_0 = 194950160;
T_2_138_2: if (x_36_1 < x_11_1) x_52_1 = 47540184901376;
T_1_139_1: if (x_36_1 < x_11_1) assert(x_0_5 == x_48_1);
}
|
the_stack_data/103264806.c | #include <stdio.h>
#include <ctype.h>
#define SIZE 100
int main(int argc, char* argv[])
{
char* choice = "-p";
if (argc > 1)
choice = argv[1];
char str[SIZE];
FILE *fp = fopen("words.txt", "r");
while (fgets(str, SIZE, fp) != NULL)
{
if (strcmp(choice, "-u") == 0)
{
char* ptr = str;
while (*ptr != EOF)
{
*ptr = toupper(*ptr);
ptr++;
}
}
if (strcmp(choice, "-l") == 0)
{
char* ptr = str;
while (*ptr != EOF)
{
*ptr = tolower(*ptr);
ptr++;
}
}
fputs(str, stdout);
}
fclose(fp);
return 0;
} |
the_stack_data/71419.c | /* PR c/27747 */
/* This is supposed to succeed only if
the target defines HANDLE_PRAGMA_PACK_PUSH_POP
and doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION. */
/* { dg-do compile { target { ! { *-*-solaris2* sh*-[us]*-elf } } } } */
#define push bar
#define foo _Pragma ("pack(push)")
foo
int i;
#pragma pack(pop)
|
the_stack_data/965101.c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXLINE 1000
void itoa(int n, char s[]);
void reverse(char s[]);
int main()
{
char s[MAXLINE];
int n = 0x80000000;
itoa(n, s);
printf("%s\n", s);
return 0;
}
/*
itoa: convert n to characters in s
'%' behavior with negative numbers are implementation defined in C89,
as stated previously in this book.
However with C99, it is clearly spelled that '%' is the remainder of
division truncating to zero, i.e. -6 / 10 = 0, and -6 % 10 = -6.
We hereby use C99 defined '%' operator.
*/
void itoa(int n, char s[])
{
int i, sign;
i = 0;
sign = n;
do {
s[i++] = abs(n % 10) + '0';
} while ((n /= 10) != 0);
if (sign < 0)
s[i++] = '-';
s[i] = '\0';
reverse(s);
}
void reverse(char s[])
{
int i, j;
for (i = 0, j = strlen(s) - 1; i < j; ++i, --j) {
char tmp = s[i];
s[i] = s[j];
s[j] = tmp;
}
}
|
the_stack_data/11074043.c | // INFO: task hung in sync_inodes_sb
// https://syzkaller.appspot.com/bug?id=ba079f8c3d13aff381ce
// status:0
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <linux/futex.h>
#include <linux/loop.h>
static unsigned long long procid;
static void sleep_ms(uint64_t ms)
{
usleep(ms * 1000);
}
static uint64_t current_time_ms(void)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts))
exit(1);
return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
}
static void use_temporary_dir(void)
{
char tmpdir_template[] = "./syzkaller.XXXXXX";
char* tmpdir = mkdtemp(tmpdir_template);
if (!tmpdir)
exit(1);
if (chmod(tmpdir, 0777))
exit(1);
if (chdir(tmpdir))
exit(1);
}
static void thread_start(void* (*fn)(void*), void* arg)
{
pthread_t th;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 128 << 10);
int i = 0;
for (; i < 100; i++) {
if (pthread_create(&th, &attr, fn, arg) == 0) {
pthread_attr_destroy(&attr);
return;
}
if (errno == EAGAIN) {
usleep(50);
continue;
}
break;
}
exit(1);
}
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (ev->state)
exit(1);
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
static int event_isset(event_t* ev)
{
return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE);
}
static int event_timedwait(event_t* ev, uint64_t timeout)
{
uint64_t start = current_time_ms();
uint64_t now = start;
for (;;) {
uint64_t remain = timeout - (now - start);
struct timespec ts;
ts.tv_sec = remain / 1000;
ts.tv_nsec = (remain % 1000) * 1000 * 1000;
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts);
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
return 1;
now = current_time_ms();
if (now - start > timeout)
return 0;
}
}
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
struct fs_image_segment {
void* data;
uintptr_t size;
uintptr_t offset;
};
#define IMAGE_MAX_SEGMENTS 4096
#define IMAGE_MAX_SIZE (129 << 20)
#define sys_memfd_create 319
static unsigned long fs_image_segment_check(unsigned long size,
unsigned long nsegs,
struct fs_image_segment* segs)
{
if (nsegs > IMAGE_MAX_SEGMENTS)
nsegs = IMAGE_MAX_SEGMENTS;
for (size_t i = 0; i < nsegs; i++) {
if (segs[i].size > IMAGE_MAX_SIZE)
segs[i].size = IMAGE_MAX_SIZE;
segs[i].offset %= IMAGE_MAX_SIZE;
if (segs[i].offset > IMAGE_MAX_SIZE - segs[i].size)
segs[i].offset = IMAGE_MAX_SIZE - segs[i].size;
if (size < segs[i].offset + segs[i].offset)
size = segs[i].offset + segs[i].offset;
}
if (size > IMAGE_MAX_SIZE)
size = IMAGE_MAX_SIZE;
return size;
}
static int setup_loop_device(long unsigned size, long unsigned nsegs,
struct fs_image_segment* segs,
const char* loopname, int* memfd_p, int* loopfd_p)
{
int err = 0, loopfd = -1;
size = fs_image_segment_check(size, nsegs, segs);
int memfd = syscall(sys_memfd_create, "syzkaller", 0);
if (memfd == -1) {
err = errno;
goto error;
}
if (ftruncate(memfd, size)) {
err = errno;
goto error_close_memfd;
}
for (size_t i = 0; i < nsegs; i++) {
if (pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset) < 0) {
}
}
loopfd = open(loopname, O_RDWR);
if (loopfd == -1) {
err = errno;
goto error_close_memfd;
}
if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
if (errno != EBUSY) {
err = errno;
goto error_close_loop;
}
ioctl(loopfd, LOOP_CLR_FD, 0);
usleep(1000);
if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
err = errno;
goto error_close_loop;
}
}
*memfd_p = memfd;
*loopfd_p = loopfd;
return 0;
error_close_loop:
close(loopfd);
error_close_memfd:
close(memfd);
error:
errno = err;
return -1;
}
static long syz_mount_image(volatile long fsarg, volatile long dir,
volatile unsigned long size,
volatile unsigned long nsegs,
volatile long segments, volatile long flags,
volatile long optsarg)
{
struct fs_image_segment* segs = (struct fs_image_segment*)segments;
int res = -1, err = 0, loopfd = -1, memfd = -1, need_loop_device = !!segs;
char* mount_opts = (char*)optsarg;
char* target = (char*)dir;
char* fs = (char*)fsarg;
char* source = NULL;
char loopname[64];
if (need_loop_device) {
memset(loopname, 0, sizeof(loopname));
snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
if (setup_loop_device(size, nsegs, segs, loopname, &memfd, &loopfd) == -1)
return -1;
source = loopname;
}
mkdir(target, 0777);
char opts[256];
memset(opts, 0, sizeof(opts));
if (strlen(mount_opts) > (sizeof(opts) - 32)) {
}
strncpy(opts, mount_opts, sizeof(opts) - 32);
if (strcmp(fs, "iso9660") == 0) {
flags |= MS_RDONLY;
} else if (strncmp(fs, "ext", 3) == 0) {
if (strstr(opts, "errors=panic") || strstr(opts, "errors=remount-ro") == 0)
strcat(opts, ",errors=continue");
} else if (strcmp(fs, "xfs") == 0) {
strcat(opts, ",nouuid");
}
res = mount(source, target, fs, flags, opts);
if (res == -1) {
err = errno;
goto error_clear_loop;
}
res = open(target, O_RDONLY | O_DIRECTORY);
if (res == -1) {
err = errno;
}
error_clear_loop:
if (need_loop_device) {
ioctl(loopfd, LOOP_CLR_FD, 0);
close(loopfd);
close(memfd);
}
errno = err;
return res;
}
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
static void remove_dir(const char* dir)
{
int iter = 0;
DIR* dp = 0;
retry:
while (umount2(dir, MNT_DETACH) == 0) {
}
dp = opendir(dir);
if (dp == NULL) {
if (errno == EMFILE) {
exit(1);
}
exit(1);
}
struct dirent* ep = 0;
while ((ep = readdir(dp))) {
if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0)
continue;
char filename[FILENAME_MAX];
snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name);
while (umount2(filename, MNT_DETACH) == 0) {
}
struct stat st;
if (lstat(filename, &st))
exit(1);
if (S_ISDIR(st.st_mode)) {
remove_dir(filename);
continue;
}
int i;
for (i = 0;; i++) {
if (unlink(filename) == 0)
break;
if (errno == EPERM) {
int fd = open(filename, O_RDONLY);
if (fd != -1) {
long flags = 0;
if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
}
close(fd);
continue;
}
}
if (errno == EROFS) {
break;
}
if (errno != EBUSY || i > 100)
exit(1);
if (umount2(filename, MNT_DETACH))
exit(1);
}
}
closedir(dp);
for (int i = 0;; i++) {
if (rmdir(dir) == 0)
break;
if (i < 100) {
if (errno == EPERM) {
int fd = open(dir, O_RDONLY);
if (fd != -1) {
long flags = 0;
if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
}
close(fd);
continue;
}
}
if (errno == EROFS) {
break;
}
if (errno == EBUSY) {
if (umount2(dir, MNT_DETACH))
exit(1);
continue;
}
if (errno == ENOTEMPTY) {
if (iter < 100) {
iter++;
goto retry;
}
}
}
exit(1);
}
}
static void kill_and_wait(int pid, int* status)
{
kill(-pid, SIGKILL);
kill(pid, SIGKILL);
for (int i = 0; i < 100; i++) {
if (waitpid(-1, status, WNOHANG | __WALL) == pid)
return;
usleep(1000);
}
DIR* dir = opendir("/sys/fs/fuse/connections");
if (dir) {
for (;;) {
struct dirent* ent = readdir(dir);
if (!ent)
break;
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
continue;
char abort[300];
snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
ent->d_name);
int fd = open(abort, O_WRONLY);
if (fd == -1) {
continue;
}
if (write(fd, abort, 1) < 0) {
}
close(fd);
}
closedir(dir);
} else {
}
while (waitpid(-1, status, __WALL) != pid) {
}
}
static void reset_loop()
{
char buf[64];
snprintf(buf, sizeof(buf), "/dev/loop%llu", procid);
int loopfd = open(buf, O_RDWR);
if (loopfd != -1) {
ioctl(loopfd, LOOP_CLR_FD, 0);
close(loopfd);
}
}
static void setup_test()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
write_file("/proc/self/oom_score_adj", "1000");
}
struct thread_t {
int created, call;
event_t ready, done;
};
static struct thread_t threads[16];
static void execute_call(int call);
static int running;
static void* thr(void* arg)
{
struct thread_t* th = (struct thread_t*)arg;
for (;;) {
event_wait(&th->ready);
event_reset(&th->ready);
execute_call(th->call);
__atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED);
event_set(&th->done);
}
return 0;
}
static void execute_one(void)
{
int i, call, thread;
int collide = 0;
again:
for (call = 0; call < 2; call++) {
for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0]));
thread++) {
struct thread_t* th = &threads[thread];
if (!th->created) {
th->created = 1;
event_init(&th->ready);
event_init(&th->done);
event_set(&th->done);
thread_start(thr, th);
}
if (!event_isset(&th->done))
continue;
event_reset(&th->done);
th->call = call;
__atomic_fetch_add(&running, 1, __ATOMIC_RELAXED);
event_set(&th->ready);
if (collide && (call % 2) == 0)
break;
event_timedwait(&th->done, 45 + (call == 1 ? 50 : 0));
break;
}
}
for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++)
sleep_ms(1);
if (!collide) {
collide = 1;
goto again;
}
}
static void execute_one(void);
#define WAIT_FLAGS __WALL
static void loop(void)
{
int iter = 0;
for (;; iter++) {
char cwdbuf[32];
sprintf(cwdbuf, "./%d", iter);
if (mkdir(cwdbuf, 0777))
exit(1);
reset_loop();
int pid = fork();
if (pid < 0)
exit(1);
if (pid == 0) {
if (chdir(cwdbuf))
exit(1);
setup_test();
execute_one();
exit(0);
}
int status = 0;
uint64_t start = current_time_ms();
for (;;) {
if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
break;
sleep_ms(1);
if (current_time_ms() - start < 5 * 1000)
continue;
kill_and_wait(pid, &status);
break;
}
remove_dir(cwdbuf);
}
}
void execute_call(int call)
{
switch (call) {
case 0:
memcpy((void*)0x20000440, "./file0/file0\000", 14);
syscall(__NR_openat, 0xffffffffffffff9cul, 0x20000440ul, 0x1015c2ul, 0ul);
break;
case 1:
memcpy((void*)0x20000000, "nilfs2\000", 7);
memcpy((void*)0x20000100, "./file0\000", 8);
*(uint64_t*)0x20000200 = 0x20010000;
memcpy((void*)0x20010000,
"\x02\x00\x00\x00\x00\x00\x34\x34\x18\x01\x00\x00\x7a\x4a\x79\x34"
"\x40\xd1\x97\xc3\x01\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x10\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00"
"\x10\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xe0\x01\x00\x00\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x57\x1b\x67\x5f\x00\x00\x00\x00\x57\x1b\x67\x5f\x00\x00\x00\x00"
"\x01\x00\x32\x00\x00\x00\x01\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x00\x4e\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00"
"\x80\x00\x20\x00\xc0\x00\x10\x00\xe2\x82\x53\x61\x8b\x3b\x42\x84"
"\x9b\x95\x43\xa5\x40\x24\x81\x3a",
168);
*(uint64_t*)0x20000208 = 0xa8;
*(uint64_t*)0x20000210 = 0x400;
*(uint64_t*)0x20000218 = 0x20010100;
memcpy((void*)0x20010100, "\x00\x00\x00\x00\x00\x00\x00\x00\x01", 9);
*(uint64_t*)0x20000220 = 9;
*(uint64_t*)0x20000228 = 0x500;
*(uint64_t*)0x20000230 = 0x20010200;
memcpy((void*)0x20010200,
"\x17\x40\xcc\x43\x33\xe8\xf0\x5b\x11\xfa\xaf\x1e\x40\x00\x07\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x10\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x05\x00\x00\x00"
"\x30\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00"
"\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00"
"\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x02",
297);
*(uint64_t*)0x20000238 = 0x129;
*(uint64_t*)0x20000240 = 0x1000;
*(uint64_t*)0x20000248 = 0x20010400;
memcpy((void*)0x20010400, "\x02\x00\x00\x00\x00\x00\x00\x00\x10\x00\x01\x02"
"\x2e\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00"
"\x10\x00\x02\x02\x2e\x2e\x00\x00\x0b\x00\x00\x00"
"\x00\x00\x00\x00\xe0\x07\x06\x01\x2e\x6e\x69\x6c"
"\x66\x73",
50);
*(uint64_t*)0x20000250 = 0x32;
*(uint64_t*)0x20000258 = 0x1800;
*(uint64_t*)0x20000260 = 0x20010500;
memcpy(
(void*)0x20010500,
"\xf4\x3f\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\xff\x0f",
2050);
*(uint64_t*)0x20000268 = 0x802;
*(uint64_t*)0x20000270 = 0x2000;
*(uint64_t*)0x20000278 = 0x20010e00;
memcpy((void*)0x20010e00, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01",
51);
*(uint64_t*)0x20000280 = 0x33;
*(uint64_t*)0x20000288 = 0x3080;
*(uint64_t*)0x20000290 = 0x20010f00;
memcpy((void*)0x20010f00, "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xed\x41\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x01",
65);
*(uint64_t*)0x20000298 = 0x41;
*(uint64_t*)0x200002a0 = 0x3100;
*(uint64_t*)0x200002a8 = 0x20011000;
memcpy((void*)0x20011000, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01",
51);
*(uint64_t*)0x200002b0 = 0x33;
*(uint64_t*)0x200002b8 = 0x3380;
*(uint64_t*)0x200002c0 = 0x20011100;
memcpy((void*)0x20011100, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01",
51);
*(uint64_t*)0x200002c8 = 0x33;
*(uint64_t*)0x200002d0 = 0x3400;
*(uint64_t*)0x200002d8 = 0x20011200;
memcpy((void*)0x20011200, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01",
51);
*(uint64_t*)0x200002e0 = 0x33;
*(uint64_t*)0x200002e8 = 0x3480;
*(uint64_t*)0x200002f0 = 0x20011300;
memcpy((void*)0x20011300, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01",
51);
*(uint64_t*)0x200002f8 = 0x33;
*(uint64_t*)0x20000300 = 0x3500;
*(uint64_t*)0x20000308 = 0x20011400;
memcpy((void*)0x20011400, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xa4\x81\x01",
51);
*(uint64_t*)0x20000310 = 0x33;
*(uint64_t*)0x20000318 = 0x3580;
*(uint64_t*)0x20000320 = 0x20011500;
memcpy((void*)0x20011500, "\x01", 1);
*(uint64_t*)0x20000328 = 1;
*(uint64_t*)0x20000330 = 0x3800;
*(uint64_t*)0x20000338 = 0x20011600;
memcpy((void*)0x20011600,
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00"
"\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x80\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00"
"\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x02",
217);
*(uint64_t*)0x20000340 = 0xd9;
*(uint64_t*)0x20000348 = 0x38c0;
*(uint64_t*)0x20000350 = 0x20011700;
memcpy((void*)0x20011700, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x03",
25);
*(uint64_t*)0x20000358 = 0x19;
*(uint64_t*)0x20000360 = 0x3a40;
*(uint64_t*)0x20000368 = 0x20011800;
memcpy((void*)0x20011800, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x04",
25);
*(uint64_t*)0x20000370 = 0x19;
*(uint64_t*)0x20000378 = 0x3b00;
*(uint64_t*)0x20000380 = 0x20011900;
memcpy((void*)0x20011900, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x05",
25);
*(uint64_t*)0x20000388 = 0x19;
*(uint64_t*)0x20000390 = 0x3bc0;
*(uint64_t*)0x20000398 = 0x20011a00;
memcpy((void*)0x20011a00, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x06",
25);
*(uint64_t*)0x200003a0 = 0x19;
*(uint64_t*)0x200003a8 = 0x3c80;
*(uint64_t*)0x200003b0 = 0x20011b00;
memcpy((void*)0x20011b00, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x07",
25);
*(uint64_t*)0x200003b8 = 0x19;
*(uint64_t*)0x200003c0 = 0x3d40;
*(uint64_t*)0x200003c8 = 0x20011c00;
memcpy((void*)0x20011c00, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x08",
25);
*(uint64_t*)0x200003d0 = 0x19;
*(uint64_t*)0x200003d8 = 0x3e00;
*(uint64_t*)0x200003e0 = 0x20011d00;
memcpy((void*)0x20011d00, "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x09",
25);
*(uint64_t*)0x200003e8 = 0x19;
*(uint64_t*)0x200003f0 = 0x3ec0;
*(uint64_t*)0x200003f8 = 0x20011e00;
memcpy((void*)0x20011e00,
"\x1d\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00"
"\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x56\x1b\x67\x5f\x00\x00\x00\x00\x0b\x00\x00\x00\x03\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03",
61);
*(uint64_t*)0x20000400 = 0x3d;
*(uint64_t*)0x20000408 = 0x4000;
*(uint64_t*)0x20000410 = 0x20011f00;
memcpy(
(void*)0x20011f00,
"\xf9\x3f\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
"\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40"
"\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00"
"\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00"
"\x00\x40\x00\x00\x00\x40\x00\x00\x7f",
2049);
*(uint64_t*)0x20000418 = 0x801;
*(uint64_t*)0x20000420 = 0x4800;
*(uint64_t*)0x20000428 = 0x20012800;
memcpy((void*)0x20012800,
"\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
"\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
"\x05\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
"\x06\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
"\x07\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
"\x08\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\xff\xff\xff\xff\xff\xff\xff\xff",
184);
*(uint64_t*)0x20000430 = 0xb8;
*(uint64_t*)0x20000438 = 0x5820;
*(uint64_t*)0x20000440 = 0x20012900;
memcpy(
(void*)0x20012900,
"\xd3\x48\xc2\x39\x90\x01\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00\x03"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x56\x1b"
"\x67\x5f\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00"
"\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00\x56\x1b"
"\x67\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x56"
"\x1b\x67\x5f\x00\x00\x00\x00\x56\x1b\x67\x5f\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06",
337);
*(uint64_t*)0x20000448 = 0x151;
*(uint64_t*)0x20000450 = 0x6000;
syz_mount_image(0x20000000, 0x20000100, 0, 0x19, 0x20000200, 0, 0x20017900);
break;
}
}
int main(void)
{
syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
use_temporary_dir();
loop();
return 0;
}
|
the_stack_data/745081.c | #include <stdio.h>
int main()
{
int x=10;
for(int i=0;i<5;i-=1){
int x=9;
printf(x);}
return 0;
}
|
the_stack_data/50138626.c | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
double p(double x)
{
return exp(-x*x/2)+exp(-(x-8)*(x-8)/8);
}
double getrnd()
{
static double x=10;
double step = 1.0;
double xp = x + step*2*(drand48()-0.5); // this is T0
double r = drand48();
if(p(xp)/p(x) > r) x = xp;
return x;
}
int main(int argc, char** argv)
{
int N = atoi(argv[1]);
for(int i=0; i<N; ++i) printf("%e\n", getrnd());
return 0;
}
|
the_stack_data/522595.c | // Test if PGO instrumentation and use pass are invoked.
//
// Ensure Pass PGOInstrumentationGenPass is invoked.
// RUN: %clang_cc1 -O2 -fprofile-instrument=llvm %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN: PGOInstrumentationGenPass
//
// Ensure Pass PGOInstrumentationGenPass is not invoked.
// RUN: %clang_cc1 -O2 -fprofile-instrument=clang %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NOT: PGOInstrumentationGenPass
// Ensure Pass PGOInstrumentationUsePass is invoked.
// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestir.profraw
// RUN: %clang_cc1 -O2 -fprofile-instrument-use-path=%t.profdata %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-INSTR-USE
// CHECK-PGOUSEPASS-INVOKED-INSTR-USE: PGOInstrumentationUsePass
//
// Ensure Pass PGOInstrumentationUsePass is not invoked.
// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestclang.profraw
// RUN: %clang_cc1 -O2 -fprofile-instrument-use-path=%t.profdata %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-USE-CLANG
// CHECK-PGOUSEPASS-INVOKED-USE-CLANG-NOT: PGOInstrumentationUsePass
|
the_stack_data/783109.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
int getargs(char *cmd, char *argv[]);
int main () {
char buf[256];
char *argv[50];
int narg;
pid_t pid;
while (1) {
printf("shell>");
fgets(buf, 256, stdin);
narg = getargs(buf, argv);
pid = fork();
if (strncmp (buf, "exit", 4) == 0) {
exit(0);
}
if (pid == 0) {
execvp(argv[0], argv);
perror("Error:");
exit(0);
}
else if (pid>0) {
if (narg>=0)
wait(NULL);
continue;
}
else {
perror("fork failed");
}
}
return 1;
}
int getargs(char * cmd, char *argv[]) {
int i = 0;
char c;
char * token;
int len=strlen(cmd);
for(i=0; i<len; i++) {
if (cmd[i]=='\n')
cmd[i]=' ';
}
argv[0]=token=strtok(cmd, " ");
argv[1]=NULL;
i=1;
while (token!=NULL) {
token=strtok(NULL, " ");
if (token!=NULL && strcmp(token,"&")==0) {
argv[i] = NULL;
return i*(-1);
}
argv[i]=token;
i++;
}
return i;
}
|
the_stack_data/104828547.c | #include <stdio.h>
int
main(void)
{
printf("%s:%d\n", __FILE__, __LINE__);
return (0);
}
|
the_stack_data/142477.c | /*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* %sccs.include.redist.c%
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)difftime.c 8.1 (Berkeley) 06/04/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
double
difftime(time1, time0)
time_t time1, time0;
{
return(time1 - time0);
}
|
the_stack_data/54681883.c | #include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
/* Obtain a backtrace and print it to @code{stdout}. */
void
print_trace (void)
{
void *array[10];
size_t size;
char **strings;
size_t i;
size = backtrace (array, 10);
strings = backtrace_symbols (array, size);
printf ("Obtained %zd stack frames.\n", size);
for (i = 0; i < size; i++)
printf ("%s\n", strings[i]);
free (strings);
}
/* A dummy function to make the backtrace more interesting. */
void
dummy_function (void)
{
print_trace ();
}
int
main (void)
{
dummy_function ();
return 0;
}
|
the_stack_data/225143341.c | #include <pthread.h>
#include <stdio.h>
#define N 10
void * thread(void * args) {
printf("Thread %d is executed\n", *(int*)args);
}
// This is a fixed version with threads executed in order thanks to pthread_join()
// Without it threads will be executed in non-determined order so that lines of output
// will be shuffled
int main() {
int i;
for (i = 1; i <= N; i++) {
pthread_t tid;
int thread_number = i;
void * args = &thread_number;
printf("Thread %d is created\n", thread_number);
pthread_create(&tid, NULL, &thread, args);
pthread_join(tid, NULL);
}
} |
the_stack_data/73444.c | main(a,b){scanf("%d %d",&a,&b);printf("%d",a*b);} |
the_stack_data/218892650.c | float main(void){
return 0;
}
|
the_stack_data/54302.c | int func1_in_obj(void) {
return 0;
}
|
the_stack_data/28261934.c | /***
* This code is a part of EvoApproxLib library (ehw.fit.vutbr.cz/approxlib) distributed under The MIT License.
* When used, please cite the following article(s): V. Mrazek, L. Sekanina, Z. Vasicek "Libraries of Approximate Circuits: Automated Design and Application in CNN Accelerators" IEEE Journal on Emerging and Selected Topics in Circuits and Systems, Vol 10, No 4, 2020
* This file contains a circuit from a sub-set of pareto optimal circuits with respect to the pwr and mre parameters
***/
// MAE% = 21.79 %
// MAE = 446
// WCE% = 87.16 %
// WCE = 1785
// WCRE% = 100.00 %
// EP% = 87.16 %
// MRE% = 100.00 %
// MSE = 380056
// PDK45_PWR = 0.000 mW
// PDK45_AREA = 0.0 um2
// PDK45_DELAY = 0.00 ns
#include <stdint.h>
#include <stdlib.h>
uint64_t mul8x3u_0QB(const uint64_t A,const uint64_t B)
{
uint64_t O;
O = 0;
O |= (0&1) << 0;
O |= (0&1) << 1;
O |= (0&1) << 2;
O |= (0&1) << 3;
O |= (0&1) << 4;
O |= (0&1) << 5;
O |= (0&1) << 6;
O |= (0&1) << 7;
O |= (0&1) << 8;
O |= (0&1) << 9;
O |= (0&1) << 10;
return O;
}
|
the_stack_data/215494.c | /* Written by: Noah Brayer 12/4/2013 */
#include <stdio.h>
int main(void)
{ char ret; // To eliminate errors with scanf
double pi=0.0; // for result of calculation
double frac=0.0; // for fractions
double sum=0.0; // for sum of fractions
int n; // Input by user
int i; // Looping variable
printf("Enter a limit for n:"); // Asks user for more/less accuracy for pi
scanf("%d%c",&i,&ret); // scans user's input and return character
for(n=i;n>=0;n--) // loop to find find sum of fractions for calculation of pi
{ frac=1/(2*((double)n)+1); // produces odd numbers for the denominator of the fraction
if((n%2)==0) // finds if n is even
frac=-frac; // if n is even, fraction becomes negative
sum=sum+frac; // finds sum of fractions
}
pi=4*sum; // final calculation for pi
printf("Pi=%f",pi); // prints the calculated value of pi
return(0); // return for main
} // ends main |
the_stack_data/12636432.c | #include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
void parse_swid();
void parse_mri();
void parse_ipv4();
void parse_ipv4_option();
void accept();
void ipv4_lpm_141857();
void tbl_add_mri_option_150190();
void swid_1_141825();
void tbl_act_150375();
void reject();
int action_run;
int added_switch_id = 0;
int extract_id[9] = {0};
int push_fronts = 0;
typedef struct {
uint32_t ingress_port : 9;
uint32_t egress_spec : 9;
uint32_t egress_port : 9;
uint32_t clone_spec : 32;
uint32_t instance_type : 32;
uint8_t drop : 1;
uint32_t recirculate_port : 16;
uint32_t packet_length : 32;
uint32_t enq_timestamp : 32;
uint32_t enq_qdepth : 19;
uint32_t deq_timedelta : 32;
uint32_t deq_qdepth : 19;
uint64_t ingress_global_timestamp : 48;
uint32_t lf_field_list : 32;
uint32_t mcast_grp : 16;
uint8_t resubmit_flag : 1;
uint32_t egress_rid : 16;
} standard_metadata_t;
void mark_to_drop() {
exit(0);
}
typedef uint32_t egressSpec_t;
typedef uint64_t macAddr_t;
typedef uint32_t ip4Addr_t;
typedef uint32_t switchID_t;
switchID_t id_const;
typedef struct {
uint8_t isValid : 1;
macAddr_t dstAddr: 48;
macAddr_t srcAddr: 48;
uint32_t etherType : 16;
} ethernet_t;
typedef struct {
uint8_t isValid : 1;
uint8_t version : 4;
uint8_t ihl : 4;
uint8_t diffserv : 8;
uint32_t totalLen : 16;
uint32_t identification : 16;
uint8_t flags : 3;
uint32_t fragOffset : 13;
uint8_t ttl : 8;
uint8_t protocol : 8;
uint32_t hdrChecksum : 16;
ip4Addr_t srcAddr: 32;
ip4Addr_t dstAddr: 32;
} ipv4_t;
typedef struct {
uint8_t isValid : 1;
uint8_t copyFlag : 1;
uint8_t optClass : 2;
uint8_t option : 5;
uint8_t optionLength : 8;
} ipv4_option_t;
typedef struct {
uint8_t isValid : 1;
uint32_t count : 16;
} mri_t;
typedef struct {
uint8_t isValid : 1;
switchID_t swid: 32;
} switch_t;
typedef struct {
uint32_t count : 16;
} ingress_metadata_t;
typedef struct {
uint32_t remaining : 16;
} parser_metadata_t;
typedef struct {
ingress_metadata_t ingress_metadata;
parser_metadata_t parser_metadata;
} metadata;
typedef struct {
ethernet_t ethernet;
ipv4_t ipv4;
ipv4_option_t ipv4_option;
mri_t mri;
int swids_index;
switch_t swids[9];
} headers;
headers hdr;
metadata meta;
standard_metadata_t standard_metadata;
uint8_t tmp_7;
uint32_t tmp_8;
void start() {
hdr.ethernet.isValid = 1;
switch(hdr.ethernet.etherType){
case 2048: parse_ipv4(); break;
default: accept(); break;
}
}
void parse_ipv4() {
tmp_7 = hdr.ipv4.ihl >= 5;
klee_assume(!tmp_7);
reject();
switch(hdr.ipv4.ihl){
case 5: accept(); break;
default: parse_ipv4_option(); break;
}
}
void parse_ipv4_option() {
hdr.ipv4_option.isValid = 1;
switch(hdr.ipv4_option.option){
case 31: parse_mri(); break;
default: accept(); break;
}
}
void parse_mri() {
hdr.mri.isValid = 1;
meta.parser_metadata.remaining = hdr.mri.count;
switch(meta.parser_metadata.remaining){
case 0: accept(); break;
default: parse_swid(); break;
}
}
void reject() {
exit(0);
}
void parse_swid() {
if (hdr.swids_index >= 9){
reject();
}
hdr.swids[hdr.swids_index].isValid = 1;
extract_id[hdr.swids_index] = 1;
hdr.swids_index++;
tmp_8 = meta.parser_metadata.remaining + 65535;
meta.parser_metadata.remaining = tmp_8;
switch(meta.parser_metadata.remaining){
case 0: accept(); break;
default: parse_swid(); break;
}
}
void accept() {
}
void ParserImpl() {
klee_make_symbolic(&hdr, sizeof(hdr), "hdr");
klee_make_symbolic(&meta, sizeof(meta), "meta");
klee_make_symbolic(&standard_metadata, sizeof(standard_metadata), "standard_metadata");
hdr.swids_index = 0;
start();
}
//Control
void verifyChecksum() {
}
//Control
uint8_t tmp_9;
uint32_t tmp_10;
uint8_t tmp_11;
uint8_t tmp_12;
uint8_t tmp_13;
void ingress() {
if(hdr.ipv4.isValid) {
ipv4_lpm_141857();
if(!hdr.mri.isValid) {
tbl_add_mri_option_150190();
}
swid_1_141825();
}
}
// Action
void NoAction_0_141591() {
action_run = 141591;
}
// Action
void NoAction_3_141601() {
action_run = 141601;
}
// Action
void drop_0_141602() {
action_run = 141602;
mark_to_drop();
}
// Action
void add_mri_option_0_143531() {
action_run = 143531;
hdr.ipv4_option.isValid = 1;
hdr.ipv4_option.copyFlag = 1;
hdr.ipv4_option.optClass = 2;
hdr.ipv4_option.option = 31;
hdr.ipv4_option.optionLength = 4;
hdr.mri.isValid = 1;
hdr.mri.count = 0;
tmp_9 = hdr.ipv4.ihl + 1;
hdr.ipv4.ihl = hdr.ipv4.ihl + 1;
}
void push_front(int count) {
int i;
for (i = 8; i >= 0; i -= 1) {
if (i >= count) {
hdr.swids[i] = hdr.swids[i-count];
} else {
hdr.swids[i].isValid = 0;
}
}
hdr.swids_index = hdr.swids_index + count;
push_fronts += count;
if (hdr.swids_index > 8) hdr.swids_index = 8;
// Note: this.last, this.next, and this.lastIndex adjust with this.nextIndex
}
// Action
void add_swid_0_143681() {
action_run = 143681;
switchID_t id;
klee_make_symbolic(&id, sizeof(id), "id");
tmp_10 = hdr.mri.count + 1;
hdr.mri.count = hdr.mri.count + 1;
push_front(1);
hdr.swids[0].swid = id;
id_const = id;
added_switch_id = 1;
tmp_11 = hdr.ipv4.ihl + 1;
hdr.ipv4.ihl = hdr.ipv4.ihl + 1;
tmp_12 = hdr.ipv4_option.optionLength + 4;
hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4;
}
// Action
void ipv4_forward_0_143838() {
action_run = 143838;
macAddr_t dstAddr;
klee_make_symbolic(&dstAddr, sizeof(dstAddr), "dstAddr");
egressSpec_t port;
klee_make_symbolic(&port, sizeof(port), "port");
standard_metadata.egress_spec = port;
hdr.ethernet.srcAddr = hdr.ethernet.dstAddr;
hdr.ethernet.dstAddr = dstAddr;
tmp_13 = hdr.ipv4.ttl + 255;
hdr.ipv4.ttl = hdr.ipv4.ttl + 255;
}
//Table
void swid_1_141825() {
NoAction_0_141591();
}
//Table
void ipv4_lpm_141857() {
int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
case 0: ipv4_forward_0_143838(); break;
case 1: drop_0_141602(); break;
default: NoAction_3_141601(); break;
}
// size 1024
// default_action NoAction_3();
}
//Table
void tbl_add_mri_option_150190() {
int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
default: add_mri_option_0_143531(); break;
}
// default_action add_mri_option_0();
}
//Control
void egress() {
}
typedef struct {
uint8_t field : 4;
uint8_t field_0 : 4;
uint8_t field_1 : 8;
uint32_t field_2 : 16;
uint32_t field_3 : 16;
uint8_t field_4 : 3;
uint32_t field_5 : 13;
uint8_t field_6 : 8;
uint8_t field_7 : 8;
uint32_t field_8 : 32;
uint32_t field_9 : 32;
} tuple_0;
//Control
uint32_t tmp_14;
void computeChecksum() {
if(hdr.ipv4.isValid) {
klee_make_symbolic(&tmp_14, sizeof(tmp_14), "tmp_14");
tbl_act_150375();
}
}
// Action
void act_148943() {
action_run = 148943;
hdr.ipv4.hdrChecksum = tmp_14;
}
//Table
void tbl_act_150375() {
int symbol;
klee_make_symbolic(&symbol, sizeof(symbol), "symbol");
switch(symbol) {
default: act_148943(); break;
}
// default_action act();
}
//Control
void DeparserImpl() {
//Emit hdr.ethernet
//Emit hdr.ipv4
//Emit hdr.ipv4_option
//Emit hdr.mri
//Emit hdr.swids
if(added_switch_id && id_const != hdr.swids[0].swid){
klee_print_once(0, "Assert error: const(switchid)");
}
int i;
for(i = 0; i < 9; i++){
if(extract_id[i] == 1 && !(hdr.swids[i+push_fronts].isValid == 1)){
klee_print_once(1, "switch id removed");
}
}
}
int main() {
ParserImpl();
ingress();
egress();
DeparserImpl();
return 0;
}
|
the_stack_data/93102.c | /*
Rot13ExecveSh.c
By Abatchy
gcc Rot13ExecveSh.c -fno-stack-protector -z execstack -o Rot13ExecveSh.out
*/
#include <stdio.h>
#include <string.h>
unsigned char sc[] = "\xeb\x09\x5e\x80\x2e\x0d\x74\x08\x46\xeb\xf8\xe8\xf2\xff\xff\xff\x3e\xcd\x5d\x96\xef\x75\x3c\x3c\x80\x75\x75\x3c\x6f\x76\x7b\x96\xf0\x5d\xbd\x18\xda\x8d\x0d";
int main()
{
printf("Shellcode size: %d\n", strlen(sc));
int (*ret)() = (int(*)())sc;
ret();
}
|
the_stack_data/156394308.c | /*
* Copyright (c) 1989, 1993
* The Regents of the University of California. 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. 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <string.h>
int strncmp(s1, s2, n) const char *s1, *s2;
size_t n;
{
if (n == 0)
return (0);
do {
if (*s1 != *s2++)
return (*(unsigned char*)s1 - *(unsigned char*)--s2);
if (*s1++ == 0)
break;
} while (--n != 0);
return (0);
}
|
the_stack_data/28263467.c | #include <inttypes.h>
#include <wchar.h>
extern void *fd4_mkclosure(void*, int, ...);
extern void *fd4_printn(uint64_t);
extern void *fd4_sub(uint64_t, uint64_t);
void* fd4_res;
uint64_t* fd4main() {
fd4_res = (void *)(({
void** fd4_a0 = 2;
(uint64_t) fd4_a0 + (uint64_t) 2;
}));
fd4_printn((uint64_t)fd4_res)
;
return 0;
}
int main() {
fd4main();
} |
the_stack_data/98575450.c | #include <stdio.h>
#include <stdint.h>
typedef uint8_t BYTE;
typedef struct /**** BMP file header structure ****/
{
unsigned int bfSize; /* Size of file */
unsigned short bfReserved1; /* Reserved */
unsigned short bfReserved2; /* ... */
unsigned int bfOffBits; /* Offset to bitmap data */
} BITMAPFILEHEADER;
typedef struct /**** BMP file info structure ****/
{
unsigned int biSize; /* Size of info header */
int biWidth; /* Width of image */
int biHeight; /* Height of image */
unsigned short biPlanes; /* Number of color planes */
unsigned short biBitCount; /* Number of bits per pixel */
unsigned int biCompression; /* Type of compression to use */
unsigned int biSizeImage; /* Size of image data */
int biXPelsPerMeter; /* X pixels per meter */
int biYPelsPerMeter; /* Y pixels per meter */
unsigned int biClrUsed; /* Number of colors used */
unsigned int biClrImportant; /* Number of important colors */
} BITMAPINFOHEADER;
typedef struct tagRGBQUAD{
BYTE rgbBlue;//蓝色的亮度(值范围为0-255)
BYTE rgbGreen;//绿色的亮度(值范围为0-255)
BYTE rgbRed;//红色的亮度(值范围为0-255)
BYTE rgbReserved;//保留,必须为0
}RGBQUAD;
void MySaveBmp(const char *filename,unsigned char *rgbbuf,int width,int height)
{
BITMAPFILEHEADER bfh;
BITMAPINFOHEADER bih;
/* Magic number for file. It does not fit in the header structure due to alignment requirements, so put it outside */
unsigned short bfType=0x4d42;
bfh.bfReserved1 = 0;
bfh.bfReserved2 = 0;
bfh.bfSize = 2+sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)+width*height*3;
bfh.bfOffBits = 0x36;
bih.biSize = sizeof(BITMAPINFOHEADER);
bih.biWidth = width;
bih.biHeight = height;
bih.biPlanes = 1;
bih.biBitCount = 24;
bih.biCompression = 0;
bih.biSizeImage = 0;
bih.biXPelsPerMeter = 5000;
bih.biYPelsPerMeter = 5000;
bih.biClrUsed = 0;
bih.biClrImportant = 0;
FILE *file = fopen(filename, "wb");
if (!file)
{
printf("Could not write file\n");
return;
}
/*Write headers*/
fwrite(&bfType,sizeof(bfType),1,file);
fwrite(&bfh,sizeof(bfh),1, file);
fwrite(&bih,sizeof(bih),1, file);
fwrite(rgbbuf,width*height*3,1,file);
fclose(file);
}
int bmp_header_size(void)
{
return 2+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
}
|
the_stack_data/36074227.c | #include <stdio.h>
#define ROWS 3
#define COLS 4
int sum2d(int rows, int cols, int ar[rows][cols]);
int main(void){
int i, j;
int rs = 3;
int cs = 10;
int junk[ROWS][COLS] = {
{2, 4, 6, 8},
{3, 5, 7, 9},
{12, 10, 8 ,6}
};
int morejunk[ROWS-1][COLS+2] = {
{20, 30, 40 ,50 ,60, 70},
{5, 6, 7, 8, 9, 10}
};
int varr[rs][cs];
for (i = 0; i < rs; i++)
for (j = 0; j < cs; j++)
varr[i][j] = i*j +j;
printf("3x4 array:\n");
printf("Sum of all elements = %d\n", sum2d(ROWS, COLS, junk));
printf("2x6 array:\n");
printf("Sum of all elements = %d\n", sum2d(ROWS-1, COLS+2, morejunk));
printf("3x10 array:\n");
printf("Sum of all elements = %d\n", sum2d(rs, cs, varr));
return 0;
}
int sum2d(int rows, int cols, int ar[rows][cols]){
int r, c, tot =0;
for (r = 0; r < rows; r++)
for (c = 0; c < cols; c++)
tot += ar[r][c];
return tot;
} |
the_stack_data/71917.c | /*
From: [email protected]
To: [email protected]
Subject: Re: Scary problems in g77 for RedHat 6.0. (glibc-2.1)
Date: Sun, 06 Jun 1999 23:37:23 -0400
X-UIDL: 9c1e40c572e3b306464f703461764cd5
*/
/* { dg-xfail-if "Can not call system libm.a with -msoft-float" { powerpc-*-aix* rs6000-*-aix* } { "-msoft-float" } { "" } } */
#include <stdio.h>
#include <math.h>
int
main()
{
if (floor (0.1) != 0.)
abort ();
return 0;
}
/*
It will result in 36028797018963968.000000 on Alpha RedHat Linux 6.0
using glibc-2.1 at least on my 21064. This may result in g77 bug
reports concerning the INT() function, just so you know.
Thanks,
Rick Niles.
*/
|
the_stack_data/103264508.c | /*
* linux/lib/vsprintf.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
/*
* Wirzenius wrote this portably, Torvalds fucked it up :-)
*/
#include <stdarg.h>
//#include <types.h>
#include <string.h>
#include <ctype.h>
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
{
unsigned long result = 0,value;
if (!base) {
base = 10;
if (*cp == '0') {
base = 8;
cp++;
if ((*cp == 'x') && isxdigit(cp[1])) {
cp++;
base = 16;
}
}
}
while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
? toupper(*cp) : *cp)-'A'+10) < base) {
result = result*base + value;
cp++;
}
if (endp)
*endp = (char *)cp;
return result;
}
long simple_strtol(const char *cp,char **endp,unsigned int base)
{
if(*cp=='-')
return -simple_strtoul(cp+1,endp,base);
return simple_strtoul(cp,endp,base);
}
/* we use this so that we can do without the ctype library */
#define is_digit(c) ((c) >= '0' && (c) <= '9')
static int skip_atoi(const char **s)
{
int i=0;
while (is_digit(**s))
i = i*10 + *((*s)++) - '0';
return i;
}
#define ZEROPAD 1 /* pad with zero */
#define SIGN 2 /* unsigned/signed long */
#define PLUS 4 /* show plus */
#define SPACE 8 /* space if plus */
#define LEFT 16 /* left justified */
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
#define do_div(n,base) ({ \
int __res; \
__res = ((unsigned long) n) % (unsigned) base; \
n = ((unsigned long) n) / (unsigned) base; \
__res; })
size_t dstrnlen (const char *s, size_t maxlen)
{
if (strlen(s) < maxlen)
return (strlen(s));
else
return (maxlen);
}
static char * number(char * str, long num, int base, int size, int precision
,int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i;
if (type & LARGE)
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
return 0;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
sign = '-';
num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
i = 0;
if (num == 0)
tmp[i++]='0';
else while (num != 0)
tmp[i++] = digits[do_div(num,base)];
if (i > precision)
precision = i;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
*str++ = ' ';
if (sign)
*str++ = sign;
if (type & SPECIAL) {
if (base==8)
*str++ = '0';
else if (base==16) {
*str++ = '0';
*str++ = digits[33];
}
}
if (!(type & LEFT))
while (size-- > 0)
*str++ = c;
while (i < precision--)
*str++ = '0';
while (i-- > 0)
*str++ = tmp[i];
while (size-- > 0)
*str++ = ' ';
return str;
}
/* Forward decl. needed for IP address printing stuff... */
int sprintf(char * buf, const char *fmt, ...);
int vsprintf(char *buf, const char *fmt, va_list args)
{
int len;
unsigned long num;
int i, base;
char * str;
const char *s;
int flags; /* flags to number() */
int field_width; /* width of output field */
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier; /* 'h', 'l', or 'L' for integer fields */
for (str=buf ; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
continue;
}
/* process flags */
flags = 0;
repeat:
++fmt; /* this also skips first '%' */
switch (*fmt) {
case '-': flags |= LEFT; goto repeat;
case '+': flags |= PLUS; goto repeat;
case ' ': flags |= SPACE; goto repeat;
case '#': flags |= SPECIAL; goto repeat;
case '0': flags |= ZEROPAD; goto repeat;
}
/* get field width */
field_width = -1;
if (is_digit(*fmt))
field_width = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* it's the next argument */
field_width = va_arg(args, int);
if (field_width < 0) {
field_width = -field_width;
flags |= LEFT;
}
}
/* get the precision */
precision = -1;
if (*fmt == '.') {
++fmt;
if (is_digit(*fmt))
precision = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* it's the next argument */
precision = va_arg(args, int);
}
if (precision < 0)
precision = 0;
}
/* get the conversion qualifier */
qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
qualifier = *fmt;
++fmt;
}
/* default base */
base = 10;
switch (*fmt) {
case 'c':
if (!(flags & LEFT))
while (--field_width > 0)
*str++ = ' ';
*str++ = (unsigned char) va_arg(args, int);
while (--field_width > 0)
*str++ = ' ';
continue;
case 's':
s = va_arg(args, char *);
if (!s)
s = "<NULL>";
len = dstrnlen(s, precision);
if (!(flags & LEFT))
while (len < field_width--)
*str++ = ' ';
for (i = 0; i < len; ++i)
*str++ = *s++;
while (len < field_width--)
*str++ = ' ';
continue;
case 'p':
if (field_width == -1) {
field_width = 2*sizeof(void *);
flags |= ZEROPAD;
}
str = number(str,
(unsigned long) va_arg(args, void *), 16,
field_width, precision, flags);
continue;
case 'n':
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
*ip = (str - buf);
} else {
int * ip = va_arg(args, int *);
*ip = (str - buf);
}
continue;
case '%':
*str++ = '%';
continue;
/* integer number formats - set up the flags and "break" */
case 'o':
base = 8;
break;
case 'X':
flags |= LARGE;
case 'x':
base = 16;
break;
case 'd':
case 'i':
flags |= SIGN;
case 'u':
break;
default:
*str++ = '%';
if (*fmt)
*str++ = *fmt;
else
--fmt;
continue;
}
if (qualifier == 'l')
num = va_arg(args, unsigned long);
else if (qualifier == 'h') {
num = (unsigned short) va_arg(args, int);
if (flags & SIGN)
num = (short) num;
} else if (flags & SIGN)
num = va_arg(args, int);
else
num = va_arg(args, unsigned int);
str = number(str, num, base, field_width, precision, flags);
}
*str = '\0';
return str-buf;
}
int dsprintf(char * buf, const char *fmt, ...)
{
va_list args;
int i;
va_start(args, fmt);
i=vsprintf(buf,fmt,args);
va_end(args);
return i;
}
|
the_stack_data/100139868.c | #include<stdio.h>
int main()
{
int a,b, value=1;
printf("Enter base number and power:");
scanf("%d %d",&a,&b);
if (b==0)
{
printf("%d ^ %d = 1",a,b);
}
else if(b>0)
{
for (int i=1;i<=b;i++)
{
value*=a;
}
printf("%d ^ %d = %d",a,b,value);
}
else
{
printf("Invalid Input");
}
return 0;
} |
the_stack_data/19355.c | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
char *wksxmpp_b64encode(const char *data, size_t dlen, char **encdata)
{
BIO *bio, *b64;
FILE *stream;
int encSize = 4 * ceil((double)dlen/3);
*encdata = (char *) malloc(encSize + 1);
stream = fmemopen((void *) *encdata, encSize + 1, "w");
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_fp(stream, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
BIO_write(bio, data, dlen);
BIO_flush(bio);
BIO_free_all(bio);
fclose(stream);
return *encdata;
}
static size_t decDataLength(const char* encdata) {
int len = strlen(encdata);
int padding = 0;
if (encdata[len-1] == '=' && encdata[len-2] == '=') //last two chars are =
padding = 2;
else if (encdata[len-1] == '=') //last char is =
padding = 1;
return (size_t)((len * 3) / 4) - padding;
}
char *wksxmpp_b64decode(const char *encdata, char **decdata, size_t *dlen)
{
BIO *bio, *b64;
FILE *stream;
int len;
*dlen = decDataLength(encdata);
*decdata = (char *) malloc((*dlen) + 1);
stream = fmemopen((void *) encdata, strlen(encdata), "r");
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_fp(stream, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
len = BIO_read(bio, *decdata, strlen(encdata));
(*decdata)[len] = '\0';
BIO_free_all(bio);
fclose(stream);
return *decdata;
}
void wksxmpp_b64free(void *ptr)
{
free(ptr);
}
|
the_stack_data/247017524.c | /*
* A simple Hello World From Thread 0 Program
*
* Author: Matt Cufari
* Version: 1.0.0
* Date Created: Jan 4 2021
* Date Last Modified: Jan 4 2021
*
*
*/
#include <stdio.h>
#include <omp.h>
int main(){
#pragma omp parallel //Create a parallel block
{
int ID = omp_get_thread_num(); //Set the ID
printf("Hello (%d) ", ID); //Hello (ID)
printf("world (%d) \n", ID); //World (ID)
/*
* The output of this program will look nonsenical because threads do not execute
* one-after another
*
* How do we modify this program so that the threads aren't racing against one another?
*/
// Mutual Exlcusion!
}
return 0;
}
|
the_stack_data/103265680.c | #ifndef TH_GENERIC_FILE
#define TH_GENERIC_FILE "generic/Col2Im.c"
#else
#include <ATen/div_rtn.h>
// Note [im2col/col2im output padding]
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Our implementations of im2col and col2im take both the input height/width as
// well as a seemingly redundant output height/width. In principle, you could
// compute the output height/width by using the convolution shape formulas. So,
// what's up with that?
//
// The trouble arises when one runs the backward of a transposed convolution
// with output_padding >= stride. (BTW, output_padding is known as adj inside
// THNN.) Let's consider a simple case where we have kernel=2, dilation=2,
// stride=1, output_padding=1 for a 4x4 input:
//
// Input: X
//
// Output: X.X.
// ....
// X.X.
// ....
//
// If we compute backwards of output with a standard convolution on the output
// with the same parameters, we would end up with a 2x2 grad_input (because you
// can slide the stencil over to the right once and down once). But that is all
// out-of-bounds if you're computing backwards for a 1x1 input.
//
// "Now Edward," you might say, "the real problem is that you set output_padding
// >= stride, surely an error should have been raised in this case." To
// understand why it is useful to handle this case, we have to understand how we
// compute the weight gradient of a convolution. Suppose we have a convolution
// with kernel=2, stride=2 on a 5x5 input. Let us see all the contributions of
// weight[0][0] (which we have labeled w) in the output:
//
// Input: a.b.. Weight: w.
// ..... ..
// c.d..
// .....
// .....
//
// Output: [ aw+... bw+... ]
// [ cw+... dw+... ]
//
// From this diagram, it easy to see that we can compute the weight gradient
// by performing a *dilated* convolution between the input and the
// output gradients with kernel=2, dilation=2, stride=1. But there's a rub: if
// we do a dilated convolution directly, we'll end up with a 3x3 weight
// gradient, when we clearly wanted a 2x2. So how do we avoid going out
// of bounds? We could add a notion of 'output_padding' for non-transposed
// convolution, but another simple and effective fix is to just accept
// the desired output size directly, and compute only within those bounds.
//
//
// ALSO do vol2col
static void THNN_(im2col)(const real* data_im, const int64_t channels,
const int64_t height, const int64_t width,
const int64_t output_height, const int64_t output_width,
const int64_t kernel_h, const int64_t kernel_w,
const int64_t pad_h, const int64_t pad_w,
const int64_t stride_h, const int64_t stride_w,
const int64_t dilation_h, const int64_t dilation_w,
real* data_col) {
const int64_t height_col = output_height;
const int64_t width_col = output_width;
const int64_t channels_col = channels * kernel_h * kernel_w;
for (int64_t c_col = 0; c_col < channels_col; ++c_col) {
int64_t w_offset = c_col % kernel_w;
int64_t h_offset = (c_col / kernel_w) % kernel_h;
int64_t c_im = c_col / kernel_h / kernel_w;
for (int64_t h_col = 0; h_col < height_col; ++h_col) {
int64_t h_im = h_col * stride_h - pad_h + h_offset * dilation_h;
for (int64_t w_col = 0; w_col < width_col; ++w_col) {
int64_t w_im = w_col * stride_w - pad_w + w_offset * dilation_w;
data_col[(c_col * height_col + h_col) * width_col + w_col] =
(h_im >= 0 && w_im >= 0 && h_im < height && w_im < width) ?
data_im[(c_im * height + h_im) * width + w_im] : 0;
}
}
}
}
static void THNN_(col2im)(const real* data_col, const int64_t channels,
const int64_t height, const int64_t width,
const int64_t output_height, const int64_t output_width,
const int64_t kernel_h, const int64_t kernel_w,
const int64_t pad_h, const int64_t pad_w,
const int64_t stride_h, const int64_t stride_w,
const int64_t dilation_h, const int64_t dilation_w,
real* data_im) {
memset(data_im, 0, sizeof(real) * height * width * channels);
const int64_t height_col = output_height;
const int64_t width_col = output_width;
const int64_t channels_col = channels * kernel_h * kernel_w;
for (int64_t c_col = 0; c_col < channels_col; ++c_col) {
int64_t w_offset = c_col % kernel_w;
int64_t h_offset = (c_col / kernel_w) % kernel_h;
int64_t c_im = c_col / kernel_h / kernel_w;
for (int64_t h_col = 0; h_col < height_col; ++h_col) {
int64_t h_im = h_col * stride_h - pad_h + h_offset * dilation_h;
for (int64_t w_col = 0; w_col < width_col; ++w_col) {
int64_t w_im = w_col * stride_w - pad_w + w_offset * dilation_w;
if (h_im >= 0 && h_im < height && w_im >= 0 && w_im < width)
data_im[(c_im * height + h_im) * width + w_im] +=
data_col[(c_col * height_col + h_col) * width_col + w_col];
}
}
}
}
static inline void THNN_(Col2Im_shapeCheck)(
THNNState *state,
THTensor *input,
THTensor *gradOutput,
int64_t outputHeight, int64_t outputWidth,
int64_t kH, int64_t kW, int64_t dH, int64_t dW,
int64_t padH, int64_t padW, int64_t sH, int64_t sW) {
THArgCheck(kW > 0 && kH > 0, 6,
"kernel size should be greater than zero, but got kH: %d kW: %d", kH, kW);
THArgCheck(sW > 0 && sH > 0, 12,
"stride should be greater than zero, but got sH: %d sW: %d", sH, sW);
THArgCheck(dW > 0 && dH > 0, 8,
"dilation should be greater than zero, but got dH: %d dW: %d", dH, dW);
int64_t ndim = THTensor_(nDimensionLegacyNoScalars)(input);
THNN_ARGCHECK(!input->is_empty() && (ndim == 2 || ndim == 3), 2, input,
"Expected non-empty 2D or 3D input tensor, but got input of shape %s");
int64_t batch_dim = (ndim == 3) ? 0 : -1;
int64_t nInputPlane = input->size(batch_dim + 1);
if (nInputPlane % (kW * kH) != 0) {
THError("Expected size of input's dimension 1 to be divisible by the "
"product of kernel_size, but got input.size(1)=%lld and "
"kernel_size=(%d, %d).", (long long) nInputPlane, kH, kW);
}
int64_t inputLength = input->size(batch_dim + 2);
int64_t nBlocksH = div_rtn<int64_t>(outputHeight + 2 * padH - dH * (kH - 1) - 1, sH) + 1;
int64_t nBlocksW = div_rtn<int64_t>(outputWidth + 2 * padW - dW * (kW - 1) - 1, sW) + 1;
if (inputLength != (nBlocksH * nBlocksW)) {
THError("Given output_size=(%d, %d), kernel_size=(%d, %d), "
"dilation=(%d, %d), padding=(%d, %d), stride=(%d, %d), expected "
"size of input's dimension 2 to match the calculated number of "
"sliding blocks %lld * %lld = %lld, but got input.size(2)=%lld.",
outputHeight, outputWidth, kH, kW, dH, dW, padH, padW, sH, sW,
(long long) nBlocksH, (long long) nBlocksW,
(long long) (nBlocksH * nBlocksW), (long long) inputLength);
}
if (outputWidth < 1 || outputHeight < 1) {
THError("Expected output spatial size to be positive, but got: output_size=(%d, %d).",
outputHeight, outputWidth);
}
}
void THNN_(Col2Im_updateOutput)(
THNNState *state,
THTensor *input,
THTensor *output,
int64_t outputHeight, int64_t outputWidth,
int64_t kH, int64_t kW,
int64_t dH, int64_t dW,
int64_t padH, int64_t padW,
int64_t sH, int64_t sW) {
THNN_(Col2Im_shapeCheck)(state, input, NULL, outputHeight, outputWidth,
kH, kW, dH, dW, padH, padW, sH, sW);
bool batched_input = true;
if (input->dim() == 2) {
// Force batch
batched_input = false;
THTensor_(resize3d)(input, 1, input->size(0), input->size(1));
}
long batchSize = input->size(0);
long nInputPlane = input->size(1);
long nOutputPlane = nInputPlane / (kW * kH);
input = THTensor_(newContiguous)(input);
THTensor_(resize4d)(output, batchSize, nOutputPlane, outputHeight, outputWidth);
THTensor_(zero)(output);
THTensor *input_n = THTensor_(new)();
THTensor *output_n = THTensor_(new)();
int64_t height_col = (outputHeight + 2 * padH - (dH * (kH - 1) + 1)) / sH + 1;
int64_t width_col = (outputWidth + 2 * padW - (dW * (kW - 1) + 1)) / sW + 1;
for (int64_t elt = 0; elt < batchSize; elt++) {
THTensor_(select)(input_n, input, 0, elt);
THTensor_(select)(output_n, output, 0, elt);
THNN_(col2im)(
THTensor_(data)(input_n),
nOutputPlane,
outputHeight, outputWidth,
height_col, width_col,
kH, kW,
padH, padW,
sH, sW,
dH, dW, THTensor_(data)(output_n));
}
THTensor_(free)(input_n);
THTensor_(free)(output_n);
if (!batched_input) {
THTensor_(resize3d)(output, nOutputPlane, outputHeight, outputWidth);
}
THTensor_(free)(input);
}
void THNN_(Col2Im_updateGradInput)(
THNNState *state,
THTensor *gradOutput,
THTensor *gradInput,
int64_t kH, int64_t kW,
int64_t dH, int64_t dW,
int64_t padH, int64_t padW,
int64_t sH, int64_t sW) {
THNN_(Im2Col_updateOutput)(state, gradOutput, gradInput,
kH, kW, dH, dW, padH, padW, sH, sW);
}
#endif
|
the_stack_data/261141.c | #include <stdio.h>
#include <stdint.h>
#include <string.h>
#define le16_to_cpu(x) ( (((x)>>8)&0xff) | (((x)<<8)&0xff00) )
#define le32_to_cpu(x) (\
(((x)>>24)&0xff)\
|\
(((x)>>8)&0xff00)\
|\
(((x)<<8)&0xff0000)\
|\
(((x)<<24)&0xff000000)\
)
#define BS_SIZE 36
#define FAT12 1
#define FAT16 2
#define FAT32 3
#define DIRECTORY 0x10
typedef struct _FAT_BS
{
/* Boot Sector */
char jmp_boot[3]; // Jump instruction to boot code, most common eb3c90
char OEM_name[8]; // An 8 byte string, typically used to indicate what OS formatted the volume. Microsoft operating systems don’t pay any attention to this field
/* BIOS Parameter Block */
uint16_t BytsPerSec; // Count of bytes per sector. Possible values 512, 1024, 2048 and 4096
uint8_t SecPerClus; // Number of sectors per allocation unit, must be a power of 2 between 1-12
uint16_t RsvdSecCnt; // Number of reserved sectors in the reserved region of the volume. This is 1 for FAT12 and FAT16. For FAT32 this is most commonly 32.
uint8_t NumFATs; // Count of FAT data structures on the volume. Should always be set to 2
uint16_t RootEnt; // For FAT12/FAT16 this field contains the count of 32. For FAT32 this is 0, it's set later in the FAT32 extended fields.
uint16_t TotSec16; // old 16bit value of total sectors, for FAT12/16 this field is used, for FAT32 the sector count is set in the extended field.
uint8_t Media; // Type of media, 0xF8 non-removable media, 0xF0 removable media
uint16_t FATSz16; // count of sectors occupied by one FAT. Used by FAT12/FAT16, 0 for FAT32
uint16_t SecPerTrk; // Sectors per track for interrupt 0x13, only relevant if the media have a geometry.
uint16_t NumHeads; // Number of heads for interrupt 0x13, only relevant if the media have a ge ometry.
uint32_t HiddSec; // Hidden sectors preceding the partiation that contains this FAT volume.
uint32_t TotSec32; // Total sectors for FAT32, 0 for FAT12/FAT16
} FAT_BS;
FAT_BS initFAT_BS(char buf[])
{
FAT_BS f;
memcpy(&f.jmp_boot, &(buf[0]), 3);
memcpy(&f.OEM_name, &(buf[3]), 8);
memcpy(&f.BytsPerSec, &(buf[11]), 2);
memcpy(&f.SecPerClus, &(buf[13]), 1);
memcpy(&f.RsvdSecCnt, &(buf[14]), 2);
memcpy(&f.NumFATs, &(buf[16]), 1);
memcpy(&f.RootEnt, &(buf[17]), 2);
memcpy(&f.TotSec16, &(buf[19]), 2);
memcpy(&f.Media, &(buf[21]), 1);
memcpy(&f.FATSz16, &(buf[22]), 2);
memcpy(&f.SecPerTrk, &(buf[24]), 2);
memcpy(&f.NumHeads, &(buf[26]), 2);
memcpy(&f.HiddSec, &(buf[28]), 4);
memcpy(&f.TotSec32,&(buf[32]), 4);
return f;
}
void printFAT_BS(FAT_BS f)
{
printf("JMP_BOOT=0x%x %x %x\n", f.jmp_boot[0], f.jmp_boot[1], f.jmp_boot[2]);
printf("%.*s\n", 8, f.OEM_name);
printf("BytsPerSec=%d\n", f.BytsPerSec);
printf("SecPerClus=%d\n", f.SecPerClus);
printf("RsvdSecCnt=%d\n", f.RsvdSecCnt);
printf("NumFATs=%d\n", f.NumFATs);
printf("RootEnt=%d\n", f.RootEnt);
printf("TotSec=%d\n", f.TotSec16);
printf("Media=%d\n", f.Media);
printf("FATSz16=%d\n", f.FATSz16);
printf("SecPerTrk=%d\n", f.SecPerTrk);
printf("NumHeads=%d\n", f.NumHeads);
printf("HiddSec=%d\n", f.HiddSec);
printf("TotSec32=%d\n", f.TotSec32);
}
/* getFATType - the FAT type is determind by the count of clusters on the volume */
int getFATType(FAT_BS f, uint32_t FATSz32)
{
uint32_t RootDirSectors = (((f.RootEnt) * 32) + ((f.BytsPerSec) - 1)) / (f.BytsPerSec);
uint32_t FATSz, TotSec, DataSec, CountOfClusters;
if((f.FATSz16) != 0)
FATSz = (f.FATSz16);
else
FATSz = (FATSz32);
if((f.TotSec16) != 0)
TotSec = (f.TotSec16);
else
TotSec = (f.TotSec32);
DataSec = TotSec - ((f.RsvdSecCnt) + (f.NumFATs * FATSz) + RootDirSectors);
CountOfClusters = DataSec / f.SecPerClus;
printf("CountOfClusters=%d\n", CountOfClusters);
if(CountOfClusters < 4085)
return FAT12;
else if(CountOfClusters < 66525)
return FAT16;
else
return FAT32;
return 0;
}
__inline uint32_t firstCluster(FAT_BS f)
{
return (f.RsvdSecCnt + (f.NumFATs * f.FATSz16)) * f.BytsPerSec;
}
// root_dir_sectors = ((fat_boot->root_entry_count * 32) + (fat_boot->bytes_per_sector - 1)) / fat_boot->bytes_per_sector;
__inline uint32_t rootDirSector(FAT_BS f)
{
return ((f.RootEnt * 32) + (f.BytsPerSec -1)) / f.BytsPerSec;
}
// first_data_sector = fat_boot->reserved_sector_count + (fat_boot->table_count * fat_size) + root_dir_sectors;
__inline uint32_t firstDataSector(FAT_BS f)
{
return f.RsvdSecCnt + (f.NumFATs * f.FATSz16) + rootDirSector(f);
}
__inline uint32_t getCluster(FAT_BS f, uint32_t clusterNum)
{
if(clusterNum < 3)
return f.RsvdSecCnt + (f.NumFATs * f.FATSz16);
else
return ((clusterNum - 2 ) * f.SecPerClus) + firstDataSector(f);
}
// first_sector_of_cluster = ((cluster - 2) * fat_boot->sectors_per_cluster) + first_data_sector;
__inline uint32_t getClusterOffset(FAT_BS f, uint32_t clusterNum)
{
if(clusterNum < 3)
return firstCluster(f);
else
return ((((clusterNum - 2 ) * f.SecPerClus) + firstDataSector(f)) * f.BytsPerSec);
}
void listDir(FAT_BS f, FILE *fptr, uint32_t cluster)
{
char buf[512];
char filename[11];
uint32_t i=0;
fseek(fptr, (getClusterOffset(f, cluster)), SEEK_SET);
fread(buf, 512, 1, fptr);
while(1)
{
memcpy(&filename, &(buf[i]), 11);
if(filename[0] == 0)
break;
else
{
printf("--");
printf("%.*s ", 11, filename);
memcpy(&cluster, &(buf[i+26]), 2);
printf("cluster=%d ", cluster);
printf("0x%x ", getClusterOffset(f, cluster));
printf("%d\n", getCluster(f, cluster));
i+=32;
}
}
}
void listDirs(FAT_BS f, int type, FILE *fptr)
{
char buf[512];
char filename[11];
uint32_t i=0;
if(type == FAT32)
{
}
else // FAT12 or FAT16
{
uint32_t cluster_offset = firstCluster(f);
uint16_t cluster=0;
printf("%d\n", cluster_offset);
fseek(fptr, cluster_offset, SEEK_SET);
fread(buf, 512, 1, fptr);
/*memcpy(&filename, &(buf[0]), 11);
printf("%.*s\n", 11, filename);
memcpy(&filename, &(buf[32]), 11);
printf("%.*s\n", 11, filename);*/
while(1)
{
memcpy(&filename, &(buf[i]), 11);
if(filename[0] == 0)
break;
else
{
printf("%.*s ", 11, filename);
memcpy(&cluster, &(buf[i+26]), 2);
printf("cluster=%d ", cluster);
printf("0x%x ", getClusterOffset(f, cluster));
printf("%d\n", getCluster(f, cluster));
if(buf[i+11] == DIRECTORY)
{
listDir(f, fptr, cluster);
printf("got dir!\n");
}
i+=32;
}
}
}
}
int main(int argc, char *argv[])
{
if(argc == 1)
{
printf("Error: no input file\n");
return -1;
}
FILE *fptr = fopen(argv[1], "r"); ;
char buf[512];
uint32_t FATSz32=0;
fread(buf, 512, 1, fptr);
FAT_BS fatBS = initFAT_BS(buf);
if(fatBS.FATSz16 == 0)
{
memcpy(&FATSz32, &(buf[36]), 4);
}
printFAT_BS(fatBS);
printf("FATSz32=%d\n", FATSz32);
switch(getFATType(fatBS, FATSz32)){
case FAT12:
printf("FAT12\n");
break;
case FAT16:
printf("FAT16\n");
break;
case FAT32:
printf("FAT32\n");
break;
}
listDirs(fatBS, FAT16, fptr);
return 0;
}
|
the_stack_data/125139487.c | // Copyright 2017 ETH Zurich and University of Bologna.
// Copyright and related rights are licensed under the Solderpad Hardware
// License, Version 0.51 (the “License”); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
// or agreed to in writing, software, hardware and materials distributed under
// this 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.
#include <stdio.h>
int main()
{
printf("Hello World!!!!!\n");
return 0;
}
|
the_stack_data/128366.c | /**
* Print the contents of a flag file if user input passes all checks.
*
* Author: Steve Matsumoto <[email protected]>
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define CAT "/bin/cat"
#define SED "/bin/sed"
#define GCC "/usr/bin/gcc"
#define PYTHON "/usr/bin/python3"
#define BODY "body.txt"
#define FUNCTION "bit_copy_lsb"
#define HEADER FUNCTION ".h"
#define TEMPLATE FUNCTION "_template.h"
#define PREPROCESSED FUNCTION ".i"
#define CHECK_CORRECTNESS "test_correctness"
#define CHECK_CORRECTNESS_SRC CHECK_CORRECTNESS ".c"
#define FLAG "flag.txt"
#define CHECK_SYNTAX "test_syntax.py"
#define ALLOWED_OPS "!,~,&,^,|,+,<<,>>"
#define MAX_OPS "5"
#define NUM_RANDOM_TESTS "10000"
void cleanup()
{
system("rm -f " BODY);
system("rm -f " PREPROCESSED);
system("rm -f " CHECK_CORRECTNESS);
system("cp " TEMPLATE " " HEADER);
system("chmod 777 " HEADER);
}
/**
* Print an error message and exit with a failure code.
*
* @param error_message An error message ending with a newline and null char.
*/
void error_and_exit(char* error_message)
{
fputs(error_message, stderr);
cleanup();
exit(EXIT_FAILURE);
}
/**
* Execute a command, and exit with an error message if unsuccessful.
*
* @param args A null-terminated array of arguments to pass to exec.
* @param input_file The input file path (defaults to stdin).
* @param output_file The output file path (defaults to stdout).
*/
void run_command(char* args[], char* input_file, char* output_file)
{
pid_t process_id = fork();
if (process_id == 0) {
if (input_file && freopen(input_file, "r", stdin) == NULL) {
error_and_exit("freopen failed for input file\n");
}
if (output_file && freopen(output_file, "w", stdout) == NULL) {
error_and_exit("freopen failed for output file\n");
}
execv(args[0], args);
} else if (process_id > 0) {
int exit_status;
wait(&exit_status);
if (!WIFEXITED(exit_status)) {
error_and_exit("Command did not terminate normally\n");
} else if (WEXITSTATUS(exit_status)) {
error_and_exit("Command exited with non-zero code\n");
}
} else {
fprintf(stderr, "[error] Failed to fork process, aborting\n");
exit(EXIT_FAILURE);
}
}
int main(void)
{
puts("Input the function body below (Enter, then Ctrl-D when done):");
run_command((char*[]) {CAT, NULL}, NULL, BODY);
run_command((char*[]) {SED, "-i",
"s/\\/\\/ INPUT GOES HERE/cat " BODY "/e",
HEADER, NULL}, NULL, NULL);
run_command((char*[]) {GCC, "-E", HEADER, "-o", PREPROCESSED, NULL}, NULL,
NULL);
run_command((char*[]) {PYTHON, CHECK_SYNTAX, FUNCTION, ALLOWED_OPS, MAX_OPS,
NULL}, PREPROCESSED, NULL);
run_command((char*[]) {GCC, "-O3", "-o", CHECK_CORRECTNESS,
CHECK_CORRECTNESS_SRC, NULL}, NULL, NULL);
run_command((char*[]) {"./" CHECK_CORRECTNESS, NUM_RANDOM_TESTS, NULL}, NULL,
NULL);
puts("All tests passed! Here's the flag:");
run_command((char*[]) {CAT, FLAG, NULL}, NULL, NULL);
cleanup();
return 0;
}
|
the_stack_data/151704518.c | /*Exercise 3 - Repetition
Write a C program to calculate the sum of the numbers from 1 to n.
Where n is a keyboard input.
e.g.
n -> 100
sum = 1+2+3+....+ 99+100 = 5050
n -> 1-
sum = 1+2+3+...+10 = 55 */
#include <stdio.h>
int main() {
int n;
int number;
int total;
//initialization phase
number=1;
total=0;
printf("\n\nEnter value(integer) of \"n\": ");
scanf("%d",&n);
//processing phase
while(number!=n+1){
total=total+number;
number++;
}//end while loop
//termination phase
printf("\n\nSum of the numbers from 1 to %d: %d",n,total);
return 0;
}
|
the_stack_data/548284.c | // Tests whethera number is prime
#include <stdbool.h> // C99 only
#include <stdio.h>
bool is_prime(int n)
{
int divisor;
if (n <= 1)
{
return false;
}
for ( divisor = 2; divisor*divisor <= n; divisor++)
{
if (n%divisor == 0)
{
return false;
}
}
return true;
}
main()
{
int n;
printf("Enter a number : ");
scanf_s("%d", &n);
if (is_prime(n))
{
printf("Prime");
}
else
{
printf("Not prime");
}
} |
the_stack_data/234519339.c | #ifdef ANDROID
#include <unistd.h>
#include <jni.h>
#include <android/log.h>
#include "SDL_thread.h"
#include "SDL_main.h"
/* JNI-C wrapper stuff */
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif
#ifndef SDL_JAVA_PACKAGE_PATH
#error You have to define SDL_JAVA_PACKAGE_PATH to your package path with dots replaced with underscores, for example "com_example_SanAngeles"
#endif
#define JAVA_EXPORT_NAME2(name,package) Java_##package##_##name
#define JAVA_EXPORT_NAME1(name,package) JAVA_EXPORT_NAME2(name,package)
#define JAVA_EXPORT_NAME(name) JAVA_EXPORT_NAME1(name,SDL_JAVA_PACKAGE_PATH)
extern C_LINKAGE void
JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz, jstring currentDirectoryPath_j, jboolean ws, jboolean dr )
{
int argc = 1;
char *argv[4] = { "sdl", NULL, NULL, NULL };
if (ws) argv[argc++] = "--wide";
if (dr) argv[argc++] = "--disable-rescale";
// Set current directory
const char *currentDirectoryPath = (*env)->GetStringUTFChars(env, currentDirectoryPath_j, 0);
chdir(currentDirectoryPath);
(*env)->ReleaseStringUTFChars(env, currentDirectoryPath_j, currentDirectoryPath);
SDL_main( argc, argv );
};
#undef JAVA_EXPORT_NAME
#undef JAVA_EXPORT_NAME1
#undef JAVA_EXPORT_NAME2
#undef C_LINKAGE
#endif
|
the_stack_data/893870.c | /** CAB403 - Systems Programming
* Group 81 - DS Assignment
* Quang Huy Tran - n10069275
* Tuan Minh Nguyen -
* Ho Fong Law - n1010321
* */
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#define MAX 1024
int isRunning;
int socket_fd;
void sig_handler(int sig){
if(isRunning == 0){
printf("Client has been successfully unregistered, closing.\n");
exit(0);
} else{
isRunning = 0;
write(socket_fd,&isRunning,sizeof(isRunning));
}
}
int main(int argc, char *argv[]) {
//int socket_fd;
int port;
struct hostent *server_host;
struct sockaddr_in server_address;
if (argc == 2)
{
port = 12345;
fprintf(stderr, "Using default port:12345\n");
}
else if(argc==3){
port = atoi(argv[2]);
}
else if (argc > 3){
//port = atoi(argv[2]);
fprintf(stderr, "Port number needed\n");
exit(1);
}
if ((server_host = gethostbyname(argv[1])) == NULL)
{ /* get the host info */
perror("gethostbyname");
exit(1);
}
/* Initialise IPv4 server address with server host. */
server_address.sin_family = AF_INET;
server_address.sin_port = htons(port);
server_address.sin_addr.s_addr = INADDR_ANY;
bzero(&(server_address.sin_zero),8);
/* Create TCP socket. */
if ((socket_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
}
/* Connect to socket with server address. */
if (connect(socket_fd, (struct sockaddr *)&server_address, sizeof server_address) == -1) {
perror("connect");
exit(1);
}
/* TODO: Put server interaction code here. For example, use
* write(socket_fd,,) and read(socket_fd,,) to send and receive messages
* with the client.
*/
char buff[MAX];
char messages[MAX];
int channel_id;
signal(SIGINT,sig_handler);
for(;;) {
memset(buff,'\0',sizeof(buff));
memset(messages,'\0',sizeof(messages));
printf("Commands: \n\
SUB <channelID> -- to subscribe to channel (0-255) \n\
UNSUB <channelID> - to unsubscribe to channel (0-255) \n\
SEND <channelID> <message> - to send the message to a given channel \n\
NEXT <channelID> - to display the next unread message on a given channel\n\
NEXT - display the next unread messages on all subscribed channles\n\
LIVEFEED <channelID> - to display messages continuously in a given channel \n\
LIVEFEED - to display messages continously across all channels\n\
BYE - to exit the connection with server \n\n:");
scanf("%s",messages);
write(socket_fd, messages, sizeof(messages));
if(strcmp(messages,"SUB") == 0 || strcmp(messages,"UNSUB") == 0 || strcmp(messages,"NEXT") == 0 || strcmp(messages,"LIVEFEED") == 0 || strcmp(messages,"SEND") == 0 || strcmp(messages,"CHANNELS") == 0){
fgets(buff,MAX,stdin);
if (sscanf(buff,"%d",&channel_id) == 1)
{
printf("%d\n",channel_id);
write(socket_fd,&channel_id,sizeof(channel_id));
if(strcmp(messages,"SEND") == 0){
char *send_message = (char *)malloc(sizeof(char) * 1024);
if(sscanf(buff,"%[^\n]%*c", send_message) == 1){
send_message+=3;
printf("%s\n",send_message);
write(socket_fd,send_message,1024);
}
}
if(strcmp(messages,"LIVEFEED") == 0){
printf("I'm feeding\n");
// Send isRunning = 1
// While (signal)
char *read_message = (char *)malloc(sizeof(char) * 1024);
isRunning = 1;
// do{
// write(socket_fd,&isRunning,sizeof(isRunning));
while(isRunning==1){
//write(socket_fd, "NEXT", sizeof("NEXT"));
while(read(socket_fd, read_message, 1024) != -1){
printf("%s\n",read_message);
}
}
// } while(isRunning == 1);
}
}
else{
channel_id = 265;
if(strcmp(messages,"CHANNELS") == 0){
printf("Channel Total Read Unread\n");
}
write(socket_fd,&channel_id,sizeof(channel_id));
}
}
if ((strncmp(messages,"BYE", 4)) == 0) {
printf("Client Exit...\n");
close(socket_fd);
return 0;
}
memset(buff,'\0',sizeof(buff));
memset(messages,'\0',sizeof(messages));
read(socket_fd, messages, 1024);
printf("%s", messages);
}
close(socket_fd);
return 0;
}
|
the_stack_data/151705690.c | #include<stdio.h>
int main ( void ) {
int numeroDaConta;
float saldoInicial, totalEncargos, totalCreditos, limiteDeCredito, novoSaldo;
while(1) {
printf("\nInforme o numero da conta(-1 para terminar): ");
scanf("%d", &numeroDaConta);
if(numeroDaConta == -1) break;
printf("Informe o saldo inicial: ");
scanf("%f", &saldoInicial);
printf("Informe o total de encargos: ");
scanf("%f", &totalEncargos);
printf("Informe o total de creditos: ");
scanf("%f", &totalCreditos);
printf("Informe o limite de creditos: ");
scanf("%f", &limiteDeCredito);
printf("\n");
novoSaldo = saldoInicial + totalEncargos - totalCreditos;
if( novoSaldo > limiteDeCredito) {
printf("Conta: %d", numeroDaConta);
printf("\nLimite de credito: %f", limiteDeCredito);
printf("\nSaldo: %f", novoSaldo);
printf("\nLimite de creditos ultrapassado");
printf("\n");
}
}
}
|
the_stack_data/148577439.c | /************************************************************************/
/* */
/* Board_Data.c -- Board Customization Data for Digilent Cerebot MX4cK */
/* */
/************************************************************************/
/* Author: Gene Apperson */
/* Copyright 2011, Digilent. All rights reserved */
/************************************************************************/
/* File Description: */
/* */
/* This file contains the board specific declartions and data structure */
/* to customize the chipKIT MPIDE for use with the Digilent Cerebot */
/* MX4cK board. */
/* */
/* This code is based on earlier work: */
/* Copyright (c) 2010, 2011 by Mark Sproul */
/* Copyright (c) 2005, 2006 by David A. Mellis */
/* */
/************************************************************************/
/* Revision History: */
/* */
/* 11/28/2011(GeneA): Created by splitting data out of Board_Defs.h */
/* 11/15/2013(KeithV): This file applies to the chipKIT Pro MX4 also */
/* */
/************************************************************************/
//* This 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.
//*
//* This library is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//* Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU Lesser General
//* Public License along with this library; if not, write to the
//* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
//* Boston, MA 02111-1307 USA
/************************************************************************/
#if !defined(BOARD_DATA_C)
#define BOARD_DATA_C
#include <inttypes.h>
/* ------------------------------------------------------------ */
/* Data Tables */
/* ------------------------------------------------------------ */
/* The following declarations define data used in pin mapping. */
/* ------------------------------------------------------------ */
#if defined(OPT_BOARD_DATA)
/* ------------------------------------------------------------ */
/* This table is used to map from port number to the address of
** the TRIS register for the port. This is used for setting the
** pin direction.
*/
const uint32_t port_to_tris_PGM[] = {
NOT_A_PORT, //index value 0 is not used
#if defined(_PORTA)
(uint32_t)&TRISA,
#else
NOT_A_PORT,
#endif
#if defined(_PORTB)
(uint32_t)&TRISB,
#else
NOT_A_PORT,
#endif
#if defined(_PORTC)
(uint32_t)&TRISC,
#else
NOT_A_PORT,
#endif
#if defined(_PORTD)
(uint32_t)&TRISD,
#else
NOT_A_PORT,
#endif
#if defined(_PORTE)
(uint32_t)&TRISE,
#else
NOT_A_PORT,
#endif
#if defined(_PORTF)
(uint32_t)&TRISF,
#else
NOT_A_PORT,
#endif
#if defined(_PORTG)
(uint32_t)&TRISG,
#else
NOT_A_PORT,
#endif
NOT_A_PORT,
};
/* ------------------------------------------------------------ */
/* This table is used to map the digital pin number to the port
** containing that pin.
*/
const uint8_t digital_pin_to_port_PGM[] = {
// Connector JA
_IOPORT_PE, // 0 RE0 PMD0
_IOPORT_PE, // 1 RE1 PMD1
_IOPORT_PE, // 2 RE2 PMD2
_IOPORT_PE, // 3 RE3 PMD3
_IOPORT_PE, // 4 RE4 PMD4
_IOPORT_PE, // 5 RE5 PMD5
_IOPORT_PE, // 6 RE6 PMD6
_IOPORT_PE, // 7 RE7 PMD7
// Connector JB
_IOPORT_PG, // 8 RG9 PMA2/SS2/CN11/RG9
_IOPORT_PG, // 9 RG8 PMA3/SDO2/CN10/RG8
_IOPORT_PG, // 10 RG7 PMA4/SDI2/CN9/RG7
_IOPORT_PG, // 11 RG6 PMA5/SCK2/CN8/RG6
_IOPORT_PB, // 12 RB15 PMALL/PMA0/AN15/OCFB/CN12/RB15 or SCL1/INT3/RA14 (Selected with JP3)
_IOPORT_PD, // 13 RD5 PMRD/CN14/RD5
_IOPORT_PD, // 14 RD4 PMWR/OC5/CN13
_IOPORT_PB, // 15 RB14 PMALH/PMA1/AN14/RB14
// Connector JC
_IOPORT_PG, // 16 RG12 TRD1/RG12 (S1)
_IOPORT_PG, // 17 RG13 TRD0/RG13 (S2)
_IOPORT_PG, // 18 RG14 TRD2/RG14 (S3)
_IOPORT_PG, // 19 RG15 RG15 (S4)
_IOPORT_PG, // 20 RG0 PMD8/RG0 (S5)
_IOPORT_PG, // 21 RG1 PMD9/RG1 (S6)
_IOPORT_PF, // 22 RF0 PMD11/RF0 (S7)
_IOPORT_PF, // 23 RF1 PMD10/RF1 (S8)
// Connector JD
_IOPORT_PD, // 24 RD7 PMD15/CN16/RD7
_IOPORT_PD, // 25 RD1 OC2/RD1
_IOPORT_PD, // 26 RD9 TC2/SS1/RD9
_IOPORT_PC, // 27 RC1 T2CK/RC1
_IOPORT_PD, // 28 RD6 PMD14/CN15/RD6
_IOPORT_PD, // 29 RD2 OC3/RD2
_IOPORT_PD, // 30 RD10 IC3/SCK1/PMCS2/PMA15/RD10
_IOPORT_PC, // 31 RC2 T3CK/RC2
// Connector JE
_IOPORT_PD, // 32 RD14 CN20/U1CTS/RD14
_IOPORT_PF, // 33 RF8 U1TX/RF8
_IOPORT_PF, // 34 RF2 U1RX/RF2
_IOPORT_PD, // 35 RD15 U1RTS/BCLK1/CN21/RD15
_IOPORT_PE, // 36 RE9 INT2/RE9
_IOPORT_PD, // 37 RD3 OC4/RD3
_IOPORT_PD, // 38 RD11 IC4/PMCS1/PMA14/RD11
_IOPORT_PC, // 39 RC3 T4CK/RC3
// Connector JF
_IOPORT_PA, // 40 RA14 SCL1/INT3/RA14
_IOPORT_PA, // 41 RA15 SDA1/INT4/RA15
_IOPORT_PA, // 42 RA6 TRCLK/RA6 (BTN1)
_IOPORT_PA, // 43 RA7 TRD3/RA7 (BTN2)
_IOPORT_PA, // 44 RA0 TMS/RA0
_IOPORT_PA, // 45 RA1 TCK/RA1
_IOPORT_PA, // 46 RA4 TDI/RA4
_IOPORT_PA, // 47 RA5 TDO/RA5
// Connector JH
_IOPORT_PF, // 48 RF12 U2CTS/RF12
_IOPORT_PF, // 49 RF5 PMA8/U2TX/CN18/RF5
_IOPORT_PF, // 50 RF4 PMA9/U2RX/CN17/RF4
_IOPORT_PF, // 51 RF13 U2RTS/BCLK2/RF13
_IOPORT_PE, // 52 RE8 INT1/RE8
_IOPORT_PD, // 53 RD0 SDO1/OC1/INT0/RD0
_IOPORT_PD, // 54 RD8 IC1/RTCC/RD8
_IOPORT_PD, // 55 RD13 PMD13/CN19/RD13
// Connector JJ
_IOPORT_PB, // 56 RB0 PGD1/FMUD1/AN0/CN2/RB0
_IOPORT_PB, // 57 RB1 PGC1/FMUC1/AN1/CN3/RB1
_IOPORT_PB, // 58 RB2 C2IN-/AN2/CN4/RB2
_IOPORT_PB, // 59 RB3 C2IN+/AN3/CN5/RB3
_IOPORT_PB, // 60 RB4 C1IN-/AN4/CN6/RB4
_IOPORT_PB, // 61 RB5 C1IN+/AN5/CN7/RB5
_IOPORT_PB, // 62 RB8 C1OUT/AN8/RB8
_IOPORT_PB, // 63 RB9 C2OUT/AN9/RB9
// Connector JK
_IOPORT_PB, // 64 RB10 CVREFOUT/PMA13/AN10/RB10 (LD1)
_IOPORT_PB, // 65 RB11 PMA12/AN11/RB11 (LD2)
_IOPORT_PB, // 66 RB12 PMA11/AN12/RB12 (LD3)
_IOPORT_PB, // 67 RB13 PMA10/AN13/RB13 (LD4)
_IOPORT_PA, // 68 RA9 PMA7/VREF-/CVREF-/RA9
_IOPORT_PA, // 69 RA10 PMA6/VREF+/CVREF+/RA10
_IOPORT_PD, // 70 RD12 PMD12/IC5/RD12
_IOPORT_PC, // 71 RC4 SDI1/T5CK/RC4
//J6 /I2C PORT 2
_IOPORT_PA, // 72 RA2 SCL2/RA2
_IOPORT_PA // 73 RA3 SDA2/RA3
};
/* ------------------------------------------------------------ */
/* This table is used to map from digital pin number to a bit mask
** for the corresponding bit within the port.
*/
const uint16_t digital_pin_to_bit_mask_PGM[] = {
// Connector JA
_BV( 0 ) , // 0 RE 0 PMD0
_BV( 1 ) , // 1 RE 1 PMD1
_BV( 2 ) , // 2 RE 2 PMD2
_BV( 3 ) , // 3 RE 3 PMD3
_BV( 4 ) , // 4 RE 4 PMD4
_BV( 5 ) , // 5 RE 5 PMD5
_BV( 6 ) , // 6 RE 6 PMD6
_BV( 7 ) , // 7 RE 7 PMD7
// Connector JB
_BV( 9 ) , // 8 RG9 PMA2/SS2/CN11/RG9
_BV( 8 ) , // 9 RG8 PMA3/SDO2/CN10/RG8
_BV( 7 ) , // 10 RG7 PMA4/SDI2/CN9/RG7
_BV( 6 ) , // 11 RG6 PMA5/SCK2/CN8/RG6
_BV( 15 ) , // 12 RB15 PMALL/PMA0/AN15/OCFB/CN12/RB15 or SCL1/INT3/RA14 (Selected with JP3)
_BV( 5 ) , // 13 RD5 PMRD/CN14/RD5
_BV( 4 ) , // 14 RD4 PMWR/OC5/CN13
_BV( 14 ) , // 15 RB14 PMALH/PMA1/AN14/RB14
// Connector JC
_BV( 12 ) , // 16 RG12 TRD1/RG12
_BV( 13 ) , // 17 RG13 TRD0/RG13
_BV( 14 ) , // 18 RG14 TRD2/RG14
_BV( 15 ) , // 19 RG15 RG15
_BV( 0 ) , // 20 RG0 PMD8/RG0
_BV( 1 ) , // 21 RG1 PMD9/RG1
_BV( 0 ) , // 22 RF0 PMD11/RF0
_BV( 1 ) , // 23 RF1 PMD10/RF1
// Connector JD
_BV( 7 ) , // 24 RD7 PMD15/CN16/RD7
_BV( 1 ) , // 25 RD1 OC2/RD1
_BV( 9 ) , // 26 RD9 TC2/SS1/RD9
_BV( 1 ) , // 27 RC1 T2CK/RC1
_BV( 6 ) , // 28 RD6 PMD14/CN15/RD6
_BV( 2 ) , // 29 RD2 OC3/RD2
_BV( 10 ) , // 30 RD10 IC3/SCK1/PMCS2/PMA15/RD10
_BV( 2 ) , // 31 RC2 T3CK/RC2
// Connector JE
_BV( 14 ) , // 32 RD14 CN20/U1CTS/RD14
_BV( 8 ) , // 33 RF8 U1TX/RF8
_BV( 2 ) , // 34 RF2 U1RX/RF2
_BV( 15 ) , // 35 RD15 U1RTS/BCLK1/CN21/RD15
_BV( 9 ) , // 36 RE9 INT2/RE9
_BV( 3 ) , // 37 RD3 OC4/RD3
_BV( 11 ) , // 38 RD11 IC4/PMCS1/PMA14/RD11
_BV( 3 ) , // 39 RC3 T4CK/RC3
// Connector JF
_BV( 14 ) , // 40 RA14 SCL1/INT3/RA14
_BV( 15 ) , // 41 RA15 SDA1/INT4/RA15
_BV( 6 ) , // 42 RA6 TRCLK/RA6
_BV( 7 ) , // 43 RA7 TRD3/RA7
_BV( 0 ) , // 44 RA0 TMS/RA0
_BV( 1 ) , // 45 RA1 TCK/RA1
_BV( 4 ) , // 46 RA4 TDI/RA4
_BV( 5 ) , // 47 RA5 TDO/RA5
// Connector JH
_BV( 12 ) , // 48 RF12 U2CTS/RF12
_BV( 5 ) , // 49 RF5 PMA8/U2TX/CN18/RF5
_BV( 4 ) , // 50 RF4 PMA9/U2RX/CN17/RF4
_BV( 13 ) , // 51 RF13 U2RTS/BCLK2/RF13
_BV( 8 ) , // 52 RE8 INT1/RE8
_BV( 0 ) , // 53 RD0 SDO1/OC1/INT0/RD0
_BV( 8 ) , // 54 RD8 IC1/RTCC/RD8
_BV( 13 ) , // 55 RD13 PMD13/CN19/RD13
// Connector JJ
_BV( 0 ) , // 56 RB0 PGD1/FMUD1/AN0/CN2/RB0
_BV( 1 ) , // 57 RB1 PGC1/FMUC1/AN1/CN3/RB1
_BV( 2 ) , // 58 RB2 C2IN-/AN2/CN4/RB2
_BV( 3 ) , // 59 RB3 C2IN+/AN3/CN5/RB3
_BV( 4 ) , // 60 RB4 C1IN-/AN4/CN6/RB4
_BV( 5 ) , // 61 RB5 C1IN+/AN5/CN7/RB5
_BV( 8 ) , // 62 RB8 C1OUT/AN8/RB8
_BV( 9 ) , // 63 RB9 C2OUT/AN9/RB9
// Connector JK
_BV( 10 ) , // 64 RB10 CVREFOUT/PMA13/AN10/RB10
_BV( 11 ) , // 65 RB11 PMA12/AN11/RB11
_BV( 12 ) , // 66 RB12 PMA11/AN12/RB12
_BV( 13 ) , // 67 RB11 PMA10/AN13/RB13
_BV( 9 ) , // 68 RA9 PMA7/VREF-/CVREF-/RA9
_BV( 10 ) , // 69 RA10 PMA6/VREF+/CVREF+/RA10
_BV( 12 ) , // 70 RD12 PMD12/IC5/RD12
_BV( 4 ) , // 71 RC4 SDI1/T5CK/RC4
//J6 /I2C PORT 2
_BV( 2 ) , // 72 RA2 SCL2/RA2
_BV( 3 ) // 73 RA3 SDA2/RA3
};
/* ------------------------------------------------------------ */
/* This table is used to map from digital pin number to the output
** compare number, input capture number, and timer external clock
** input associated with that pin.
*/
const uint16_t digital_pin_to_timer_PGM[] = {
// Connector JA
NOT_ON_TIMER, // 0 RE 0 PMD0
NOT_ON_TIMER, // 1 RE 1 PMD1
NOT_ON_TIMER, // 2 RE 2 PMD2
NOT_ON_TIMER, // 3 RE 3 PMD3
NOT_ON_TIMER, // 4 RE 4 PMD4
NOT_ON_TIMER, // 5 RE 5 PMD5
NOT_ON_TIMER, // 6 RE 6 PMD6
NOT_ON_TIMER, // 7 RE 7 PMD7
// Connector JB
NOT_ON_TIMER, // 8 RG9 PMA2/SS2/CN11/RG9
NOT_ON_TIMER, // 9 RG8 PMA3/SDO2/CN10/RG8
NOT_ON_TIMER, // 10 RG7 PMA4/SDI2/CN9/RG7
NOT_ON_TIMER, // 11 RG6 PMA5/SCK2/CN8/RG6
NOT_ON_TIMER, // 12 RB15 PMALL/PMA0/AN15/OCFB/CN12/RB15 or SCL1/INT3/RA14 (Selected with JP3)
NOT_ON_TIMER, // 13 RD5 PMRD/CN14/RD5
_TIMER_OC5, // 14 RD4 PMWR/OC5/CN13
NOT_ON_TIMER, // 15 RB14 PMALH/PMA1/AN14/RB14
// Connector JC
NOT_ON_TIMER, // 16 RG12 TRD1/RG12
NOT_ON_TIMER, // 17 RG13 TRD0/RG13
NOT_ON_TIMER, // 18 RG14 TRD2/RG14
NOT_ON_TIMER, // 19 RG15 RG15
NOT_ON_TIMER, // 20 RG0 PMD8/RG0
NOT_ON_TIMER, // 21 RG1 PMD9/RG1
NOT_ON_TIMER, // 22 RF0 PMD11/RF0
NOT_ON_TIMER, // 23 RF1 PMD10/RF1
// Connector JD
NOT_ON_TIMER, // 24 RD7 PMD15/CN16/RD7
_TIMER_OC2, // 25 RD1 OC2/RD1
_TIMER_IC2, // 26 RD9 IC2/SS1/RD9
_TIMER_TCK2, // 27 RC1 T2CK/RC1
NOT_ON_TIMER, // 28 RD6 PMD14/CN15/RD6
_TIMER_OC3, // 29 RD2 OC3/RD2
_TIMER_IC3, // 30 RD10 IC3/SCK1/PMCS2/PMA15/RD10
_TIMER_TCK3, // 31 RC2 T3CK/RC2
// Connector JE
NOT_ON_TIMER, // 32 RD14 CN20/U1CTS/RD14
NOT_ON_TIMER, // 33 RF8 U1TX/RF8
NOT_ON_TIMER, // 34 RF2 U1RX/RF2
NOT_ON_TIMER, // 35 RD15 U1RTS/BCLK1/CN21/RD15
NOT_ON_TIMER, // 36 RE9 INT2/RE9
_TIMER_OC4, // 37 RD3 OC4/RD3
_TIMER_IC4, // 38 RD11 IC4/PMCS1/PMA14/RD11
_TIMER_TCK4, // 39 RC3 T4CK/RC3
// Connector JF
NOT_ON_TIMER, // 40 RD14 SCL1/INT3/RA14
NOT_ON_TIMER, // 41 RA15 SDA1/INT4/RA15
NOT_ON_TIMER, // 42 RA6 TRCLK/RA6
NOT_ON_TIMER, // 43 RA7 TRD3/RA7
NOT_ON_TIMER, // 44 RA0 TMS/RA0
NOT_ON_TIMER, // 45 RA1 TCK/RA1
NOT_ON_TIMER, // 46 RA4 TDI/RA4
NOT_ON_TIMER, // 47 RA5 TDO/RA5
// Connector JH
NOT_ON_TIMER, // 48 RF12 U2CTS/RF12
NOT_ON_TIMER, // 49 RF5 PMA8/U2TX/CN18/RF5
NOT_ON_TIMER, // 50 RF4 PMA9/U2RX/CN17/RF4
NOT_ON_TIMER, // 51 RF13 U2RTS/BCLK2/RF13
NOT_ON_TIMER, // 52 RE8 INT1/RE8
_TIMER_OC1, // 53 RD0 SDO1/OC1/INT0/RD0
_TIMER_IC1, // 54 RD8 IC1/RTCC/RD8
NOT_ON_TIMER, // 55 RD13 PMD13/CN19/RD13
// Connector JJ
NOT_ON_TIMER, // 56 RB0 PGD1/FMUD1/AN0/CN2/RB0
NOT_ON_TIMER, // 57 RB1 PGC1/FMUC1/AN1/CN3/RB1
NOT_ON_TIMER, // 58 RB2 C2IN-/AN2/CN4/RB2
NOT_ON_TIMER, // 59 RB3 C2IN+/AN3/CN5/RB3
NOT_ON_TIMER, // 60 RB4 C1IN-/AN4/CN6/RB4
NOT_ON_TIMER, // 61 RB5 C1IN+/AN5/CN7/RB5
NOT_ON_TIMER, // 62 RB8 C1OUT/AN8/RB8
NOT_ON_TIMER, // 63 RB9 C2OUT/AN9/RB9
// Connector JK
NOT_ON_TIMER, // 64 RB10 CVREFOUT/PMA13/AN10/RB10
NOT_ON_TIMER, // 65 RB11 PMA12/AN11/RB11
NOT_ON_TIMER, // 66 RB12 PMA11/AN12/RB12
NOT_ON_TIMER, // 67 RB13 PMA10/AN13/RB13
NOT_ON_TIMER, // 68 RA9 PMA7/VREF-/CVREF-/RA9
NOT_ON_TIMER, // 69 RA10 PMA6/VREF+/CVREF+/RA10
_TIMER_IC5, // 70 RD12 PMD12/IC5/RD12
_TIMER_TCK5, // 71 RC4 SDI1/T5CK/RC4
//J6 /I2C PORT 2
NOT_ON_TIMER, // 72 RA2 SCL2/RA2
NOT_ON_TIMER // 73 RA3 SDA2/RA3
};
/* ------------------------------------------------------------ */
/* This table maps from a digital pin number to the corresponding
** analog pin number.
*/
const uint8_t digital_pin_to_analog_PGM[] = {
// Connector JA
NOT_ANALOG_PIN, // 0 RE 0 PMD0
NOT_ANALOG_PIN, // 1 RE 1 PMD1
NOT_ANALOG_PIN, // 2 RE 2 PMD2
NOT_ANALOG_PIN, // 3 RE 3 PMD3
NOT_ANALOG_PIN, // 4 RE 4 PMD4
NOT_ANALOG_PIN, // 5 RE 5 PMD5
NOT_ANALOG_PIN, // 6 RE 6 PMD6
NOT_ANALOG_PIN, // 7 RE 7 PMD7
// Connector JB
NOT_ANALOG_PIN, // 8 RG9 PMA2/SS2/CN11/RG9
NOT_ANALOG_PIN, // 9 RG8 PMA3/SDO2/CN10/RG8
NOT_ANALOG_PIN, // 10 RG7 PMA4/SDI2/CN9/RG7
NOT_ANALOG_PIN, // 11 RG6 PMA5/SCK2/CN8/RG6
_BOARD_AN12, // 12 RB15 PMALL/PMA0/AN15/OCFB/CN12/RB15
NOT_ANALOG_PIN, // 13 RD5 PMRD/CN14/RD5
NOT_ANALOG_PIN, // 14 RD4 PMWR/OC5/CN13
_BOARD_AN13, // 15 RB14 PMALH/PMA1/AN14/RB14
// Connector JC
NOT_ANALOG_PIN, // 16 RG12 TRD1/RG12
NOT_ANALOG_PIN, // 17 RG13 TRD0/RG13
NOT_ANALOG_PIN, // 18 RG14 TRD2/RG14
NOT_ANALOG_PIN, // 19 RG15 RG15
NOT_ANALOG_PIN, // 20 RG0 PMD8/RG0
NOT_ANALOG_PIN, // 21 RG1 PMD9/RG1
NOT_ANALOG_PIN, // 22 RF0 PMD11/RF0
NOT_ANALOG_PIN, // 23 RF1 PMD10/RF1
// Connector JD
NOT_ANALOG_PIN, // 24 RD7 PMD15/CN16/RD7
NOT_ANALOG_PIN, // 25 RD1 OC2/RD1
NOT_ANALOG_PIN, // 26 RD9 TC2/SS1/RD9
NOT_ANALOG_PIN, // 27 RC1 T2CK/RC1
NOT_ANALOG_PIN, // 28 RD6 PMD14/CN15/RD6
NOT_ANALOG_PIN, // 29 RD2 OC3/RD2
NOT_ANALOG_PIN, // 30 RD10 IC3/SCK1/PMCS2/PMA15/RD10
NOT_ANALOG_PIN, // 31 RC2 T3CK/RC2
// Connector JE
NOT_ANALOG_PIN, // 32 RD14 CN20/U1CTS/RD14
NOT_ANALOG_PIN, // 33 RF8 U1TX/RF8
NOT_ANALOG_PIN, // 34 RF2 U1RX/RF2
NOT_ANALOG_PIN, // 35 RD15 U1RTS/BCLK1/CN21/RD15
NOT_ANALOG_PIN, // 36 RE9 INT2/RE9
NOT_ANALOG_PIN, // 37 RD3 OC4/RD3
NOT_ANALOG_PIN, // 38 RD11 IC4/PMCS1/PMA14/RD11
NOT_ANALOG_PIN, // 39 RC3 T4CK/RC3
// Connector JF
NOT_ANALOG_PIN, // 40 RD14 SCL1/INT3/RA14
NOT_ANALOG_PIN, // 41 RA15 SDA1/INT4/RA15
NOT_ANALOG_PIN, // 42 RA6 TRCLK/RA6
NOT_ANALOG_PIN, // 43 RA7 TRD3/RA7
NOT_ANALOG_PIN, // 44 RA0 TMS/RA0
NOT_ANALOG_PIN, // 45 RA1 TCK/RA1
NOT_ANALOG_PIN, // 46 RA4 TDI/RA4
NOT_ANALOG_PIN, // 47 RA5 TDO/RA5
// Connector JH
NOT_ANALOG_PIN, // 48 RF12 U2CTS/RF12
NOT_ANALOG_PIN, // 49 RF5 PMA8/U2TX/CN18/RF5
NOT_ANALOG_PIN, // 50 RF4 PMA9/U2RX/CN17/RF4
NOT_ANALOG_PIN, // 51 RF13 U2RTS/BCLK2/RF13
NOT_ANALOG_PIN, // 52 RE8 INT1/RE8
NOT_ANALOG_PIN, // 53 RD0 SDO1/OC1/INT0/RD0
NOT_ANALOG_PIN, // 54 RD8 IC1/RTCC/RD8
NOT_ANALOG_PIN, // 55 RD13 PMD13/CN19/RD13
// Connector JJ
_BOARD_AN0, // 56 RB0 PGD1/FMUD1/AN0/CN2/RB0
_BOARD_AN1, // 57 RB1 PGC1/FMUC1/AN1/CN3/RB1
_BOARD_AN2, // 58 RB2 C2IN-/AN2/CN4/RB2
_BOARD_AN3, // 59 RB3 C2IN+/AN3/CN5/RB3
_BOARD_AN4, // 60 RB4 C1IN-/AN4/CN6/RB4
_BOARD_AN5, // 61 RB5 C1IN+/AN5/CN7/RB5
_BOARD_AN6, // 62 RB8 C1OUT/AN8/RB8
_BOARD_AN7, // 63 RB9 C2OUT/AN9/RB9
// Connector JK
_BOARD_AN8, // 64 RB10 CVREFOUT/PMA13/AN10/RB10
_BOARD_AN9, // 65 RB11 PMA12/AN11/RB11
_BOARD_AN10, // 66 RB12 PMA11/AN12/RB12
_BOARD_AN11, // 67 RB13 PMA10/AN13/RB13
NOT_ANALOG_PIN, // 68 RA9 PMA7/VREF-/CVREF-/RA9
NOT_ANALOG_PIN, // 69 RA10 PMA6/VREF+/CVREF+/RA10
NOT_ANALOG_PIN, // 70 RD12 PMD12/IC5/RD12
NOT_ANALOG_PIN, // 71 RC4 SDI1/T5CK/RC4
//J6 /I2C PORT 2
NOT_ANALOG_PIN, // 72 RA2 SCL2/RA2
NOT_ANALOG_PIN // 73 RA3 SDA2/RA3
};
/* ------------------------------------------------------------ */
/* This table is used to map from the analog pin number to the
** actual A/D converter channel used for that pin.
*/
const uint8_t analog_pin_to_channel_PGM[] =
{
//* chipKIT Pin PIC32 Analog channel
0, //* A0 AN0
1, //* A1 AN1
2, //* A2 AN2
3, //* A3 AN3
4, //* A4 AN4
5, //* A5 AN5
8, //* A6 AN8
9, //* A7 AN9
10, //* A8 AN10
11, //* A9 AN11
12, //* A10 AN12
13, //* A11 AN13
15, //* A12 AN15
14 //* A13 AN14
};
/* ------------------------------------------------------------ */
/* Board Customization Functions */
/* ------------------------------------------------------------ */
/* */
/* The following can be used to customize the behavior of some */
/* of the core API functions. These provide hooks that can be */
/* used to extend or replace the default behavior of the core */
/* functions. To use one of these functions, add the desired */
/* code to the function skeleton below and then set the value */
/* of the appropriate compile switch above to 1. This will */
/* cause the hook function to be compiled into the build and */
/* to cause the code to call the hook function to be compiled */
/* into the appropriate core function. */
/* */
/* ------------------------------------------------------------ */
/*** _board_init
**
** Parameters:
** none
**
** Return Value:
** none
**
** Errors:
** none
**
** Description:
** This function is called from the core init() function.
** This can be used to perform any board specific init
** that needs to be done when the processor comes out of
** reset and before the user sketch is run.
*/
#if (OPT_BOARD_INIT != 0)
void _board_init(void) {
}
#endif
/* ------------------------------------------------------------ */
/*** _board_pinMode
**
** Parameters:
** pin - digital pin number to configure
** mode - mode to which the pin should be configured
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the pinMode
** function. It can perform any special processing needed
** when setting the pin mode. If this function returns zero,
** control will pass through the normal pinMode code. If
** it returns a non-zero value the normal pinMode code isn't
** executed.
*/
#if (OPT_BOARD_DIGITAL_IO != 0)
int _board_pinMode(uint8_t pin, uint8_t mode) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_getPinMode
**
** Parameters:
** pin - digital pin number
** mode - pointer to variable to receive mode value
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the getPinMode
** function. It can perform any special processing needed
** when getting the pin mode. If this function returns zero,
** control will pass through the normal getPinMode code. If
** it returns a non-zero value the normal getPinMode code isn't
** executed.
*/
#if (OPT_BOARD_DIGITAL_IO != 0)
int _board_getPinMode(uint8_t pin, uint8_t * mode) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_digitalWrite
**
** Parameters:
** pin - digital pin number
** val - value to write to the pin
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the digitalWrite
** function. It can perform any special processing needed
** in writing to the pin. If this function returns zero,
** control will pass through the normal digitalWrite code. If
** it returns a non-zero value the normal digitalWrite code isn't
** executed.
*/#if (OPT_BOARD_DIGITAL_IO != 0)
int _board_digitalWrite(uint8_t pin, uint8_t val) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_digitalRead
**
** Parameters:
** pin - digital pin number
** val - pointer to variable to receive pin value
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the digitalRead
** function. It can perform any special processing needed
** in reading from the pin. If this function returns zero,
** control will pass through the normal digitalRead code. If
** it returns a non-zero value the normal digitalRead code isn't
** executed.
*/
#if (OPT_BOARD_DIGITAL_IO != 0)
int _board_digitalRead(uint8_t pin, uint8_t * val) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_analogRead
**
** Parameters:
** pin - analog channel number
** val - pointer to variable to receive analog value
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the analogRead
** function. It can perform any special processing needed
** in reading from the pin. If this function returns zero,
** control will pass through the normal analogRead code. If
** it returns a non-zero value the normal analogRead code isn't
** executed.
*/
#if (OPT_BOARD_ANALOG_READ != 0)
int _board_analogRead(uint8_t pin, int * val) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_analogReference
**
** Parameters:
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the analogReference
** function. It can perform any special processing needed
** to set the reference voltage. If this function returns zero,
** control will pass through the normal analogReference code. If
** it returns a non-zero value the normal analogReference code isn't
** executed.
*/
#if (OPT_BOARD_ANALOG_READ != 0)
int _board_analogReference(uint8_t mode) {
return 0;
}
#endif
/* ------------------------------------------------------------ */
/*** _board_analogWrite
**
** Parameters:
** pin - pin number
** val - analog value to write
**
** Return Value:
** Returns 0 if not handled, !0 if handled.
**
** Errors:
** none
**
** Description:
** This function is called at the beginning of the analogWrite
** function. It can perform any special processing needed
** in writing to the pin. If this function returns zero,
** control will pass through the normal analogWrite code. If
** it returns a non-zero value the normal analogWrite code isn't
** executed.
*/
#if (OPT_BOARD_ANALOG_WRITE != 0)
int _board_analogWrite(uint8_t pin, int val) {
return 0;
}
#endif
#endif // OPT_BOARD_DATA
/* ------------------------------------------------------------ */
#endif // BOARD_DATA_C
/************************************************************************/
|
the_stack_data/140924.c | #include <string.h>
extern int udhcpd_main(int argc, char *argv[]);
extern int udhcpc_main(int argc, char *argv[]);
int main(int argc, char *argv[])
{
int ret = 0;
char *base = strrchr(argv[0], '/');
if (strstr(base ? (base + 1) : argv[0], "dhcpd"))
ret = udhcpd_main(argc, argv);
else ret = udhcpc_main(argc, argv);
return ret;
}
|
the_stack_data/154830899.c | // RUN: %crabllvm --inline --lower-select --lower-unsigned-icmp --do-not-print-invariants --crab-dom=boxes --crab-check=assert %opts "%s" 2>&1 | OutputCheck -l debug %s
// CHECK: ^1 Number of total safe checks$
// CHECK: ^0 Number of total error checks$
// CHECK: ^0 Number of total warning checks$
extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern char __VERIFIER_nondet_char(void);
extern int __VERIFIER_nondet_int(void);
extern long __VERIFIER_nondet_long(void);
extern void *__VERIFIER_nondet_pointer(void);
extern int __VERIFIER_nondet_int();
/* Generated by CIL v. 1.3.6 */
/* print_CIL_Input is true */
int ssl3_accept(int initial_state )
{ int s__info_callback = __VERIFIER_nondet_int() ;
int s__in_handshake = __VERIFIER_nondet_int() ;
int s__state ;
int s__new_session ;
int s__server ;
int s__version = __VERIFIER_nondet_int() ;
int s__type ;
int s__init_num ;
int s__hit = __VERIFIER_nondet_int() ;
int s__rwstate ;
int s__init_buf___0 ;
int s__debug = __VERIFIER_nondet_int() ;
int s__shutdown ;
int s__cert = __VERIFIER_nondet_int() ;
int s__options = __VERIFIER_nondet_int() ;
int s__verify_mode = __VERIFIER_nondet_int() ;
int s__session__peer = __VERIFIER_nondet_int() ;
int s__cert__pkeys__AT0__privatekey = __VERIFIER_nondet_int() ;
int s__ctx__info_callback = __VERIFIER_nondet_int() ;
int s__ctx__stats__sess_accept_renegotiate = __VERIFIER_nondet_int() ;
int s__ctx__stats__sess_accept = __VERIFIER_nondet_int() ;
int s__ctx__stats__sess_accept_good = __VERIFIER_nondet_int() ;
int s__s3__tmp__cert_request ;
int s__s3__tmp__reuse_message = __VERIFIER_nondet_int() ;
int s__s3__tmp__use_rsa_tmp ;
int s__s3__tmp__new_cipher = __VERIFIER_nondet_int() ;
int s__s3__tmp__new_cipher__algorithms = __VERIFIER_nondet_int() ;
int s__s3__tmp__next_state___0 ;
int s__s3__tmp__new_cipher__algo_strength = __VERIFIER_nondet_int() ;
int s__session__cipher ;
int buf ;
unsigned long l ;
unsigned long Time ;
unsigned long tmp ;
int cb ;
long num1 ;
int ret ;
int new_state ;
int state ;
int skip ;
int got_new_session ;
int tmp___1 = __VERIFIER_nondet_int() ;
int tmp___2 = __VERIFIER_nondet_int() ;
int tmp___3 = __VERIFIER_nondet_int() ;
int tmp___4 = __VERIFIER_nondet_int() ;
int tmp___5 = __VERIFIER_nondet_int() ;
int tmp___6 = __VERIFIER_nondet_int() ;
int tmp___7 ;
long tmp___8 = __VERIFIER_nondet_long() ;
int tmp___9 = __VERIFIER_nondet_int() ;
int tmp___10 = __VERIFIER_nondet_int() ;
int blastFlag ;
int __cil_tmp55 ;
unsigned long __cil_tmp56 ;
unsigned long __cil_tmp57 ;
unsigned long __cil_tmp58 ;
unsigned long __cil_tmp59 ;
int __cil_tmp60 ;
unsigned long __cil_tmp61 ;
{
;
s__state = initial_state;
blastFlag = 0;
tmp = __VERIFIER_nondet_int();
Time = tmp;
cb = 0;
ret = -1;
skip = 0;
got_new_session = 0;
if (s__info_callback != 0) {
cb = s__info_callback;
} else {
if (s__ctx__info_callback != 0) {
cb = s__ctx__info_callback;
}
}
s__in_handshake ++;
if (tmp___1 + 12288) {
if (tmp___2 + 16384) {
}
}
if (s__cert == 0) {
return (-1);
}
{
while (1) {
while_0_continue: /* CIL Label */ ;
state = s__state;
if (s__state == 12292) {
goto switch_1_12292;
} else {
if (s__state == 16384) {
goto switch_1_16384;
} else {
if (s__state == 8192) {
goto switch_1_8192;
} else {
if (s__state == 24576) {
goto switch_1_24576;
} else {
if (s__state == 8195) {
goto switch_1_8195;
} else {
if (s__state == 8480) {
goto switch_1_8480;
} else {
if (s__state == 8481) {
goto switch_1_8481;
} else {
if (s__state == 8482) {
goto switch_1_8482;
} else {
if (s__state == 8464) {
goto switch_1_8464;
} else {
if (s__state == 8465) {
goto switch_1_8465;
} else {
if (s__state == 8466) {
goto switch_1_8466;
} else {
if (s__state == 8496) {
goto switch_1_8496;
} else {
if (s__state == 8497) {
goto switch_1_8497;
} else {
if (s__state == 8512) {
goto switch_1_8512;
} else {
if (s__state == 8513) {
goto switch_1_8513;
} else {
if (s__state == 8528) {
goto switch_1_8528;
} else {
if (s__state == 8529) {
goto switch_1_8529;
} else {
if (s__state == 8544) {
goto switch_1_8544;
} else {
if (s__state == 8545) {
goto switch_1_8545;
} else {
if (s__state == 8560) {
goto switch_1_8560;
} else {
if (s__state == 8561) {
goto switch_1_8561;
} else {
if (s__state == 8448) {
goto switch_1_8448;
} else {
if (s__state == 8576) {
goto switch_1_8576;
} else {
if (s__state == 8577) {
goto switch_1_8577;
} else {
if (s__state == 8592) {
goto switch_1_8592;
} else {
if (s__state == 8593) {
goto switch_1_8593;
} else {
if (s__state == 8608) {
goto switch_1_8608;
} else {
if (s__state == 8609) {
goto switch_1_8609;
} else {
if (s__state == 8640) {
goto switch_1_8640;
} else {
if (s__state == 8641) {
goto switch_1_8641;
} else {
if (s__state == 8656) {
goto switch_1_8656;
} else {
if (s__state == 8657) {
goto switch_1_8657;
} else {
if (s__state == 8672) {
goto switch_1_8672;
} else {
if (s__state == 8673) {
goto switch_1_8673;
} else {
if (s__state == 3) {
goto switch_1_3;
} else {
goto switch_1_default;
if (0) {
switch_1_12292:
s__new_session = 1;
switch_1_16384: ;
switch_1_8192: ;
switch_1_24576: ;
switch_1_8195:
s__server = 1;
if (cb != 0) {
}
{
__cil_tmp55 = s__version * 8;
if (__cil_tmp55 != 3) {
return (-1);
}
}
s__type = 8192;
if (s__init_buf___0 == 0) {
buf = __VERIFIER_nondet_int();
if (buf == 0) {
ret = -1;
goto end;
}
if (! tmp___3) {
ret = -1;
goto end;
}
s__init_buf___0 = buf;
}
if (! tmp___4) {
ret = -1;
goto end;
}
s__init_num = 0;
if (s__state != 12292) {
if (! tmp___5) {
ret = -1;
goto end;
}
s__state = 8464;
s__ctx__stats__sess_accept ++;
} else {
s__ctx__stats__sess_accept_renegotiate ++;
s__state = 8480;
}
goto switch_1_break;
switch_1_8480: ;
switch_1_8481:
s__shutdown = 0;
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
s__s3__tmp__next_state___0 = 8482;
s__state = 8448;
s__init_num = 0;
goto switch_1_break;
switch_1_8482:
s__state = 3;
goto switch_1_break;
switch_1_8464: ;
switch_1_8465: ;
switch_1_8466:
s__shutdown = 0;
ret = __VERIFIER_nondet_int();
if (blastFlag == 0) {
blastFlag = 1;
}
if (ret <= 0) {
goto end;
}
got_new_session = 1;
s__state = 8496;
s__init_num = 0;
goto switch_1_break;
switch_1_8496: ;
switch_1_8497:
ret = __VERIFIER_nondet_int();
if (blastFlag == 1) {
blastFlag = 2;
}
if (ret <= 0) {
goto end;
}
if (s__hit) {
s__state = 8656;
} else {
s__state = 8512;
}
s__init_num = 0;
goto switch_1_break;
switch_1_8512: ;
switch_1_8513: ;
{
__cil_tmp56 = (unsigned long )s__s3__tmp__new_cipher__algorithms;
if (__cil_tmp56 + 256UL) {
skip = 1;
} else {
ret = __VERIFIER_nondet_int();
if (blastFlag == 2) {
blastFlag = 6;
}
if (ret <= 0) {
goto end;
}
}
}
s__state = 8528;
s__init_num = 0;
goto switch_1_break;
switch_1_8528: ;
switch_1_8529:
l = (unsigned long )s__s3__tmp__new_cipher__algorithms;
{
__cil_tmp57 = (unsigned long )s__options;
if (__cil_tmp57 + 2097152UL) {
s__s3__tmp__use_rsa_tmp = 1;
} else {
s__s3__tmp__use_rsa_tmp = 0;
}
}
if (s__s3__tmp__use_rsa_tmp) {
goto _L___0;
} else {
if (l + 30UL) {
goto _L___0;
} else {
if (l + 1UL) {
if (s__cert__pkeys__AT0__privatekey == 0) {
goto _L___0;
} else {
{
__cil_tmp58 = (unsigned long )s__s3__tmp__new_cipher__algo_strength;
if (__cil_tmp58 + 2UL) {
{
__cil_tmp59 = (unsigned long )s__s3__tmp__new_cipher__algo_strength;
if (__cil_tmp59 + 4UL) {
tmp___7 = 512;
} else {
tmp___7 = 1024;
}
}
{
__cil_tmp60 = tmp___6 * 8;
if (__cil_tmp60 > tmp___7) {
_L___0:
ret = __VERIFIER_nondet_int();
if (blastFlag == 6) {
blastFlag = 7;
}
if (ret <= 0) {
goto end;
}
} else {
skip = 1;
}
}
} else {
skip = 1;
}
}
}
} else {
skip = 1;
}
}
}
s__state = 8544;
s__init_num = 0;
goto switch_1_break;
switch_1_8544: ;
switch_1_8545: ;
if (s__verify_mode + 1) {
if (s__session__peer != 0) {
if (s__verify_mode + 4) {
skip = 1;
s__s3__tmp__cert_request = 0;
s__state = 8560;
} else {
goto _L___2;
}
} else {
_L___2:
{
__cil_tmp61 = (unsigned long )s__s3__tmp__new_cipher__algorithms;
if (__cil_tmp61 + 256UL) {
if (s__verify_mode + 2) {
goto _L___1;
} else {
skip = 1;
s__s3__tmp__cert_request = 0;
s__state = 8560;
}
} else {
_L___1:
s__s3__tmp__cert_request = 1;
ret = __VERIFIER_nondet_int();
if (blastFlag == 8) {
goto ERROR;
}
if (ret <= 0) {
goto end;
}
s__state = 8448;
s__s3__tmp__next_state___0 = 8576;
s__init_num = 0;
}
}
}
} else {
skip = 1;
s__s3__tmp__cert_request = 0;
s__state = 8560;
}
goto switch_1_break;
switch_1_8560: ;
switch_1_8561:
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
s__s3__tmp__next_state___0 = 8576;
s__state = 8448;
s__init_num = 0;
goto switch_1_break;
switch_1_8448:
if (num1 > 0L) {
s__rwstate = 2;
num1 = tmp___8;
if (num1 <= 0L) {
ret = -1;
goto end;
}
s__rwstate = 1;
}
s__state = s__s3__tmp__next_state___0;
goto switch_1_break;
switch_1_8576: ;
switch_1_8577:
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
if (ret == 2) {
s__state = 8466;
} else {
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
s__init_num = 0;
s__state = 8592;
}
goto switch_1_break;
switch_1_8592: ;
switch_1_8593:
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
s__state = 8608;
s__init_num = 0;
goto switch_1_break;
switch_1_8608: ;
switch_1_8609:
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
s__state = 8640;
s__init_num = 0;
goto switch_1_break;
switch_1_8640: ;
switch_1_8641:
ret = __VERIFIER_nondet_int();
if (blastFlag == 5) {
goto ERROR;
}
if (ret <= 0) {
goto end;
}
if (s__hit) {
s__state = 3;
} else {
s__state = 8656;
}
s__init_num = 0;
goto switch_1_break;
switch_1_8656: ;
switch_1_8657:
s__session__cipher = s__s3__tmp__new_cipher;
if (! tmp___9) {
ret = -1;
goto end;
}
ret = __VERIFIER_nondet_int();
if (blastFlag == 2) {
blastFlag = 3;
} else {
if (blastFlag == 4) {
blastFlag = 5;
} else {
if (blastFlag == 7) {
blastFlag = 8;
}
}
}
if (ret <= 0) {
goto end;
}
s__state = 8672;
s__init_num = 0;
if (! tmp___10) {
ret = -1;
goto end;
}
goto switch_1_break;
switch_1_8672: ;
switch_1_8673:
ret = __VERIFIER_nondet_int();
if (blastFlag == 3) {
blastFlag = 4;
}
if (ret <= 0) {
goto end;
}
s__state = 8448;
if (s__hit) {
s__s3__tmp__next_state___0 = 8640;
} else {
s__s3__tmp__next_state___0 = 3;
}
s__init_num = 0;
goto switch_1_break;
switch_1_3:
s__init_buf___0 = 0;
s__init_num = 0;
if (got_new_session) {
s__new_session = 0;
s__ctx__stats__sess_accept_good ++;
if (cb != 0) {
}
}
ret = 1;
goto end;
switch_1_default:
ret = -1;
goto end;
} else {
switch_1_break: ;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (! s__s3__tmp__reuse_message) {
if (! skip) {
if (s__debug) {
ret = __VERIFIER_nondet_int();
if (ret <= 0) {
goto end;
}
}
if (cb != 0) {
if (s__state != state) {
new_state = s__state;
s__state = state;
s__state = new_state;
}
}
}
}
skip = 0;
}
while_0_break: /* CIL Label */ ;
}
end:
s__in_handshake --;
if (cb != 0) {
}
return (ret);
ERROR: __VERIFIER_error();
return (-1);
}
}
int main(void)
{ int s ;
int tmp ;
{
{
s = 8464;
tmp = ssl3_accept(s);
}
return (tmp);
}
}
|
the_stack_data/1210286.c | //
// This C-language parser code was generated by APG Version 7.0.
// User modifications invalidate the license agreement and may cause unpredictable results.
//
/* *************************************************************************************
Copyright (c) 2021, Lowell D. Thomas
All rights reserved.
This file is part of APG Version 7.0.
APG Version 7.0 may be used under the terms of the BSD 2-Clause License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *************************************************************************************/
#include <stdint.h>
static const char caStringTable[580] = {
74,83,79,78,45,116,101,120,116,0,98,101,103,105,110,45,97,114,114,97,121,0,98,101,103,105,110,45,111,98
,106,101,99,116,0,101,110,100,45,97,114,114,97,121,0,101,110,100,45,111,98,106,101,99,116,0,110,97,109,101
,45,115,101,112,97,114,97,116,111,114,0,118,97,108,117,101,45,115,101,112,97,114,97,116,111,114,0,101,110,100
,45,109,101,109,98,101,114,45,115,101,112,97,114,97,116,111,114,0,101,110,100,45,118,97,108,117,101,45,115,101
,112,97,114,97,116,111,114,0,119,115,0,118,97,108,117,101,0,102,97,108,115,101,0,110,117,108,108,0,116,114
,117,101,0,111,98,106,101,99,116,0,109,101,109,98,101,114,0,107,101,121,0,107,101,121,45,98,101,103,105,110
,0,97,114,114,97,121,0,110,117,109,98,101,114,0,102,114,97,99,45,111,110,108,121,0,100,101,99,105,109,97
,108,45,112,111,105,110,116,0,100,105,103,105,116,49,45,57,0,101,0,101,120,112,0,102,114,97,99,0,102,114
,97,99,45,100,105,103,105,116,115,0,105,110,116,0,109,105,110,117,115,0,101,109,105,110,117,115,0,112,108,117
,115,0,101,112,108,117,115,0,122,101,114,111,0,115,116,114,105,110,103,0,115,116,114,105,110,103,45,98,101,103
,105,110,0,115,116,114,105,110,103,45,99,111,110,116,101,110,116,0,115,116,114,105,110,103,45,101,110,100,0,99
,104,97,114,0,113,117,111,116,101,0,114,45,115,111,108,105,100,117,115,0,115,111,108,105,100,117,115,0,98,97
,99,107,115,112,97,99,101,0,102,111,114,109,45,102,101,101,100,0,108,105,110,101,45,102,101,101,100,0,99,114
,0,116,97,98,0,97,115,99,105,105,0,117,116,102,49,54,0,117,116,102,49,54,45,50,0,117,116,102,49,54
,45,49,0,117,116,102,49,54,45,116,97,105,108,0,117,116,102,56,0,117,116,102,56,45,50,0,117,116,102,56
,45,51,0,117,116,102,56,45,52,0,85,84,70,56,45,116,97,105,108,0,68,73,71,73,84,0,72,69,88,68
,73,71,0,55,46,48,0,71,78,85,32,76,101,115,115,101,114,32,71,101,110,101,114,97,108,32,80,117,98,108
,105,99,32,76,105,99,101,110,115,101,44,32,118,101,114,115,105,111,110,32,51,32,111,114,32,104,105,103,104,101
,114,46,0,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,50,48,32,76,111,119,101,108,108,32,68
,46,32,84,104,111,109,97,115,0,0};
static const uint8_t ucaPpptTable[44793] = {
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3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0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0};
static const uint8_t aAcharTable[64] = {
91,123,93,125,58,44,44,44,32,9,10,13,102,97,108,115,101,110,117,108,108,116,114,117,101,34,46,101,69,45,45
,43,43,48,34,34,92,34,92,92,92,47,92,98,92,102,92,110,92,114,92,116,92,117,92,117,92,117,224,237,238
,239,240,244};
static const uint16_t aParserInit[1320] = {
1320,9,244,1,44793,2,58,0,225,189,237,483,543,487,22,144,166,348,514,0,514,806,1,2,3,5,6,7,9,10,11
,13,14,15,17,18,19,21,22,23,25,26,27,29,30,31,33,34,35,38,39,40,41,43,44,45,46,47,48,49,54
,55,64,57,58,62,60,61,66,67,68,70,71,72,75,76,85,78,79,83,81,82,87,91,97,89,90,92,96,93,94
,103,104,106,107,111,109,110,114,115,119,120,121,122,130,131,132,138,139,140,141,142,143,144,145,146,147,148,158,159,160
,162,163,165,166,168,169,172,173,177,178,179,181,182,184,188,192,196,200,185,186,187,189,190,193,194,195,197,198,201,202
,203,205,210,214,206,207,208,211,212,215,216,217,222,223,224,0,0,0,0,4,0,1,237,10,4,4,0,2,474,22
,8,4,0,3,711,35,12,4,0,4,948,45,16,4,0,5,1185,56,20,4,0,6,1422,71,24,4,0,7,1659,87
,28,4,0,8,1896,108,32,4,0,9,2133,128,36,6,1,10,2370,131,42,8,0,11,2607,137,50,1,0,12,2844,143
,51,1,0,13,3081,148,52,1,0,14,3318,153,53,12,0,15,3555,160,65,4,0,16,3792,167,69,4,0,17,4029,171
,73,1,0,18,4266,181,74,12,0,19,4503,187,86,13,0,20,4740,194,99,1,0,21,4977,204,100,1,0,22,5214,218
,101,1,0,23,5451,227,102,3,0,24,5688,229,105,8,0,25,5925,233,113,3,0,26,6162,238,116,2,0,27,6399,250
,118,6,0,28,6636,254,124,1,0,29,6873,260,125,1,0,30,7110,267,126,1,0,31,7347,272,127,1,0,32,7584,278
,128,1,0,33,7821,283,129,4,0,34,8058,290,133,1,0,35,8295,303,134,2,1,36,8532,318,136,1,0,37,8769,329
,137,12,0,38,9006,334,149,1,0,39,9243,340,150,1,0,40,9480,350,151,1,0,41,9717,358,152,1,0,42,9954,368
,153,1,0,43,10191,378,154,1,0,44,10428,388,155,1,0,45,10665,391,156,1,0,46,10902,395,157,4,0,47,11139,401
,161,3,0,48,11376,407,164,7,0,49,11613,415,171,3,0,50,11850,423,174,2,0,51,12087,434,176,4,0,52,12324,439
,180,3,0,53,12561,446,183,21,0,54,12798,453,204,15,0,55,13035,460,219,1,0,56,13272,470,220,1,0,57,13509,476
,221,4,0,2,13746,0,3,4,2133,9,4,2370,10,4,2133,9,2,13983,3,3,4,2133,9,6,14220,0,1,4,2133,9
,2,14457,6,3,4,2133,9,6,14694,1,1,4,2133,9,2,14931,9,3,4,2133,9,6,15168,2,1,4,2133,9,2,15405
,12,3,4,2133,9,6,15642,3,1,4,2133,9,2,15879,15,3,4,2133,9,6,16116,4,1,4,2133,9,2,16353,18,3
,4,2133,9,6,16590,5,1,4,2133,9,2,16827,21,3,4,2133,9,6,17064,6,1,4,2133,9,2,17301,24,3,4,2133
,9,6,17538,7,1,4,2133,9,3,17775,0,-1,1,18012,27,4,6,18249,8,1,6,18486,9,1,6,18723,10,1,6,18960
,11,1,1,19197,31,7,4,3081,13,4,2607,11,4,2844,12,4,3318,14,4,4266,18,4,4503,19,4,7821,33,6,19434,12
,5,6,19671,17,4,6,19908,21,4,2,20145,38,3,4,474,2,3,20382,0,1,2,20619,41,3,4,3555,15,3,20856,0
,-1,2,21093,44,2,4,1422,6,4,3555,15,3,21330,0,1,4,1659,7,4,948,4,2,21567,46,3,4,3792,16,4,1185
,5,4,2370,10,2,21804,49,3,4,4029,17,4,8295,35,4,8532,36,6,22041,25,1,2,22278,52,3,4,237,1,3,22515
,0,1,2,22752,55,3,4,2370,10,3,22989,0,-1,2,23226,58,2,4,1422,6,4,2370,10,3,23463,0,1,4,1896,8
,4,711,3,2,23700,60,3,3,23937,0,1,1,24174,63,2,4,6636,28,4,7110,30,1,24411,65,2,2,24648,67,2,4
,6399,27,3,24885,0,1,4,5925,25,4,4740,20,3,25122,0,1,4,5688,24,4,5925,25,6,25359,26,1,5,25596,49,57
,1,25833,69,2,6,26070,27,1,6,26307,28,1,2,26544,71,3,4,5451,23,3,26781,0,1,1,27018,74,2,4,6873,29
,4,7347,31,3,27255,1,-1,4,13272,56,2,27492,76,2,4,4977,21,4,6162,26,3,27729,1,-1,4,13272,56,1,27966,78
,2,4,7584,32,2,28203,80,2,4,5214,22,3,28440,0,-1,4,13272,56,6,28677,29,1,6,28914,30,1,6,29151,31,1
,6,29388,32,1,6,29625,33,1,2,29862,82,3,4,8058,34,4,8295,35,4,8532,36,6,30099,34,1,3,30336,0,-1,4
,8769,37,6,30573,35,1,1,30810,85,11,4,10902,46,4,9006,38,4,9243,39,4,9480,40,4,9717,41,4,9954,42,4,10191
,43,4,10428,44,4,10665,45,4,11139,47,4,12087,51,6,31047,36,2,6,31284,38,2,6,31521,40,2,6,31758,42,2,6
,31995,44,2,6,32232,46,2,6,32469,48,2,6,32706,50,2,1,32943,96,3,5,33180,32,33,5,33417,35,91,5,33654,93
,127,1,33891,99,2,4,11376,48,4,11613,49,2,34128,101,4,6,34365,52,2,3,34602,4,4,4,13509,57,6,34839,54,2
,3,35076,4,4,4,13509,57,2,35313,105,2,6,35550,56,2,4,11850,50,3,35787,4,4,4,13509,57,1,36024,107,3,4
,12324,52,4,12561,53,4,12798,54,2,36261,110,2,5,36498,194,223,4,13035,55,1,36735,112,5,2,36972,117,3,6,37209,58
,1,5,37446,160,191,4,13035,55,2,37683,120,2,5,37920,225,236,3,38157,2,2,4,13035,55,2,38394,122,3,6,38631,59
,1,5,38868,128,159,4,13035,55,2,39105,125,2,6,39342,60,1,3,39579,2,2,4,13035,55,2,39816,127,3,6,40053,61
,1,4,13035,55,5,40290,128,189,1,40527,130,3,2,40764,133,3,6,41001,62,1,5,41238,144,191,3,41475,2,2,4,13035
,55,2,41712,136,2,5,41949,241,243,3,42186,3,3,4,13035,55,2,42423,138,3,6,42660,63,1,5,42897,128,143,3,43134
,2,2,4,13035,55,5,43371,128,191,5,43608,48,57,1,43845,141,3,5,44082,48,57,5,44319,65,70,5,44556,97,102};
static struct {
uint32_t uiSizeofAchar;
uint32_t uiSizeofUint;
uint32_t uiStringTableLength;
uint32_t uiAcharTableLength;
uint32_t uiPpptTableLength;
uint32_t uiParserInitLength;
const char* cpStringTable;
const uint8_t* ucpPpptTable;
const void* vpAcharTable;
const void* vpParserInit;
} s_parser_init = {
1,
2,
580,
64,
44793,
1320,
caStringTable,
ucaPpptTable,
(const void*)aAcharTable,
(const void*)aParserInit
};
// void pointer to the parser initialization data
void* vpJsonGrammarInit = (void*)&s_parser_init;
// summary
// achar min = 9
// achar max = 244
// aint max = 44793
// PPPT maps = 189 (number of PPPT maps)
// PPPT size = 237 (size in bytes of one PPPT map)
// rules = 58
// UDTs = 0
// opcodes = 225
// --- ABNF original opcodes
// ALT = 14
// CAT = 34
// REP = 23
// RNM = 94
// TRG = 17
// TLS = 0
// TBS = 43
// --- SABNF opcodes
// UDT = 0
// AND = 0
// NOT = 0
// BKR = 0
// BKA = 0
// BKN = 0
// ABG = 0
// AEN = 0
// ;original grammar
// ;
// ; This grammar is intended to be fully compliant with RFC 8259
// ; https://tools.ietf.org/html/rfc8259
// ; The initial version was extracted from RFC 8259 with the
// ; IETF ABNF extraction tool https://tools.ietf.org/abnf/
// ;
// ; Modifications have been made to more easily capture the JSON-text values
// ; in a single pass without need of generating and translating an AST.
// ; Some additional rules are "error productions", added to capture and report JSON-text errors.
// ;
// ; Characters greater than 0x7F must be UTF-8 encoded or UTF-16 escaped (\uXXXX).
// ; UTF-8 encoding must conform with well-formed byte sequencing.
// ; (See section D92, table 3.7, https://www.unicode.org/versions/Unicode9.0.0/ch03.pdf#G7404.)
// ; UTF-16 surrogate pairs are interpreted as such and any occurrence of a lone pair value is reported as an error.
// ;
// JSON-text = ws value ws
// begin-array = ws %x5B ws ; [ left square bracket
// begin-object = ws %x7B ws ; { left curly bracket
// end-array = ws %x5D ws ; ] right square bracket
// end-object = ws %x7D ws ; } right curly bracket
// name-separator = ws %x3A ws ; : colon
// value-separator = ws %x2C ws ; , comma
// end-member-separator = ws %x2C ws ; , comma - error production to catch illegal trailing commas
// end-value-separator = ws %x2C ws ; , comma - error production to catch illegal trailing commas
// ws = *(
// %x20 / ; Space
// %x09 / ; Horizontal tab
// %x0A / ; Line feed or New line
// %x0D ) ; Carriage return
// value = true / false / null / object / array / number / string
// false = %x66.61.6c.73.65 ; false
// null = %x6e.75.6c.6c ; null
// true = %x74.72.75.65 ; true
// object = begin-object [ member *( value-separator member ) [end-member-separator] ] end-object
// member = key name-separator value
// key = key-begin string-content string-end
// key-begin = %x22
// array = begin-array [ value *( value-separator value ) [end-value-separator] ] end-array
// number = [ minus / plus ] ((int [ frac ])/ frac-only) [ exp ]
// frac-only = frac ; error production - fraction without preceding int is not allowd by RFC 8259
// decimal-point = %x2E ; . period
// digit1-9 = %x31-39 ; 1-9
// e = %x65 / %x45 ; e E
// exp = e [ eminus / eplus ] 1*DIGIT
// frac = decimal-point frac-digits
// frac-digits = 1*DIGIT
// int = zero / ( digit1-9 *DIGIT )
// minus = %x2D ; - minus - recognized only as the integer/decimal sign
// eminus = %x2D ; - minus - recognized as the exponent sign only
// plus = %x2B ; + plus - error production - plus sign is invalid for decimal (RFC8259)
// eplus = %x2B ; + plus - recognized as exponent sign only
// zero = %x30 ; 0 zero
// string = string-begin string-content string-end
// string-begin = %x22
// string-content = *char
// string-end = %x22
// char = ascii / quote / r-solidus / solidus / backspace / form-feed / line-feed / cr / tab / utf16 / utf8
// quote = %x5C.22 ; " quotation mark U+0022
// r-solidus = %x5C.5C ; \ reverse solidus U+005C
// solidus = %x5C.2F ; / solidus U+002F
// backspace = %x5C.62 ; b backspace U+0008
// form-feed = %x5C.66 ; f form feed U+000C
// line-feed = %x5C.6E ; n line feed U+000A
// cr = %x5C.72 ; r carriage return U+000D
// tab = %x5C.74 ; t tab U+0009
// ascii = %x20-21 / %x23-5B / %x5D-7F ; all but \ and "
// utf16 = utf16-2 / utf16-1
// utf16-2 = %x5C.75 4HEXDIG %x5C.75 4HEXDIG ; surrogate pairs are evaluated semantically
// utf16-1 = %x5C.75 utf16-tail
// utf16-tail = 4HEXDIG ; error production for semantically detecting \uXXXX formatting errors
// utf8 = utf8-2 / utf8-3 / utf8-4 ; decoding utf8 is done semantically
// utf8-2 = %xC2-DF UTF8-tail
// utf8-3 = %xE0 %xA0-BF UTF8-tail
// / %xE1-EC 2( UTF8-tail )
// / %xED %x80-9F UTF8-tail
// / %xEE 2( UTF8-tail )
// / %xEF UTF8-tail %x80-BD
// utf8-4 = %xF0 %x90-BF 2( UTF8-tail )
// / %xF1-F3 3( UTF8-tail )
// / %xF4 %x80-8F 2( UTF8-tail )
// UTF8-tail = %x80-BF
// DIGIT = %d48-57
// HEXDIG = %d48-57 / %d65-70 / %d97-102
//
|
the_stack_data/126702866.c | #include <stdio.h>
#include <stdlib.h>
/*
Elabore um programa que, dado o numero do mes, indica quantos dias tem esse mes. Utilize para isso a estrutura de selecao SWITCH.
OBS: Considere fevereiro contendo 28 dias*/
int main(int argc, char const *argv[])
{
int mes;
printf("\n\nDigite o numero do mes: ");
scanf("%d", &mes);
switch(mes){
case 1:
printf("\n\nO mes de JANEIRO tem 31 dias!");
break;
case 2:
printf("\n\nO mes de FEVEREIRO tem 28 dias!");
break;
case 3:
printf("\n\nO mes de MARCO tem 31 dias!");
break;
case 4:
printf("\n\nO mes de ABRIL tem 30 dias!");
break;
case 5:
printf("\n\nO mes de MAIO tem 31 dias!");
break;
case 6:
printf("\n\nO mes de JUNHO tem 30 dias!");
break;
case 7:
printf("\n\nO mes de JULHO tem 31 dias!");
break;
case 8:
printf("\n\nO mes de AGOSTO tem 31 dias!");
break;
case 9:
printf("\n\nO mes de SETEMEBRO tem 30 dias!");
break;
case 10:
printf("\n\nO mes de OUTUBRO tem 31 dias!");
break;
case 11:
printf("\n\nO mes de NOVEMBRO tem 30 dias!");
break;
case 12:
printf("\n\nO mes de DEZEMBRO tem 31 dias!");
break;
default:
printf("\n\nMES INVALIDO!!!");
}
return 0;
}
|
the_stack_data/100141370.c | // RUN: %clang_hwasan %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
#include <sanitizer/hwasan_interface.h>
int main() {
__hwasan_enable_allocator_tagging();
char *p = (char *)malloc(1);
fprintf(stderr, "ALLOC %p\n", __hwasan_tag_pointer(p, 0));
// CHECK: ALLOC {{[0x]+}}[[ADDR:.*]]
free(p - 8);
// CHECK: ERROR: HWAddressSanitizer: invalid-free on address {{.*}} at pc {{[0x]+}}[[PC:.*]] on thread T{{[0-9]+}}
// CHECK: #0 {{[0x]+}}{{.*}}[[PC]] in {{.*}}free
// CHECK: #1 {{.*}} in main {{.*}}wild-free-close.c:[[@LINE-3]]
// CHECK: is located 8 bytes to the left of 1-byte region [{{[0x]+}}{{.*}}[[ADDR]]
// CHECK-NOT: Segmentation fault
// CHECK-NOT: SIGSEGV
return 0;
}
|
the_stack_data/387464.c | /*
* "Optimize" a list of dependencies as spit out by gcc -MD
* for the kernel build
* ===========================================================================
*
* Author Kai Germaschewski
* Copyright 2002 by Kai Germaschewski <[email protected]>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*
* Introduction:
*
* gcc produces a very nice and correct list of dependencies which
* tells make when to remake a file.
*
* To use this list as-is however has the drawback that virtually
* every file in the kernel includes <linux/config.h> which then again
* includes <linux/autoconf.h>
*
* If the user re-runs make *config, linux/autoconf.h will be
* regenerated. make notices that and will rebuild every file which
* includes autoconf.h, i.e. basically all files. This is extremely
* annoying if the user just changed CONFIG_HIS_DRIVER from n to m.
*
* So we play the same trick that "mkdep" played before. We replace
* the dependency on linux/autoconf.h by a dependency on every config
* option which is mentioned in any of the listed prequisites.
*
* kconfig populates a tree in include/config/ with an empty file
* for each config symbol and when the configuration is updated
* the files representing changed config options are touched
* which then let make pick up the changes and the files that use
* the config symbols are rebuilt.
*
* So if the user changes his CONFIG_HIS_DRIVER option, only the objects
* which depend on "include/linux/config/his/driver.h" will be rebuilt,
* so most likely only his driver ;-)
*
* The idea above dates, by the way, back to Michael E Chastain, AFAIK.
*
* So to get dependencies right, there are two issues:
* o if any of the files the compiler read changed, we need to rebuild
* o if the command line given to the compile the file changed, we
* better rebuild as well.
*
* The former is handled by using the -MD output, the later by saving
* the command line used to compile the old object and comparing it
* to the one we would now use.
*
* Again, also this idea is pretty old and has been discussed on
* kbuild-devel a long time ago. I don't have a sensibly working
* internet connection right now, so I rather don't mention names
* without double checking.
*
* This code here has been based partially based on mkdep.c, which
* says the following about its history:
*
* Copyright abandoned, Michael Chastain, <mailto:[email protected]>.
* This is a C version of syncdep.pl by Werner Almesberger.
*
*
* It is invoked as
*
* fixdep <depfile> <target> <cmdline>
*
* and will read the dependency file <depfile>
*
* The transformed dependency snipped is written to stdout.
*
* It first generates a line
*
* cmd_<target> = <cmdline>
*
* and then basically copies the .<target>.d file to stdout, in the
* process filtering out the dependency on linux/autoconf.h and adding
* dependencies on include/config/my/option.h for every
* CONFIG_MY_OPTION encountered in any of the prequisites.
*
* It will also filter out all the dependencies on *.ver. We need
* to make sure that the generated version checksum are globally up
* to date before even starting the recursive build, so it's too late
* at this point anyway.
*
* The algorithm to grep for "CONFIG_..." is bit unusual, but should
* be fast ;-) We don't even try to really parse the header files, but
* merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will
* be picked up as well. It's not a problem with respect to
* correctness, since that can only give too many dependencies, thus
* we cannot miss a rebuild. Since people tend to not mention totally
* unrelated CONFIG_ options all over the place, it's not an
* efficiency problem either.
*
* (Note: it'd be easy to port over the complete mkdep state machine,
* but I don't think the added complexity is worth it)
*/
/*
* Note 2: if somebody writes HELLO_CONFIG_BOOM in a file, it will depend onto
* CONFIG_BOOM. This could seem a bug (not too hard to fix), but please do not
* fix it! Some UserModeLinux files (look at arch/um/) call CONFIG_BOOM as
* UML_CONFIG_BOOM, to avoid conflicts with /usr/include/linux/autoconf.h,
* through arch/um/include/uml-config.h; this fixdep "bug" makes sure that
* those files will have correct dependencies.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
#include <arpa/inet.h>
#define INT_CONF ntohl(0x434f4e46)
#define INT_ONFI ntohl(0x4f4e4649)
#define INT_NFIG ntohl(0x4e464947)
#define INT_FIG_ ntohl(0x4649475f)
char *target;
char *depfile;
char *cmdline;
void usage(void)
{
fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
exit(1);
}
/*
* Print out the commandline prefixed with cmd_<target filename> :=
*/
void print_cmdline(void)
{
printf("cmd_%s := %s\n\n", target, cmdline);
}
char * str_config = NULL;
int size_config = 0;
int len_config = 0;
/*
* Grow the configuration string to a desired length.
* Usually the first growth is plenty.
*/
void grow_config(int len)
{
while (len_config + len > size_config) {
if (size_config == 0)
size_config = 2048;
str_config = realloc(str_config, size_config *= 2);
if (str_config == NULL)
{ perror("fixdep:malloc"); exit(1); }
}
}
/*
* Lookup a value in the configuration string.
*/
int is_defined_config(const char * name, int len)
{
const char * pconfig;
const char * plast = str_config + len_config - len;
for ( pconfig = str_config + 1; pconfig < plast; pconfig++ ) {
if (pconfig[ -1] == '\n'
&& pconfig[len] == '\n'
&& !memcmp(pconfig, name, len))
return 1;
}
return 0;
}
/*
* Add a new value to the configuration string.
*/
void define_config(const char * name, int len)
{
grow_config(len + 1);
memcpy(str_config+len_config, name, len);
len_config += len;
str_config[len_config++] = '\n';
}
/*
* Clear the set of configuration strings.
*/
void clear_config(void)
{
len_config = 0;
define_config("", 0);
}
/*
* Record the use of a CONFIG_* word.
*/
void use_config(char *m, int slen)
{
char s[PATH_MAX];
char *p;
if (is_defined_config(m, slen))
return;
define_config(m, slen);
memcpy(s, m, slen); s[slen] = 0;
for (p = s; p < s + slen; p++) {
if (*p == '_')
*p = '/';
else
*p = tolower((int)*p);
}
printf(" $(wildcard include/config/%s.h) \\\n", s);
}
void parse_config_file(char *map, size_t len)
{
int *end = (int *) (map + len);
/* start at +1, so that p can never be < map */
int *m = (int *) map + 1;
char *p, *q;
for (; m < end; m++) {
if (*m == INT_CONF) { p = (char *) m ; goto conf; }
if (*m == INT_ONFI) { p = (char *) m-1; goto conf; }
if (*m == INT_NFIG) { p = (char *) m-2; goto conf; }
if (*m == INT_FIG_) { p = (char *) m-3; goto conf; }
continue;
conf:
if (p > map + len - 7)
continue;
if (memcmp(p, "CONFIG_", 7))
continue;
for (q = p + 7; q < map + len; q++) {
if (!(isalnum(*q) || *q == '_'))
goto found;
}
continue;
found:
if (!memcmp(q - 7, "_MODULE", 7))
q -= 7;
use_config(p+7, q-p-7);
}
}
/* test is s ends in sub */
int strrcmp(char *s, char *sub)
{
int slen = strlen(s);
int sublen = strlen(sub);
if (sublen > slen)
return 1;
return memcmp(s + slen - sublen, sub, sublen);
}
void do_config_file(char *filename)
{
struct stat st;
int fd;
void *map;
fd = open(filename, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "fixdep: ");
perror(filename);
exit(2);
}
fstat(fd, &st);
if (st.st_size == 0) {
close(fd);
return;
}
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if ((long) map == -1) {
perror("fixdep: mmap");
close(fd);
return;
}
parse_config_file(map, st.st_size);
munmap(map, st.st_size);
close(fd);
}
void parse_dep_file(void *map, size_t len)
{
char *m = map;
char *end = m + len;
char *p;
char s[PATH_MAX];
p = strchr(m, ':');
if (!p) {
fprintf(stderr, "fixdep: parse error\n");
exit(1);
}
memcpy(s, m, p-m); s[p-m] = 0;
printf("deps_%s := \\\n", target);
m = p+1;
clear_config();
while (m < end) {
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++;
p = m;
while (p < end && *p != ' ') p++;
if (p == end) {
do p--; while (!isalnum(*p));
p++;
}
memcpy(s, m, p-m); s[p-m] = 0;
if (strrcmp(s, "include/linux/autoconf.h") &&
strrcmp(s, "arch/um/include/uml-config.h") &&
strrcmp(s, ".ver")) {
printf(" %s \\\n", s);
do_config_file(s);
}
m = p + 1;
}
printf("\n%s: $(deps_%s)\n\n", target, target);
printf("$(deps_%s):\n", target);
}
void print_deps(void)
{
struct stat st;
int fd;
void *map;
fd = open(depfile, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "fixdep: ");
perror(depfile);
exit(2);
}
fstat(fd, &st);
if (st.st_size == 0) {
fprintf(stderr,"fixdep: %s is empty\n",depfile);
close(fd);
return;
}
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if ((long) map == -1) {
perror("fixdep: mmap");
close(fd);
return;
}
parse_dep_file(map, st.st_size);
munmap(map, st.st_size);
close(fd);
}
void traps(void)
{
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
if (*(int *)test != INT_CONF) {
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
*(int *)test);
exit(2);
}
}
int main(int argc, char *argv[])
{
traps();
if (argc != 4)
usage();
depfile = argv[1];
target = argv[2];
cmdline = argv[3];
print_cmdline();
print_deps();
return 0;
}
|
the_stack_data/92325312.c | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
struct Node {
int coeff;
int exp;
struct Node * next;
}* poly = NULL;
void create() {
struct Node * t, * last = NULL;
int num, i;
printf("Enter number of terms");
scanf("%d", & num);
printf("Enter each term with coeff and exp\n");
for (i = 0; i < num; i++) {
t = (struct Node * ) malloc(sizeof(struct Node));
scanf("%d%d", &t->coeff, &t->exp);
t-> next = NULL;
if (poly == NULL) {
poly = last = t;
} else {
last -> next = t;
last = t;
}
}
}
void Display(struct Node * p) {
while (p) {
printf("%dx%d +", p -> coeff, p -> exp);
p = p -> next;
}
printf("\n");
}
long Eval(struct Node * p, int x) {
long val = 0;
while (p) {
val += p -> coeff * pow(x, p -> exp);
p = p -> next;
}
return val;
}
int main() {
create();
Display(poly);
printf("%ld\n", Eval(poly, 1));
return 0;
}
|
the_stack_data/232956716.c | /**
* gcc -g -o ssl_client ssl_client.c -lssl -lcrypt -lcrypto
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <malloc.h>
#include <string.h>
#include <sys/socket.h>
#include <resolv.h>
#include <netdb.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#define FAIL -1
int OpenConnection(const char *hostname, int port)
{
int sd;
struct hostent *host;
struct sockaddr_in addr;
if ((host = gethostbyname(hostname)) == NULL)
{
printf("Eroor: %s\n", hostname);
perror(hostname);
abort();
}
sd = socket(PF_INET, SOCK_STREAM, 0);
bzero(&addr, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = *(long*) (host->h_addr);
if (connect(sd, (struct sockaddr*) &addr, sizeof(addr)) != 0)
{
close(sd);
perror(hostname);
abort();
}
return sd;
}
SSL_CTX* InitCTX(void)
{
SSL_METHOD *method;
SSL_CTX *ctx;
OpenSSL_add_all_algorithms(); /* Load cryptos, et.al. */
SSL_load_error_strings(); /* Bring in and register error messages */
method = SSLv3_client_method(); /* Create new client-method instance */
ctx = SSL_CTX_new(method); /* Create new context */
if (ctx == NULL)
{
ERR_print_errors_fp(stderr);
printf("Eroor: %s\n", stderr);
abort();
}
return ctx;
}
void ShowCerts(SSL* ssl)
{
X509 *cert;
char *line;
cert = SSL_get_peer_certificate(ssl); /* Get certificates (if available) */
if (cert != NULL)
{
printf("Server certificates:\n");
line = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
printf("Subject: %s\n", line);
free(line);
line = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
printf("Issuer: %s\n", line);
free(line);
X509_free(cert);
}
else
printf("No certificates.\n");
}
int main(int count, char *strings[])
{
SSL_CTX *ctx;
int server;
SSL *ssl;
char buf[1024];
int bytes;
char *hostname, *portnum;
if (count != 3)
{
printf("usage: %s <hostname> <portnum>\n", strings[0]);
exit(0);
}
SSL_library_init();
hostname = strings[1];
portnum = strings[2];
ctx = InitCTX();
server = OpenConnection(hostname, atoi(portnum));
ssl = SSL_new(ctx); /* create new SSL connection state */
SSL_set_fd(ssl, server); /* attach the socket descriptor */
if (SSL_connect(ssl) == FAIL) /* perform the connection */
{
printf("Eroor: %s\n", stderr);
ERR_print_errors_fp(stderr);
}
else
{
char *msg = "HelloWorld";
printf("Connected with %s encryption\n", SSL_get_cipher(ssl));
ShowCerts(ssl); /* get any certs */
SSL_write(ssl, msg, strlen(msg)); /* encrypt & send message */
bytes = SSL_read(ssl, buf, sizeof(buf)); /* get reply & decrypt */
buf[bytes] = 0;
printf("Received: \"%s\"\n", buf);
SSL_free(ssl); /* release connection state */
}
close(server); /* close socket */
SSL_CTX_free(ctx); /* release context */
return 0;
}
|
the_stack_data/995813.c | /*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates.
*
* 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. Neither the name of the copyright holder nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
extern void abort(void);
struct test {
int a : 2;
};
int main() {
struct test t = { 0 };
if (t.a++ != 0) {
abort();
}
if (t.a != 1) {
abort();
}
if (++t.a != -2) {
abort();
}
if (t.a != -2) {
abort();
}
if (t.a-- != -2) {
abort();
}
if (t.a != 1) {
abort();
}
if (--t.a != 0) {
abort();
}
if (t.a != 0) {
abort();
}
return 0;
}
|
the_stack_data/93886845.c | #include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include<sys/wait.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
void mkdir_command(char const *str,int simple,char const *flag)
{
if(simple==1)
{
int ret=mkdir(str,0700); // with read/write/search permissions for owner and group, and with read/search permissions for others.
if(ret<0)
{
perror("Error in directory creation");
}
}
else{
if(!(strcmp(flag,"-v\n")) || !(strcmp(flag,"-v")))
{
int ret=mkdir(str,0700); // with read/write/search permissions for owner and group, and with read/search permissions for others.
if(ret<0)
{
perror("Error in directory creation");
}
printf("%s:\t%s'%s'\n","mkdir","created directory ",str);
}
if(!(strcmp(flag,"-p\n")) || !(strcmp(flag,"-p")))
{
char *pointer1=str;
char *pointer=strtok(pointer1,"/");
while(pointer!=NULL)
{
int ret=mkdir(pointer,0700); // with read/write/search permissions for owner and group, and with read/search permissions for others.
if(ret<0)
{
perror("Error in directory creation");
}
char str[1024];
getcwd(str,1024);
strcat(str,"/");
strcat(str,pointer);
int val= chdir(str);
if(val<0)
{
perror("Error in directory change ");
}
getcwd(str,1024);
pointer=strtok(NULL,"/");
}
}
else{
printf("%s\n","command not found");
}
}
}
int main(int argc, char const *argv[])
{
int simple=atoi(argv[1]);
if(simple==1)
{
mkdir_command(argv[0],1,NULL);
}
else{
mkdir_command(argv[0],0,argv[2]);
}
} |
the_stack_data/706348.c | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#define LEFT 30000000
#define RIGHT 30000200
#define THRNUM (RIGHT-LEFT+1)
static void *thr_prime(void *ptr)
{
int mark;
int i, j;
i=(int)ptr;
mark=1;
for (j=2;j<i/2;++j) {
if (i%j==0) {
mark=0;
break;
}
}
if (mark==1) {
printf("[%d]: %d is a prime\n", getpid(), i);
}
pthread_exit(NULL);
}
int
main()
{
int i;
int err;
pthread_t tid[THRNUM];
for (i=LEFT;i<=RIGHT;++i) {
err = pthread_create(tid+(i-LEFT), NULL, thr_prime, (void*)i);
if (err) {
fprintf(stderr, "pthread_create(): %s\n", strerror(err));
exit(1);
}
}
for (i=LEFT;i<=RIGHT;++i) {
pthread_join(tid[i-LEFT], NULL);
}
return 0;
}
|
Subsets and Splits