file
stringlengths 18
26
| data
stringlengths 4
1.03M
|
---|---|
the_stack_data/106411.c | #include <stdio.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include<string.h>
// structure for message queue
#define delim " ,\t\r\n\a"
char buff[500];
struct msg_buffer {
long msg_type;
char msg[500];
} message;
void main() {
key_t my_key;
int msg_id;
my_key = ftok("progfile", 65); //create unique key
msg_id = msgget(my_key, 0666 | IPC_CREAT); //create message queue and return id
message.msg_type = 1;
FILE *fd= fopen("para1.txt","r");
if(!fd){
printf("Error in opening the file\n");
}
//fgets(buff, 500, fd);
while(fgets(buff, 500, fd)>0){
char* token = strtok(buff," ");
while(token!=NULL){
strcpy(message.msg,token);
msgsnd(msg_id, &message, sizeof(message), 0);
token = strtok(NULL," ");
}
}
//msgsnd(msg_id, &message, sizeof(message), 0); //send message
printf("Sent message is : %s \n", message.msg);
}
|
the_stack_data/90766649.c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_18__ TYPE_6__ ;
typedef struct TYPE_17__ TYPE_5__ ;
typedef struct TYPE_16__ TYPE_4__ ;
typedef struct TYPE_15__ TYPE_3__ ;
typedef struct TYPE_14__ TYPE_2__ ;
typedef struct TYPE_13__ TYPE_1__ ;
typedef struct TYPE_12__ TYPE_10__ ;
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t ;
struct record_params {int channels; double samplerate; } ;
struct ff_config_param {char* acodec; int sample_rate; scalar_t__ audio_opts; scalar_t__ audio_bit_rate; int /*<<< orphan*/ audio_global_quality; scalar_t__ audio_qscale; } ;
struct ff_audio_info {double ratio; int sample_size; int outbuf_size; int /*<<< orphan*/ * outbuf; int /*<<< orphan*/ * buffer; TYPE_10__* codec; int /*<<< orphan*/ resampler; int /*<<< orphan*/ resampler_data; int /*<<< orphan*/ * encoder; } ;
struct TYPE_13__ {int /*<<< orphan*/ audio_resampler; } ;
struct TYPE_17__ {TYPE_1__ arrays; } ;
typedef TYPE_5__ settings_t ;
struct TYPE_16__ {TYPE_3__* ctx; } ;
struct TYPE_18__ {TYPE_4__ muxer; struct record_params params; struct ff_audio_info audio; struct ff_config_param config; } ;
typedef TYPE_6__ ffmpeg_t ;
struct TYPE_15__ {TYPE_2__* oformat; } ;
struct TYPE_14__ {int flags; } ;
struct TYPE_12__ {int channels; int sample_rate; int frame_size; int /*<<< orphan*/ flags; int /*<<< orphan*/ strict_std_compliance; scalar_t__ bit_rate; int /*<<< orphan*/ global_quality; void* time_base; int /*<<< orphan*/ sample_fmt; int /*<<< orphan*/ channel_layout; int /*<<< orphan*/ codec_type; } ;
typedef int /*<<< orphan*/ AVCodec ;
/* Variables and functions */
int AVFMT_GLOBALHEADER ;
int /*<<< orphan*/ AVMEDIA_TYPE_AUDIO ;
int /*<<< orphan*/ AV_CH_LAYOUT_MONO ;
int /*<<< orphan*/ AV_CH_LAYOUT_STEREO ;
int /*<<< orphan*/ AV_CODEC_FLAG_GLOBAL_HEADER ;
int /*<<< orphan*/ AV_CODEC_FLAG_QSCALE ;
int AV_INPUT_BUFFER_MIN_SIZE ;
int /*<<< orphan*/ AV_SAMPLE_FMT_S16 ;
int /*<<< orphan*/ FF_COMPLIANCE_EXPERIMENTAL ;
int /*<<< orphan*/ RARCH_ERR (char*,char*) ;
int /*<<< orphan*/ RARCH_LOG (char*,int) ;
int /*<<< orphan*/ RESAMPLER_QUALITY_DONTCARE ;
void* av_d2q (double,int) ;
scalar_t__ av_malloc (int) ;
TYPE_10__* avcodec_alloc_context3 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * avcodec_find_encoder_by_name (char*) ;
scalar_t__ avcodec_open2 (TYPE_10__*,int /*<<< orphan*/ *,scalar_t__*) ;
TYPE_5__* config_get_ptr () ;
int /*<<< orphan*/ ffmpeg_audio_resolve_format (struct ff_audio_info*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ffmpeg_audio_resolve_sample_rate (TYPE_6__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ retro_resampler_realloc (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ;
scalar_t__ roundf (double) ;
__attribute__((used)) static bool ffmpeg_init_audio(ffmpeg_t *handle)
{
settings_t *settings = config_get_ptr();
struct ff_config_param *params = &handle->config;
struct ff_audio_info *audio = &handle->audio;
struct record_params *param = &handle->params;
AVCodec *codec = avcodec_find_encoder_by_name(
*params->acodec ? params->acodec : "flac");
if (!codec)
{
RARCH_ERR("[FFmpeg]: Cannot find acodec %s.\n",
*params->acodec ? params->acodec : "flac");
return false;
}
audio->encoder = codec;
audio->codec = avcodec_alloc_context3(codec);
audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
audio->codec->channels = param->channels;
audio->codec->channel_layout = (param->channels > 1)
? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
ffmpeg_audio_resolve_format(audio, codec);
ffmpeg_audio_resolve_sample_rate(handle, codec);
if (params->sample_rate)
{
audio->ratio = (double)params->sample_rate / param->samplerate;
audio->codec->sample_rate = params->sample_rate;
audio->codec->time_base = av_d2q(1.0 / params->sample_rate, 1000000);
retro_resampler_realloc(&audio->resampler_data,
&audio->resampler,
settings->arrays.audio_resampler,
RESAMPLER_QUALITY_DONTCARE,
audio->ratio);
}
else
{
audio->codec->sample_fmt = AV_SAMPLE_FMT_S16;
audio->codec->sample_rate = (int)roundf(param->samplerate);
audio->codec->time_base = av_d2q(1.0 / param->samplerate, 1000000);
}
if (params->audio_qscale)
{
audio->codec->flags |= AV_CODEC_FLAG_QSCALE;
audio->codec->global_quality = params->audio_global_quality;
}
else if (params->audio_bit_rate)
audio->codec->bit_rate = params->audio_bit_rate;
/* Allow experimental codecs. */
audio->codec->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
if (handle->muxer.ctx->oformat->flags & AVFMT_GLOBALHEADER)
audio->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
if (avcodec_open2(audio->codec, codec, params->audio_opts ? ¶ms->audio_opts : NULL) != 0)
return false;
if (!audio->codec->frame_size) /* If not set (PCM), just set something. */
audio->codec->frame_size = 1024;
audio->buffer = (uint8_t*)av_malloc(
audio->codec->frame_size *
audio->codec->channels *
audio->sample_size);
#if 0
RARCH_LOG("[FFmpeg]: Audio frame size: %d.\n", audio->codec->frame_size);
#endif
if (!audio->buffer)
return false;
audio->outbuf_size = AV_INPUT_BUFFER_MIN_SIZE;
audio->outbuf = (uint8_t*)av_malloc(audio->outbuf_size);
if (!audio->outbuf)
return false;
return true;
} |
the_stack_data/9513998.c | #include <stdio.h>
#include <stdbool.h>
bool primo(int n) {
for (int i = 2; i <= n / 2; i++) {
if (n % i == 0)
return false;
}
return true;
}
int main(void) {
int n;
scanf("%d", &n);
if (primo(n))
printf("%d è primo\n", n);
else
printf("%d non è primo\n", n);
return 0;
}
|
the_stack_data/121357.c | /*
*****************************************************************************
*
* Copyright (C) 2012 Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices, Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. 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.
*
* ***************************************************************************
*
*/
// helper.c - these functions are compiled separately because they redefine
// functions invoked directly by the compiler code generator.
// The Microsoft tools do not allow such functions to be compiled
// with the "Enable link-time code generation (/GL)" option. Compile
// this module without /GL to avoid a build failure LNK1237.
//
#if defined (_MSC_VER)
#include "Porting.h"
//---------------------------------------------------------------------------
void *memcpy (void *dest, const void *src, size_t bytes)
{
// Rep movsb is faster than a byte loop, but still quite slow
// for large operations. However, it is a good choice here because
// this function is intended for use by the compiler only. For
// large copy operations, call LibAmdMemCopy.
__movsb (dest, src, bytes);
return dest;
}
//---------------------------------------------------------------------------
void *memset (void *dest, int value, size_t bytes)
{
// Rep stosb is faster than a byte loop, but still quite slow
// for large operations. However, it is a good choice here because
// this function is intended for use by the compiler only. For
// large fill operations, call LibAmdMemFill.
__stosb (dest, value, bytes);
return dest;
}
//---------------------------------------------------------------------------
#endif |
the_stack_data/165765947.c | #include <stdio.h>
#include <stdlib.h>
static int trailingZeroes(int n)
{
return n == 0 ? 0 : trailingZeroes(n / 5);
}
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: ./test n\n");
exit(-1);
}
printf("%d\n", trailingZeroes(atoi(argv[1])));
return 0;
}
|
the_stack_data/82951198.c | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
//declaracao de variaveis
int pessoas, itens, itens2;
//leitura dos dados
scanf("%d%d", &pessoas, &itens);
//se o numero de pessoas for superior ao de itens, logo a ultima pessoa a receber sera a que pegar o ultimo item
if(pessoas > itens)
printf("RESP:%d", itens);
//se o numero de pessoas igual ao de itens
else if(pessoas == itens)
printf("RESP:%d", itens);
//se o numero de itens for superior ao de pessoas
else
{
if(itens % pessoas == 0)
printf("RESP:%d", pessoas);
else
{
itens2 = itens % pessoas;
printf("RESP:%d", itens2);
}
}
return 0;
}
|
the_stack_data/76699561.c | #include <stdio.h>
int main(){
/*variaveis*/
int alc = 0, gas = 0, dis = 0, tipo;
/*entrada & processamento*/
while(1){
while(1){
scanf("%d", &tipo);
if(tipo > 0 && tipo < 5){
break;
}
}
switch (tipo){
case 1:
alc += 1;
break;
case 2:
gas += 1;
break;
case 3:
dis += 1;
break;
}
if(tipo == 4){
break;
}
}
/*saída*/
printf("MUITO OBRIGADO\n");
printf("Alcool: %d\n", alc);
printf("Gasolina: %d\n", gas);
printf("Diesel: %d\n", dis);
return 0;
} |
the_stack_data/107799.c | /*
cap19_MarkovChain3.c: Convergence on a 1-dimensional, but large, Markov chain.
Copyright (C) 2006 Federico Ricci-Tersenghi ([email protected])
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 2
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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
This program has been extracted from "Programmazione Scientifica",
Pearson Education ed. (2006), by Barone, Marinari, Organtini and
Ricci-Tersenghi. ISBN 8871922425.
*/
/* by FRT */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define N 999
void measures(int, double *);
void oneStep(double *);
int main(int argc, char *argv[]) {
int i, t, niter, measTime;
double p[N];
if (argc != 2) {
fprintf(stderr, "usage: %s <niter>\n", argv[0]);
exit(1);
}
niter = (unsigned)atoi(argv[1]);
p[0] = 1.0;
for (i = 1; i < N; i++) {
p[i] = 0.0;
}
measures(0, p);
measTime = 1;
t = 0;
while (measTime <= niter) {
oneStep(p);
t++;
if (t == measTime) {
measures(t, p);
measTime = (int)(measTime * 1.05) + 1;
}
}
return 0;
}
void oneStep(double *p) {
int i;
double tmp[N];
tmp[0] = 0.5 * (p[N-1] + p[1]);
for (i = 1; i < N-1; i++) {
tmp[i] = 0.5 * (p[i-1] + p[i+1]);
}
tmp[N-1] = 0.5 * (p[N-2] + p[0]);
for (i = 0; i < N; i++) {
p[i] = tmp[i];
}
}
void measures(int time, double *p) {
int i;
double invN=1.0/N, dist1=0.0, dist2=0.0;
for (i = 0; i < N; i++) {
dist1 += fabs(p[i] - invN);
dist2 += (p[i] - invN) * (p[i] - invN);
}
printf("%i %g %g\n", time, dist1, sqrt(dist2));
fflush(stdout);
}
|
the_stack_data/149915.c | /* 첫 번째 프로그램 */
#include <stdio.h>
void main(void)
{
printf("Hello World\n");
}
|
the_stack_data/173578335.c | /*
============================================================================
Name : analiz.c
Author : Maxim Sokolov
Version :
Copyright : copyleft
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
|
the_stack_data/82950210.c | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main(int argc, const char* argv[]) {
printf(
"Real UID = %d\n"
"Effective UID = %d\n"
"Real GID = %d\n"
"Effective GID = %d\n",
getuid (),
geteuid(),
getgid (),
getegid()
);
system("touch /tmp/owner-of-file-will-create");
}
|
the_stack_data/78926.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
FILE* fp1 = fopen("arquivo1.dat", "rb");
FILE* fp2 = fopen("arquivo2.dat", "rb");
FILE* fp3 = fopen("arquivo3.dat", "wb");
if(fp1== NULL || fp2== NULL || fp3== NULL){
printf("\nErro ao abrir o arquivo\n");
return 1;
}
float num1, num2;
int flag1, flag2;
flag1= fread(&num1, sizeof(float), 1, fp1);
flag2= fread(&num2, sizeof(float), 1, fp2);
while(flag1!= 0 && flag2!= 0){
if(num1<num2){
fwite(&num1, sizeof(float), 1, fp3);
fread(&num1, sizeof(float), 1, fp1);
} else{
fwite(&num2, sizeof(float), 1, fp3);
fread(&num2, sizeof(float), 1, fp2);
}
}
while(flag1!= 0){
fwite(&num1, sizeof(float), 1, fp3);
flag1= fread(&num1, sizeof(num1), 1, fp1);
}
while(flag2!= 0){
fwite(&num2, sizeof(float), 1, fp3);
fread(&num2, sizeof(float), 1, fp2);
}
fclose(fp1);
fclose(fp2);
fclose(fp3);
return 0;
} |
the_stack_data/10364.c | #include<stdio.h>
float calc_charges(float hours) {
if ((int)hours == 0)
return 0.0;
else if (hours > 0 && hours <= 3)
return 30.0;
else if (hours > 3 && hours <= 24){
float ch = (((hours-3)*5)+30);
return (ch > 100.0)? 100: ch;
}
return -1;
}
int main()
{
float h1, h2, h3;
printf("Enter the number of hours for car 1: ");
scanf("%f", &h1);
printf("Enter the number of hours for car 2: ");
scanf("%f", &h2);
printf("Enter the number of hours for car 3: ");
scanf("%f", &h3);
float ttl_charges = calc_charges(h1) + calc_charges(h2) + calc_charges(h3);
printf("\nCars\tHours\t\tCharges\n");
printf("1\t\t%.2f\t\t%.2f\n",h1,calc_charges(h1));
printf("2\t\t%.2f\t\t%.2f\n",h2,calc_charges(h2));
printf("3\t\t%.2f\t\t%.2f\n",h3,calc_charges(h3));
printf("Total\t%.2f\t\t%.2f\n",h1+h2+h3,ttl_charges);
return 0;
}
|
the_stack_data/37422.c | # include <stdio.h>
int main(void){
struct horario{
int hora, minuto, segundo;
};
struct horario agora, *depois;
depois = &agora;
depois -> hora = 20;
depois -> minuto = 80;
depois -> segundo = 50;
int somatorio = 100;
struct horario antes;
// operações matemáticas com ponteiros
antes.hora = somatorio + depois -> segundo;
antes.minuto = agora.hora + depois -> minuto;
antes.segundo = depois->minuto + depois->segundo;
printf("%i:%i:%i\n", antes.hora, antes.minuto, antes.segundo);
return 0;
} |
the_stack_data/242330003.c | #include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#define PORT 8000
int main(int argc, char const *argv[])
{
int server_fd, new_socket, valread,chunk;
chunk = 100000;
struct sockaddr_in address;
int opt = 1;
int addrlen = sizeof(address);
char *hello = "Hello from server";
struct stat st;
// Creating socket file descriptor
if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) // creates socket, SOCK_STREAM is for TCP. SOCK_DGRAM for UDP
{
perror("socket failed");
exit(EXIT_FAILURE);
}
// This is to lose the pesky "Address already in use" error message
if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT,&opt, sizeof(opt))) // SOL_SOCKET is the socket layer itself
{
perror("setsockopt");
exit(EXIT_FAILURE);
}
address.sin_family = AF_INET; // Address family. For IPv6, it's AF_INET6. 29 others exist like AF_UNIX etc.
address.sin_addr.s_addr = INADDR_ANY; // Accept connections from any IP address - listens from all interfaces.
address.sin_port = htons( PORT ); // Server port to open. Htons converts to Big Endian - Left to Right. RTL is Little Endian
// Forcefully attaching socket to the port 8080
if (bind(server_fd, (struct sockaddr *)&address,
sizeof(address))<0)
{
perror("bind failed");
exit(EXIT_FAILURE);
}
// Port bind is done. You want to wait for incoming connections and handle them in some way.
// The process is two step: first you listen(), then you accept()
if (listen(server_fd, 3) < 0) // 3 is the maximum size of queue - connections you haven't accepted
{
perror("listen");
exit(EXIT_FAILURE);
}
// returns a brand new socket file descriptor to use for this single accepted connection. Once done, use send and recv
if ((new_socket = accept(server_fd, (struct sockaddr *)&address,
(socklen_t*)&addrlen))<0)
{
perror("accept");
exit(EXIT_FAILURE);
}
/* valread = read(new_socket , buffer, chunk); // read infromation received into the buffer
printf("%s\n",buffer);
send(new_socket , hello , strlen(hello) , 0 ); // use sendto() and recvfrom() for DGRAM
printf("Hello message sent\n");*/
while(1){
int src,tbs = 0,filesize;
char buffer[chunk] ;
char filename[chunk];
int ready;
//valread = read(new_socket,&ready,chunk);
//printf("red %d\n",ready );
//if(ready == 0){
//break;
//}
//else if (ready == 1){
// printf("jdhdhdh\n");
valread = read(new_socket,filename,chunk);
printf("Checking..... %s\n",filename);
stat(filename,&st);
filesize = st.st_size;
src = open(filename,O_RDONLY);
if(src < 0){
perror("Source file ");
filesize = -1;
send(new_socket , &filesize , sizeof(int) , 0 );
bzero(filename,chunk);
continue;
}
send(new_socket , &filesize , sizeof(int) , 0 );
printf("Preparing to send the file... %s\n", filename);
valread = read(new_socket, filename, chunk);
tbs = 0;
//printf("djfjfj\n");
while(tbs <filesize){
bzero(buffer,chunk);
int bs = 0;
bs = read(src,buffer,chunk);
// printf(" read %s \n",buffer);
if(bs < 0){
printf("Error reading\n");
break;
}
send(new_socket,&buffer,bs,0);
tbs += bs;
}
printf("File Sent\n");
bzero(filename,chunk);
//}
}
close(new_socket);
close(server_fd);
printf("Client disconnected\n");
return 0;
}
|
the_stack_data/598271.c | // This file is part of the SV-Benchmarks collection of verification tasks:
// https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks
//
// SPDX-FileCopyrightText: 2005-2021 University of Tartu & Technische Universität München
//
// SPDX-License-Identifier: MIT
#include <assert.h>
extern void abort(void);
void reach_error()
{
assert(0);
} //6
void __VERIFIER_assert(int cond)
{
if(!(cond))
{
ERROR:
{
reach_error();
abort();
}
}
}
#include <pthread.h>
struct __anonstruct_PQUEUE_63
{
int occupied;
pthread_mutex_t mtx;
};
typedef struct __anonstruct_PQUEUE_63 PQUEUE;
PQUEUE pqb; //1
int pqueue_init(PQUEUE *qp)
{
qp->occupied = 0; //4
pthread_mutex_init(&qp->mtx, NULL);
return (0);
}
int pqueue_put(PQUEUE *qp)
{
pthread_mutex_lock(&qp->mtx);
if(qp->occupied < 1000)
(qp->occupied)++;
pthread_mutex_unlock(&qp->mtx);
return (1);
}
int pqueue_get(PQUEUE *qp)
{
int got = 0; //4
pthread_mutex_lock(&qp->mtx);
while(qp->occupied <= 0)
{
__VERIFIER_assert(qp->occupied == 0);
}
__VERIFIER_assert(qp->occupied != 0);
if(qp->occupied > 0)
{
(qp->occupied)--;
got = 1;
pthread_mutex_unlock(&qp->mtx);
}
else
{
pthread_mutex_unlock(&qp->mtx);
}
return (got);
}
void *worker(void *arg)
{
while(1)
{
pqueue_get(&pqb);
}
return NULL;
}
int main(int argc, char **argv)
{
pthread_t tid;
PQUEUE *qp = &pqb; //2
pqueue_init(&pqb);
pthread_create(&tid, NULL, &worker, NULL);
for(int i = 1; i < 3; i++)
{ //5
pqueue_put(&pqb);
}
return 0;
}
|
the_stack_data/140764620.c | /*
* Sorting Algorithms
* Selection Sort (C implementation)
* Author: Priyank Chheda
* E: [email protected]
* W: https://github.com/x899
*
* The selection sort algorithm sorts an array by repeatedly finding the
* minimum element (considering ascending order) from unsorted part and
* putting it at the beginning. The algorithm maintains two subarrays in
* a given array.
* - The subarray which is already sorted.
* - Remaining subarray which is unsorted.
*
* In every iteration of selection sort, the minimum element (considering
* ascending order) from the unsorted subarray is picked and moved to the
* sorted subarray.
*/
#include <stdio.h>
/* Function Declaration */
void selection_sort(int array[], size_t array_size);
static void print_array(int array[], size_t array_size);
static void swap(int *a, int *b);
/* Main Operational Function */
int
main(int argc, char *argv[])
{
int array[] = {229, 79, 46, 12, 58, 31, 34, 67, 89, 12, 67, 2};
size_t array_size = sizeof(array) / sizeof(array[0]);
selection_sort(array, array_size);
print_array(array, array_size);
return 0;
}
/**
* Selection Sort Function
* @param array actual array to sort
* @param array_size size of array
*/
void
selection_sort(int array[], size_t array_size)
{
for (size_t i = 0; i < array_size; i++)
{
int min_element_index = i;
for (size_t j = i+1; j < array_size; j++)
{
if (array[j] < array[min_element_index])
min_element_index = j;
}
/* swap those two element */
swap(&array[i], &array[min_element_index]);
}
}
/**
* Pretty print array Function
* @param array actual array to sort
* @param array_size size of array
*/
static void
print_array(int array[], size_t array_size)
{
for (size_t i = 0; i < array_size; i++)
{
printf("%d ", array[i]);
}
printf("\n");
}
/**
* Swapping two array elements
* @param a an integer to swap
* @param b an integer to swap
*/
static void
swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
} |
the_stack_data/159516489.c | // Copyright 2021 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if defined(_WIN32)
#include "libreprl.h"
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#define NOMINMAX
#include <Windows.h>
#define MIN(x, y) ((x) < (y) ? (x) : (y))
static uint64_t current_usecs()
{
ULONGLONG ullUnbiasedTime;
QueryUnbiasedInterruptTime(&ullUnbiasedTime);
return ullUnbiasedTime / 10;
}
static char** copy_string_array(const char** orig)
{
size_t num_entries = 0;
for (const char** current = orig; *current; current++) {
num_entries += 1;
}
char** copy = calloc(num_entries + 1, sizeof(char*));
for (size_t i = 0; i < num_entries; i++) {
copy[i] = _strdup(orig[i]);
}
return copy;
}
static void free_string_array(char** arr)
{
if (!arr) return;
for (char** current = arr; *current; current++) {
free(*current);
}
free(arr);
}
static int vasprintf(char **strp, const char *fmt, va_list ap) {
va_list argp;
va_copy(argp, ap);
int len = _vscprintf(fmt, ap);
if (len < 0) {
va_end(argp);
return -1;
}
*strp = malloc(len + 1);
if (!*strp) {
va_end(argp);
return -1;
}
len = vsprintf_s(*strp, len + 1, fmt, argp);
va_end(argp);
return len;
}
// A unidirectional communication channel for larger amounts of data, up to a
// maximum size (REPRL_MAX_DATA_SIZE).
//
// Implemented as a (RAM-backed) file for which the file descriptor is shared
// with the child process and which is mapped into our address space.
struct data_channel {
// HANDLE of the underlying mapping. Directly shared with the child process.
HANDLE hFile;
// Memory mapping of the file, always of size REPRL_MAX_DATA_SIZE.
char* mapping;
};
struct reprl_context {
// Whether reprl_initialize has been successfully performed on this context.
bool initialized;
HANDLE hControlRead;
HANDLE hControlWrite;
// Data channel REPRL -> Child
struct data_channel* data_in;
// Data channel Child -> REPRL
struct data_channel* data_out;
// Optional data channel for the child's stdout and stderr.
struct data_channel* child_stdout;
struct data_channel* child_stderr;
// PID of the child process. Will be zero if no child process is currently running.
HANDLE hChild;
// Arguments and environment for the child process.
char** argv;
char** envp;
// A malloc'd string containing a description of the last error that occurred.
char* last_error;
};
static int reprl_error(struct reprl_context* ctx, const char *format, ...)
{
va_list args;
va_start(args, format);
free(ctx->last_error);
vasprintf(&ctx->last_error, format, args);
return -1;
}
static struct data_channel* reprl_create_data_channel(struct reprl_context* ctx)
{
SECURITY_ATTRIBUTES sa = { sizeof(sa), NULL, TRUE };
HANDLE hFile = CreateFileMappingW(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE, 0, REPRL_MAX_DATA_SIZE, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return NULL;
LPVOID mapping = MapViewOfFile(hFile, FILE_MAP_ALL_ACCESS, 0, 0, REPRL_MAX_DATA_SIZE);
if (mapping == NULL) {
CloseHandle(hFile);
return NULL;
}
struct data_channel *channel = malloc(sizeof(struct data_channel));
channel->hFile = hFile;
channel->mapping = mapping;
return channel;
}
static void reprl_destroy_data_channel(struct data_channel* channel)
{
if (!channel)
return;
UnmapViewOfFile(channel->mapping);
CloseHandle(channel->hFile);
free(channel);
}
static void reprl_child_terminated(struct reprl_context* ctx)
{
if (ctx->hChild == INVALID_HANDLE_VALUE)
return;
ctx->hChild = INVALID_HANDLE_VALUE;
CloseHandle(ctx->hControlRead);
CloseHandle(ctx->hControlWrite);
}
static void reprl_terminate_child(struct reprl_context* ctx)
{
if (ctx->hChild == INVALID_HANDLE_VALUE)
return;
(void)TerminateProcess(ctx->hChild, -9);
(void)WaitForSingleObject(ctx->hChild, INFINITE);
CloseHandle(ctx->hChild);
reprl_child_terminated(ctx);
}
static int reprl_spawn_child(struct reprl_context* ctx)
{
HANDLE hFiles[4] = {
ctx->data_in->hFile,
ctx->data_out->hFile,
ctx->child_stdout ? ctx->child_stdout->hFile : INVALID_HANDLE_VALUE,
ctx->child_stderr ? ctx->child_stderr->hFile : INVALID_HANDLE_VALUE,
};
for (int index = 0; index < (sizeof(hFiles) / sizeof(*hFiles)); ++index) {
if (hFiles[index] == INVALID_HANDLE_VALUE)
continue;
assert(REPRL_MAX_DATA_SIZE <= INT32_MAX && "need to adjust SetFilePointer invocation");
SetFilePointer(hFiles[index], REPRL_MAX_DATA_SIZE, NULL, FILE_BEGIN);
SetEndOfFile(hFiles[index]);
}
SECURITY_ATTRIBUTES sa = {sizeof(sa), NULL, TRUE};
enum { PI_READ, PI_WRITE, PI_PIPES };
HANDLE output[PI_PIPES] = {INVALID_HANDLE_VALUE,INVALID_HANDLE_VALUE}; // control pipe child -> reprl
if (CreatePipe(&output[PI_READ], &output[PI_WRITE], &sa, 0))
return reprl_error(ctx, "Could not create pipe for REPRL communication: %d", GetLastError());
(void)SetHandleInformation(output[PI_READ], HANDLE_FLAG_INHERIT, 0);
HANDLE input[PI_PIPES] = {INVALID_HANDLE_VALUE,INVALID_HANDLE_VALUE}; // control pipe reprl -> child
if (CreatePipe(&input[PI_READ], &input[PI_WRITE], &sa, 0)) {
CloseHandle(output[PI_READ]);
CloseHandle(output[PI_WRITE]);
return reprl_error(ctx, "Could not create pipe for REPRL communication: %d", GetLastError());
}
(void)SetHandleInformation(input[PI_WRITE], HANDLE_FLAG_INHERIT, 0);
ctx->hControlRead = output[PI_READ];
ctx->hControlWrite = input[PI_WRITE];
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.hStdError = ctx->child_stderr ? ctx->child_stderr->hFile : INVALID_HANDLE_VALUE;
si.hStdOutput = output[PI_WRITE];
si.hStdInput = input[PI_READ];
si.dwFlags = STARTF_USESTDHANDLES;
// Build a commandline from argv.
// TODO(compnerd) fix quoting for the command line.
size_t length = 0;
for (char **arg = ctx->argv; *arg; ++arg)
length += 1 + strlen(*arg);
char *commandline = calloc(length + 1, sizeof(char));
if (!commandline)
return reprl_error(ctx, "unable to allocate memory");
for (char *pointer = commandline, **arg = ctx->argv; *arg; ++arg) {
size_t len = strlen(*arg);
strncpy_s(pointer, commandline - pointer + 1, *arg, len);
pointer += len;
*pointer++ = ' ';
}
// FIXME(compnerd) this can be problemtic if the process or command line
// arguments contains non-ASCII characters.
if (!CreateProcessA(NULL, commandline, NULL, NULL, TRUE, 0, ctx->envp, NULL, &si, &pi))
fprintf(stderr, "Failed to execute child process %s: %lu\n", ctx->argv[0], GetLastError());
free(commandline);
CloseHandle(output[PI_WRITE]);
CloseHandle(input[PI_READ]);
// We require the following services:
// PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE | SYNCHRONIZE
ctx->hChild = pi.hProcess;
DWORD dwResult;
char buffer[5] = {0};
if (!ReadFile(ctx->hControlRead, buffer, 4, &dwResult, NULL) || dwResult != 4) {
reprl_terminate_child(ctx);
return reprl_error(ctx, "Did not receive HELO message from child: %lu", GetLastError());
}
if (strncmp(buffer, "HELO", 4)) {
reprl_terminate_child(ctx);
return reprl_error(ctx, "Received invalid HELO message from child: %s", buffer);
}
if (!WriteFile(ctx->hControlWrite, buffer, 4, &dwResult, NULL) || dwResult != 4) {
reprl_terminate_child(ctx);
return reprl_error(ctx, "Faile dto send HELO reply message to child: %lu", GetLastError());
}
return 0;
}
struct reprl_context* reprl_create_context()
{
return calloc(1, sizeof(struct reprl_context));
}
int reprl_initialize_context(struct reprl_context* ctx, const char** argv, const char** envp, int capture_stdout, int capture_stderr)
{
if (ctx->initialized)
return reprl_error(ctx, "Context is already initialized");
ctx->argv = copy_string_array(argv);
ctx->envp = copy_string_array(envp);
ctx->data_in = reprl_create_data_channel(ctx);
ctx->data_out = reprl_create_data_channel(ctx);
if (capture_stdout)
ctx->child_stdout = reprl_create_data_channel(ctx);
if (capture_stderr)
ctx->child_stderr = reprl_create_data_channel(ctx);
// Proper error message will have been set by reprl_create_data_channel
if (!ctx->data_in || !ctx->data_out || (capture_stdout && !ctx->child_stdout) || (capture_stderr && !ctx->child_stderr))
return -1;
ctx->initialized = true;
return 0;
}
void reprl_destroy_context(struct reprl_context* ctx)
{
reprl_terminate_child(ctx);
free_string_array(ctx->argv);
free_string_array(ctx->envp);
reprl_destroy_data_channel(ctx->data_in);
reprl_destroy_data_channel(ctx->data_out);
reprl_destroy_data_channel(ctx->child_stdout);
reprl_destroy_data_channel(ctx->child_stderr);
free(ctx->last_error);
free(ctx);
}
int reprl_execute(struct reprl_context* ctx, const char* script, uint64_t script_length, uint64_t timeout, uint64_t* execution_time, int fresh_instance)
{
if (!ctx->initialized)
return reprl_error(ctx, "REPRL context is not initialized");
if (script_length > REPRL_MAX_DATA_SIZE)
return reprl_error(ctx, "Script too large");
if (fresh_instance && ctx->hChild != INVALID_HANDLE_VALUE)
reprl_terminate_child(ctx);
SetFilePointer(ctx->data_out->hFile, 0, 0, FILE_BEGIN);
SetFilePointer(ctx->data_in->hFile, 0, 0, FILE_BEGIN);
if (ctx->child_stdout)
SetFilePointer(ctx->child_stdout->hFile, 0, 0, FILE_BEGIN);
if (ctx->child_stderr)
SetFilePointer(ctx->child_stderr->hFile, 0, 0, FILE_BEGIN);
if (ctx->hChild == INVALID_HANDLE_VALUE) {
int r = reprl_spawn_child(ctx);
if (r)
return r;
}
// Copy the script to the data channel.
memcpy(ctx->data_out->mapping, script, script_length);
// Tell child to execute the script.
DWORD dwBytesWritten;
if (!WriteFile(ctx->hControlWrite, "exec", 4, &dwBytesWritten, NULL) || dwBytesWritten != 4) {
DWORD dwExitCode;
if (GetExitCodeProcess(ctx->hChild, &dwExitCode) != STILL_ACTIVE) {
reprl_child_terminated(ctx);
return reprl_error(ctx, "Child unexpected terminated with status %u between executions", dwExitCode);
}
return reprl_error(ctx, "Failed to send command to child process: %d", GetLastError());
}
if (!WriteFile(ctx->hControlWrite, &script_length, sizeof(script_length), &dwBytesWritten, NULL) || dwBytesWritten != sizeof(script_length)) {
DWORD dwExitCode;
if (GetExitCodeProcess(ctx->hChild, &dwExitCode) != STILL_ACTIVE) {
reprl_child_terminated(ctx);
return reprl_error(ctx, "Child unexpected terminated with status %u between executions", dwExitCode);
}
return reprl_error(ctx, "Failed to send command to child process: %d", GetLastError());
}
switch (WaitForSingleObject(ctx->hChild, timeout / 1000)) {
case WAIT_TIMEOUT:
reprl_terminate_child(ctx);
return 1 << 16;
case WAIT_OBJECT_0:
break;
default:
return reprl_error(ctx, "WaitForSingleObject error: %d", GetLastError());
}
int status;
DWORD dwBytesRead;
if (!ReadFile(ctx->hControlRead, &status, sizeof(status), &dwBytesRead, NULL))
return reprl_error(ctx, "unable to read from control pipe: %d", GetLastError());
if (dwBytesRead == sizeof(status))
return status & 0xffff;
DWORD dwExitCode;
BOOL bSuccess;
bSuccess = GetExitCodeProcess(ctx->hChild, &dwExitCode);
reprl_terminate_child(ctx);
if (bSuccess)
return status & 0xffff;
return reprl_error(ctx, "child in weird state after execution");
}
static const char* fetch_data_channel_content(struct data_channel* channel)
{
if (!channel)
return "";
DWORD pos = SetFilePointer(channel->hFile, 0, 0, FILE_CURRENT);
pos = MIN(pos, REPRL_MAX_DATA_SIZE - 1);
channel->mapping[pos] = 0;
return channel->mapping;
}
const char* reprl_fetch_fuzzout(struct reprl_context* ctx)
{
return fetch_data_channel_content(ctx->data_in);
}
const char* reprl_fetch_stdout(struct reprl_context* ctx)
{
return fetch_data_channel_content(ctx->child_stdout);
}
const char* reprl_fetch_stderr(struct reprl_context* ctx)
{
return fetch_data_channel_content(ctx->child_stderr);
}
const char* reprl_get_last_error(struct reprl_context* ctx)
{
return ctx->last_error;
}
#endif
|
the_stack_data/5234.c | #include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <sys/wait.h>
int main(void)
{
pid_t pid;
int status;
/* Get and print my own pid, then fork
and check for errors */
printf("My PID is %d\n", getpid());
if ( (pid = fork()) == -1 )
{
perror("Can't fork");
return 1;
}
if (pid == 0)
{
/* If pid is 0 we are in the child process,
from here we execute 'man ls' */
if ( execl("/usr/bin/man", "man", "ls",
(char*)NULL) == -1 )
{
perror("Can't exec");
return 1;
}
}
else if(pid > 0)
{
/* In the parent we must wait for the child
to exit with waitpid(). Afterward, the
child exit status is written to 'status' */
waitpid(pid, &status, 0);
printf("Child executed with PID %d\n", pid);
printf("Its return status was %d\n", status);
}
else
{
fprintf(stderr, "Something went wrong "
"forking\n");
return 1;
}
return 0;
}
|
the_stack_data/3261724.c | #include <stdio.h>
int main(){
float n, max = 0;
while (1){
printf("Enter a number: ");
scanf("%f", &n);
if (n <= 0)
break;
if (n > max)
max = n;
}
printf("The largest number entered was %.2f\n", max);
return 0;
}
|
the_stack_data/1164857.c | #include <stdio.h>
void main() {
/*
* Implemente um programa que solicite ao utilizador dois inteiros e, em seguida,
* aplique todos os operadores relacionais de C aos inteiros lidos.
*/
/* int valorX, valorY;
printf("Digite dois inteiros: ");
scanf("%d%d", &valorX, &valorY);
printf("O resultado de %d == %d : %d\n", valorX, valorY, valorX == valorY);
printf("O resultado de %d > %d : %d\n", valorX, valorY, valorX > valorY);
printf("O resultado de %d < %d : %d\n", valorX, valorY, valorX < valorY);
printf("O resultado de %d >= %d : %d\n", valorX, valorY, valorX >= valorY);
printf("O resultado de %d != %d : %d\n", valorX, valorY, valorX != valorY);
*/
/*
* Um programa que solicite um salário ao utilizador e mostre o imposto a pagar.
* Se o salário for negativo ou zero mostre o erro respectivo.
* Se o salário for maior que 1000, paga 10% de imposto, se não paga apenas 5%.
*
*/
float salario, imposto;
printf("Informe o seu salario: ");
scanf("%f", &salario);
if(salario <= 0) {
printf("Salario Invalido");
return ;
} else if (salario <= 1000){
imposto = salario * 0.05;
} else {
imposto = salario * 0.1;
}
printf("O valor do seu imposto e de: %.2f \n", imposto);
} |
the_stack_data/155682.c | #include <stdarg.h>
int foo(int A, __attribute__((annotate("psr.sink"))) int B) { return 0; }
__attribute__((annotate("psr.source"))) int bar() { return 0; }
int baz(int A, __attribute__((annotate("psr.sink"))) int B, int C) { return 0; }
void quark() {}
double average(int Count, ...) {
va_list Args;
double Tot = 0;
va_start(Args, Count);
for (int J = 0; J < Count; J++) {
Tot += va_arg(Args, double);
}
va_end(Args);
return Tot / Count;
}
int main() {
int A = foo(42, 13);
int B = bar();
int C = A + 42;
C = baz(C, A, B);
quark();
double Avg = average(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
return C;
}
|
the_stack_data/295829.c | /*
* Record progress memory snapshot into * * file,the coredump file.
*
*/
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
int main()
{
char abc[12]={0};
pid_t pid = fork();
if(pid<0)
exit(1);
else if (pid == 0){
printf("son process %zu!\n",getpid());
raise(SIGABRT);
}
else{
printf("father process %zu!\n",getpid());
raise(SIGABRT);
}
return 0;
}
|
the_stack_data/68887437.c | /*!
* @file main.c
* @brief 06. Funciones - Argumentos por Valor - 02. Scope o alcance de una variable
* @author Javier Balloffet <[email protected]>
* @date Sep 7, 2018
*/
#include <stdio.h>
void increment(int number);
int main() {
int number = 1;
// Invoco a "increment" y muestro el valor de "number" antes y después de llamar a la función.
printf("Valor de \"number\" en main() antes de incrementar = %d\n", number);
increment(number);
printf("Valor de \"number\" en main() despues de incrementar = %d\n", number);
return 0;
}
void increment(int number) {
printf("Valor de \"number\" en increment() antes de incrementar = %d\n", number);
number++;
printf("Valor de \"number\" en increment() despues de incrementar = %d\n", number);
}
|
the_stack_data/51699705.c | #include <stdio.h>
int main(){
double M[12][12];
char O[0];
int aux = 0, i, j;
double soma = 0;
scanf("%c", &O[0]);
for (i=0; i<12; i++){
for (j=0; j<12; j++){
scanf("%lf",&M[i][j]);
}
}
for (i=0; i<5; i++){
for(j=i+1; j<11-aux; j++){
soma = M[i][j] + soma;
}
aux = aux + 1;
}
if(O[0]=='M'){
soma = soma/30;
}
printf("%.1lf\n", soma);
return 0;
}
|
the_stack_data/72012360.c | // RUN: %clang_cc1 %s -emit-llvm -o -
struct V { short X, Y; };
int bar() {
struct V bar;
__asm__ volatile("foo %0\n" : "=r"(bar));
return bar.X;
}
|
the_stack_data/35971.c | //
// Created by zhangrongxiang on 2017/10/31 15:14
// File pipe3
//
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
#include<fcntl.h>
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<signal.h>
#define ERR_EXIT(m) \
do { \
perror(m); \
exit(EXIT_FAILURE); \
} while(0)
void handler(int sig) {
printf("recv sig=%d\n", sig);
}
int main(int argc, char *argv[]) {
signal(SIGPIPE, handler);
int pipefd[2];
if (pipe(pipefd) == -1)
ERR_EXIT("pipe error");
pid_t pid;
pid = fork();
if (pid == -1)
ERR_EXIT("fork error");
if (pid == 0) {
close(pipefd[0]);
exit(EXIT_SUCCESS);
}
close(pipefd[0]);
sleep(1);
int ret = write(pipefd[1], "hello", 5);
if (ret == -1) {
printf("err=%s\n", strerror(errno));
}
// recv sig=13
// err=Broken pipe
return 0;
} |
the_stack_data/117327123.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: exam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/02 18:35:46 by exam #+# #+# */
/* Updated: 2019/08/02 18:37:02 by exam ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int tmp;
tmp =*a;
*a = *b;
*b = tmp;
}
|
the_stack_data/165767414.c | // SPDX-License-Identifier: GPL-2.0-or-later
/* -*- linux-c -*- ------------------------------------------------------- *
*
* Copyright (C) 2012 Intel Corporation
* Author: Yuanhan Liu <[email protected]>
*
* Based on sse2.c: Copyright 2002 H. Peter Anvin - All Rights Reserved
*
* ----------------------------------------------------------------------- */
/*
* AVX2 implementation of RAID-6 syndrome functions
*
*/
#ifdef CONFIG_AS_AVX2
#include <linux/raid/pq.h>
#include "x86.h"
static const struct raid6_avx2_constants {
u64 x1d[4];
} raid6_avx2_constants __aligned(32) = {
{ 0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL,
0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL,},
};
static int raid6_have_avx2(void)
{
return boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_AVX);
}
/*
* Plain AVX2 implementation
*/
static void raid6_avx21_gen_syndrome(int disks, size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = disks - 3; /* Highest data disk */
p = dptr[z0+1]; /* XOR parity */
q = dptr[z0+2]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" : : "m" (raid6_avx2_constants.x1d[0]));
asm volatile("vpxor %ymm3,%ymm3,%ymm3"); /* Zero temp */
for (d = 0; d < bytes; d += 32) {
asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
asm volatile("vmovdqa %0,%%ymm2" : : "m" (dptr[z0][d]));/* P[0] */
asm volatile("prefetchnta %0" : : "m" (dptr[z0-1][d]));
asm volatile("vmovdqa %ymm2,%ymm4");/* Q[0] */
asm volatile("vmovdqa %0,%%ymm6" : : "m" (dptr[z0-1][d]));
for (z = z0-2; z >= 0; z--) {
asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
asm volatile("vpcmpgtb %ymm4,%ymm3,%ymm5");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm6,%ymm2,%ymm2");
asm volatile("vpxor %ymm6,%ymm4,%ymm4");
asm volatile("vmovdqa %0,%%ymm6" : : "m" (dptr[z][d]));
}
asm volatile("vpcmpgtb %ymm4,%ymm3,%ymm5");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm6,%ymm2,%ymm2");
asm volatile("vpxor %ymm6,%ymm4,%ymm4");
asm volatile("vmovntdq %%ymm2,%0" : "=m" (p[d]));
asm volatile("vpxor %ymm2,%ymm2,%ymm2");
asm volatile("vmovntdq %%ymm4,%0" : "=m" (q[d]));
asm volatile("vpxor %ymm4,%ymm4,%ymm4");
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
static void raid6_avx21_xor_syndrome(int disks, int start, int stop,
size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = stop; /* P/Q right side optimization */
p = dptr[disks-2]; /* XOR parity */
q = dptr[disks-1]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" : : "m" (raid6_avx2_constants.x1d[0]));
for (d = 0 ; d < bytes ; d += 32) {
asm volatile("vmovdqa %0,%%ymm4" :: "m" (dptr[z0][d]));
asm volatile("vmovdqa %0,%%ymm2" : : "m" (p[d]));
asm volatile("vpxor %ymm4,%ymm2,%ymm2");
/* P/Q data pages */
for (z = z0-1 ; z >= start ; z--) {
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vmovdqa %0,%%ymm5" :: "m" (dptr[z][d]));
asm volatile("vpxor %ymm5,%ymm2,%ymm2");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
}
/* P/Q left side optimization */
for (z = start-1 ; z >= 0 ; z--) {
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
}
asm volatile("vpxor %0,%%ymm4,%%ymm4" : : "m" (q[d]));
/* Don't use movntdq for r/w memory area < cache line */
asm volatile("vmovdqa %%ymm4,%0" : "=m" (q[d]));
asm volatile("vmovdqa %%ymm2,%0" : "=m" (p[d]));
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
const struct raid6_calls raid6_avx2x1 = {
raid6_avx21_gen_syndrome,
raid6_avx21_xor_syndrome,
raid6_have_avx2,
"avx2x1",
1 /* Has cache hints */
};
/*
* Unrolled-by-2 AVX2 implementation
*/
static void raid6_avx22_gen_syndrome(int disks, size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = disks - 3; /* Highest data disk */
p = dptr[z0+1]; /* XOR parity */
q = dptr[z0+2]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" : : "m" (raid6_avx2_constants.x1d[0]));
asm volatile("vpxor %ymm1,%ymm1,%ymm1"); /* Zero temp */
/* We uniformly assume a single prefetch covers at least 32 bytes */
for (d = 0; d < bytes; d += 64) {
asm volatile("prefetchnta %0" : : "m" (dptr[z0][d]));
asm volatile("prefetchnta %0" : : "m" (dptr[z0][d+32]));
asm volatile("vmovdqa %0,%%ymm2" : : "m" (dptr[z0][d]));/* P[0] */
asm volatile("vmovdqa %0,%%ymm3" : : "m" (dptr[z0][d+32]));/* P[1] */
asm volatile("vmovdqa %ymm2,%ymm4"); /* Q[0] */
asm volatile("vmovdqa %ymm3,%ymm6"); /* Q[1] */
for (z = z0-1; z >= 0; z--) {
asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
asm volatile("prefetchnta %0" : : "m" (dptr[z][d+32]));
asm volatile("vpcmpgtb %ymm4,%ymm1,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm1,%ymm7");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vmovdqa %0,%%ymm5" : : "m" (dptr[z][d]));
asm volatile("vmovdqa %0,%%ymm7" : : "m" (dptr[z][d+32]));
asm volatile("vpxor %ymm5,%ymm2,%ymm2");
asm volatile("vpxor %ymm7,%ymm3,%ymm3");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
}
asm volatile("vmovntdq %%ymm2,%0" : "=m" (p[d]));
asm volatile("vmovntdq %%ymm3,%0" : "=m" (p[d+32]));
asm volatile("vmovntdq %%ymm4,%0" : "=m" (q[d]));
asm volatile("vmovntdq %%ymm6,%0" : "=m" (q[d+32]));
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
static void raid6_avx22_xor_syndrome(int disks, int start, int stop,
size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = stop; /* P/Q right side optimization */
p = dptr[disks-2]; /* XOR parity */
q = dptr[disks-1]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" : : "m" (raid6_avx2_constants.x1d[0]));
for (d = 0 ; d < bytes ; d += 64) {
asm volatile("vmovdqa %0,%%ymm4" :: "m" (dptr[z0][d]));
asm volatile("vmovdqa %0,%%ymm6" :: "m" (dptr[z0][d+32]));
asm volatile("vmovdqa %0,%%ymm2" : : "m" (p[d]));
asm volatile("vmovdqa %0,%%ymm3" : : "m" (p[d+32]));
asm volatile("vpxor %ymm4,%ymm2,%ymm2");
asm volatile("vpxor %ymm6,%ymm3,%ymm3");
/* P/Q data pages */
for (z = z0-1 ; z >= start ; z--) {
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpxor %ymm7,%ymm7,%ymm7");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm7,%ymm7");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vmovdqa %0,%%ymm5" :: "m" (dptr[z][d]));
asm volatile("vmovdqa %0,%%ymm7"
:: "m" (dptr[z][d+32]));
asm volatile("vpxor %ymm5,%ymm2,%ymm2");
asm volatile("vpxor %ymm7,%ymm3,%ymm3");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
}
/* P/Q left side optimization */
for (z = start-1 ; z >= 0 ; z--) {
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpxor %ymm7,%ymm7,%ymm7");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm7,%ymm7");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
}
asm volatile("vpxor %0,%%ymm4,%%ymm4" : : "m" (q[d]));
asm volatile("vpxor %0,%%ymm6,%%ymm6" : : "m" (q[d+32]));
/* Don't use movntdq for r/w memory area < cache line */
asm volatile("vmovdqa %%ymm4,%0" : "=m" (q[d]));
asm volatile("vmovdqa %%ymm6,%0" : "=m" (q[d+32]));
asm volatile("vmovdqa %%ymm2,%0" : "=m" (p[d]));
asm volatile("vmovdqa %%ymm3,%0" : "=m" (p[d+32]));
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
const struct raid6_calls raid6_avx2x2 = {
raid6_avx22_gen_syndrome,
raid6_avx22_xor_syndrome,
raid6_have_avx2,
"avx2x2",
1 /* Has cache hints */
};
#ifdef CONFIG_X86_64
/*
* Unrolled-by-4 AVX2 implementation
*/
static void raid6_avx24_gen_syndrome(int disks, size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = disks - 3; /* Highest data disk */
p = dptr[z0+1]; /* XOR parity */
q = dptr[z0+2]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" : : "m" (raid6_avx2_constants.x1d[0]));
asm volatile("vpxor %ymm1,%ymm1,%ymm1"); /* Zero temp */
asm volatile("vpxor %ymm2,%ymm2,%ymm2"); /* P[0] */
asm volatile("vpxor %ymm3,%ymm3,%ymm3"); /* P[1] */
asm volatile("vpxor %ymm4,%ymm4,%ymm4"); /* Q[0] */
asm volatile("vpxor %ymm6,%ymm6,%ymm6"); /* Q[1] */
asm volatile("vpxor %ymm10,%ymm10,%ymm10"); /* P[2] */
asm volatile("vpxor %ymm11,%ymm11,%ymm11"); /* P[3] */
asm volatile("vpxor %ymm12,%ymm12,%ymm12"); /* Q[2] */
asm volatile("vpxor %ymm14,%ymm14,%ymm14"); /* Q[3] */
for (d = 0; d < bytes; d += 128) {
for (z = z0; z >= 0; z--) {
asm volatile("prefetchnta %0" : : "m" (dptr[z][d]));
asm volatile("prefetchnta %0" : : "m" (dptr[z][d+32]));
asm volatile("prefetchnta %0" : : "m" (dptr[z][d+64]));
asm volatile("prefetchnta %0" : : "m" (dptr[z][d+96]));
asm volatile("vpcmpgtb %ymm4,%ymm1,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm1,%ymm7");
asm volatile("vpcmpgtb %ymm12,%ymm1,%ymm13");
asm volatile("vpcmpgtb %ymm14,%ymm1,%ymm15");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpaddb %ymm12,%ymm12,%ymm12");
asm volatile("vpaddb %ymm14,%ymm14,%ymm14");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpand %ymm0,%ymm13,%ymm13");
asm volatile("vpand %ymm0,%ymm15,%ymm15");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vpxor %ymm13,%ymm12,%ymm12");
asm volatile("vpxor %ymm15,%ymm14,%ymm14");
asm volatile("vmovdqa %0,%%ymm5" : : "m" (dptr[z][d]));
asm volatile("vmovdqa %0,%%ymm7" : : "m" (dptr[z][d+32]));
asm volatile("vmovdqa %0,%%ymm13" : : "m" (dptr[z][d+64]));
asm volatile("vmovdqa %0,%%ymm15" : : "m" (dptr[z][d+96]));
asm volatile("vpxor %ymm5,%ymm2,%ymm2");
asm volatile("vpxor %ymm7,%ymm3,%ymm3");
asm volatile("vpxor %ymm13,%ymm10,%ymm10");
asm volatile("vpxor %ymm15,%ymm11,%ymm11");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vpxor %ymm13,%ymm12,%ymm12");
asm volatile("vpxor %ymm15,%ymm14,%ymm14");
}
asm volatile("vmovntdq %%ymm2,%0" : "=m" (p[d]));
asm volatile("vpxor %ymm2,%ymm2,%ymm2");
asm volatile("vmovntdq %%ymm3,%0" : "=m" (p[d+32]));
asm volatile("vpxor %ymm3,%ymm3,%ymm3");
asm volatile("vmovntdq %%ymm10,%0" : "=m" (p[d+64]));
asm volatile("vpxor %ymm10,%ymm10,%ymm10");
asm volatile("vmovntdq %%ymm11,%0" : "=m" (p[d+96]));
asm volatile("vpxor %ymm11,%ymm11,%ymm11");
asm volatile("vmovntdq %%ymm4,%0" : "=m" (q[d]));
asm volatile("vpxor %ymm4,%ymm4,%ymm4");
asm volatile("vmovntdq %%ymm6,%0" : "=m" (q[d+32]));
asm volatile("vpxor %ymm6,%ymm6,%ymm6");
asm volatile("vmovntdq %%ymm12,%0" : "=m" (q[d+64]));
asm volatile("vpxor %ymm12,%ymm12,%ymm12");
asm volatile("vmovntdq %%ymm14,%0" : "=m" (q[d+96]));
asm volatile("vpxor %ymm14,%ymm14,%ymm14");
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
static void raid6_avx24_xor_syndrome(int disks, int start, int stop,
size_t bytes, void **ptrs)
{
u8 **dptr = (u8 **)ptrs;
u8 *p, *q;
int d, z, z0;
z0 = stop; /* P/Q right side optimization */
p = dptr[disks-2]; /* XOR parity */
q = dptr[disks-1]; /* RS syndrome */
kernel_fpu_begin();
asm volatile("vmovdqa %0,%%ymm0" :: "m" (raid6_avx2_constants.x1d[0]));
for (d = 0 ; d < bytes ; d += 128) {
asm volatile("vmovdqa %0,%%ymm4" :: "m" (dptr[z0][d]));
asm volatile("vmovdqa %0,%%ymm6" :: "m" (dptr[z0][d+32]));
asm volatile("vmovdqa %0,%%ymm12" :: "m" (dptr[z0][d+64]));
asm volatile("vmovdqa %0,%%ymm14" :: "m" (dptr[z0][d+96]));
asm volatile("vmovdqa %0,%%ymm2" : : "m" (p[d]));
asm volatile("vmovdqa %0,%%ymm3" : : "m" (p[d+32]));
asm volatile("vmovdqa %0,%%ymm10" : : "m" (p[d+64]));
asm volatile("vmovdqa %0,%%ymm11" : : "m" (p[d+96]));
asm volatile("vpxor %ymm4,%ymm2,%ymm2");
asm volatile("vpxor %ymm6,%ymm3,%ymm3");
asm volatile("vpxor %ymm12,%ymm10,%ymm10");
asm volatile("vpxor %ymm14,%ymm11,%ymm11");
/* P/Q data pages */
for (z = z0-1 ; z >= start ; z--) {
asm volatile("prefetchnta %0" :: "m" (dptr[z][d]));
asm volatile("prefetchnta %0" :: "m" (dptr[z][d+64]));
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpxor %ymm7,%ymm7,%ymm7");
asm volatile("vpxor %ymm13,%ymm13,%ymm13");
asm volatile("vpxor %ymm15,%ymm15,%ymm15");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm7,%ymm7");
asm volatile("vpcmpgtb %ymm12,%ymm13,%ymm13");
asm volatile("vpcmpgtb %ymm14,%ymm15,%ymm15");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpaddb %ymm12,%ymm12,%ymm12");
asm volatile("vpaddb %ymm14,%ymm14,%ymm14");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpand %ymm0,%ymm13,%ymm13");
asm volatile("vpand %ymm0,%ymm15,%ymm15");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vpxor %ymm13,%ymm12,%ymm12");
asm volatile("vpxor %ymm15,%ymm14,%ymm14");
asm volatile("vmovdqa %0,%%ymm5" :: "m" (dptr[z][d]));
asm volatile("vmovdqa %0,%%ymm7"
:: "m" (dptr[z][d+32]));
asm volatile("vmovdqa %0,%%ymm13"
:: "m" (dptr[z][d+64]));
asm volatile("vmovdqa %0,%%ymm15"
:: "m" (dptr[z][d+96]));
asm volatile("vpxor %ymm5,%ymm2,%ymm2");
asm volatile("vpxor %ymm7,%ymm3,%ymm3");
asm volatile("vpxor %ymm13,%ymm10,%ymm10");
asm volatile("vpxor %ymm15,%ymm11,%ymm11");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vpxor %ymm13,%ymm12,%ymm12");
asm volatile("vpxor %ymm15,%ymm14,%ymm14");
}
asm volatile("prefetchnta %0" :: "m" (q[d]));
asm volatile("prefetchnta %0" :: "m" (q[d+64]));
/* P/Q left side optimization */
for (z = start-1 ; z >= 0 ; z--) {
asm volatile("vpxor %ymm5,%ymm5,%ymm5");
asm volatile("vpxor %ymm7,%ymm7,%ymm7");
asm volatile("vpxor %ymm13,%ymm13,%ymm13");
asm volatile("vpxor %ymm15,%ymm15,%ymm15");
asm volatile("vpcmpgtb %ymm4,%ymm5,%ymm5");
asm volatile("vpcmpgtb %ymm6,%ymm7,%ymm7");
asm volatile("vpcmpgtb %ymm12,%ymm13,%ymm13");
asm volatile("vpcmpgtb %ymm14,%ymm15,%ymm15");
asm volatile("vpaddb %ymm4,%ymm4,%ymm4");
asm volatile("vpaddb %ymm6,%ymm6,%ymm6");
asm volatile("vpaddb %ymm12,%ymm12,%ymm12");
asm volatile("vpaddb %ymm14,%ymm14,%ymm14");
asm volatile("vpand %ymm0,%ymm5,%ymm5");
asm volatile("vpand %ymm0,%ymm7,%ymm7");
asm volatile("vpand %ymm0,%ymm13,%ymm13");
asm volatile("vpand %ymm0,%ymm15,%ymm15");
asm volatile("vpxor %ymm5,%ymm4,%ymm4");
asm volatile("vpxor %ymm7,%ymm6,%ymm6");
asm volatile("vpxor %ymm13,%ymm12,%ymm12");
asm volatile("vpxor %ymm15,%ymm14,%ymm14");
}
asm volatile("vmovntdq %%ymm2,%0" : "=m" (p[d]));
asm volatile("vmovntdq %%ymm3,%0" : "=m" (p[d+32]));
asm volatile("vmovntdq %%ymm10,%0" : "=m" (p[d+64]));
asm volatile("vmovntdq %%ymm11,%0" : "=m" (p[d+96]));
asm volatile("vpxor %0,%%ymm4,%%ymm4" : : "m" (q[d]));
asm volatile("vpxor %0,%%ymm6,%%ymm6" : : "m" (q[d+32]));
asm volatile("vpxor %0,%%ymm12,%%ymm12" : : "m" (q[d+64]));
asm volatile("vpxor %0,%%ymm14,%%ymm14" : : "m" (q[d+96]));
asm volatile("vmovntdq %%ymm4,%0" : "=m" (q[d]));
asm volatile("vmovntdq %%ymm6,%0" : "=m" (q[d+32]));
asm volatile("vmovntdq %%ymm12,%0" : "=m" (q[d+64]));
asm volatile("vmovntdq %%ymm14,%0" : "=m" (q[d+96]));
}
asm volatile("sfence" : : : "memory");
kernel_fpu_end();
}
const struct raid6_calls raid6_avx2x4 = {
raid6_avx24_gen_syndrome,
raid6_avx24_xor_syndrome,
raid6_have_avx2,
"avx2x4",
1 /* Has cache hints */
};
#endif
#endif /* CONFIG_AS_AVX2 */
|
the_stack_data/878054.c | /* This test file is part of GDB, the GNU debugger.
Copyright 2007-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
double a = 1.0/0.0;
double b = 0.0/0.0;
double c;
int
main()
{
c = a + b;
return 0;
}
|
the_stack_data/104942.c | // Method 1:
// #include <stdio.h>
// int main()
// {
// int a[100], n, i, j, position, swap;
// printf("Enter number of element\n");
// scanf("%d", &n);
// printf("Enter %d Number\n", n);
// for (i = 0; i < n; i++)
// scanf("%d", &a[i]);
// for (i = 0; i < n - 1; i++)
// {
// position = i;
// for (j = i + 1; j < n; j++)
// {
// if (a[position] > a[j])
// position = j;
// }
// if (position != i)
// {
// swap = a[i];
// a[i] = a[position];
// a[position] = swap;
// }
// }
// printf("Sorted Array:\n");
// for (i = 0; i < n; i++)
// printf("%d\n", a[i]);
// return 0;
// }
// Method 2:
// #include <stdio.h>
// void SelSort(int array[], int n);
// int main()
// {
// int array[100], n, i;
// printf("Enter number of element\n");
// scanf("%d", &n);
// printf("Enter %d Numbers\n", n);
// for (i = 0; i < n; i++)
// scanf("%d", &array[i]);
// SelSort(array, n);
// return 0;
// }
// void SelSort(int array[], int n)
// {
// int i, j, position, swap;
// for (i = 0; i < (n - 1); i++)
// {
// position = i;
// for (j = i + 1; j < n; j++)
// {
// if (array[position] > array[j])
// position = j;
// }
// if (position != i)
// {
// swap = array[i];
// array[i] = array[position];
// array[position] = swap;
// }
// }
// printf("Sorted Array:\n");
// for (i = 0; i < n; i++)
// printf("%d\n", array[i]);
// }
// Method 3:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define MAX_SIZE 101
#define SWAP(x, y, t) ((t) = (x), (x) = (y), (y) = (t))
void sort(int [], int);
void main(void)
{
int i, n;
int list[MAX_SIZE];
srand(time(NULL));
printf("Enter the number of numbers to generate:\n");
scanf("%d", &n);
printf("Create %d numbers\n", n);
if(n<1||n>MAX_SIZE)
{
fprintf(stderr, "Improper value of n\n");
exit(EXIT_FAILURE);
}
for(i=0;i<n;i++)
{
list[i] = rand()%1000;
printf("%d\n", list[i]);
}
sort(list, n);
printf("\n Sorted array: \n");
for(i=0;i<n;i++)
{
printf("%d\n", list[i]);
}
printf("\n");
}
void sort(int list[], int n)
{
int i, j, min, temp;
for(i=0; i<n-1; i++)
{
min = i;
for(j = i+1; j<n; j++)
{
if(list[j]<list[min])
min = j;
}
SWAP(list[i], list[min], temp);
}
} |
the_stack_data/107954006.c | int
main(int argc, char *argv[]) {
exit(1);
}
|
the_stack_data/48574819.c | #ifdef USING_MPI
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <mappingreader/mappingreader.h>
#include "memory/memory_range.h"
#include "simulator/distributed/output.h"
int get_mpi_eventid_mapping_datatype(MPI_Datatype* mpi_mapping_datatype) {
int err;
int blocklengths[6] = {1, 1, 1, 1, 1, 1};
MPI_Datatype types[6] = {MPI_UINT8_T, MPI_UINT8_T, MPI_UINT8_T, MPI_UINT8_T, MPI_UINT8_T, MPI_UINT8_T};
MPI_Aint offsets[6];
offsets[0] = offsetof(struct EventIDMapping, guest_update_cr);
offsets[1] = offsetof(struct EventIDMapping, instruction_fetch);
offsets[2] = offsetof(struct EventIDMapping, guest_mem_load_before_exec);
offsets[3] = offsetof(struct EventIDMapping, guest_mem_store_before_exec);
offsets[4] = offsetof(struct EventIDMapping, guest_flush_tlb_invlpg);
offsets[5] = offsetof(struct EventIDMapping, guest_start_exec_tb);
err = MPI_Type_create_struct(6, blocklengths, offsets, types, mpi_mapping_datatype);
if(err){
return err;
}
return MPI_Type_commit(mpi_mapping_datatype);
}
int get_mpi_memoryrange_datatype(MPI_Datatype* mpi_memoryrange_datatype) {
int blocklenghts[2] = {8, 8};
MPI_Datatype types[2] = {MPI_UINT64_T, MPI_UINT64_T};
MPI_Aint offsets[2] = {offsetof(struct MemoryRange, start_addr), offsetof(struct MemoryRange, start_addr)};
if(MPI_Type_create_struct(2, blocklenghts, offsets, types, mpi_memoryrange_datatype)) {
return 1;
}
return MPI_Type_commit(mpi_memoryrange_datatype);
}
int get_mpi_cache_miss_datatype(MPI_Datatype* mpi_cache_miss_datatype) {
int blocklengths[3] = {1, 1, 1};
MPI_Datatype types[3] = {MPI_UINT64_T, MPI_UINT64_T, MPI_UINT8_T};
MPI_Aint offsets[3] = {offsetof(struct CacheMiss, addr), offsetof(struct CacheMiss, timestamp), offsetof(struct CacheMiss, cpu)};
if(MPI_Type_create_struct(3, blocklengths, offsets, types, mpi_cache_miss_datatype)){
return 1;
}
return MPI_Type_commit(mpi_cache_miss_datatype);
}
#endif /*MPI*/
|
the_stack_data/662783.c | #include <stdio.h>
#include <stdlib.h>
void merge(int *v1, int left, int middle, int right){
int *v2 = malloc((right-left+1)*sizeof(int));
int i = left;
int j = middle + 1;
int k = 0;
while(i<=middle && j<=right){
if(v1[i] <= v1[j]){
v2[k] = v1[i];
k++, i++;
}
else{
v2[k] = v1[j];
k++, j++;
}
}
while(i<=middle){
v2[k] = v1[i];
k++, i++;
}
while(j<=right){
v2[k] = v1[j];
k++, j++;
}
k = 0;
for(i = left; i<=right; i++){
v1[i] = v2[k];
k++;
}
free(v2);
}
void mergesort(int *v, int left, int right){
if(left>=right)
return;
int middle = (left+right)/2;
mergesort(v, left, middle);
mergesort(v, middle+1, right);
merge(v, left, middle, right);
}
int main(){
int qtd, num, cont=0, i;
scanf("%d", &qtd);
int *v = malloc(qtd*sizeof(int));
for(i = 0; i<qtd; i++){
scanf("%d", &num);
v[i] = num;
}
mergesort(v, 0, i-1);
for(int j = 0; j<qtd-1; j++){
if(v[j] == v[j+1])
cont++;
}
int res = qtd - cont;
printf("%d\n", res);
free(v);
return 0;
} |
the_stack_data/65539.c | /*
* https://code.google.com/p/android/issues/detail?id=228260
* https://issuetracker.google.com/issues/37127518
* CVE-2017-10997
* The poc was tested in pixel, google/sailfish/sailfish:7.1/NDE63L/3273814:user/release-keys
* [email protected] , 20161221
*/
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <asm/ioctl.h>
char *pci_msm_path = "/sys/kernel/debug//pci-msm/";
#define SIZE 64
int write_file(int fd, char *str)
{
int ret;
ret = write(fd, str, SIZE);
if(ret<0) {
printf("write fail %s\n",strerror(errno));
} else printf("succ write %d byte\n",ret);
return 0;
}
int open_file(char* filename)
{
int fd;
char file[125] = {0};
sprintf(file, "%s%s", pci_msm_path, filename);
fd = open(file, O_RDWR);
if(fd<0) {
printf("open %s fail %s\n",file, strerror(errno));
exit(1);
}
printf("open %s succ\n",file);
return fd;
}
void set_aer_enable()
{
int fd;
char buf[SIZE] = {0};
fd = open_file("aer_enable");
write_file(fd,buf);
close(fd);
}
void set_wr_offset()
{
int fd;
char buf[SIZE] = {0};
fd = open_file("wr_offset");
sprintf(buf,"%s","9999999");
write_file(fd,buf);
close(fd);
}
void set_test_case()
{
int fd;
char buf[SIZE] = {0};
buf[0] = '1';
buf[1] = '2';
fd = open_file("case");
write_file(fd,buf);
close(fd);
}
void set_base_sel()
{
int fd;
char buf[SIZE] = {0};
buf[0] = '1';
fd = open_file("base_sel");
write_file(fd,buf);
close(fd);
}
int
main(int argc, char *argv[])
{
set_wr_offset();
set_base_sel();
set_test_case();
return 0;
}
|
the_stack_data/898512.c | /* Attributions:
* http://computing.llnl.gov/tutorials/pthreads/
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
static const int NUM_THREADS = 5;
/*
* Prints hello world
*/
void * printHello(void * threadid) {
long tid;
tid = (long) threadid;
printf("Hello, World! It's me, thread #%ld!\n", tid);
printf("Thread #%ld exiting\n", tid);
pthread_exit(NULL);
}
/*
* Main
*/
int main(int argc, char * argv[]) {
// Main is comprised of a single default thread
pthread_t threads[NUM_THREADS]; // an array of threads
int rc; // return code
long t; // thread counter
for (t=0; t < NUM_THREADS; t++) {
printf("In main: creating thread %ld\n", t);
/*
* pthread_create(thread, attr, start_routine, arg)
* thread: thread identifier
* attr: sets thread attributes
* start_routine: routine to execute upon thread init
* arg: single argument to pass to routine
*/
rc = pthread_create(&threads[t], NULL, printHello, (void *) t);
if (rc) {
printf("ERROR; return code from pthread_create() is %d\n", rc);
exit(-1);
}
else {
// Successful thread creation returns 0
//printf("SUCCESS: return code from pthread_create() is %d\n", rc);
}
}
/* Last thing that main() should do */
printf("Main thread exiting\n");
pthread_exit(NULL);
}
|
the_stack_data/150139755.c | /*
* Copyright 2015 Nervana Systems Inc.
* 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 <cuda.h>
#define CUDA_CHECK( fn ) do { \
CUresult status = (fn); \
if ( CUDA_SUCCESS != status ) { \
const char* errstr; \
cuGetErrorString(status, &errstr); \
printf("CUDA Driver Failure (line %d of file %s):\n\t%s returned 0x%x (%s)\n", __LINE__, __FILE__, #fn, status, errstr); \
exit(EXIT_FAILURE); \
} \
} while (0)
int main(int argc, char* argv[]) {
char deviceName[32];
int devCount, ordinal, major, minor;
int maxMajor = 0, maxMinor = 0;
CUdevice hDevice;
// Initialize the Driver API and find a device
CUDA_CHECK( cuInit(0) );
CUDA_CHECK( cuDeviceGetCount(&devCount) );
for (ordinal = 0; ordinal < devCount; ordinal++) {
CUDA_CHECK( cuDeviceGet(&hDevice, ordinal) );
CUDA_CHECK( cuDeviceGetAttribute (&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, hDevice) );
CUDA_CHECK( cuDeviceGetAttribute (&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, hDevice) );
CUDA_CHECK( cuDeviceGetName(deviceName, sizeof(deviceName), hDevice) );
if (major >= maxMajor) {
maxMajor = major;
if (minor > maxMinor) {
maxMinor = minor;
}
}
}
if (maxMajor == 0) {
// no CUDA capable devices found.
printf("0\n");
} else {
printf("%d.%d\n", maxMajor, maxMinor);
}
exit(0);
}
|
the_stack_data/345898.c | #include <stdio.h>
#include <stdlib.h>
int hookme(void) {
return 2;
}
int main(void) {
fprintf(stderr, "b start\n");
system("./c");
fprintf(stderr, "b hookme(): %d\n", hookme());
fprintf(stderr, "b finish\n");
return 0;
}
|
the_stack_data/90765892.c | #include <stdio.h>;
#include <stdlib.h>;
typedef int RU;
typedef float prova;
struct notasAluno
{
RU matricula;
prova nota1;
prova nota2;
}; typedef struct notasAluno n_aluno;
int main()
{
n_aluno aluno;
prova media = 0;
printf("Digite a matricula do aluno:");
scanf_s("%d", &aluno.matricula);
printf("Digite a primeira nota do aluno:");
scanf_s("%f", &aluno.nota1);
printf("Digite a segunda nota do aluno:");
scanf_s("%f", &aluno.nota2);
media = (aluno.nota1 + aluno.nota2)/2;
printf("\nmatricula do aluno: %d\n", aluno.matricula);
printf("\nMedia das duas notas: %.2f\n\n",media);
system("pause");
return 0;
} |
the_stack_data/897504.c | // 1.13. Write a program to input data of a student like rollno (int), name (string with space), gender (char), email (string without space), mobile(string without space), course (string with space) and show the output.
#include <stdio.h>
#include<stdlib.h>
int main(){
int rollno;char name[20],gender,email[30],mobile[13],course[10];
printf("enter rollno:");scanf("%d",&rollno);
printf("enter name:");fflush(stdin);
gets(name);
printf("gender:");fflush(stdin);
gender=getchar();
printf("enter email:");fflush(stdin);
scanf("%s",&email);
printf("enter mobile:");fflush(stdin);
scanf("%s",&mobile);
printf("enter course:");fflush(stdin);
gets(course);
printf("rollno=%d\nname=%s\ngender=%c\nemail=%s\nmobile=%s\ncourse=%s",rollno,name,gender,email,mobile,course);
return 0;
}
// enter rollno:12
// enter name:adarsh
// gender:m
// enter email:[email protected]
// enter mobile:9696697291
// enter course:btech
// rollno=12
// name=adarsh
// gender=m
// [email protected]
// mobile=9696697291
// course=btech |
the_stack_data/285973.c | /*##########################################################
# File Name: ex16.c
# Author: franklin
# mail: [email protected]
# Created Time: Fri 23 Feb 2018 09:33:22 PM CST
#=========================================================*/
#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 = malloc(sizeof(struct Person));
assert(who != NULL);
who->name = strdup(name);
who->age = age;
who->height = height;
who->weight = weight;
return who;
}
void Person_destroy(struct Person *who)
{
assert(who != NULL);
free(who->name);
free(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 and where they are in memory
printf("Joe is at memory location %p:\n", joe);
Person_print(joe);
printf("Frank is at memory location %p:\n", frank);
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);
//destroy them both so we clean up
Person_destroy(joe);
Person_destroy(frank);
return 0;
}
|
the_stack_data/178265986.c | #include <errno.h>
#include <stdio.h>
int main(void)
{
errno = ENOMEM;
perror("ENOMEM");
errno = EDOM;
perror("EDOM");
return 0;
}
|
the_stack_data/144450.c |
#include <stdio.h>
int main() {
return 0;
}
|
the_stack_data/117328135.c | /* Model is correctly constrained.
* No equations needed Newton-Raphson evaluation.
* The rate and state arrays need 2 entries.
* The algebraic variables array needs 0 entries.
* The constant array needs 4 entries.
* Variable storage is as follows:
* * Target amplitude in component environment
* * * Variable type: constant
* * * Variable index: 0
* * * Variable storage: CONSTANTS[0]
* * Target d^1/dt^1 x in component main
* * * Variable type: algebraic variable
* * * Variable index: 1
* * * Variable storage: RATES[1]
* * Target d^1/dt^1 y in component main
* * * Variable type: algebraic variable
* * * Variable index: 0
* * * Variable storage: RATES[0]
* * Target initial_t in component environment
* * * Variable type: constant
* * * Variable index: 1
* * * Variable storage: CONSTANTS[1]
* * Target t in component environment
* * * Variable type: variable of integration
* * * Variable index: 0
* * * Variable storage: VOI
* * Target x in component main
* * * Variable type: state variable
* * * Variable index: 1
* * * Variable storage: STATES[1]
* * Target x_initial in component main
* * * Variable type: constant
* * * Variable index: 3
* * * Variable storage: CONSTANTS[3]
* * Target y in component main
* * * Variable type: state variable
* * * Variable index: 0
* * * Variable storage: STATES[0]
* * Target y_initial in component main
* * * Variable type: constant
* * * Variable index: 2
* * * Variable storage: CONSTANTS[2]
*/
void SetupFixedConstants(double* CONSTANTS, double* RATES, double* STATES)
{
/* Constant amplitude */
CONSTANTS[0] = 5;
/* Constant initial_t */
CONSTANTS[1] = 0.78;
/* Constant 3.2.3 */
CONSTANTS[2] = CONSTANTS[0]* sin(CONSTANTS[1]);
/* Constant 3.2.4 */
CONSTANTS[3] = CONSTANTS[0]*cos(CONSTANTS[1]);
/* Constant y */
STATES[0] = CONSTANTS[2];
/* Constant x */
STATES[1] = CONSTANTS[3];
}
void EvaluateVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void ComputeRates(double VOI, double* STATES, double* RATES, double* CONSTANTS, double* ALGEBRAIC)
{
/* 3.2.1 */
RATES[0] = STATES[1];
/* 3.2.2 */
RATES[1] = - STATES[0];
}
|
the_stack_data/165768402.c | #include <stdio.h>
float Media(float, float, float, char);
int main()
{
printf("%f\n", Media(4,4,5,'P'));
}
float Media(float x, float y, float z, char M)
{
if (M == 'A')
return (x+y+z)/3;
else if (M == 'P')
return (5*x+3*y+2*z)/10;
else
return 0;
} |
the_stack_data/26701446.c | extern int xxx;
int
bar (void)
{
return xxx;
}
int
main ()
{
return 0;
}
|
the_stack_data/959771.c | /*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2015 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the Intel Corporation nor the names of its contributors may be used to
endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END_LEGAL */
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
if (argc < 2)
{
printf("Specify app name\n");
return -1;
}
char *newArg[2];
newArg[0] = (char *)argv[1];
newArg[1] = NULL;
pid_t child_id = vfork();
if (child_id == 0)
{
printf("APPLICATION: After vfork in child\n");
execv(argv[1], newArg);
}
else
{
printf("APPLICATION: After vfork in parent\n");
wait(0);
execv(argv[1], newArg);
}
return 0;
}
|
the_stack_data/623919.c | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i,sum=0;
printf("Enter any number\n");
scanf("%d",&n);
for(i=1;i<n;i++)
{
if(n%i==0)
sum+=i;
}
if(sum==n)
printf("%d is a perfect number",n);
else
printf("%d is not a perfect number",n);
return 0;
}
|
the_stack_data/167332032.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, S. S. Sarwar, L. Sekanina, Z. Vasicek and K. Roy, "Design of power-efficient approximate multipliers for approximate artificial neural networks," 2016 IEEE/ACM International Conference on Computer-Aided Design (ICCAD), Austin, TX, 2016, pp. 1-7. doi: 10.1145/2966986.2967021
* This file contains a circuit from a sub-set of pareto optimal circuits with respect to the pwr and mse parameters
***/
// MAE% = 0.18 %
// MAE = 7555
// WCE% = 0.99 %
// WCE = 41617
// WCRE% = 6300.00 %
// EP% = 99.88 %
// MRE% = 4.96 %
// MSE = 89807.495e3
// PDK45_PWR = 0.410 mW
// PDK45_AREA = 694.1 um2
// PDK45_DELAY = 1.44 ns
#include <stdint.h>
#include <stdlib.h>
uint64_t mul11u_06R(uint64_t a, uint64_t b) {
int wa[11];
int wb[11];
uint64_t y = 0;
wa[0] = (a >> 0) & 0x01;
wb[0] = (b >> 0) & 0x01;
wa[1] = (a >> 1) & 0x01;
wb[1] = (b >> 1) & 0x01;
wa[2] = (a >> 2) & 0x01;
wb[2] = (b >> 2) & 0x01;
wa[3] = (a >> 3) & 0x01;
wb[3] = (b >> 3) & 0x01;
wa[4] = (a >> 4) & 0x01;
wb[4] = (b >> 4) & 0x01;
wa[5] = (a >> 5) & 0x01;
wb[5] = (b >> 5) & 0x01;
wa[6] = (a >> 6) & 0x01;
wb[6] = (b >> 6) & 0x01;
wa[7] = (a >> 7) & 0x01;
wb[7] = (b >> 7) & 0x01;
wa[8] = (a >> 8) & 0x01;
wb[8] = (b >> 8) & 0x01;
wa[9] = (a >> 9) & 0x01;
wb[9] = (b >> 9) & 0x01;
wa[10] = (a >> 10) & 0x01;
wb[10] = (b >> 10) & 0x01;
int sig_42 = wa[9] & wb[1];
int sig_43 = wa[10] & wb[1];
int sig_53 = wa[4] & wb[6];
int sig_54 = wa[10] & wb[2];
int sig_59 = wa[4] & wb[10];
int sig_64 = wa[9] & wb[3];
int sig_65 = wa[10] & wb[3];
int sig_74 = wa[8] & wb[10];
int sig_75 = wa[9] & wb[4];
int sig_76 = wa[10] & wb[4];
int sig_83 = wa[6] & wb[5];
int sig_84 = wa[9] & wb[5];
int sig_85 = wa[8] & wb[5];
int sig_86 = wa[9] & wb[5];
int sig_87 = wa[10] & wb[5];
int sig_94 = wa[6] & wb[6];
int sig_95 = wa[3] & wb[10];
int sig_96 = wa[8] & wb[6];
int sig_97 = wa[9] & wb[6];
int sig_98 = wa[10] & wb[6];
int sig_103 = wa[4] & wb[7];
int sig_104 = wa[5] & wb[7];
int sig_105 = wa[6] & wb[7];
int sig_106 = wa[7] & wb[7];
int sig_107 = wa[8] & wb[7];
int sig_108 = wa[9] & wb[7];
int sig_109 = wa[10] & wb[7];
int sig_113 = wa[3] & wb[7];
int sig_114 = wa[4] & wb[8];
int sig_115 = wa[5] & wb[8];
int sig_116 = wa[6] & wb[8];
int sig_117 = wa[7] & wb[8];
int sig_118 = wa[8] & wb[8];
int sig_119 = wa[9] & wb[8];
int sig_120 = wa[10] & wb[8];
int sig_124 = wa[3] & wb[9];
int sig_125 = wa[4] & wb[9];
int sig_126 = wa[5] & wb[9];
int sig_127 = wa[6] & wb[9];
int sig_128 = wa[7] & wb[9];
int sig_129 = wa[8] & wb[9];
int sig_130 = wa[9] & wb[9];
int sig_131 = wa[10] & wb[9];
int sig_133 = wa[1] & wb[5];
int sig_134 = wa[2] & wb[10];
int sig_135 = wa[3] & wb[4];
int sig_136 = wa[4] & wb[10];
int sig_137 = wa[5] & wb[10];
int sig_138 = wa[6] & wb[10];
int sig_139 = wa[7] & wb[10];
int sig_140 = wa[8] & wb[10];
int sig_141 = wa[9] & wb[10];
int sig_142 = wa[10] & wb[10];
int sig_186 = wa[4] & sig_42;
int sig_189 = sig_186;
int sig_190 = sig_43 & sig_53;
int sig_191 = sig_43 & sig_53;
int sig_219 = wb[6];
int sig_220 = wa[4] & wb[4];
int sig_221 = sig_219 & wb[5];
int sig_223 = sig_220 | sig_221;
int sig_225 = wa[5] & wb[9];
int sig_226 = wa[8] & sig_83;
int sig_228 = sig_225 | sig_226;
int sig_229 = sig_64 | sig_74;
int sig_230 = sig_64 & wa[4];
int sig_231 = sig_229 & sig_84;
int sig_232 = sig_229 ^ sig_84;
int sig_233 = sig_230 | sig_231;
int sig_234 = sig_65 ^ sig_75;
int sig_235 = sig_65 & sig_75;
int sig_236 = sig_234 & sig_85;
int sig_237 = sig_234 ^ sig_85;
int sig_238 = sig_235 | sig_236;
int sig_239 = sig_76 & sig_86;
int sig_240 = sig_76 ^ sig_86;
int sig_255 = !wb[4];
int sig_257 = wa[8] | sig_255;
int sig_259 = wb[10] & sig_103;
int sig_260 = wa[1] & sig_113;
int sig_262 = sig_259;
int sig_263 = sig_94 ^ sig_104;
int sig_264 = sig_94 & wb[7];
int sig_266 = sig_263 ^ sig_114;
int sig_267 = sig_264;
int sig_268 = sig_95 ^ sig_105;
int sig_269 = sig_95 & sig_105;
int sig_270 = sig_268 & sig_115;
int sig_271 = sig_268 ^ sig_115;
int sig_272 = sig_269 ^ sig_270;
int sig_273 = sig_96 ^ sig_106;
int sig_274 = sig_96 & sig_106;
int sig_275 = sig_273 & sig_116;
int sig_276 = sig_273 ^ sig_116;
int sig_277 = sig_274 | sig_275;
int sig_278 = sig_97 ^ sig_107;
int sig_279 = sig_97 & sig_107;
int sig_280 = sig_278 & sig_117;
int sig_281 = sig_278 ^ sig_117;
int sig_282 = sig_279 | sig_280;
int sig_283 = sig_98 ^ sig_108;
int sig_284 = sig_98 & sig_108;
int sig_285 = sig_283 & sig_118;
int sig_286 = sig_283 ^ sig_118;
int sig_287 = sig_284 | sig_285;
int sig_288 = sig_109 & sig_119;
int sig_289 = sig_109 ^ sig_119;
int sig_332 = sig_191 ^ sig_189;
int sig_333 = sig_191;
int sig_334 = sig_332 & wa[8];
int sig_336 = sig_333 ^ sig_334;
int sig_337 = sig_54 | sig_190;
int sig_338 = sig_54 & sig_190;
int sig_339 = sig_337 & sig_232;
int sig_340 = sig_337 ^ sig_232;
int sig_341 = sig_338 | sig_339;
int sig_361 = sig_223;
int sig_362 = wb[6] & wa[2];
int sig_363 = sig_361 & sig_257;
int sig_365 = sig_362 | sig_363;
int sig_366 = sig_228 ^ sig_266;
int sig_367 = sig_228 & sig_266;
int sig_368 = wb[8] & sig_262;
int sig_369 = sig_366 | sig_262;
int sig_370 = sig_367 | sig_368;
int sig_371 = sig_233 ^ sig_271;
int sig_372 = sig_233 & sig_271;
int sig_373 = sig_371 & sig_267;
int sig_374 = sig_371 ^ sig_267;
int sig_375 = sig_372 | sig_373;
int sig_376 = sig_238 ^ sig_276;
int sig_377 = sig_238 & sig_276;
int sig_378 = sig_376 & sig_272;
int sig_379 = sig_376 ^ sig_272;
int sig_380 = sig_377 | sig_378;
int sig_381 = sig_239 ^ sig_281;
int sig_382 = sig_239 & sig_281;
int sig_383 = sig_381 & sig_277;
int sig_384 = sig_381 ^ sig_277;
int sig_385 = sig_382 | sig_383;
int sig_386 = sig_286 & sig_282;
int sig_387 = sig_286 ^ sig_282;
int sig_388 = sig_289 & sig_287;
int sig_389 = sig_289 ^ sig_287;
int sig_390 = sig_120 & sig_288;
int sig_391 = sig_120 ^ sig_288;
int sig_427 = wa[3] & wb[2];
int sig_430 = sig_427;
int sig_431 = sig_340 ^ sig_336;
int sig_432 = sig_340 & sig_336;
int sig_433 = sig_431 & sig_369;
int sig_434 = sig_431 ^ sig_369;
int sig_435 = sig_432 | sig_433;
int sig_436 = sig_237 ^ sig_341;
int sig_437 = sig_237 & sig_341;
int sig_438 = sig_436 & sig_374;
int sig_439 = sig_436 ^ sig_374;
int sig_440 = sig_437 | sig_438;
int sig_441 = sig_240 & sig_379;
int sig_442 = sig_240 ^ sig_379;
int sig_443 = sig_87 & sig_384;
int sig_444 = sig_87 ^ sig_384;
int sig_457 = sig_365 ^ sig_124;
int sig_458 = sig_365 & sig_124;
int sig_459 = sig_457 & sig_134;
int sig_460 = sig_457 ^ sig_134;
int sig_461 = sig_458 | sig_459;
int sig_462 = sig_370 ^ sig_125;
int sig_463 = sig_370 & sig_125;
int sig_464 = sig_462 & wa[7];
int sig_465 = sig_462 ^ sig_135;
int sig_466 = sig_463 | sig_464;
int sig_467 = sig_375 ^ sig_126;
int sig_468 = sig_375 & sig_126;
int sig_469 = sig_467 & sig_136;
int sig_470 = sig_467 ^ sig_136;
int sig_471 = sig_468 | sig_469;
int sig_472 = sig_380 ^ sig_127;
int sig_473 = sig_380 & sig_127;
int sig_474 = sig_472 & sig_137;
int sig_475 = sig_472 ^ sig_137;
int sig_476 = sig_473 | sig_474;
int sig_477 = sig_385 ^ sig_128;
int sig_478 = sig_385 & sig_128;
int sig_479 = sig_477 & sig_138;
int sig_480 = sig_477 ^ sig_138;
int sig_481 = sig_478 | sig_479;
int sig_482 = sig_386 ^ sig_129;
int sig_483 = sig_386 & sig_129;
int sig_484 = sig_482 & sig_139;
int sig_485 = sig_482 ^ sig_139;
int sig_486 = sig_483 | sig_484;
int sig_487 = sig_388 ^ sig_130;
int sig_488 = sig_388 & sig_130;
int sig_489 = sig_487 & sig_140;
int sig_490 = sig_487 ^ sig_140;
int sig_491 = sig_488 | sig_489;
int sig_492 = sig_390 ^ sig_131;
int sig_493 = sig_390 & sig_131;
int sig_494 = sig_492 & sig_141;
int sig_495 = sig_492 ^ sig_141;
int sig_496 = sig_493 | sig_494;
int sig_524 = wa[3] & wa[5];
int sig_527 = sig_524;
int sig_528 = sig_434 ^ sig_430;
int sig_529 = sig_434 & sig_430;
int sig_530 = sig_528 & sig_460;
int sig_531 = sig_528 ^ sig_460;
int sig_532 = sig_529 ^ sig_530;
int sig_533 = sig_439 ^ sig_435;
int sig_534 = sig_439 & sig_435;
int sig_535 = sig_533 & sig_465;
int sig_536 = sig_533 ^ sig_465;
int sig_537 = sig_534 | sig_535;
int sig_538 = sig_442 ^ sig_440;
int sig_539 = sig_442 & sig_440;
int sig_540 = sig_538 & sig_470;
int sig_541 = sig_538 ^ sig_470;
int sig_542 = sig_539 | sig_540;
int sig_543 = sig_444 ^ sig_441;
int sig_544 = sig_444 & sig_441;
int sig_545 = sig_543 & sig_475;
int sig_546 = sig_543 ^ sig_475;
int sig_547 = sig_544 ^ sig_545;
int sig_548 = sig_387 ^ sig_443;
int sig_549 = sig_387 & sig_443;
int sig_550 = sig_548 & sig_480;
int sig_551 = sig_548 ^ sig_480;
int sig_552 = sig_549 | sig_550;
int sig_553 = sig_389 & sig_485;
int sig_554 = sig_389 ^ sig_485;
int sig_555 = sig_391 & sig_490;
int sig_556 = sig_391 ^ sig_490;
int sig_570 = wb[4] & wa[1];
int sig_578 = sig_531 & sig_527;
int sig_581 = sig_578;
int sig_582 = sig_536 ^ sig_532;
int sig_583 = sig_536 & sig_532;
int sig_584 = sig_582 & sig_461;
int sig_585 = sig_582 ^ sig_461;
int sig_586 = sig_583 | sig_584;
int sig_587 = sig_541 ^ sig_537;
int sig_588 = sig_541 & sig_537;
int sig_589 = sig_587 & sig_466;
int sig_590 = sig_587 ^ sig_466;
int sig_591 = sig_588 | sig_589;
int sig_592 = sig_546 ^ sig_542;
int sig_593 = sig_546 & sig_542;
int sig_594 = sig_592 & sig_471;
int sig_595 = sig_592 ^ sig_471;
int sig_596 = sig_593 | sig_594;
int sig_597 = sig_551 ^ sig_547;
int sig_598 = sig_551 & sig_547;
int sig_599 = sig_597 & sig_476;
int sig_600 = sig_597 ^ sig_476;
int sig_601 = sig_598 | sig_599;
int sig_602 = sig_554 ^ sig_552;
int sig_603 = sig_554 & sig_552;
int sig_604 = sig_602 & sig_481;
int sig_605 = sig_602 ^ sig_481;
int sig_606 = sig_603 | sig_604;
int sig_607 = sig_556 ^ sig_553;
int sig_608 = sig_556 & sig_553;
int sig_609 = sig_607 & sig_486;
int sig_610 = sig_607 ^ sig_486;
int sig_611 = sig_608 | sig_609;
int sig_612 = sig_495 ^ sig_555;
int sig_613 = sig_495 & sig_555;
int sig_614 = sig_612 & sig_491;
int sig_615 = sig_612 ^ sig_491;
int sig_616 = sig_613 | sig_614;
int sig_617 = sig_142 & sig_496;
int sig_618 = sig_142 ^ sig_496;
int sig_636 = sig_570;
int sig_639 = sig_636;
int sig_647 = wa[1] & wb[10];
int sig_650 = sig_647;
int sig_651 = sig_585 ^ sig_581;
int sig_652 = sig_585 & sig_581;
int sig_653 = sig_651 & sig_650;
int sig_654 = sig_651 ^ sig_650;
int sig_655 = sig_652 | sig_653;
int sig_656 = sig_590 ^ sig_586;
int sig_657 = sig_590 & sig_586;
int sig_658 = sig_656 & sig_655;
int sig_659 = sig_656 ^ sig_655;
int sig_660 = sig_657 | sig_658;
int sig_661 = sig_595 ^ sig_591;
int sig_662 = sig_595 & sig_591;
int sig_663 = sig_661 & sig_660;
int sig_664 = sig_661 ^ sig_660;
int sig_665 = sig_662 | sig_663;
int sig_666 = sig_600 ^ sig_596;
int sig_667 = sig_600 & sig_596;
int sig_668 = sig_666 & sig_665;
int sig_669 = sig_666 ^ sig_665;
int sig_670 = sig_667 | sig_668;
int sig_671 = sig_605 ^ sig_601;
int sig_672 = sig_605 & sig_601;
int sig_673 = sig_671 & sig_670;
int sig_674 = sig_671 ^ sig_670;
int sig_675 = sig_672 | sig_673;
int sig_676 = sig_610 ^ sig_606;
int sig_677 = sig_610 & sig_606;
int sig_678 = sig_676 & sig_675;
int sig_679 = sig_676 ^ sig_675;
int sig_680 = sig_677 | sig_678;
int sig_681 = sig_615 ^ sig_611;
int sig_682 = sig_615 & sig_611;
int sig_683 = sig_681 & sig_680;
int sig_684 = sig_681 ^ sig_680;
int sig_685 = sig_682 | sig_683;
int sig_686 = sig_618 ^ sig_616;
int sig_687 = sig_618 & sig_616;
int sig_688 = sig_686 & sig_685;
int sig_689 = sig_686 ^ sig_685;
int sig_690 = sig_687 | sig_688;
int sig_692 = sig_617 ^ sig_690;
y |= (sig_260 & 0x01) << 0; // default output
y |= (sig_462 & 0x01) << 1; // default output
y |= (sig_133 & 0x01) << 2; // default output
y |= (sig_333 & 0x01) << 3; // default output
y |= (sig_274 & 0x01) << 4; // default output
y |= (sig_581 & 0x01) << 5; // default output
y |= (sig_592 & 0x01) << 6; // default output
y |= (sig_682 & 0x01) << 7; // default output
y |= (sig_76 & 0x01) << 8; // default output
y |= (sig_59 & 0x01) << 9; // default output
y |= (sig_639 & 0x01) << 10; // default output
y |= (sig_680 & 0x01) << 11; // default output
y |= (sig_386 & 0x01) << 12; // default output
y |= (sig_654 & 0x01) << 13; // default output
y |= (sig_659 & 0x01) << 14; // default output
y |= (sig_664 & 0x01) << 15; // default output
y |= (sig_669 & 0x01) << 16; // default output
y |= (sig_674 & 0x01) << 17; // default output
y |= (sig_679 & 0x01) << 18; // default output
y |= (sig_684 & 0x01) << 19; // default output
y |= (sig_689 & 0x01) << 20; // default output
y |= (sig_692 & 0x01) << 21; // default output
return y;
}
|
the_stack_data/198579866.c | #include <stdio.h>
#include <string.h>
int main()
{
char str_a[20];
char *pointer;
char *pointer2;
strcpy(str_a, "Hello World!\n");
pointer = str_a;
printf(pointer);
pointer2 = pointer + 2;
printf(pointer2);
strcpy(pointer2, "y you guys!\n");
printf(pointer);
return 0;
}
|
the_stack_data/68888421.c | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
void get();
int expr();
void term_tail(int* );
int term();
void factor_tail(int* );
int factor();
void term_rel_tail(int* );
int term_rel();
void factor_rel_tail(int* );
void term_log_tail(int* );
int term_log();
void factor_log_tail(int* );
char* tokens[] = {"(", "5", "<=", "5", "*", "(", "3", "+", "8", "*", "2", ">", "(", "1", "+", "6", ")",
"&&", "1", "!=", "5", "*", "2", "-", "3", "*", "(", "3", "+", "2", ")", ")", "+", "4", ")", "+", "9", "*", "(",
"29", "-", "-", "-1", "*", "90", "/", "5", ")"};
size_t size = 48;
size_t count;
static char* ahead;
bool all_good = false;
bool audit_int(char* number)
{
size_t length = -1;
while(number[++length]);
if (!(number[0] == '-' || isdigit(number[0]))) // Check if number is negative
return false;
for (size_t i = 1; i < length; i++)
{
if (!isdigit(number[i]))
return false;
}
return true;
}
void get()
{
if (++count == size)
all_good = true;
if (count < size)
ahead = tokens[count];
}
int log_expr()
{
int value = term_log();
term_log_tail(&value);
return value;
}
int rel_expr()
{
int value = term_rel();
term_rel_tail(&value);
return value;
}
int expr()
{
int value = term();
term_tail(&value);
return value;
}
void term_log_tail(int* value)
{
if (strcmp(ahead, "||") == 0)
{
get();
int temp_val = rel_expr();
*value = temp_val || *value;
term_log_tail(value);
}
}
int term_log()
{
int value = rel_expr();
factor_log_tail(&value);
return value;
}
void factor_log_tail(int* value)
{
if (strcmp(ahead, "&&") == 0)
{
get();
int temp_val = rel_expr();
*value = temp_val && *value;
factor_log_tail(value);
}
}
void term_rel_tail(int* value)
{
if (strcmp(ahead, "==") == 0)
{
get();
int temp_val = term_rel();
*value = (temp_val == *value);
term_rel_tail(value);
}
else if (strcmp(ahead, "!=") == 0)
{
get();
int temp_val = term_rel();
*value = (temp_val != *value);
term_rel_tail(value);
}
}
int term_rel()
{
int value = expr();
factor_rel_tail(&value);
return value;
}
void factor_rel_tail(int* value)
{
if (strcmp(ahead, ">=") == 0)
{
get();
int temp_val = expr();
*value = (*value >= temp_val);
factor_rel_tail(value);
}
else if (strcmp(ahead, "<=") == 0)
{
get();
int temp_val = expr();
*value = (*value <= temp_val);
factor_rel_tail(value);
}
else if (strcmp(ahead, ">") == 0)
{
get();
int temp_val = expr();
*value = (*value > temp_val);
factor_rel_tail(value);
}
else if (strcmp(ahead, "<") == 0)
{
get();
int temp_val = expr();
*value = (*value < temp_val);
factor_rel_tail(value);
}
}
void term_tail(int* value)
{
if (strcmp(ahead, "+") == 0)
{
get();
int temp_val = term();
*value += temp_val;
term_tail(value);
}
else if (strcmp(ahead, "-") == 0)
{
get();
int temp_val = term();
*value -= temp_val;
term_tail(value);
}
}
int term()
{
int value = factor();
factor_tail(&value);
return value;
}
void factor_tail(int* value)
{
if (strcmp(ahead, "*") == 0 )
{
get();
int temp_val = factor();
*value *= temp_val;
factor_tail(value);
}
else if (strcmp(ahead, "/") == 0)
{
get();
int temp_val = factor();
if (temp_val == 0)
{
printf("Division by 0!\n");
exit(1);
}
*value /= temp_val;
factor_tail(value);
}
else if (strcmp(ahead, "%") == 0) // Ok with negatives, not ok with doubles
{
get();
int temp_val = factor();
if (temp_val == 0)
{
printf("Division by 0!\n");
exit(1);
}
*value = *value % temp_val;
factor_tail(value);
}
}
int factor_no_neg_un_op()
{
int value = 0;
if (strcmp(ahead, "(") == 0)
{
get();
value = log_expr();
if (strcmp(ahead, ")") == 0)
get();
else
{
printf("Expected )\n");
exit(1);
}
}
else if (strcmp(ahead, "-") == 0)
{
printf("\nWrong format!\n");
exit(0);
}
else if (strcmp(ahead, "!") == 0)
{
get();
value = !factor();
}
else if (audit_int(ahead))
{
value = atoi(ahead);
get();
}
else
{
printf("factor expected\n");
exit(1);
}
return value;
}
int factor()
{
int value = 0;
if (strcmp(ahead, "(") == 0)
{
get();
value = log_expr();
if (strcmp(ahead, ")") == 0)
get();
else
{
printf("Expected )\n");
exit(1);
}
}
else if (strcmp(ahead, "-") == 0)
{
get();
value = -factor();
}
else if (strcmp(ahead, "+") == 0)
{
get();
value = factor();
}
else if (strcmp(ahead, "!") == 0)
{
get();
value = !factor();
}
else if (audit_int(ahead))
{
value = atoi(ahead);
get();
}
else
{
printf("Factor expected\n");
exit(1);
}
return value;
}
// Example use
void print_expr(char** tokens, int size, int res)
{
for (size_t i = 0; i < size; i++)
printf("%s ", tokens[i]);
printf("= %d\n", res);
}
int main(void)
{
count = 0;
ahead = tokens[0];
int v = log_expr();
if (all_good)
print_expr(tokens, size, v);
else
printf("Error in parsing\n");
return 0;
}
|
the_stack_data/95125.c | /****************************************************************
Copyright 1990, 1994, 2000 by AT&T, Lucent Technologies and Bellcore.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the names of AT&T, Bell Laboratories,
Lucent or Bellcore or any of their entities not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
AT&T, Lucent and Bellcore disclaim all warranties with regard to
this software, including all implied warranties of
merchantability and fitness. In no event shall AT&T, Lucent or
Bellcore be liable for any special, indirect or consequential
damages or any damages whatsoever resulting from loss of use,
data or profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection with the
use or performance of this software.
****************************************************************/
#ifndef CRAY
#define STACKMIN 512
#define MINBLK (2*sizeof(struct mem) + 16)
#define F _malloc_free_
#define SBGULP 8192
#include "string.h" /* for memcpy */
#ifdef KR_headers
#define Char char
#define Unsigned unsigned
#define Int /*int*/
#else
#define Char void
#define Unsigned size_t
#define Int int
#endif
typedef struct mem {
struct mem *next;
Unsigned len;
} mem;
mem *F;
Char *
#ifdef KR_headers
malloc(size)
register Unsigned size;
#else
malloc(register Unsigned size)
#endif
{
register mem *p, *q, *r, *s;
unsigned register k, m;
extern Char *sbrk(Int);
char *top, *top1;
size = (size+7) & ~7;
r = (mem *) &F;
for (p = F, q = 0; p; r = p, p = p->next) {
if ((k = p->len) >= size && (!q || m > k)) {
m = k;
q = p;
s = r;
}
}
if (q) {
if (q->len - size >= MINBLK) { /* split block */
p = (mem *) (((char *) (q+1)) + size);
p->next = q->next;
p->len = q->len - size - sizeof(mem);
s->next = p;
q->len = size;
}
else
s->next = q->next;
}
else {
top = (Char *)(((long)sbrk(0) + 7) & ~7);
if (F && (char *)(F+1) + F->len == top) {
q = F;
F = F->next;
}
else
q = (mem *) top;
top1 = (char *)(q+1) + size;
if (sbrk((int)(top1-top+SBGULP)) == (Char *) -1)
return 0;
r = (mem *)top1;
r->len = SBGULP - sizeof(mem);
r->next = F;
F = r;
q->len = size;
}
return (Char *) (q+1);
}
void
#ifdef KR_headers
free(f)
Char *f;
#else
free(Char *f)
#endif
{
mem *p, *q, *r;
char *pn, *qn;
if (!f) return;
q = (mem *) ((char *)f - sizeof(mem));
qn = (char *)f + q->len;
for (p = F, r = (mem *) &F; ; r = p, p = p->next) {
if (qn == (Char *) p) {
q->len += p->len + sizeof(mem);
p = p->next;
}
pn = p ? ((char *) (p+1)) + p->len : 0;
if (pn == (Char *) q) {
p->len += sizeof(mem) + q->len;
q->len = 0;
q->next = p;
r->next = p;
break;
}
if (pn < (char *) q) {
r->next = q;
q->next = p;
break;
}
}
}
Char *
#ifdef KR_headers
realloc(f, size)
Char *f;
Unsigned size;
#else
realloc(Char *f, Unsigned size)
#endif
{
mem *p;
Char *q, *f1;
Unsigned s1;
if (!f) return malloc(size);
p = (mem *) ((char *)f - sizeof(mem));
s1 = p->len;
free(f);
if (s1 > size)
s1 = size + 7 & ~7;
if (!p->len) {
f1 = (Char *)(p->next + 1);
memcpy(f1, f, s1);
f = f1;
}
q = malloc(size);
if (q && q != f)
memcpy(q, f, s1);
return q;
}
/* The following (calloc) should really be in a separate file, */
/* but defining it here sometimes avoids confusion on systems */
/* that do not provide calloc in its own file. */
Char *
#ifdef KR_headers
calloc(n, m) Unsigned m, n;
#else
calloc(Unsigned n, Unsigned m)
#endif
{
Char *rv;
rv = malloc(n *= m);
if (n && rv)
memset(rv, 0, n);
return rv;
}
#endif
|
the_stack_data/433703.c | #include <sys/utsname.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char* str_replace(char* string, const char* substr, const char* replacement) {
char* tok = NULL;
char* newstr = NULL;
char* oldstr = NULL;
int oldstr_len = 0;
int substr_len = 0;
int replacement_len = 0;
newstr = strdup(string);
substr_len = strlen(substr);
replacement_len = strlen(replacement);
if (substr == NULL || replacement == NULL) {
return newstr;
}
while ((tok = strstr(newstr, substr))) {
oldstr = newstr;
oldstr_len = strlen(oldstr);
newstr = (char*)malloc(sizeof(char) * (oldstr_len - substr_len + replacement_len + 1));
if (newstr == NULL) {
free(oldstr);
return NULL;
}
memcpy(newstr, oldstr, tok - oldstr);
memcpy(newstr + (tok - oldstr), replacement, replacement_len);
memcpy(newstr + (tok - oldstr) + replacement_len, tok + substr_len, oldstr_len - substr_len - (tok - oldstr));
memset(newstr + oldstr_len - substr_len + replacement_len, 0, 1);
free(oldstr);
}
//free(string);
return newstr;
}
int main(){
struct utsname _uname = {};
uname(&_uname);
char *kversion = str_replace(str_replace(_uname.release, ".", " "), "-", " ");
int v1, v2, v3;
sscanf(kversion,"%d %d %d",&v1,&v2,&v3);
printf("v1: %d | v2: %d | v3: %d\n",v1,v2,v3);
if(
v1 < 5 ||
(v1 == 5 && v2 < 8) ||
(v1 == 5 && v2 == 10 && v3 == 102) ||
(v1 == 5 && v2 == 10 && v3 == 92) ||
(v1 == 5 && v2 == 15 && v3 == 25) ||
(v1 == 5 && v2 >= 16 && v3 >= 11) ||
(v1 == 5 && v2 > 16))
{
printf("Not Vulnerable");
}else
printf("Vulnerable");
}
|
the_stack_data/220455704.c | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(int argc, char *argv[]){
char input[0x40];
puts("Welcome to the Dr. Phil Show. Wanna smash?");
fflush(stdin);
// 0x40(64バイト)以上でオーバーフロー
gets(input);
// 特定の文字列を含んでいるかチェック
if(strstr(input, "Smash me outside, how bout dAAAAAAAAAAA")){
return 0;
}
exit(0);
}
|
the_stack_data/161080567.c | /* RAR 3.x cracker patch for JtR. Hacked together during
* April of 2011 by Dhiru Kholia <dhiru.kholia at gmail.com> for GSoC.
* magnum added -p mode support, using code based on libclamav
* and OMP, AES-NI and OpenCL support.
*
* This software is Copyright (c) 2011, Dhiru Kholia <dhiru.kholia at gmail.com>
* and Copyright (c) 2012, magnum and it is hereby released to the general public
* under the following terms:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* This code is based on the work of Alexander L. Roshal (C)
*
* The unRAR sources may be used in any software to handle RAR
* archives without limitations free of charge, but cannot be used
* to re-create the RAR compression algorithm, which is proprietary.
* Distribution of modified unRAR sources in separate form or as a
* part of other software is permitted, provided that it is clearly
* stated in the documentation and source comments that the code may
* not be used to develop a RAR (WinRAR) compatible archiver.
*
* Huge thanks to Marc Bevand <m.bevand (at) gmail.com> for releasing unrarhp
* (http://www.zorinaq.com/unrarhp/) and documenting the RAR encryption scheme.
* This patch is made possible by unrarhp's documentation.
*
* http://anrieff.net/ucbench/technical_qna.html is another useful reference
* for RAR encryption scheme.
*
* Thanks also to Pavel Semjanov for crucial help with Huffman table checks.
*
* For type = 0 for files encrypted with "rar -hp ..." option
* archive_name:$RAR3$*type*hex(salt)*hex(partial-file-contents):type::::archive_name
*
* For type = 1 for files encrypted with "rar -p ..." option
* archive_name:$RAR3$*type*hex(salt)*hex(crc)*PACK_SIZE*UNP_SIZE*archive_name*offset-for-ciphertext*method:type::file_name
*
* or (inlined binary)
*
* archive_name:$RAR3$*type*hex(salt)*hex(crc)*PACK_SIZE*UNP_SIZE*1*hex(full encrypted file)*method:type::file_name
*
*/
#ifdef HAVE_OPENCL
#if FMT_EXTERNS_H
extern struct fmt_main fmt_ocl_rar;
#elif FMT_REGISTERS_H
john_register_one(&fmt_ocl_rar);
#else
#include <string.h>
#include <errno.h>
#if AC_BUILT
#include "autoconfig.h"
#endif
#if _MSC_VER || __MINGW32__ || __MINGW64__ || __CYGWIN__ || HAVE_WINDOWS_H
#include "win32_memmap.h"
#ifndef __CYGWIN__
#include "mmap-windows.c"
#elif defined HAVE_MMAP
#include <sys/mman.h>
#endif
#elif defined(HAVE_MMAP)
#include <sys/mman.h>
#endif
#include "arch.h"
#include "sha.h"
#include "aes.h"
#include "crc32.h"
#include "misc.h"
#include "common.h"
#include "formats.h"
#include "dyna_salt.h"
#include "memory.h"
#include "params.h"
#include "options.h"
#include "unicode.h"
#include "johnswap.h"
#include "unrar.h"
#include "common-opencl.h"
#include "config.h"
#include "jumbo.h"
#define FORMAT_LABEL "rar-opencl"
#define FORMAT_NAME "RAR3"
#define ALGORITHM_NAME "SHA1 OpenCL AES"
#ifdef DEBUG
#define BENCHMARK_COMMENT " (length 1-16)"
#else
#define BENCHMARK_COMMENT " (length 4)"
#endif
#define BENCHMARK_LENGTH -1
#define PLAINTEXT_LENGTH 22 /* Max. currently supported is 22 */
#define UNICODE_LENGTH (2 * PLAINTEXT_LENGTH)
#define BINARY_SIZE 0
#define BINARY_ALIGN MEM_ALIGN_NONE
#define SALT_SIZE sizeof(rarfile*)
#define SALT_ALIGN sizeof(rarfile*)
#define MIN_KEYS_PER_CRYPT 1
#define MAX_KEYS_PER_CRYPT 1
#ifdef _OPENMP
#include <omp.h>
#ifndef OMP_SCALE
#define OMP_SCALE 32
#endif
#endif
static const char * warn[] = {
"key xfer: " , ", len xfer: " , ", init: " , ", loop: " ,
", final: ", ", key xfer: ", ", iv xfer: "
};
static int split_events[] = { 3, -1, -1 };
#define STEP 0
#define SEED 256
//This file contains auto-tuning routine(s). Has to be included after formats definitions.
#include "opencl-autotune.h"
#include "memdbg.h"
#define ITERATIONS 0x40000
#define HASH_LOOPS 0x4000 // Max. 0x4000
static int new_keys;
static struct fmt_main *self;
/* Determines when to use CPU instead (eg. Single mode, few keys in a call) */
#define CPU_GPU_RATIO 32
static cl_mem cl_saved_key, cl_saved_len, cl_salt, cl_OutputBuf, cl_round, cl_aes_key, cl_aes_iv;
static cl_mem pinned_saved_key, pinned_saved_len, pinned_salt, pinned_aes_key, pinned_aes_iv;
static cl_kernel RarInit, RarFinal;
#define RAR_OPENCL_FORMAT
#include "rar_common.c"
static void create_clobj(size_t gws, struct fmt_main *self)
{
int i;
int bench_len = strlen(self->params.tests[0].plaintext) * 2;
pinned_saved_key = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, UNICODE_LENGTH * gws, NULL , &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating page-locked memory");
cl_saved_key = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, UNICODE_LENGTH * gws, NULL , &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
saved_key = (unsigned char*)clEnqueueMapBuffer(queue[gpu_id], pinned_saved_key, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, UNICODE_LENGTH * gws, 0, NULL, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error mapping page-locked memory saved_key");
memset(saved_key, 0, UNICODE_LENGTH * gws);
pinned_saved_len = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, sizeof(cl_int) * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating page-locked memory");
cl_saved_len = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, sizeof(cl_int) * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
saved_len = (unsigned int*)clEnqueueMapBuffer(queue[gpu_id], pinned_saved_len, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_int) * gws, 0, NULL, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error mapping page-locked memory saved_len");
for (i = 0; i < gws; i++)
saved_len[i] = bench_len;
pinned_salt = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, 8, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating page-locked memory");
cl_salt = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, 8, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
saved_salt = (unsigned char*) clEnqueueMapBuffer(queue[gpu_id], pinned_salt, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, 8, 0, NULL, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error mapping page-locked memory saved_salt");
memset(saved_salt, 0, 8);
cl_OutputBuf = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, sizeof(cl_int) * 5 * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
cl_round = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, sizeof(cl_int) * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
// aes_key is uchar[16] but kernel treats it as uint[4]
pinned_aes_key = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, sizeof(cl_uint) * 4 * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating page-locked memory");
cl_aes_key = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, sizeof(cl_uint) * 4 * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
aes_key = (unsigned char*) clEnqueueMapBuffer(queue[gpu_id], pinned_aes_key, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_uint) * 4 * gws, 0, NULL, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error mapping page-locked memory aes_key");
memset(aes_key, 0, 16 * gws);
pinned_aes_iv = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, 16 * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating page-locked memory");
cl_aes_iv = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, 16 * gws, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error allocating device memory");
aes_iv = (unsigned char*) clEnqueueMapBuffer(queue[gpu_id], pinned_aes_iv, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, 16 * gws, 0, NULL, NULL, &ret_code);
HANDLE_CLERROR(ret_code, "Error mapping page-locked memory aes_iv");
memset(aes_iv, 0, 16 * gws);
HANDLE_CLERROR(clSetKernelArg(RarInit, 0, sizeof(cl_mem), (void*)&cl_OutputBuf), "Error setting argument 0");
HANDLE_CLERROR(clSetKernelArg(RarInit, 1, sizeof(cl_mem), (void*)&cl_round), "Error setting argument 1");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 0, sizeof(cl_mem), (void*)&cl_saved_key), "Error setting argument 0");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 1, sizeof(cl_mem), (void*)&cl_saved_len), "Error setting argument 1");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 2, sizeof(cl_mem), (void*)&cl_round), "Error setting argument 2");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 3, sizeof(cl_mem), (void*)&cl_OutputBuf), "Error setting argument 3");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 4, sizeof(cl_mem), (void*)&cl_salt), "Error setting argument 4");
HANDLE_CLERROR(clSetKernelArg(crypt_kernel, 5, sizeof(cl_mem), (void*)&cl_aes_iv), "Error setting argument 5");
HANDLE_CLERROR(clSetKernelArg(RarFinal, 0, sizeof(cl_mem), (void*)&cl_saved_len), "Error setting argument 0");
HANDLE_CLERROR(clSetKernelArg(RarFinal, 1, sizeof(cl_mem), (void*)&cl_OutputBuf), "Error setting argument 1");
HANDLE_CLERROR(clSetKernelArg(RarFinal, 2, sizeof(cl_mem), (void*)&cl_aes_key), "Error setting argument 2");
cracked = mem_alloc(sizeof(*cracked) * gws);
}
/* ------- Helper functions ------- */
static size_t get_task_max_work_group_size()
{
return MIN(
MIN(autotune_get_task_max_work_group_size(FALSE, 0, RarInit),
autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel)),
autotune_get_task_max_work_group_size(FALSE, 0, RarFinal));
}
static void release_clobj(void)
{
if (cracked) {
HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[gpu_id], pinned_aes_key, aes_key, 0, NULL, NULL), "Error Unmapping aes_key");
HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[gpu_id], pinned_aes_iv, aes_iv, 0, NULL, NULL), "Error Unmapping aes_iv");
HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[gpu_id], pinned_saved_key, saved_key, 0, NULL, NULL), "Error Unmapping saved_key");
HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[gpu_id], pinned_saved_len, saved_len, 0, NULL, NULL), "Error Unmapping saved_len");
HANDLE_CLERROR(clEnqueueUnmapMemObject(queue[gpu_id], pinned_salt, saved_salt, 0, NULL, NULL), "Error Unmapping saved_salt");
HANDLE_CLERROR(clFinish(queue[gpu_id]), "Error releasing memory mappings");
HANDLE_CLERROR(clReleaseMemObject(cl_aes_key), "Release aes_key");
HANDLE_CLERROR(clReleaseMemObject(cl_aes_iv), "Release aes_iv");
HANDLE_CLERROR(clReleaseMemObject(cl_saved_key), "Release saved_key");
HANDLE_CLERROR(clReleaseMemObject(cl_saved_len), "Release saved_len");
HANDLE_CLERROR(clReleaseMemObject(cl_salt), "Release salt");
HANDLE_CLERROR(clReleaseMemObject(pinned_aes_key), "Release aes_key");
HANDLE_CLERROR(clReleaseMemObject(pinned_aes_iv), "Release aes_iv");
HANDLE_CLERROR(clReleaseMemObject(pinned_saved_key), "Release saved_key");
HANDLE_CLERROR(clReleaseMemObject(pinned_saved_len), "Release saved_len");
HANDLE_CLERROR(clReleaseMemObject(pinned_salt), "Release salt");
HANDLE_CLERROR(clReleaseMemObject(cl_OutputBuf), "Release OutputBuf");
MEM_FREE(cracked);
}
}
static void done(void)
{
if (autotuned) {
release_clobj();
HANDLE_CLERROR(clReleaseKernel(RarInit), "Release kernel");
HANDLE_CLERROR(clReleaseKernel(crypt_kernel), "Release kernel");
HANDLE_CLERROR(clReleaseKernel(RarFinal), "Release kernel");
HANDLE_CLERROR(clReleaseProgram(program[gpu_id]), "Release Program");
MEM_FREE(unpack_data);
autotuned--;
}
}
static void clear_keys(void)
{
memset(saved_len, 0, sizeof(int) * global_work_size);
}
static void init(struct fmt_main *_self)
{
self = _self;
opencl_prepare_dev(gpu_id);
#ifdef DEBUG
self->params.benchmark_comment = " (1-16 characters)";
#endif
/* We mimic the lengths of cRARk for comparisons */
if (!cpu(device_info[gpu_id])) {
#ifndef DEBUG
self->params.benchmark_comment = " (length 5)";
#endif
self->params.tests = gpu_tests;
}
#if defined (_OPENMP)
omp_t = omp_get_max_threads();
#endif /* _OPENMP */
if (options.target_enc == UTF_8)
self->params.plaintext_length = MIN(125, 3 * PLAINTEXT_LENGTH);
unpack_data = mem_calloc(omp_t, sizeof(unpack_data_t));
/* CRC-32 table init, do it before we start multithreading */
{
CRC32_t crc;
CRC32_Init(&crc);
}
}
static void reset(struct db_main *db)
{
if (!autotuned) {
char build_opts[64];
snprintf(build_opts, sizeof(build_opts), "-DPLAINTEXT_LENGTH=%u -DHASH_LOOPS=0x%x", PLAINTEXT_LENGTH, HASH_LOOPS);
opencl_init("$JOHN/kernels/rar_kernel.cl", gpu_id, build_opts);
// create kernels to execute
RarInit = clCreateKernel(program[gpu_id], "RarInit", &ret_code);
HANDLE_CLERROR(ret_code, "Error creating kernel. Double-check kernel name?");
crypt_kernel = clCreateKernel(program[gpu_id], "RarHashLoop", &ret_code);
HANDLE_CLERROR(ret_code, "Error creating kernel. Double-check kernel name?");
RarFinal = clCreateKernel(program[gpu_id], "RarFinal", &ret_code);
HANDLE_CLERROR(ret_code, "Error creating kernel. Double-check kernel name?");
//Initialize openCL tuning (library) for this format.
opencl_init_auto_setup(SEED, HASH_LOOPS, split_events,
warn, 3, self,
create_clobj, release_clobj,
UNICODE_LENGTH + sizeof(cl_int) * 14, 0, db);
//Auto tune execution from shared/included code.
autotune_run(self, ITERATIONS, 0,
(cpu(device_info[gpu_id]) ?
1000000000 : 10000000000ULL));
}
}
static int crypt_all(int *pcount, struct db_salt *salt)
{
const int count = *pcount;
int k;
size_t *lws = local_work_size ? &local_work_size : NULL;
size_t gws = GET_MULTIPLE_OR_BIGGER(count, local_work_size);
if (ocl_autotune_running || new_keys) {
BENCH_CLERROR(clEnqueueWriteBuffer(queue[gpu_id], cl_saved_key, CL_FALSE, 0, UNICODE_LENGTH * gws, saved_key, 0, NULL, multi_profilingEvent[0]), "failed in clEnqueueWriteBuffer saved_key");
BENCH_CLERROR(clEnqueueWriteBuffer(queue[gpu_id], cl_saved_len, CL_FALSE, 0, sizeof(int) * gws, saved_len, 0, NULL, multi_profilingEvent[1]), "failed in clEnqueueWriteBuffer saved_len");
new_keys = 0;
}
BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], RarInit, 1, NULL, &gws, lws, 0, NULL, multi_profilingEvent[2]), "failed in clEnqueueNDRangeKernel");
for (k = 0; k < (ocl_autotune_running ? 1 : (ITERATIONS / HASH_LOOPS)); k++) {
BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], crypt_kernel, 1, NULL, &gws, lws, 0, NULL, multi_profilingEvent[3]), "failed in clEnqueueNDRangeKernel");
BENCH_CLERROR(clFinish(queue[gpu_id]), "Error running loop kernel");
opencl_process_event();
}
BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], RarFinal, 1, NULL, &gws, lws, 0, NULL, multi_profilingEvent[4]), "failed in clEnqueueNDRangeKernel");
// read back aes key & iv
BENCH_CLERROR(clEnqueueReadBuffer(queue[gpu_id], cl_aes_key, CL_FALSE, 0, 16 * gws, aes_key, 0, NULL, multi_profilingEvent[5]), "failed in reading key back");
BENCH_CLERROR(clEnqueueReadBuffer(queue[gpu_id], cl_aes_iv, CL_TRUE, 0, 16 * gws, aes_iv, 0, NULL, multi_profilingEvent[6]), "failed in reading iv back");
if (!ocl_autotune_running)
check_rar(count);
return count;
}
struct fmt_main fmt_ocl_rar = {
{
FORMAT_LABEL,
FORMAT_NAME,
ALGORITHM_NAME,
BENCHMARK_COMMENT,
BENCHMARK_LENGTH,
0,
PLAINTEXT_LENGTH,
BINARY_SIZE,
BINARY_ALIGN,
SALT_SIZE,
SALT_ALIGN,
MIN_KEYS_PER_CRYPT,
MAX_KEYS_PER_CRYPT,
FMT_CASE | FMT_8_BIT | FMT_UNICODE | FMT_UTF8 | FMT_OMP | FMT_DYNA_SALT,
{ NULL },
{ FORMAT_TAG },
cpu_tests // Changed in init if GPU
},{
init,
done,
reset,
fmt_default_prepare,
valid,
fmt_default_split,
fmt_default_binary,
get_salt,
{ NULL },
fmt_default_source,
{
fmt_default_binary_hash
},
fmt_default_dyna_salt_hash,
NULL,
set_salt,
set_key,
get_key,
clear_keys,
crypt_all,
{
fmt_default_get_hash
},
cmp_all,
cmp_one,
cmp_exact
}
};
#endif /* plugin stanza */
#endif /* HAVE_OPENCL */
|
the_stack_data/43886784.c | #include<stdio.h>
int a[1000006],heap[1000006];
int n,k,m,flag;
int fun(int a,int b)
{
return flag^(b-a>0); //...//some problem
}
void shiftdown(int l)
{
int i,j;
i=l;
j=2*i;
heap[0]=heap[i];
while(j<=m)
{
if(j<m&&fun(a[heap[j]],a[heap[j+1]])) j++;
if(fun(a[heap[0]],a[heap[j]]))
{
heap[i]=heap[j];
i=j;
j=2*i;
}
else
{
heap[i]=heap[0];
return ;
}
}
heap[i]=heap[0];
}
void shiftup(int l)
{
int i,j;
heap[0]=heap[l];
i=l;
j=i/2;
while(j>=1)
{
if(fun(a[heap[j]],a[heap[0]]))
{
heap[i]=heap[j];
i=j;
j=i/2;
}
else
{
heap[i]=heap[0];
return ;
}
}
heap[i]=heap[0];
}
void max()
{
int i;
m=k;
for(i=1;i<=k;i++) heap[i]=i;
for(i=k/2;i>=1;i--) shiftdown(i);
printf("%d",a[heap[1]]);
for(i=k+1;i<=n;i++)
{
heap[++m]=i;
shiftup(m);
heap[0]=heap[1];
while(heap[0]<=i-k)
{
heap[1]=heap[m--];
shiftdown(1);
heap[0]=heap[1];
}
printf(" %d",a[heap[0]]);
}
printf("\n");
}
int main()
{
int i;
while(scanf("%d%d",&n,&k)!=EOF)
{
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
flag=1;
max();
flag=0;
max();
}
return 0;
}
|
the_stack_data/64200904.c | int __dummy__;
|
the_stack_data/132953867.c | // WAP to print out an array of dynamic values.
void main() {
int r,n,i,a[10];
// To set range of array:
printf("\n Enter the range of array: \n");
scanf("%d", &n);
// To get values of array:
printf("\n Enter the elements of the array: \n");
r = 0;
for (i=0 ; i<=n; i++) {
scanf("%d", &a[i]);
}
// To print the elements of the array:
printf("\n The elements of the array are: \n");
for (i=0 ; i<=n; i++) {
r++;
printf("\n a[%d] = %d \n", r, a[i]);
}
} |
the_stack_data/75463.c | // RUN: %clang %flags -shared -fPIC %s -o %T/first_tool.so
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %T/second_tool.so
// RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %T/third_tool.so
// RUN: %libomp-compile -DCODE
// RUN: env OMP_TOOL_LIBRARIES=%T/non_existing_file.so:%T/first_tool.so:%T/second_tool.so:%T/third_tool.so \
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%T
// REQUIRES: ompt
/*
* This file contains code for three OMPT shared library tool to be
* loaded and the code for the OpenMP executable.
* No option enables code for the first shared library
* (without an implementation of ompt_start_tool) during compilation
* -DTOOL -DSECOND_TOOL enables the code for the second tool during compilation
* -DTOOL -DTHIRD_TOOL enables the code for the third tool during compilation
* -DCODE enables the code for the executable during compilation
*/
// CHECK: ----- START LOGGING OF TOOL REGISTRATION -----
// CHECK-NEXT: Search for OMP tool in current address space... Failed.
// CHECK-NEXT: Searching tool libraries...
// CHECK-NEXT: OMP_TOOL_LIBRARIES = [[PARENTPATH]]/non_existing_file.so
// CHECK-SAME: [[PARENTPATH]]/first_tool.so
// CHECK-SAME: [[PARENTPATH]]/second_tool.so
// CHECK-SAME: [[PARENTPATH]]/third_tool.so
// CHECK-NEXT: Opening [[PARENTPATH]]/non_existing_file.so... Failed:
// CHECK-SAME: [[PARENTPATH]]/non_existing_file.so: cannot open shared object
// CHECK-SAME: file: No such file or directory
// CHECK-NEXT: Opening [[PARENTPATH]]/first_tool.so... Success.
// CHECK-NEXT: Searching for ompt_start_tool in
// CHECK-SAME: [[PARENTPATH]]/first_tool.so... Failed:
// CHECK-SAME: [[PARENTPATH]]/first_tool.so: undefined symbol: ompt_start_tool
// CHECK-NEXT: Opening [[PARENTPATH]]/second_tool.so... Success.
// CHECK-NEXT: Searching for ompt_start_tool in
// CHECK-SAME: [[PARENTPATH]]/second_tool.so... 0: Do not initialize tool
// CHECK-NEXT: Found but not using the OMPT interface.
// CHECK-NEXT: Continuing search...
// CHECK-NEXT: Opening [[PARENTPATH]]/third_tool.so... Success.
// CHECK-NEXT: Searching for ompt_start_tool in
// CHECK-SAME: [[PARENTPATH]]/third_tool.so... 0: Do initialize tool
// CHECK-NEXT: Success.
// CHECK-NEXT: Tool was started and is using the OMPT interface.
// CHECK-NEXT: ----- END LOGGING OF TOOL REGISTRATION -----
// Check if libomp supports the callbacks for this test.
// CHECK-NOT: {{^}}0: Could not register callback
// CHECK: {{^}}0: Tool initialized
// CHECK: {{^}}0: ompt_event_thread_begin
// CHECK-DAG: {{^}}0: ompt_event_thread_begin
// CHECK-DAG: {{^}}0: control_tool()=-1
// CHECK: {{^}}0: Tool finalized
#ifdef CODE
#include "stdio.h"
#include "omp.h"
#include "omp-tools.h"
int main()
{
#pragma omp parallel num_threads(2)
{
#pragma omp master
{
int result = omp_control_tool(omp_control_tool_start, 0, NULL);
printf("0: control_tool()=%d\n", result);
}
}
return 0;
}
#endif /* CODE */
#ifdef TOOL
#include <omp-tools.h>
#include "stdio.h"
#ifdef SECOND_TOOL
// The second tool has an implementation of ompt_start_tool that returns NULL
ompt_start_tool_result_t* ompt_start_tool(
unsigned int omp_version,
const char *runtime_version)
{
printf("0: Do not initialize tool\n");
return NULL;
}
#elif defined(THIRD_TOOL)
// The third tool has an implementation of ompt_start_tool that returns a
// pointer to a valid instance of ompt_start_tool_result_t
static void
on_ompt_callback_thread_begin(
ompt_thread_t thread_type,
ompt_data_t *thread_data)
{
printf("0: ompt_event_thread_begin\n");
}
int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_data_t *tool_data) {
ompt_set_callback_t ompt_set_callback = (ompt_set_callback_t) lookup("ompt_set_callback");
ompt_set_callback(ompt_callback_thread_begin, (ompt_callback_t)on_ompt_callback_thread_begin);
printf("0: Tool initialized\n");
return 1;
}
void ompt_finalize(ompt_data_t *tool_data)
{
printf("0: Tool finalized\n");
}
ompt_start_tool_result_t* ompt_start_tool(
unsigned int omp_version,
const char *runtime_version)
{
printf("0: Do initialize tool\n");
static ompt_start_tool_result_t ompt_start_tool_result = {&ompt_initialize,&ompt_finalize, 0};
return &ompt_start_tool_result;
}
#endif
#endif /* TOOL */
|
the_stack_data/179831526.c | #include <stdio.h>
void imprime(int x, int prod){
if (x != 3){
printf("%d ", prod);
}
else{
printf("%d\n", prod);
}
}
int main(){
int n, i, j, produto;
scanf("%d", &n);
for (i = 1; i <= n; i++){
produto = 1;
for (j = 1; j <= 3; j++){
produto *= i;
imprime(j, produto);
}
produto = 1;
for (j = 1; j <= 3; j++){
produto *= i;
if (j == 1){
imprime(j ,produto);
}
else{
imprime(j, produto + 1);
}
}
}
return 0;
}
|
the_stack_data/52325.c | #include<stdio.h>
#include<math.h> /*For trigonometric functions*/
/* #include<conio.h>
#include<windows.h>
These headers are windows specific.
If you compilpe on windows, then remove the comment symbol from the above headers and comment and # of lines marked with '#'. May warn for implicitly calling "system" */
int main()
{
int func;
double x, y;
/* #system("color 02");
#SetConsoleTitle("Wide Range Trigonometry calculation- ); */
printf("Wide Range Trigonometry calculation\n Choose Function From list:\n Trigonometry Functions: \n 1.tan\n 2.sin\n 3.cos\n Hyperbolic Trigonometry Functions: \n 4.tanh\n 5.sinh\n 6.cosh\n ");
printf("Inverse Trigonometry Functions: \n 7.tan^-1\n 8.sin^-1\n 9.cos^-1\n Inverse Hyperbolic Functions: \n a.tanh^-1\n b.sinh^-1\n c.cosh^-1\nPress e to exit\nType desired function number\n ");
scanf("%x",&func); /*%x makes the input to be read as base-16*/
if(func > 0 && func < 12 ) /* Loop , loop and more loops*/
{
printf("Value for x: ");
scanf("%lf",&x);
if (func == 1)
{
y = tan ( x );
printf ("The tangent of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 2)
{
y = sin ( x );
printf ("The sine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 3)
{
y = cos ( x );
printf ("The cosine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 4)
{
y = tanh ( x );
printf ("The hyperbolic tangent of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 5)
{
y = sinh ( x );
printf ("The hyperbolic sine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 6)
{
y = cosh ( x );
printf ("The hyperbolic cosine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 7)
{
y = atan ( x );
printf ("The arctangent of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 8)
{
y = asin ( x );
printf ("The arcsine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 9)
{
y = acos( x );
printf ("The arc-cosine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 10)
{
y = atanh ( x );
printf ("The hyperbolic arctangent of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 11)
{
y = asinh ( x );
printf ("The hyperbolic arcsine of %f is %f.\n", x, y );
printf(" \n");
}
else if (func == 12)
{
y = acosh ( x );
printf ("The hyperbolic arc-cosine of %f is %f.\n", x, y );
printf(" \n");
}
printf("Press any key to returm to main menu");
getchar();
getchar();
/* #system("pause");
#system("cls"); use these instead of getchar()*/
return main();
}
else if(func == 14) /*Home brewed quit function*/
{
return 0;
}
else
{
printf("ERROR!");
printf(" \n");
printf("Press any key to returm to main menu");
getchar();
getchar();
/* #system("pause");
#system("cls");*/
return main();
}
}
|
the_stack_data/114818.c | /* This test is part of GDB, the GNU debugger.
Copyright 2007-2014 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/>. */
int leaf (void)
{
return 1;
}
int marker (int val)
{
leaf ();
return leaf () * val;
}
int other (int val) __attribute__((alias("marker")));
int main(void)
{
marker (0);
marker (0);
return 0;
}
|
the_stack_data/38434.c | #include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// @NOTE: We do this so we only have to allocate constant space for doing
// swaps, rather than allocating at every recursive call.
static void qsort_aux(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *), void *swap_space);
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *))
{
void *swap_space = malloc(size);
qsort_aux(base, nmemb, size, compar, swap_space);
free(swap_space);
}
static void swap_elems(void *a, void *b, size_t size, void *swap_space)
{
if (a != b) {
memcpy(swap_space, a, size);
memcpy(a, b, size);
memcpy(b, swap_space, size);
}
}
static void qsort_aux(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *), void *swap_space)
{
#define NTH_ELEM(n) ((void *)((uint8_t *)base + ((n) * size)))
if (nmemb <= 1) {
return;
}
void *pivot = NTH_ELEM(nmemb - 1);
size_t lower_end = 0;
size_t higher_end = 0;
while (higher_end != nmemb - 1) {
void *curr_elem = NTH_ELEM(higher_end);
if (compar(curr_elem, pivot) < 0) {
swap_elems(curr_elem, NTH_ELEM(lower_end), size, swap_space);
lower_end++;
}
higher_end++;
}
swap_elems(pivot, NTH_ELEM(lower_end), size, swap_space);
size_t num_lower = lower_end;
size_t num_higher = nmemb - num_lower - 1;
void *lower_start = base;
void *higher_start = NTH_ELEM(lower_end + 1);
qsort_aux(lower_start, num_lower, size, compar, swap_space);
qsort_aux(higher_start, num_higher, size, compar, swap_space);
#undef NTH_ELEM
}
|
the_stack_data/130185.c | #include <stdio.h>
#include <stdlib.h>
void vassume(int b){}
void vtrace(int z, int n){}
void mainQ(int n, int kt, int flag) {
vassume(n >= 0);
int k = 1;
if (flag != 0) {
vassume(kt >= 0);
k = kt;
}
int i = 0;
int j = 0;
while (i <= n) {
i++;
j += i;
}
int z = k + i + j;
//%%%traces: int z, int n, int i, int j
vtrace(z, n);
//assert(z > 2 * n);
}
void main(int argc, char *argv[]) {
mainQ(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]));
}
|
the_stack_data/150142296.c | /* *****************************************************************************
* Do a whole bunch of malloc() calls followed by a whole bunch of free() calls.
* This allows the user to observe the memory usage of the process to see if it
* goes up (and more importantly, back down).
* ****************************************************************************/
#include <inttypes.h>
#include <malloc.h>
#include <stdint.h>
#include <stdio.h>
#define MALLOC_SIZE (16 * 1024 * 1024)
#define MALLOC_TOTAL (1 * 1024 * 1024 * 1024)
#define MALLOC_COUNT (MALLOC_TOTAL / MALLOC_SIZE)
uint8_t *ptrs[MALLOC_COUNT];
int main(int argc, char **argv)
{
uint64_t totalSize = 0ULL;
printf("%" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
MALLOC_SIZE, MALLOC_TOTAL, MALLOC_COUNT);
sleep(5);
int i;
for(i = 0; i < MALLOC_COUNT; i++) {
ptrs[i] = (uint8_t *) calloc(1, MALLOC_SIZE);
if(ptrs[i] != NULL) {
int x;
uint8_t *p = ptrs[i];
for(x = 0; x < MALLOC_SIZE; x++) {
p[x] = x;
}
}
totalSize += MALLOC_SIZE;
printf("%d: ptr %p: totalSize %" PRIu64 "\n",
i, ptrs[i], totalSize);
usleep(500000);
}
for(i = 0; i < MALLOC_COUNT; i++) {
printf("%d: Free ptr %p\n", i, ptrs[i]);
free(ptrs[i]);
usleep(500000);
}
sleep(3600);
return 0;
}
|
the_stack_data/212642291.c | extern const unsigned char Pods_TMPlayer_TestsVersionString[];
extern const double Pods_TMPlayer_TestsVersionNumber;
const unsigned char Pods_TMPlayer_TestsVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:Pods_TMPlayer_Tests PROJECT:Pods-1" "\n";
const double Pods_TMPlayer_TestsVersionNumber __attribute__ ((used)) = (double)1.;
|
the_stack_data/77930.c | /* Provide Declarations */
#include <stdarg.h>
#include <setjmp.h>
#include <limits.h>
#include <stdint.h>
struct l_struct_struct_OC_uint64v8_t;
struct l_struct_union_OC_vec512_t;
struct l_struct_union_OC_VectorReg;
struct l_struct_struct_OC_ArithFlags;
struct l_struct_union_OC_SegmentSelector;
struct l_struct_struct_OC_Segments;
struct l_struct_struct_OC_Reg;
struct l_struct_struct_OC_AddressSpace;
struct l_struct_struct_OC_GPR;
struct l_struct_struct_OC_anon_OC_3;
struct l_struct_struct_OC_X87Stack;
struct l_struct_struct_OC_uint64v1_t;
struct l_struct_union_OC_vec64_t;
struct l_struct_struct_OC_anon_OC_4;
struct l_struct_struct_OC_MMX;
struct l_struct_struct_OC_FPUStatusFlags;
struct l_struct_union_OC_FPUAbridgedTagWord;
struct l_struct_union_OC_FPUControlStatus;
struct l_struct_struct_OC_float80_t;
struct l_struct_union_OC_anon_OC_11;
struct l_struct_struct_OC_FPUStackElem;
struct l_struct_struct_OC_uint128v1_t;
struct l_struct_union_OC_vec128_t;
struct l_struct_struct_OC_FpuFXSAVE;
/* Types Definitions */
struct l_array_8_ureplace_u8int {
int array[8];
};
struct l_struct___bss_start_type {
struct l_array_8_ureplace_u8int field0;
} ;
struct l_struct_union_OC_anon {
int field0;
};
struct l_struct_struct_OC_ArchState {
int field0;
int field1;
struct l_struct_union_OC_anon field2;
};
struct l_array_8_ureplace_u64int {
int array[8];
};
struct l_struct_struct_OC_uint64v8_t {
struct l_array_8_ureplace_u64int field0;
};
struct l_struct_union_OC_vec512_t {
struct l_struct_struct_OC_uint64v8_t field0;
};
struct l_struct_union_OC_VectorReg {
struct l_struct_union_OC_vec512_t field0;
};
struct l_array_32_struct_AC_l_struct_union_OC_VectorReg {
struct l_struct_union_OC_VectorReg array[32];
};
struct l_struct_struct_OC_ArithFlags {
int field0;
int field1;
int field2;
int field3;
int field4;
int field5;
int field6;
int field7;
int field8;
int field9;
int field10;
int field11;
int field12;
int field13;
int field14;
int field15;
};
struct l_struct_union_OC_SegmentSelector {
int field0;
};
struct l_struct_struct_OC_Segments {
int field0;
struct l_struct_union_OC_SegmentSelector field1;
int field2;
struct l_struct_union_OC_SegmentSelector field3;
int field4;
struct l_struct_union_OC_SegmentSelector field5;
int field6;
struct l_struct_union_OC_SegmentSelector field7;
int field8;
struct l_struct_union_OC_SegmentSelector field9;
int field10;
struct l_struct_union_OC_SegmentSelector field11;
};
struct l_struct_struct_OC_Reg {
struct l_struct_union_OC_anon field0;
};
struct l_struct_struct_OC_AddressSpace {
int field0;
struct l_struct_struct_OC_Reg field1;
int field2;
struct l_struct_struct_OC_Reg field3;
int field4;
struct l_struct_struct_OC_Reg field5;
int field6;
struct l_struct_struct_OC_Reg field7;
int field8;
struct l_struct_struct_OC_Reg field9;
int field10;
struct l_struct_struct_OC_Reg field11;
};
struct l_struct_struct_OC_GPR {
int field0;
struct l_struct_struct_OC_Reg field1;
int field2;
struct l_struct_struct_OC_Reg field3;
int field4;
struct l_struct_struct_OC_Reg field5;
int field6;
struct l_struct_struct_OC_Reg field7;
int field8;
struct l_struct_struct_OC_Reg field9;
int field10;
struct l_struct_struct_OC_Reg field11;
int field12;
struct l_struct_struct_OC_Reg field13;
int field14;
struct l_struct_struct_OC_Reg field15;
int field16;
struct l_struct_struct_OC_Reg field17;
int field18;
struct l_struct_struct_OC_Reg field19;
int field20;
struct l_struct_struct_OC_Reg field21;
int field22;
struct l_struct_struct_OC_Reg field23;
int field24;
struct l_struct_struct_OC_Reg field25;
int field26;
struct l_struct_struct_OC_Reg field27;
int field28;
struct l_struct_struct_OC_Reg field29;
int field30;
struct l_struct_struct_OC_Reg field31;
int field32;
struct l_struct_struct_OC_Reg field33;
};
struct l_struct_struct_OC_anon_OC_3 {
int field0;
double field1;
};
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_3 {
struct l_struct_struct_OC_anon_OC_3 array[8];
};
struct l_struct_struct_OC_X87Stack {
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_3 field0;
};
struct l_array_1_ureplace_u64int {
int array[1];
};
struct l_struct_struct_OC_uint64v1_t {
struct l_array_1_ureplace_u64int field0;
};
struct l_struct_union_OC_vec64_t {
struct l_struct_struct_OC_uint64v1_t field0;
};
struct l_struct_struct_OC_anon_OC_4 {
int field0;
struct l_struct_union_OC_vec64_t field1;
};
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_4 {
struct l_struct_struct_OC_anon_OC_4 array[8];
};
struct l_struct_struct_OC_MMX {
struct l_array_8_struct_AC_l_struct_struct_OC_anon_OC_4 field0;
};
struct l_array_4_ureplace_u8int {
int array[4];
};
struct l_struct_struct_OC_FPUStatusFlags {
int field0;
int field1;
int field2;
int field3;
int field4;
int field5;
int field6;
int field7;
int field8;
int field9;
int field10;
int field11;
int field12;
int field13;
int field14;
int field15;
int field16;
int field17;
int field18;
int field19;
struct l_array_4_ureplace_u8int field20;
};
struct l_struct_union_OC_FPUAbridgedTagWord {
int field0;
};
struct l_struct_union_OC_FPUControlStatus {
int field0;
};
struct l_array_10_ureplace_u8int {
int array[10];
};
struct l_struct_struct_OC_float80_t {
struct l_array_10_ureplace_u8int field0;
};
struct l_struct_union_OC_anon_OC_11 {
struct l_struct_struct_OC_float80_t field0;
};
struct l_array_6_ureplace_u8int {
int array[6];
};
struct l_struct_struct_OC_FPUStackElem {
struct l_struct_union_OC_anon_OC_11 field0;
struct l_array_6_ureplace_u8int field1;
};
struct l_array_8_struct_AC_l_struct_struct_OC_FPUStackElem {
struct l_struct_struct_OC_FPUStackElem array[8];
};
struct l_array_96_ureplace_u8int {
int array[96];
};
struct l_struct_struct_OC_SegmentShadow {
struct l_struct_union_OC_anon field0;
int field1;
int field2;
};
struct l_struct_struct_OC_SegmentCaches {
struct l_struct_struct_OC_SegmentShadow field0;
struct l_struct_struct_OC_SegmentShadow field1;
struct l_struct_struct_OC_SegmentShadow field2;
struct l_struct_struct_OC_SegmentShadow field3;
struct l_struct_struct_OC_SegmentShadow field4;
struct l_struct_struct_OC_SegmentShadow field5;
};
struct l_struct_struct_OC_State {
struct l_struct_struct_OC_ArchState field0;
struct l_array_32_struct_AC_l_struct_union_OC_VectorReg field1;
struct l_struct_struct_OC_ArithFlags field2;
struct l_struct_union_OC_anon field3;
struct l_struct_struct_OC_Segments field4;
struct l_struct_struct_OC_AddressSpace field5;
struct l_struct_struct_OC_GPR field6;
struct l_struct_struct_OC_X87Stack field7;
struct l_struct_struct_OC_MMX field8;
struct l_struct_struct_OC_FPUStatusFlags field9;
struct l_struct_union_OC_anon field10;
struct l_struct_struct_OC_SegmentCaches field12;
};
/* External Global Variable Declarations */
/* Function Declarations */
int __VERIFIER_nondet_int() { int x; return x; };
void __mcsema_destructor(void) ;
void __mcsema_constructor(void) ;
/* Global Variable Definitions and Initialization */
struct l_struct___bss_start_type __bss_start;
/* LLVM Intrinsic Builtin Function Bodies */
static int llvm_select_u64(int condition, int iftrue, int ifnot) {
int r;
r = condition ? iftrue : ifnot;
return r;
}
static int llvm_add_u32(int a, int b) {
int r = a + b;
return r;
}
static int llvm_add_u64(int a, int b) {
int r = a + b;
return r;
}
static int llvm_lshr_u32(int a, int b) {
int r = a >> b;
return r;
}
static int llvm_lshr_u64(int a, int b) {
int r = a >> b;
return r;
}
static int llvm_and_u8(int a, int b) {
int r = a & b;
return r;
}
static int llvm_xor_u8(int a, int b) {
int r = a ^ b;
return r;
}
static int llvm_OC_ctpop_OC_i32(int a) {
int r;
r = LLVMCountPopulation(8 * sizeof(a), &a);
return r;
}
/* Function Bodies */
int main() {
struct l_struct_struct_OC_State* tmp__1;
int tmp__2;
void* tmp__3;
struct l_struct_union_OC_anon* tmp__4;
int* tmp__5;
int* tmp__6;
int* tmp__7;
int* tmp__8;
int* tmp__9;
int* EAX;
int tmp__10;
int tmp__11;
int tmp__12;
int tmp__13;
int* tmp__14;
int tmp__15;
int* tmp__16;
int* tmp__17;
int* tmp__18;
int tmp__19;
int* tmp__20;
int tmp__21;
int* tmp__22;
int tmp__23;
void* tmp__24;
int tmp__25;
int tmp__26;
int tmp__27;
int tmp__28;
int tmp__29;
void* tmp__30;
int tmp__31;
int tmp__32;
int tmp__33;
int tmp__34;
int tmp__35;
int tmp__36;
int tmp__37;
int tmp__38;
int tmp__39;
int tmp__40;
int tmp__41;
int tmp__42;
int tmp__43;
int tmp__44;
int tmp__45;
int tmp__46;
int tmp__47;
int tmp__48;
int tmp__49;
int tmp__50;
int tmp__51;
int tmp__52;
int tmp__53;
int tmp__54;
int tmp__55;
int tmp__56;
int tmp__57;
int tmp__58;
int tmp__59;
int tmp__60;
void* tmp__61;
void* tmp__61__PHI_TEMPORARY;
int tmp__62;
int tmp__63;
int tmp__64;
int tmp__65;
int tmp__65__PHI_TEMPORARY;
void* tmp__66;
void* tmp__66__PHI_TEMPORARY;
int tmp__67;
int tmp__68;
int tmp__69;
int tmp__70;
int tmp__71;
int tmp__72;
int tmp__73;
int tmp__74;
int tmp__75;
tmp__4 = (&tmp__1->field6.field1.field0);
tmp__5 = (&tmp__4->field0);
tmp__6 = (&tmp__1->field6.field7.field0.field0);
tmp__7 = (&tmp__1->field6.field13.field0.field0);
tmp__8 = (&tmp__1->field6.field15.field0.field0);
tmp__9 = (&tmp__1->field6.field33.field0.field0);
EAX = ((int*)tmp__4);
tmp__10 = *tmp__8;
tmp__11 = *tmp__7;
tmp__12 = llvm_add_u64(tmp__11, (18446744073709551608UL));
*(((int*)tmp__12)) = tmp__10;
*tmp__8 = tmp__12;
tmp__13 = llvm_add_u64(tmp__11, (18446744073709551592UL));
tmp__14 = (&tmp__1->field2.field1);
*tmp__14 = (((int)(int)(((((int)tmp__12) < ((int)(16UL)))&1))));
tmp__15 = /*tail*/ llvm_OC_ctpop_OC_i32(((((int)tmp__13)) & 255));
tmp__16 = (&tmp__1->field2.field3);
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__15)), 1)), 1));
tmp__17 = (&tmp__1->field2.field5);
*tmp__17 = (llvm_and_u8((((int)(llvm_lshr_u64(((tmp__12 ^ (16UL)) ^ tmp__13), (4UL))))), 1));
tmp__18 = (&tmp__1->field2.field7);
*tmp__18 = (((int)(int)(((tmp__13 == (0UL))&1))));
tmp__19 = llvm_lshr_u64(tmp__13, (63UL));
tmp__20 = (&tmp__1->field2.field9);
*tmp__20 = (((int)tmp__19));
tmp__21 = llvm_lshr_u64(tmp__12, (63UL));
tmp__22 = (&tmp__1->field2.field13);
*tmp__22 = (((int)(int)((((llvm_add_u64((tmp__19 ^ tmp__21), tmp__21)) == (2UL))&1))));
*tmp__5 = (0UL);
tmp__23 = llvm_add_u64(tmp__11, (18446744073709551584UL));
*(((int*)tmp__23)) = (llvm_add_u64(tmp__2, (22UL)));
*tmp__7 = tmp__23;
tmp__24 = /*tail*/ sub_401106___VERIFIER_nondet_int(tmp__1, /*UNDEF*/(0UL), tmp__3);
tmp__25 = *tmp__8;
tmp__26 = *EAX;
tmp__27 = *tmp__9;
*(((int*)(llvm_add_u64(tmp__25, (18446744073709551612UL))))) = tmp__26;
*tmp__5 = (0UL);
tmp__28 = *tmp__7;
tmp__29 = llvm_add_u64(tmp__28, (18446744073709551608UL));
*(((int*)tmp__29)) = (llvm_add_u64(tmp__27, (13UL)));
*tmp__7 = tmp__29;
tmp__30 = /*tail*/ sub_401106___VERIFIER_nondet_int(tmp__1, /*UNDEF*/(0UL), tmp__24);
tmp__31 = *tmp__8;
tmp__32 = llvm_add_u64(tmp__31, (18446744073709551608UL));
tmp__33 = *EAX;
tmp__34 = *tmp__9;
*(((int*)tmp__32)) = tmp__33;
tmp__35 = llvm_add_u64(tmp__31, (18446744073709551612UL));
tmp__36 = *(((int*)tmp__35));
tmp__37 = llvm_add_u32(tmp__36, 65535);
*tmp__14 = (((int)(int)(((((int)tmp__36) < ((int)4294901761u))&1))));
tmp__38 = /*tail*/ llvm_OC_ctpop_OC_i32((tmp__37 & 255));
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__38)), 1)), 1));
*tmp__17 = (llvm_and_u8((((int)(llvm_lshr_u32((tmp__37 ^ tmp__36), 4)))), 1));
*tmp__18 = (((int)(int)(((tmp__37 == 0u)&1))));
tmp__39 = llvm_lshr_u32(tmp__37, 31);
tmp__40 = ((int)tmp__39);
*tmp__20 = tmp__40;
tmp__41 = llvm_lshr_u32(tmp__36, 31);
*tmp__22 = (((int)(int)((((llvm_add_u32((tmp__39 ^ tmp__41), (tmp__41 ^ 1))) == 2u)&1))));
tmp__42 = (((((tmp__40 != ((int)0))&1)) ^ ((((llvm_add_u32((tmp__39 ^ tmp__41), (tmp__41 ^ 1))) == 2u)&1)))&1);
tmp__43 = llvm_add_u64((llvm_select_u64(tmp__42, (11UL), (2UL))), (llvm_add_u64(tmp__34, (10UL))));
if (tmp__42) {
goto block_401149;
} else {
goto block_401140;
}
block_401159:
tmp__44 = llvm_add_u32(tmp__53, -65535);
*tmp__14 = (((int)(int)(((((int)tmp__53) < ((int)65535u))&1))));
tmp__45 = /*tail*/ llvm_OC_ctpop_OC_i32((tmp__44 & 255));
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__45)), 1)), 1));
*tmp__17 = (llvm_and_u8((((int)(llvm_lshr_u32(((tmp__53 ^ 16) ^ tmp__44), 4)))), 1));
*tmp__18 = (((int)(int)(((tmp__44 == 0u)&1))));
tmp__46 = llvm_lshr_u32(tmp__44, 31);
tmp__47 = ((int)tmp__46);
*tmp__20 = tmp__47;
*tmp__22 = (((int)(int)((((llvm_add_u32((tmp__46 ^ tmp__58), tmp__58)) == 2u)&1))));
tmp__48 = (((((tmp__44 == 0u)&1)) | ((((((tmp__47 != ((int)0))&1)) ^ ((((llvm_add_u32((tmp__46 ^ tmp__58), tmp__58)) == 2u)&1)))&1)))&1);
tmp__49 = llvm_add_u64((llvm_add_u64(tmp__60, (7UL))), (llvm_select_u64(tmp__48, (33UL), (2UL))));
if (tmp__48) {
tmp__65__PHI_TEMPORARY = tmp__49; /* for PHI node */
tmp__66__PHI_TEMPORARY = tmp__30; /* for PHI node */
goto block_401181;
} else {
goto block_401162;
}
block_401150:
tmp__53 = *(((int*)tmp__32));
tmp__54 = llvm_add_u32(tmp__53, 65535);
*tmp__14 = (((int)(int)(((((int)tmp__53) < ((int)4294901761u))&1))));
tmp__55 = /*tail*/ llvm_OC_ctpop_OC_i32((tmp__54 & 255));
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__55)), 1)), 1));
*tmp__17 = (llvm_and_u8((((int)(llvm_lshr_u32((tmp__54 ^ tmp__53), 4)))), 1));
*tmp__18 = (((int)(int)(((tmp__54 == 0u)&1))));
tmp__56 = llvm_lshr_u32(tmp__54, 31);
tmp__57 = ((int)tmp__56);
*tmp__20 = tmp__57;
tmp__58 = llvm_lshr_u32(tmp__53, 31);
*tmp__22 = (((int)(int)((((llvm_add_u32((tmp__56 ^ tmp__58), (tmp__58 ^ 1))) == 2u)&1))));
tmp__59 = (((((tmp__57 != ((int)0))&1)) ^ ((((llvm_add_u32((tmp__56 ^ tmp__58), (tmp__58 ^ 1))) == 2u)&1)))&1);
tmp__60 = llvm_add_u64((llvm_select_u64(tmp__59, (11UL), (2UL))), (llvm_add_u64(tmp__75, (7UL))));
if (tmp__59) {
goto block_401162;
} else {
goto block_401159;
}
block_40118c:
tmp__61 = tmp__61__PHI_TEMPORARY;
tmp__62 = *(((int*)tmp__31));
*tmp__8 = tmp__62;
tmp__63 = *(((int*)(llvm_add_u64(tmp__31, (8UL)))));
*tmp__9 = tmp__63;
*tmp__7 = (llvm_add_u64(tmp__31, (16UL)));
return tmp__61;
block_401149:
*tmp__5 = (0UL);
tmp__61__PHI_TEMPORARY = tmp__30; /* for PHI node */
goto block_40118c;
block_401187:
tmp__64 = /*tail*/ llvm_OC_ctpop_OC_i32((tmp__67 & 255));
*tmp__14 = 0;
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__64)), 1)), 1));
*tmp__17 = 0;
*tmp__18 = (((int)(int)(((tmp__67 == 0u)&1))));
*tmp__20 = (((int)tmp__68));
*tmp__22 = 0;
*tmp__5 = (0UL);
tmp__61__PHI_TEMPORARY = tmp__66; /* for PHI node */
goto block_40118c;
block_401162:
*tmp__5 = (0UL);
tmp__61__PHI_TEMPORARY = tmp__30; /* for PHI node */
goto block_40118c;
do { /* Syntactic loop 'block_401181' to make GCC happy */
block_401181:
tmp__65 = tmp__65__PHI_TEMPORARY;
tmp__66 = tmp__66__PHI_TEMPORARY;
tmp__67 = *(((int*)tmp__35));
tmp__68 = llvm_lshr_u32(tmp__67, 31);
tmp__69 = llvm_add_u64((llvm_select_u64((((tmp__68 == 0u)&1)), (18446744073709551588UL), (2UL))), (llvm_add_u64(tmp__65, (4UL))));
if ((((tmp__68 == 0u)&1))) {
goto block_401169;
} else {
goto block_401187;
}
block_401169:
tmp__50 = *(((int*)tmp__32));
*(((int*)tmp__35)) = (llvm_add_u32(tmp__50, tmp__67));
tmp__51 = *(((int*)tmp__32));
*tmp__6 = (((int)(int)tmp__51));
tmp__52 = llvm_add_u64(tmp__69, (24UL));
*(((int*)tmp__32)) = (~((tmp__51 << 1)));
tmp__65__PHI_TEMPORARY = tmp__52; /* for PHI node */
tmp__66__PHI_TEMPORARY = tmp__66; /* for PHI node */
goto block_401181;
} while (1); /* end of syntactic loop 'block_401181' */
block_401140:
tmp__70 = llvm_add_u32(tmp__36, -65535);
*tmp__14 = (((int)(int)(((((int)tmp__36) < ((int)65535u))&1))));
tmp__71 = /*tail*/ llvm_OC_ctpop_OC_i32((tmp__70 & 255));
*tmp__16 = (llvm_xor_u8((llvm_and_u8((((int)tmp__71)), 1)), 1));
*tmp__17 = (llvm_and_u8((((int)(llvm_lshr_u32(((tmp__36 ^ 16) ^ tmp__70), 4)))), 1));
*tmp__18 = (((int)(int)(((tmp__70 == 0u)&1))));
tmp__72 = llvm_lshr_u32(tmp__70, 31);
tmp__73 = ((int)tmp__72);
*tmp__20 = tmp__73;
*tmp__22 = (((int)(int)((((llvm_add_u32((tmp__72 ^ tmp__41), tmp__41)) == 2u)&1))));
tmp__74 = (((((tmp__70 == 0u)&1)) | ((((((tmp__73 != ((int)0))&1)) ^ ((((llvm_add_u32((tmp__72 ^ tmp__41), tmp__41)) == 2u)&1)))&1)))&1);
tmp__75 = llvm_add_u64((llvm_add_u64(tmp__43, (7UL))), (llvm_select_u64(tmp__74, (9UL), (2UL))));
if (tmp__74) {
goto block_401150;
} else {
goto block_401149;
}
}
|
the_stack_data/170453993.c | #include <stdio.h>
int main(int argc, char** argv) {
for(int i = 1; i <= 100; i++) {
if(i % 3 == 0 && i % 5 == 0){
printf("Fizzbuzz");
}
else if(i % 3 == 0){
printf("Fizz");
}
else if(i % 5 == 0){
printf("Buzz");
}
else{
printf("%d", i);
}
printf(", ");
}
return 0;
} |
the_stack_data/459012.c | #include<stdio.h>
long long jie(long long);
int main(){
long long m,n,x,y,z;
scanf("%lld%lld",&m,&n);
if(m==n)
printf("1");
else{
x=jie(m),y=jie(n),z=jie(m-n);
printf("%lld",x/(y*z));
}
return 0;
}
long long jie(long long a){
long long sum=1,i;
for(i=a;i>0;i--)
sum=sum*i;
return sum;
} |
the_stack_data/1169512.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#define NSTEPS 8388600
#define NITER 8388600
#define P_START 0
#define P_END 10
struct timeval startTime;
struct timeval finishTime;
double timeIntervalLength;
int NUM_THREADS = 8;
int main(int argc, char* argv[])
{
int i;
double h;
double area;
double p_current = P_START;
double f_result_low, f_result_high;
//
//I N I T I A L I Z A T I O N S
//
h = (double)(P_END-P_START)/NSTEPS;
p_current = P_START;
area=0.0;
//Get the start time
gettimeofday(&startTime, NULL);
for(i = 0; i < NITER; i++)
{
p_current = i*h;
f_result_low = cos(p_current);
f_result_high = cos(p_current+h);
area += (f_result_low + f_result_high)*h/2;
p_current += h;
}
//Get the end time
gettimeofday(&finishTime, NULL); /* after time */
printf("Result : %.2lf \n",area);
//Calculate the interval length
timeIntervalLength = (double)(finishTime.tv_sec-startTime.tv_sec) * 1000000
+ (double)(finishTime.tv_usec-startTime.tv_usec);
timeIntervalLength=timeIntervalLength/1000;
//Print the interval lenght
printf("Interval length: %g msec.\n", timeIntervalLength);
return 0;
}
|
the_stack_data/212643119.c | int main() {
foo();
}
|
the_stack_data/40763774.c | #include<stdio.h>
int main(){
int num ,par , impar, resultado ;
printf("digite um numero : ");
scanf(" %d",&num);
resultado = num % 2 ;
if (resultado == 0){
par = num ;
printf("o numero %d e par ",par);
}else{
impar = num ;
printf("o numero %d e impar ", impar);
}
return 0 ;
} |
the_stack_data/173577323.c |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <inttypes.h>
#define NAMESIZE 256
static char buf[65536];
static char filename[FILENAME_MAX+1];
static int lineno = 0;
static int sccz80_mode = 0;
char *skip_ws(char *ptr)
{
while ( isspace(*ptr) ) {
ptr++;
}
return ptr;
}
void strip_nl(char *ptr)
{
char *nl;
if ( ( nl = strchr(ptr,'\n') ) != NULL || (nl = strchr(ptr,'\r')) != NULL ) {
*nl = 0;
}
}
void first_word_only(char *ptr)
{
while (!isspace(*ptr))
++ptr;
*ptr = 0;
}
/*
* Dump some text into the zcc_opt.def, this allows us to define some
* things that the startup code might need
*/
void write_pragma_string(char *ptr)
{
char *text;
FILE *fp;
ptr = skip_ws(ptr);
strip_nl(ptr);
text = strchr(ptr,' ');
if ( text == NULL ) text = strchr(ptr,'\t');
if ( text != NULL ) {
*text = 0;
text++;
if ( (fp=fopen("zcc_opt.def","a")) == NULL ) {
fprintf(stderr,"%s:%d Cannot open zcc_opt.def file\n", filename, lineno);
exit(1);
}
text = skip_ws(text);
fprintf(fp,"\nIF NEED_%s\n",ptr);
fprintf(fp,"\tdefm\t\"%s\"\n",text);
fprintf(fp,"\tdefc DEFINED_NEED_%s = 1\n",ptr);
fprintf(fp,"ENDIF\n\n");
fclose(fp);
}
}
/* Dump some bytes into the zcc_opt.def file */
void write_bytes(char *line, int flag)
{
FILE *fp;
char sname[NAMESIZE+1];
char *ptr;
long value;
int count;
ptr = sname;
while ( isalpha(*line) && ( ptr - sname) < NAMESIZE ) {
*ptr++ = *line++;
}
*ptr = 0;
if ( strlen(sname) ) {
if ( (fp=fopen("zcc_opt.def","a")) == NULL ) {
fprintf(stderr,"%s:%d Cannot open zcc_opt.def file\n", filename, lineno);
exit(1);
}
fprintf(fp,"\nIF NEED_%s\n",sname);
if ( flag ) {
fprintf(fp,"\tdefc DEFINED_NEED_%s = 1\n",sname);
}
/* Now, do the numbers */
count=0;
ptr = skip_ws(line);
while ( *line != ';' ) {
char *end;
if ( count == 0 ) {
fprintf(fp,"\n\tdefb\t");
} else {
fprintf(fp,",");
}
value = strtol(line, &end, 0);
if ( end != line ) {
fprintf(fp,"%ld",value);
} else {
fprintf(stderr, "%s:%d Invalid number format %.10s\n",filename, lineno, line);
break;
}
line = skip_ws(end);
if ( *line == ';' ) {
break;
} else if ( *line != ',' ) {
fprintf(stderr, "%s:%d Invalid syntax for #pragma line\n", filename, lineno);
break;
}
line = skip_ws(line);
count++;
if ( count == 9 ) count=0;
}
fprintf(fp,"\nENDIF\n");
fclose(fp);
}
}
void write_defined(char *sname, int32_t value, int export)
{
FILE *fp;
if ( (fp=fopen("zcc_opt.def","a")) == NULL ) {
fprintf(stderr,"%s:%d Cannot open zcc_opt.def file\n", filename, lineno);
exit(1);
}
strip_nl(sname);
fprintf(fp,"\nIF !DEFINED_%s\n",sname);
fprintf(fp,"\tdefc\tDEFINED_%s = 1\n",sname);
if (export) fprintf(fp, "\tPUBLIC\t%s\n", sname);
fprintf(fp,"\tdefc %s = %0#x\n",sname,value);
fprintf(fp,"\tIFNDEF %s\n\tENDIF\n",sname);
fprintf(fp,"ENDIF\n\n");
fclose(fp);
}
void write_need(char *sname, int value)
{
FILE *fp;
if ( (fp=fopen("zcc_opt.def","a")) == NULL ) {
fprintf(stderr,"%s:%d Cannot open zcc_opt.def file\n", filename, lineno);
exit(1);
}
fprintf(fp,"\nIF !NEED_%s\n",sname);
fprintf(fp,"\tdefc\tNEED_%s = %d\n",sname, value);
fprintf(fp,"ENDIF\n\n");
fclose(fp);
}
void write_redirect(char *sname, char *value)
{
FILE *fp;
strip_nl(sname);
value = skip_ws(value);
first_word_only(value);
if ( (fp=fopen("zcc_opt.def","a")) == NULL ) {
fprintf(stderr,"%s:%d Cannot open zcc_opt.def file\n", filename, lineno);
exit(1);
}
fprintf(fp,"\nIF !DEFINED_%s\n",sname);
fprintf(fp,"\tPUBLIC %s\n",sname);
fprintf(fp,"\tEXTERN %s\n",value);
fprintf(fp,"\tdefc\tDEFINED_%s = 1\n",sname);
fprintf(fp,"\tdefc %s = %s\n",sname,value);
fprintf(fp,"ENDIF\n\n");
fclose(fp);
}
typedef struct convspec_s {
char fmt;
char complex;
uint32_t val;
uint32_t lval;
uint32_t llval;
} CONVSPEC;
CONVSPEC printf_formats[] = {
{ 'd', 1, 0x01, 0x1000, 0x01 },
{ 'u', 1, 0x02, 0x2000, 0x02 },
{ 'x', 2, 0x04, 0x4000, 0x04 },
{ 'X', 2, 0x08, 0x8000, 0x08 },
{ 'o', 2, 0x10, 0x10000, 0x10 },
{ 'n', 2, 0x20, 0x20000, 0 },
{ 'i', 2, 0x40, 0x40000, 0x40 },
{ 'p', 2, 0x80, 0x80000, 0 },
{ 'B', 2, 0x100, 0x100000, 0 },
{ 's', 1, 0x200, 0, 0 },
{ 'c', 1, 0x400, 0, 0 },
{ 'I', 0, 0x800, 0, 0 },
{ 'a', 0, 0x400000, 0x400000, 0 },
{ 'A', 0, 0x800000, 0x800000, 0 },
{ 'e', 3, 0x1000000, 0x1000000, 0 },
{ 'E', 3, 0x2000000, 0x2000000, 0 },
{ 'f', 3, 0x4000000, 0x4000000, 0 },
{ 'F', 3, 0x8000000, 0x8000000, 0 },
{ 'g', 3, 0x10000000, 0x10000000, 0 },
{ 'G', 3, 0x20000000, 0x20000000, 0 },
{ 0, 0, 0, 0 }
};
CONVSPEC scanf_formats[] = {
{ 'd', 1, 0x01, 0x1000, 0x01 },
{ 'u', 1, 0x02, 0x2000, 0x02 },
{ 'x', 2, 0x04, 0x4000, 0x04 },
{ 'X', 2, 0x08, 0x8000, 0x08 },
{ 'o', 2, 0x10, 0x10000, 0x10 },
{ 'n', 2, 0x20, 0x20000, 0 },
{ 'i', 2, 0x40, 0x40000, 0x40 },
{ 'p', 2, 0x80, 0x80000, 0 },
{ 'B', 2, 0x100, 0x100000, 0 },
{ 's', 1, 0x200, 0, 0 },
{ 'c', 1, 0x400, 0, 0 },
{ 'I', 0, 0x800, 0, 0 },
{ '[', 0, 0x200000, 0x200000, 0},
{ 'a', 0, 0x400000, 0x400000, 0 },
{ 'A', 0, 0x800000, 0x800000, 0 },
{ 'e', 3, 0x1000000, 0x1000000, 0 },
{ 'E', 3, 0x2000000, 0x2000000, 0 },
{ 'f', 3, 0x4000000, 0x4000000, 0 },
{ 'F', 3, 0x8000000, 0x8000000, 0 },
{ 'g', 3, 0x10000000, 0x10000000, 0 },
{ 'G', 3, 0x20000000, 0x20000000, 0 },
{ 0, 0, 0, 0 }
};
static uint64_t parse_format_string(char *arg, CONVSPEC *specifiers)
{
char c;
int complex, islong;
uint64_t format_option = 0;
CONVSPEC *fmt;
for (complex = 1; (c = *arg); ++arg)
{
if (c == '/')
break;
if ((c == '%') || isspace(c) || (c == '"') || (c == '='))
continue;
if (*arg == '-' || *arg == '0' || *arg == '+' || *arg == ' ' || *arg == '*' || *arg == '.')
{
if (complex < 2)
complex = 2; /* Switch to standard */
format_option |= 0x40000000;
while (!isalpha(*arg))
arg++;
}
else if (isdigit(*arg))
{
if (complex < 2)
complex = 2; /* Switch to standard */
format_option |= 0x40000000;
while (isdigit(*arg) || *arg == '.')
arg++;
}
islong = 0;
if (*arg == 'l')
{
if (complex < 2)
complex = 2;
arg++;
islong = 1;
if (*arg == 'l')
{
arg++;
islong = 2;
}
}
fmt = specifiers;
while (fmt->fmt)
{
if (fmt->fmt == *arg)
{
if (complex < fmt->complex)
complex = fmt->complex;
switch (islong)
{
case 0:
format_option |= fmt->val;
break;
case 1:
format_option |= fmt->lval;
break;
default:
format_option |= (uint64_t)(fmt->llval) << 32;
break;
}
break;
}
fmt++;
}
if (fmt->fmt == 0)
fprintf(stderr, "Ignoring unrecognized %s format specifier %%%c\n", (specifiers == printf_formats) ? "printf" : "scanf", *arg);
}
return format_option;
}
int main(int argc, char **argv)
{
char *ptr;
if ( argc == 2 && strcmp(argv[1],"-sccz80") == 0 ) {
sccz80_mode = 1;
}
strcpy(filename,"<stdin>");
lineno = 0;
while ( fgets(buf, sizeof(buf) - 1, stdin) != NULL ) {
lineno++;
ptr = skip_ws(buf);
if ( strncmp(ptr,"#pragma", 7) == 0 ) {
int ol = 1;
ptr = skip_ws(ptr + 7);
if ( ( strncmp(ptr, "output",6) == 0 ) || ( strncmp(ptr, "define",6) == 0 ) || ( strncmp(ptr, "export",6) == 0 ) ) {
char *offs;
int value = 0;
int exp = strncmp(ptr, "export",6) == 0;
ptr = skip_ws(ptr+6);
if ( (offs = strchr(ptr+1,'=') ) != NULL ) {
value = (int)strtol(offs+1,NULL,0);
*offs = 0;
}
write_defined(ptr,value,exp);
if ( strncmp(ptr, "STACKPTR",8) == 0 ) {
write_defined("REGISTER_SP",value,exp);
}
if ( strncmp(ptr, "nostreams",9) == 0 ) {
write_defined("CRT_ENABLE_STDIO",0,exp);
}
} else if ( strncmp(ptr, "redirect",8) == 0 ) {
char *offs;
char *value = "0";
ptr = skip_ws(ptr+8);
if ( (offs = strchr(ptr+1,'=') ) != NULL ) {
value = offs + 1;
*offs = 0;
}
write_redirect(ptr,value);
} else if ( strncmp(ptr,"printf", 6) == 0 ) {
uint64_t value = parse_format_string(ptr + 6, printf_formats);
write_defined("CLIB_OPT_PRINTF", (int32_t)(value & 0xffffffff), 0);
write_defined("CLIB_OPT_PRINTF_2", (int32_t)((value >> 32) & 0xffffffff), 0);
} else if ( strncmp(ptr,"scanf", 5) == 0 ) {
uint64_t value = parse_format_string(ptr + 5, scanf_formats);
write_defined("CLIB_OPT_SCANF", (int32_t)(value & 0xffffffff), 0);
write_defined("CLIB_OPT_SCANF_2", (int32_t)((value >> 32) & 0xffffffff), 0);
} else if ( strncmp(ptr,"string",6) == 0 ) {
write_pragma_string(ptr + 6);
} else if ( strncmp(ptr, "data", 4) == 0 ) {
write_bytes(ptr + 4, 1);
} else if ( strncmp(ptr, "byte", 4) == 0 ) {
write_bytes(ptr + 4, 0);
} else if ( sccz80_mode == 0 && strncmp(ptr, "asm", 3) == 0 ) {
fputs("__asm\n",stdout);
ol = 0;
} else if ( sccz80_mode == 0 && strncmp(ptr, "endasm", 6) == 0 ) {
fputs("__endasm;\n",stdout);
ol = 0;
} else if ( sccz80_mode == 1 && strncmp(ptr, "asm", 3) == 0 ) {
fputs("#asm\n",stdout);
ol = 0;
} else if ( sccz80_mode == 1 && strncmp(ptr, "endasm", 6) == 0 ) {
fputs("#endasm\n",stdout);
ol = 0;
} else if (strncmp(ptr, "-zorg=", 6) == 0 ) {
/* It's an option, this may tweak something */
write_defined("CRT_ORG_CODE", strtol(ptr+6, NULL, 0), 0);
} else if ( strncmp(ptr, "-reqpag=", 8) == 0 ) {
write_defined("CRT_Z88_BADPAGES", strtol(ptr+8, NULL, 0), 0);
} else if ( strncmp(ptr, "-defvars=", 8) == 0 ) {
write_defined("defvarsaddr", strtol(ptr+8, NULL, 0), 0);
} else if ( strncmp(ptr, "-safedata=", 10) == 0 ) {
write_defined("CRT_Z88_SAFEDATA", strtol(ptr+9, NULL, 0), 0);
} else if ( strncmp(ptr, "-startup=", 9) == 0 ) {
write_defined("startup", strtol(ptr+9, NULL, 0), 0);
} else if ( strncmp(ptr, "-farheap=", 9) == 0 ) {
write_defined("farheapsz", strtol(ptr+9, NULL, 0), 0);
} else if ( strncmp(ptr, "-expandz88", 9) == 0 ) {
write_defined("CRT_Z88_EXPANDED", 1, 0);
} else if ( strncmp(ptr, "-no-expandz88", 9) == 0 ) {
write_defined("CRT_Z88_EXPANDED", 0, 0);
} else {
printf("%s\n",buf);
}
if ( ol ) {
fputs("\n",stdout);
}
} else if ( sccz80_mode == 0 && strncmp(ptr, "#asm", 4) == 0 ) {
fputs("__asm\n",stdout);
} else if ( sccz80_mode == 0 && strncmp(ptr, "#endasm", 7) == 0 ) {
fputs("__endasm;\n",stdout);
} else if ( sccz80_mode == 1 && strncmp(ptr, "__asm", 5) == 0 && strncmp(ptr,"__asm__", 7) ) {
fputs("#asm\n",stdout);
} else if ( sccz80_mode == 1 && strncmp(ptr, "__endasm", 8) == 0 ) {
fputs("#endasm;\n",stdout);
} else {
int skip = 0;
if ( (skip=2, strncmp(ptr,"# ",2) == 0) || ( skip=5, strncmp(ptr,"#line",5) == 0) ) {
int num=0;
char tmp[FILENAME_MAX+1];
ptr = skip_ws(ptr + skip);
tmp[0]=0;
sscanf(ptr,"%d %s",&num,tmp);
if (num) lineno=--num;
if (strlen(tmp)) strcpy(filename,tmp);
}
fputs(buf,stdout);
}
}
}
|
the_stack_data/146903.c | /***********************************************************************************
* *
* NAME: main.c *
* *
* AUTHOR: Michael Brockus. *
* *
* CONTACT: <mailto:[email protected]> *
* *
* NOTICES: *
* *
* License: MIT *
* *
***********************************************************************************/
#include <stdio.h>
#include <stdlib.h>
/*
* This demonstrates a simple hello world program where the message
* 'Hello, c' is desplayed to the standerd console.
*
*/
int main(void)
{
puts("Hello, c.");
return EXIT_SUCCESS;
}// end of function main
|
the_stack_data/31386782.c | #include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
unsigned int sleep_time = 5;
printf("Hello from process hibernate...\n");
if (argc > 1) {
sleep_time = (unsigned) atoi(argv[1]);
}
sleep(sleep_time);
exit(EXIT_SUCCESS);
}
|
the_stack_data/27578.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2009-2019 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/>.
Please email any bugs, comments, and/or additions to this file to:
[email protected] */
/* This source is mainly to test what happens when a watchpoint is
removed while another watchpoint, inserted later is left active. */
int count = -1;
int ival1 = -1;
int ival2 = -1;
int ival3 = -1;
int ival4 = -1;
int
main ()
{
for (count = 0; count < 4; count++) {
ival1 = count; ival2 = count;
ival3 = count; ival4 = count;
}
ival1 = count; ival2 = count; /* Outside loop */
ival3 = count; ival4 = count;
return 0;
}
|
the_stack_data/287420.c | // kernel BUG at fs/buffer.c:LINE!
// https://syzkaller.appspot.com/bug?id=20c4a7b5a6f4c32158f2b8ea3dd461bc1e9e9a4e
// status:open
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <arpa/inet.h>
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <sched.h>
#include <linux/genetlink.h>
#include <linux/if_addr.h>
#include <linux/if_link.h>
#include <linux/in6.h>
#include <linux/loop.h>
#include <linux/neighbour.h>
#include <linux/net.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/veth.h>
unsigned long long procid;
static __thread int skip_segv;
static __thread jmp_buf segv_env;
static void segv_handler(int sig, siginfo_t* info, void* ctx)
{
uintptr_t addr = (uintptr_t)info->si_addr;
const uintptr_t prog_start = 1 << 20;
const uintptr_t prog_end = 100 << 20;
if (__atomic_load_n(&skip_segv, __ATOMIC_RELAXED) &&
(addr < prog_start || addr > prog_end)) {
_longjmp(segv_env, 1);
}
exit(sig);
}
static void install_segv_handler(void)
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_IGN;
syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8);
syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8);
memset(&sa, 0, sizeof(sa));
sa.sa_sigaction = segv_handler;
sa.sa_flags = SA_NODEFER | SA_SIGINFO;
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGBUS, &sa, NULL);
}
#define NONFAILING(...) \
{ \
__atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \
if (_setjmp(segv_env) == 0) { \
__VA_ARGS__; \
} \
__atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \
}
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 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 nlmsg {
char* pos;
int nesting;
struct nlattr* nested[8];
char buf[1024];
};
static struct nlmsg nlmsg;
static void netlink_init(struct nlmsg* nlmsg, int typ, int flags,
const void* data, int size)
{
memset(nlmsg, 0, sizeof(*nlmsg));
struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
hdr->nlmsg_type = typ;
hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
memcpy(hdr + 1, data, size);
nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size);
}
static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data,
int size)
{
struct nlattr* attr = (struct nlattr*)nlmsg->pos;
attr->nla_len = sizeof(*attr) + size;
attr->nla_type = typ;
memcpy(attr + 1, data, size);
nlmsg->pos += NLMSG_ALIGN(attr->nla_len);
}
static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type,
int* reply_len)
{
if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting)
exit(1);
struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
hdr->nlmsg_len = nlmsg->pos - nlmsg->buf;
struct sockaddr_nl addr;
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
unsigned n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0,
(struct sockaddr*)&addr, sizeof(addr));
if (n != hdr->nlmsg_len)
exit(1);
n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0);
if (hdr->nlmsg_type == NLMSG_DONE) {
*reply_len = 0;
return 0;
}
if (n < sizeof(struct nlmsghdr))
exit(1);
if (reply_len && hdr->nlmsg_type == reply_type) {
*reply_len = n;
return 0;
}
if (n < sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))
exit(1);
if (hdr->nlmsg_type != NLMSG_ERROR)
exit(1);
return -((struct nlmsgerr*)(hdr + 1))->error;
}
static int netlink_send(struct nlmsg* nlmsg, int sock)
{
return netlink_send_ext(nlmsg, sock, 0, NULL);
}
static int netlink_next_msg(struct nlmsg* nlmsg, unsigned int offset,
unsigned int total_len)
{
struct nlmsghdr* hdr = (struct nlmsghdr*)(nlmsg->buf + offset);
if (offset == total_len || offset + hdr->nlmsg_len > total_len)
return -1;
return hdr->nlmsg_len;
}
static void netlink_device_change(struct nlmsg* nlmsg, int sock,
const char* name, bool up, const char* master,
const void* mac, int macsize,
const char* new_name)
{
struct ifinfomsg hdr;
memset(&hdr, 0, sizeof(hdr));
if (up)
hdr.ifi_flags = hdr.ifi_change = IFF_UP;
hdr.ifi_index = if_nametoindex(name);
netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr));
if (new_name)
netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name));
if (master) {
int ifindex = if_nametoindex(master);
netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex));
}
if (macsize)
netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize);
int err = netlink_send(nlmsg, sock);
(void)err;
}
const int kInitNetNsFd = 239;
#define DEVLINK_FAMILY_NAME "devlink"
#define DEVLINK_CMD_PORT_GET 5
#define DEVLINK_CMD_RELOAD 37
#define DEVLINK_ATTR_BUS_NAME 1
#define DEVLINK_ATTR_DEV_NAME 2
#define DEVLINK_ATTR_NETDEV_NAME 7
#define DEVLINK_ATTR_NETNS_FD 138
static int netlink_devlink_id_get(struct nlmsg* nlmsg, int sock)
{
struct genlmsghdr genlhdr;
struct nlattr* attr;
int err, n;
uint16_t id = 0;
memset(&genlhdr, 0, sizeof(genlhdr));
genlhdr.cmd = CTRL_CMD_GETFAMILY;
netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr));
netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, DEVLINK_FAMILY_NAME,
strlen(DEVLINK_FAMILY_NAME) + 1);
err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n);
if (err) {
return -1;
}
attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN +
NLMSG_ALIGN(sizeof(genlhdr)));
for (; (char*)attr < nlmsg->buf + n;
attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) {
if (attr->nla_type == CTRL_ATTR_FAMILY_ID) {
id = *(uint16_t*)(attr + 1);
break;
}
}
if (!id) {
return -1;
}
recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); /* recv ack */
return id;
}
static void netlink_devlink_netns_move(const char* bus_name,
const char* dev_name, int netns_fd)
{
struct genlmsghdr genlhdr;
int sock;
int id, err;
sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
if (sock == -1)
exit(1);
id = netlink_devlink_id_get(&nlmsg, sock);
if (id == -1)
goto error;
memset(&genlhdr, 0, sizeof(genlhdr));
genlhdr.cmd = DEVLINK_CMD_RELOAD;
netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr));
netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1);
netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1);
netlink_attr(&nlmsg, DEVLINK_ATTR_NETNS_FD, &netns_fd, sizeof(netns_fd));
err = netlink_send(&nlmsg, sock);
if (err) {
}
error:
close(sock);
}
static struct nlmsg nlmsg2;
static void initialize_devlink_ports(const char* bus_name, const char* dev_name,
const char* netdev_prefix)
{
struct genlmsghdr genlhdr;
int len, total_len, id, err, offset;
uint16_t netdev_index;
int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
if (sock == -1)
exit(1);
int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (rtsock == -1)
exit(1);
id = netlink_devlink_id_get(&nlmsg, sock);
if (id == -1)
goto error;
memset(&genlhdr, 0, sizeof(genlhdr));
genlhdr.cmd = DEVLINK_CMD_PORT_GET;
netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr));
netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1);
netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1);
err = netlink_send_ext(&nlmsg, sock, id, &total_len);
if (err) {
goto error;
}
offset = 0;
netdev_index = 0;
while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) {
struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN +
NLMSG_ALIGN(sizeof(genlhdr)));
for (; (char*)attr < nlmsg.buf + offset + len;
attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) {
if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) {
char* port_name;
char netdev_name[IFNAMSIZ];
port_name = (char*)(attr + 1);
snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix,
netdev_index);
netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0,
netdev_name);
break;
}
}
offset += len;
netdev_index++;
}
error:
close(rtsock);
close(sock);
}
static void initialize_devlink_pci(void)
{
int netns = open("/proc/self/ns/net", O_RDONLY);
if (netns == -1)
exit(1);
int ret = setns(kInitNetNsFd, 0);
if (ret == -1)
exit(1);
netlink_devlink_netns_move("pci", "0000:00:10.0", netns);
ret = setns(netns, 0);
if (ret == -1)
exit(1);
close(netns);
initialize_devlink_ports("pci", "0000:00:10.0", "netpci");
}
static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
{
if (a0 == 0xc || a0 == 0xb) {
char buf[128];
sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1,
(uint8_t)a2);
return open(buf, O_RDWR, 0);
} else {
char buf[1024];
char* hash;
NONFAILING(strncpy(buf, (char*)a0, sizeof(buf) - 1));
buf[sizeof(buf) - 1] = 0;
while ((hash = strchr(buf, '#'))) {
*hash = '0' + (char)(a1 % 10);
a1 /= 10;
}
return open(buf, a2, 0);
}
}
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, long segments)
{
unsigned long i;
struct fs_image_segment* segs = (struct fs_image_segment*)segments;
if (nsegs > IMAGE_MAX_SEGMENTS)
nsegs = IMAGE_MAX_SEGMENTS;
for (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 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)
{
char loopname[64], fs[32], opts[256];
int loopfd, err = 0, res = -1;
unsigned long i;
NONFAILING(size = fs_image_segment_check(size, nsegs, segments));
int memfd = syscall(sys_memfd_create, "syz_mount_image", 0);
if (memfd == -1) {
err = errno;
goto error;
}
if (ftruncate(memfd, size)) {
err = errno;
goto error_close_memfd;
}
for (i = 0; i < nsegs; i++) {
struct fs_image_segment* segs = (struct fs_image_segment*)segments;
int res1 = 0;
NONFAILING(res1 =
pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset));
if (res1 < 0) {
}
}
snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
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;
}
}
mkdir((char*)dir, 0777);
memset(fs, 0, sizeof(fs));
NONFAILING(strncpy(fs, (char*)fsarg, sizeof(fs) - 1));
memset(opts, 0, sizeof(opts));
NONFAILING(strncpy(opts, (char*)optsarg, 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");
}
if (mount(loopname, (char*)dir, fs, flags, opts)) {
err = errno;
goto error_clear_loop;
}
res = 0;
error_clear_loop:
ioctl(loopfd, LOOP_CLR_FD, 0);
error_close_loop:
close(loopfd);
error_close_memfd:
close(memfd);
error:
errno = err;
return res;
}
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
static void remove_dir(const char* dir)
{
DIR* dp;
struct dirent* ep;
int iter = 0;
retry:
while (umount2(dir, MNT_DETACH) == 0) {
}
dp = opendir(dir);
if (dp == NULL) {
if (errno == EMFILE) {
exit(1);
}
exit(1);
}
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);
int i;
for (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);
int i;
for (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");
}
static void execute_one(void);
#define WAIT_FLAGS __WALL
static void loop(void)
{
int iter;
for (iter = 0;; 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);
}
}
uint64_t r[1] = {0xffffffffffffffff};
void execute_one(void)
{
intptr_t res = 0;
NONFAILING(memcpy((void*)0x20000540, "vfat\000", 5));
NONFAILING(memcpy((void*)0x200002c0, "./file0\000", 8));
NONFAILING(*(uint64_t*)0x20000580 = 0x20010000);
NONFAILING(memcpy((void*)0x20010000, "\xeb\x3c\x90\x6d\x6b\x66\x73\x2e\x66"
"\x61\x74\x00\x02\x04\x01\x00\x02\x00"
"\x02\x70\xff\xf8",
22));
NONFAILING(*(uint64_t*)0x20000588 = 0x16);
NONFAILING(*(uint64_t*)0x20000590 = 0);
syz_mount_image(0x20000540, 0x200002c0, 0x800000000e004, 1, 0x20000580, 0, 0);
NONFAILING(memcpy((void*)0x20000580, "/dev/loop#\000", 11));
res = syz_open_dev(0x20000580, 0, 0x6b102);
if (res != -1)
r[0] = res;
NONFAILING(*(uint64_t*)0x20000000 = 0);
NONFAILING(*(uint64_t*)0x20000008 = 0);
NONFAILING(*(uint64_t*)0x20000010 = 0);
NONFAILING(*(uint64_t*)0x20000018 = 4);
NONFAILING(*(uint64_t*)0x20000020 = 0);
NONFAILING(*(uint32_t*)0x20000028 = 0);
NONFAILING(*(uint32_t*)0x2000002c = 0xb);
NONFAILING(*(uint32_t*)0x20000030 = 0x11);
NONFAILING(*(uint32_t*)0x20000034 = 0);
NONFAILING(memcpy((void*)0x20000038,
"\x26\x98\xcb\x4d\xd1\x3d\x31\x08\xc0\x7e\x29\x07\x8f\x92"
"\xc6\x55\xbd\x7e\xa7\x0e\x26\xc0\x90\x19\x92\x93\x20\x01"
"\xc5\x91\x06\x3a\xae\x31\xcc\xbf\x95\x37\x8e\x62\x54\x59"
"\xe4\x33\xe2\xd4\x78\x48\x8f\xed\x1d\x7c\xab\x2a\xa8\x01"
"\x64\x99\x4f\xa7\x71\xdc\xf9\xfc",
64));
NONFAILING(memcpy((void*)0x20000078,
"\x31\x38\x50\xdc\xcf\xcc\x0e\xc4\x8c\x38\x22\xfe\xb1\xc9"
"\x09\xce\xc8\x08\x4e\xcc\xcb\x1f\x6e\xa6\x02\x32\x94\x2a"
"\x27\xfe\x33\x83\x20\xa2\xb9\xbe\xb4\xe2\x78\x48\x33\xea"
"\x09\x55\xb1\xe3\xd1\xdb\x61\x59\xf0\xa9\x08\xa2\x26\xdf"
"\xfb\xf1\xf1\xb4\x4c\x00\x49\x02",
64));
NONFAILING(memcpy((void*)0x200000b8, "\x48\xc0\x27\x6c\x58\xd5\xfc\x3b\x2e"
"\xb6\xef\xe2\x39\x02\x78\xc5\xe5\x7f"
"\xd9\x06\x6e\xde\x05\x7b\xcb\xf5\x9c"
"\x46\xd9\x55\x09\x8b",
32));
NONFAILING(*(uint64_t*)0x200000d8 = 0x3f);
NONFAILING(*(uint64_t*)0x200000e0 = 5);
syscall(__NR_ioctl, r[0], 0x4c04ul, 0x20000000ul);
}
int main(void)
{
syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0);
install_segv_handler();
for (procid = 0; procid < 6; procid++) {
if (fork() == 0) {
use_temporary_dir();
loop();
}
}
sleep(1000000);
return 0;
}
|
the_stack_data/248580207.c | #define _GNU_SOURCE
#include <stdarg.h>
#include <stdio.h>
int asprintf(char** s, const char* fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vasprintf(s, fmt, ap);
va_end(ap);
return ret;
}
|
the_stack_data/109407.c | // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -DEXPECT_NO_DIAGNOSTICS %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=conditional %s \
// RUN: -analyzer-config ignore-bison-generated-files=false
#ifdef EXPECT_NO_DIAGNOSTICS
// expected-no-diagnostics
#endif
/* A Bison parser, made by GNU Bison 1.875. */
void clang_analyzer_warnIfReached();
void foo() {
clang_analyzer_warnIfReached(); // conditional-warning {{REACHABLE}}
}
|
the_stack_data/86074470.c | #include <stdio.h>
#include <stdlib.h>
typedef unsigned long long ULL;
#define STACK(T) struct stack_##T##_node { \
T data; \
struct stack_##T##_node* next; \
}; \
struct stack_##T { \
struct stack_##T##_node* root; \
ULL size; \
}; \
void stack_##T##_node_init(struct stack_##T##_node* node, T data, struct stack_##T##_node* next) { \
node->data = data; \
node->next = next; \
} \
void stack_##T##_init(struct stack_##T* stk) { \
stk->size = 0; \
stk->root = NULL; \
} \
void stack_##T##_push(struct stack_##T* stk, T val) { \
if (stk->root) { \
struct stack_##T##_node* node = malloc(sizeof(struct stack_##T##_node)); \
stack_##T##_node_init(node, val, stk->root); \
stk->root = node; \
} \
else { \
stk->root = malloc(sizeof(struct stack_##T##_node)); \
stack_##T##_node_init(stk->root, val, NULL); \
} \
stk->size++; \
} \
void stack_##T##_pop(struct stack_##T* stk) { \
if (stk->size == 0) return; \
stk->size--; \
free(stk->root); \
stk->root = stk->root->next; \
} \
void stack_##T##_free(struct stack_##T* stk) { \
struct stack_##T##_node* node = stk->root; \
while (node) { \
struct stack_##T##_node* nxt = node->next; \
free(node); \
node = nxt; \
} \
} \
T stack_##T##_top(struct stack_##T* stk) { \
return stk->root->data; \
} \
T stack_##T##_empty(struct stack_##T* stk) { \
return stk->size == 0; \
}
STACK(int)
int main() {
struct stack_int stack;
stack_int_init(&stack);
stack_int_push(&stack, 0);
printf("%d\n", stack_int_top(&stack));
stack_int_push(&stack, 1);
printf("%d\n", stack_int_top(&stack));
stack_int_push(&stack, 2);
printf("%d\n", stack_int_top(&stack));
stack_int_pop(&stack);
printf("%d\n", stack_int_top(&stack));
stack_int_free(&stack);
return 0;
}
|
the_stack_data/47903.c | #include<stdio.h>
#include<stdlib.h>
int main (int argc, char *argv[]){
int i,id,idade[45],idsoma = 0 ,contadorid,contadoralt;
float alt,altura[45],altsoma = 0,mediaid,mediaalt;
for (i=0;i<=45;i++){
printf("Digite a idade do aluno");
scanf("%d",&id);
printf("Digite a Altura do aluno");
scanf("%f",&alt);
idade[i] = id;
altura[i] = alt;
}
for (i=0;i<=45;i++){
if(altura[i] < 1.70);
idsoma += idade[i];
contadoralt++;
if(idade[i] > 20);
altsoma += altura[45];
contadorid++;
}
mediaid = (idsoma/contadoralt);
mediaalt = (altsoma/contadorid);
printf("A media de altura dos alunos com menos de 1.70 e = %d \n",mediaid);
printf("A media de idade dos alunos com mais de 20 anos = %d \n",mediaalt);
}
|
the_stack_data/232956296.c | extern float __VERIFIER_nondet_float(void);
extern int __VERIFIER_nondet_int(void);
typedef enum {false, true} bool;
bool __VERIFIER_nondet_bool(void) {
return __VERIFIER_nondet_int() != 0;
}
int main()
{
int sm11_l, _x_sm11_l;
int sm11_loop_len, _x_sm11_loop_len;
bool sm11_state, _x_sm11_state;
int sm10_l, _x_sm10_l;
int sm10_loop_len, _x_sm10_loop_len;
bool sm10_state, _x_sm10_state;
int sm9_l, _x_sm9_l;
int sm9_loop_len, _x_sm9_loop_len;
bool sm9_state, _x_sm9_state;
int sm8_l, _x_sm8_l;
int sm8_loop_len, _x_sm8_loop_len;
bool sm8_state, _x_sm8_state;
int sm7_l, _x_sm7_l;
int sm7_loop_len, _x_sm7_loop_len;
bool sm7_state, _x_sm7_state;
int sm6_l, _x_sm6_l;
int sm6_loop_len, _x_sm6_loop_len;
bool sm6_state, _x_sm6_state;
int sm5_l, _x_sm5_l;
int sm5_loop_len, _x_sm5_loop_len;
bool sm5_state, _x_sm5_state;
int sm4_l, _x_sm4_l;
int sm4_loop_len, _x_sm4_loop_len;
bool sm4_state, _x_sm4_state;
int sm3_l, _x_sm3_l;
int sm3_loop_len, _x_sm3_loop_len;
bool sm3_state, _x_sm3_state;
int sm2_l, _x_sm2_l;
int sm2_loop_len, _x_sm2_loop_len;
bool sm2_state, _x_sm2_state;
int sm1_l, _x_sm1_l;
int sm1_loop_len, _x_sm1_loop_len;
bool sm1_state, _x_sm1_state;
int sm0_l, _x_sm0_l;
int sm0_loop_len, _x_sm0_loop_len;
bool sm0_state, _x_sm0_state;
int semaphore, _x_semaphore;
bool _J1058, _x__J1058;
bool _J1052, _x__J1052;
bool _J1045, _x__J1045;
bool _J1039, _x__J1039;
bool _J1032, _x__J1032;
bool _J1026, _x__J1026;
bool _J1019, _x__J1019;
bool _J1013, _x__J1013;
bool _J1006, _x__J1006;
bool _J1000, _x__J1000;
bool _J993, _x__J993;
bool _J987, _x__J987;
bool _J980, _x__J980;
bool _J974, _x__J974;
bool _J967, _x__J967;
bool _J961, _x__J961;
bool _J954, _x__J954;
bool _J948, _x__J948;
bool _J941, _x__J941;
bool _J935, _x__J935;
bool _J928, _x__J928;
bool _J922, _x__J922;
bool _J916, _x__J916;
bool _J910, _x__J910;
bool _J904, _x__J904;
bool _J898, _x__J898;
bool _EL_U_750, _x__EL_U_750;
int run, _x_run;
bool _EL_U_752, _x__EL_U_752;
bool _EL_U_754, _x__EL_U_754;
bool _EL_U_756, _x__EL_U_756;
bool _EL_U_758, _x__EL_U_758;
bool _EL_U_760, _x__EL_U_760;
bool _EL_U_762, _x__EL_U_762;
bool _EL_U_764, _x__EL_U_764;
bool _EL_U_766, _x__EL_U_766;
bool _EL_U_768, _x__EL_U_768;
bool _EL_U_770, _x__EL_U_770;
bool _EL_U_772, _x__EL_U_772;
bool _EL_U_774, _x__EL_U_774;
bool _EL_U_776, _x__EL_U_776;
bool _EL_U_778, _x__EL_U_778;
bool _EL_U_780, _x__EL_U_780;
bool _EL_U_782, _x__EL_U_782;
bool _EL_U_784, _x__EL_U_784;
bool _EL_U_786, _x__EL_U_786;
bool _EL_U_788, _x__EL_U_788;
bool _EL_U_790, _x__EL_U_790;
bool _EL_U_792, _x__EL_U_792;
bool _EL_U_794, _x__EL_U_794;
bool _EL_U_796, _x__EL_U_796;
bool _EL_U_810, _x__EL_U_810;
bool _EL_U_812, _x__EL_U_812;
int __steps_to_fair = __VERIFIER_nondet_int();
sm11_l = __VERIFIER_nondet_int();
sm11_loop_len = __VERIFIER_nondet_int();
sm11_state = __VERIFIER_nondet_bool();
sm10_l = __VERIFIER_nondet_int();
sm10_loop_len = __VERIFIER_nondet_int();
sm10_state = __VERIFIER_nondet_bool();
sm9_l = __VERIFIER_nondet_int();
sm9_loop_len = __VERIFIER_nondet_int();
sm9_state = __VERIFIER_nondet_bool();
sm8_l = __VERIFIER_nondet_int();
sm8_loop_len = __VERIFIER_nondet_int();
sm8_state = __VERIFIER_nondet_bool();
sm7_l = __VERIFIER_nondet_int();
sm7_loop_len = __VERIFIER_nondet_int();
sm7_state = __VERIFIER_nondet_bool();
sm6_l = __VERIFIER_nondet_int();
sm6_loop_len = __VERIFIER_nondet_int();
sm6_state = __VERIFIER_nondet_bool();
sm5_l = __VERIFIER_nondet_int();
sm5_loop_len = __VERIFIER_nondet_int();
sm5_state = __VERIFIER_nondet_bool();
sm4_l = __VERIFIER_nondet_int();
sm4_loop_len = __VERIFIER_nondet_int();
sm4_state = __VERIFIER_nondet_bool();
sm3_l = __VERIFIER_nondet_int();
sm3_loop_len = __VERIFIER_nondet_int();
sm3_state = __VERIFIER_nondet_bool();
sm2_l = __VERIFIER_nondet_int();
sm2_loop_len = __VERIFIER_nondet_int();
sm2_state = __VERIFIER_nondet_bool();
sm1_l = __VERIFIER_nondet_int();
sm1_loop_len = __VERIFIER_nondet_int();
sm1_state = __VERIFIER_nondet_bool();
sm0_l = __VERIFIER_nondet_int();
sm0_loop_len = __VERIFIER_nondet_int();
sm0_state = __VERIFIER_nondet_bool();
semaphore = __VERIFIER_nondet_int();
_J1058 = __VERIFIER_nondet_bool();
_J1052 = __VERIFIER_nondet_bool();
_J1045 = __VERIFIER_nondet_bool();
_J1039 = __VERIFIER_nondet_bool();
_J1032 = __VERIFIER_nondet_bool();
_J1026 = __VERIFIER_nondet_bool();
_J1019 = __VERIFIER_nondet_bool();
_J1013 = __VERIFIER_nondet_bool();
_J1006 = __VERIFIER_nondet_bool();
_J1000 = __VERIFIER_nondet_bool();
_J993 = __VERIFIER_nondet_bool();
_J987 = __VERIFIER_nondet_bool();
_J980 = __VERIFIER_nondet_bool();
_J974 = __VERIFIER_nondet_bool();
_J967 = __VERIFIER_nondet_bool();
_J961 = __VERIFIER_nondet_bool();
_J954 = __VERIFIER_nondet_bool();
_J948 = __VERIFIER_nondet_bool();
_J941 = __VERIFIER_nondet_bool();
_J935 = __VERIFIER_nondet_bool();
_J928 = __VERIFIER_nondet_bool();
_J922 = __VERIFIER_nondet_bool();
_J916 = __VERIFIER_nondet_bool();
_J910 = __VERIFIER_nondet_bool();
_J904 = __VERIFIER_nondet_bool();
_J898 = __VERIFIER_nondet_bool();
_EL_U_750 = __VERIFIER_nondet_bool();
run = __VERIFIER_nondet_int();
_EL_U_752 = __VERIFIER_nondet_bool();
_EL_U_754 = __VERIFIER_nondet_bool();
_EL_U_756 = __VERIFIER_nondet_bool();
_EL_U_758 = __VERIFIER_nondet_bool();
_EL_U_760 = __VERIFIER_nondet_bool();
_EL_U_762 = __VERIFIER_nondet_bool();
_EL_U_764 = __VERIFIER_nondet_bool();
_EL_U_766 = __VERIFIER_nondet_bool();
_EL_U_768 = __VERIFIER_nondet_bool();
_EL_U_770 = __VERIFIER_nondet_bool();
_EL_U_772 = __VERIFIER_nondet_bool();
_EL_U_774 = __VERIFIER_nondet_bool();
_EL_U_776 = __VERIFIER_nondet_bool();
_EL_U_778 = __VERIFIER_nondet_bool();
_EL_U_780 = __VERIFIER_nondet_bool();
_EL_U_782 = __VERIFIER_nondet_bool();
_EL_U_784 = __VERIFIER_nondet_bool();
_EL_U_786 = __VERIFIER_nondet_bool();
_EL_U_788 = __VERIFIER_nondet_bool();
_EL_U_790 = __VERIFIER_nondet_bool();
_EL_U_792 = __VERIFIER_nondet_bool();
_EL_U_794 = __VERIFIER_nondet_bool();
_EL_U_796 = __VERIFIER_nondet_bool();
_EL_U_810 = __VERIFIER_nondet_bool();
_EL_U_812 = __VERIFIER_nondet_bool();
bool __ok = ((((((((((((((semaphore == 0) && (sm0_state && (( !(sm0_loop_len <= 0)) && (sm0_l == 0)))) && (sm1_state && (( !(sm1_loop_len <= 0)) && (sm1_l == 0)))) && (sm2_state && (( !(sm2_loop_len <= 0)) && (sm2_l == 0)))) && (sm3_state && (( !(sm3_loop_len <= 0)) && (sm3_l == 0)))) && (sm4_state && (( !(sm4_loop_len <= 0)) && (sm4_l == 0)))) && (sm5_state && (( !(sm5_loop_len <= 0)) && (sm5_l == 0)))) && (sm6_state && (( !(sm6_loop_len <= 0)) && (sm6_l == 0)))) && (sm7_state && (( !(sm7_loop_len <= 0)) && (sm7_l == 0)))) && (sm8_state && (( !(sm8_loop_len <= 0)) && (sm8_l == 0)))) && (sm9_state && (( !(sm9_loop_len <= 0)) && (sm9_l == 0)))) && (sm10_state && (( !(sm10_loop_len <= 0)) && (sm10_l == 0)))) && (sm11_state && (( !(sm11_loop_len <= 0)) && (sm11_l == 0)))) && ((((((((((((((((((((((((((( !((_EL_U_812 || ( !((semaphore == 0) || _EL_U_810))) || ( !(((((((((((( !(_EL_U_796 || ( !((run == 0) || _EL_U_794)))) && ( !(_EL_U_792 || ( !((run == 1) || _EL_U_790))))) && ( !(_EL_U_788 || ( !((run == 2) || _EL_U_786))))) && ( !(_EL_U_784 || ( !((run == 3) || _EL_U_782))))) && ( !(_EL_U_780 || ( !((run == 4) || _EL_U_778))))) && ( !(_EL_U_776 || ( !((run == 5) || _EL_U_774))))) && ( !(_EL_U_772 || ( !((run == 6) || _EL_U_770))))) && ( !(_EL_U_768 || ( !((run == 7) || _EL_U_766))))) && ( !(_EL_U_764 || ( !((run == 8) || _EL_U_762))))) && ( !(_EL_U_760 || ( !((run == 9) || _EL_U_758))))) && ( !(_EL_U_756 || ( !((run == 10) || _EL_U_754))))) && ( !(_EL_U_752 || ( !((run == 11) || _EL_U_750)))))))) && ( !_J898)) && ( !_J904)) && ( !_J910)) && ( !_J916)) && ( !_J922)) && ( !_J928)) && ( !_J935)) && ( !_J941)) && ( !_J948)) && ( !_J954)) && ( !_J961)) && ( !_J967)) && ( !_J974)) && ( !_J980)) && ( !_J987)) && ( !_J993)) && ( !_J1000)) && ( !_J1006)) && ( !_J1013)) && ( !_J1019)) && ( !_J1026)) && ( !_J1032)) && ( !_J1039)) && ( !_J1045)) && ( !_J1052)) && ( !_J1058)));
while (__steps_to_fair >= 0 && __ok) {
if ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) {
__steps_to_fair = __VERIFIER_nondet_int();
} else {
__steps_to_fair--;
}
_x_sm11_l = __VERIFIER_nondet_int();
_x_sm11_loop_len = __VERIFIER_nondet_int();
_x_sm11_state = __VERIFIER_nondet_bool();
_x_sm10_l = __VERIFIER_nondet_int();
_x_sm10_loop_len = __VERIFIER_nondet_int();
_x_sm10_state = __VERIFIER_nondet_bool();
_x_sm9_l = __VERIFIER_nondet_int();
_x_sm9_loop_len = __VERIFIER_nondet_int();
_x_sm9_state = __VERIFIER_nondet_bool();
_x_sm8_l = __VERIFIER_nondet_int();
_x_sm8_loop_len = __VERIFIER_nondet_int();
_x_sm8_state = __VERIFIER_nondet_bool();
_x_sm7_l = __VERIFIER_nondet_int();
_x_sm7_loop_len = __VERIFIER_nondet_int();
_x_sm7_state = __VERIFIER_nondet_bool();
_x_sm6_l = __VERIFIER_nondet_int();
_x_sm6_loop_len = __VERIFIER_nondet_int();
_x_sm6_state = __VERIFIER_nondet_bool();
_x_sm5_l = __VERIFIER_nondet_int();
_x_sm5_loop_len = __VERIFIER_nondet_int();
_x_sm5_state = __VERIFIER_nondet_bool();
_x_sm4_l = __VERIFIER_nondet_int();
_x_sm4_loop_len = __VERIFIER_nondet_int();
_x_sm4_state = __VERIFIER_nondet_bool();
_x_sm3_l = __VERIFIER_nondet_int();
_x_sm3_loop_len = __VERIFIER_nondet_int();
_x_sm3_state = __VERIFIER_nondet_bool();
_x_sm2_l = __VERIFIER_nondet_int();
_x_sm2_loop_len = __VERIFIER_nondet_int();
_x_sm2_state = __VERIFIER_nondet_bool();
_x_sm1_l = __VERIFIER_nondet_int();
_x_sm1_loop_len = __VERIFIER_nondet_int();
_x_sm1_state = __VERIFIER_nondet_bool();
_x_sm0_l = __VERIFIER_nondet_int();
_x_sm0_loop_len = __VERIFIER_nondet_int();
_x_sm0_state = __VERIFIER_nondet_bool();
_x_semaphore = __VERIFIER_nondet_int();
_x__J1058 = __VERIFIER_nondet_bool();
_x__J1052 = __VERIFIER_nondet_bool();
_x__J1045 = __VERIFIER_nondet_bool();
_x__J1039 = __VERIFIER_nondet_bool();
_x__J1032 = __VERIFIER_nondet_bool();
_x__J1026 = __VERIFIER_nondet_bool();
_x__J1019 = __VERIFIER_nondet_bool();
_x__J1013 = __VERIFIER_nondet_bool();
_x__J1006 = __VERIFIER_nondet_bool();
_x__J1000 = __VERIFIER_nondet_bool();
_x__J993 = __VERIFIER_nondet_bool();
_x__J987 = __VERIFIER_nondet_bool();
_x__J980 = __VERIFIER_nondet_bool();
_x__J974 = __VERIFIER_nondet_bool();
_x__J967 = __VERIFIER_nondet_bool();
_x__J961 = __VERIFIER_nondet_bool();
_x__J954 = __VERIFIER_nondet_bool();
_x__J948 = __VERIFIER_nondet_bool();
_x__J941 = __VERIFIER_nondet_bool();
_x__J935 = __VERIFIER_nondet_bool();
_x__J928 = __VERIFIER_nondet_bool();
_x__J922 = __VERIFIER_nondet_bool();
_x__J916 = __VERIFIER_nondet_bool();
_x__J910 = __VERIFIER_nondet_bool();
_x__J904 = __VERIFIER_nondet_bool();
_x__J898 = __VERIFIER_nondet_bool();
_x__EL_U_750 = __VERIFIER_nondet_bool();
_x_run = __VERIFIER_nondet_int();
_x__EL_U_752 = __VERIFIER_nondet_bool();
_x__EL_U_754 = __VERIFIER_nondet_bool();
_x__EL_U_756 = __VERIFIER_nondet_bool();
_x__EL_U_758 = __VERIFIER_nondet_bool();
_x__EL_U_760 = __VERIFIER_nondet_bool();
_x__EL_U_762 = __VERIFIER_nondet_bool();
_x__EL_U_764 = __VERIFIER_nondet_bool();
_x__EL_U_766 = __VERIFIER_nondet_bool();
_x__EL_U_768 = __VERIFIER_nondet_bool();
_x__EL_U_770 = __VERIFIER_nondet_bool();
_x__EL_U_772 = __VERIFIER_nondet_bool();
_x__EL_U_774 = __VERIFIER_nondet_bool();
_x__EL_U_776 = __VERIFIER_nondet_bool();
_x__EL_U_778 = __VERIFIER_nondet_bool();
_x__EL_U_780 = __VERIFIER_nondet_bool();
_x__EL_U_782 = __VERIFIER_nondet_bool();
_x__EL_U_784 = __VERIFIER_nondet_bool();
_x__EL_U_786 = __VERIFIER_nondet_bool();
_x__EL_U_788 = __VERIFIER_nondet_bool();
_x__EL_U_790 = __VERIFIER_nondet_bool();
_x__EL_U_792 = __VERIFIER_nondet_bool();
_x__EL_U_794 = __VERIFIER_nondet_bool();
_x__EL_U_796 = __VERIFIER_nondet_bool();
_x__EL_U_810 = __VERIFIER_nondet_bool();
_x__EL_U_812 = __VERIFIER_nondet_bool();
__ok = (((((((((((((((_x_semaphore == 0) || ( !(semaphore == 12))) && ((((((((((sm0_l == 0) && ( !(_x_sm0_loop_len <= sm0_loop_len))) || ( !(_x_sm0_state && ( !sm0_state)))) && ((_x_sm0_state && ( !sm0_state)) || (sm0_loop_len == _x_sm0_loop_len))) && (( !sm0_state) || ((sm0_l + (-1 * _x_sm0_l)) == 1))) && (_x_sm0_state || ( !(sm0_state && ( !(sm0_loop_len <= sm0_l)))))) && (_x_sm0_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm0_state))))) && ((sm0_state == _x_sm0_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm0_state))) && ( !(run == 0)))))) && ((semaphore == _x_semaphore) || ( !((run == 0) && (sm0_state == _x_sm0_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm0_state) && ((run == 0) && sm0_state)))))) && ((((((((((sm1_l == 0) && ( !(_x_sm1_loop_len <= sm1_loop_len))) || ( !(_x_sm1_state && ( !sm1_state)))) && ((_x_sm1_state && ( !sm1_state)) || (sm1_loop_len == _x_sm1_loop_len))) && (( !sm1_state) || ((sm1_l + (-1 * _x_sm1_l)) == 1))) && (_x_sm1_state || ( !(sm1_state && ( !(sm1_loop_len <= sm1_l)))))) && (_x_sm1_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm1_state))))) && ((sm1_state == _x_sm1_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm1_state))) && ( !(run == 1)))))) && ((semaphore == _x_semaphore) || ( !((run == 1) && (sm1_state == _x_sm1_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm1_state) && ((run == 1) && sm1_state)))))) && ((((((((((sm2_l == 0) && ( !(_x_sm2_loop_len <= sm2_loop_len))) || ( !(_x_sm2_state && ( !sm2_state)))) && ((_x_sm2_state && ( !sm2_state)) || (sm2_loop_len == _x_sm2_loop_len))) && (( !sm2_state) || ((sm2_l + (-1 * _x_sm2_l)) == 1))) && (_x_sm2_state || ( !(sm2_state && ( !(sm2_loop_len <= sm2_l)))))) && (_x_sm2_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm2_state))))) && ((sm2_state == _x_sm2_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm2_state))) && ( !(run == 2)))))) && ((semaphore == _x_semaphore) || ( !((run == 2) && (sm2_state == _x_sm2_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm2_state) && ((run == 2) && sm2_state)))))) && ((((((((((sm3_l == 0) && ( !(_x_sm3_loop_len <= sm3_loop_len))) || ( !(_x_sm3_state && ( !sm3_state)))) && ((_x_sm3_state && ( !sm3_state)) || (sm3_loop_len == _x_sm3_loop_len))) && (( !sm3_state) || ((sm3_l + (-1 * _x_sm3_l)) == 1))) && (_x_sm3_state || ( !(sm3_state && ( !(sm3_loop_len <= sm3_l)))))) && (_x_sm3_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm3_state))))) && ((sm3_state == _x_sm3_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm3_state))) && ( !(run == 3)))))) && ((semaphore == _x_semaphore) || ( !((run == 3) && (sm3_state == _x_sm3_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm3_state) && ((run == 3) && sm3_state)))))) && ((((((((((sm4_l == 0) && ( !(_x_sm4_loop_len <= sm4_loop_len))) || ( !(_x_sm4_state && ( !sm4_state)))) && ((_x_sm4_state && ( !sm4_state)) || (sm4_loop_len == _x_sm4_loop_len))) && (( !sm4_state) || ((sm4_l + (-1 * _x_sm4_l)) == 1))) && (_x_sm4_state || ( !(sm4_state && ( !(sm4_loop_len <= sm4_l)))))) && (_x_sm4_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm4_state))))) && ((sm4_state == _x_sm4_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm4_state))) && ( !(run == 4)))))) && ((semaphore == _x_semaphore) || ( !((run == 4) && (sm4_state == _x_sm4_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm4_state) && ((run == 4) && sm4_state)))))) && ((((((((((sm5_l == 0) && ( !(_x_sm5_loop_len <= sm5_loop_len))) || ( !(_x_sm5_state && ( !sm5_state)))) && ((_x_sm5_state && ( !sm5_state)) || (sm5_loop_len == _x_sm5_loop_len))) && (( !sm5_state) || ((sm5_l + (-1 * _x_sm5_l)) == 1))) && (_x_sm5_state || ( !(sm5_state && ( !(sm5_loop_len <= sm5_l)))))) && (_x_sm5_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm5_state))))) && ((sm5_state == _x_sm5_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm5_state))) && ( !(run == 5)))))) && ((semaphore == _x_semaphore) || ( !((run == 5) && (sm5_state == _x_sm5_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm5_state) && ((run == 5) && sm5_state)))))) && ((((((((((sm6_l == 0) && ( !(_x_sm6_loop_len <= sm6_loop_len))) || ( !(_x_sm6_state && ( !sm6_state)))) && ((_x_sm6_state && ( !sm6_state)) || (sm6_loop_len == _x_sm6_loop_len))) && (( !sm6_state) || ((sm6_l + (-1 * _x_sm6_l)) == 1))) && (_x_sm6_state || ( !(sm6_state && ( !(sm6_loop_len <= sm6_l)))))) && (_x_sm6_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm6_state))))) && ((sm6_state == _x_sm6_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm6_state))) && ( !(run == 6)))))) && ((semaphore == _x_semaphore) || ( !((run == 6) && (sm6_state == _x_sm6_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm6_state) && ((run == 6) && sm6_state)))))) && ((((((((((sm7_l == 0) && ( !(_x_sm7_loop_len <= sm7_loop_len))) || ( !(_x_sm7_state && ( !sm7_state)))) && ((_x_sm7_state && ( !sm7_state)) || (sm7_loop_len == _x_sm7_loop_len))) && (( !sm7_state) || ((sm7_l + (-1 * _x_sm7_l)) == 1))) && (_x_sm7_state || ( !(sm7_state && ( !(sm7_loop_len <= sm7_l)))))) && (_x_sm7_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm7_state))))) && ((sm7_state == _x_sm7_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm7_state))) && ( !(run == 7)))))) && ((semaphore == _x_semaphore) || ( !((run == 7) && (sm7_state == _x_sm7_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm7_state) && ((run == 7) && sm7_state)))))) && ((((((((((sm8_l == 0) && ( !(_x_sm8_loop_len <= sm8_loop_len))) || ( !(_x_sm8_state && ( !sm8_state)))) && ((_x_sm8_state && ( !sm8_state)) || (sm8_loop_len == _x_sm8_loop_len))) && (( !sm8_state) || ((sm8_l + (-1 * _x_sm8_l)) == 1))) && (_x_sm8_state || ( !(sm8_state && ( !(sm8_loop_len <= sm8_l)))))) && (_x_sm8_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm8_state))))) && ((sm8_state == _x_sm8_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm8_state))) && ( !(run == 8)))))) && ((semaphore == _x_semaphore) || ( !((run == 8) && (sm8_state == _x_sm8_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm8_state) && ((run == 8) && sm8_state)))))) && ((((((((((sm9_l == 0) && ( !(_x_sm9_loop_len <= sm9_loop_len))) || ( !(_x_sm9_state && ( !sm9_state)))) && ((_x_sm9_state && ( !sm9_state)) || (sm9_loop_len == _x_sm9_loop_len))) && (( !sm9_state) || ((sm9_l + (-1 * _x_sm9_l)) == 1))) && (_x_sm9_state || ( !(sm9_state && ( !(sm9_loop_len <= sm9_l)))))) && (_x_sm9_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm9_state))))) && ((sm9_state == _x_sm9_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm9_state))) && ( !(run == 9)))))) && ((semaphore == _x_semaphore) || ( !((run == 9) && (sm9_state == _x_sm9_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm9_state) && ((run == 9) && sm9_state)))))) && ((((((((((sm10_l == 0) && ( !(_x_sm10_loop_len <= sm10_loop_len))) || ( !(_x_sm10_state && ( !sm10_state)))) && ((_x_sm10_state && ( !sm10_state)) || (sm10_loop_len == _x_sm10_loop_len))) && (( !sm10_state) || ((sm10_l + (-1 * _x_sm10_l)) == 1))) && (_x_sm10_state || ( !(sm10_state && ( !(sm10_loop_len <= sm10_l)))))) && (_x_sm10_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm10_state))))) && ((sm10_state == _x_sm10_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm10_state))) && ( !(run == 10)))))) && ((semaphore == _x_semaphore) || ( !((run == 10) && (sm10_state == _x_sm10_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm10_state) && ((run == 10) && sm10_state)))))) && ((((((((((sm11_l == 0) && ( !(_x_sm11_loop_len <= sm11_loop_len))) || ( !(_x_sm11_state && ( !sm11_state)))) && ((_x_sm11_state && ( !sm11_state)) || (sm11_loop_len == _x_sm11_loop_len))) && (( !sm11_state) || ((sm11_l + (-1 * _x_sm11_l)) == 1))) && (_x_sm11_state || ( !(sm11_state && ( !(sm11_loop_len <= sm11_l)))))) && (_x_sm11_state || ( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm11_state))))) && ((sm11_state == _x_sm11_state) || ( !(( !(((semaphore == 12) && (_x_semaphore == 0)) && ( !sm11_state))) && ( !(run == 11)))))) && ((semaphore == _x_semaphore) || ( !((run == 11) && (sm11_state == _x_sm11_state))))) && (((semaphore + (-1 * _x_semaphore)) == -1) || ( !(( !_x_sm11_state) && ((run == 11) && sm11_state)))))) && ((((((((((((((((((((((((((((_EL_U_752 == (_x__EL_U_752 || ( !(_x__EL_U_750 || (_x_run == 11))))) && ((_EL_U_750 == (_x__EL_U_750 || (_x_run == 11))) && ((_EL_U_756 == (_x__EL_U_756 || ( !(_x__EL_U_754 || (_x_run == 10))))) && ((_EL_U_754 == (_x__EL_U_754 || (_x_run == 10))) && ((_EL_U_760 == (_x__EL_U_760 || ( !(_x__EL_U_758 || (_x_run == 9))))) && ((_EL_U_758 == (_x__EL_U_758 || (_x_run == 9))) && ((_EL_U_764 == (_x__EL_U_764 || ( !(_x__EL_U_762 || (_x_run == 8))))) && ((_EL_U_762 == (_x__EL_U_762 || (_x_run == 8))) && ((_EL_U_768 == (_x__EL_U_768 || ( !(_x__EL_U_766 || (_x_run == 7))))) && ((_EL_U_766 == (_x__EL_U_766 || (_x_run == 7))) && ((_EL_U_772 == (_x__EL_U_772 || ( !(_x__EL_U_770 || (_x_run == 6))))) && ((_EL_U_770 == (_x__EL_U_770 || (_x_run == 6))) && ((_EL_U_776 == (_x__EL_U_776 || ( !(_x__EL_U_774 || (_x_run == 5))))) && ((_EL_U_774 == (_x__EL_U_774 || (_x_run == 5))) && ((_EL_U_780 == (_x__EL_U_780 || ( !(_x__EL_U_778 || (_x_run == 4))))) && ((_EL_U_778 == (_x__EL_U_778 || (_x_run == 4))) && ((_EL_U_784 == (_x__EL_U_784 || ( !(_x__EL_U_782 || (_x_run == 3))))) && ((_EL_U_782 == (_x__EL_U_782 || (_x_run == 3))) && ((_EL_U_788 == (_x__EL_U_788 || ( !(_x__EL_U_786 || (_x_run == 2))))) && ((_EL_U_786 == (_x__EL_U_786 || (_x_run == 2))) && ((_EL_U_792 == (_x__EL_U_792 || ( !(_x__EL_U_790 || (_x_run == 1))))) && ((_EL_U_790 == (_x__EL_U_790 || (_x_run == 1))) && ((_EL_U_796 == (_x__EL_U_796 || ( !(_x__EL_U_794 || (_x_run == 0))))) && ((_EL_U_794 == (_x__EL_U_794 || (_x_run == 0))) && ((_EL_U_810 == ((_x_semaphore == 0) || _x__EL_U_810)) && (_EL_U_812 == (_x__EL_U_812 || ( !((_x_semaphore == 0) || _x__EL_U_810))))))))))))))))))))))))))))) && (_x__J898 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((semaphore == 0) || ( !((semaphore == 0) || _EL_U_810))) || _J898))))) && (_x__J904 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((semaphore == 0) || _EL_U_810)) || ( !(_EL_U_812 || ( !((semaphore == 0) || _EL_U_810))))) || _J904))))) && (_x__J910 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 0) || ( !((run == 0) || _EL_U_794))) || _J910))))) && (_x__J916 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 0) || _EL_U_794)) || ( !(_EL_U_796 || ( !((run == 0) || _EL_U_794))))) || _J916))))) && (_x__J922 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 1) || ( !((run == 1) || _EL_U_790))) || _J922))))) && (_x__J928 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 1) || _EL_U_790)) || ( !(_EL_U_792 || ( !((run == 1) || _EL_U_790))))) || _J928))))) && (_x__J935 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 2) || ( !((run == 2) || _EL_U_786))) || _J935))))) && (_x__J941 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 2) || _EL_U_786)) || ( !(_EL_U_788 || ( !((run == 2) || _EL_U_786))))) || _J941))))) && (_x__J948 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 3) || ( !((run == 3) || _EL_U_782))) || _J948))))) && (_x__J954 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 3) || _EL_U_782)) || ( !(_EL_U_784 || ( !((run == 3) || _EL_U_782))))) || _J954))))) && (_x__J961 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 4) || ( !((run == 4) || _EL_U_778))) || _J961))))) && (_x__J967 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 4) || _EL_U_778)) || ( !(_EL_U_780 || ( !((run == 4) || _EL_U_778))))) || _J967))))) && (_x__J974 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 5) || ( !((run == 5) || _EL_U_774))) || _J974))))) && (_x__J980 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 5) || _EL_U_774)) || ( !(_EL_U_776 || ( !((run == 5) || _EL_U_774))))) || _J980))))) && (_x__J987 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 6) || ( !((run == 6) || _EL_U_770))) || _J987))))) && (_x__J993 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 6) || _EL_U_770)) || ( !(_EL_U_772 || ( !((run == 6) || _EL_U_770))))) || _J993))))) && (_x__J1000 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 7) || ( !((run == 7) || _EL_U_766))) || _J1000))))) && (_x__J1006 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 7) || _EL_U_766)) || ( !(_EL_U_768 || ( !((run == 7) || _EL_U_766))))) || _J1006))))) && (_x__J1013 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 8) || ( !((run == 8) || _EL_U_762))) || _J1013))))) && (_x__J1019 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 8) || _EL_U_762)) || ( !(_EL_U_764 || ( !((run == 8) || _EL_U_762))))) || _J1019))))) && (_x__J1026 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 9) || ( !((run == 9) || _EL_U_758))) || _J1026))))) && (_x__J1032 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 9) || _EL_U_758)) || ( !(_EL_U_760 || ( !((run == 9) || _EL_U_758))))) || _J1032))))) && (_x__J1039 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 10) || ( !((run == 10) || _EL_U_754))) || _J1039))))) && (_x__J1045 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 10) || _EL_U_754)) || ( !(_EL_U_756 || ( !((run == 10) || _EL_U_754))))) || _J1045))))) && (_x__J1052 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || (((run == 11) || ( !((run == 11) || _EL_U_750))) || _J1052))))) && (_x__J1058 == (( !(((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058)) && ((((((((((((((((((((((((((_J898 && _J904) && _J910) && _J916) && _J922) && _J928) && _J935) && _J941) && _J948) && _J954) && _J961) && _J967) && _J974) && _J980) && _J987) && _J993) && _J1000) && _J1006) && _J1013) && _J1019) && _J1026) && _J1032) && _J1039) && _J1045) && _J1052) && _J1058) || ((( !((run == 11) || _EL_U_750)) || ( !(_EL_U_752 || ( !((run == 11) || _EL_U_750))))) || _J1058))))));
sm11_l = _x_sm11_l;
sm11_loop_len = _x_sm11_loop_len;
sm11_state = _x_sm11_state;
sm10_l = _x_sm10_l;
sm10_loop_len = _x_sm10_loop_len;
sm10_state = _x_sm10_state;
sm9_l = _x_sm9_l;
sm9_loop_len = _x_sm9_loop_len;
sm9_state = _x_sm9_state;
sm8_l = _x_sm8_l;
sm8_loop_len = _x_sm8_loop_len;
sm8_state = _x_sm8_state;
sm7_l = _x_sm7_l;
sm7_loop_len = _x_sm7_loop_len;
sm7_state = _x_sm7_state;
sm6_l = _x_sm6_l;
sm6_loop_len = _x_sm6_loop_len;
sm6_state = _x_sm6_state;
sm5_l = _x_sm5_l;
sm5_loop_len = _x_sm5_loop_len;
sm5_state = _x_sm5_state;
sm4_l = _x_sm4_l;
sm4_loop_len = _x_sm4_loop_len;
sm4_state = _x_sm4_state;
sm3_l = _x_sm3_l;
sm3_loop_len = _x_sm3_loop_len;
sm3_state = _x_sm3_state;
sm2_l = _x_sm2_l;
sm2_loop_len = _x_sm2_loop_len;
sm2_state = _x_sm2_state;
sm1_l = _x_sm1_l;
sm1_loop_len = _x_sm1_loop_len;
sm1_state = _x_sm1_state;
sm0_l = _x_sm0_l;
sm0_loop_len = _x_sm0_loop_len;
sm0_state = _x_sm0_state;
semaphore = _x_semaphore;
_J1058 = _x__J1058;
_J1052 = _x__J1052;
_J1045 = _x__J1045;
_J1039 = _x__J1039;
_J1032 = _x__J1032;
_J1026 = _x__J1026;
_J1019 = _x__J1019;
_J1013 = _x__J1013;
_J1006 = _x__J1006;
_J1000 = _x__J1000;
_J993 = _x__J993;
_J987 = _x__J987;
_J980 = _x__J980;
_J974 = _x__J974;
_J967 = _x__J967;
_J961 = _x__J961;
_J954 = _x__J954;
_J948 = _x__J948;
_J941 = _x__J941;
_J935 = _x__J935;
_J928 = _x__J928;
_J922 = _x__J922;
_J916 = _x__J916;
_J910 = _x__J910;
_J904 = _x__J904;
_J898 = _x__J898;
_EL_U_750 = _x__EL_U_750;
run = _x_run;
_EL_U_752 = _x__EL_U_752;
_EL_U_754 = _x__EL_U_754;
_EL_U_756 = _x__EL_U_756;
_EL_U_758 = _x__EL_U_758;
_EL_U_760 = _x__EL_U_760;
_EL_U_762 = _x__EL_U_762;
_EL_U_764 = _x__EL_U_764;
_EL_U_766 = _x__EL_U_766;
_EL_U_768 = _x__EL_U_768;
_EL_U_770 = _x__EL_U_770;
_EL_U_772 = _x__EL_U_772;
_EL_U_774 = _x__EL_U_774;
_EL_U_776 = _x__EL_U_776;
_EL_U_778 = _x__EL_U_778;
_EL_U_780 = _x__EL_U_780;
_EL_U_782 = _x__EL_U_782;
_EL_U_784 = _x__EL_U_784;
_EL_U_786 = _x__EL_U_786;
_EL_U_788 = _x__EL_U_788;
_EL_U_790 = _x__EL_U_790;
_EL_U_792 = _x__EL_U_792;
_EL_U_794 = _x__EL_U_794;
_EL_U_796 = _x__EL_U_796;
_EL_U_810 = _x__EL_U_810;
_EL_U_812 = _x__EL_U_812;
}
}
|
the_stack_data/629273.c | #include <stdio.h>
int main()
{
int a,b,c,d,e,f,q,r;
scanf("%d%d", &a, &b);
if(a<0)
{
e=b;
if(b<0) e=b*-1;
for(r=0; r<e; r++)
{
f=a-r;
if(f%b==0) break;
}
q=f/b;
}
else
{
q=a/b;
r=a%b;
}
printf("%d %d\n",q,r);
return 0;
}
|
the_stack_data/92325692.c | /*
* @file integrate.c
* @authors SSGL
* @version 0.1
* @details
*
* DESCRIPTION: This code tames two integrals using Gaussian-Laguerre
* quadrature method. Abscissa and corresponding weights for different
* n-degree Laguerre polynomials were obtained using function in R-package
* "gaussguad": laguerre.quadrature.rules(n).
* Table with abscissa values and weights are read in into this code with
* max(n) = 1000. Code runs until max(n) is reached or until convergence
* is reached. Code takes in user-input values as alpha, x_min and
* outputs approximate result for 1st or 2nd integral. User can choose
* which integral to compute by entering -i value = {1,2}.
*
* Compile as:
* gcc -o integrate integrate.c -Wall -pedantic -lm
*
* Usage:
* ./integrate -a <alpha> -x <x_min> -i <which integal>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
/* Declare functions */
double f1(double t, double alpha, int x_min);
double f2(double t, double alpha, int x_min);
int main(int argc, char **argv)
{
double alpha;
int x_min; /* integer, since it is count number */
int which; /* which integral to tame */
/* Read user-input */
int opt;
while ((opt = getopt(argc, argv, "a:x:i:")) != -1) {
switch (opt) {
case 'a':
sscanf(optarg, "%lf", &alpha);
printf("alpha = %lf\n", alpha);
break;
case 'x':
sscanf(optarg, "%d", &x_min);
printf("x_min = %d\n", x_min);
break;
case 'i':
sscanf(optarg, "%d", &which);
printf("which integral = %d\n", which);
break;
case '?':
printf("FATAL: unknown option.\\n");
return (EXIT_FAILURE);
}
}
/* Check user-inputs */
if (alpha <= 0) {
printf("FATAL: alpha must be bigger than 0.\n");
return (EXIT_FAILURE);
}
if (x_min < 1) {
printf("FATAL: x_min must be bigger than or equal to 1.\n");
return (EXIT_FAILURE);
}
if (which != 1 && which != 2) {
printf("FATAL: Enter i is out of range.\n");
return (EXIT_FAILURE);
}
/* Read in abscissa and weights of Laguerre polynomials */
FILE *fp;
fp = fopen("laguerre.txt", "r");
if (fp == NULL) {
fprintf(stderr, "Couldn't open the file!\n");
return EXIT_FAILURE;
}
double laguerre[500500][2]; /* max(n) = 1000 */
for (int row = 0; row < 500500; row++) {
for (int col = 0; col < 2; col++) {
fscanf(fp, "%lf", &laguerre[row][col]);
}
}
fclose(fp);
//to check data is read correctly:
printf("%lf, %lf\n", laguerre[8][0], laguerre[13][1]);
/* Tame the integrals */
double epsilon = 0.000001;
double temp;
double res_prev;
double res_next = 580;
int count, start, stop;
if (which == 1) {
for (int n = 1; n < 1001; n++) {
temp = 0;
start = (n-1)*n / 2; /* starting row in Laguerre table */
stop = n*(n+1) / 2; /* stopping row in Laguerre table */
for (int i = start; i < stop; i++) {
temp += laguerre[i][1] * f1(laguerre[i][0], alpha, x_min);
}
res_prev = res_next;
res_next = temp;
printf("%lf\n", res_next);
if (fabs(res_prev - res_next) <= epsilon)
{
count = n;
break;
}
count = n;
}
} else {
for (int n = 1; n < 1001; n++) {
temp = 0;
start = (n-1)*n / 2; /* starting row in Laguerre table */
stop = n*(n+1) / 2; /* stopping row in Laguerre table */
for (int i = start; i < stop; i++) {
temp += laguerre[i][1] * f2(laguerre[i][0], alpha, x_min);
}
res_prev = res_next;
res_next = temp;
printf("%lf\n", res_next);
if (fabs(res_prev - res_next) <= epsilon)
{
count = n;
break;
}
count = n;
}
}
/* Print the result */
printf("Approximate value of the integral = %lf, is reached at %d\n", res_next, count);
return(EXIT_SUCCESS);
}
/***********************************************************************/
/********************** Supplementary functions ************************/
/***********************************************************************/
/* integrand in the first integral */
double f1(double t, double alpha, int x_min)
{
double res;
if (t < 0.1) {
res = 6 * pow(t, alpha-2) * exp((1-x_min)*t) / (t*t - 3*t + 6);
} else {
res = pow(t, alpha-1) * exp((1-x_min)*t) / (1-exp(-t));
}
return(res);
}
/* integrand in the second integral */
double f2(double t, double alpha, int x_min)
{
double res;
if (t < 0.1) {
res = 6 * pow(t, alpha-2) * exp((1-x_min)*t) * log(t) / (t*t - 3*t + 6);
} else {
res = pow(t, alpha-1) * exp((1-x_min)*t) * log(t) / (1-exp(-t));
}
return(res);
}
|
the_stack_data/126578.c | main(){puts("Hello World!");} |
the_stack_data/122015889.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_prime.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jdos-san <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/03 17:08:20 by jdos-san #+# #+# */
/* Updated: 2020/12/03 17:48:09 by jdos-san ### ########.fr */
/* */
/* ************************************************************************** */
int ft_is_prime(int nb)
{
int i;
i = 2;
while (nb % i != 0)
{
if (i > nb)
break ;
i++;
}
if (nb == i)
{
return (1);
}
return (0);
}
|
the_stack_data/1077212.c | // Liao, 3/13/2012
// test cases for various function objects
// named, expression, and aliased, pointer to function
void foo ();
void foo ()
{
}
void bar()
{
// pointer to a function
void (*func) (void) ;
func = foo;
foo();
(*func)();
}
|
the_stack_data/190769124.c | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <netinet/in.h>
#include <string.h>
#define DWORD unsigned int
DWORD recvUntilNull(char * buffer)
{
char *tmp = buffer;
int totalBytes = 0;
char tmpLocal[2] = {0};
do
{
if (read(0, tmpLocal, 1) != -1)
{
*tmp++ = tmpLocal[0];
totalBytes++;
}
else break;
} while (tmpLocal[0] != 0x00);
return totalBytes;
}
// expects the following:
// |"HELLO" | size | word |
// https://xkcd.com/1354/ ;)
DWORD doHeartbeat()
{
char recvBuf[300] = {0};
int heartbeatSize = 0;
signed int bytesRecv;
bytesRecv = read(0, recvBuf, 9);
// check our header
if(0 != strstr(recvBuf,"HELLO"))
{
// get the recv size
bytesRecv = read(0, (char *)&heartbeatSize, 4);
// get the word to echo - buffer overflow
recvUntilNull(recvBuf);
// echo the word back
write(1, recvBuf, heartbeatSize);
return 0;
}
return 1;
}
void serverFunc()
{
while(!doHeartbeat());
}
int main()
{
serverFunc();
return 0;
}
|
the_stack_data/148579227.c | int main() {
int ret = 0;
for (int i = 0; i < 3; i++) {
ret++;
}
return ret;
}
|
the_stack_data/100140578.c | #include <stdio.h>
int int_size(void)
{
int n, size = 0;
for(n = ~0; n != 0; n <<=1)
size += 1;
return size;
}
int number_size(unsigned int number)
{
unsigned int n;
int size = 0;
for(n = number; n != 0; n >>=1)
size += 1;
return size;
}
void bitpat_set(unsigned int *source, unsigned int value, int number, int bits)
{
int intSize, sourceSize, int_size(void), number_size(unsigned int);
unsigned int head, tail;
intSize = int_size();
sourceSize = number_size(*source);
head = *source >> (sourceSize - number);
tail = *source << (intSize - sourceSize + number + bits);
tail >>= (intSize - sourceSize + number + bits);
*source = (head << bits) | value;
*source = (*source << (sourceSize - number - bits)) | tail;
}
int main(void)
{
unsigned int w1 = 0xe1f4, w2 = 0x5;
void bitpat_set(unsigned int *, unsigned int, int, int);
bitpat_set(&w1, 0, 8, 1);
printf("%x\n", w1);
bitpat_set(&w2, 1, 1, 1);
printf("%x\n", w2);
return 0;
} |
the_stack_data/234517527.c | #include <stdio.h>
int main(){
int number;
printf("Enter a number:\n");
scanf("%d", &number);
int prime = 1, i ;
for(i=2; i < number/2; i++){
if(number%i==0){
prime = 0;
break;
}
}
if(prime){
printf("%d is Prime.", number);
}
else{
printf("%d is not prime", number);
}
}
|
the_stack_data/145452455.c | /*
datastart.c
A hack to get the extent of global data for the Macintosh.
by Patrick C. Beard.
*/
long __datastart;
|
the_stack_data/31185.c | //@ ltl invariant negative: (X (<> ([] (<> AP(x_3 - x_20 >= 1)))));
float x_0;
float x_1;
float x_2;
float x_3;
float x_4;
float x_5;
float x_6;
float x_7;
float x_8;
float x_9;
float x_10;
float x_11;
float x_12;
float x_13;
float x_14;
float x_15;
float x_16;
float x_17;
float x_18;
float x_19;
float x_20;
float x_21;
float x_22;
float x_23;
int main()
{
float x_0_;
float x_1_;
float x_2_;
float x_3_;
float x_4_;
float x_5_;
float x_6_;
float x_7_;
float x_8_;
float x_9_;
float x_10_;
float x_11_;
float x_12_;
float x_13_;
float x_14_;
float x_15_;
float x_16_;
float x_17_;
float x_18_;
float x_19_;
float x_20_;
float x_21_;
float x_22_;
float x_23_;
while(1) {
x_0_ = ((((9.0 + x_3) > ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))? (9.0 + x_3) : ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))) > ((15.0 + x_9) > ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12))? (15.0 + x_9) : ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12)))? ((9.0 + x_3) > ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))? (9.0 + x_3) : ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))) : ((15.0 + x_9) > ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12))? (15.0 + x_9) : ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12)))) > (((9.0 + x_14) > ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))? (9.0 + x_14) : ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))) > ((6.0 + x_18) > ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22))? (6.0 + x_18) : ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22)))? ((9.0 + x_14) > ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))? (9.0 + x_14) : ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))) : ((6.0 + x_18) > ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22))? (6.0 + x_18) : ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22))))? (((9.0 + x_3) > ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))? (9.0 + x_3) : ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))) > ((15.0 + x_9) > ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12))? (15.0 + x_9) : ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12)))? ((9.0 + x_3) > ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))? (9.0 + x_3) : ((5.0 + x_4) > (16.0 + x_6)? (5.0 + x_4) : (16.0 + x_6))) : ((15.0 + x_9) > ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12))? (15.0 + x_9) : ((8.0 + x_10) > (10.0 + x_12)? (8.0 + x_10) : (10.0 + x_12)))) : (((9.0 + x_14) > ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))? (9.0 + x_14) : ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))) > ((6.0 + x_18) > ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22))? (6.0 + x_18) : ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22)))? ((9.0 + x_14) > ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))? (9.0 + x_14) : ((18.0 + x_15) > (4.0 + x_17)? (18.0 + x_15) : (4.0 + x_17))) : ((6.0 + x_18) > ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22))? (6.0 + x_18) : ((4.0 + x_21) > (18.0 + x_22)? (4.0 + x_21) : (18.0 + x_22)))));
x_1_ = ((((7.0 + x_1) > ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))? (7.0 + x_1) : ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))) > ((12.0 + x_6) > ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11))? (12.0 + x_6) : ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11)))? ((7.0 + x_1) > ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))? (7.0 + x_1) : ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))) : ((12.0 + x_6) > ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11))? (12.0 + x_6) : ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11)))) > (((18.0 + x_12) > ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))? (18.0 + x_12) : ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))) > ((8.0 + x_16) > ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22))? (8.0 + x_16) : ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22)))? ((18.0 + x_12) > ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))? (18.0 + x_12) : ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))) : ((8.0 + x_16) > ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22))? (8.0 + x_16) : ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22))))? (((7.0 + x_1) > ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))? (7.0 + x_1) : ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))) > ((12.0 + x_6) > ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11))? (12.0 + x_6) : ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11)))? ((7.0 + x_1) > ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))? (7.0 + x_1) : ((19.0 + x_2) > (11.0 + x_3)? (19.0 + x_2) : (11.0 + x_3))) : ((12.0 + x_6) > ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11))? (12.0 + x_6) : ((14.0 + x_8) > (11.0 + x_11)? (14.0 + x_8) : (11.0 + x_11)))) : (((18.0 + x_12) > ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))? (18.0 + x_12) : ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))) > ((8.0 + x_16) > ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22))? (8.0 + x_16) : ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22)))? ((18.0 + x_12) > ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))? (18.0 + x_12) : ((17.0 + x_14) > (10.0 + x_15)? (17.0 + x_14) : (10.0 + x_15))) : ((8.0 + x_16) > ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22))? (8.0 + x_16) : ((11.0 + x_18) > (9.0 + x_22)? (11.0 + x_18) : (9.0 + x_22)))));
x_2_ = ((((18.0 + x_0) > ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))? (18.0 + x_0) : ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))) > ((13.0 + x_4) > ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7))? (13.0 + x_4) : ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7)))? ((18.0 + x_0) > ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))? (18.0 + x_0) : ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))) : ((13.0 + x_4) > ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7))? (13.0 + x_4) : ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7)))) > (((18.0 + x_8) > ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))? (18.0 + x_8) : ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))) > ((18.0 + x_15) > ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21))? (18.0 + x_15) : ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21)))? ((18.0 + x_8) > ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))? (18.0 + x_8) : ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))) : ((18.0 + x_15) > ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21))? (18.0 + x_15) : ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21))))? (((18.0 + x_0) > ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))? (18.0 + x_0) : ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))) > ((13.0 + x_4) > ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7))? (13.0 + x_4) : ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7)))? ((18.0 + x_0) > ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))? (18.0 + x_0) : ((7.0 + x_2) > (1.0 + x_3)? (7.0 + x_2) : (1.0 + x_3))) : ((13.0 + x_4) > ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7))? (13.0 + x_4) : ((9.0 + x_6) > (8.0 + x_7)? (9.0 + x_6) : (8.0 + x_7)))) : (((18.0 + x_8) > ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))? (18.0 + x_8) : ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))) > ((18.0 + x_15) > ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21))? (18.0 + x_15) : ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21)))? ((18.0 + x_8) > ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))? (18.0 + x_8) : ((7.0 + x_10) > (2.0 + x_13)? (7.0 + x_10) : (2.0 + x_13))) : ((18.0 + x_15) > ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21))? (18.0 + x_15) : ((14.0 + x_18) > (8.0 + x_21)? (14.0 + x_18) : (8.0 + x_21)))));
x_3_ = ((((4.0 + x_0) > ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))? (4.0 + x_0) : ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))) > ((7.0 + x_5) > ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9))? (7.0 + x_5) : ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9)))? ((4.0 + x_0) > ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))? (4.0 + x_0) : ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))) : ((7.0 + x_5) > ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9))? (7.0 + x_5) : ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9)))) > (((8.0 + x_11) > ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))? (8.0 + x_11) : ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))) > ((7.0 + x_18) > ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22))? (7.0 + x_18) : ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22)))? ((8.0 + x_11) > ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))? (8.0 + x_11) : ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))) : ((7.0 + x_18) > ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22))? (7.0 + x_18) : ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22))))? (((4.0 + x_0) > ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))? (4.0 + x_0) : ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))) > ((7.0 + x_5) > ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9))? (7.0 + x_5) : ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9)))? ((4.0 + x_0) > ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))? (4.0 + x_0) : ((2.0 + x_2) > (9.0 + x_3)? (2.0 + x_2) : (9.0 + x_3))) : ((7.0 + x_5) > ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9))? (7.0 + x_5) : ((5.0 + x_6) > (10.0 + x_9)? (5.0 + x_6) : (10.0 + x_9)))) : (((8.0 + x_11) > ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))? (8.0 + x_11) : ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))) > ((7.0 + x_18) > ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22))? (7.0 + x_18) : ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22)))? ((8.0 + x_11) > ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))? (8.0 + x_11) : ((14.0 + x_13) > (13.0 + x_15)? (14.0 + x_13) : (13.0 + x_15))) : ((7.0 + x_18) > ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22))? (7.0 + x_18) : ((2.0 + x_20) > (8.0 + x_22)? (2.0 + x_20) : (8.0 + x_22)))));
x_4_ = ((((20.0 + x_1) > ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))? (20.0 + x_1) : ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))) > ((3.0 + x_5) > ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11))? (3.0 + x_5) : ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11)))? ((20.0 + x_1) > ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))? (20.0 + x_1) : ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))) : ((3.0 + x_5) > ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11))? (3.0 + x_5) : ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11)))) > (((16.0 + x_14) > ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))? (16.0 + x_14) : ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))) > ((6.0 + x_18) > ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22))? (6.0 + x_18) : ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22)))? ((16.0 + x_14) > ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))? (16.0 + x_14) : ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))) : ((6.0 + x_18) > ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22))? (6.0 + x_18) : ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22))))? (((20.0 + x_1) > ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))? (20.0 + x_1) : ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))) > ((3.0 + x_5) > ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11))? (3.0 + x_5) : ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11)))? ((20.0 + x_1) > ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))? (20.0 + x_1) : ((4.0 + x_3) > (12.0 + x_4)? (4.0 + x_3) : (12.0 + x_4))) : ((3.0 + x_5) > ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11))? (3.0 + x_5) : ((16.0 + x_6) > (6.0 + x_11)? (16.0 + x_6) : (6.0 + x_11)))) : (((16.0 + x_14) > ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))? (16.0 + x_14) : ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))) > ((6.0 + x_18) > ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22))? (6.0 + x_18) : ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22)))? ((16.0 + x_14) > ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))? (16.0 + x_14) : ((9.0 + x_15) > (1.0 + x_16)? (9.0 + x_15) : (1.0 + x_16))) : ((6.0 + x_18) > ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22))? (6.0 + x_18) : ((3.0 + x_21) > (12.0 + x_22)? (3.0 + x_21) : (12.0 + x_22)))));
x_5_ = ((((10.0 + x_1) > ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))? (10.0 + x_1) : ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))) > ((9.0 + x_6) > ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9))? (9.0 + x_6) : ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9)))? ((10.0 + x_1) > ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))? (10.0 + x_1) : ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))) : ((9.0 + x_6) > ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9))? (9.0 + x_6) : ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9)))) > (((10.0 + x_10) > ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))? (10.0 + x_10) : ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))) > ((2.0 + x_17) > ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21))? (2.0 + x_17) : ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21)))? ((10.0 + x_10) > ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))? (10.0 + x_10) : ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))) : ((2.0 + x_17) > ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21))? (2.0 + x_17) : ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21))))? (((10.0 + x_1) > ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))? (10.0 + x_1) : ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))) > ((9.0 + x_6) > ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9))? (9.0 + x_6) : ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9)))? ((10.0 + x_1) > ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))? (10.0 + x_1) : ((7.0 + x_3) > (14.0 + x_5)? (7.0 + x_3) : (14.0 + x_5))) : ((9.0 + x_6) > ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9))? (9.0 + x_6) : ((11.0 + x_7) > (18.0 + x_9)? (11.0 + x_7) : (18.0 + x_9)))) : (((10.0 + x_10) > ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))? (10.0 + x_10) : ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))) > ((2.0 + x_17) > ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21))? (2.0 + x_17) : ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21)))? ((10.0 + x_10) > ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))? (10.0 + x_10) : ((18.0 + x_11) > (20.0 + x_15)? (18.0 + x_11) : (20.0 + x_15))) : ((2.0 + x_17) > ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21))? (2.0 + x_17) : ((17.0 + x_18) > (8.0 + x_21)? (17.0 + x_18) : (8.0 + x_21)))));
x_6_ = ((((18.0 + x_0) > ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))? (18.0 + x_0) : ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))) > ((5.0 + x_5) > ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9))? (5.0 + x_5) : ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9)))? ((18.0 + x_0) > ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))? (18.0 + x_0) : ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))) : ((5.0 + x_5) > ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9))? (5.0 + x_5) : ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9)))) > (((17.0 + x_11) > ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))? (17.0 + x_11) : ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))) > ((16.0 + x_19) > ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22))? (16.0 + x_19) : ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22)))? ((17.0 + x_11) > ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))? (17.0 + x_11) : ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))) : ((16.0 + x_19) > ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22))? (16.0 + x_19) : ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22))))? (((18.0 + x_0) > ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))? (18.0 + x_0) : ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))) > ((5.0 + x_5) > ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9))? (5.0 + x_5) : ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9)))? ((18.0 + x_0) > ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))? (18.0 + x_0) : ((14.0 + x_3) > (2.0 + x_4)? (14.0 + x_3) : (2.0 + x_4))) : ((5.0 + x_5) > ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9))? (5.0 + x_5) : ((8.0 + x_6) > (7.0 + x_9)? (8.0 + x_6) : (7.0 + x_9)))) : (((17.0 + x_11) > ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))? (17.0 + x_11) : ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))) > ((16.0 + x_19) > ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22))? (16.0 + x_19) : ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22)))? ((17.0 + x_11) > ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))? (17.0 + x_11) : ((5.0 + x_15) > (6.0 + x_16)? (5.0 + x_15) : (6.0 + x_16))) : ((16.0 + x_19) > ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22))? (16.0 + x_19) : ((20.0 + x_20) > (10.0 + x_22)? (20.0 + x_20) : (10.0 + x_22)))));
x_7_ = ((((3.0 + x_2) > ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))? (3.0 + x_2) : ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))) > ((9.0 + x_5) > ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10))? (9.0 + x_5) : ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10)))? ((3.0 + x_2) > ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))? (3.0 + x_2) : ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))) : ((9.0 + x_5) > ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10))? (9.0 + x_5) : ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10)))) > (((4.0 + x_12) > ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))? (4.0 + x_12) : ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))) > ((14.0 + x_20) > ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22))? (14.0 + x_20) : ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22)))? ((4.0 + x_12) > ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))? (4.0 + x_12) : ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))) : ((14.0 + x_20) > ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22))? (14.0 + x_20) : ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22))))? (((3.0 + x_2) > ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))? (3.0 + x_2) : ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))) > ((9.0 + x_5) > ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10))? (9.0 + x_5) : ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10)))? ((3.0 + x_2) > ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))? (3.0 + x_2) : ((18.0 + x_3) > (10.0 + x_4)? (18.0 + x_3) : (10.0 + x_4))) : ((9.0 + x_5) > ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10))? (9.0 + x_5) : ((20.0 + x_7) > (3.0 + x_10)? (20.0 + x_7) : (3.0 + x_10)))) : (((4.0 + x_12) > ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))? (4.0 + x_12) : ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))) > ((14.0 + x_20) > ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22))? (14.0 + x_20) : ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22)))? ((4.0 + x_12) > ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))? (4.0 + x_12) : ((16.0 + x_14) > (20.0 + x_18)? (16.0 + x_14) : (20.0 + x_18))) : ((14.0 + x_20) > ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22))? (14.0 + x_20) : ((18.0 + x_21) > (6.0 + x_22)? (18.0 + x_21) : (6.0 + x_22)))));
x_8_ = ((((10.0 + x_1) > ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))? (10.0 + x_1) : ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))) > ((6.0 + x_4) > ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11))? (6.0 + x_4) : ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11)))? ((10.0 + x_1) > ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))? (10.0 + x_1) : ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))) : ((6.0 + x_4) > ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11))? (6.0 + x_4) : ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11)))) > (((14.0 + x_12) > ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))? (14.0 + x_12) : ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))) > ((5.0 + x_18) > ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23))? (5.0 + x_18) : ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23)))? ((14.0 + x_12) > ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))? (14.0 + x_12) : ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))) : ((5.0 + x_18) > ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23))? (5.0 + x_18) : ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23))))? (((10.0 + x_1) > ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))? (10.0 + x_1) : ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))) > ((6.0 + x_4) > ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11))? (6.0 + x_4) : ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11)))? ((10.0 + x_1) > ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))? (10.0 + x_1) : ((2.0 + x_2) > (14.0 + x_3)? (2.0 + x_2) : (14.0 + x_3))) : ((6.0 + x_4) > ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11))? (6.0 + x_4) : ((8.0 + x_10) > (3.0 + x_11)? (8.0 + x_10) : (3.0 + x_11)))) : (((14.0 + x_12) > ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))? (14.0 + x_12) : ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))) > ((5.0 + x_18) > ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23))? (5.0 + x_18) : ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23)))? ((14.0 + x_12) > ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))? (14.0 + x_12) : ((4.0 + x_14) > (15.0 + x_16)? (4.0 + x_14) : (15.0 + x_16))) : ((5.0 + x_18) > ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23))? (5.0 + x_18) : ((3.0 + x_20) > (8.0 + x_23)? (3.0 + x_20) : (8.0 + x_23)))));
x_9_ = ((((7.0 + x_0) > ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))? (7.0 + x_0) : ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))) > ((1.0 + x_5) > ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11))? (1.0 + x_5) : ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11)))? ((7.0 + x_0) > ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))? (7.0 + x_0) : ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))) : ((1.0 + x_5) > ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11))? (1.0 + x_5) : ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11)))) > (((10.0 + x_13) > ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))? (10.0 + x_13) : ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))) > ((14.0 + x_19) > ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21))? (14.0 + x_19) : ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21)))? ((10.0 + x_13) > ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))? (10.0 + x_13) : ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))) : ((14.0 + x_19) > ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21))? (14.0 + x_19) : ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21))))? (((7.0 + x_0) > ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))? (7.0 + x_0) : ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))) > ((1.0 + x_5) > ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11))? (1.0 + x_5) : ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11)))? ((7.0 + x_0) > ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))? (7.0 + x_0) : ((15.0 + x_3) > (2.0 + x_4)? (15.0 + x_3) : (2.0 + x_4))) : ((1.0 + x_5) > ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11))? (1.0 + x_5) : ((19.0 + x_10) > (12.0 + x_11)? (19.0 + x_10) : (12.0 + x_11)))) : (((10.0 + x_13) > ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))? (10.0 + x_13) : ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))) > ((14.0 + x_19) > ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21))? (14.0 + x_19) : ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21)))? ((10.0 + x_13) > ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))? (10.0 + x_13) : ((14.0 + x_15) > (16.0 + x_18)? (14.0 + x_15) : (16.0 + x_18))) : ((14.0 + x_19) > ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21))? (14.0 + x_19) : ((8.0 + x_20) > (12.0 + x_21)? (8.0 + x_20) : (12.0 + x_21)))));
x_10_ = ((((15.0 + x_1) > ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))? (15.0 + x_1) : ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))) > ((20.0 + x_4) > ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8))? (20.0 + x_4) : ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8)))? ((15.0 + x_1) > ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))? (15.0 + x_1) : ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))) : ((20.0 + x_4) > ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8))? (20.0 + x_4) : ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8)))) > (((5.0 + x_9) > ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))? (5.0 + x_9) : ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))) > ((1.0 + x_12) > ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15))? (1.0 + x_12) : ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15)))? ((5.0 + x_9) > ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))? (5.0 + x_9) : ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))) : ((1.0 + x_12) > ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15))? (1.0 + x_12) : ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15))))? (((15.0 + x_1) > ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))? (15.0 + x_1) : ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))) > ((20.0 + x_4) > ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8))? (20.0 + x_4) : ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8)))? ((15.0 + x_1) > ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))? (15.0 + x_1) : ((14.0 + x_2) > (4.0 + x_3)? (14.0 + x_2) : (4.0 + x_3))) : ((20.0 + x_4) > ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8))? (20.0 + x_4) : ((3.0 + x_5) > (18.0 + x_8)? (3.0 + x_5) : (18.0 + x_8)))) : (((5.0 + x_9) > ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))? (5.0 + x_9) : ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))) > ((1.0 + x_12) > ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15))? (1.0 + x_12) : ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15)))? ((5.0 + x_9) > ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))? (5.0 + x_9) : ((20.0 + x_10) > (10.0 + x_11)? (20.0 + x_10) : (10.0 + x_11))) : ((1.0 + x_12) > ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15))? (1.0 + x_12) : ((15.0 + x_14) > (20.0 + x_15)? (15.0 + x_14) : (20.0 + x_15)))));
x_11_ = ((((11.0 + x_0) > ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))? (11.0 + x_0) : ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))) > ((10.0 + x_7) > ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10))? (10.0 + x_7) : ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10)))? ((11.0 + x_0) > ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))? (11.0 + x_0) : ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))) : ((10.0 + x_7) > ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10))? (10.0 + x_7) : ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10)))) > (((6.0 + x_11) > ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))? (6.0 + x_11) : ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))) > ((20.0 + x_19) > ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22))? (20.0 + x_19) : ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22)))? ((6.0 + x_11) > ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))? (6.0 + x_11) : ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))) : ((20.0 + x_19) > ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22))? (20.0 + x_19) : ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22))))? (((11.0 + x_0) > ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))? (11.0 + x_0) : ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))) > ((10.0 + x_7) > ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10))? (10.0 + x_7) : ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10)))? ((11.0 + x_0) > ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))? (11.0 + x_0) : ((3.0 + x_4) > (16.0 + x_5)? (3.0 + x_4) : (16.0 + x_5))) : ((10.0 + x_7) > ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10))? (10.0 + x_7) : ((20.0 + x_9) > (13.0 + x_10)? (20.0 + x_9) : (13.0 + x_10)))) : (((6.0 + x_11) > ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))? (6.0 + x_11) : ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))) > ((20.0 + x_19) > ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22))? (20.0 + x_19) : ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22)))? ((6.0 + x_11) > ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))? (6.0 + x_11) : ((10.0 + x_13) > (8.0 + x_15)? (10.0 + x_13) : (8.0 + x_15))) : ((20.0 + x_19) > ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22))? (20.0 + x_19) : ((19.0 + x_21) > (14.0 + x_22)? (19.0 + x_21) : (14.0 + x_22)))));
x_12_ = ((((16.0 + x_0) > ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))? (16.0 + x_0) : ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))) > ((4.0 + x_7) > ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9))? (4.0 + x_7) : ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9)))? ((16.0 + x_0) > ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))? (16.0 + x_0) : ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))) : ((4.0 + x_7) > ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9))? (4.0 + x_7) : ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9)))) > (((4.0 + x_12) > ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))? (4.0 + x_12) : ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))) > ((12.0 + x_20) > ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23))? (12.0 + x_20) : ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23)))? ((4.0 + x_12) > ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))? (4.0 + x_12) : ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))) : ((12.0 + x_20) > ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23))? (12.0 + x_20) : ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23))))? (((16.0 + x_0) > ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))? (16.0 + x_0) : ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))) > ((4.0 + x_7) > ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9))? (4.0 + x_7) : ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9)))? ((16.0 + x_0) > ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))? (16.0 + x_0) : ((18.0 + x_4) > (13.0 + x_6)? (18.0 + x_4) : (13.0 + x_6))) : ((4.0 + x_7) > ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9))? (4.0 + x_7) : ((10.0 + x_8) > (8.0 + x_9)? (10.0 + x_8) : (8.0 + x_9)))) : (((4.0 + x_12) > ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))? (4.0 + x_12) : ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))) > ((12.0 + x_20) > ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23))? (12.0 + x_20) : ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23)))? ((4.0 + x_12) > ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))? (4.0 + x_12) : ((9.0 + x_15) > (1.0 + x_19)? (9.0 + x_15) : (1.0 + x_19))) : ((12.0 + x_20) > ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23))? (12.0 + x_20) : ((4.0 + x_22) > (19.0 + x_23)? (4.0 + x_22) : (19.0 + x_23)))));
x_13_ = ((((6.0 + x_2) > ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))? (6.0 + x_2) : ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))) > ((13.0 + x_7) > ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9))? (13.0 + x_7) : ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9)))? ((6.0 + x_2) > ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))? (6.0 + x_2) : ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))) : ((13.0 + x_7) > ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9))? (13.0 + x_7) : ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9)))) > (((7.0 + x_11) > ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))? (7.0 + x_11) : ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))) > ((19.0 + x_19) > ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23))? (19.0 + x_19) : ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23)))? ((7.0 + x_11) > ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))? (7.0 + x_11) : ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))) : ((19.0 + x_19) > ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23))? (19.0 + x_19) : ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23))))? (((6.0 + x_2) > ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))? (6.0 + x_2) : ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))) > ((13.0 + x_7) > ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9))? (13.0 + x_7) : ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9)))? ((6.0 + x_2) > ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))? (6.0 + x_2) : ((16.0 + x_5) > (9.0 + x_6)? (16.0 + x_5) : (9.0 + x_6))) : ((13.0 + x_7) > ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9))? (13.0 + x_7) : ((14.0 + x_8) > (13.0 + x_9)? (14.0 + x_8) : (13.0 + x_9)))) : (((7.0 + x_11) > ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))? (7.0 + x_11) : ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))) > ((19.0 + x_19) > ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23))? (19.0 + x_19) : ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23)))? ((7.0 + x_11) > ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))? (7.0 + x_11) : ((9.0 + x_13) > (1.0 + x_15)? (9.0 + x_13) : (1.0 + x_15))) : ((19.0 + x_19) > ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23))? (19.0 + x_19) : ((7.0 + x_21) > (14.0 + x_23)? (7.0 + x_21) : (14.0 + x_23)))));
x_14_ = ((((19.0 + x_2) > ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))? (19.0 + x_2) : ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))) > ((11.0 + x_9) > ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11))? (11.0 + x_9) : ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11)))? ((19.0 + x_2) > ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))? (19.0 + x_2) : ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))) : ((11.0 + x_9) > ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11))? (11.0 + x_9) : ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11)))) > (((16.0 + x_12) > ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))? (16.0 + x_12) : ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))) > ((10.0 + x_21) > ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23))? (10.0 + x_21) : ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23)))? ((16.0 + x_12) > ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))? (16.0 + x_12) : ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))) : ((10.0 + x_21) > ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23))? (10.0 + x_21) : ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23))))? (((19.0 + x_2) > ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))? (19.0 + x_2) : ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))) > ((11.0 + x_9) > ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11))? (11.0 + x_9) : ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11)))? ((19.0 + x_2) > ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))? (19.0 + x_2) : ((4.0 + x_6) > (8.0 + x_7)? (4.0 + x_6) : (8.0 + x_7))) : ((11.0 + x_9) > ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11))? (11.0 + x_9) : ((14.0 + x_10) > (20.0 + x_11)? (14.0 + x_10) : (20.0 + x_11)))) : (((16.0 + x_12) > ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))? (16.0 + x_12) : ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))) > ((10.0 + x_21) > ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23))? (10.0 + x_21) : ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23)))? ((16.0 + x_12) > ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))? (16.0 + x_12) : ((15.0 + x_15) > (15.0 + x_17)? (15.0 + x_15) : (15.0 + x_17))) : ((10.0 + x_21) > ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23))? (10.0 + x_21) : ((7.0 + x_22) > (17.0 + x_23)? (7.0 + x_22) : (17.0 + x_23)))));
x_15_ = ((((8.0 + x_0) > ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))? (8.0 + x_0) : ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))) > ((11.0 + x_4) > ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8))? (11.0 + x_4) : ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8)))? ((8.0 + x_0) > ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))? (8.0 + x_0) : ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))) : ((11.0 + x_4) > ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8))? (11.0 + x_4) : ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8)))) > (((5.0 + x_9) > ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))? (5.0 + x_9) : ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))) > ((18.0 + x_14) > ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19))? (18.0 + x_14) : ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19)))? ((5.0 + x_9) > ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))? (5.0 + x_9) : ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))) : ((18.0 + x_14) > ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19))? (18.0 + x_14) : ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19))))? (((8.0 + x_0) > ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))? (8.0 + x_0) : ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))) > ((11.0 + x_4) > ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8))? (11.0 + x_4) : ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8)))? ((8.0 + x_0) > ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))? (8.0 + x_0) : ((11.0 + x_1) > (7.0 + x_3)? (11.0 + x_1) : (7.0 + x_3))) : ((11.0 + x_4) > ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8))? (11.0 + x_4) : ((6.0 + x_5) > (15.0 + x_8)? (6.0 + x_5) : (15.0 + x_8)))) : (((5.0 + x_9) > ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))? (5.0 + x_9) : ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))) > ((18.0 + x_14) > ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19))? (18.0 + x_14) : ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19)))? ((5.0 + x_9) > ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))? (5.0 + x_9) : ((9.0 + x_11) > (17.0 + x_13)? (9.0 + x_11) : (17.0 + x_13))) : ((18.0 + x_14) > ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19))? (18.0 + x_14) : ((10.0 + x_15) > (3.0 + x_19)? (10.0 + x_15) : (3.0 + x_19)))));
x_16_ = ((((11.0 + x_0) > ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))? (11.0 + x_0) : ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))) > ((6.0 + x_9) > ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13))? (6.0 + x_9) : ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13)))? ((11.0 + x_0) > ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))? (11.0 + x_0) : ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))) : ((6.0 + x_9) > ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13))? (6.0 + x_9) : ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13)))) > (((17.0 + x_14) > ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))? (17.0 + x_14) : ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))) > ((18.0 + x_20) > ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23))? (18.0 + x_20) : ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23)))? ((17.0 + x_14) > ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))? (17.0 + x_14) : ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))) : ((18.0 + x_20) > ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23))? (18.0 + x_20) : ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23))))? (((11.0 + x_0) > ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))? (11.0 + x_0) : ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))) > ((6.0 + x_9) > ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13))? (6.0 + x_9) : ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13)))? ((11.0 + x_0) > ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))? (11.0 + x_0) : ((19.0 + x_5) > (2.0 + x_8)? (19.0 + x_5) : (2.0 + x_8))) : ((6.0 + x_9) > ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13))? (6.0 + x_9) : ((6.0 + x_10) > (18.0 + x_13)? (6.0 + x_10) : (18.0 + x_13)))) : (((17.0 + x_14) > ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))? (17.0 + x_14) : ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))) > ((18.0 + x_20) > ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23))? (18.0 + x_20) : ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23)))? ((17.0 + x_14) > ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))? (17.0 + x_14) : ((2.0 + x_15) > (11.0 + x_17)? (2.0 + x_15) : (11.0 + x_17))) : ((18.0 + x_20) > ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23))? (18.0 + x_20) : ((14.0 + x_21) > (2.0 + x_23)? (14.0 + x_21) : (2.0 + x_23)))));
x_17_ = ((((13.0 + x_1) > ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))? (13.0 + x_1) : ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))) > ((8.0 + x_6) > ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11))? (8.0 + x_6) : ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11)))? ((13.0 + x_1) > ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))? (13.0 + x_1) : ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))) : ((8.0 + x_6) > ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11))? (8.0 + x_6) : ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11)))) > (((5.0 + x_12) > ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))? (5.0 + x_12) : ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))) > ((9.0 + x_18) > ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22))? (9.0 + x_18) : ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22)))? ((5.0 + x_12) > ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))? (5.0 + x_12) : ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))) : ((9.0 + x_18) > ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22))? (9.0 + x_18) : ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22))))? (((13.0 + x_1) > ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))? (13.0 + x_1) : ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))) > ((8.0 + x_6) > ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11))? (8.0 + x_6) : ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11)))? ((13.0 + x_1) > ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))? (13.0 + x_1) : ((15.0 + x_3) > (10.0 + x_4)? (15.0 + x_3) : (10.0 + x_4))) : ((8.0 + x_6) > ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11))? (8.0 + x_6) : ((2.0 + x_9) > (19.0 + x_11)? (2.0 + x_9) : (19.0 + x_11)))) : (((5.0 + x_12) > ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))? (5.0 + x_12) : ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))) > ((9.0 + x_18) > ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22))? (9.0 + x_18) : ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22)))? ((5.0 + x_12) > ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))? (5.0 + x_12) : ((7.0 + x_13) > (8.0 + x_14)? (7.0 + x_13) : (8.0 + x_14))) : ((9.0 + x_18) > ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22))? (9.0 + x_18) : ((7.0 + x_21) > (9.0 + x_22)? (7.0 + x_21) : (9.0 + x_22)))));
x_18_ = ((((6.0 + x_0) > ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))? (6.0 + x_0) : ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))) > ((14.0 + x_5) > ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8))? (14.0 + x_5) : ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8)))? ((6.0 + x_0) > ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))? (6.0 + x_0) : ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))) : ((14.0 + x_5) > ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8))? (14.0 + x_5) : ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8)))) > (((2.0 + x_9) > ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))? (2.0 + x_9) : ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))) > ((10.0 + x_21) > ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23))? (10.0 + x_21) : ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23)))? ((2.0 + x_9) > ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))? (2.0 + x_9) : ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))) : ((10.0 + x_21) > ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23))? (10.0 + x_21) : ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23))))? (((6.0 + x_0) > ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))? (6.0 + x_0) : ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))) > ((14.0 + x_5) > ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8))? (14.0 + x_5) : ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8)))? ((6.0 + x_0) > ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))? (6.0 + x_0) : ((10.0 + x_3) > (1.0 + x_4)? (10.0 + x_3) : (1.0 + x_4))) : ((14.0 + x_5) > ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8))? (14.0 + x_5) : ((8.0 + x_7) > (17.0 + x_8)? (8.0 + x_7) : (17.0 + x_8)))) : (((2.0 + x_9) > ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))? (2.0 + x_9) : ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))) > ((10.0 + x_21) > ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23))? (10.0 + x_21) : ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23)))? ((2.0 + x_9) > ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))? (2.0 + x_9) : ((3.0 + x_15) > (8.0 + x_20)? (3.0 + x_15) : (8.0 + x_20))) : ((10.0 + x_21) > ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23))? (10.0 + x_21) : ((17.0 + x_22) > (1.0 + x_23)? (17.0 + x_22) : (1.0 + x_23)))));
x_19_ = ((((15.0 + x_0) > ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))? (15.0 + x_0) : ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))) > ((7.0 + x_8) > ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11))? (7.0 + x_8) : ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11)))? ((15.0 + x_0) > ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))? (15.0 + x_0) : ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))) : ((7.0 + x_8) > ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11))? (7.0 + x_8) : ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11)))) > (((20.0 + x_12) > ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))? (20.0 + x_12) : ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))) > ((4.0 + x_18) > ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20))? (4.0 + x_18) : ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20)))? ((20.0 + x_12) > ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))? (20.0 + x_12) : ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))) : ((4.0 + x_18) > ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20))? (4.0 + x_18) : ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20))))? (((15.0 + x_0) > ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))? (15.0 + x_0) : ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))) > ((7.0 + x_8) > ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11))? (7.0 + x_8) : ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11)))? ((15.0 + x_0) > ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))? (15.0 + x_0) : ((7.0 + x_3) > (10.0 + x_6)? (7.0 + x_3) : (10.0 + x_6))) : ((7.0 + x_8) > ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11))? (7.0 + x_8) : ((17.0 + x_10) > (3.0 + x_11)? (17.0 + x_10) : (3.0 + x_11)))) : (((20.0 + x_12) > ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))? (20.0 + x_12) : ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))) > ((4.0 + x_18) > ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20))? (4.0 + x_18) : ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20)))? ((20.0 + x_12) > ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))? (20.0 + x_12) : ((8.0 + x_15) > (7.0 + x_17)? (8.0 + x_15) : (7.0 + x_17))) : ((4.0 + x_18) > ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20))? (4.0 + x_18) : ((20.0 + x_19) > (15.0 + x_20)? (20.0 + x_19) : (15.0 + x_20)))));
x_20_ = ((((17.0 + x_5) > ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))? (17.0 + x_5) : ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))) > ((12.0 + x_9) > ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12))? (12.0 + x_9) : ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12)))? ((17.0 + x_5) > ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))? (17.0 + x_5) : ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))) : ((12.0 + x_9) > ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12))? (12.0 + x_9) : ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12)))) > (((14.0 + x_15) > ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))? (14.0 + x_15) : ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))) > ((3.0 + x_19) > ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23))? (3.0 + x_19) : ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23)))? ((14.0 + x_15) > ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))? (14.0 + x_15) : ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))) : ((3.0 + x_19) > ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23))? (3.0 + x_19) : ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23))))? (((17.0 + x_5) > ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))? (17.0 + x_5) : ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))) > ((12.0 + x_9) > ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12))? (12.0 + x_9) : ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12)))? ((17.0 + x_5) > ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))? (17.0 + x_5) : ((6.0 + x_6) > (5.0 + x_7)? (6.0 + x_6) : (5.0 + x_7))) : ((12.0 + x_9) > ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12))? (12.0 + x_9) : ((13.0 + x_10) > (3.0 + x_12)? (13.0 + x_10) : (3.0 + x_12)))) : (((14.0 + x_15) > ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))? (14.0 + x_15) : ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))) > ((3.0 + x_19) > ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23))? (3.0 + x_19) : ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23)))? ((14.0 + x_15) > ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))? (14.0 + x_15) : ((17.0 + x_16) > (10.0 + x_17)? (17.0 + x_16) : (10.0 + x_17))) : ((3.0 + x_19) > ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23))? (3.0 + x_19) : ((18.0 + x_22) > (1.0 + x_23)? (18.0 + x_22) : (1.0 + x_23)))));
x_21_ = ((((15.0 + x_1) > ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))? (15.0 + x_1) : ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))) > ((2.0 + x_6) > ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9))? (2.0 + x_6) : ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9)))? ((15.0 + x_1) > ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))? (15.0 + x_1) : ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))) : ((2.0 + x_6) > ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9))? (2.0 + x_6) : ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9)))) > (((10.0 + x_15) > ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))? (10.0 + x_15) : ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))) > ((9.0 + x_18) > ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23))? (9.0 + x_18) : ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23)))? ((10.0 + x_15) > ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))? (10.0 + x_15) : ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))) : ((9.0 + x_18) > ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23))? (9.0 + x_18) : ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23))))? (((15.0 + x_1) > ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))? (15.0 + x_1) : ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))) > ((2.0 + x_6) > ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9))? (2.0 + x_6) : ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9)))? ((15.0 + x_1) > ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))? (15.0 + x_1) : ((17.0 + x_4) > (19.0 + x_5)? (17.0 + x_4) : (19.0 + x_5))) : ((2.0 + x_6) > ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9))? (2.0 + x_6) : ((19.0 + x_8) > (2.0 + x_9)? (19.0 + x_8) : (2.0 + x_9)))) : (((10.0 + x_15) > ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))? (10.0 + x_15) : ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))) > ((9.0 + x_18) > ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23))? (9.0 + x_18) : ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23)))? ((10.0 + x_15) > ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))? (10.0 + x_15) : ((17.0 + x_16) > (9.0 + x_17)? (17.0 + x_16) : (9.0 + x_17))) : ((9.0 + x_18) > ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23))? (9.0 + x_18) : ((9.0 + x_20) > (12.0 + x_23)? (9.0 + x_20) : (12.0 + x_23)))));
x_22_ = ((((10.0 + x_0) > ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))? (10.0 + x_0) : ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))) > ((14.0 + x_6) > ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8))? (14.0 + x_6) : ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8)))? ((10.0 + x_0) > ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))? (10.0 + x_0) : ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))) : ((14.0 + x_6) > ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8))? (14.0 + x_6) : ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8)))) > (((1.0 + x_9) > ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))? (1.0 + x_9) : ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))) > ((10.0 + x_13) > ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21))? (10.0 + x_13) : ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21)))? ((1.0 + x_9) > ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))? (1.0 + x_9) : ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))) : ((10.0 + x_13) > ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21))? (10.0 + x_13) : ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21))))? (((10.0 + x_0) > ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))? (10.0 + x_0) : ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))) > ((14.0 + x_6) > ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8))? (14.0 + x_6) : ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8)))? ((10.0 + x_0) > ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))? (10.0 + x_0) : ((19.0 + x_2) > (12.0 + x_5)? (19.0 + x_2) : (12.0 + x_5))) : ((14.0 + x_6) > ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8))? (14.0 + x_6) : ((20.0 + x_7) > (3.0 + x_8)? (20.0 + x_7) : (3.0 + x_8)))) : (((1.0 + x_9) > ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))? (1.0 + x_9) : ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))) > ((10.0 + x_13) > ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21))? (10.0 + x_13) : ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21)))? ((1.0 + x_9) > ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))? (1.0 + x_9) : ((8.0 + x_10) > (9.0 + x_11)? (8.0 + x_10) : (9.0 + x_11))) : ((10.0 + x_13) > ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21))? (10.0 + x_13) : ((16.0 + x_16) > (9.0 + x_21)? (16.0 + x_16) : (9.0 + x_21)))));
x_23_ = ((((5.0 + x_0) > ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))? (5.0 + x_0) : ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))) > ((19.0 + x_4) > ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10))? (19.0 + x_4) : ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10)))? ((5.0 + x_0) > ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))? (5.0 + x_0) : ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))) : ((19.0 + x_4) > ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10))? (19.0 + x_4) : ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10)))) > (((18.0 + x_11) > ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))? (18.0 + x_11) : ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))) > ((9.0 + x_19) > ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22))? (9.0 + x_19) : ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22)))? ((18.0 + x_11) > ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))? (18.0 + x_11) : ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))) : ((9.0 + x_19) > ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22))? (9.0 + x_19) : ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22))))? (((5.0 + x_0) > ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))? (5.0 + x_0) : ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))) > ((19.0 + x_4) > ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10))? (19.0 + x_4) : ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10)))? ((5.0 + x_0) > ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))? (5.0 + x_0) : ((10.0 + x_1) > (11.0 + x_3)? (10.0 + x_1) : (11.0 + x_3))) : ((19.0 + x_4) > ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10))? (19.0 + x_4) : ((2.0 + x_9) > (13.0 + x_10)? (2.0 + x_9) : (13.0 + x_10)))) : (((18.0 + x_11) > ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))? (18.0 + x_11) : ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))) > ((9.0 + x_19) > ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22))? (9.0 + x_19) : ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22)))? ((18.0 + x_11) > ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))? (18.0 + x_11) : ((14.0 + x_15) > (3.0 + x_16)? (14.0 + x_15) : (3.0 + x_16))) : ((9.0 + x_19) > ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22))? (9.0 + x_19) : ((1.0 + x_20) > (17.0 + x_22)? (1.0 + x_20) : (17.0 + x_22)))));
x_0 = x_0_;
x_1 = x_1_;
x_2 = x_2_;
x_3 = x_3_;
x_4 = x_4_;
x_5 = x_5_;
x_6 = x_6_;
x_7 = x_7_;
x_8 = x_8_;
x_9 = x_9_;
x_10 = x_10_;
x_11 = x_11_;
x_12 = x_12_;
x_13 = x_13_;
x_14 = x_14_;
x_15 = x_15_;
x_16 = x_16_;
x_17 = x_17_;
x_18 = x_18_;
x_19 = x_19_;
x_20 = x_20_;
x_21 = x_21_;
x_22 = x_22_;
x_23 = x_23_;
}
return 0;
}
|
the_stack_data/139434.c | // Copyright (c) Open Enclave SDK contributors.
// Licensed under the MIT License.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#define BUFFER_SIZE 13
int create_listener_socket(uint16_t port)
{
int ret = -1;
int sock = -1;
const int opt = 1;
const socklen_t n = sizeof(opt);
struct sockaddr_in addr;
const int backlog = 10;
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
goto done;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, n) != 0)
goto done;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
addr.sin_port = htons(port);
if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) != 0)
goto done;
if (listen(sock, backlog) != 0)
goto done;
ret = sock;
sock = -1;
done:
if (sock != -1)
close(sock);
return ret;
}
typedef struct _client
{
int sock;
uint8_t* data;
size_t size;
} client_t;
#define MAX_CLIENTS 8
typedef struct _clients
{
client_t data[MAX_CLIENTS];
size_t size;
} clients_t;
client_t* find_client(clients_t* clients, int sock)
{
for (size_t i = 0; i < clients->size; i++)
{
if (clients->data[i].sock == sock)
return &clients->data[i];
}
/* Not found */
return NULL;
}
int client_append(client_t* client, const void* data, size_t size)
{
size_t n = client->size + size;
if (!(client->data = realloc(client->data, n)))
return -1;
memcpy(client->data + client->size, data, size);
client->size = n;
return 0;
}
int client_remove_leading(client_t* client, size_t size)
{
if (size > client->size)
return -1;
size_t n = client->size - size;
memcpy(client->data, client->data + size, n);
client->size -= size;
return 0;
}
static int set_blocking(int sock, bool blocking)
{
int flags;
if ((flags = fcntl(sock, F_GETFL, 0)) == -1)
return -1;
if (blocking)
flags &= ~O_NONBLOCK;
else
flags |= O_NONBLOCK;
if (fcntl(sock, F_SETFL, flags) == -1)
return -1;
return 0;
}
static int add_events(int epfd, int sock, uint32_t events)
{
int r;
struct epoll_event ev = {.data.fd = sock, .events = events};
return epoll_ctl(epfd, EPOLL_CTL_ADD, sock, &ev);
}
static int mod_events(int epfd, int sock, uint32_t events)
{
int r;
struct epoll_event ev = {.data.fd = sock, .events = events};
return epoll_ctl(epfd, EPOLL_CTL_MOD, sock, &ev);
}
static int del_events(int epfd, int sock)
{
int r;
struct epoll_event ev = {.data.fd = sock, .events = 0};
return epoll_ctl(epfd, EPOLL_CTL_DEL, sock, &ev);
}
void run_server(uint16_t port, size_t num_clients)
{
int lsock;
bool quit = false;
clients_t clients;
size_t num_disconnects = 0;
int epfd;
assert((epfd = epoll_create1(0)) >= 0);
memset(&clients, 0, sizeof(clients));
if ((lsock = create_listener_socket(port)) == -1)
{
assert("create_listener_socket() failed" == NULL);
}
/* Watch for read events on the lsock socket (i.e., connects). */
assert(add_events(epfd, lsock, EPOLLIN) == 0);
while (!quit)
{
client_t* client;
const static int maxevents = MAX_CLIENTS;
struct epoll_event events[maxevents];
int timeout = 1000;
/* Wait for events. */
printf("wait for events...\n");
int n = epoll_wait(epfd, events, maxevents, timeout);
assert(n >= 0);
for (size_t i = 0; i < n; i++)
{
struct epoll_event* event = &events[i];
if (event->events == 0)
continue;
/* Handle client connection. */
if (event->data.fd == lsock)
{
if ((event->events & EPOLLIN))
{
int sock;
if ((sock = accept(lsock, NULL, NULL)) < 0)
assert("accept() failed" == NULL);
printf("accepted connection\n");
client_t client;
client.sock = sock;
client.data = NULL;
client.size = 0;
clients.data[clients.size++] = client;
set_blocking(sock, false);
assert(add_events(epfd, sock, EPOLLIN) == 0);
printf("client %d connect\n", sock);
fflush(stdout);
}
else
{
assert(false);
}
continue;
}
/* Find the client for this event. */
assert((client = find_client(&clients, event->data.fd)));
/* Handle client input. */
if ((event->events & EPOLLIN))
{
/* Read until EAGAIN is encountered. */
for (;;)
{
uint8_t buf[BUFFER_SIZE];
ssize_t n;
errno = 0;
n = recv(client->sock, buf, sizeof(buf), 0);
if (n > 0)
{
printf("client %d input: %zd bytes\n", client->sock, n);
fflush(stdout);
assert(client_append(client, buf, n) == 0);
uint32_t events = EPOLLIN | EPOLLOUT;
assert(mod_events(epfd, client->sock, events) == 0);
}
else if (n == 0)
{
printf("client %d disconnect\n", client->sock);
fflush(stdout);
/* Client disconnect. */
// Be nasty here: keep the closed sock in epoll FD list.
// del_events(epfd, client->sock);
close(client->sock);
client->sock = -1;
num_disconnects++;
if (num_disconnects == num_clients)
{
quit = true;
}
break;
}
else if (errno == EAGAIN)
{
break;
}
else
{
assert(false);
}
}
if (quit)
break;
}
/* Handle client input. */
if (client->sock != -1 && (event->events & EPOLLOUT))
{
/* Write until output is exhausted or EAGAIN encountered. */
for (;;)
{
ssize_t n;
assert(client->size > 0);
errno = 0;
/* Send data to client. */
n = send(client->sock, client->data, client->size, 0);
if (n > 0)
{
printf(
"client %d output: %zd bytes\n", client->sock, n);
fflush(stdout);
assert(client_remove_leading(client, n) == 0);
if (client->size == 0)
{
uint32_t events = EPOLLIN;
mod_events(epfd, event->data.fd, events);
break;
}
}
else if (errno == EAGAIN)
{
break;
}
else
{
assert(false);
}
}
}
}
}
close(lsock);
close(epfd);
}
|
the_stack_data/125140997.c | #include<stdio.h>
union u{
char ch;
int x;
int y;
}uv;
int main(){
uv.ch = 'A';
printf("uv.ch = %c\n",uv.ch);
printf("uv.x = %d\n",uv.x);
uv.x = 17;
printf("uv.x = %d\n",uv.x);
printf("uv.ch = %c\n",uv.ch);
uv.y = 15;
printf("uv.y = %d\n",uv.y);
printf("uv.x = %d\n",uv.x);
printf("uv.ch = %c\n",uv.ch);
return 0;
}
|
the_stack_data/34511676.c | /*
* Math Tools in C
* MULTIPLES
*
* https://afaan.ml/math-tools-in-c
*
* (c) Afaan Bilal (https://google.com/+AfaanBilal)
*
*/
#include <stdio.h>
int main()
{
int a, n, i = 1;
printf("Enter a number: ");
scanf("%d", &a);
printf("Enter the number of multiples required: ");
scanf("%d", &n);
printf("%d multiples of %d :", n, a);
while(i <= n)
{
printf("\n %d x %d = %d", a, i, a * i);
i++;
}
getch();
return 0;
}
|
the_stack_data/57950534.c | main()
{
signed i1;
signed int i2;
signed short i3;
signed short int i4;
signed long i5;
signed long int i6;
signed long long i7;
signed long long int i8;
i1 = 1;
i2 = 2;
i8 = 8;
}
|
the_stack_data/193893098.c | #include <stdio.h>
#include <math.h>
int main(void) {
int n;
scanf("%d", &n);
int arr[n];
arr[0] = 1;
arr[1] = 1;
for (int i = 2; i < n; i++) {
arr[i] = arr[i-1] + arr[i-2];
}
for (int i = n - 1; i >= 0; i--) {
if (i == 0) {
printf("%d\n", arr[i]);
} else {
printf("%d ", arr[i]);
}
}
return 0;
} |
the_stack_data/192331847.c | #include <openssl/opensslconf.h>
#ifdef OPENSSL_FIPS
# include "fips_err.h"
#else
#ifdef OPENSSL_SYS_WINDOWS
static void *dummy=&dummy;
#endif
#endif
|
the_stack_data/70450033.c | #include <stdlib.h>
void *p;
int main()
{
p = malloc(7);
p = 0; // The memory is leaked here.
return 0;
}
|